From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FSL_HELO_FAKE,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69352C07E96 for ; Tue, 13 Jul 2021 09:18:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 518D761375 for ; Tue, 13 Jul 2021 09:18:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234735AbhGMJU4 (ORCPT ); Tue, 13 Jul 2021 05:20:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235018AbhGMJU4 (ORCPT ); Tue, 13 Jul 2021 05:20:56 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B17C0613E9 for ; Tue, 13 Jul 2021 02:18:05 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id p8so29522104wrr.1 for ; Tue, 13 Jul 2021 02:18:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=ewEO5MHGcmAYvogawgNCpQFpb7n+ZIMY7fSG23QfRTM=; b=IPBbiZ2JbktF+haUg2zYgBjGTi9+Mdvb5IEohZtSNIOMef+cZvCtpNlH72FG7q7UCs ibHJFhOu8yjCK7DBREPzXjTAshbnjRkbEzpgm05Mh502bISWJBVIpyd7Y2WgmhE6/B4D dvF6WluGEWJcksqoDZKIKpErB0bqbQ7SusaxDRAZ2I9tfl9b2m0NkJJQooOZj8dX7JM6 U9sEse5FpSAs/N4zrmUGPZuJNRGGgsdXRIryt+MDy1N7X2PY0eZHsO3Co4VQ+lHrn0bw wtndCWrMH84W4mzZ5X7c6IMtitYUTYk6rJkdTeO1XAZlarTqnB0DvVgkOZkH2aQRPOhv YgaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=ewEO5MHGcmAYvogawgNCpQFpb7n+ZIMY7fSG23QfRTM=; b=m+f0d8/WfrjVisC8GgEbhCzwYIcmICYmpibom5iNBz68QaQGdsWLO2q85ZBYhNMyZn vrg0J1/dYAy4bHawkhafCh9b4EWlVpnuNZwKiSXatPQHCMchsUZ1F/87w9zEu7BOio9G BU2pGoIwgaQ4exYZHiThJer7b6+t8eG41AkpkEr0eKZL02ZOrMkhzt3iCr9dyvBjc7l/ mhQF4SYOkIOgqeBYPZ1z5GSAQoamv9j5cs+QsYIpQhQtMGibD4DWEi/AIf7t9yq+aTtc e8c+SbG8h81tfhwF3n2cY32dQaQlXGg6uO1GIpi5TqR4GkR1Q+Kq2vFJ3CqLQOFc01/v TyeQ== X-Gm-Message-State: AOAM532Oz2BajeQOEO4fa9F+s/JdtBuatFqrltv+aPoQmz0HIle0YqQ3 V5poGRTiH8M9WZ20PaYQz5SM3A== X-Google-Smtp-Source: ABdhPJxk+wHbMBSyJZq1DnAP6a6eJsWWNd4mXYLV79Ryi/iwYbkATYfbBhs56+4Bzqmr4OxnR8T23g== X-Received: by 2002:a5d:63ca:: with SMTP id c10mr4323761wrw.163.1626167884123; Tue, 13 Jul 2021 02:18:04 -0700 (PDT) Received: from google.com ([109.180.115.218]) by smtp.gmail.com with ESMTPSA id o3sm17061852wrw.56.2021.07.13.02.18.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 02:18:03 -0700 (PDT) Date: Tue, 13 Jul 2021 10:18:01 +0100 From: Lee Jones To: Emil Renner Berthing Cc: Rob Herring , Sebastian Reichel , "Andrew F. Davis" , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 2/3] mfd: tps65086: Make interrupt line optional Message-ID: References: <20210625224744.1020108-1-kernel@esmil.dk> <20210625224744.1020108-3-kernel@esmil.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210625224744.1020108-3-kernel@esmil.dk> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Sat, 26 Jun 2021, Emil Renner Berthing wrote: > The BeagleV Starlight v0.9 board[1] doesn't have the IRQB line routed to > the SoC, but it is still useful to be able to reach the PMIC over I2C What is still useful? The GPIO and Regulator drivers? > for the other functionality it provides. > > [1] https://github.com/beagleboard/beaglev-starlight > > Signed-off-by: Emil Renner Berthing > --- > .../devicetree/bindings/mfd/ti,tps65086.yaml | 3 --- > drivers/mfd/tps65086.c | 21 ++++++++++--------- > 2 files changed, 11 insertions(+), 13 deletions(-) > > diff --git a/Documentation/devicetree/bindings/mfd/ti,tps65086.yaml b/Documentation/devicetree/bindings/mfd/ti,tps65086.yaml > index ba638bd10a58..4b629fcc0df9 100644 > --- a/Documentation/devicetree/bindings/mfd/ti,tps65086.yaml > +++ b/Documentation/devicetree/bindings/mfd/ti,tps65086.yaml > @@ -87,9 +87,6 @@ additionalProperties: false > required: > - compatible > - reg > - - interrupts > - - interrupt-controller > - - '#interrupt-cells' I can't say that I've been keeping up with the latest DT binding changes, but shouldn't these lines be relocated into some kind of optional listing? Or are optional properties omitted from documentation? > - gpio-controller > - '#gpio-cells' > - regulators > diff --git a/drivers/mfd/tps65086.c b/drivers/mfd/tps65086.c > index 341466ef20cc..cc3478ee9a64 100644 > --- a/drivers/mfd/tps65086.c > +++ b/drivers/mfd/tps65086.c > @@ -100,29 +100,30 @@ static int tps65086_probe(struct i2c_client *client, > (char)((version & TPS65086_DEVICEID_OTP_MASK) >> 4) + 'A', > (version & TPS65086_DEVICEID_REV_MASK) >> 6); > > - ret = regmap_add_irq_chip(tps->regmap, tps->irq, IRQF_ONESHOT, 0, > - &tps65086_irq_chip, &tps->irq_data); > - if (ret) { > - dev_err(tps->dev, "Failed to register IRQ chip\n"); > - return ret; > + if (tps->irq > 0) { Are you sure that the 0th line is not a valid IRQ? > + ret = regmap_add_irq_chip(tps->regmap, tps->irq, IRQF_ONESHOT, 0, > + &tps65086_irq_chip, &tps->irq_data); > + if (ret) { > + dev_err(tps->dev, "Failed to register IRQ chip\n"); > + return ret; > + } > } > > ret = mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, tps65086_cells, > ARRAY_SIZE(tps65086_cells), NULL, 0, > regmap_irq_get_domain(tps->irq_data)); > - if (ret) { > + if (ret && tps->irq > 0) > regmap_del_irq_chip(tps->irq, tps->irq_data); > - return ret; > - } > > - return 0; > + return ret; > } > > static int tps65086_remove(struct i2c_client *client) > { > struct tps65086 *tps = i2c_get_clientdata(client); > > - regmap_del_irq_chip(tps->irq, tps->irq_data); > + if (tps->irq > 0) > + regmap_del_irq_chip(tps->irq, tps->irq_data); > > return 0; > } -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog