linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Add support for vibrator motor for TBS A711 Tablet
@ 2020-02-22 23:14 Ondrej Jirman
  2020-02-22 23:14 ` [PATCH 1/4] dt-bindings: input: gpio-vibrator: Don't require enable-gpios Ondrej Jirman
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Ondrej Jirman @ 2020-02-22 23:14 UTC (permalink / raw)
  To: linux-sunxi, Dmitry Torokhov, Rob Herring, Maxime Ripard, Chen-Yu Tsai
  Cc: Ondrej Jirman, Mark Rutland, Luca Weiss, Tomas Novotny,
	linux-input, devicetree, linux-kernel, linux-arm-kernel

The tablet has a vibrator. Expose it via input subsystem (EV_FF).

Please take a look.

thank you and regards,
  Ondrej Jirman

Ondrej Jirman (4):
  dt-bindings: input: gpio-vibrator: Don't require enable-gpios
  input: gpio-vibra: Allow to use vcc-supply alone to control the
    vibrator
  ARM: dts: sun8i-a83t-tbs-a711: Add support for the vibrator motor
  ARM: dts: sun8i-a83t-tbs-a711: Increase voltage on the vibrator

 .../devicetree/bindings/input/gpio-vibrator.yaml         | 1 -
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts                | 9 +++++++--
 drivers/input/misc/gpio-vibra.c                          | 3 ++-
 3 files changed, 9 insertions(+), 4 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/4] dt-bindings: input: gpio-vibrator: Don't require enable-gpios
  2020-02-22 23:14 [PATCH 0/4] Add support for vibrator motor for TBS A711 Tablet Ondrej Jirman
@ 2020-02-22 23:14 ` Ondrej Jirman
  2020-02-26 22:25   ` Rob Herring
  2020-02-22 23:14 ` [PATCH 2/4] input: gpio-vibra: Allow to use vcc-supply alone to control the vibrator Ondrej Jirman
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Ondrej Jirman @ 2020-02-22 23:14 UTC (permalink / raw)
  To: linux-sunxi, Dmitry Torokhov, Rob Herring, Maxime Ripard, Chen-Yu Tsai
  Cc: Ondrej Jirman, Mark Rutland, Luca Weiss, Tomas Novotny,
	linux-input, devicetree, linux-kernel, linux-arm-kernel

It is possible to turn the motor on/off just by enabling/disabling
the vcc-supply.

Signed-off-by: Ondrej Jirman <megous@megous.com>
---
 Documentation/devicetree/bindings/input/gpio-vibrator.yaml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/input/gpio-vibrator.yaml b/Documentation/devicetree/bindings/input/gpio-vibrator.yaml
index b98bf9363c8ff..f8f4093a0a454 100644
--- a/Documentation/devicetree/bindings/input/gpio-vibrator.yaml
+++ b/Documentation/devicetree/bindings/input/gpio-vibrator.yaml
@@ -24,7 +24,6 @@ properties:
 
 required:
   - compatible
-  - enable-gpios
 
 examples:
   - |
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/4] input: gpio-vibra: Allow to use vcc-supply alone to control the vibrator
  2020-02-22 23:14 [PATCH 0/4] Add support for vibrator motor for TBS A711 Tablet Ondrej Jirman
  2020-02-22 23:14 ` [PATCH 1/4] dt-bindings: input: gpio-vibrator: Don't require enable-gpios Ondrej Jirman
@ 2020-02-22 23:14 ` Ondrej Jirman
  2020-02-22 23:14 ` [PATCH 3/4] ARM: dts: sun8i-a83t-tbs-a711: Add support for the vibrator motor Ondrej Jirman
  2020-02-22 23:14 ` [PATCH 4/4] ARM: dts: sun8i-a83t-tbs-a711: Increase voltage on the vibrator Ondrej Jirman
  3 siblings, 0 replies; 9+ messages in thread
From: Ondrej Jirman @ 2020-02-22 23:14 UTC (permalink / raw)
  To: linux-sunxi, Dmitry Torokhov, Rob Herring, Maxime Ripard, Chen-Yu Tsai
  Cc: Ondrej Jirman, Mark Rutland, Luca Weiss, Tomas Novotny,
	linux-input, devicetree, linux-kernel, linux-arm-kernel

Make enable-gpio optional to allow using this driver with
boards that have vibrator connected to a power supply without
intermediate gpio based enable circuitry.

Signed-off-by: Ondrej Jirman <megous@megous.com>
---
 drivers/input/misc/gpio-vibra.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/misc/gpio-vibra.c b/drivers/input/misc/gpio-vibra.c
index f79f75595dd73..f11877f04b43c 100644
--- a/drivers/input/misc/gpio-vibra.c
+++ b/drivers/input/misc/gpio-vibra.c
@@ -121,7 +121,8 @@ static int gpio_vibrator_probe(struct platform_device *pdev)
 		return err;
 	}
 
-	vibrator->gpio = devm_gpiod_get(&pdev->dev, "enable", GPIOD_OUT_LOW);
+	vibrator->gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
+						 GPIOD_OUT_LOW);
 	err = PTR_ERR_OR_ZERO(vibrator->gpio);
 	if (err) {
 		if (err != -EPROBE_DEFER)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/4] ARM: dts: sun8i-a83t-tbs-a711: Add support for the vibrator motor
  2020-02-22 23:14 [PATCH 0/4] Add support for vibrator motor for TBS A711 Tablet Ondrej Jirman
  2020-02-22 23:14 ` [PATCH 1/4] dt-bindings: input: gpio-vibrator: Don't require enable-gpios Ondrej Jirman
  2020-02-22 23:14 ` [PATCH 2/4] input: gpio-vibra: Allow to use vcc-supply alone to control the vibrator Ondrej Jirman
@ 2020-02-22 23:14 ` Ondrej Jirman
  2020-02-24  9:10   ` Maxime Ripard
  2020-02-22 23:14 ` [PATCH 4/4] ARM: dts: sun8i-a83t-tbs-a711: Increase voltage on the vibrator Ondrej Jirman
  3 siblings, 1 reply; 9+ messages in thread
From: Ondrej Jirman @ 2020-02-22 23:14 UTC (permalink / raw)
  To: linux-sunxi, Dmitry Torokhov, Rob Herring, Maxime Ripard, Chen-Yu Tsai
  Cc: Ondrej Jirman, Mark Rutland, Luca Weiss, Tomas Novotny,
	linux-input, devicetree, linux-kernel, linux-arm-kernel

The board has a vibrator mottor. Hook it to the input subsystem.

Signed-off-by: Ondrej Jirman <megous@megous.com>
---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 2fd31a0a0b344..a22920275e99b 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -99,6 +99,11 @@ panel_input: endpoint {
 		};
 	};
 
+	vibrator {
+		compatible = "gpio-vibrator";
+		vcc-supply = <&reg_ldo_io1>;
+	};
+
 	reg_gps: reg-gps {
 		compatible = "regulator-fixed";
 		regulator-name = "gps";
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/4] ARM: dts: sun8i-a83t-tbs-a711: Increase voltage on the vibrator
  2020-02-22 23:14 [PATCH 0/4] Add support for vibrator motor for TBS A711 Tablet Ondrej Jirman
                   ` (2 preceding siblings ...)
  2020-02-22 23:14 ` [PATCH 3/4] ARM: dts: sun8i-a83t-tbs-a711: Add support for the vibrator motor Ondrej Jirman
@ 2020-02-22 23:14 ` Ondrej Jirman
  3 siblings, 0 replies; 9+ messages in thread
From: Ondrej Jirman @ 2020-02-22 23:14 UTC (permalink / raw)
  To: linux-sunxi, Dmitry Torokhov, Rob Herring, Maxime Ripard, Chen-Yu Tsai
  Cc: Ondrej Jirman, Mark Rutland, Luca Weiss, Tomas Novotny,
	linux-input, devicetree, linux-kernel, linux-arm-kernel

Vibrator motor is weak at the current voltage. Increase the voltage.

Signed-off-by: Ondrej Jirman <megous@megous.com>
---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index a22920275e99b..314491cdafca2 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -434,8 +434,8 @@ &reg_ldo_io0 {
 };
 
 &reg_ldo_io1 {
-	regulator-min-microvolt = <3100000>;
-	regulator-max-microvolt = <3100000>;
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
 	regulator-name = "vcc-vb";
 	status = "okay";
 };
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/4] ARM: dts: sun8i-a83t-tbs-a711: Add support for the vibrator motor
  2020-02-22 23:14 ` [PATCH 3/4] ARM: dts: sun8i-a83t-tbs-a711: Add support for the vibrator motor Ondrej Jirman
@ 2020-02-24  9:10   ` Maxime Ripard
  2020-02-24 14:14     ` Ondřej Jirman
  0 siblings, 1 reply; 9+ messages in thread
From: Maxime Ripard @ 2020-02-24  9:10 UTC (permalink / raw)
  To: Ondrej Jirman
  Cc: linux-sunxi, Dmitry Torokhov, Rob Herring, Chen-Yu Tsai,
	Mark Rutland, Luca Weiss, Tomas Novotny, linux-input, devicetree,
	linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

Hi,

On Sun, Feb 23, 2020 at 12:14:27AM +0100, Ondrej Jirman wrote:
> The board has a vibrator mottor. Hook it to the input subsystem.
>
> Signed-off-by: Ondrej Jirman <megous@megous.com>
> ---
>  arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> index 2fd31a0a0b344..a22920275e99b 100644
> --- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> +++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> @@ -99,6 +99,11 @@ panel_input: endpoint {
>  		};
>  	};
>
> +	vibrator {
> +		compatible = "gpio-vibrator";
> +		vcc-supply = <&reg_ldo_io1>;
> +	};
> +

LDO IO1 can also be muxed in as a GPIO iirc, why did you choose the
regulator instead?

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/4] ARM: dts: sun8i-a83t-tbs-a711: Add support for the vibrator motor
  2020-02-24  9:10   ` Maxime Ripard
@ 2020-02-24 14:14     ` Ondřej Jirman
  2020-02-24 16:13       ` Maxime Ripard
  0 siblings, 1 reply; 9+ messages in thread
From: Ondřej Jirman @ 2020-02-24 14:14 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: linux-sunxi, Dmitry Torokhov, Rob Herring, Chen-Yu Tsai,
	Mark Rutland, Luca Weiss, Tomas Novotny, linux-input, devicetree,
	linux-kernel, linux-arm-kernel

Hello,

On Mon, Feb 24, 2020 at 10:10:59AM +0100, Maxime Ripard wrote:
> Hi,
> 
> On Sun, Feb 23, 2020 at 12:14:27AM +0100, Ondrej Jirman wrote:
> > The board has a vibrator mottor. Hook it to the input subsystem.
> >
> > Signed-off-by: Ondrej Jirman <megous@megous.com>
> > ---
> >  arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> > index 2fd31a0a0b344..a22920275e99b 100644
> > --- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> > +++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> > @@ -99,6 +99,11 @@ panel_input: endpoint {
> >  		};
> >  	};
> >
> > +	vibrator {
> > +		compatible = "gpio-vibrator";
> > +		vcc-supply = <&reg_ldo_io1>;
> > +	};
> > +
> 
> LDO IO1 can also be muxed in as a GPIO iirc, why did you choose the
> regulator instead?

According to the specification, LDO needs to be enabled (value 0b11)
to achieve the specified max driving current of 150mA:

  https://megous.com/dl/tmp/92b7d9d94820c3ba.png

Otherwise the chip is probably just using the regular CMOS logic output
(typically limited to around 20-35mA, but not specified in this datasheet),
which would be probably overdriven, if we try to drive the motor with it.

And since we're driving a motor directly, the more the better.

thank you and regards,
	o.

> Maxime



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/4] ARM: dts: sun8i-a83t-tbs-a711: Add support for the vibrator motor
  2020-02-24 14:14     ` Ondřej Jirman
@ 2020-02-24 16:13       ` Maxime Ripard
  0 siblings, 0 replies; 9+ messages in thread
From: Maxime Ripard @ 2020-02-24 16:13 UTC (permalink / raw)
  To: linux-sunxi, Dmitry Torokhov, Rob Herring, Chen-Yu Tsai,
	Mark Rutland, Luca Weiss, Tomas Novotny, linux-input, devicetree,
	linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1742 bytes --]

On Mon, Feb 24, 2020 at 03:14:37PM +0100, Ondřej Jirman wrote:
> Hello,
>
> On Mon, Feb 24, 2020 at 10:10:59AM +0100, Maxime Ripard wrote:
> > Hi,
> >
> > On Sun, Feb 23, 2020 at 12:14:27AM +0100, Ondrej Jirman wrote:
> > > The board has a vibrator mottor. Hook it to the input subsystem.
> > >
> > > Signed-off-by: Ondrej Jirman <megous@megous.com>
> > > ---
> > >  arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > >
> > > diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> > > index 2fd31a0a0b344..a22920275e99b 100644
> > > --- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> > > +++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> > > @@ -99,6 +99,11 @@ panel_input: endpoint {
> > >  		};
> > >  	};
> > >
> > > +	vibrator {
> > > +		compatible = "gpio-vibrator";
> > > +		vcc-supply = <&reg_ldo_io1>;
> > > +	};
> > > +
> >
> > LDO IO1 can also be muxed in as a GPIO iirc, why did you choose the
> > regulator instead?
>
> According to the specification, LDO needs to be enabled (value 0b11)
> to achieve the specified max driving current of 150mA:
>
>   https://megous.com/dl/tmp/92b7d9d94820c3ba.png
>
> Otherwise the chip is probably just using the regular CMOS logic output
> (typically limited to around 20-35mA, but not specified in this datasheet),
> which would be probably overdriven, if we try to drive the motor with it.
>
> And since we're driving a motor directly, the more the better.

Ok, that works for me then. This is typically the kind of things that
should be in your commit log though, since it's basically the
motivation for doing what you're doing in your patches.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/4] dt-bindings: input: gpio-vibrator: Don't require enable-gpios
  2020-02-22 23:14 ` [PATCH 1/4] dt-bindings: input: gpio-vibrator: Don't require enable-gpios Ondrej Jirman
@ 2020-02-26 22:25   ` Rob Herring
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2020-02-26 22:25 UTC (permalink / raw)
  To: Ondrej Jirman
  Cc: linux-sunxi, Dmitry Torokhov, Chen-Yu Tsai, Ondrej Jirman,
	Mark Rutland, Luca Weiss, Tomas Novotny, linux-input, devicetree,
	linux-kernel, linux-arm-kernel

On Sun, 23 Feb 2020 00:14:25 +0100, Ondrej Jirman wrote:
> It is possible to turn the motor on/off just by enabling/disabling
> the vcc-supply.
> 
> Signed-off-by: Ondrej Jirman <megous@megous.com>
> ---
>  Documentation/devicetree/bindings/input/gpio-vibrator.yaml | 1 -
>  1 file changed, 1 deletion(-)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-02-26 22:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-22 23:14 [PATCH 0/4] Add support for vibrator motor for TBS A711 Tablet Ondrej Jirman
2020-02-22 23:14 ` [PATCH 1/4] dt-bindings: input: gpio-vibrator: Don't require enable-gpios Ondrej Jirman
2020-02-26 22:25   ` Rob Herring
2020-02-22 23:14 ` [PATCH 2/4] input: gpio-vibra: Allow to use vcc-supply alone to control the vibrator Ondrej Jirman
2020-02-22 23:14 ` [PATCH 3/4] ARM: dts: sun8i-a83t-tbs-a711: Add support for the vibrator motor Ondrej Jirman
2020-02-24  9:10   ` Maxime Ripard
2020-02-24 14:14     ` Ondřej Jirman
2020-02-24 16:13       ` Maxime Ripard
2020-02-22 23:14 ` [PATCH 4/4] ARM: dts: sun8i-a83t-tbs-a711: Increase voltage on the vibrator Ondrej Jirman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).