isa1200.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * isa1200.h - ISA1200 Haptic Motor driver
  3. *
  4. * Copyright (C) 2009 Samsung Electronics
  5. * Kyungmin Park <kyungmin.park@samsung.com>
  6. * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
  7. *
  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. #ifndef __LINUX_ISA1200_H
  13. #define __LINUX_ISA1200_H
  14. #define ISA_I2C_VTG_MAX_UV 1800000
  15. #define ISA_I2C_VTG_MIN_UV 1800000
  16. #define ISA_I2C_CURR_UA 9630
  17. struct isa1200_regulator {
  18. const char *name;
  19. u32 min_uV;
  20. u32 max_uV;
  21. u32 load_uA;
  22. };
  23. enum mode_control {
  24. POWER_DOWN_MODE = 0,
  25. PWM_INPUT_MODE,
  26. PWM_GEN_MODE,
  27. WAVE_GEN_MODE
  28. };
  29. union pwm_div_freq {
  30. unsigned int pwm_div; /* PWM gen mode */
  31. unsigned int pwm_freq; /* PWM input mode */
  32. };
  33. struct isa1200_platform_data {
  34. const char *name;
  35. unsigned int pwm_ch_id; /* pwm channel id */
  36. unsigned int max_timeout;
  37. unsigned int hap_en_gpio;
  38. unsigned int hap_len_gpio;
  39. bool overdrive_high; /* high/low overdrive */
  40. bool overdrive_en; /* enable/disable overdrive */
  41. enum mode_control mode_ctrl; /* input/generation/wave */
  42. union pwm_div_freq pwm_fd;
  43. bool smart_en; /* smart mode enable/disable */
  44. bool is_erm;
  45. bool ext_clk_en;
  46. bool need_pwm_clk;
  47. unsigned int chip_en;
  48. unsigned int duty;
  49. struct isa1200_regulator *regulator_info;
  50. u8 num_regulators;
  51. int (*power_on)(int on);
  52. int (*dev_setup)(bool on);
  53. int (*clk_enable)(bool on);
  54. };
  55. #endif /* __LINUX_ISA1200_H */