Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp980228rdh; Fri, 27 Oct 2023 00:46:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDus854LqLB3yxeAtORSK1uv/Lkwk1ieq+kGsUeR8JUiddKl++ijW5e3sGcTPXjMWfkkm3 X-Received: by 2002:a05:620a:5223:b0:778:9210:ceb3 with SMTP id dc35-20020a05620a522300b007789210ceb3mr1809008qkb.46.1698392777408; Fri, 27 Oct 2023 00:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698392777; cv=none; d=google.com; s=arc-20160816; b=wx5Ll6cdcBqwiZk9dXL/I/4n/jnowa8d3j6ZDhLg+5UPiDkqRx3/h6oA/5C4iGTonc f83bwo3Pw0kvobUoQSyBSkEr0wL968bLfVufx9T+GzuhOr97FG8Y1M+E3RmXFvnHc4hZ 8Da/WxdUJHTTJBrqnttz6Zp5i4uohRyOt+7i/M9W469pxQBrOrcz7/AFn+97RWnJ1IT0 LqhevaqATwGSJdHuXwLKGfDrVI3+oI1rg4eq6pNqwiDD9ZgBv+BLDTD4mDMtecPPYTNh tWIVSOV6Z/6g6zyeiFdnTbQzV1rGbE1ZN/4tcwV/4jpReRHzxdQN5EydZw3cU0m+JNOf 0fhQ== 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=tZM7mEbym++2u+NU79QX4ZHMRGx0lVPkdpZQMaBrXSg=; fh=t8KtzLLNH/5vGwqpf/v4tjL155e/ioGpKA4tz0DWROk=; b=xET2HQ9h+SVJ994tQyX2bYtfE4ZGpbSYgVHjJMprcuNxQBBhzycPsyL4e/M8Ckv8mV CvY5I+h7GY7CXkZ+XELZy3GMy50cHYTSn4KgTze8IFw5n5yZMN6z/HWmUm5zfNTSV+9j uOUV88F3ZVrAdWjzIHEIvocxsj9SEAbekN7IfIPeE3wbhOjEFCg/T4roXK3vM+s7Wvdk VlFIk0d1ZCDHRQ2Y0QHaRporFlfk2Cj/fkXEad0S9ZS03rHg/NRafi22tP3gc3Glubp6 PUJLAOJrxQLnrIsp3cxlXLDDsVyNrDH7Mcz2/CCj8nPRslrCZDGNJi+6VHbehvF8gBUq k0rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tweaklogic.com header.s=google header.b=Ft24V1OF; 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 Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y189-20020a0dd6c6000000b005a7d82629c1si1804979ywd.69.2023.10.27.00.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 00:46:17 -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=Ft24V1OF; 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 D7FF282B1C40; Fri, 27 Oct 2023 00:46:15 -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 S1345504AbjJ0HqI (ORCPT + 99 others); Fri, 27 Oct 2023 03:46:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345496AbjJ0HqE (ORCPT ); Fri, 27 Oct 2023 03:46:04 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82C6B1AC for ; Fri, 27 Oct 2023 00:46:01 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6be840283ceso1754224b3a.3 for ; Fri, 27 Oct 2023 00:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tweaklogic.com; s=google; t=1698392761; x=1698997561; 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=tZM7mEbym++2u+NU79QX4ZHMRGx0lVPkdpZQMaBrXSg=; b=Ft24V1OFnLpvslK6+YTzMQi/tdIlNytIjOEbhu8m4apjFGtJGd/ZnGAB8Ti4ztD1uf egm31OUUsLZ2rUyqVDPC4VSqZjyNfDP7F1/4b6aYhFlcIqs/IjnBpTgttmAfttyetH9f 6VoRACoQDd6RZRaRtywcHfeS8obPbDtlBxT9NC+9Az2YgJySesM5+Ys9GFN83uEc/6d0 YIoglZqf45+owgeJ+WyiZMSsXtJw3GWMfkVm4lv+tFjZK2JDer9UU/DKMIfmE4+wyv8n mSnxpILTyNNIexY0jDZtFB9/Yes1WHhOrrYVWWBLx4m40yiQYq2yRLBCT2QcRbl3IOAu RwjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698392761; x=1698997561; 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=tZM7mEbym++2u+NU79QX4ZHMRGx0lVPkdpZQMaBrXSg=; b=eCpYNs3lIPbk47NkhzfpZ1VamEFw2C1LBDCNrpEQUUfuotl3gOL1MghrTk1G10tT30 PQgwZRI6EFdrU96wM8Zu1FMuXTaHLtoqz3NAFjRaoqyxORucszBpwuvG/S+yxioxlneg eymLybpOPvl7tFL6KNkwIq8t+/9rh/d33CNrbn4Py7pjlRVKFYfGximNxZHbntt35TeT iK5QTxeblDD9JaH9+Sfa8Eizi7M9QHGzARxaztBpLixZvbW7IMLxxH74NVA68o37xYbj vmjMjIBf9PZViSLnFJldi0bScQAm9u/zfbRnuABuFcaYO4HxFZ6H/caa2v508EFHINsC xWwQ== X-Gm-Message-State: AOJu0YzdYTW/fUKCCaqChEiWMdOYeR6RmUqWHpMnDN0fiQWQfFmRsIGl 4gk25Hq51nTaUIjQZsXW2mwZjA== X-Received: by 2002:a05:6a21:7906:b0:174:af85:91fc with SMTP id bg6-20020a056a21790600b00174af8591fcmr2034147pzc.48.1698392761014; Fri, 27 Oct 2023 00:46:01 -0700 (PDT) Received: from localhost.localdomain (2403-580d-82f4-0-bfe6-93ca-47b7-e8ec.ip6.aussiebb.net. [2403:580d:82f4:0:bfe6:93ca:47b7:e8ec]) by smtp.gmail.com with ESMTPSA id v12-20020a17090ac90c00b00277832fbf4esm684835pjt.16.2023.10.27.00.45.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 00:46:00 -0700 (PDT) From: Subhajit Ghosh To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matti Vaittinen , Andy Shevchenko , Paul Gazzillo Cc: Subhajit Ghosh , Matt Ranostay , Stefan Windfeldt-Prytz , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] dt-bindings: iio: light: Avago APDS9306 Date: Fri, 27 Oct 2023 18:15:44 +1030 Message-Id: <20231027074545.6055-2-subhajit.ghosh@tweaklogic.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231027074545.6055-1-subhajit.ghosh@tweaklogic.com> References: <20231027074545.6055-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,URIBL_BLOCKED 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: 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]); Fri, 27 Oct 2023 00:46:16 -0700 (PDT) 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 - 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: + - 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 + +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>; - }; - }; -... -- 2.34.1