Message ID | 20230308090219.12710-2-clamor95@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp222155wrd; Wed, 8 Mar 2023 01:09:10 -0800 (PST) X-Google-Smtp-Source: AK7set8Q1r10Gn5Psaevt7dYy+eoBg7UgxymdORQiHzoGSR1/T0YIXJH4zBkwXCdQJtCh1ohCf4T X-Received: by 2002:a17:902:c94b:b0:19c:f84b:58be with SMTP id i11-20020a170902c94b00b0019cf84b58bemr20594190pla.3.1678266549998; Wed, 08 Mar 2023 01:09:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678266549; cv=none; d=google.com; s=arc-20160816; b=My3dGw/NNnZQOdJn8oCJPmwB5WiRhzNAwIMhTcLerUCN4HgmDAhdwBTwxzHCOTTJTr KQYvRMBHW+md7wjS19Z9qZlVKFpUMvsLveI9DfH4rmRHEsx9iDq+zC5cIPGcV60GRF7q YbU5IcE3qN0rq22GXLl1ifi8oDh2jvVyWIYEF5qMTvGSuIemSg5P+mOjjVAzUdDGhHcL Fe5+g+ALDh+ySFiRSEIGBWJwH9pZ1QDJ+WkvEfAN2aimmEh60Pb6GtmMfGEzzYcaHqwx 9C16S2ScZ/CDa1HNl4G88aCgn/5ARjrwPftCIbSkpd858dSJuF9HiLmo61c5bW7S4Jep EEOg== 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=0Lzu9bzEGqcu2KmMdZnQFwDXwVJpSW2jAVAy1BeLRyY=; b=0kAs3MQ6ElGfg1gVpP+uZiaFXx1mG+ayVd0YBEzoT+yeN7tg2H5YXCCvxNCrZe2FU6 ulJDQORGPIGgOWdCzCcUZhHf8aoh7G8UGcVCW1sX4TG5lXXvQ5FsxKSF/dbmFIypYUWX yPNKF8JsXIZcEPxiVeKayvHhZcER33udL5dnPlWRHoIs6skbg/kkD0oJ3oIhUu5yOFUl MV0M2KPNyMz21nIQEqyHAwZFUNO647Kx7uARJBjxcnbruS13wO6OCoWaMhTGM9BLjso2 i2MKzhvRNXd/NYHRzF/PJxiv6mkRzLzxzpEMo/pMyGHJ2hB/AtCjEw530Oi8xYbBM+MI lfTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oeXzRPdG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 4-20020a170902c10400b0019e6185116esi13398723pli.274.2023.03.08.01.08.57; Wed, 08 Mar 2023 01:09:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oeXzRPdG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230214AbjCHJCi (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Wed, 8 Mar 2023 04:02:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229676AbjCHJCc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 8 Mar 2023 04:02:32 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEFAC9609B; Wed, 8 Mar 2023 01:02:29 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id s11so62761658edy.8; Wed, 08 Mar 2023 01:02:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678266148; 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=0Lzu9bzEGqcu2KmMdZnQFwDXwVJpSW2jAVAy1BeLRyY=; b=oeXzRPdGt3zyzDQNXPT58ahdDhTnpdodkZqd2euRE/JqRnO6nI/tJGwG9l9ywshUxF Dt40RzzWSWmXyjpSzpPo4Wew+2j0baFjasmMaYRMGAeUCq0/wcYC/Jjz3L/jdqFdj6Qr XMVaWk8rIdsQr6Qm+terGnqznbaxgdTfdDLabXOI8lLdElv0vRATTL/vcieH8Y3lNEFe qAHpP2h07WFzjjH81BTP/nORscSehU1S1uwCk4nRNZ/BSSdYAjCgaFnzz/wOcaQKaZNw F9/hlRwDGw8oC20bmkBo85YCfPXd3Q1+vLippv9+gMPo3yYlRkyp5SSMKmGkwVK2DN/j RgAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678266148; 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=0Lzu9bzEGqcu2KmMdZnQFwDXwVJpSW2jAVAy1BeLRyY=; b=Uk0LZaVFlRYv/2UThrwh2L1TlQg98G28f+aVtLeNek3pd15V1aa0iFr9eNe+iz059E twjaVfELuepjoSwXObnLwNOcXszwR2WibN9S3EpOocieFEczJivAYHXH9rFsA9pBUSEy 3mdRp1y7M8YlP+9fN5cl6m4b2eLT0zzrvM03ueqd5STPw7zdj90zQIhUGoVamhwP7oMn zhFSm/iN2JUQ2/wqL2St1BPQtECUn5dHV3LVTM36lJzUVk0Zwp2bamreKp1dXFkyx1+3 NloTt8Gd2TpktfLWcdv+WvZYHZ+xXVl3lFQWMCK5DpIZw7JEw7BTWQvDn75obnd14c8P 3CcA== X-Gm-Message-State: AO0yUKV5V4aqxOYefMfEjLFvN+c+qURsOA/pg4vRovj+krJuFyDr2gKh DlEUBBGgfmsPib0HxEEip+I= X-Received: by 2002:a17:906:fca8:b0:8ae:707:e129 with SMTP id qw8-20020a170906fca800b008ae0707e129mr16319860ejb.19.1678266148422; Wed, 08 Mar 2023 01:02:28 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id j7-20020a17090643c700b008caaae1f1e1sm7153709ejn.110.2023.03.08.01.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 01:02:28 -0800 (PST) From: Svyatoslav Ryhel <clamor95@gmail.com> To: Jonathan Cameron <jic23@kernel.org>, Lars-Peter Clausen <lars@metafoo.de>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Derek Kiernan <derek.kiernan@xilinx.com>, Dragan Cvetic <dragan.cvetic@xilinx.com>, Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Svyatoslav Ryhel <clamor95@gmail.com>, Dmitry Osipenko <dmitry.osipenko@collabora.com> Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/4] dt-bindings: iio: light: add apds990x binding Date: Wed, 8 Mar 2023 11:02:16 +0200 Message-Id: <20230308090219.12710-2-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230308090219.12710-1-clamor95@gmail.com> References: <20230308090219.12710-1-clamor95@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759790026155742152?= X-GMAIL-MSGID: =?utf-8?q?1759790026155742152?= |
Series |
Update APDS990x ALS to support IIO
|
|
Commit Message
Svyatoslav Ryhel
March 8, 2023, 9:02 a.m. UTC
Add dt-binding for apds990x ALS/proximity sensor.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
.../bindings/iio/light/avago,apds990x.yaml | 76 +++++++++++++++++++
1 file changed, 76 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml
Comments
On Wed, 08 Mar 2023 11:02:16 +0200, Svyatoslav Ryhel wrote: > Add dt-binding for apds990x ALS/proximity sensor. > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> > --- > .../bindings/iio/light/avago,apds990x.yaml | 76 +++++++++++++++++++ > 1 file changed, 76 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13): yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/light/avago,apds990x.example.dtb: light-sensor@39: 'interrupt' is a required property From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230308090219.12710-2-clamor95@gmail.com The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
On Wed, 8 Mar 2023 11:02:16 +0200 Svyatoslav Ryhel <clamor95@gmail.com> wrote: > Add dt-binding for apds990x ALS/proximity sensor. > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> > --- > .../bindings/iio/light/avago,apds990x.yaml | 76 +++++++++++++++++++ I'm not a fan of wild cards. It breaks far too often. Can we name this instead after a particular supported part - same for compatible. I'm not sure what parts are supported by this, but you may want multiple compatibles. > 1 file changed, 76 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml > > diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml > new file mode 100644 > index 000000000000..9b47e13f88e3 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml > @@ -0,0 +1,76 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/light/avago,apds990x.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Avago APDS990x ALS and proximity sensor > + > +maintainers: > + - Samu Onkalo <samu.p.onkalo@nokia.com> > + > +description: | > + APDS990x is a combined ambient light and proximity sensor. ALS and > + proximity functionality are highly connected. ALS measurement path > + must be running while the proximity functionality is enabled. > + > +properties: > + compatible: > + const: avago,apds990x > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + vdd-supply: true > + vled-supply: true > + > + avago,pdrive: > + $ref: /schemas/types.yaml#/definitions/uint32 > + minimum: 0 > + maximum: 32 > + description: | > + Drive value used in configuring control register. Is this something where there is a reasonable default? If so I'd prefer it was optional so that the device is easier to use without needing firmware description. > + > + avago,ppcount: > + $ref: /schemas/types.yaml#/definitions/uint32 > + minimum: 0 > + maximum: 32 > + description: | > + Number of pulses used for proximity sensor calibration. Same for this - if there is a reasonable default it would be good to have that specified. > + > +additionalProperties: false > + > +required: > + - compatible > + - reg > + - interrupt It would nice to relax the need for an interrupt if the device is still useable with timeouts etc. Board folk have a habit of deciding they don't need to wire up interrupts. We can relax that a later date though if you prefer not to do it now. > + - vdd-supply > + - vled-supply Whilst true that the supplies need to be connected, that doesn't mean they need to provided in the device tree binding. If they are always powered up I think we can fallback to stub regulators. > + - avago,pdrive > + - avago,ppcount > + > +examples: > + - | > + #include <dt-bindings/interrupt-controller/irq.h> > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + light-sensor@39 { > + compatible = "avago,apds990x"; > + reg = <0x39>; > + > + interrupt-parent = <&gpio>; > + interrupts = <82 IRQ_TYPE_EDGE_RISING>; > + > + vdd-supply = <&vdd_3v0_proxi>; > + vled-supply = <&vdd_1v8_sen>; > + > + avago,pdrive = <0x00>; > + avago,ppcount = <0x03>; > + }; > + }; > +...
On 11/03/2023 20:34, Jonathan Cameron wrote: >> + >> +additionalProperties: false >> + >> +required: >> + - compatible >> + - reg >> + - interrupt > It would nice to relax the need for an interrupt if the device is still useable > with timeouts etc. Board folk have a habit of deciding they don't need to wire > up interrupts. We can relax that a later date though if you prefer not to do > it now. >> + - vdd-supply >> + - vled-supply > > Whilst true that the supplies need to be connected, that doesn't > mean they need to provided in the device tree binding. If they are > always powered up I think we can fallback to stub regulators. We can, but others might not. The binding should still require them if they are required for device to work. Mark also made it clear recently: https://lore.kernel.org/all/31ca0ede-012c-4849-bf25-d0492b116681@sirena.org.uk/ https://lore.kernel.org/all/5cd6764c-9b04-42ea-932d-9f14aa465605@sirena.org.uk/ https://lore.kernel.org/all/f6f02138-8ef9-4a33-9b51-0b7cd371230f@sirena.org.uk/ Best regards, Krzysztof
On Sun, 12 Mar 2023 11:47:19 +0100 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > On 11/03/2023 20:34, Jonathan Cameron wrote: > > >> + > >> +additionalProperties: false > >> + > >> +required: > >> + - compatible > >> + - reg > >> + - interrupt > > It would nice to relax the need for an interrupt if the device is still useable > > with timeouts etc. Board folk have a habit of deciding they don't need to wire > > up interrupts. We can relax that a later date though if you prefer not to do > > it now. > >> + - vdd-supply > >> + - vled-supply > > > > Whilst true that the supplies need to be connected, that doesn't > > mean they need to provided in the device tree binding. If they are > > always powered up I think we can fallback to stub regulators. > > We can, but others might not. The binding should still require them if > they are required for device to work. Mark also made it clear recently: > > https://lore.kernel.org/all/31ca0ede-012c-4849-bf25-d0492b116681@sirena.org.uk/ > https://lore.kernel.org/all/5cd6764c-9b04-42ea-932d-9f14aa465605@sirena.org.uk/ > https://lore.kernel.org/all/f6f02138-8ef9-4a33-9b51-0b7cd371230f@sirena.org.uk/ OK. Then there are a lot of bindings to fix. Seems odd to me but meh it's not something I care about. Note this means that we can't have trivial-device.yaml for instance. Ah well, I guess views change or crystallise over time or just differed in the first place. Jonathan > > Best regards, > Krzysztof >
diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml new file mode 100644 index 000000000000..9b47e13f88e3 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml @@ -0,0 +1,76 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/light/avago,apds990x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Avago APDS990x ALS and proximity sensor + +maintainers: + - Samu Onkalo <samu.p.onkalo@nokia.com> + +description: | + APDS990x is a combined ambient light and proximity sensor. ALS and + proximity functionality are highly connected. ALS measurement path + must be running while the proximity functionality is enabled. + +properties: + compatible: + const: avago,apds990x + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vdd-supply: true + vled-supply: true + + avago,pdrive: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 32 + description: | + Drive value used in configuring control register. + + avago,ppcount: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 32 + description: | + Number of pulses used for proximity sensor calibration. + +additionalProperties: false + +required: + - compatible + - reg + - interrupt + - vdd-supply + - vled-supply + - avago,pdrive + - avago,ppcount + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + i2c { + #address-cells = <1>; + #size-cells = <0>; + + light-sensor@39 { + compatible = "avago,apds990x"; + reg = <0x39>; + + interrupt-parent = <&gpio>; + interrupts = <82 IRQ_TYPE_EDGE_RISING>; + + vdd-supply = <&vdd_3v0_proxi>; + vled-supply = <&vdd_1v8_sen>; + + avago,pdrive = <0x00>; + avago,ppcount = <0x03>; + }; + }; +...