Message ID | 20231008154857.24162-2-subhajit.ghosh@tweaklogic.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1424711vqo; Sun, 8 Oct 2023 08:49:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZU47O5t04CAdSj2p9arzEDvZT5GMgeLhtpAW8XzmnusbBT5YZWxLPAZPMF+vEIznsQ1Su X-Received: by 2002:a17:90a:6343:b0:279:104d:1473 with SMTP id v3-20020a17090a634300b00279104d1473mr10650399pjs.45.1696780186949; Sun, 08 Oct 2023 08:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696780186; cv=none; d=google.com; s=arc-20160816; b=odSffthleqToSdMhPoQuak9WiPipdBHvROS0TRbVq5BTBB5CJA7gtyF8MKe2CfoNGy WVlVXhwBP8Il7vnVg86i8XDZJI8GTmH3TAjSY/gdhzTQobxF/j1zsV1gdWeBj00Oy65O W/XBez5sqSR5rwBz2wL69UNeFaX0R9YgIJWUnFpOqmf22GEwki/o5IcCmlqxb8E92Upp C1xzRI+hqbiZlbFkpxKiZolCUkRquzZ0g1ZTRhW3+4Eiv39ZZEwJbzJPmGaE3FmSYwYt 1beFI5CMj+R4/wePWnnnAhpN+e6pW0N1uppuSeJe45Iy8G7uzL+3dlT3i7hnOYOFs/2Q GWbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iNFoZA1zZW25lllOuroNi5vtVqqnAR6Pi3h82umCIA0=; fh=vmV6bERWBx1rcO8Iu/4PU7SIIEQAqowjFItclqa+pak=; b=u47IBriJWU0lBJOra3u+ZYtPyKvj3075C26+wh6ohzQrA2d02Q4c8sfzCtInGYLoVY PCni2p5sVrSLO0A0X139nZu35K5lvcKKDwyupKA4Bw8SRQ5QvnjyvBopXZT4yeFojcxh hiWAKjk7CmKs6YxiKOBSr05a4fU43MwZCWcvFCaKoFON3ZSW3Eg3Vbxui4jU/ELO/4lR ADSiE3NCB+RoXmc4SBcErFLTqPDxzXd38hhBwjMYFX+VnomqWsrVmtKnIuXAGmZKWCVf fyDjLa2/sJMaHt9oYYiUvWunmcvT1AmrED64zhk7NcHGeQhq8lIDYF79xjOdFBuxu99L bd8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tweaklogic.com header.s=google header.b=K6A4z8ac; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id fv18-20020a17090b0e9200b00276ea6d9ac3si9829322pjb.182.2023.10.08.08.49.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 08:49:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@tweaklogic.com header.s=google header.b=K6A4z8ac; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E61A68059E70; Sun, 8 Oct 2023 08:49:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344912AbjJHPtc (ORCPT <rfc822;ezelljr.billy@gmail.com> + 18 others); Sun, 8 Oct 2023 11:49:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344921AbjJHPtb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 8 Oct 2023 11:49:31 -0400 Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CAA9EB for <linux-kernel@vger.kernel.org>; Sun, 8 Oct 2023 08:49:29 -0700 (PDT) Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-1e1e25ab32bso2637387fac.1 for <linux-kernel@vger.kernel.org>; Sun, 08 Oct 2023 08:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tweaklogic.com; s=google; t=1696780168; x=1697384968; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iNFoZA1zZW25lllOuroNi5vtVqqnAR6Pi3h82umCIA0=; b=K6A4z8acZrpTvMv+zgaMPMtkTpBQM9Rm36Sc6Q4X/2rgtkJ7QHbOMDPjs1dTYLWc/r 6EuyDKs7c/QMHb+OEdxnLkYfuUbXihSqnhWq4RDA7zR3Oa+RW5CGr3kWkG+yyqvHi4gu ElG+NUzEEOPaYpcCHrZIhaPp8CEtHfuqgh7J+PJMQG4EBx16c81DrGZ8ho/QtjZyCThe jEodg4SkgP59Bgi5jzcsdETpvHW1KJnab40q4OzeOegosGRSCjmMUYoQ/CfoJQTXtBq+ 5yf8JbPWqkt2QJmjXDn21JkIWVBmEuk1+Y1UXdzs195SeXxhRFm8UAEMpWut6U7r5FjW AYbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696780168; x=1697384968; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iNFoZA1zZW25lllOuroNi5vtVqqnAR6Pi3h82umCIA0=; b=dvrNlUzzuSlfXs55KARK02FuZLGbMsUKVQzs4YVcvkB+X0ewd7ej3YYPA/C8R+qkAD ZSLeX7FK+eVMzcNJnXfzubLzStSMHAKqUKMeFuu1Y8j5TKBc+56Bd+qxiWif6ZKenlPA Mnrg3kcTsha2Fs+V8hxmmZv4VJBIbQtwOarPhnycPs3TOSK9Bd3caB1uco127063rSRw POOvOioYEJAkU+j3b8zozo19fAws6b0IhwN4wHO2CKRtAz8Uv1wNVtQQQYtjlAsSj3jE e4E0irFqoOsjHybn//nZm1R2d+xTdynK/mNLUhVvwIN4vk4TkCbGE11UN8wowy6s3Qpl 3OGQ== X-Gm-Message-State: AOJu0YyQPh2BYcXPwTx3wo1J1nmW/F5SGkGoe8VwZDg6T/yRtletBJOg jZnslkMPs64Kibg8aUhr3nUNKQ== X-Received: by 2002:a05:6870:58e:b0:1bf:e1e9:a320 with SMTP id m14-20020a056870058e00b001bfe1e9a320mr16195606oap.13.1696780168680; Sun, 08 Oct 2023 08:49:28 -0700 (PDT) Received: from localhost.localdomain (2403-580d-82f4-0-65d1-409f-dd8-4287.ip6.aussiebb.net. [2403:580d:82f4:0:65d1:409f:dd8:4287]) by smtp.gmail.com with ESMTPSA id n26-20020aa7905a000000b0068fc48fcaa8sm4723374pfo.155.2023.10.08.08.49.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 08:49:28 -0700 (PDT) From: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> To: Jonathan Cameron <jic23@kernel.org>, Lars-Peter Clausen <lars@metafoo.de>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Matti Vaittinen <mazziesaccount@gmail.com> Cc: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Gazzillo <paul@pgazz.com>, Conor Dooley <conor+dt@kernel.org>, Stefan Windfeldt-Prytz <stefan.windfeldt-prytz@axis.com> Subject: [PATCH 1/2] dt-bindings: iio: light: Avago APDS9306 Date: Mon, 9 Oct 2023 02:18:56 +1030 Message-Id: <20231008154857.24162-2-subhajit.ghosh@tweaklogic.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231008154857.24162-1-subhajit.ghosh@tweaklogic.com> References: <20231008154857.24162-1-subhajit.ghosh@tweaklogic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 08 Oct 2023 08:49:45 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779202981503929511 X-GMAIL-MSGID: 1779202981503929511 |
Series |
Support for Avago APDS9306 Ambient Light Sensor
|
|
Commit Message
Subhajit Ghosh
Oct. 8, 2023, 3:48 p.m. UTC
Add devicetree bindings for Avago APDS9306 Ambient Light Sensor.
Signed-off-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>
---
.../bindings/iio/light/avago,apds9306.yaml | 49 +++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml
Comments
On 08/10/2023 17:48, Subhajit Ghosh wrote: > Add devicetree bindings for Avago APDS9306 Ambient Light Sensor. > > Signed-off-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> > --- > .../bindings/iio/light/avago,apds9306.yaml | 49 +++++++++++++++++++ > 1 file changed, 49 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml > > diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml > new file mode 100644 > index 000000000000..e8bb897782fc > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml > @@ -0,0 +1,49 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/light/avago,apds9306.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Avago APDS9306 Ambient Light Sensor > + > +maintainers: > + - Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> > + > +description: > + Datasheet at https://docs.broadcom.com/doc/AV02-4755EN This is exactly the same as two other Avago devices. It should be squashed - first two device schemas squashed, then add new device support. Also, the supply is not vin, but vdd. Best regards, Krzysztof
>> +description: >> + Datasheet at https://docs.broadcom.com/doc/AV02-4755EN > > This is exactly the same as two other Avago devices. It should be > squashed - first two device schemas squashed, then add new device support. > > Also, the supply is not vin, but vdd. > Yes, they look similar. I will combine them all in a single yaml file in the next revision. Thank you Krzysztof. Regards, Subhajit Ghosh
On 10/8/23 18:48, Subhajit Ghosh wrote: > Add devicetree bindings for Avago APDS9306 Ambient Light Sensor. > > Signed-off-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> > --- > .../bindings/iio/light/avago,apds9306.yaml | 49 +++++++++++++++++++ > 1 file changed, 49 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml > > diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml > new file mode 100644 > index 000000000000..e8bb897782fc > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml > @@ -0,0 +1,49 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/light/avago,apds9306.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Avago APDS9306 Ambient Light Sensor > + > +maintainers: > + - Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> > + > +description: > + Datasheet at https://docs.broadcom.com/doc/AV02-4755EN > + > +properties: > + compatible: > + const: avago,apds9306 I see the driver supports two different variants of this IC, differentiated by the part-ID register. Variants are named as apds9306 and apds9306-065. I wonder if we could/should have different compatibles for them? Yours, -- Matti
On 10/10/23 19:22, Matti Vaittinen wrote: >> +properties: >> + compatible: >> + const: avago,apds9306 > > I see the driver supports two different variants of this IC, differentiated by the part-ID register. Variants are named as apds9306 and apds9306-065. I wonder if we could/should have different compatibles for them? > Yes, we can. It makes sense. I'll implement that. Regards, Subhajit Ghosh
On Mon, 9 Oct 2023 02:18:56 +1030 Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> wrote: > Add devicetree bindings for Avago APDS9306 Ambient Light Sensor. > > Signed-off-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> > --- > .../bindings/iio/light/avago,apds9306.yaml | 49 +++++++++++++++++++ > 1 file changed, 49 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml > > diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml > new file mode 100644 > index 000000000000..e8bb897782fc > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml > @@ -0,0 +1,49 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/light/avago,apds9306.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Avago APDS9306 Ambient Light Sensor > + > +maintainers: > + - Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> > + > +description: > + Datasheet at https://docs.broadcom.com/doc/AV02-4755EN > + > +properties: > + compatible: > + const: avago,apds9306 > + > + reg: > + maxItems: 1 > + > + vin-supply: > + description: Regulator supply to the sensor Why vin? It seems to be vdd on the datasheet. We tend to match the datasheet naming for power supplies as that is normally what is seen on circuit board schematics. > + > + interrupts: > + maxItems: 1 > + > +required: > + - compatible > + - reg > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/interrupt-controller/irq.h> > + > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + light-sensor@52 { > + compatible = "avago,apds9306"; > + reg = <0x52>; > + interrupt-parent = <&gpiof>; > + interrupts = <6 IRQ_TYPE_LEVEL_LOW>; > + }; > + }; > +...
On Tue, 10 Oct 2023 22:48:43 +1030 Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> wrote: > On 10/10/23 19:22, Matti Vaittinen wrote: > > >> +properties: > >> + compatible: > >> + const: avago,apds9306 > > > > I see the driver supports two different variants of this IC, differentiated by the part-ID register. Variants are named as apds9306 and apds9306-065. I wonder if we could/should have different compatibles for them? > > > > Yes, we can. It makes sense. I'll implement that. We could. The reason to do so is that we might in future want to use fallback compatibles. So we want to allow a new DT to work with older kernel by saying - I have a new device, but it is fully compatible with this earlier one. In those cases we check the ID as your driver current does, but just print a warning that we aren't sure what the device is so are going with what the DT told us to fall back to. Jonathan > > Regards, > Subhajit Ghosh >
On Tue, Oct 10, 2023 at 11:52:28AM +0300, Matti Vaittinen wrote: > On 10/8/23 18:48, Subhajit Ghosh wrote: > > Add devicetree bindings for Avago APDS9306 Ambient Light Sensor. > > > > Signed-off-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> > > --- > > .../bindings/iio/light/avago,apds9306.yaml | 49 +++++++++++++++++++ > > 1 file changed, 49 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml > > > > diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml > > new file mode 100644 > > index 000000000000..e8bb897782fc > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml > > @@ -0,0 +1,49 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/iio/light/avago,apds9306.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Avago APDS9306 Ambient Light Sensor > > + > > +maintainers: > > + - Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> > > + > > +description: > > + Datasheet at https://docs.broadcom.com/doc/AV02-4755EN > > + > > +properties: > > + compatible: > > + const: avago,apds9306 > > I see the driver supports two different variants of this IC, differentiated > by the part-ID register. Variants are named as apds9306 and apds9306-065. I > wonder if we could/should have different compatibles for them? If 1 compatible is sufficient to know how to power on both devices and read the part-ID register, then no need for different compatibles. Rob
On 11/10/23 02:49, Rob Herring wrote: >>> + >>> +properties: >>> + compatible: >>> + const: avago,apds9306 >> >> I see the driver supports two different variants of this IC, differentiated >> by the part-ID register. Variants are named as apds9306 and apds9306-065. I >> wonder if we could/should have different compatibles for them? > > If 1 compatible is sufficient to know how to power on both devices and > read the part-ID register, then no need for different compatibles. > > Rob Understood. Thanks Rob. Regards, Subhajit Ghosh
On 11/10/23 00:21, Jonathan Cameron wrote: >> + >> + reg: >> + maxItems: 1 >> + >> + vin-supply: >> + description: Regulator supply to the sensor > > Why vin? It seems to be vdd on the datasheet. > We tend to match the datasheet naming for power supplies as that is normally > what is seen on circuit board schematics. Got it, I'll fix it. Thanks for looking into it. Regards, Subhajit Ghosh
diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml new file mode 100644 index 000000000000..e8bb897782fc --- /dev/null +++ b/Documentation/devicetree/bindings/iio/light/avago,apds9306.yaml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/light/avago,apds9306.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Avago APDS9306 Ambient Light Sensor + +maintainers: + - Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> + +description: + Datasheet at https://docs.broadcom.com/doc/AV02-4755EN + +properties: + compatible: + const: avago,apds9306 + + reg: + maxItems: 1 + + vin-supply: + description: Regulator supply to the sensor + + interrupts: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + light-sensor@52 { + compatible = "avago,apds9306"; + reg = <0x52>; + interrupt-parent = <&gpiof>; + interrupts = <6 IRQ_TYPE_LEVEL_LOW>; + }; + }; +...