Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp938473pxj; Fri, 21 May 2021 02:42:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbYsrIiEvQONTxXICcB9sQZtT0TPptp/jQPrz68A/VShQlL6gBQWG8ewCSFjxPU6hm9FCo X-Received: by 2002:a05:6402:44:: with SMTP id f4mr10166003edu.364.1621590123662; Fri, 21 May 2021 02:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621590123; cv=none; d=google.com; s=arc-20160816; b=hxQh6qUa3klPqmWVFGqpkHM8FYJFdPma/qJYNLRBwGf3zq9dkwkLdCbyttj3ec11u/ 8HylsTIxAVu9pnKxmwpePceQWTAZFqlpa/VzNtZJKQveEHsT65hfsJBKuOFgpkN9GU8K UPtxWodAHNNUhWAJulFDjxciEQWKpkLzGrAwjPHMCGrwnZkY8C0bPUVa3+uQkfXTky2d TNP6TnKpKPmW51T1XfygNxXu0CSXEV/QQIwE8FdNEubTQB8iuA3Qh0UCAtzdwXJBmRSt WnNfoitl7YyMkIr6oVc3EufJv24D25zdSejaGRXG2avdEzXshiZJ3YXi+x41nDXIAjWe +0Bg== 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; bh=FLR9XIG0wmN9KL3T9usUSEq7n5Oe5OdLx1d318/eTpw=; b=bDkz2O8JOxOBgRinvpYSnBhLlITX3mcpDj18oftCiO82Sro0l7OuYyu8TyarYB2i0N bRb4kT17H0NAGU/QvzJntP4YkTCf34FmEF4T5L6N00V/JLtSurJyc7wmgpRFT7AKEpb4 VoB9xnVMuf+X5OD2OU6acgoEcIQFpI8q2sIFMYtLxOT5kmemqRlV0eiUBokFdv/M5hvq q8BVHtXM6w8x2y6mDF4JlAqbC/ThrtesFONATlqI8o6SbrRu3Z3dj2dqtU0bfK1oC9U0 Zoc0Lckmb2SYfhaWl2QWtaxm0Fdu3NUawh6wBxVIYexNhSo6hSpnrIHPNo+9D5vzayON fsng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rs28si5257521ejb.19.2021.05.21.02.41.40; Fri, 21 May 2021 02:42:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239251AbhEUErR (ORCPT + 99 others); Fri, 21 May 2021 00:47:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239177AbhEUErO (ORCPT ); Fri, 21 May 2021 00:47:14 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7E2EC061763 for ; Thu, 20 May 2021 21:45:51 -0700 (PDT) Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljx2d-0006Z9-AD; Fri, 21 May 2021 06:45:43 +0200 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1ljx2b-0002Fj-IU; Fri, 21 May 2021 06:45:41 +0200 From: Oleksij Rempel To: Dmitry Torokhov , Rob Herring , Jonathan Cameron Cc: Oleksij Rempel , Rob Herring , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, David Jander , devicetree@vger.kernel.org Subject: [PATCH v5 5/8] dt-bindings: touchscreen: Convert resistive-adc-touch binding to json schema Date: Fri, 21 May 2021 06:45:22 +0200 Message-Id: <20210521044525.7397-6-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210521044525.7397-1-o.rempel@pengutronix.de> References: <20210521044525.7397-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the resistive-adc-touch binding to DT schema format using json-schema. Signed-off-by: Oleksij Rempel Reviewed-by: Rob Herring --- .../input/touchscreen/resistive-adc-touch.txt | 33 --------- .../touchscreen/resistive-adc-touch.yaml | 70 +++++++++++++++++++ 2 files changed, 70 insertions(+), 33 deletions(-) delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.txt create mode 100644 Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.yaml diff --git a/Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.txt b/Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.txt deleted file mode 100644 index af5223bb5bdd..000000000000 --- a/Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.txt +++ /dev/null @@ -1,33 +0,0 @@ -Generic resistive touchscreen ADC - -Required properties: - - - compatible: must be "resistive-adc-touch" -The device must be connected to an ADC device that provides channels for -position measurement and optional pressure. -Refer to -https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml -for details - - - iio-channels: must have at least two channels connected to an ADC device. -These should correspond to the channels exposed by the ADC device and should -have the right index as the ADC device registers them. These channels -represent the relative position on the "x" and "y" axes. - - iio-channel-names: must have all the channels' names. Mandatory channels -are "x" and "y". - -Optional properties: - - iio-channels: The third channel named "pressure" is optional and can be -used if the ADC device also measures pressure besides position. -If this channel is missing, pressure will be ignored and the touchscreen -will only report position. - - iio-channel-names: optional channel named "pressure". - -Example: - - resistive_touch: resistive_touch { - compatible = "resistive-adc-touch"; - touchscreen-min-pressure = <50000>; - io-channels = <&adc 24>, <&adc 25>, <&adc 26>; - io-channel-names = "x", "y", "pressure"; - }; diff --git a/Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.yaml b/Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.yaml new file mode 100644 index 000000000000..38b4cbee9429 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.yaml @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/resistive-adc-touch.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic resistive touchscreen ADC + +maintainers: + - Oleksij Rempel + +description: | + Generic ADC based resistive touchscreen controller + The device must be connected to an ADC device that provides channels for + position measurement and optional pressure. + +allOf: + - $ref: touchscreen.yaml# + +properties: + compatible: + const: resistive-adc-touch + + io-channels: + minItems: 2 + items: + - description: x + - description: y + - description: pressure (optional) + + io-channel-names: + oneOf: + - items: + - enum: [x, y] + - enum: [x, y] + - items: + - enum: [x, y, pressure] + - enum: [x, y, pressure] + - enum: [x, y, pressure] + + touchscreen-size-x: true + touchscreen-size-y: true + touchscreen-fuzz-x: true + touchscreen-fuzz-y: true + touchscreen-inverted-x: true + touchscreen-inverted-y: true + touchscreen-swapped-x-y: true + touchscreen-min-pressure: true + +additionalProperties: false + +required: + - compatible + - io-channels + - io-channel-names + +examples: + - | + touchscreen { + compatible = "resistive-adc-touch"; + io-channels = <&adc 24>, <&adc 25>; + io-channel-names = "y", "x"; + }; + - | + touchscreen { + compatible = "resistive-adc-touch"; + touchscreen-min-pressure = <50000>; + io-channels = <&adc 24>, <&adc 25>, <&adc 26>; + io-channel-names = "y", "pressure", "x"; + }; -- 2.29.2