Input: add driver support for MAX8997-haptic

The MAX8997-haptic function can be used to control motor. User can
control the haptic driver by using force feedback framework.

Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
Donggeun Kim
2012-03-16 12:28:22 -07:00
committed by Dmitry Torokhov
parent 145e97348a
commit 104594b01c
4 changed files with 472 additions and 1 deletions

View File

@@ -131,6 +131,55 @@ struct max8997_muic_platform_data {
int num_init_data;
};
enum max8997_haptic_motor_type {
MAX8997_HAPTIC_ERM,
MAX8997_HAPTIC_LRA,
};
enum max8997_haptic_pulse_mode {
MAX8997_EXTERNAL_MODE,
MAX8997_INTERNAL_MODE,
};
enum max8997_haptic_pwm_divisor {
MAX8997_PWM_DIVISOR_32,
MAX8997_PWM_DIVISOR_64,
MAX8997_PWM_DIVISOR_128,
MAX8997_PWM_DIVISOR_256,
};
/**
* max8997_haptic_platform_data
* @pwm_channel_id: channel number of PWM device
* valid for MAX8997_EXTERNAL_MODE
* @pwm_period: period in nano second for PWM device
* valid for MAX8997_EXTERNAL_MODE
* @type: motor type
* @mode: pulse mode
* MAX8997_EXTERNAL_MODE: external PWM device is used to control motor
* MAX8997_INTERNAL_MODE: internal pulse generator is used to control motor
* @pwm_divisor: divisor for external PWM device
* @internal_mode_pattern: internal mode pattern for internal mode
* [0 - 3]: valid pattern number
* @pattern_cycle: the number of cycles of the waveform
* for the internal mode pattern
* [0 - 15]: available cycles
* @pattern_signal_period: period of the waveform for the internal mode pattern
* [0 - 255]: available period
*/
struct max8997_haptic_platform_data {
unsigned int pwm_channel_id;
unsigned int pwm_period;
enum max8997_haptic_motor_type type;
enum max8997_haptic_pulse_mode mode;
enum max8997_haptic_pwm_divisor pwm_divisor;
unsigned int internal_mode_pattern;
unsigned int pattern_cycle;
unsigned int pattern_signal_period;
};
enum max8997_led_mode {
MAX8997_NONE,
MAX8997_FLASH_MODE,
@@ -192,7 +241,9 @@ struct max8997_platform_data {
/* ---- MUIC ---- */
struct max8997_muic_platform_data *muic_pdata;
/* HAPTIC: Not implemented */
/* ---- HAPTIC ---- */
struct max8997_haptic_platform_data *haptic_pdata;
/* RTC: Not implemented */
/* ---- LED ---- */
struct max8997_led_platform_data *led_pdata;