blob: 65a6bf5b09508ca92381c7d6805beba4c520aa90 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/*
2 * isa1200.h - ISA1200 Haptic Motor driver
3 *
4 * Copyright (C) 2009 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com>
Duy Truong790f06d2013-02-13 16:38:12 -08006 * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07007 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __LINUX_ISA1200_H
14#define __LINUX_ISA1200_H
15
Mohan Pallaka73787fa2011-09-09 15:14:20 +053016#define ISA_I2C_VTG_MAX_UV 1800000
17#define ISA_I2C_VTG_MIN_UV 1800000
18#define ISA_I2C_CURR_UA 9630
19
20struct isa1200_regulator {
21 const char *name;
22 u32 min_uV;
23 u32 max_uV;
24 u32 load_uA;
25};
26
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070027enum mode_control {
28 POWER_DOWN_MODE = 0,
29 PWM_INPUT_MODE,
30 PWM_GEN_MODE,
31 WAVE_GEN_MODE
32};
33
34union pwm_div_freq {
35 unsigned int pwm_div; /* PWM gen mode */
36 unsigned int pwm_freq; /* PWM input mode */
37};
38
39struct isa1200_platform_data {
40 const char *name;
41 unsigned int pwm_ch_id; /* pwm channel id */
42 unsigned int max_timeout;
43 unsigned int hap_en_gpio;
Mohan Pallaka73787fa2011-09-09 15:14:20 +053044 unsigned int hap_len_gpio;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070045 bool overdrive_high; /* high/low overdrive */
46 bool overdrive_en; /* enable/disable overdrive */
47 enum mode_control mode_ctrl; /* input/generation/wave */
48 union pwm_div_freq pwm_fd;
49 bool smart_en; /* smart mode enable/disable */
50 bool is_erm;
51 bool ext_clk_en;
Mohan Pallaka32f20a72012-06-14 14:41:11 +053052 bool need_pwm_clk;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070053 unsigned int chip_en;
54 unsigned int duty;
Mohan Pallaka73787fa2011-09-09 15:14:20 +053055 struct isa1200_regulator *regulator_info;
56 u8 num_regulators;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070057 int (*power_on)(int on);
58 int (*dev_setup)(bool on);
Mohan Pallakaace9fa92012-05-11 13:05:40 +053059 int (*clk_enable)(bool on);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070060};
61
62#endif /* __LINUX_ISA1200_H */