提交 7132fe4f 编写于 作者: D Dan Murphy 提交者: Dmitry Torokhov

Input: drv260x - add TI drv260x haptics driver

Add the TI drv260x haptics/vibrator driver.  This device uses the input
force feedback to produce a wave form to driver an ERM or LRA actuator
device.

The initial driver supports the devices real time playback mode.  But the
device has additional wave patterns in ROM. This functionality will be
added in future patchsets.

Product data sheet is located here: http://www.ti.com/product/drv2605Signed-off-by: NDan Murphy <dmurphy@ti.com>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 3361a976
Texas Instruments - drv260x Haptics driver family
The drv260x family serial control bus communicates through I2C protocols
Required properties:
- compatible - One of:
"ti,drv2604" - DRV2604
"ti,drv2605" - DRV2605
"ti,drv2605l" - DRV2605L
- reg - I2C slave address
- vbat-supply - Required supply regulator
- mode - Power up mode of the chip (defined in include/dt-bindings/input/ti-drv260x.h)
DRV260X_LRA_MODE - Linear Resonance Actuator mode (Piezoelectric)
DRV260X_LRA_NO_CAL_MODE - This is a LRA Mode but there is no calibration
sequence during init. And the device is configured for real
time playback mode (RTP mode).
DRV260X_ERM_MODE - Eccentric Rotating Mass mode (Rotary vibrator)
- library-sel - These are ROM based waveforms pre-programmed into the IC.
This should be set to set the library to use at power up.
(defined in include/dt-bindings/input/ti-drv260x.h)
DRV260X_LIB_EMPTY - Do not use a pre-programmed library
DRV260X_ERM_LIB_A - Pre-programmed Library
DRV260X_ERM_LIB_B - Pre-programmed Library
DRV260X_ERM_LIB_C - Pre-programmed Library
DRV260X_ERM_LIB_D - Pre-programmed Library
DRV260X_ERM_LIB_E - Pre-programmed Library
DRV260X_ERM_LIB_F - Pre-programmed Library
DRV260X_LIB_LRA - Pre-programmed LRA Library
Optional properties:
- enable-gpio - gpio pin to enable/disable the device.
- vib-rated-mv - The rated voltage of the actuator in millivolts.
If this is not set then the value will be defaulted to
3.2 v.
- vib-overdrive-mv - The overdrive voltage of the actuator in millivolts.
If this is not set then the value will be defaulted to
3.2 v.
Example:
drv2605l: drv2605l@5a {
compatible = "ti,drv2605l";
reg = <0x5a>;
enable-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
mode = <DRV260X_LRA_MODE>;
library-sel = <DRV260X_LIB_LRA>;
vib-rated-mv = <3200>;
vib-overdriver-mv = <3200>;
};
For more product information please see the link below:
http://www.ti.com/product/drv2605
......@@ -676,4 +676,15 @@ config INPUT_SOC_BUTTON_ARRAY
To compile this driver as a module, choose M here: the
module will be called soc_button_array.
config INPUT_DRV260X_HAPTICS
tristate "TI DRV260X haptics support"
depends on INPUT && I2C && GPIOLIB
select INPUT_FF_MEMLESS
select REGMAP_I2C
help
Say Y to enable support for the TI DRV260X haptics driver.
To compile this driver as a module, choose M here: the
module will be called drv260x-haptics.
endif
......@@ -26,6 +26,7 @@ obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o
obj-$(CONFIG_INPUT_DA9052_ONKEY) += da9052_onkey.o
obj-$(CONFIG_INPUT_DA9055_ONKEY) += da9055_onkey.o
obj-$(CONFIG_INPUT_DM355EVM) += dm355evm_keys.o
obj-$(CONFIG_INPUT_DRV260X_HAPTICS) += drv260x.o
obj-$(CONFIG_INPUT_GP2A) += gp2ap002a00f.o
obj-$(CONFIG_INPUT_GPIO_BEEPER) += gpio-beeper.o
obj-$(CONFIG_INPUT_GPIO_TILT_POLLED) += gpio_tilt_polled.o
......
此差异已折叠。
/*
* DRV260X haptics driver family
*
* Author: Dan Murphy <dmurphy@ti.com>
*
* Copyright: (C) 2014 Texas Instruments, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#ifndef _DT_BINDINGS_TI_DRV260X_H
#define _DT_BINDINGS_TI_DRV260X_H
/* Calibration Types */
#define DRV260X_LRA_MODE 0x00
#define DRV260X_LRA_NO_CAL_MODE 0x01
#define DRV260X_ERM_MODE 0x02
/* Library Selection */
#define DRV260X_LIB_EMPTY 0x00
#define DRV260X_ERM_LIB_A 0x01
#define DRV260X_ERM_LIB_B 0x02
#define DRV260X_ERM_LIB_C 0x03
#define DRV260X_ERM_LIB_D 0x04
#define DRV260X_ERM_LIB_E 0x05
#define DRV260X_LIB_LRA 0x06
#define DRV260X_ERM_LIB_F 0x07
#endif
/*
* Platform data for DRV260X haptics driver family
*
* Author: Dan Murphy <dmurphy@ti.com>
*
* Copyright: (C) 2014 Texas Instruments, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#ifndef _LINUX_DRV260X_PDATA_H
#define _LINUX_DRV260X_PDATA_H
struct drv260x_platform_data {
u32 library_selection;
u32 mode;
u32 vib_rated_voltage;
u32 vib_overdrive_voltage;
};
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册