proccomm-regulator.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 and
  6. * only version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef __ARCH_ARM_MACH_MSM_PROCCOMM_REGULATOR_H__
  14. #define __ARCH_ARM_MACH_MSM_PROCCOMM_REGULATOR_H__
  15. #include <linux/regulator/machine.h>
  16. #define PROCCOMM_REGULATOR_DEV_NAME "proccomm-regulator"
  17. /**
  18. * struct proccomm_regulator_info - A description of one proccomm regulator
  19. * @init_data: Initialization data for the regulator.
  20. * Must contain:
  21. * - A list of struct regulator_consumer_supply indicating
  22. * supply names for the regulator
  23. * - A filled out struct regulation_constraints containing:
  24. * - The name of the regulator
  25. * - The minimum and maximum voltages supported
  26. * - The supported modes (REGULATOR_MODE_NORMAL)
  27. * - The supported operations, currently limited to:
  28. * REGULATOR_CHANGE_STATUS
  29. * REGULATOR_CHANGE_VOLTAGE
  30. * - The input voltage, if the regulator is powered by another
  31. * - Properly set always_on, boot_on, and apply_uV flags
  32. * - The name of the supply regulator, if applicable
  33. * @id: The proccomm ID of this regulator.
  34. * @rise_time: The time that the regulator takes to initialize,
  35. * in microseconds. Set to 0 to disable rise-time checking.
  36. * @pulldown: Whether the regulator should be pulled down when off.
  37. * 1 to pull down the regulator.
  38. * 0 to leave the regulator floating.
  39. * -1 to indicate no preference.
  40. */
  41. struct proccomm_regulator_info {
  42. struct regulator_init_data init_data;
  43. int id;
  44. int rise_time;
  45. int pulldown;
  46. int negative;
  47. int n_voltages;
  48. };
  49. /**
  50. * struct proccomm_regulator_platform_data - proccomm driver platform data.
  51. *
  52. * Contains a description of a set of proccomm-controlled regulators.
  53. * Pass this in the platform_data field when instantiating the driver.
  54. *
  55. * @regs: An array of struct proccomm_regulator_info describing
  56. * the regulators to register.
  57. * @nregs: The number of regulators to register.
  58. */
  59. struct proccomm_regulator_platform_data {
  60. struct proccomm_regulator_info *regs;
  61. size_t nregs;
  62. };
  63. #if defined(CONFIG_MSM_VREG_SWITCH_INVERTED)
  64. #define VREG_SWITCH_ENABLE 0
  65. #define VREG_SWITCH_DISABLE 1
  66. #else
  67. #define VREG_SWITCH_ENABLE 1
  68. #define VREG_SWITCH_DISABLE 0
  69. #endif
  70. #endif