Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1636265

[PATCHv3 0/2] PWM Vibrator driver

From Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Newsgroups linux.kernel
Subject [PATCHv3 0/2] PWM Vibrator driver
Date 2017-05-05 11:30 +0200
Message-ID <tDHIJ-8ec-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCHv3 0/2] PWM Vibrator driver Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-05-05 11:30 +0200
  [PATCHv3 1/2] Input: pwm-vibra: new driver Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-05-05 11:30 +0200
    Re: [PATCHv3 1/2] Input: pwm-vibra: new driver Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-05-07 23:40 +0200
      Re: [PATCHv3 1/2] Input: pwm-vibra: new driver Sebastian Reichel <sre@kernel.org> - 2017-05-08 21:00 +0200
        Re: [PATCHv3 1/2] Input: pwm-vibra: new driver Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-05-11 00:00 +0200
    Re: [PATCHv3 1/2] Input: pwm-vibra: new driver Rob Herring <robh@kernel.org> - 2017-05-08 19:40 +0200
      Re: [PATCHv3 1/2] Input: pwm-vibra: new driver Sebastian Reichel <sre@kernel.org> - 2017-05-08 20:40 +0200
  [PATCHv3 2/2] ARM: dts: omap4-droid4: Add vibrator Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-05-05 11:30 +0200

csiph-web