From patchwork Mon Jul 31 11:02:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 128632 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1972688vqg; Mon, 31 Jul 2023 05:16:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlFy+Tr/gAv5UPfrb2b9542L+M4xGQv9qoEBIpctTGh6U/NKvqHtjLlgVRjuCeE0dEj7jltP X-Received: by 2002:a17:902:a40d:b0:1bb:20ee:e29e with SMTP id p13-20020a170902a40d00b001bb20eee29emr9033914plq.1.1690805780713; Mon, 31 Jul 2023 05:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690805780; cv=none; d=google.com; s=arc-20160816; b=FrGz7qv4vcuD+L2dfnEB+dtLErr6QZtysCer7N1pDizYfB0rn5C69CjDTcEltsVOcO o8VSQlSjYzOS9UXRnnXwj+Y9VX2ojQWbKNuQvg7h3v3GSfOHeUjKHDJnQgwVk4/X917R Qd2UbKqtSv0BgEOYVyFP23VReDmE8trQDx0v+npa1d+YBoOFYIpNSYgosMQAeVeRcmzs K7PapaS/qzT4mD6pZ2+PXz+E4lZgAOzAIEiOYcZ26e+Mhol+Sq9VidUVkSgfKalDUGtN DXpAj9FWZGjTxgRIq0+hOp7XIIHnMAVbMXp0U06pMkW4rmlUrybi/tU9rXdDSas4xJQ6 WZIA== 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=1VbuOesFY8jgrwRNfOH6TH6GpPlQAQeFgnVpyaXLhy0=; fh=Cqg9bSLHI6IcMQfoPfFj/2ZMBgtP9/bxMQtC63kOWJM=; b=IwGVEimnU6gGlExZrQP9frMGRKRVuKDwyRPPCpBv46KY8iX/0Fs0Jn+1FlggkuCiDu EGksAQ03vHSS5BjvA17fSRKNSn+uyHimUHIABXpyp6dO78G4MLwKOHI4RXLFPHhalBwA x1Zx7AhibieHiDSFz89jPpuqMnZ88hyUBpAgso6X2NKw9pgR/ZEavAk6CAMzAYtxHZrW jtXfQETau1etQTl2R5ue9WBlajMKzrvCkHc13rwe0WjNZ8odSGZicFSsoFgOl8gDsQ4l h18O/Bv/HFMfXqPcZ0lTbMOzeNBUXNpZDymak9UdcjnMesc7i/V/w7DKx6w61zuPlTlI 3Q3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=NYA+jcor; 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 z16-20020a170903019000b001b9d2659694si7662067plg.270.2023.07.31.05.16.07; Mon, 31 Jul 2023 05:16:20 -0700 (PDT) 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=20221208 header.b=NYA+jcor; 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 S231195AbjGaLDX (ORCPT + 99 others); Mon, 31 Jul 2023 07:03:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232433AbjGaLDF (ORCPT ); Mon, 31 Jul 2023 07:03:05 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BB16129; Mon, 31 Jul 2023 04:03:04 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2b9db1de50cso25442301fa.3; Mon, 31 Jul 2023 04:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690801382; x=1691406182; 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=1VbuOesFY8jgrwRNfOH6TH6GpPlQAQeFgnVpyaXLhy0=; b=NYA+jcorU61v4iXcDDJEPRNT7gO9w1yrLMAr5FWtCaHkz78BGEWVxa4ZY4D6824oH5 6VIOJK8OrP0OXoAy9hf8OykiN1DMgfSOThVv+evF9JoZxB1NaLldeZ7oNz0DwEvVJ2TQ o20Gt1Gf7U2Ucz2KiQixp85pX8OivoGyFrdJqnC09eHMA1LliIQ+LgRoSgc9t5aURtqs lVqq5hnaisSRpByj7+gZU8SBi0adebwvb0F16KBAZqotd7jpO6JqpAgYujo3oQ4N3a1V e6QvK/ARiuMwTwqPl4OuRtL05dzjsYiLx14PK0CRHfS7j2dreA3KmpV7mgbHLKXni3SW VrnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690801382; x=1691406182; 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=1VbuOesFY8jgrwRNfOH6TH6GpPlQAQeFgnVpyaXLhy0=; b=StKyxOvmBr6X8QQYq7j5/kXt1KeVqqbS5rXNN7daAKVm5NRp2qGkiPmL5SBSNRnzHQ RmoeYfOymCi7ZP1aRYeS/3mrLwZoJb3VX+UeOJe9M6c0I4tQg/Byk/BJKK4ZuMr+i/wp i81hn3nSWP2xdGoWnRWvevJAvWEpkFjild1aqYCazjW6qYBt1LMZqpDcVxi0p6dXblZp 4PGVeJ517ntRLbgubFi3KN9nERJUup7cH8FHsskIyreo8u0GxNhM+xrLEJ3GXnbrzpxV CC+BpSROqf1Exc8OF0s8lZzV4qLJeSusTpOaHWwPmty00FXtF4ZXKUf3/je7cqyvKLXK kDMQ== X-Gm-Message-State: ABy/qLZreHN8y/3VDOT5pKi+XRx9Erj0+8jS3gOpda/AU90u1fsoBR1v +5T4mpq2GslsFzVYf2MYsJ4= X-Received: by 2002:a2e:6e14:0:b0:2b9:dfd1:3808 with SMTP id j20-20020a2e6e14000000b002b9dfd13808mr2984934ljc.25.1690801382092; Mon, 31 Jul 2023 04:03:02 -0700 (PDT) Received: from xeon.. ([188.163.112.48]) by smtp.gmail.com with ESMTPSA id p2-20020a2e8042000000b002b9bf5b071bsm74607ljg.20.2023.07.31.04.03.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 04:03:01 -0700 (PDT) From: Svyatoslav Ryhel To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Arnd Bergmann , Greg Kroah-Hartman , Svyatoslav Ryhel , Samu Onkalo Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/2] dt-bindings: iio: light: add apds990x binding Date: Mon, 31 Jul 2023 14:02:38 +0300 Message-Id: <20230731110239.107086-2-clamor95@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731110239.107086-1-clamor95@gmail.com> References: <20230731110239.107086-1-clamor95@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 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_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772938362580580865 X-GMAIL-MSGID: 1772938362580580865 Add dt-binding for apds990x ambient light/proximity sensor. Signed-off-by: Svyatoslav Ryhel --- .../bindings/iio/light/avago,apds990x.yaml | 87 +++++++++++++++++++ 1 file changed, 87 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..89a061643de5 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml @@ -0,0 +1,87 @@ +# 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 ambient light and proximity sensor + +maintainers: + - Samu Onkalo + +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. + Datasheet at https://docs.broadcom.com/doc/AV02-2867EN + +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: 3 + description: + The LED drive current is controlled by a regulated current + sink on the LDR pin. This feature eliminates the need to use + a current limiting resistor to control LED current. The LED + drive current can be configured for 12.5 mA (pdrive = 3), + 25 mA (2), 50 mA (1) or 100 mA (0). For higher LED drive + requirements, an external P type transistor can be used to + control the LED current. + + avago,ppcount: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 255 + description: + The number of LED pulses can be programmed to a value of 1 to + 255 pulses as needed. Increasing the number of LED pulses at a + given current will increase the sensor sensitivity. Sensitivity + grows by the square root of the number of pulses. Each pulse + has a 16 mS period. + +additionalProperties: false + +required: + - compatible + - reg + - interrupts + - vdd-supply + - vled-supply + - avago,pdrive + - avago,ppcount + +examples: + - | + #include + 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 = <0>; + avago,ppcount = <3>; + }; + }; +...