Re: [PATCH] input: drv260x: Introduce TI drv260x haptics driver

2014-07-25 Thread Murphy, Dan
On 07/24/2014 02:07 PM, Murphy, Dan wrote:
> 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/drv2605
>
> Signed-off-by: Dan Murphy 
> ---
>  .../devicetree/bindings/input/ti,drv260x.txt   |   44 ++
>  drivers/input/misc/Kconfig |9 +
>  drivers/input/misc/Makefile|1 +
>  drivers/input/misc/drv260x.c   |  537 
> 
>  include/dt-bindings/input/ti-drv260x.h |   30 ++
>  include/linux/input/drv260x.h  |  181 +++
>  6 files changed, 802 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/ti,drv260x.txt
>  create mode 100644 drivers/input/misc/drv260x.c
>  create mode 100644 include/dt-bindings/input/ti-drv260x.h
>  create mode 100644 include/linux/input/drv260x.h
>
> diff --git a/Documentation/devicetree/bindings/input/ti,drv260x.txt 
> b/Documentation/devicetree/bindings/input/ti,drv260x.txt
> new file mode 100644
> index 000..0860661
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/ti,drv260x.txt
> @@ -0,0 +1,44 @@
> +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
> + - mode - Power up mode of the chip (defined in 
> include/dt-bindings/input/ti-drv260x.h)
> + DRV260X_RTP_MODE - Real time playback mode
> + DRV260X_LRA_MODE - Linear Resonance Actuator mode 
> (Piezoelectric)
> + DRV260X_ERM_MODE - Eccentric Rotating Mass mode (Rotary 
> vibrator)
> + - library_sel - Library to use at power up (defined in 
> include/dt-bindings/input/ti-drv260x.h)
> + DRV260X_LIB_A - Pre-programmed Library
> + DRV260X_LIB_B - Pre-programmed Library
> + DRV260X_LIB_C - Pre-programmed Library
> + DRV260X_LIB_D - Pre-programmed Library
> + DRV260X_LIB_E - Pre-programmed Library
> + DRV260X_LIB_F - Pre-programmed Library
> +
> +Optional properties:
> + - enable-gpio - gpio pin to enable/disable the device.
> + - vib_rated_voltage - The rated voltage of the actuator.  If this is not
> +   set then the value will be 
> defaulted to 0x90 in the
> +   driver.
> + - vib_overdrive_voltage - The overdrive voltage of the actuator.
> + If this is not set then 
> the value
> + will be defaulted to 
> 0x90 in the driver.
> +Example:
> +
> +drv2605l: drv2605l@41 {

This needs to be updated

> + compatible = "ti,drv2605l";
> + reg = <0x5a>;
> + enable-gpio = < 28 GPIO_ACTIVE_HIGH>;  /* GPIO 60 */
> + mode = ;
> + library_sel = ;
> + vib_rated_voltage = <3200>;
> + vib_overdriver_voltage = <3200>;
> +};
> +
> +For more product information please see the link below:
> +http://www.ti.com/product/drv2605
> diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
> index 2ff4425..99f6762 100644
> --- a/drivers/input/misc/Kconfig
> +++ b/drivers/input/misc/Kconfig
> @@ -676,4 +676,13 @@ 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
> + 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
> diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
> index 4955ad3..d8ef3c7 100644
> --- a/drivers/input/misc/Makefile
> +++ b/drivers/input/misc/Makefile
> @@ -64,3 +64,4 @@ obj-$(CONFIG_INPUT_WM831X_ON)   += wm831x-on.o
>  obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND)  += xen-kbdfront.o
>  obj-$(CONFIG_INPUT_YEALINK)  += yealink.o
>  obj-$(CONFIG_INPUT_IDEAPAD_SLIDEBAR) += ideapad_slidebar.o
> +obj-$(CONFIG_INPUT_DRV260X_HAPTICS)  += drv260x.o
> diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c
> new file mode 100644
> index 000..aadfd57
> --- /dev/null
> +++ b/drivers/input/misc/drv260x.c
> @@ -0,0 +1,537 @@

Re: [PATCH] input: drv260x: Introduce TI drv260x haptics driver

2014-07-25 Thread Murphy, Dan
On 07/24/2014 02:07 PM, Murphy, Dan wrote:
 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/drv2605

 Signed-off-by: Dan Murphy dmur...@ti.com
 ---
  .../devicetree/bindings/input/ti,drv260x.txt   |   44 ++
  drivers/input/misc/Kconfig |9 +
  drivers/input/misc/Makefile|1 +
  drivers/input/misc/drv260x.c   |  537 
 
  include/dt-bindings/input/ti-drv260x.h |   30 ++
  include/linux/input/drv260x.h  |  181 +++
  6 files changed, 802 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/input/ti,drv260x.txt
  create mode 100644 drivers/input/misc/drv260x.c
  create mode 100644 include/dt-bindings/input/ti-drv260x.h
  create mode 100644 include/linux/input/drv260x.h

 diff --git a/Documentation/devicetree/bindings/input/ti,drv260x.txt 
 b/Documentation/devicetree/bindings/input/ti,drv260x.txt
 new file mode 100644
 index 000..0860661
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/input/ti,drv260x.txt
 @@ -0,0 +1,44 @@
 +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
 + - mode - Power up mode of the chip (defined in 
 include/dt-bindings/input/ti-drv260x.h)
 + DRV260X_RTP_MODE - Real time playback mode
 + DRV260X_LRA_MODE - Linear Resonance Actuator mode 
 (Piezoelectric)
 + DRV260X_ERM_MODE - Eccentric Rotating Mass mode (Rotary 
 vibrator)
 + - library_sel - Library to use at power up (defined in 
 include/dt-bindings/input/ti-drv260x.h)
 + DRV260X_LIB_A - Pre-programmed Library
 + DRV260X_LIB_B - Pre-programmed Library
 + DRV260X_LIB_C - Pre-programmed Library
 + DRV260X_LIB_D - Pre-programmed Library
 + DRV260X_LIB_E - Pre-programmed Library
 + DRV260X_LIB_F - Pre-programmed Library
 +
 +Optional properties:
 + - enable-gpio - gpio pin to enable/disable the device.
 + - vib_rated_voltage - The rated voltage of the actuator.  If this is not
 +   set then the value will be 
 defaulted to 0x90 in the
 +   driver.
 + - vib_overdrive_voltage - The overdrive voltage of the actuator.
 + If this is not set then 
 the value
 + will be defaulted to 
 0x90 in the driver.
 +Example:
 +
 +drv2605l: drv2605l@41 {

This needs to be updated

 + compatible = ti,drv2605l;
 + reg = 0x5a;
 + enable-gpio = gpio1 28 GPIO_ACTIVE_HIGH;  /* GPIO 60 */
 + mode = DRV260X_RTP_MODE;
 + library_sel = DRV260X_LIB_SEL_DEFAULT;
 + vib_rated_voltage = 3200;
 + vib_overdriver_voltage = 3200;
 +};
 +
 +For more product information please see the link below:
 +http://www.ti.com/product/drv2605
 diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
 index 2ff4425..99f6762 100644
 --- a/drivers/input/misc/Kconfig
 +++ b/drivers/input/misc/Kconfig
 @@ -676,4 +676,13 @@ 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
 + 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
 diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
 index 4955ad3..d8ef3c7 100644
 --- a/drivers/input/misc/Makefile
 +++ b/drivers/input/misc/Makefile
 @@ -64,3 +64,4 @@ obj-$(CONFIG_INPUT_WM831X_ON)   += wm831x-on.o
  obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND)  += xen-kbdfront.o
  obj-$(CONFIG_INPUT_YEALINK)  += yealink.o
  obj-$(CONFIG_INPUT_IDEAPAD_SLIDEBAR) += ideapad_slidebar.o
 +obj-$(CONFIG_INPUT_DRV260X_HAPTICS)  += drv260x.o
 diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c
 new file mode 100644
 index 000..aadfd57
 --- /dev/null
 +++ b/drivers/input/misc/drv260x.c
 @@ -0,0 +1,537 @@
 +/*
 + * drv260x.c - DRV260X haptics driver family
 + *
 + * Author: Dan Murphy 

[PATCH] input: drv260x: Introduce TI drv260x haptics driver

2014-07-24 Thread Dan Murphy
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/drv2605

Signed-off-by: Dan Murphy 
---
 .../devicetree/bindings/input/ti,drv260x.txt   |   44 ++
 drivers/input/misc/Kconfig |9 +
 drivers/input/misc/Makefile|1 +
 drivers/input/misc/drv260x.c   |  537 
 include/dt-bindings/input/ti-drv260x.h |   30 ++
 include/linux/input/drv260x.h  |  181 +++
 6 files changed, 802 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/ti,drv260x.txt
 create mode 100644 drivers/input/misc/drv260x.c
 create mode 100644 include/dt-bindings/input/ti-drv260x.h
 create mode 100644 include/linux/input/drv260x.h

diff --git a/Documentation/devicetree/bindings/input/ti,drv260x.txt 
b/Documentation/devicetree/bindings/input/ti,drv260x.txt
new file mode 100644
index 000..0860661
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/ti,drv260x.txt
@@ -0,0 +1,44 @@
+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
+   - mode - Power up mode of the chip (defined in 
include/dt-bindings/input/ti-drv260x.h)
+   DRV260X_RTP_MODE - Real time playback mode
+   DRV260X_LRA_MODE - Linear Resonance Actuator mode 
(Piezoelectric)
+   DRV260X_ERM_MODE - Eccentric Rotating Mass mode (Rotary 
vibrator)
+   - library_sel - Library to use at power up (defined in 
include/dt-bindings/input/ti-drv260x.h)
+   DRV260X_LIB_A - Pre-programmed Library
+   DRV260X_LIB_B - Pre-programmed Library
+   DRV260X_LIB_C - Pre-programmed Library
+   DRV260X_LIB_D - Pre-programmed Library
+   DRV260X_LIB_E - Pre-programmed Library
+   DRV260X_LIB_F - Pre-programmed Library
+
+Optional properties:
+   - enable-gpio - gpio pin to enable/disable the device.
+   - vib_rated_voltage - The rated voltage of the actuator.  If this is not
+ set then the value will be 
defaulted to 0x90 in the
+ driver.
+   - vib_overdrive_voltage - The overdrive voltage of the actuator.
+   If this is not set then 
the value
+   will be defaulted to 
0x90 in the driver.
+Example:
+
+drv2605l: drv2605l@41 {
+   compatible = "ti,drv2605l";
+   reg = <0x5a>;
+   enable-gpio = < 28 GPIO_ACTIVE_HIGH>;  /* GPIO 60 */
+   mode = ;
+   library_sel = ;
+   vib_rated_voltage = <3200>;
+   vib_overdriver_voltage = <3200>;
+};
+
+For more product information please see the link below:
+http://www.ti.com/product/drv2605
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 2ff4425..99f6762 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -676,4 +676,13 @@ 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
+   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
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 4955ad3..d8ef3c7 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -64,3 +64,4 @@ obj-$(CONFIG_INPUT_WM831X_ON) += wm831x-on.o
 obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND)+= xen-kbdfront.o
 obj-$(CONFIG_INPUT_YEALINK)+= yealink.o
 obj-$(CONFIG_INPUT_IDEAPAD_SLIDEBAR)   += ideapad_slidebar.o
+obj-$(CONFIG_INPUT_DRV260X_HAPTICS)+= drv260x.o
diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c
new file mode 100644
index 000..aadfd57
--- /dev/null
+++ b/drivers/input/misc/drv260x.c
@@ -0,0 +1,537 @@
+/*
+ * drv260x.c - DRV260X haptics driver family
+ *
+ * Author: Dan Murphy 
+ *
+ * Copyright:   (C) 2014 Texas Instruments, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the 

[PATCH] input: drv260x: Introduce TI drv260x haptics driver

2014-07-24 Thread Dan Murphy
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/drv2605

Signed-off-by: Dan Murphy dmur...@ti.com
---
 .../devicetree/bindings/input/ti,drv260x.txt   |   44 ++
 drivers/input/misc/Kconfig |9 +
 drivers/input/misc/Makefile|1 +
 drivers/input/misc/drv260x.c   |  537 
 include/dt-bindings/input/ti-drv260x.h |   30 ++
 include/linux/input/drv260x.h  |  181 +++
 6 files changed, 802 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/ti,drv260x.txt
 create mode 100644 drivers/input/misc/drv260x.c
 create mode 100644 include/dt-bindings/input/ti-drv260x.h
 create mode 100644 include/linux/input/drv260x.h

diff --git a/Documentation/devicetree/bindings/input/ti,drv260x.txt 
b/Documentation/devicetree/bindings/input/ti,drv260x.txt
new file mode 100644
index 000..0860661
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/ti,drv260x.txt
@@ -0,0 +1,44 @@
+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
+   - mode - Power up mode of the chip (defined in 
include/dt-bindings/input/ti-drv260x.h)
+   DRV260X_RTP_MODE - Real time playback mode
+   DRV260X_LRA_MODE - Linear Resonance Actuator mode 
(Piezoelectric)
+   DRV260X_ERM_MODE - Eccentric Rotating Mass mode (Rotary 
vibrator)
+   - library_sel - Library to use at power up (defined in 
include/dt-bindings/input/ti-drv260x.h)
+   DRV260X_LIB_A - Pre-programmed Library
+   DRV260X_LIB_B - Pre-programmed Library
+   DRV260X_LIB_C - Pre-programmed Library
+   DRV260X_LIB_D - Pre-programmed Library
+   DRV260X_LIB_E - Pre-programmed Library
+   DRV260X_LIB_F - Pre-programmed Library
+
+Optional properties:
+   - enable-gpio - gpio pin to enable/disable the device.
+   - vib_rated_voltage - The rated voltage of the actuator.  If this is not
+ set then the value will be 
defaulted to 0x90 in the
+ driver.
+   - vib_overdrive_voltage - The overdrive voltage of the actuator.
+   If this is not set then 
the value
+   will be defaulted to 
0x90 in the driver.
+Example:
+
+drv2605l: drv2605l@41 {
+   compatible = ti,drv2605l;
+   reg = 0x5a;
+   enable-gpio = gpio1 28 GPIO_ACTIVE_HIGH;  /* GPIO 60 */
+   mode = DRV260X_RTP_MODE;
+   library_sel = DRV260X_LIB_SEL_DEFAULT;
+   vib_rated_voltage = 3200;
+   vib_overdriver_voltage = 3200;
+};
+
+For more product information please see the link below:
+http://www.ti.com/product/drv2605
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 2ff4425..99f6762 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -676,4 +676,13 @@ 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
+   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
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 4955ad3..d8ef3c7 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -64,3 +64,4 @@ obj-$(CONFIG_INPUT_WM831X_ON) += wm831x-on.o
 obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND)+= xen-kbdfront.o
 obj-$(CONFIG_INPUT_YEALINK)+= yealink.o
 obj-$(CONFIG_INPUT_IDEAPAD_SLIDEBAR)   += ideapad_slidebar.o
+obj-$(CONFIG_INPUT_DRV260X_HAPTICS)+= drv260x.o
diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c
new file mode 100644
index 000..aadfd57
--- /dev/null
+++ b/drivers/input/misc/drv260x.c
@@ -0,0 +1,537 @@
+/*
+ * drv260x.c - DRV260X haptics driver family
+ *
+ * Author: Dan Murphy dmur...@ti.com
+ *
+ * Copyright:   (C) 2014 Texas Instruments, Inc.
+ *
+ * This program is free software; you can