input: misc: add support for Imagis ISA1200 haptic motor driver
Subsystems (3)
v2 cover input: misc: add support for Imagis ISA1200 haptic motor driver
The ISA1200 is a haptic feedback unit from Imagis Technology using two motors for haptic feedback in mobile phones. Used in many mobile devices c. 2012 including Samsung Galxy S Advance GT-I9070 (Janice), Samsung Beam GT-I8350 (Gavini), LG Optimus 4X P880 and LG Optimus Vu P895.
The exact datasheet for the ISA1200 is not available; all data was modeled based on available downstream kernel sources for various devices and fragments of information scattered across the internet.
---
Changes in v2:
- imagis,clk-div switched to accept actual divider value
- dropped DT header
- adjusted imagis,period-ns range
- initiated hctrl0 and hctrl1 values in isa1200_start
- fixed situation when PWM might return -EPROBE_DEFER to be treated properly
- added chech a clock or PWM is available
- fixed regulator voltages check being off by 10
- added chech if state.period is not zero
- added action call to disable clock and gpios on error
- used managed version of work init
- added work cancel on suspend
- PW calls are done under mutex lock
---
Linus Walleij (1):
Input: isa1200 - new driver for Imagis ISA1200
Svyatoslav Ryhel (1):
dt-bindings: input: Document Imagis ISA1200 haptic motor driver
.../bindings/input/imagis,isa1200.yaml | 140 +++++ drivers/input/misc/Kconfig | 11 + drivers/input/misc/Makefile | 1 + drivers/input/misc/isa1200.c | 507 ++++++++++++++++++ 4 files changed, 659 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/imagis,isa1200.yaml create mode 100644 drivers/input/misc/isa1200.c
Signature · 1 line
2.51.0
PATCH v2 1/2 dt-bindings: input: Document Imagis ISA1200 haptic motor driver
Document the Imagis ISA1200 haptic motor driver, used primarily in mobile handheld devices and capable of supporting up to two motors.
The exact datasheet for the ISA1200 is not available; all data was modeled based on available downstream kernel sources for various devices and fragments of information scattered across the internet.
--- .../bindings/input/imagis,isa1200.yaml | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/imagis,isa1200.yaml
Documentation/devicetree/bindings/input/imagis,isa1200.yaml new file +140 -0
@@ -0,0 +1,140 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/imagis,isa1200.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Imagis ISA1200 haptic motor driver + +maintainers: + - Svyatoslav Ryhel <[email protected]> + - Linus Walleij <[email protected]> + +description: + The ISA1200 is a high-performance enhanced haptic motor driver designed + for mobile hand-held devices. It supports various voltages for both ERM + (Eccentric Rotating Mass) and LRA (Linear Resonant Actuator) type + actuators. Thanks to an embedded LDO, battery power can be used directly + in handheld applications. + +properties: + compatible: + const: imagis,isa1200 + + reg: + maxItems: 1 + + control-gpios: + description: + One or two GPIOs flagged as active high linked to HEN and LEN pins + maxItems: 2 + + clocks: + maxItems: 1 + + pwms: + maxItems: 1 + + vdd-supply: + description: + Regulator for 2.4V - 5.5V power supply + + vddp-supply: + description: + Regulator for 2.4V - 3.6V IO power supply + + imagis,clk-div: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Divider for the external input clock/PWM + enum: [128, 256, 512, 1024] + default: 128 + + imagis,pll-div: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Divider for the internal PLL clock + minimum: 1 + maximum: 15 + default: 1 + + imagis,mode: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Defines the motor type isa1200 drives + 0 - LRA (Linear Resonant Actuator) + 1 - ERM (Eccentric Rotating Mass) + enum: [0, 1] + default: 0 + + imagis,period-ns: + description: + Period of the internal PWM channel in nanoseconds. + minimum: 12800 + maximum: 25400 + + imagis,duty-cycle-ns: + description: + Duty cycle of the external/internal PWM channel in nanoseconds, + defaults to 50% of the channel's period + + ldo: + $ref: /schemas/regulator/regulator.yaml# + type: object + description: + Embedded LDO regulator with voltage range 2.3V - 3.8V + unevaluatedProperties: false + + required: + - regulator-min-microvolt + - regulator-max-microvolt + +required: + - compatible + - reg + - ldo + +anyOf: + - required: + - clocks + - imagis,period-ns + - required: + - pwms + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + haptic-engine@49 { + compatible = "imagis,isa1200"; + reg = <0x49>; + + clocks = <&isa1200_refclk>; + + control-gpios = <&gpio 22 GPIO_ACTIVE_HIGH>, + <&gpio 23 GPIO_ACTIVE_HIGH>; + + vdd-supply = <&vdd_3v3_vbat>; + vddp-supply = <&vdd_2v8_vvib>; + + imagis,clk-div = <256>; + imagis,pll-div = <2>; + + imagis,mode = <0>; /* LRA_MODE */ + + imagis,period-ns = <13400>; + imagis,duty-cycle-ns = <100>; + + ldo { + regulator-name = "vdd_vib"; + regulator-min-microvolt = <2300000>; + regulator-max-microvolt = <2300000>; + }; + }; + };
Signature · 1 line
2.51.0
PATCH v2 2/2 Input: isa1200 - new driver for Imagis ISA1200
In reply to Svyatoslav RyhelFrom: Linus Walleij <[email protected]>
The ISA1200 is a haptic feedback unit from Imagis Technology using two motors for haptic feedback in mobile phones. Used in many mobile devices c. 2012 including Samsung Galxy S Advance GT-I9070 (Janice), Samsung Beam GT-I8350 (Gavini), LG Optimus 4X P880 and LG Optimus Vu P895.
The exact datasheet for the ISA1200 is not available; all data was modeled based on available downstream kernel sources for various devices and fragments of information scattered across the internet.
--- drivers/input/misc/Kconfig | 11 + drivers/input/misc/Makefile | 1 + drivers/input/misc/isa1200.c | 507 +++++++++++++++++++++++++++++++++++ 3 files changed, 519 insertions(+) create mode 100644 drivers/input/misc/isa1200.c
drivers/input/misc/Kconfig +11 -0
@@ -852,6 +852,17 @@ config INPUT_IQS7222 To compile this driver as a module, choose M here: the module will be called iqs7222. +config INPUT_ISA1200_HAPTIC + tristate "Imagis ISA1200 haptic feedback unit" + depends on I2C + select REGMAP_I2C + help + Say Y to enable support for the Imagis ISA1200 haptic + feedback unit. + + To compile this driver as a module, choose M here: the + module will be called isa1200. + config INPUT_CMA3000 tristate "VTI CMA3000 Tri-axis accelerometer" help
drivers/input/misc/Makefile +1 -0
@@ -49,6 +49,7 @@ obj-$(CONFIG_INPUT_IMS_PCU) += ims-pcu.o obj-$(CONFIG_INPUT_IQS269A) += iqs269a.o obj-$(CONFIG_INPUT_IQS626A) += iqs626a.o obj-$(CONFIG_INPUT_IQS7222) += iqs7222.o +obj-$(CONFIG_INPUT_ISA1200_HAPTIC) += isa1200.o obj-$(CONFIG_INPUT_KEYSPAN_REMOTE) += keyspan_remote.o obj-$(CONFIG_INPUT_KXTJ9) += kxtj9.o obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o
drivers/input/misc/isa1200.c new file +507 -0
507 lines not on this page · raw message
Signature · 1 line
2.51.0
Re: [PATCH v2 2/2] Input: isa1200 - new driver for Imagis ISA1200
Hi Svyatoslav,
I just saw this thing:
Quoted 2 lines · Svyatoslav Ryhel
drivers/input/misc/isa1200.c new file +2
-0+/* HCTRL5 controls the PWM high duty cycle of internal channel */ +#define ISA1200_HCTRL5 0x35
(...)
Quoted 1 line
+struct
isa1200_config{
(...)
Quoted 4 lines
drivers/input/misc/isa1200.c new file +4
-0+u32 duty; +}; +/* Duty cycle */ +regmap_write (isa->map,ISA1200_HCTRL5 , config->period >>1 );
(...)
Quoted 2 lines
drivers/input/misc/isa1200.c new file +2
-0+if (isa->clk) +regmap_write (isa->map,ISA1200_HCTRL5 , config->duty);
(..)
Quoted 12 lines
drivers/input/misc/isa1200.c new file +12
-0+if (isa->clk) { + ret =device_property_read_u32 (dev,"imagis,period-ns" , + &config->period); +if (ret) +return dev_err_probe (dev, ret, +"failed to get period\n" ); + + config->period /=ISA1200_HCTRL6_PERIOD_SCALE ; + config->duty = config->period >>1 ; + } + +if (isa->pwm) {
drivers/input/misc/isa1200.c line 374
Quoted 10 lines
drivers/input/misc/isa1200.c new file +10
-0+struct pwm_state state; + +pwm_init_state (isa->pwm, &state); + +if (!state.period) +return dev_err_probe (dev, -EINVAL , +"PWM period cannot be zero\n" ); + + config->freq =div64_u64 (NANO , state.period * config->clkdiv); + config->duty = state.period >>1 ;
So you don't need the same code writing regmap_write(isa->map, ISA1200_HCTRL5, config->period >> 1); above, just use confg->duty which contains config->period >> 1 (...)
Quoted 1 line
+
device_property_read_u32(dev, "imagis,duty-cycle-ns", &config->duty);
I'm not sure about this, it works for me when I set this to 100 resulting in a register write of 100 to ISA1200_HCTRL5. But are we sure that this register is expressed in nanoseconds? I think some calculation is needed here (and probably another value in my device tree).
Yours,
Linus Walleij
Re: [PATCH v2 2/2] Input: isa1200 - new driver for Imagis ISA1200
чт, 30 квіт. 2026 р. о 12:22 Linus Walleij <[email protected]> пише:
Quoted 39 lines
Hi Svyatoslav,
I just saw this thing:
Quoted 2 lines · Svyatoslav Ryhel
drivers/input/misc/isa1200.c new file +2
-0+/* HCTRL5 controls the PWM high duty cycle of internal channel */ +#define ISA1200_HCTRL5 0x35(...)
Quoted 1 line
+struct
isa1200_config{(...)
Quoted 4 lines
drivers/input/misc/isa1200.c new file +4
-0+u32 duty; +}; +/* Duty cycle */ +regmap_write (isa->map,ISA1200_HCTRL5 , config->period >>1 );(...)
Quoted 2 lines
drivers/input/misc/isa1200.c new file +2
-0+if (isa->clk) +regmap_write (isa->map,ISA1200_HCTRL5 , config->duty);(..)
Quoted 19 lines
drivers/input/misc/isa1200.c new file +19
-0+if (isa->clk) { + ret =device_property_read_u32 (dev,"imagis,period-ns" , + &config->period); +if (ret) +return dev_err_probe (dev, ret, +"failed to get period\n" ); + + config->period /=ISA1200_HCTRL6_PERIOD_SCALE ; + config->duty = config->period >>1 ; + } + +if (isa->pwm) { +struct pwm_state state; + +pwm_init_state (isa->pwm, &state); + +if (!state.period) +return dev_err_probe (dev, -EINVAL , +"PWM period cannot be zero\n" );
Quoted 8 lines
drivers/input/misc/isa1200.c line 374
Quoted 3 lines
drivers/input/misc/isa1200.c new file +3
-0+ + config->freq =div64_u64 (NANO , state.period * config->clkdiv); + config->duty = state.period >>1 ;So you don't need the same code writing
regmap_write(isa->map, ISA1200_HCTRL5, config->period >> 1); above, just useconfg->dutywhich containsconfig->period>> 1 (...)
No this is intended. It seems that isa1200 uses period >> 1 (aka 1/2 of period for some type of pre-enable). Setting duty as 1/2 period be default is a safe fallback but it will not trigger haptics.
Quoted 8 lines
Quoted 1 line
+
device_property_read_u32(dev, "imagis,duty-cycle-ns", &config->duty);I'm not sure about this, it works for me when I set this to 100 resulting in a register write of 100 to
ISA1200_HCTRL5. But are we sure that this register is expressed in nanoseconds? I think some calculation is needed here (and probably another value in my device tree).
I do are that this most likely is somehow mapped, but I have no clue how to transfer this into actual nanoseconds. That is very unfortunate.
In you original code
/*
* This is done in the vendor tree with the commment
* "Duty 0x64 == nForce 90", and no force feedback happens
* unless we do this.
*/
if (isa->clk)regmap_write(isa->map, ISA1200_HCTRL5, 0x64);
0x64 is actually some conversion of duty cycle, you got this accurately.
Quoted 2 lines
Yours,
Linus Walleij
Re: [PATCH v2 2/2] Input: isa1200 - new driver for Imagis ISA1200
Quoted 11 lines · Svyatoslav Ryhel
чт, 30 квіт. 2026 р. о 12:22 Linus Walleij <[email protected]> пише:
In you original code
/*
* This is done in the vendor tree with the commment
* "Duty0x64== nForce 90", and no force feedback happens
* unless we do this.
*/
if (isa->clk)regmap_write(isa->map, ISA1200_HCTRL5, 0x64);
Quoted 1 line
0x64is actually some conversion of duty cycle, you got this accurately.
I wonder if 0x64 = 100 is simply 100% duty cycle?
So the value in this register can only be 0..100.
Yours,
Linus Walleij
Re: [PATCH v2 2/2] Input: isa1200 - new driver for Imagis ISA1200
вт, 5 трав. 2026 р. о 13:39 Linus Walleij <[email protected]> пише:
Quoted 13 lines · Svyatoslav Ryhel
Quoted 11 lines
чт, 30 квіт. 2026 р. о 12:22 Linus Walleij <[email protected]> пише:
In you original code
/*
* This is done in the vendor tree with the commment
* "Duty0x64== nForce 90", and no force feedback happens
* unless we do this.
*/
if (isa->clk)regmap_write(isa->map, ISA1200_HCTRL5, 0x64);
Quoted 5 lines
Quoted 1 line
0x64is actually some conversion of duty cycle, you got this accurately.I wonder if
0x64= 100 is simply 100% duty cycle?
So the value in this register can only be 0..100.
Assumption is interesting, but it is still just a guess based on observation of a single hw configuration. For example, Samsung Galaxy Tab 10.1 (GT-P7501) passes 133 (0x85) into duty register.
Quoted 2 lines
Yours,
Linus Walleij
Quoted 8 lines · Svyatoslav Ryhel
The ISA1200 is a haptic feedback unit from Imagis Technology using two motors for haptic feedback in mobile phones. Used in many mobile devices c. 2012 including Samsung Galxy S Advance GT-I9070 (Janice), Samsung Beam GT-I8350 (Gavini), LG Optimus 4X P880 and LG Optimus Vu P895.
The exact datasheet for the ISA1200 is not available; all data was modeled based on available downstream kernel sources for various devices and fragments of information scattered across the internet.
I applied a patch to the Janice devicetree like this:
+ /* Haptic feedback unit Immersion ISA1200 */
+ haptic-engine@49 {
+ compatible = "immersion,isa1200";
+ reg = <0x49>;
+
+ /* clkout1 from ACLK divided by 8 */
+ clocks = <&clkout_clk DB8500_CLKOUT_1DB8500_CLKOUT_SRC_ACLK 8>;
+
+ /*
+ * GPIO194 pin HEN (motor hardware enable) + * GPIO195 pin LEN (motor LDO enable) + */
+ control-gpios = <&gpio6 2 GPIO_ACTIVE_HIGH>,
<&gpio6 3 GPIO_ACTIVE_HIGH>;
+
+ imagis,clk-div = <256>;
+ imagis,pll-div = <2>;
+
+ imagis,mode = <0>; /* LRA_MODE */
+
+ imagis,period-ns = <1340000>;
+ imagis,duty-cycle-ns = <100>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&isa1200_janice_default>;
+
+ ldo {
+ regulator-name = "vdd_vib"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>;
+ };
+ };
It works, I get rumble on the keys.
Yours,
Linus Walleij
чт, 30 квіт. 2026 р. о 12:16 Linus Walleij <[email protected]> пише:
Quoted 29 lines · Svyatoslav Ryhel
Quoted 9 lines
The ISA1200 is a haptic feedback unit from Imagis Technology using two motors for haptic feedback in mobile phones. Used in many mobile devices c. 2012 including Samsung Galxy S Advance GT-I9070 (Janice), Samsung Beam GT-I8350 (Gavini), LG Optimus 4X P880 and LG Optimus Vu P895.
The exact datasheet for the ISA1200 is not available; all data was modeled based on available downstream kernel sources for various devices and fragments of information scattered across the internet.
I applied a patch to the Janice devicetree like this:
(quoted diff) +7
-0+ /* Haptic feedback unit Immersion ISA1200 */ + haptic-engine@49 { + compatible = "immersion,isa1200"; + reg = <0x49>; + + /* clkout1 from ACLK divided by 8 */ + clocks = <&clkout_clk DB8500_CLKOUT_1
DB8500_CLKOUT_SRC_ACLK8>;(quoted diff) +6
-0+ + /* + * GPIO194 pin HEN (motor hardware enable) + * GPIO195 pin LEN (motor LDO enable) + */ + control-gpios = <&gpio6 2 GPIO_ACTIVE_HIGH>,<&gpio6 3
GPIO_ACTIVE_HIGH>;
Review
Quoted 7 lines
(quoted diff) +7
-0+ + imagis,clk-div = <256>; + imagis,pll-div = <2>; + + imagis,mode = <0>; /* LRA_MODE */ + + imagis,period-ns = <1340000>;
Hello Linus!
May you please try with imagis,period-ns = <12900>; and <11900> which one will fit better.
Quoted 12 lines
(quoted diff) +11
-0+ imagis,duty-cycle-ns = <100>; + + pinctrl-names = "default"; + pinctrl-0 = <&isa1200_janice_default>; + + ldo { + regulator-name = "vdd_vib"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + }; + };
Quoted 4 lines
It works, I get rumble on the keys.
Tested-by Linus Walleij <[email protected]>
Very nice! Thank you for testing!
Quoted 2 lines
Yours,
Linus Walleij