124-regulator-rpm-add-support-for-RPM-controller-SMB208.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. From 0f5bb5b5de3b18877373f746bdb85d8ea0efeedf Mon Sep 17 00:00:00 2001
  2. From: Josh Cartwright <joshc@codeaurora.org>
  3. Date: Thu, 20 Nov 2014 13:41:25 -0600
  4. Subject: [PATCH] regulator: rpm: add support for RPM-controller SMB208
  5. The IPQ8064 reference boards make use of SMB208 regulators which are
  6. controlled by RPM. Implement support for these regulators in the RPM
  7. regulator driver.
  8. Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
  9. Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
  10. Signed-off-by: Mark Brown <broonie@kernel.org>
  11. ---
  12. drivers/regulator/qcom_rpm-regulator.c | 19 +++++++++++++++++++
  13. 1 file changed, 19 insertions(+)
  14. --- a/drivers/regulator/qcom_rpm-regulator.c
  15. +++ b/drivers/regulator/qcom_rpm-regulator.c
  16. @@ -183,6 +183,13 @@ static const struct regulator_linear_ran
  17. REGULATOR_LINEAR_RANGE(1500000, 64, 100, 50000),
  18. };
  19. +static const struct regulator_linear_range smb208_ranges[] = {
  20. + REGULATOR_LINEAR_RANGE( 375000, 0, 29, 12500),
  21. + REGULATOR_LINEAR_RANGE( 750000, 30, 89, 12500),
  22. + REGULATOR_LINEAR_RANGE(1500000, 90, 153, 25000),
  23. + REGULATOR_LINEAR_RANGE(3100000, 154, 234, 25000),
  24. +};
  25. +
  26. static const struct regulator_linear_range ncp_ranges[] = {
  27. REGULATOR_LINEAR_RANGE(1500000, 0, 31, 50000),
  28. };
  29. @@ -559,6 +566,16 @@ static const struct qcom_rpm_reg pm8921_
  30. .parts = &rpm8960_switch_parts,
  31. };
  32. +static const struct qcom_rpm_reg smb208_smps = {
  33. + .desc.linear_ranges = smb208_ranges,
  34. + .desc.n_linear_ranges = ARRAY_SIZE(smb208_ranges),
  35. + .desc.n_voltages = 235,
  36. + .desc.ops = &uV_ops,
  37. + .parts = &rpm8960_smps_parts,
  38. + .supports_force_mode_auto = false,
  39. + .supports_force_mode_bypass = false,
  40. +};
  41. +
  42. static const struct of_device_id rpm_of_match[] = {
  43. { .compatible = "qcom,rpm-pm8058-pldo", .data = &pm8058_pldo },
  44. { .compatible = "qcom,rpm-pm8058-nldo", .data = &pm8058_nldo },
  45. @@ -578,6 +595,8 @@ static const struct of_device_id rpm_of_
  46. { .compatible = "qcom,rpm-pm8921-ftsmps", .data = &pm8921_ftsmps },
  47. { .compatible = "qcom,rpm-pm8921-ncp", .data = &pm8921_ncp },
  48. { .compatible = "qcom,rpm-pm8921-switch", .data = &pm8921_switch },
  49. +
  50. + { .compatible = "qcom,rpm-smb208", .data = &smb208_smps },
  51. { }
  52. };
  53. MODULE_DEVICE_TABLE(of, rpm_of_match);