From patchwork Sat Nov 5 14:17:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 15974 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1021998wru; Sat, 5 Nov 2022 07:35:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4yioSyd9FuipK/9Zg+5zYVU/LvOI7wQtl9XM9GUhP6+G83ryzfNKqZgkCnV8BtdEl46HIP X-Received: by 2002:a17:907:da5:b0:7ad:7e95:6513 with SMTP id go37-20020a1709070da500b007ad7e956513mr40600226ejc.442.1667658917963; Sat, 05 Nov 2022 07:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667658917; cv=none; d=google.com; s=arc-20160816; b=TtWBeWTpUUBySCHh9qCd8Af34oD8ZgYM9u4AFioDi2s7yN4QkRoL6v/a4O7+phCz5R t4BZxKo72m+0whjj/mos77K2rYaW1/9aUS9urG8hQAt3xFQ8GSRffXx5PQGhkjbaD17y Y9yGae3Ick0F3RhFPKqT9zLb0Lg/YTNTGXGSM8gfjpDiZthF2wOc5eFkm0PBGFyYloL3 xEfaoNSTIwEYet3J304vA+7h003BYB27D++UNaLPT5d19zPij6X4BavzfWX2uJyeCL8x sdGK73KvGDSCHm8wcW1cCU5107ptU5W1SlUewWXJUutLHbbPnpzBoZipULuqhDYffcvv eSiQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=u0SD2bosuKaRTnehq4DCxIPVUekWB8Ab4xECahVAGd4=; b=DSQVQioRhtlFf9muY1oGUg/UIEnpeI7DvY5WD2g7QlhtJARYDYC4gXbrYfqfeL1gnI s7h8wDcxfjCOEAlIkEbBfSf9VZTZW5r2Wyn1InUJhYQagzugBQV50i9pzHeDz0R8QcIO z2TjXkoUYUYKxbY0570SqEYEp8pvaKqFzW9GYhsKB5/Wz2VCuogG7wEp0mrq8b+ImMkV wuJhdZaVHXksiLVuR4PMn0vXhSsnnlbYV65kBZszpQLKw/PQZfKSN//Icd9Ia1A72/Xb Fu5GcIMsPqEwYlHf2jjpS0xvGAe8h+lnY41p3eNK0tgI9srjC9X104ArkEbQ6IyTZd8e Z7ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@z3ntu.xyz header.s=z3ntu header.b="pmYbjG/h"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=z3ntu.xyz Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt3-20020a170907728300b0078db371355esi2409055ejc.987.2022.11.05.07.34.54; Sat, 05 Nov 2022 07:35:17 -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=fail header.i=@z3ntu.xyz header.s=z3ntu header.b="pmYbjG/h"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=z3ntu.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbiKEOTG (ORCPT + 99 others); Sat, 5 Nov 2022 10:19:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229851AbiKEOSv (ORCPT ); Sat, 5 Nov 2022 10:18:51 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07D6FBBD; Sat, 5 Nov 2022 07:18:36 -0700 (PDT) Received: from g550jk.. (unknown [46.183.103.8]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 48C9AD0409; Sat, 5 Nov 2022 14:18:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1667657914; bh=1SgFc7do9FxwPKWcXsHvto6nssiqHLSglAvy8Itz6a8=; h=From:To:Cc:Subject:Date; b=pmYbjG/hx1B1rKL9yk3VFW6u/4xnu4cyvNIakg6Ss/ZxoTjS3VqjMX2FVT8LNga9z RmGropT1C1ix57+gJ6DE7Om1An3PImYgTUXpbBQb5efuQlGs9UjkRkCDynFx940NY7 fE3viUvYIU3mkTUyCpyrKltn7lPOTS8iEqpzZAmc= From: Luca Weiss To: linux-input@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Luca Weiss , Andrew Davis , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] dt-bindings: input: Convert ti,drv260x to DT schema Date: Sat, 5 Nov 2022 15:17:06 +0100 Message-Id: <20221105141707.92652-1-luca@z3ntu.xyz> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Spam-Status: No, score=4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, FROM_SUSPICIOUS_NTLD_FP,PDS_OTHER_BAD_TLD,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: **** 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748667117520547948?= X-GMAIL-MSGID: =?utf-8?q?1748667117520547948?= 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. Acked-by: Andrew Davis Signed-off-by: Luca Weiss --- Changes since v2: * add default values for vib-*-mv * add note about 'mode' property * add enable-gpios, deprecate enable-gpio .../devicetree/bindings/input/ti,drv260x.txt | 50 -------- .../devicetree/bindings/input/ti,drv260x.yaml | 109 ++++++++++++++++++ 2 files changed, 109 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 = ; - library-sel = ; - 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..63230977043e --- /dev/null +++ b/Documentation/devicetree/bindings/input/ti,drv260x.yaml @@ -0,0 +1,109 @@ +# 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: + - Andrew Davis + +properties: + compatible: + enum: + - ti,drv2604 + - ti,drv2605 + - ti,drv2605l + + reg: + maxItems: 1 + + vbat-supply: + description: Power supply to the haptic motor + + # TODO: Deprecate 'mode' in favor of differently named property + mode: + $ref: /schemas/types.yaml#/definitions/uint32 + 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 ] + + library-sel: + $ref: /schemas/types.yaml#/definitions/uint32 + 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 ] + + enable-gpio: + maxItems: 1 + deprecated: true + + enable-gpios: + maxItems: 1 + + vib-rated-mv: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + The rated voltage of the actuator in millivolts. + If this is not set then the value will be defaulted to 3200 mV. + default: 3200 + + vib-overdrive-mv: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + The overdrive voltage of the actuator in millivolts. + If this is not set then the value will be defaulted to 3200 mV. + default: 3200 + +required: + - compatible + - reg + - enable-gpio + - mode + - library-sel + +additionalProperties: false + +examples: + - | + #include + #include + + 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 = ; + library-sel = ; + vib-rated-mv = <3200>; + vib-overdrive-mv = <3200>; + }; + };