From: Rob Herring <robh@kernel.org>
To: Luca Weiss <luca@z3ntu.xyz>
Cc: linux-input@vger.kernel.org,
~postmarketos/upstreaming@lists.sr.ht,
phone-devel@vger.kernel.org,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dt-bindings: input: Convert ti,drv260x to DT schema
Date: Thu, 13 Oct 2022 15:29:14 -0500 [thread overview]
Message-ID: <20221013202914.GA175270-robh@kernel.org> (raw)
In-Reply-To: <20221012214219.28976-1-luca@z3ntu.xyz>
On Wed, Oct 12, 2022 at 11:42:16PM +0200, Luca Weiss wrote:
> Convert the drv260x haptics binding to DT schema format.
>
> The only notable change from .txt format is that vbat-supply is not
> actually required, so don't make it a required property.
>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
> .../devicetree/bindings/input/ti,drv260x.txt | 50 ----------
> .../devicetree/bindings/input/ti,drv260x.yaml | 98 +++++++++++++++++++
> 2 files changed, 98 insertions(+), 50 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/input/ti,drv260x.txt
> create mode 100644 Documentation/devicetree/bindings/input/ti,drv260x.yaml
>
> diff --git a/Documentation/devicetree/bindings/input/ti,drv260x.txt b/Documentation/devicetree/bindings/input/ti,drv260x.txt
> deleted file mode 100644
> index 4c5312eaaa85..000000000000
> --- a/Documentation/devicetree/bindings/input/ti,drv260x.txt
> +++ /dev/null
> @@ -1,50 +0,0 @@
> -* Texas Instruments - drv260x Haptics driver family
> -
> -Required properties:
> - - compatible - One of:
> - "ti,drv2604" - DRV2604
> - "ti,drv2605" - DRV2605
> - "ti,drv2605l" - DRV2605L
> - - reg - I2C slave address
> - - vbat-supply - Required supply regulator
> - - mode - Power up mode of the chip (defined in include/dt-bindings/input/ti-drv260x.h)
> - DRV260X_LRA_MODE - Linear Resonance Actuator mode (Piezoelectric)
> - DRV260X_LRA_NO_CAL_MODE - This is a LRA Mode but there is no calibration
> - sequence during init. And the device is configured for real
> - time playback mode (RTP mode).
> - DRV260X_ERM_MODE - Eccentric Rotating Mass mode (Rotary vibrator)
> - - library-sel - These are ROM based waveforms pre-programmed into the IC.
> - This should be set to set the library to use at power up.
> - (defined in include/dt-bindings/input/ti-drv260x.h)
> - DRV260X_LIB_EMPTY - Do not use a pre-programmed library
> - DRV260X_ERM_LIB_A - Pre-programmed Library
> - DRV260X_ERM_LIB_B - Pre-programmed Library
> - DRV260X_ERM_LIB_C - Pre-programmed Library
> - DRV260X_ERM_LIB_D - Pre-programmed Library
> - DRV260X_ERM_LIB_E - Pre-programmed Library
> - DRV260X_ERM_LIB_F - Pre-programmed Library
> - DRV260X_LIB_LRA - Pre-programmed LRA Library
> -
> -Optional properties:
> - - enable-gpio - gpio pin to enable/disable the device.
> - - vib-rated-mv - The rated voltage of the actuator in millivolts.
> - If this is not set then the value will be defaulted to
> - 3.2 v.
> - - vib-overdrive-mv - The overdrive voltage of the actuator in millivolts.
> - If this is not set then the value will be defaulted to
> - 3.2 v.
> -Example:
> -
> -haptics: haptics@5a {
> - compatible = "ti,drv2605l";
> - reg = <0x5a>;
> - vbat-supply = <&vbat>;
> - enable-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
> - mode = <DRV260X_LRA_MODE>;
> - library-sel = <DRV260X_LIB_LRA>;
> - vib-rated-mv = <3200>;
> - vib-overdrive-mv = <3200>;
> -}
> -
> -For more product information please see the link below:
> -http://www.ti.com/product/drv2605
> diff --git a/Documentation/devicetree/bindings/input/ti,drv260x.yaml b/Documentation/devicetree/bindings/input/ti,drv260x.yaml
> new file mode 100644
> index 000000000000..7d67e815f80d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/ti,drv260x.yaml
> @@ -0,0 +1,98 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/ti,drv260x.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Texas Instruments - drv260x Haptics driver family
> +
> +maintainers:
> + - Dmitry Torokhov <dmitry.torokhov@gmail.com>
Should be someone that knows about and has this h/w, not who applies
patches.
> +
> +properties:
> + compatible:
> + enum:
> + - ti,drv2604
> + - ti,drv2605
> + - ti,drv2605l
> +
> + reg:
> + maxItems: 1
> +
> + vbat-supply:
> + description: Power supply to the haptic motor
> +
> + mode:
> + description: |
> + Power up mode of the chip
> + (defined in include/dt-bindings/input/ti-drv260x.h)
> +
> + DRV260X_LRA_MODE
> + Linear Resonance Actuator mode (Piezoelectric)
> +
> + DRV260X_LRA_NO_CAL_MODE
> + This is a LRA Mode but there is no calibration sequence during init.
> + And the device is configured for real time playback mode (RTP mode).
> +
> + DRV260X_ERM_MODE
> + Eccentric Rotating Mass mode (Rotary vibrator)
> + enum: [ 0, 1, 2 ]
Needs a type $ref.
> +
> + library-sel:
> + description: |
> + These are ROM based waveforms pre-programmed into the IC.
> + This should be set to set the library to use at power up.
> + (defined in include/dt-bindings/input/ti-drv260x.h)
> +
> + DRV260X_LIB_EMPTY - Do not use a pre-programmed library
> + DRV260X_ERM_LIB_A - Pre-programmed Library
> + DRV260X_ERM_LIB_B - Pre-programmed Library
> + DRV260X_ERM_LIB_C - Pre-programmed Library
> + DRV260X_ERM_LIB_D - Pre-programmed Library
> + DRV260X_ERM_LIB_E - Pre-programmed Library
> + DRV260X_ERM_LIB_F - Pre-programmed Library
> + DRV260X_LIB_LRA - Pre-programmed LRA Library
> + enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
Needs a type $ref.
> +
> + enable-gpio:
> + maxItems: 1
> +
> + vib-rated-mv:
As 'mv' is not the standard unit suffix, this needs a type $ref.
> + description: |
> + The rated voltage of the actuator in millivolts.
> + If this is not set then the value will be defaulted to 3200 mV.
> +
> + vib-overdrive-mv:
Ditto.
> + description: |
> + The overdrive voltage of the actuator in millivolts.
> + If this is not set then the value will be defaulted to 3200 mV.
> +
> +required:
> + - compatible
> + - reg
> + - enable-gpio
> + - mode
> + - library-sel
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> + #include <dt-bindings/input/ti-drv260x.h>
> +
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + haptics@5a {
> + compatible = "ti,drv2605l";
> + reg = <0x5a>;
> + vbat-supply = <&vbat>;
> + enable-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
> + mode = <DRV260X_LRA_MODE>;
> + library-sel = <DRV260X_LIB_LRA>;
> + vib-rated-mv = <3200>;
> + vib-overdrive-mv = <3200>;
> + };
> + };
> --
> 2.38.0
>
>
prev parent reply other threads:[~2022-10-13 20:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 21:42 [PATCH] dt-bindings: input: Convert ti,drv260x to DT schema Luca Weiss
2022-10-13 20:29 ` Rob Herring [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221013202914.GA175270-robh@kernel.org \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luca@z3ntu.xyz \
--cc=phone-devel@vger.kernel.org \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.