max8973-regulator.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * max8973-regulator.h -- MAXIM 8973 regulator
  4. *
  5. * Interface for regulator driver for MAXIM 8973 DC-DC step-down
  6. * switching regulator.
  7. *
  8. * Copyright (C) 2012 NVIDIA Corporation
  9. * Author: Laxman Dewangan <ldewangan@nvidia.com>
  10. */
  11. #ifndef __LINUX_REGULATOR_MAX8973_H
  12. #define __LINUX_REGULATOR_MAX8973_H
  13. /*
  14. * Control flags for configuration of the device.
  15. * Client need to pass this information with ORed
  16. */
  17. #define MAX8973_CONTROL_REMOTE_SENSE_ENABLE 0x00000001
  18. #define MAX8973_CONTROL_FALLING_SLEW_RATE_ENABLE 0x00000002
  19. #define MAX8973_CONTROL_OUTPUT_ACTIVE_DISCH_ENABLE 0x00000004
  20. #define MAX8973_CONTROL_BIAS_ENABLE 0x00000008
  21. #define MAX8973_CONTROL_PULL_DOWN_ENABLE 0x00000010
  22. #define MAX8973_CONTROL_FREQ_SHIFT_9PER_ENABLE 0x00000020
  23. #define MAX8973_CONTROL_CLKADV_TRIP_DISABLED 0x00000000
  24. #define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US 0x00010000
  25. #define MAX8973_CONTROL_CLKADV_TRIP_150mV_PER_US 0x00020000
  26. #define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US_HIST_DIS 0x00030000
  27. #define MAX8973_CONTROL_INDUCTOR_VALUE_NOMINAL 0x00000000
  28. #define MAX8973_CONTROL_INDUCTOR_VALUE_MINUS_30_PER 0x00100000
  29. #define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_30_PER 0x00200000
  30. #define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_60_PER 0x00300000
  31. /*
  32. * struct max8973_regulator_platform_data - max8973 regulator platform data.
  33. *
  34. * @reg_init_data: The regulator init data.
  35. * @control_flags: Control flags which are ORed value of above flags to
  36. * configure device.
  37. * @junction_temp_warning: Junction temp in millicelcius on which warning need
  38. * to be set. Thermal functionality is only supported on
  39. * MAX77621. The threshold warning supported by MAX77621
  40. * are 120C and 140C.
  41. * @enable_ext_control: Enable the voltage enable/disable through external
  42. * control signal from EN input pin. If it is false then
  43. * voltage output will be enabled/disabled through EN bit of
  44. * device register.
  45. * @enable_gpio: Enable GPIO. If EN pin is controlled through GPIO from host
  46. * then GPIO number can be provided. If no GPIO controlled then
  47. * it should be -1.
  48. * @dvs_gpio: GPIO for dvs. It should be -1 if this is tied with fixed logic.
  49. * @dvs_def_state: Default state of dvs. 1 if it is high else 0.
  50. */
  51. struct max8973_regulator_platform_data {
  52. struct regulator_init_data *reg_init_data;
  53. unsigned long control_flags;
  54. unsigned long junction_temp_warning;
  55. bool enable_ext_control;
  56. int enable_gpio;
  57. int dvs_gpio;
  58. unsigned dvs_def_state:1;
  59. };
  60. #endif /* __LINUX_REGULATOR_MAX8973_H */