aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2012-03-07 03:02:51 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2012-03-16 13:41:17 -0400
commit02b09703e7a411f80e5ec037b3abf14061a61933 (patch)
treee447b02707d4100233167dc1888219e8819888a3
parent618dd15d216915df04fe3baa93123179b1c887c5 (diff)
mfd: Add platform data for MAX8997 haptic driver
MAX8997 device does not support haptic function of it. This patch adds platform data for for MAX8997 haptic driver. 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> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--include/linux/mfd/max8997.h53
1 files changed, 52 insertions, 1 deletions
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h
index fff590521e50..9d8006b4a13a 100644
--- a/include/linux/mfd/max8997.h
+++ b/include/linux/mfd/max8997.h
@@ -153,6 +153,55 @@ struct max8997_led_platform_data {
153 u8 brightness[2]; 153 u8 brightness[2];
154}; 154};
155 155
156enum max8997_haptic_motor_type {
157 MAX8997_HAPTIC_ERM,
158 MAX8997_HAPTIC_LRA,
159};
160
161enum max8997_haptic_pulse_mode {
162 MAX8997_EXTERNAL_MODE,
163 MAX8997_INTERNAL_MODE,
164};
165
166enum max8997_haptic_pwm_divisor {
167 MAX8997_PWM_DIVISOR_32,
168 MAX8997_PWM_DIVISOR_64,
169 MAX8997_PWM_DIVISOR_128,
170 MAX8997_PWM_DIVISOR_256,
171};
172
173/*
174 * max8997_haptic_platform_data
175 * @pwm_channel_id: channel number of PWM device
176 * valid for MAX8997_EXTERNAL_MODE
177 * @pwm_period: period in nano second for PWM device
178 * valid for MAX8997_EXTERNAL_MODE
179 * @type: motor type
180 * @mode: pulse mode
181 * MAX8997_EXTERNAL_MODE: external PWM device is used to control motor
182 * MAX8997_INTERNAL_MODE: internal pulse generator is used to control motor
183 * @pwm_divisor: divisor for external PWM device
184 * @internal_mode_pattern: internal mode pattern for internal mode
185 * [0 - 3]: valid pattern number
186 * @pattern_cycle: the number of cycles of the waveform
187 * for the internal mode pattern
188 * [0 - 15]: available cycles
189 * @pattern_signal_period: period of the waveform for the internal mode pattern
190 * [0 - 255]: available period
191 */
192struct max8997_haptic_platform_data {
193 int pwm_channel_id;
194 int pwm_period;
195
196 enum max8997_haptic_motor_type type;
197 enum max8997_haptic_pulse_mode mode;
198 enum max8997_haptic_pwm_divisor pwm_divisor;
199
200 int internal_mode_pattern;
201 int pattern_cycle;
202 int pattern_signal_period;
203};
204
156struct max8997_platform_data { 205struct max8997_platform_data {
157 /* IRQ */ 206 /* IRQ */
158 int irq_base; 207 int irq_base;
@@ -192,7 +241,9 @@ struct max8997_platform_data {
192 /* ---- MUIC ---- */ 241 /* ---- MUIC ---- */
193 struct max8997_muic_platform_data *muic_pdata; 242 struct max8997_muic_platform_data *muic_pdata;
194 243
195 /* HAPTIC: Not implemented */ 244 /* ---- HAPTIC ---- */
245 struct max8997_haptic_platform_data *haptic_pdata;
246
196 /* RTC: Not implemented */ 247 /* RTC: Not implemented */
197 /* ---- LED ---- */ 248 /* ---- LED ---- */
198 struct max8997_led_platform_data *led_pdata; 249 struct max8997_led_platform_data *led_pdata;