linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Tony Lindgren <tony@atomide.com>,
	linux-input@vger.kernel.org, linux-omap@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCHv3 1/2] Input: pwm-vibra: new driver
Date: Mon, 8 May 2017 20:38:52 +0200	[thread overview]
Message-ID: <20170508183852.k7tlnglxkl7dtsfy@earth> (raw)
In-Reply-To: <20170508173121.v45f76tyihk2x5xq@rob-hp-laptop>

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

Hi Rob,

On Mon, May 08, 2017 at 12:31:21PM -0500, Rob Herring wrote:
> On Fri, May 05, 2017 at 11:28:22AM +0200, Sebastian Reichel wrote:
> > Provide a simple driver for PWM controllable vibrators. It
> > will be used by Motorola Droid 4.
> > 
> > Tested-by: Tony Lindgren <tony@atomide.com>
> > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
> > ---
> > Changes since PATCHv1:
> >  - move driver removal code to input->close function
> >  - mark PM functions __maybe_unused and drop #ifdef CONFIG_PM_SLEEP
> >  - remove duplicate NULL check for vibrator in probe function
> >  - cancel work in suspend function
> > Changes since PATCHv2:
> >  - Add Kconfig dependency on INPUT_FF_MEMLESS
> >  - Add Tested-by from Tiny Lindgren
> > ---
> >  .../devicetree/bindings/input/pwm-vibrator.txt     |  60 ++++
> >  drivers/input/misc/Kconfig                         |  12 +
> >  drivers/input/misc/Makefile                        |   1 +
> >  drivers/input/misc/pwm-vibra.c                     | 343 +++++++++++++++++++++
> >  4 files changed, 416 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/input/pwm-vibrator.txt
> >  create mode 100644 drivers/input/misc/pwm-vibra.c
> > 
> > diff --git a/Documentation/devicetree/bindings/input/pwm-vibrator.txt b/Documentation/devicetree/bindings/input/pwm-vibrator.txt
> > new file mode 100644
> > index 000000000000..c35be4691366
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/input/pwm-vibrator.txt
> > @@ -0,0 +1,60 @@
> > +* PWM vibrator device tree bindings
> > +
> > +Registers a PWM device as vibrator.
> > +
> > +Required properties:
> > +- compatible: should be
> > +  * "pwm-vibrator"
> > +    For vibrators controlled using the PWM channel's duty cycle (higher duty means
> > +    the vibrator becomes stronger).
> > +  * "motorola,mapphone-pwm-vibrator"
> > +     For vibrator found in Motorola Droid 4. This vibrator generates a pulse for
> > +     every rising edge, so its controlled using a duty cycle of 50% and changing
> 
> s/its/it's/
> 
> > +     the period time.
> 
> What does "controlled" mean? strength? Shorter period is stronger?

well it controls pulses / second. Basically more pulses / second
result in smother vibration effect, but reduced strength.

> > +- pwm-names: Should contain "enable" and optionally "direction"
> 
> What does direction mean? Does that apply to both compatibles.

I don't know for sure (I took over the names from stock kernel), but
I assume, that the rotation direction of the vibrator is changed.

> > +- pwms: Should contain a PWM handle for each entry in pwm-names

-- Sebastian

> > +
> > +Example from Motorola Droid 4:
> > +
> > +&omap4_pmx_core {
> > +	vibrator_direction_pin: pinmux_vibrator_direction_pin {
> > +		pinctrl-single,pins = <
> > +		OMAP4_IOPAD(0x1ce, PIN_OUTPUT | MUX_MODE1) /* dmtimer8_pwm_evt (gpio_27) */
> > +		>;
> > +	};
> > +
> > +	vibrator_enable_pin: pinmux_vibrator_enable_pin {
> > +		pinctrl-single,pins = <
> > +		OMAP4_IOPAD(0X1d0, PIN_OUTPUT | MUX_MODE1) /* dmtimer9_pwm_evt (gpio_28) */
> > +		>;
> > +	};
> > +};
> > +
> > +/ {
> > +	pwm8: dmtimer-pwm {
> > +		pinctrl-names = "default";
> > +		pinctrl-0 = <&vibrator_direction_pin>;
> > +
> > +		compatible = "ti,omap-dmtimer-pwm";
> > +		#pwm-cells = <3>;
> > +		ti,timers = <&timer8>;
> > +		ti,clock-source = <0x01>;
> > +	};
> > +
> > +	pwm9: dmtimer-pwm {
> > +		pinctrl-names = "default";
> > +		pinctrl-0 = <&vibrator_enable_pin>;
> > +
> > +		compatible = "ti,omap-dmtimer-pwm";
> > +		#pwm-cells = <3>;
> > +		ti,timers = <&timer9>;
> > +		ti,clock-source = <0x01>;
> > +	};
> > +
> > +	vibrator {
> > +		compatible = "pwm-vibrator";
> > +		pwms = <&pwm8 0 1000000000 0>,
> > +		       <&pwm9 0 1000000000 0>;
> > +		pwm-names = "enable", "direction";
> > +	};
> > +};

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

  reply	other threads:[~2017-05-08 18:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05  9:28 [PATCHv3 0/2] PWM Vibrator driver Sebastian Reichel
2017-05-05  9:28 ` [PATCHv3 1/2] Input: pwm-vibra: new driver Sebastian Reichel
2017-05-07 21:38   ` Dmitry Torokhov
2017-05-08 18:51     ` Sebastian Reichel
2017-05-10 21:56       ` Dmitry Torokhov
2017-05-08 17:31   ` Rob Herring
2017-05-08 18:38     ` Sebastian Reichel [this message]
2017-05-05  9:28 ` [PATCHv3 2/2] ARM: dts: omap4-droid4: Add vibrator Sebastian Reichel

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=20170508183852.k7tlnglxkl7dtsfy@earth \
    --to=sre@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=tony@atomide.com \
    /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 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).