Support for isa1200 haptic chip
Subsystems (5)
cover Support for isa1200 haptic chip
This patchset includes stubs for pwm apis in pwm.h and a ff-memless based isa1200 driver.
ISA1200 chip can operate in two modes and if the chip has been configured for pwm-generation mode, which doesn't use pwm standard apis then it'd encounter compilation errors if the host doesn't support PWM. Adding pwm stubs will avoid compilation errors in those cases. This driver is based on Park's isa1200 driver that uses haptic class.
Kyungmin Park (1):
input: misc: Add support for isa1200 chip
Mohan Pallaka (1):
pwm: Add stubs for pwm operations
drivers/input/misc/Kconfig | 12 + drivers/input/misc/Makefile | 1 + drivers/input/misc/isa1200.c | 442 +++++++++++++++++++++++++++++++++++++++++ include/linux/input/isa1200.h | 46 +++++ include/linux/pwm.h | 24 +++ 5 files changed, 525 insertions(+), 0 deletions(-) create mode 100644 drivers/input/misc/isa1200.c create mode 100644 include/linux/input/isa1200.h
Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
PATCH 1/2 pwm: Add stubs for pwm operations
Chip drivers that support both pwm and non-pwm modes would encounter compilation errors if the platform doesn't have support for pwm, even though the chip is programmed to work in non-pwm mode. Add stubs for pwm functions to avoid compilation errors in these scenarios.
--- include/linux/pwm.h | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-)
include/linux/pwm.h +24 -0
@@ -3,6 +3,7 @@struct pwm_device ; +#if defined(CONFIG_PWM )/* * pwm_request - request a PWM device */
@@ -28,4 +29,27 @@ int pwm_enable(struct pwm_device *pwm);*/ void pwm_disable (struct pwm_device *pwm); +#else + +struct pwm_device *pwm_request (int pwm_id,const char *label) +{ +return NULL ; +} + +void pwm_free (struct pwm_device *pwm) { } + +int pwm_config (struct pwm_device *pwm,int duty_ns,int period_ns) +{ +return -EINVAL ; +} + +int pwm_enable (struct pwm_device *pwm) +{ +return -EINVAL ; +} + +void pwm_disable (struct pwm_device *pwm) { } + + +#endif /* CONFIG_PWM */ #endif /* __LINUX_PWM_H */
Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Dmitry Torokhov
maintainerRe: [PATCH 1/2] pwm: Add stubs for pwm operations
Quoted 16 lines · Mohan Pallaka
Chip drivers that support both pwm and non-pwm modes would encounter compilation errors if the platform doesn't have support for pwm, even though the chip is programmed to work in non-pwm mode. Add stubs for pwm functions to avoid compilation errors in these scenarios.
Signed-off-by Mohan Pallaka <[email protected]>--- include/linux/pwm.h | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-)include/linux/pwm.h +0
-0
include/linux/pwm.h line 6
Quoted 4 lines
include/linux/pwm.h +1
-0@@ -3,6 +3,7 @@struct pwm_device ; +#if defined(CONFIG_PWM )
Shouldn't it be CONFIG_HAVE_PWM?
Thanks.
Signature · 1 line
Dmitry
PATCH 2/2 input: misc: Add support for isa1200 chip
In reply to Mohan PallakaFrom: Kyungmin Park <[email protected]>
isa1200 chip can be used to generate vibrations to indicate silent alerts, providing gaming haptic actions or vibrations in response to touches. It can operate in two modes, pwm generation and pwm input mode. Pwm generation mode requires external clock and pwm input mode needs the pwm signal to be given as input to the chip.
This patch has been derived based on Kyungmin Park's haptic framework patches at http://lkml.org/lkml/2009/10/7/50 . Park's isa1200 driver registers to the haptic class, which is also introduced as part of the same patch series, and userspace will operate the vibrator through exported sysfs entries. This version supports only pwm input mode.
This derived patch converts the driver from haptic framework to the Linux supported force feeback framework. It also supports the chip operation in both pwm input and generation modes.
--- drivers/input/misc/Kconfig | 12 + drivers/input/misc/Makefile | 1 + drivers/input/misc/isa1200.c | 442 +++++++++++++++++++++++++++++++++++++++++ include/linux/input/isa1200.h | 46 +++++ 4 files changed, 501 insertions(+), 0 deletions(-) create mode 100644 drivers/input/misc/isa1200.c create mode 100644 include/linux/input/isa1200.h
drivers/input/misc/Kconfig +12 -0
@@ -302,6 +302,18 @@ config HP_SDC_RTC Say Y here if you want to support the built-in real time clock of the HP SDC controller. +config INPUT_ISA1200 + tristate "ISA1200 haptic support" + depends on I2C + select INPUT_FF_MEMLESS + help + ISA1200 is a high performance enhanced haptic chip. + Say Y here if you want to support ISA1200 connected via I2C, + and select N if you are unsure. + + To compile this driver as a module, choose M here: the + module will be called isa1200. + config INPUT_PCF50633_PMU tristate "PCF50633 PMU events" depends on MFD_PCF50633
drivers/input/misc/Makefile +1 -0
@@ -23,6 +23,7 @@ obj-$(CONFIG_INPUT_CMA3000_I2C) += cma3000_d0x_i2c.o obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o obj-$(CONFIG_INPUT_DM355EVM) += dm355evm_keys.o obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o +obj-$(CONFIG_INPUT_ISA1200) += isa1200.o obj-$(CONFIG_INPUT_IXP4XX_BEEPER) += ixp4xx-beeper.o obj-$(CONFIG_INPUT_KEYSPAN_REMOTE) += keyspan_remote.o obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o
drivers/input/misc/isa1200.c new file +442 -0
442 lines not on this page · raw message
include/linux/input/isa1200.h new file +46 -0
46 lines not on this page · raw message
Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.