vibrator.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * vibrator.h
  3. *
  4. * header file describing vibrator platform data for Samsung device
  5. *
  6. * COPYRIGHT(C) Samsung Electronics Co., Ltd. 2006-2011 All Right 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 as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful, but WITHOUT
  14. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  16. * more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  21. */
  22. #ifndef __VIBRATOR_H__
  23. #define __VIBRATOR_H__
  24. enum vibrator_model {
  25. NO_VIBRATOR,
  26. HAPTIC_PWM,
  27. HAPTIC_MOTOR,
  28. };
  29. struct vibrator_platform_data {
  30. unsigned int vib_pwm_gpio;/* gpio number for vibrator pwm */
  31. unsigned int haptic_pwr_en_gpio;/* gpio number of haptic power enable */
  32. unsigned int vib_en_gpio;/* gpio number of vibrator enable */
  33. unsigned int is_pmic_haptic_pwr_en; /* 1 -> pmic gpio used,\
  34. 0 -> msm gpio used */
  35. unsigned int is_pmic_vib_en; /* 1 -> pmic gpio used,\
  36. 0 -> msm gpio used */
  37. unsigned int is_pmic_vib_pwm ;
  38. enum vibrator_model vib_model;
  39. struct pwm_device *pwm_dev;
  40. unsigned int pwm_period_us;
  41. unsigned int duty_us;
  42. void (*power_onoff)(int onoff);
  43. struct clk *gp2_clk;
  44. unsigned int changed_chip;
  45. unsigned int changed_en_gpio;
  46. #if defined(CONFIG_MOTOR_DRV_DRV2603)
  47. unsigned int drv2603_en_gpio;
  48. #endif
  49. #if defined(CONFIG_MOTOR_DRV_MAX77888)
  50. unsigned int max77888_en_gpio;
  51. #endif
  52. unsigned int intensity;
  53. unsigned int state;
  54. };
  55. struct vibrator_platform_data_motor {
  56. void (*power_onoff)(int onoff);
  57. };
  58. #if defined(CONFIG_HAPTIC_ISA1200)
  59. struct vibrator_platform_data_isa1200 {
  60. unsigned int motor_en;
  61. unsigned int vib_clk;
  62. struct i2c_client *client;
  63. #if defined(CONFIG_MACH_MATISSE3G_OPEN) || defined (CONFIG_SEC_MATISSELTE_COMMON) || defined (CONFIG_MACH_T10_3G_OPEN)
  64. void (*power_onoff)(int onoff);
  65. #endif
  66. unsigned int intensity;
  67. };
  68. #endif
  69. #if defined(CONFIG_DRV2604_VIBRATOR)
  70. struct vibrator_platform_data_drv2604 {
  71. unsigned int motor_en;
  72. struct i2c_client *client;
  73. };
  74. #endif
  75. #endif