From nobody Wed Feb 11 13:28:47 2026 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 25206C77B75 for ; Mon, 8 May 2023 12:35:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234095AbjEHMfX (ORCPT ); Mon, 8 May 2023 08:35:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234160AbjEHMfQ (ORCPT ); Mon, 8 May 2023 08:35:16 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33DE1391A9 for ; Mon, 8 May 2023 05:35:13 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2ac785015d7so50030861fa.1 for ; Mon, 08 May 2023 05:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683549311; x=1686141311; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ulJciNp9+1XlKIBJfPg6D9fHgUw6mUDVehwtyecw6EM=; b=U5GXHAq4aJMBPrI1k9iVP7Kp1DyAp854W2N1KvoA7v70jUMtjgIvgwrv3KbG81NSMZ LSq6t2czDIX5nwii7BD8YWo1R78spiM8peQzpzqRLkQITpjpnH9GItCXdQU8EOBwKeue XlKeTApzwlXElHuC1v82EKApUd+fZ3WkSJLtxbhDf+X4IotkBgR2QwO1CahppYJsmFcz GLdBXC0qJHhEoKpjGdnon7ncA/DI1mqqdRRQB9x/onJRZ8kq9ZIILZ/9XgQSMqGc2ql2 sex8ItGNuH8hHfFlZQGayN66qLdmOCr97Nau2ZJo1CkgwJOqawGWzYVFD6ATuBTF4NQZ uLqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683549311; x=1686141311; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ulJciNp9+1XlKIBJfPg6D9fHgUw6mUDVehwtyecw6EM=; b=QsaZNloQa2hRVcGIB0w9a6VtyKlLSxDNA4vy4iBrncStWIAZDddzHqRvMuotpAJU2u UhlAAFID8sgCNFipkaJ/Nwk6D84/Fnm/Bt7I8/MK0Gozx6/a9KHaMgAO0xoIPNR4e23c 5Lp0q601kD4Fr/AvhwoaH1GUnJm2t6QLAY3Ye3vbQzzILvXCuclYy31O50XlkW9tU0Yi idKoRYcgfG3U9xXsQtlsPNhHSucuvfdbBfem1Y/RrxIcjKG8MVtUToeLvKz+2hDG4TbM 1emAv7NeBKSzJeSeD9fBXOvRnJjI9TXfggt3MO2/5sro2dVPukZmZAejjZ4Tyytn5+1T 8cRw== X-Gm-Message-State: AC+VfDyySXnHHtzbBJzpXiyvxCjvy6IIlnJeS0uBpE7JBR839sNCiAjf YZ5t3hi3991DyDAAKSEa4tyrlQ== X-Google-Smtp-Source: ACHHUZ4mfWFKzmhz/Ro72qavdGjf9iBzwapKmzVAgSOO01+2A+P6ObB0AbSZv9OETX4tfyYdG2x5CQ== X-Received: by 2002:ac2:51cd:0:b0:4f2:4d0a:7bde with SMTP id u13-20020ac251cd000000b004f24d0a7bdemr1256751lfm.31.1683549311405; Mon, 08 May 2023 05:35:11 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id q2-20020ac25fc2000000b004b55ddeb7e3sm1289593lfg.309.2023.05.08.05.35.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 May 2023 05:35:10 -0700 (PDT) From: Linus Walleij Date: Mon, 08 May 2023 14:35:09 +0200 Subject: [PATCH v4 1/2] dt-bindings: gpio: Convert STMPE GPIO to YAML schema MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230426-stmpe-dt-bindings-v4-1-36fdd53d9919@linaro.org> References: <20230426-stmpe-dt-bindings-v4-0-36fdd53d9919@linaro.org> In-Reply-To: <20230426-stmpe-dt-bindings-v4-0-36fdd53d9919@linaro.org> To: Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Maxime Coquelin , Alexandre Torgue , Dmitry Torokhov , Lee Jones , Philippe Schenker , Stefan Agner , Marek Vasut , Steffen Trumtrar Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This rewrites the STMPE GPIO bindings to a YAML schema. We add the properties that are used in the widely used STMPE GPIO device nodes found in the wild, most notably interrupt support, so interrupt-cells and interrupt-controller is now part of the bindings. Signed-off-by: Linus Walleij Reviewed-by: Krzysztof Kozlowski --- ChangeLog v3->v4: - Realize that there were actually some old bindings so we need to get rid of them as part of this patch. - Fix blank lines after description: keyword. ChangeLog v2->v3: - Use a compact hog node schema backed by the standard hog schema. ChangeLog v1->v2: - New patch split off from the MFD patch. --- .../devicetree/bindings/gpio/gpio-stmpe.txt | 17 ------- .../devicetree/bindings/gpio/st,stmpe-gpio.yaml | 53 ++++++++++++++++++= ++++ 2 files changed, 53 insertions(+), 17 deletions(-) diff --git a/Documentation/devicetree/bindings/gpio/gpio-stmpe.txt b/Docume= ntation/devicetree/bindings/gpio/gpio-stmpe.txt deleted file mode 100644 index b33f8f02c0d7..000000000000 --- a/Documentation/devicetree/bindings/gpio/gpio-stmpe.txt +++ /dev/null @@ -1,17 +0,0 @@ -STMPE gpio ----------- - -Required properties: - - compatible: "st,stmpe-gpio" - -Optional properties: - - st,norequest-mask: bitmask specifying which GPIOs should _not_ be reque= stable - due to different usage (e.g. touch, keypad) - -Node should be child node of stmpe node to which it belongs. - -Example: - stmpe_gpio { - compatible =3D "st,stmpe-gpio"; - st,norequest-mask =3D <0x20>; //gpio 5 can't be used - }; diff --git a/Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml b/Do= cumentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml new file mode 100644 index 000000000000..22c0cae73425 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/st,stmpe-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: STMicroelectonics Port Expander (STMPE) GPIO Block + +description: + STMicroelectronics Port Expander (STMPE) is a series of slow + bus controllers for various expanded peripherals such as GPIO, keypad, + touchscreen, ADC, PWM or rotator. It can contain one or several different + peripherals connected to SPI or I2C. These bindings pertain to the + GPIO portions of these expanders. + +maintainers: + - Linus Walleij + +properties: + compatible: + const: st,stmpe-gpio + + "#gpio-cells": + const: 2 + + "#interrupt-cells": + const: 2 + + gpio-controller: true + + interrupt-controller: true + + st,norequest-mask: + description: + A bitmask of GPIO lines that cannot be requested because for + for example not being connected to anything on the system + $ref: /schemas/types.yaml#/definitions/uint32 + +patternProperties: + "^.+-hog(-[0-9]+)?$": + type: object + + required: + - gpio-hog + +additionalProperties: false + +required: + - compatible + - "#gpio-cells" + - "#interrupt-cells" + - gpio-controller + - interrupt-controller --=20 2.34.1 From nobody Wed Feb 11 13:28:47 2026 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 D5C5BC77B7F for ; Mon, 8 May 2023 12:35:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234229AbjEHMf0 (ORCPT ); Mon, 8 May 2023 08:35:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234178AbjEHMfR (ORCPT ); Mon, 8 May 2023 08:35:17 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55ED837036 for ; Mon, 8 May 2023 05:35:14 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f13a72ff53so4932765e87.0 for ; Mon, 08 May 2023 05:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683549312; x=1686141312; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=jQ1qf2e03WlPLJuXOlZ1OBamEh8pCtH4w3SZqhsTCas=; b=X1gjYl1f+C9uS+BnSDmuZ0EkVCALhlpymWRvpt0n6pshD8Pf4BjEWLb0Q6ik2zkoNG vpgLsI1nu0oMhYL2iuFmBEXmxoWv5XfB+cRng0gS9J7d7ZXGX8clJoQTN0j9fbOx+7GQ qmTRLsvyC879m8ABTniJhZrVGSyhgJnpE+E8Q5KXiQOYp43/+ONjNuy79q+jVXKQqiTe Qo+AlcvvANNAUhB2NyCXZrFoTDDEf1cbXcrtx768syrEZVsAowBBvkXHMenHBSVyNa71 qw4AhMZ3SxDN/LPRF15aQ0eCyNPc2RubAnL/qA892wDO+Xdf/+yurMy/N2UvjJH7z3rG uwoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683549312; x=1686141312; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jQ1qf2e03WlPLJuXOlZ1OBamEh8pCtH4w3SZqhsTCas=; b=OsxUEOPuR99opPPh3394exqSYBck7n6dnrywR9zqBzm4fgN/HlQ3oyQRXwquz+kuEN /75OlW1umRvjRkME7UWDMsrGxMk5Zu2GcaDNEPgnXk299+Hp/+gsR1cD8N4uBlSmRw6E EkdSW56O/VSdNxJZy34sjNHVuYSegGz5JkOrkjmZaz8ILCZWEE7TC15xEWSdztVYEJfH Q00TsyHP/fBKOBwZqTaAhW+acdVDtN65ObjJEVgYz/nMeiJCJ+vpeRi14gAzBivsgeKo joEz91kIdFQH4fwvVurju/f4yn08xTZbZMyt1iFAuvQgezrI1bRnnzwcxttJEqcWnaUo LqNQ== X-Gm-Message-State: AC+VfDxGCExBKlkAf9F+jSvW4MXbCRZGBEt/7hbHwqwp27OdeByoW5Gf ockhH8yCXQwGFwudpArtc0pMsA== X-Google-Smtp-Source: ACHHUZ7qRYKEqB7/XpiGpe3apn3BdFTbobqx6B1CZPNb579NQIuf7jLRLjJoxGZ80SU/mT3wm8dVZg== X-Received: by 2002:ac2:42c9:0:b0:4dd:9ddc:4463 with SMTP id n9-20020ac242c9000000b004dd9ddc4463mr2608842lfl.5.1683549312454; Mon, 08 May 2023 05:35:12 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id q2-20020ac25fc2000000b004b55ddeb7e3sm1289593lfg.309.2023.05.08.05.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 May 2023 05:35:12 -0700 (PDT) From: Linus Walleij Date: Mon, 08 May 2023 14:35:10 +0200 Subject: [PATCH v4 2/2] dt-bindings: MFD: Convert STMPE to YAML schema MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230426-stmpe-dt-bindings-v4-2-36fdd53d9919@linaro.org> References: <20230426-stmpe-dt-bindings-v4-0-36fdd53d9919@linaro.org> In-Reply-To: <20230426-stmpe-dt-bindings-v4-0-36fdd53d9919@linaro.org> To: Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Maxime Coquelin , Alexandre Torgue , Dmitry Torokhov , Lee Jones , Philippe Schenker , Stefan Agner , Marek Vasut , Steffen Trumtrar Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Linus Walleij , Rob Herring X-Mailer: b4 0.12.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This converts the STMPE MFD device tree bindings to the YAML schema. Reference the existing schema for the ADC, just define the other subnode schemas directly in the MFD schema. Add two examples so we have examples covering both the simple GPIO expander and the more complex with ADC and touchscreen. Some in-tree users do not follow the naming conventions for nodes so these DTS files need to be augmented to use proper node names like "adc", "pwm", "gpio", "keyboard-controller" etc before the bindings take effect on them. Acked-by: Dmitry Torokhov Reviewed-by: Rob Herring Signed-off-by: Linus Walleij --- ChangeLog v2->v3: - Drop the required pwm properties already required by the template pwm schema. - Add the number of PWM cells as const. ChangeLog v1->v2: - Split off the GPIO bindings to their own schema, as the old bindings didn't even have any GPIO bindings. Put the GPIO schema before this schema so we can use GPIO in the examples. - Drop nodename and pattern as STMPE is not a generic name. - Add maxItems to the resets. - Make wakeup-source just :true, as it is a generic property. - Move unevaluatedProperties for subnodes right before properties as requested. - Name devices "port-expander" in the examples. - Use lowercase hex in line init. --- .../devicetree/bindings/input/stmpe-keypad.txt | 41 --- .../bindings/input/touchscreen/stmpe.txt | 108 -------- .../devicetree/bindings/mfd/st,stmpe.yaml | 297 +++++++++++++++++= ++++ Documentation/devicetree/bindings/mfd/stmpe.txt | 42 --- 4 files changed, 297 insertions(+), 191 deletions(-) diff --git a/Documentation/devicetree/bindings/input/stmpe-keypad.txt b/Doc= umentation/devicetree/bindings/input/stmpe-keypad.txt deleted file mode 100644 index 12bb771d66d4..000000000000 --- a/Documentation/devicetree/bindings/input/stmpe-keypad.txt +++ /dev/null @@ -1,41 +0,0 @@ -* STMPE Keypad - -Required properties: - - compatible : "st,stmpe-keypad" - - linux,keymap : See ./matrix-keymap.txt - -Optional properties: - - debounce-interval : Debouncing interval time in milliseconds - - st,scan-count : Scanning cycles elapsed before key data is u= pdated - - st,no-autorepeat : If specified device will not autorepeat - - keypad,num-rows : See ./matrix-keymap.txt - - keypad,num-columns : See ./matrix-keymap.txt - -Example: - - stmpe_keypad { - compatible =3D "st,stmpe-keypad"; - - debounce-interval =3D <64>; - st,scan-count =3D <8>; - st,no-autorepeat; - - linux,keymap =3D <0x205006b - 0x4010074 - 0x3050072 - 0x1030004 - 0x502006a - 0x500000a - 0x5008b - 0x706001c - 0x405000b - 0x6070003 - 0x3040067 - 0x303006c - 0x60400e7 - 0x602009e - 0x4020073 - 0x5050002 - 0x4030069 - 0x3020008>; - }; diff --git a/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt = b/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt deleted file mode 100644 index 238b51555c04..000000000000 --- a/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt +++ /dev/null @@ -1,108 +0,0 @@ -STMPE Touchscreen ----------------- - -Required properties: - - compatible: "st,stmpe-ts" - -Optional properties: -- st,ave-ctrl : Sample average control - 0 -> 1 sample - 1 -> 2 samples - 2 -> 4 samples - 3 -> 8 samples -- st,touch-det-delay : Touch detect interrupt delay (recommended is 3) - 0 -> 10 us - 1 -> 50 us - 2 -> 100 us - 3 -> 500 us - 4 -> 1 ms - 5 -> 5 ms - 6 -> 10 ms - 7 -> 50 ms -- st,settling : Panel driver settling time (recommended is 2) - 0 -> 10 us - 1 -> 100 us - 2 -> 500 us - 3 -> 1 ms - 4 -> 5 ms - 5 -> 10 ms - 6 -> 50 ms - 7 -> 100 ms -- st,fraction-z : Length of the fractional part in z (recommended is 7) - (fraction-z ([0..7]) =3D Count of the fractional part) -- st,i-drive : current limit value of the touchscreen drivers - 0 -> 20 mA (typical 35mA max) - 1 -> 50 mA (typical 80 mA max) - -Optional properties common with MFD (deprecated): - - st,sample-time : ADC conversion time in number of clock. - 0 -> 36 clocks - 1 -> 44 clocks - 2 -> 56 clocks - 3 -> 64 clocks - 4 -> 80 clocks (recommended) - 5 -> 96 clocks - 6 -> 124 clocks - - st,mod-12b : ADC Bit mode - 0 -> 10bit ADC - 1 -> 12bit ADC - - st,ref-sel : ADC reference source - 0 -> internal - 1 -> external - - st,adc-freq : ADC Clock speed - 0 -> 1.625 MHz - 1 -> 3.25 MHz - 2 || 3 -> 6.5 MHz - -Node should be child node of stmpe node to which it belongs. - -Note that common ADC settings of stmpe_touchscreen (child) will take prece= dence -over the settings done in MFD. - -Example: - -stmpe811@41 { - compatible =3D "st,stmpe811"; - pinctrl-names =3D "default"; - pinctrl-0 =3D <&pinctrl_touch_int>; - #address-cells =3D <1>; - #size-cells =3D <0>; - reg =3D <0x41>; - interrupts =3D <10 IRQ_TYPE_LEVEL_LOW>; - interrupt-parent =3D <&gpio4>; - interrupt-controller; - id =3D <0>; - blocks =3D <0x5>; - irq-trigger =3D <0x1>; - /* Common ADC settings */ - /* 3.25 MHz ADC clock speed */ - st,adc-freq =3D <1>; - /* 12-bit ADC */ - st,mod-12b =3D <1>; - /* internal ADC reference */ - st,ref-sel =3D <0>; - /* ADC converstion time: 80 clocks */ - st,sample-time =3D <4>; - - stmpe_touchscreen { - compatible =3D "st,stmpe-ts"; - reg =3D <0>; - /* 8 sample average control */ - st,ave-ctrl =3D <3>; - /* 5 ms touch detect interrupt delay */ - st,touch-det-delay =3D <5>; - /* 1 ms panel driver settling time */ - st,settling =3D <3>; - /* 7 length fractional part in z */ - st,fraction-z =3D <7>; - /* - * 50 mA typical 80 mA max touchscreen drivers - * current limit value - */ - st,i-drive =3D <1>; - }; - stmpe_adc { - compatible =3D "st,stmpe-adc"; - st,norequest-mask =3D <0x0F>; - }; -}; diff --git a/Documentation/devicetree/bindings/mfd/st,stmpe.yaml b/Document= ation/devicetree/bindings/mfd/st,stmpe.yaml new file mode 100644 index 000000000000..b77cc3f3075d --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/st,stmpe.yaml @@ -0,0 +1,297 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/st,stmpe.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: STMicroelectonics Port Expander (STMPE) + +description: STMicroelectronics Port Expander (STMPE) is a series of slow + bus controllers for various expanded peripherals such as GPIO, keypad, + touchscreen, ADC, PWM or rotator. It can contain one or several different + peripherals connected to SPI or I2C. + +maintainers: + - Linus Walleij + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml# + +properties: + compatible: + enum: + - st,stmpe601 + - st,stmpe801 + - st,stmpe811 + - st,stmpe1600 + - st,stmpe1601 + - st,stmpe2401 + - st,stmpe2403 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vcc-supply: true + + vio-supply: true + + reset-gpios: + maxItems: 1 + + wakeup-source: true + + st,autosleep-timeout: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 4, 16, 32, 64, 128, 256, 512, 1024 ] + description: Time idle before going to automatic sleep to save power + + st,sample-time: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 0, 1, 2, 3, 4, 5, 6 ] + description: | + Sample time per iteration + 0 =3D 36 clock ticks + 1 =3D 44 clock ticks + 2 =3D 56 clock ticks + 3 =3D 64 clock ticks + 4 =3D 80 clock ticks - recommended + 5 =3D 96 clock ticks + 6 =3D 124 clock ticks + + st,mod-12b: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 0, 1 ] + description: ADC bit mode 0 =3D 10bit ADC, 1 =3D 12bit ADC + + st,ref-sel: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 0, 1 ] + description: ADC reference source 0 =3D internal, 1 =3D external + + st,adc-freq: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 0, 1, 2, 3 ] + description: | + ADC clock speed + 0 =3D 1.625 MHz + 1 =3D 3.25 MHz + 2, 3 =3D 6.5 MHz + + adc: + type: object + $ref: /schemas/iio/adc/st,stmpe-adc.yaml# + + gpio: + type: object + $ref: /schemas/gpio/st,stmpe-gpio.yaml# + + keyboard-controller: + type: object + $ref: /schemas/input/matrix-keymap.yaml# + + unevaluatedProperties: false + + properties: + compatible: + const: st,stmpe-keypad + + debounce-interval: + description: Debouncing interval in milliseconds + $ref: /schemas/types.yaml#/definitions/uint32 + + st,no-autorepeat: + description: If present, the keys will not autorepeat when pressed + $ref: /schemas/types.yaml#/definitions/flag + + st,scan-count: + description: Scanning cycles elapsed before key data is updated + $ref: /schemas/types.yaml#/definitions/uint32 + + required: + - compatible + - linux,keymap + + pwm: + type: object + $ref: /schemas/pwm/pwm.yaml# + + unevaluatedProperties: false + + properties: + compatible: + const: st,stmpe-pwm + + "#pwm-cells": + const: 2 + + touchscreen: + type: object + $ref: /schemas/input/touchscreen/touchscreen.yaml# + + unevaluatedProperties: false + + properties: + compatible: + const: st,stmpe-ts + + st,ave-ctrl: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 0, 1, 2, 3 ] + description: | + Sample average control + 0 =3D 1 sample + 1 =3D 2 samples + 2 =3D 4 samples + 3 =3D 8 samples + + st,touch-det-delay: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ] + description: | + Touch detection delay + 0 =3D 10 us + 1 =3D 50 us + 2 =3D 100 us + 3 =3D 500 us - recommended + 4 =3D 1 ms + 5 =3D 5 ms + 6 =3D 10 ms + 7 =3D 50 ms + + st,settling: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ] + description: | + Panel driver settling time + 0 =3D 10 us + 1 =3D 100 us + 2 =3D 500 us - recommended + 3 =3D 1 ms + 4 =3D 5 ms + 5 =3D 10 ms + 6 =3D 50 ms + 7 =3D 100 ms + + st,fraction-z: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ] + description: Length of the fractional part in z, recommended is 7 + (fraction-z ([0..7]) =3D Count of the fractional part) + + st,i-drive: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 0, 1 ] + description: | + current limit value of the touchscreen drivers + 0 =3D 20 mA (typical 35 mA max) + 1 =3D 50 mA (typical 80 mA max) + + required: + - compatible + +additionalProperties: false + +required: + - compatible + - reg + - interrupts + +examples: + - | + #include + #include + #include + i2c { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port-expander@43 { + compatible =3D "st,stmpe2401"; + reg =3D <0x43>; + reset-gpios =3D <&gpio 13 GPIO_ACTIVE_LOW>; + interrupts =3D <26 IRQ_TYPE_EDGE_FALLING>; + interrupt-parent =3D <&gpio>; + vcc-supply =3D <&db8500_vsmps2_reg>; + vio-supply =3D <&db8500_vsmps2_reg>; + wakeup-source; + st,autosleep-timeout =3D <1024>; + + gpio { + compatible =3D "st,stmpe-gpio"; + gpio-controller; + #gpio-cells =3D <2>; + interrupt-controller; + #interrupt-cells =3D <2>; + st,norequest-mask =3D <0xf0f002>; + }; + + keyboard-controller { + compatible =3D "st,stmpe-keypad"; + debounce-interval =3D <64>; + st,scan-count =3D <8>; + st,no-autorepeat; + keypad,num-rows =3D <8>; + keypad,num-columns =3D <8>; + linux,keymap =3D < + MATRIX_KEY(0x00, 0x00, KEY_1) + MATRIX_KEY(0x00, 0x01, KEY_2) + MATRIX_KEY(0x00, 0x02, KEY_3) + MATRIX_KEY(0x00, 0x03, KEY_4) + MATRIX_KEY(0x00, 0x04, KEY_5) + MATRIX_KEY(0x00, 0x05, KEY_6) + MATRIX_KEY(0x00, 0x06, KEY_7) + MATRIX_KEY(0x00, 0x07, KEY_8) + MATRIX_KEY(0x00, 0x08, KEY_9) + MATRIX_KEY(0x00, 0x09, KEY_0) + >; + }; + + pwm { + compatible =3D "st,stmpe-pwm"; + #pwm-cells =3D <2>; + }; + }; + + port-expander@41 { + compatible =3D "st,stmpe811"; + reg =3D <0x41>; + interrupts =3D <10 IRQ_TYPE_LEVEL_LOW>; + interrupt-parent =3D <&gpio>; + st,adc-freq =3D <1>; + st,mod-12b =3D <1>; + st,ref-sel =3D <0>; + st,sample-time =3D <4>; + + adc { + compatible =3D "st,stmpe-adc"; + st,norequest-mask =3D <0x0f>; + #io-channel-cells =3D <1>; + }; + + gpio { + compatible =3D "st,stmpe-gpio"; + gpio-controller; + #gpio-cells =3D <2>; + interrupt-controller; + #interrupt-cells =3D <2>; + }; + + pwm { + compatible =3D "st,stmpe-pwm"; + #pwm-cells =3D <2>; + }; + + touchscreen { + compatible =3D "st,stmpe-ts"; + st,ave-ctrl =3D <3>; + st,touch-det-delay =3D <5>; + st,settling =3D <3>; + st,fraction-z =3D <7>; + st,i-drive =3D <1>; + }; + }; + }; +... diff --git a/Documentation/devicetree/bindings/mfd/stmpe.txt b/Documentatio= n/devicetree/bindings/mfd/stmpe.txt deleted file mode 100644 index d4408a417193..000000000000 --- a/Documentation/devicetree/bindings/mfd/stmpe.txt +++ /dev/null @@ -1,42 +0,0 @@ -* ST Microelectronics STMPE Multi-Functional Device - -STMPE is an MFD device which may expose the following inbuilt devices: gpi= o, -keypad, touchscreen, adc, pwm, rotator. - -Required properties: - - compatible : "st,stmpe[610|801|811|1600|1601|2401|2403]" - - reg : I2C/SPI address of the device - -Optional properties: - - interrupts : The interrupt outputs from the controller - - interrupt-controller : Marks the device node as an interrupt controller - - wakeup-source : Marks the input device as wakable - - st,autosleep-timeout : Valid entries (ms); 4, 16, 32, 64, 128, 256, 51= 2 and 1024 - - irq-gpio : If present, which GPIO to use for event IRQ - -Optional properties for devices with touch and ADC (STMPE811|STMPE610): - - st,sample-time : ADC conversion time in number of clock. - 0 -> 36 clocks 4 -> 80 clocks (recommended) - 1 -> 44 clocks 5 -> 96 clocks - 2 -> 56 clocks 6 -> 124 clocks - 3 -> 64 clocks - - st,mod-12b : ADC Bit mode - 0 -> 10bit ADC 1 -> 12bit ADC - - st,ref-sel : ADC reference source - 0 -> internal 1 -> external - - st,adc-freq : ADC Clock speed - 0 -> 1.625 MHz 2 || 3 -> 6.5 MHz - 1 -> 3.25 MHz - -Example: - - stmpe1601: stmpe1601@40 { - compatible =3D "st,stmpe1601"; - reg =3D <0x40>; - interrupts =3D <26 0x4>; - interrupt-parent =3D <&gpio6>; - interrupt-controller; - - wakeup-source; - st,autosleep-timeout =3D <1024>; - }; --=20 2.34.1