From patchwork Sat Dec 28 20:11:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 182495 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp4513539ild; Sat, 28 Dec 2019 12:11:26 -0800 (PST) X-Google-Smtp-Source: APXvYqxK7PQSQYsZpgPSXW0k5oFAtERrpgVfVSHf300g4+v4jzaf0FYMHee73+1zTJZ8rs00UPCQ X-Received: by 2002:a54:4e8d:: with SMTP id c13mr4625706oiy.27.1577563886563; Sat, 28 Dec 2019 12:11:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577563886; cv=none; d=google.com; s=arc-20160816; b=R1YTb0SXAlmu0nvSGGE3AI3qZ0V3MlraGplQhRxGKSWp8xBYAhXDiFkppfs9ih169n /+SdpGuxBmBaB5meaWQctAcArnxz69M+lM2/GeXWUwlChn7Hd9A8hhwGsz3SrhnGj2OV 7lLK94m1sntPoI9ugNzwKGiv1ujXqDR2aBAcoOc2ljz5E7G0lVNSGeSgOhdxGwMqVYAU TW6YADOw2Bug6AG91Ny0vKYLaHJdvp3GQiGbNEOv/9Ud6jformOGbl0GLz7lbOIeLk01 bua972/2ZGQMJ4jWaYwzftE8RLEbxRudpXetnLMzLVzH7eZEr5dhfesFtSGLEBc1QjbE YZfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Zh8S/4W0ztEaOCn11DyhGNjQj/bRNp6ULAbdfdJJfMM=; b=ziN52V8sEa0PoKudgeNlKTSMUUkPsr+ughBBFsdNYTM7Rd+Vv/UwKdr9IrjpXHbmkc VHfklZgeYmEpPXE8Bp23ZfaYfSsfylQ/B/qbXRaAvl9WQD7Gw+SDJbr1lUFHWs/IFEwC QmdFFVChFIDNWebdKOxbcbRG2F5NptREJnFKucCD6U41G8mat1VyAJlXWqSIdYcnsWw4 ovC96s+hVr6w3gT8q1SiCufY9/aJ8fcjJnBqU3czF3BJyQ0B19IrQ/qTOVulE8GYefG6 1DpAFRVEiYkF73M4BdOwB3+3Nl2agMNsmlZOXbCJKzGA3R7CF70WZtGq9PsJ8uZBw3s9 tKAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TBi5LQOE; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f15si14741214oij.160.2019.12.28.12.11.25; Sat, 28 Dec 2019 12:11:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TBi5LQOE; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726371AbfL1ULZ (ORCPT + 8 others); Sat, 28 Dec 2019 15:11:25 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:42182 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726563AbfL1ULY (ORCPT ); Sat, 28 Dec 2019 15:11:24 -0500 Received: by mail-lf1-f68.google.com with SMTP id y19so22864356lfl.9 for ; Sat, 28 Dec 2019 12:11:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Zh8S/4W0ztEaOCn11DyhGNjQj/bRNp6ULAbdfdJJfMM=; b=TBi5LQOED8JDNv5C6um28CrR7N2BYkuKI4C60P7VIYXDNfqMIVHl5A3KX4mQKnuhdq PSeFg48eT8NnQFPGTwh/rnYJEENx7UmiPqodxVpXgvWbsuU8BCk9qK/dqY0Wyde4hWXs lJgpyIfh8aYkuDWLL1OqMNeMqjbLGCvuh4empOZoagah+sgw97WGY1RnwbM3XM7n+JXQ l8/iD5mYAOkV2sz6mHUVhDUrVV5M3cxc5Rh2wuU2Vc8Vd26Ff+vYNE6FXAeiekWOxzPX 0w9NI/Voia8QmNPVgz8u2a3RroPJaIjR31qyOUw7LVDBgbXMpSmWDq/9CsfiEN1MQTYS KJDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Zh8S/4W0ztEaOCn11DyhGNjQj/bRNp6ULAbdfdJJfMM=; b=BARDLZodwLlgKRqNuDLVezrMxLSr4kN6lOSlAv8FAwnIFge+U5O+yiTzVrxbw4z0Ko UHVpvuDCt2Otn1thXVbKwIbm4k/iF6bPXDO2kGaWwrtLYPGaPUkeB4LfCprIkXGp9BUJ +g4GXFfMHLo7qVRKQ6G99RpI84ffRefLFv9+GYaqMoETgEEKzB4lKSD2hx+Cfb58rhjU MC1Fp8oTjWp0zUSJEM/dyE11/TeiITRQ6P3GEC2QPSBt1Qq//Su+zGe8talN5ybnEXVO HUeoRECoiBIajX8fUPKFHGhPGJWMt5yqRzYVNlICaKAw06Ww5B24VT2/H/PPNkYrxsST Bkqw== X-Gm-Message-State: APjAAAWLEr7SZIGOqlwqccO3vCRsYCaFkXJP0SfTzbM4c2Cyr6oXUMka Brz4p/9CbGWikgWgVCcPWckjRQ== X-Received: by 2002:a19:c7c5:: with SMTP id x188mr32486605lff.22.1577563881848; Sat, 28 Dec 2019 12:11:21 -0800 (PST) Received: from localhost.bredbandsbolaget (c-5ac9225c.014-348-6c756e10.bbcust.telenor.se. [92.34.201.90]) by smtp.gmail.com with ESMTPSA id r15sm2590064ljh.11.2019.12.28.12.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2019 12:11:20 -0800 (PST) From: Linus Walleij To: Jonathan Cameron , linux-iio@vger.kernel.org Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-input@vger.kernel.org, Linus Walleij , Stephan Gerhold , Donggeun Kim , Minkyu Kang , =?utf-8?q?Pawe=C5=82_Chmie?= =?utf-8?q?l?= , Jonathan Bakker , Oskar Andero , Dmitry Torokhov , devicetree@vger.kernel.org Subject: [PATCH 1/2 v1] iio: light: Add DT bindings for GP2AP002 Date: Sat, 28 Dec 2019 21:11:08 +0100 Message-Id: <20191228201109.13635-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This adds device tree bindings for the GP2AP002 light and proximity sensor. As with other early proximity sensors (~2010) the light sensor and proximity sensors were combined into a single component. Cc: Stephan Gerhold Cc: Donggeun Kim Cc: Minkyu Kang Cc: Paweł Chmiel Cc: Jonathan Bakker Cc: Oskar Andero Cc: Dmitry Torokhov Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij --- .../bindings/iio/light/sharp,gp2ap002.yaml | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/light/sharp,gp2ap002.yaml -- 2.21.0 diff --git a/Documentation/devicetree/bindings/iio/light/sharp,gp2ap002.yaml b/Documentation/devicetree/bindings/iio/light/sharp,gp2ap002.yaml new file mode 100644 index 000000000000..27d129e76a8b --- /dev/null +++ b/Documentation/devicetree/bindings/iio/light/sharp,gp2ap002.yaml @@ -0,0 +1,87 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/light/sharp,gp2ap002.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Sharp GP2AP002A00F and GP2AP002S00F proximity and ambient light sensors + +maintainers: + - Linus Walleij + +description: | + Proximity and ambient light sensor with IR LED for the proximity + sensing and an analog output for light intensity. The ambient light + sensor output is not available on the GP2AP002S00F variant. + +properties: + compatible: + enum: + - sharp,gp2ap002a00f + - sharp,gp2ap002s00f + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + description: an interrupt for proximity, usually a GPIO line + + vdd-supply: + maxItems: 1 + description: VDD power supply a phandle to a regulator + + vio-supply: + maxItems: 1 + description: VIO power supply a phandle to a regulator + + io-channels: + maxItems: 1 + description: ALSOUT ADC channel to read the ambient light + + io-channel-names: + const: "alsout" + + sharp,proximity-far-hysteresis: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Hysteresis setting for "far" object detection, this setting is + device-unique and adjust the optical setting for proximity detection + of a "far away" object in front of the sensor. + + sharp,proximity-close-hysteresis: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Hysteresis setting for "close" object detection, this setting is + device-unique and adjust the optical setting for proximity detection + of a "close" object in front of the sensor. + +required: + - compatible + - reg + - interrupts + - sharp,proximity-far-hysteresis + - sharp,proximity-close-hysteresis + +examples: + - | + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + light-sensor@44 { + compatible = "sharp,gp2ap002a00f"; + reg = <0x44>; + interrupts = <18 IRQ_TYPE_EDGE_FALLING>; + vdd-supply = <&vdd_regulator>; + vio-supply = <&vio_regulator>; + io-channels = <&adc_channel>; + io-channel-names = "alsout"; + sharp,proximity-far-hysteresis = <0x2f>; + sharp,proximity-close-hysteresis = <0x0f>; + }; + }; + +...