Re: [PATCH v2 2/2] input: misc: Add support for the DRV2667 haptic driver

2014-09-04 Thread Murphy, Dan
Bumping x2

On 08/25/2014 10:26 AM, Murphy, Dan wrote:
> Adding support for the DRV2667 haptic driver.
> This device has the ability to store vibration
> patterns in RAM and execute them once the GO bit
> is set.
> 
> The initial driver sets a basic waveform in the
> first waveform sequence and will play the waveform
> when the GO bit is set and will continously play
> the waveform until the GO bit is unset.
> 
> Data sheet is here:
> http://www.ti.com/product/drv2667
> 
> Signed-off-by: Dan Murphy 
> ---
> 
> v2 - No updates since no comments - 
> https://patchwork.kernel.org/patch/4759391/
> 
>  drivers/input/misc/Kconfig   |   11 +
>  drivers/input/misc/Makefile  |1 +
>  drivers/input/misc/drv2667.c |  500 
> ++
>  3 files changed, 512 insertions(+)
>  create mode 100644 drivers/input/misc/drv2667.c
> 
> diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
> index 41d0ae6..51891f6 100644
> --- a/drivers/input/misc/Kconfig
> +++ b/drivers/input/misc/Kconfig
> @@ -687,4 +687,15 @@ config INPUT_DRV260X_HAPTICS
> To compile this driver as a module, choose M here: the
> module will be called drv260x-haptics.
>  
> +config INPUT_DRV2667_HAPTICS
> + tristate "TI DRV2667 haptics support"
> + depends on INPUT && I2C
> + select INPUT_FF_MEMLESS
> + select REGMAP_I2C
> + help
> +   Say Y to enable support for the TI DRV2667 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 cd4bc2d..e0cee17 100644
> --- a/drivers/input/misc/Makefile
> +++ b/drivers/input/misc/Makefile
> @@ -27,6 +27,7 @@ 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_DRV2667_HAPTICS)  += drv2667.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
> diff --git a/drivers/input/misc/drv2667.c b/drivers/input/misc/drv2667.c
> new file mode 100644
> index 000..0f43758
> --- /dev/null
> +++ b/drivers/input/misc/drv2667.c
> @@ -0,0 +1,500 @@
> +/*
> + * DRV2667 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 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.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/* Contol registers */
> +#define DRV2667_STATUS   0x00
> +#define DRV2667_CTRL_1   0x01
> +#define DRV2667_CTRL_2   0x02
> +/* Waveform sequencer */
> +#define DRV2667_WV_SEQ_0 0x03
> +#define DRV2667_WV_SEQ_1 0x04
> +#define DRV2667_WV_SEQ_2 0x05
> +#define DRV2667_WV_SEQ_3 0x06
> +#define DRV2667_WV_SEQ_4 0x07
> +#define DRV2667_WV_SEQ_5 0x08
> +#define DRV2667_WV_SEQ_6 0x09
> +#define DRV2667_WV_SEQ_7 0x0A
> +#define DRV2667_FIFO 0x0B
> +#define DRV2667_PAGE 0xFF
> +#define DRV2667_MAX_REG  DRV2667_PAGE
> +
> +#define DRV2667_PAGE_0   0x00
> +#define DRV2667_PAGE_1   0x01
> +#define DRV2667_PAGE_2   0x02
> +#define DRV2667_PAGE_3   0x03
> +#define DRV2667_PAGE_4   0x04
> +#define DRV2667_PAGE_5   0x05
> +#define DRV2667_PAGE_6   0x06
> +#define DRV2667_PAGE_7   0x07
> +#define DRV2667_PAGE_8   0x08
> +
> +/* RAM fields */
> +#define DRV2667_RAM_HDR_SZ   0x0
> +/* RAM Header addresses */
> +#define DRV2667_RAM_START_HI 0x01
> +#define DRV2667_RAM_START_LO 0x02
> +#define DRV2667_RAM_STOP_HI  0x03
> +#define DRV2667_RAM_STOP_LO  0x04
> +#define DRV2667_RAM_REPEAT_CT0x05
> +/* RAM data addresses */
> +#define DRV2667_RAM_AMP  0x06
> +#define DRV2667_RAM_FREQ 0x07
> +#define DRV2667_RAM_DURATION 0x08
> +#define DRV2667_RAM_ENVELOPE 0x09
> +
> +/* Control 1 Register */
> +#define DRV2667_25_VPP_GAIN  0x00
> +#define DRV2667_50_VPP_GAIN  0x01
> +#define DRV2667_75_VPP_GAIN  0x02
> +#define DRV2667_100_VPP_GAIN 0x03
> +#define DRV2667_DIGITAL_IN   0xfc
> +#define DRV2667_ANALOG_IN(1 << 2)
> +
> +/* Control 2 Register */
> +#define DRV2667_GO 

Re: [PATCH v2 2/2] input: misc: Add support for the DRV2667 haptic driver

2014-09-04 Thread Murphy, Dan
Bumping x2

On 08/25/2014 10:26 AM, Murphy, Dan wrote:
 Adding support for the DRV2667 haptic driver.
 This device has the ability to store vibration
 patterns in RAM and execute them once the GO bit
 is set.
 
 The initial driver sets a basic waveform in the
 first waveform sequence and will play the waveform
 when the GO bit is set and will continously play
 the waveform until the GO bit is unset.
 
 Data sheet is here:
 http://www.ti.com/product/drv2667
 
 Signed-off-by: Dan Murphy dmur...@ti.com
 ---
 
 v2 - No updates since no comments - 
 https://patchwork.kernel.org/patch/4759391/
 
  drivers/input/misc/Kconfig   |   11 +
  drivers/input/misc/Makefile  |1 +
  drivers/input/misc/drv2667.c |  500 
 ++
  3 files changed, 512 insertions(+)
  create mode 100644 drivers/input/misc/drv2667.c
 
 diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
 index 41d0ae6..51891f6 100644
 --- a/drivers/input/misc/Kconfig
 +++ b/drivers/input/misc/Kconfig
 @@ -687,4 +687,15 @@ config INPUT_DRV260X_HAPTICS
 To compile this driver as a module, choose M here: the
 module will be called drv260x-haptics.
  
 +config INPUT_DRV2667_HAPTICS
 + tristate TI DRV2667 haptics support
 + depends on INPUT  I2C
 + select INPUT_FF_MEMLESS
 + select REGMAP_I2C
 + help
 +   Say Y to enable support for the TI DRV2667 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 cd4bc2d..e0cee17 100644
 --- a/drivers/input/misc/Makefile
 +++ b/drivers/input/misc/Makefile
 @@ -27,6 +27,7 @@ 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_DRV2667_HAPTICS)  += drv2667.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
 diff --git a/drivers/input/misc/drv2667.c b/drivers/input/misc/drv2667.c
 new file mode 100644
 index 000..0f43758
 --- /dev/null
 +++ b/drivers/input/misc/drv2667.c
 @@ -0,0 +1,500 @@
 +/*
 + * DRV2667 haptics driver family
 + *
 + * Author: Dan Murphy dmur...@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.
 + */
 +
 +#include linux/i2c.h
 +#include linux/input.h
 +#include linux/module.h
 +#include linux/platform_device.h
 +#include linux/regmap.h
 +#include linux/slab.h
 +#include linux/delay.h
 +#include linux/regulator/consumer.h
 +
 +/* Contol registers */
 +#define DRV2667_STATUS   0x00
 +#define DRV2667_CTRL_1   0x01
 +#define DRV2667_CTRL_2   0x02
 +/* Waveform sequencer */
 +#define DRV2667_WV_SEQ_0 0x03
 +#define DRV2667_WV_SEQ_1 0x04
 +#define DRV2667_WV_SEQ_2 0x05
 +#define DRV2667_WV_SEQ_3 0x06
 +#define DRV2667_WV_SEQ_4 0x07
 +#define DRV2667_WV_SEQ_5 0x08
 +#define DRV2667_WV_SEQ_6 0x09
 +#define DRV2667_WV_SEQ_7 0x0A
 +#define DRV2667_FIFO 0x0B
 +#define DRV2667_PAGE 0xFF
 +#define DRV2667_MAX_REG  DRV2667_PAGE
 +
 +#define DRV2667_PAGE_0   0x00
 +#define DRV2667_PAGE_1   0x01
 +#define DRV2667_PAGE_2   0x02
 +#define DRV2667_PAGE_3   0x03
 +#define DRV2667_PAGE_4   0x04
 +#define DRV2667_PAGE_5   0x05
 +#define DRV2667_PAGE_6   0x06
 +#define DRV2667_PAGE_7   0x07
 +#define DRV2667_PAGE_8   0x08
 +
 +/* RAM fields */
 +#define DRV2667_RAM_HDR_SZ   0x0
 +/* RAM Header addresses */
 +#define DRV2667_RAM_START_HI 0x01
 +#define DRV2667_RAM_START_LO 0x02
 +#define DRV2667_RAM_STOP_HI  0x03
 +#define DRV2667_RAM_STOP_LO  0x04
 +#define DRV2667_RAM_REPEAT_CT0x05
 +/* RAM data addresses */
 +#define DRV2667_RAM_AMP  0x06
 +#define DRV2667_RAM_FREQ 0x07
 +#define DRV2667_RAM_DURATION 0x08
 +#define DRV2667_RAM_ENVELOPE 0x09
 +
 +/* Control 1 Register */
 +#define DRV2667_25_VPP_GAIN  0x00
 +#define DRV2667_50_VPP_GAIN  0x01
 +#define DRV2667_75_VPP_GAIN  0x02
 +#define DRV2667_100_VPP_GAIN 0x03
 +#define DRV2667_DIGITAL_IN   0xfc
 +#define DRV2667_ANALOG_IN(1  2)
 +
 +/* Control 2 Register */
 +#define DRV2667_GO  

Re: [PATCH v2 2/2] input: misc: Add support for the DRV2667 haptic driver

2014-08-28 Thread Murphy, Dan
Bump

On 08/25/2014 10:26 AM, Murphy, Dan wrote:
> Adding support for the DRV2667 haptic driver.
> This device has the ability to store vibration
> patterns in RAM and execute them once the GO bit
> is set.
> 
> The initial driver sets a basic waveform in the
> first waveform sequence and will play the waveform
> when the GO bit is set and will continously play
> the waveform until the GO bit is unset.
> 
> Data sheet is here:
> http://www.ti.com/product/drv2667
> 
> Signed-off-by: Dan Murphy 
> ---
> 
> v2 - No updates since no comments - 
> https://patchwork.kernel.org/patch/4759391/
> 
>  drivers/input/misc/Kconfig   |   11 +
>  drivers/input/misc/Makefile  |1 +
>  drivers/input/misc/drv2667.c |  500 
> ++
>  3 files changed, 512 insertions(+)
>  create mode 100644 drivers/input/misc/drv2667.c
> 
> diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
> index 41d0ae6..51891f6 100644
> --- a/drivers/input/misc/Kconfig
> +++ b/drivers/input/misc/Kconfig
> @@ -687,4 +687,15 @@ config INPUT_DRV260X_HAPTICS
> To compile this driver as a module, choose M here: the
> module will be called drv260x-haptics.
>  
> +config INPUT_DRV2667_HAPTICS
> + tristate "TI DRV2667 haptics support"
> + depends on INPUT && I2C
> + select INPUT_FF_MEMLESS
> + select REGMAP_I2C
> + help
> +   Say Y to enable support for the TI DRV2667 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 cd4bc2d..e0cee17 100644
> --- a/drivers/input/misc/Makefile
> +++ b/drivers/input/misc/Makefile
> @@ -27,6 +27,7 @@ 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_DRV2667_HAPTICS)  += drv2667.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
> diff --git a/drivers/input/misc/drv2667.c b/drivers/input/misc/drv2667.c
> new file mode 100644
> index 000..0f43758
> --- /dev/null
> +++ b/drivers/input/misc/drv2667.c
> @@ -0,0 +1,500 @@
> +/*
> + * DRV2667 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 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.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/* Contol registers */
> +#define DRV2667_STATUS   0x00
> +#define DRV2667_CTRL_1   0x01
> +#define DRV2667_CTRL_2   0x02
> +/* Waveform sequencer */
> +#define DRV2667_WV_SEQ_0 0x03
> +#define DRV2667_WV_SEQ_1 0x04
> +#define DRV2667_WV_SEQ_2 0x05
> +#define DRV2667_WV_SEQ_3 0x06
> +#define DRV2667_WV_SEQ_4 0x07
> +#define DRV2667_WV_SEQ_5 0x08
> +#define DRV2667_WV_SEQ_6 0x09
> +#define DRV2667_WV_SEQ_7 0x0A
> +#define DRV2667_FIFO 0x0B
> +#define DRV2667_PAGE 0xFF
> +#define DRV2667_MAX_REG  DRV2667_PAGE
> +
> +#define DRV2667_PAGE_0   0x00
> +#define DRV2667_PAGE_1   0x01
> +#define DRV2667_PAGE_2   0x02
> +#define DRV2667_PAGE_3   0x03
> +#define DRV2667_PAGE_4   0x04
> +#define DRV2667_PAGE_5   0x05
> +#define DRV2667_PAGE_6   0x06
> +#define DRV2667_PAGE_7   0x07
> +#define DRV2667_PAGE_8   0x08
> +
> +/* RAM fields */
> +#define DRV2667_RAM_HDR_SZ   0x0
> +/* RAM Header addresses */
> +#define DRV2667_RAM_START_HI 0x01
> +#define DRV2667_RAM_START_LO 0x02
> +#define DRV2667_RAM_STOP_HI  0x03
> +#define DRV2667_RAM_STOP_LO  0x04
> +#define DRV2667_RAM_REPEAT_CT0x05
> +/* RAM data addresses */
> +#define DRV2667_RAM_AMP  0x06
> +#define DRV2667_RAM_FREQ 0x07
> +#define DRV2667_RAM_DURATION 0x08
> +#define DRV2667_RAM_ENVELOPE 0x09
> +
> +/* Control 1 Register */
> +#define DRV2667_25_VPP_GAIN  0x00
> +#define DRV2667_50_VPP_GAIN  0x01
> +#define DRV2667_75_VPP_GAIN  0x02
> +#define DRV2667_100_VPP_GAIN 0x03
> +#define DRV2667_DIGITAL_IN   0xfc
> +#define DRV2667_ANALOG_IN(1 << 2)
> +
> +/* Control 2 Register */
> +#define DRV2667_GO   

Re: [PATCH v2 2/2] input: misc: Add support for the DRV2667 haptic driver

2014-08-28 Thread Murphy, Dan
Bump

On 08/25/2014 10:26 AM, Murphy, Dan wrote:
 Adding support for the DRV2667 haptic driver.
 This device has the ability to store vibration
 patterns in RAM and execute them once the GO bit
 is set.
 
 The initial driver sets a basic waveform in the
 first waveform sequence and will play the waveform
 when the GO bit is set and will continously play
 the waveform until the GO bit is unset.
 
 Data sheet is here:
 http://www.ti.com/product/drv2667
 
 Signed-off-by: Dan Murphy dmur...@ti.com
 ---
 
 v2 - No updates since no comments - 
 https://patchwork.kernel.org/patch/4759391/
 
  drivers/input/misc/Kconfig   |   11 +
  drivers/input/misc/Makefile  |1 +
  drivers/input/misc/drv2667.c |  500 
 ++
  3 files changed, 512 insertions(+)
  create mode 100644 drivers/input/misc/drv2667.c
 
 diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
 index 41d0ae6..51891f6 100644
 --- a/drivers/input/misc/Kconfig
 +++ b/drivers/input/misc/Kconfig
 @@ -687,4 +687,15 @@ config INPUT_DRV260X_HAPTICS
 To compile this driver as a module, choose M here: the
 module will be called drv260x-haptics.
  
 +config INPUT_DRV2667_HAPTICS
 + tristate TI DRV2667 haptics support
 + depends on INPUT  I2C
 + select INPUT_FF_MEMLESS
 + select REGMAP_I2C
 + help
 +   Say Y to enable support for the TI DRV2667 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 cd4bc2d..e0cee17 100644
 --- a/drivers/input/misc/Makefile
 +++ b/drivers/input/misc/Makefile
 @@ -27,6 +27,7 @@ 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_DRV2667_HAPTICS)  += drv2667.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
 diff --git a/drivers/input/misc/drv2667.c b/drivers/input/misc/drv2667.c
 new file mode 100644
 index 000..0f43758
 --- /dev/null
 +++ b/drivers/input/misc/drv2667.c
 @@ -0,0 +1,500 @@
 +/*
 + * DRV2667 haptics driver family
 + *
 + * Author: Dan Murphy dmur...@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.
 + */
 +
 +#include linux/i2c.h
 +#include linux/input.h
 +#include linux/module.h
 +#include linux/platform_device.h
 +#include linux/regmap.h
 +#include linux/slab.h
 +#include linux/delay.h
 +#include linux/regulator/consumer.h
 +
 +/* Contol registers */
 +#define DRV2667_STATUS   0x00
 +#define DRV2667_CTRL_1   0x01
 +#define DRV2667_CTRL_2   0x02
 +/* Waveform sequencer */
 +#define DRV2667_WV_SEQ_0 0x03
 +#define DRV2667_WV_SEQ_1 0x04
 +#define DRV2667_WV_SEQ_2 0x05
 +#define DRV2667_WV_SEQ_3 0x06
 +#define DRV2667_WV_SEQ_4 0x07
 +#define DRV2667_WV_SEQ_5 0x08
 +#define DRV2667_WV_SEQ_6 0x09
 +#define DRV2667_WV_SEQ_7 0x0A
 +#define DRV2667_FIFO 0x0B
 +#define DRV2667_PAGE 0xFF
 +#define DRV2667_MAX_REG  DRV2667_PAGE
 +
 +#define DRV2667_PAGE_0   0x00
 +#define DRV2667_PAGE_1   0x01
 +#define DRV2667_PAGE_2   0x02
 +#define DRV2667_PAGE_3   0x03
 +#define DRV2667_PAGE_4   0x04
 +#define DRV2667_PAGE_5   0x05
 +#define DRV2667_PAGE_6   0x06
 +#define DRV2667_PAGE_7   0x07
 +#define DRV2667_PAGE_8   0x08
 +
 +/* RAM fields */
 +#define DRV2667_RAM_HDR_SZ   0x0
 +/* RAM Header addresses */
 +#define DRV2667_RAM_START_HI 0x01
 +#define DRV2667_RAM_START_LO 0x02
 +#define DRV2667_RAM_STOP_HI  0x03
 +#define DRV2667_RAM_STOP_LO  0x04
 +#define DRV2667_RAM_REPEAT_CT0x05
 +/* RAM data addresses */
 +#define DRV2667_RAM_AMP  0x06
 +#define DRV2667_RAM_FREQ 0x07
 +#define DRV2667_RAM_DURATION 0x08
 +#define DRV2667_RAM_ENVELOPE 0x09
 +
 +/* Control 1 Register */
 +#define DRV2667_25_VPP_GAIN  0x00
 +#define DRV2667_50_VPP_GAIN  0x01
 +#define DRV2667_75_VPP_GAIN  0x02
 +#define DRV2667_100_VPP_GAIN 0x03
 +#define DRV2667_DIGITAL_IN   0xfc
 +#define DRV2667_ANALOG_IN(1  2)
 +
 +/* Control 2 Register */
 +#define DRV2667_GO

[PATCH v2 2/2] input: misc: Add support for the DRV2667 haptic driver

2014-08-25 Thread Dan Murphy
Adding support for the DRV2667 haptic driver.
This device has the ability to store vibration
patterns in RAM and execute them once the GO bit
is set.

The initial driver sets a basic waveform in the
first waveform sequence and will play the waveform
when the GO bit is set and will continously play
the waveform until the GO bit is unset.

Data sheet is here:
http://www.ti.com/product/drv2667

Signed-off-by: Dan Murphy 
---

v2 - No updates since no comments - https://patchwork.kernel.org/patch/4759391/

 drivers/input/misc/Kconfig   |   11 +
 drivers/input/misc/Makefile  |1 +
 drivers/input/misc/drv2667.c |  500 ++
 3 files changed, 512 insertions(+)
 create mode 100644 drivers/input/misc/drv2667.c

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 41d0ae6..51891f6 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -687,4 +687,15 @@ config INPUT_DRV260X_HAPTICS
  To compile this driver as a module, choose M here: the
  module will be called drv260x-haptics.
 
+config INPUT_DRV2667_HAPTICS
+   tristate "TI DRV2667 haptics support"
+   depends on INPUT && I2C
+   select INPUT_FF_MEMLESS
+   select REGMAP_I2C
+   help
+ Say Y to enable support for the TI DRV2667 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 cd4bc2d..e0cee17 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -27,6 +27,7 @@ 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_DRV2667_HAPTICS)+= drv2667.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
diff --git a/drivers/input/misc/drv2667.c b/drivers/input/misc/drv2667.c
new file mode 100644
index 000..0f43758
--- /dev/null
+++ b/drivers/input/misc/drv2667.c
@@ -0,0 +1,500 @@
+/*
+ * DRV2667 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 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.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Contol registers */
+#define DRV2667_STATUS 0x00
+#define DRV2667_CTRL_1 0x01
+#define DRV2667_CTRL_2 0x02
+/* Waveform sequencer */
+#define DRV2667_WV_SEQ_0   0x03
+#define DRV2667_WV_SEQ_1   0x04
+#define DRV2667_WV_SEQ_2   0x05
+#define DRV2667_WV_SEQ_3   0x06
+#define DRV2667_WV_SEQ_4   0x07
+#define DRV2667_WV_SEQ_5   0x08
+#define DRV2667_WV_SEQ_6   0x09
+#define DRV2667_WV_SEQ_7   0x0A
+#define DRV2667_FIFO   0x0B
+#define DRV2667_PAGE   0xFF
+#define DRV2667_MAX_REGDRV2667_PAGE
+
+#define DRV2667_PAGE_0 0x00
+#define DRV2667_PAGE_1 0x01
+#define DRV2667_PAGE_2 0x02
+#define DRV2667_PAGE_3 0x03
+#define DRV2667_PAGE_4 0x04
+#define DRV2667_PAGE_5 0x05
+#define DRV2667_PAGE_6 0x06
+#define DRV2667_PAGE_7 0x07
+#define DRV2667_PAGE_8 0x08
+
+/* RAM fields */
+#define DRV2667_RAM_HDR_SZ 0x0
+/* RAM Header addresses */
+#define DRV2667_RAM_START_HI   0x01
+#define DRV2667_RAM_START_LO   0x02
+#define DRV2667_RAM_STOP_HI0x03
+#define DRV2667_RAM_STOP_LO0x04
+#define DRV2667_RAM_REPEAT_CT  0x05
+/* RAM data addresses */
+#define DRV2667_RAM_AMP0x06
+#define DRV2667_RAM_FREQ   0x07
+#define DRV2667_RAM_DURATION   0x08
+#define DRV2667_RAM_ENVELOPE   0x09
+
+/* Control 1 Register */
+#define DRV2667_25_VPP_GAIN0x00
+#define DRV2667_50_VPP_GAIN0x01
+#define DRV2667_75_VPP_GAIN0x02
+#define DRV2667_100_VPP_GAIN   0x03
+#define DRV2667_DIGITAL_IN 0xfc
+#define DRV2667_ANALOG_IN  (1 << 2)
+
+/* Control 2 Register */
+#define DRV2667_GO (1 << 0)
+#define DRV2667_STANDBY(1 << 6)
+#define DRV2667_DEV_RST(1 << 7)
+
+/* RAM Envelope settings */
+#define DRV2667_NO_ENV 0x00
+#define DRV2667_32_MS_ENV  0x01
+#define DRV2667_64_MS_ENV  0x02
+#define DRV2667_96_MS_ENV  0x03

[PATCH v2 2/2] input: misc: Add support for the DRV2667 haptic driver

2014-08-25 Thread Dan Murphy
Adding support for the DRV2667 haptic driver.
This device has the ability to store vibration
patterns in RAM and execute them once the GO bit
is set.

The initial driver sets a basic waveform in the
first waveform sequence and will play the waveform
when the GO bit is set and will continously play
the waveform until the GO bit is unset.

Data sheet is here:
http://www.ti.com/product/drv2667

Signed-off-by: Dan Murphy dmur...@ti.com
---

v2 - No updates since no comments - https://patchwork.kernel.org/patch/4759391/

 drivers/input/misc/Kconfig   |   11 +
 drivers/input/misc/Makefile  |1 +
 drivers/input/misc/drv2667.c |  500 ++
 3 files changed, 512 insertions(+)
 create mode 100644 drivers/input/misc/drv2667.c

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 41d0ae6..51891f6 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -687,4 +687,15 @@ config INPUT_DRV260X_HAPTICS
  To compile this driver as a module, choose M here: the
  module will be called drv260x-haptics.
 
+config INPUT_DRV2667_HAPTICS
+   tristate TI DRV2667 haptics support
+   depends on INPUT  I2C
+   select INPUT_FF_MEMLESS
+   select REGMAP_I2C
+   help
+ Say Y to enable support for the TI DRV2667 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 cd4bc2d..e0cee17 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -27,6 +27,7 @@ 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_DRV2667_HAPTICS)+= drv2667.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
diff --git a/drivers/input/misc/drv2667.c b/drivers/input/misc/drv2667.c
new file mode 100644
index 000..0f43758
--- /dev/null
+++ b/drivers/input/misc/drv2667.c
@@ -0,0 +1,500 @@
+/*
+ * DRV2667 haptics driver family
+ *
+ * Author: Dan Murphy dmur...@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.
+ */
+
+#include linux/i2c.h
+#include linux/input.h
+#include linux/module.h
+#include linux/platform_device.h
+#include linux/regmap.h
+#include linux/slab.h
+#include linux/delay.h
+#include linux/regulator/consumer.h
+
+/* Contol registers */
+#define DRV2667_STATUS 0x00
+#define DRV2667_CTRL_1 0x01
+#define DRV2667_CTRL_2 0x02
+/* Waveform sequencer */
+#define DRV2667_WV_SEQ_0   0x03
+#define DRV2667_WV_SEQ_1   0x04
+#define DRV2667_WV_SEQ_2   0x05
+#define DRV2667_WV_SEQ_3   0x06
+#define DRV2667_WV_SEQ_4   0x07
+#define DRV2667_WV_SEQ_5   0x08
+#define DRV2667_WV_SEQ_6   0x09
+#define DRV2667_WV_SEQ_7   0x0A
+#define DRV2667_FIFO   0x0B
+#define DRV2667_PAGE   0xFF
+#define DRV2667_MAX_REGDRV2667_PAGE
+
+#define DRV2667_PAGE_0 0x00
+#define DRV2667_PAGE_1 0x01
+#define DRV2667_PAGE_2 0x02
+#define DRV2667_PAGE_3 0x03
+#define DRV2667_PAGE_4 0x04
+#define DRV2667_PAGE_5 0x05
+#define DRV2667_PAGE_6 0x06
+#define DRV2667_PAGE_7 0x07
+#define DRV2667_PAGE_8 0x08
+
+/* RAM fields */
+#define DRV2667_RAM_HDR_SZ 0x0
+/* RAM Header addresses */
+#define DRV2667_RAM_START_HI   0x01
+#define DRV2667_RAM_START_LO   0x02
+#define DRV2667_RAM_STOP_HI0x03
+#define DRV2667_RAM_STOP_LO0x04
+#define DRV2667_RAM_REPEAT_CT  0x05
+/* RAM data addresses */
+#define DRV2667_RAM_AMP0x06
+#define DRV2667_RAM_FREQ   0x07
+#define DRV2667_RAM_DURATION   0x08
+#define DRV2667_RAM_ENVELOPE   0x09
+
+/* Control 1 Register */
+#define DRV2667_25_VPP_GAIN0x00
+#define DRV2667_50_VPP_GAIN0x01
+#define DRV2667_75_VPP_GAIN0x02
+#define DRV2667_100_VPP_GAIN   0x03
+#define DRV2667_DIGITAL_IN 0xfc
+#define DRV2667_ANALOG_IN  (1  2)
+
+/* Control 2 Register */
+#define DRV2667_GO (1  0)
+#define DRV2667_STANDBY(1  6)
+#define DRV2667_DEV_RST(1  7)
+
+/* RAM Envelope settings */
+#define DRV2667_NO_ENV