Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1767905rdh; Sat, 28 Oct 2023 06:31:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtllS7evQupznqniTMoOf8DT9CK+GMtdle1yHEMCAuyvTNzxOwEKMtMrs6GUOlaDQfVTrk X-Received: by 2002:a05:6870:134f:b0:1d5:40df:8fb1 with SMTP id 15-20020a056870134f00b001d540df8fb1mr5665898oac.19.1698499895475; Sat, 28 Oct 2023 06:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698499895; cv=none; d=google.com; s=arc-20160816; b=K1u7T6mp2FH89RfokAeSkk5dqEEOtSdABEF0RJAxiYQ6mFzN43yD/pdyxJ06WroZxn V/AMUxGkkfbwZV6f0FQOBW8aSGRphj7JAKxyQU+1F0fberHBG074MGwLWKMt3Pkgm1zV LPSU9qif3JsKoNCmZV2VD44kjyco9XMBRhKgQGRlmdnN/tFpPvvPM4BSQIQ+1Ste4TsJ fNE5ZQ0a5866DGKMhjx2IUueFErxjrVG53KVuh/R9pk+FSnRWVqwqQbth4z3PxsuOJj6 UpUI2acZX63o+RfQ7qxuCOyRlPR/9N2IS1cGuGgM9jiBiUEPQkHxTodYA5k1DLrcMV8F 7QVQ== 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:subject:cc:to:from:date :dkim-signature; bh=fVvTWsG+iJGVnWEhbSFshWlBussUaR9iX2N126jXB5k=; fh=fiUwKbHF4iENAMGk7dJxiT85dhQZ5POxApgFyBDhOl0=; b=Z3A6dvwyRzWSedwEXoSkmMlTX76179NqXfY3+aO3ycCF7wdggWYncX743bFgW5N704 t2DaKzA1Kts0xGxMDFY0i588oMjcIQrRPi0zL+lmYEAsDVLWlkXNcwutRFXdU9mD8jRM 9psJXumDGjeKrXFdfFzzC+P8DllPl73W1f/WRQvvy6d8mhrjuaYn9I0ISHSb1wyI9vO3 EpeLwubIZruyxoqM2uQ63cdtIbViJ5yyCIRJ6NReBM2GNoG2v5GJtqHHogcZ101qr2q7 DNPt6ECNCtm5rzde+ZrBg7PLRe7VO9LtAuOe6qKF3jf9WZEqdgF1IowY5K8lVQYM9ybc 2P+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IQLY0nc5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id p19-20020a056a000b5300b0068fcb7125e1si2475356pfo.242.2023.10.28.06.31.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 06:31:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IQLY0nc5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id A10BD808D281; Sat, 28 Oct 2023 06:30:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbjJ1Nai (ORCPT + 99 others); Sat, 28 Oct 2023 09:30:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjJ1Nai (ORCPT ); Sat, 28 Oct 2023 09:30:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7CA9C0; Sat, 28 Oct 2023 06:30:35 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A968C433C8; Sat, 28 Oct 2023 13:30:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698499835; bh=WkdNOEVhRrZD1+qlH9V+lIII5rGeKECmjOho1RRiBUo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IQLY0nc5Xwk3K6NsD/0KMQetNlS2TIjCGPfgLIEq4SFrtIv3iq2KpgEP18aApLC7Z qb8D8WY8sjP2B3w0XhKfqDh/iKsfHNiTDXMsUEB+a1z/SUZcUiyQToYyvisP0v9pkh G2kXMz8K+jCUmIH5D7orXEtTXxrKV+prlEHTrytwHJ1dcuiATsdDyzHpFYtTVJ/cXU 1s6VE4M7aNxrukL5hNZT0BYkHZSPZBSSsGEwwE10H7pNBIFyxLuVMkwqFzN0Hn0TG+ FTCxDyW7H4F28cu1sHkRhHMNIO6tnumjrdVW44tIFEqGUdjOlqH46CrxtQ7wPtlLuE h//SAI8nuBc8A== Date: Sat, 28 Oct 2023 14:29:44 +0100 From: Jonathan Cameron To: Subhajit Ghosh Cc: Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matti Vaittinen , Andy Shevchenko , Paul Gazzillo , Matt Ranostay , Stefan Windfeldt-Prytz , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] dt-bindings: iio: light: Avago APDS9306 Message-ID: <20231028142944.7e210eb6@jic23-huawei> In-Reply-To: <20231027074545.6055-2-subhajit.ghosh@tweaklogic.com> References: <20231027074545.6055-1-subhajit.ghosh@tweaklogic.com> <20231027074545.6055-2-subhajit.ghosh@tweaklogic.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 28 Oct 2023 06:30:52 -0700 (PDT) On Fri, 27 Oct 2023 18:15:44 +1030 Subhajit Ghosh wrote: > v1 -> v2 > - No change > > v0 -> v1 > - Squashing Avago (Broadcom) APDS9300 and APDS9960 schemas into one as > they look similar > - Adding support for APDS9306 in the same schema file The fact this belongs below the --- has already been mentioned. These first two things are different types of change. Patch 1: Combine bindings. Patch 2: Add new device entry to combined binding Patch 3: Add driver support. > - Adding mandatory interrupt property requirement for APDS9960 as per the > driver's probe method which fails if interrupt bindings are not defined. > Both APDS9300 and APDS9306 (this patch set) supports sensors with and > without hardware interrupt bindings > - In the device tree example, replacing interrupt type number with macro > from irq.h > - Updated the vin to vdd which is the same for all the three sensors > - Used proper "Datasheet:" tags > > Signed-off-by: Subhajit Ghosh > --- > .../bindings/iio/light/avago,apds9300.yaml | 35 ++++++++++++--- > .../bindings/iio/light/avago,apds9960.yaml | 44 ------------------- > 2 files changed, 30 insertions(+), 49 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml > > diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds9300.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds9300.yaml > index 206af44f2c43..7a24a97d0594 100644 > --- a/Documentation/devicetree/bindings/iio/light/avago,apds9300.yaml > +++ b/Documentation/devicetree/bindings/iio/light/avago,apds9300.yaml > @@ -4,17 +4,26 @@ > $id: http://devicetree.org/schemas/iio/light/avago,apds9300.yaml# > $schema: http://devicetree.org/meta-schemas/core.yaml# > > -title: Avago APDS9300 ambient light sensor > +title: Avago Gesture, RGB, ALS and Proximity sensors > > maintainers: > - Jonathan Cameron > + - Matt Ranostay > + - Subhajit Ghosh > > description: | > - Datasheet at https://www.avagotech.com/docs/AV02-1077EN > + Avago (Broadcom) optical and proximity sensors with I2C interfaces. > + Datasheet: https://docs.broadcom.com/doc/AV02-1077EN > + Datasheet: https://docs.broadcom.com/doc/AV02-4191EN > + Datasheet: https://docs.broadcom.com/doc/AV02-4755EN > > properties: > compatible: > - const: avago,apds9300 > + oneOf: Don't need the oneOf. Lots of examples of this in tree! enum: - ... > + - enum: > + - avago,apds9300 > + - avago,apds9306 > + - avago,apds9960 > > reg: > maxItems: 1 > @@ -22,14 +31,30 @@ properties: > interrupts: > maxItems: 1 > > -additionalProperties: false > + vdd-supply: true > > required: > - compatible > - reg > > +allOf: > + - $ref: ../common.yaml# > + - if: > + properties: > + compatible: > + contains: > + enum: > + - avago,apds9960 > + then: > + required: > + - interrupts It is very rare that a binding for a sensor 'requires' interrupts. They are more commonly a nice to have. Note that the driver failing doesn't mean the binding should change. Unless there is a very strong requirement (polling can't be done for some reason - or device is largely pointless with out the interrupt) then we normally keep it optional in the binding. Someone can fix the driver later if they care about it! Also, if this fix is correct, it needs to be a precursor patch handing just this tightening of the binding. The rest of the series then goes on top of that. Jonathan > + > +additionalProperties: false > + > examples: > - | > + #include > + > i2c { > #address-cells = <1>; > #size-cells = <0>; > @@ -38,7 +63,7 @@ examples: > compatible = "avago,apds9300"; > reg = <0x39>; > interrupt-parent = <&gpio2>; > - interrupts = <29 8>; > + interrupts = <29 IRQ_TYPE_EDGE_FALLING>; > }; > }; > ... > diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml > deleted file mode 100644 > index f06e0fda5629..000000000000 > --- a/Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml > +++ /dev/null > @@ -1,44 +0,0 @@ > -# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > -%YAML 1.2 > ---- > -$id: http://devicetree.org/schemas/iio/light/avago,apds9960.yaml# > -$schema: http://devicetree.org/meta-schemas/core.yaml# > - > -title: Avago APDS9960 gesture/RGB/ALS/proximity sensor > - > -maintainers: > - - Matt Ranostay > - > -description: | > - Datasheet at https://www.avagotech.com/docs/AV02-4191EN > - > -properties: > - compatible: > - const: avago,apds9960 > - > - reg: > - maxItems: 1 > - > - interrupts: > - maxItems: 1 > - > -additionalProperties: false > - > -required: > - - compatible > - - reg > - > -examples: > - - | > - i2c { > - #address-cells = <1>; > - #size-cells = <0>; > - > - light-sensor@39 { > - compatible = "avago,apds9960"; > - reg = <0x39>; > - interrupt-parent = <&gpio1>; > - interrupts = <16 1>; > - }; > - }; > -...