linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv3 0/2] PWM Vibrator driver
@ 2017-05-05  9:28 Sebastian Reichel
  2017-05-05  9:28 ` [PATCHv3 1/2] Input: pwm-vibra: new driver Sebastian Reichel
  2017-05-05  9:28 ` [PATCHv3 2/2] ARM: dts: omap4-droid4: Add vibrator Sebastian Reichel
  0 siblings, 2 replies; 8+ messages in thread
From: Sebastian Reichel @ 2017-05-05  9:28 UTC (permalink / raw)
  To: Sebastian Reichel, Dmitry Torokhov, Tony Lindgren
  Cc: Rob Herring, linux-input, linux-omap, devicetree, linux-kernel,
	Sebastian Reichel

Hi,

The Motorola Droid 4 has a vibrator, that is connected
to two GPIOs. Motorola's stock kernel names them vib_en
and vib_dir, which probably stand for vibrator_enable
and vibrator_direction. In their stock kernel both GPIOs
are toggled using a hrtimer and a custom vibrator "misc"
device is provided to userspace.

Thankfully the hardware designers the used GPIOs can
also be used from OMAP's dmtimers, so that they can
be driven as PWM output instead saving some CPU cycles
(and code).

The driver is loosely based on an old patch from Dmitry,
that I found in the internet(tm) [0]. Note, that I did
not check the generic vibrator stuff. I just kept it in
the driver, since it's probably what other people expect
from a pwm-vibra driver :)

Also I wrote a small tool to test the vibrator running
at different strength levels, since fftest(1) used a
fixed one.

[0] https://lkml.org/lkml/2012/4/10/41
[1] https://git.collabora.com/cgit/user/sre/rumble-test.git/plain/rumble-test.c

-- Sebastian

Sebastian Reichel (2):
  Input: pwm-vibra: new driver
  ARM: dts: omap4-droid4: Add vibrator

 .../devicetree/bindings/input/pwm-vibrator.txt     |  60 ++++
 arch/arm/boot/dts/omap4-droid4-xt894.dts           |  38 +++
 drivers/input/misc/Kconfig                         |  12 +
 drivers/input/misc/Makefile                        |   1 +
 drivers/input/misc/pwm-vibra.c                     | 343 +++++++++++++++++++++
 5 files changed, 454 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/pwm-vibrator.txt
 create mode 100644 drivers/input/misc/pwm-vibra.c

-- 
2.11.0

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

end of thread, other threads:[~2017-05-10 21:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2017-05-05  9:28 ` [PATCHv3 2/2] ARM: dts: omap4-droid4: Add vibrator Sebastian Reichel

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).