Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8503720 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull more input updates from Dmitry Torokhov:
 "A second round of updates for the input subsystem:

   - a new driver for PWM-controlled vibrators

   - ucb1400 touchscreen driver had completely busted suspend/resume
     handling

   - we now handle "home" button found on some devices with Goodix
     touchscreens

   - assorted other fixups"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: i8042 - add Gigabyte P57 to the keyboard reset table
  Input: xpad - validate USB endpoint type during probe
  Input: ucb1400_ts - fix suspend and resume handling
  Input: edt-ft5x06 - fix access to non-existing register
  Input: elantech - make arrays debounce_packet static, reduces object code size
  Input: surface3_spi - make const array header static, reduces object code size
  Input: goodix - add support for capacitive home button
  Input: add a driver for PWM controllable vibrators
  Input: adi - make array seq static, reduces object code size
parents df85b2d7 bbc86087
Loading
Loading
Loading
Loading
+66 −0
Original line number Diff line number Diff line
* PWM vibrator device tree bindings

Registers a PWM device as vibrator. It is expected, that the vibrator's
strength increases based on the duty cycle of the enable PWM channel
(100% duty cycle meaning strongest vibration, 0% meaning no vibration).

The binding supports an optional direction PWM channel, that can be
driven at fixed duty cycle. If available this is can be used to increase
the vibration effect of some devices.

Required properties:
- compatible: should contain "pwm-vibrator"
- pwm-names: Should contain "enable" and optionally "direction"
- pwms: Should contain a PWM handle for each entry in pwm-names

Optional properties:
- vcc-supply: Phandle for the regulator supplying power
- direction-duty-cycle-ns: Duty cycle of the direction PWM channel in
                           nanoseconds, defaults to 50% of the channel's
			   period.

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";
		direction-duty-cycle-ns = <1000000000>;
	};
};
+1 −1
Original line number Diff line number Diff line
@@ -313,7 +313,7 @@ static void adi_close(struct input_dev *dev)

static void adi_init_digital(struct gameport *gameport)
{
	int seq[] = { 4, -2, -3, 10, -6, -11, -7, -9, 11, 0 };
	static const int seq[] = { 4, -2, -3, 10, -6, -11, -7, -9, 11, 0 };
	int i;

	for (i = 0; seq[i]; i++) {
+6 −4
Original line number Diff line number Diff line
@@ -1764,11 +1764,13 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
		struct usb_endpoint_descriptor *ep =
				&intf->cur_altsetting->endpoint[i].desc;

		if (usb_endpoint_xfer_int(ep)) {
			if (usb_endpoint_dir_in(ep))
				ep_irq_in = ep;
			else
				ep_irq_out = ep;
		}
	}

	if (!ep_irq_in || !ep_irq_out) {
		error = -ENODEV;
+12 −0
Original line number Diff line number Diff line
@@ -581,6 +581,18 @@ config INPUT_PWM_BEEPER
	  To compile this driver as a module, choose M here: the module will be
	  called pwm-beeper.

config INPUT_PWM_VIBRA
	tristate "PWM vibrator support"
	depends on PWM
	select INPUT_FF_MEMLESS
	help
	  Say Y here to get support for PWM based vibrator devices.

	  If unsure, say N.

	  To compile this driver as a module, choose M here: the module will be
	  called pwm-vibra.

config INPUT_RK805_PWRKEY
	tristate "Rockchip RK805 PMIC power key support"
	depends on MFD_RK808
+1 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ obj-$(CONFIG_INPUT_PM8XXX_VIBRATOR) += pm8xxx-vibrator.o
obj-$(CONFIG_INPUT_PMIC8XXX_PWRKEY)	+= pmic8xxx-pwrkey.o
obj-$(CONFIG_INPUT_POWERMATE)		+= powermate.o
obj-$(CONFIG_INPUT_PWM_BEEPER)		+= pwm-beeper.o
obj-$(CONFIG_INPUT_PWM_VIBRA)		+= pwm-vibra.o
obj-$(CONFIG_INPUT_RB532_BUTTON)	+= rb532_button.o
obj-$(CONFIG_INPUT_REGULATOR_HAPTIC)	+= regulator-haptic.o
obj-$(CONFIG_INPUT_RETU_PWRBUTTON)	+= retu-pwrbutton.o
Loading