From patchwork Wed Apr 26 11:57:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Windfeldt-Prytz X-Patchwork-Id: 13224536 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6112CC7618E for ; Wed, 26 Apr 2023 11:57:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240690AbjDZL5y (ORCPT ); Wed, 26 Apr 2023 07:57:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240680AbjDZL5x (ORCPT ); Wed, 26 Apr 2023 07:57:53 -0400 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A6901FD3; Wed, 26 Apr 2023 04:57:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1682510272; x=1714046272; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=UrVPi9iavO/29AvSYL2Oe59H3w4J+MhU9zUYa5TBKuQ=; b=OO2KIU/Gy71HxJJ8ruD8BxqyJbPQNQoPXnJSN7I6Ei8HuKL7xtfdVTpy zZZLbAmb3+phR9vmyl+q8yGfMQZXd1xDhgwiftlyTAOY8r+D0H1/yf695 TyynIR+Lz5y2XF5bmQx8wTd/Ced8Pr83sQvcPZnccFdjyJGzlyCdsmCVG Hzca4TCj03yGAvoZ9x1t8BlpsKxPoLIgznZ5os8FCM4HedbTYfWE9rAJV CPc8+faZ2oiwyxbpFLSi5PAq2eBggyuovi3uxeTD9OOWP6gtbgDBRnnD6 H3mLEN9vjJ8YiUAn0VKcEw+0IcO+m8xXJO/hcuk/hNotlxpwLiqT8qtID Q==; From: Stefan Windfeldt-Prytz Date: Wed, 26 Apr 2023 13:57:29 +0200 Subject: [PATCH v3 1/2] dt-bindings: iio: light: Document TI OPT4001 light sensor MIME-Version: 1.0 Message-ID: <20230323-add-opt4001-driver-v3-1-62e121dab294@axis.com> References: <20230323-add-opt4001-driver-v3-0-62e121dab294@axis.com> In-Reply-To: <20230323-add-opt4001-driver-v3-0-62e121dab294@axis.com> To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski CC: , , , Stefan Windfeldt-Prytz , X-Mailer: b4 0.12.2 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Add devicetree bindings for opt4001 ambient light sensor. Signed-off-by: Stefan Windfeldt-Prytz Reviewed-by: Rob Herring --- .../devicetree/bindings/iio/light/ti,opt4001.yaml | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/light/ti,opt4001.yaml b/Documentation/devicetree/bindings/iio/light/ti,opt4001.yaml new file mode 100644 index 000000000000..12b0c7ed5d72 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/light/ti,opt4001.yaml @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/light/ti,opt4001.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Texas Instruments OPT4001 Ambient Light Sensor + +maintainers: + - Stefan Windfeldt-Prytz + +description: + Ambient light sensor with an i2c interface. + Last part of compatible is for the packaging used. + Picostar is a 4 pinned SMT and sot-5x3 is a 8 pinned SOT. + https://www.ti.com/lit/gpn/opt4001 + +properties: + compatible: + enum: + - ti,opt4001-picostar + - ti,opt4001-sot-5x3 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vdd-supply: + description: Regulator that provides power to the sensor + +required: + - compatible + - reg + +allOf: + - if: + properties: + compatible: + contains: + const: ti,opt4001-sot-5x3 + then: + properties: + interrupts: + maxItems: 1 + else: + properties: + interrupts: false + +additionalProperties: false + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + light-sensor@44 { + compatible = "ti,opt4001-sot-5x3"; + reg = <0x44>; + vdd-supply = <&vdd_reg>; + interrupt-parent = <&gpio1>; + interrupts = <28 IRQ_TYPE_EDGE_FALLING>; + }; + }; +...