max8973-regulator.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * max8973-regulator.h -- MAXIM 8973 regulator
  3. *
  4. * Interface for regulator driver for MAXIM 8973 DC-DC step-down
  5. * switching regulator.
  6. *
  7. * Copyright (C) 2012 NVIDIA Corporation
  8. * Author: Laxman Dewangan <ldewangan@nvidia.com>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful, but WITHOUT
  16. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  17. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  18. * more details.
  19. *
  20. * You should have received a copy of the GNU General Public License along
  21. * with this program; if not, write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  23. *
  24. */
  25. #ifndef __LINUX_REGULATOR_MAX8973_H
  26. #define __LINUX_REGULATOR_MAX8973_H
  27. /*
  28. * Control flags for configuration of the device.
  29. * Client need to pass this information with ORed
  30. */
  31. #define MAX8973_CONTROL_REMOTE_SENSE_ENABLE 0x00000001
  32. #define MAX8973_CONTROL_FALLING_SLEW_RATE_ENABLE 0x00000002
  33. #define MAX8973_CONTROL_OUTPUT_ACTIVE_DISCH_ENABLE 0x00000004
  34. #define MAX8973_CONTROL_BIAS_ENABLE 0x00000008
  35. #define MAX8973_CONTROL_PULL_DOWN_ENABLE 0x00000010
  36. #define MAX8973_CONTROL_FREQ_SHIFT_9PER_ENABLE 0x00000020
  37. #define MAX8973_CONTROL_CLKADV_TRIP_DISABLED 0x00000000
  38. #define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US 0x00010000
  39. #define MAX8973_CONTROL_CLKADV_TRIP_150mV_PER_US 0x00020000
  40. #define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US_HIST_DIS 0x00030000
  41. #define MAX8973_CONTROL_INDUCTOR_VALUE_NOMINAL 0x00000000
  42. #define MAX8973_CONTROL_INDUCTOR_VALUE_MINUS_30_PER 0x00100000
  43. #define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_30_PER 0x00200000
  44. #define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_60_PER 0x00300000
  45. /*
  46. * struct max8973_regulator_platform_data - max8973 regulator platform data.
  47. *
  48. * @reg_init_data: The regulator init data.
  49. * @control_flags: Control flags which are ORed value of above flags to
  50. * configure device.
  51. * @enable_ext_control: Enable the voltage enable/disable through external
  52. * control signal from EN input pin. If it is false then
  53. * voltage output will be enabled/disabled through EN bit of
  54. * device register.
  55. * @dvs_gpio: GPIO for dvs. It should be -1 if this is tied with fixed logic.
  56. * @dvs_def_state: Default state of dvs. 1 if it is high else 0.
  57. */
  58. struct max8973_regulator_platform_data {
  59. struct regulator_init_data *reg_init_data;
  60. unsigned long control_flags;
  61. bool enable_ext_control;
  62. int dvs_gpio;
  63. unsigned dvs_def_state:1;
  64. };
  65. #endif /* __LINUX_REGULATOR_MAX8973_H */