Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 1 | /* |
Venkat Gopalakrishnan | b9d8bbd | 2012-12-04 19:36:47 -0800 | [diff] [blame] | 2 | * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 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 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 14 | #include <linux/regulator/pm8xxx-regulator.h> |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 15 | |
Stepan Moskovchenko | 5a83dba | 2011-12-05 17:30:17 -0800 | [diff] [blame] | 16 | #include "board-8064.h" |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 17 | |
| 18 | #define VREG_CONSUMERS(_id) \ |
| 19 | static struct regulator_consumer_supply vreg_consumers_##_id[] |
| 20 | |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 21 | /* Regulators that are present when using either PM8921 or PM8917 */ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 22 | /* |
| 23 | * Consumer specific regulator names: |
| 24 | * regulator name consumer dev_name |
| 25 | */ |
| 26 | VREG_CONSUMERS(L1) = { |
| 27 | REGULATOR_SUPPLY("8921_l1", NULL), |
| 28 | }; |
| 29 | VREG_CONSUMERS(L2) = { |
| 30 | REGULATOR_SUPPLY("8921_l2", NULL), |
Kevin Chan | 330e4d5 | 2012-02-18 23:11:24 -0800 | [diff] [blame] | 31 | REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.0"), |
| 32 | REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.1"), |
| 33 | REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.2"), |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 34 | REGULATOR_SUPPLY("lvds_pll_vdda", "lvds.0"), |
| 35 | REGULATOR_SUPPLY("dsi1_pll_vdda", "mipi_dsi.1"), |
Santosh Mardi | 344455a | 2012-09-07 13:22:16 +0530 | [diff] [blame] | 36 | REGULATOR_SUPPLY("HRD_VDDD_CDC_D", "tabla2x-slim"), |
| 37 | REGULATOR_SUPPLY("HRD_CDC_VDDA_A_1P2V", "tabla2x-slim"), |
Ravishangar Kalyanam | ad32002 | 2012-07-23 18:26:09 -0700 | [diff] [blame] | 38 | REGULATOR_SUPPLY("dsi_pll_vdda", "mdp.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 39 | }; |
| 40 | VREG_CONSUMERS(L3) = { |
| 41 | REGULATOR_SUPPLY("8921_l3", NULL), |
Hemant Kumar | 6ddad59 | 2011-08-03 19:31:56 -0700 | [diff] [blame] | 42 | REGULATOR_SUPPLY("HSUSB_3p3", "msm_otg"), |
Manu Gautam | dccbca4 | 2011-11-08 15:13:38 +0530 | [diff] [blame] | 43 | REGULATOR_SUPPLY("HSUSB_3p3", "msm_ehci_host.0"), |
| 44 | REGULATOR_SUPPLY("HSUSB_3p3", "msm_ehci_host.1"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 45 | }; |
| 46 | VREG_CONSUMERS(L4) = { |
| 47 | REGULATOR_SUPPLY("8921_l4", NULL), |
Hemant Kumar | 6ddad59 | 2011-08-03 19:31:56 -0700 | [diff] [blame] | 48 | REGULATOR_SUPPLY("HSUSB_1p8", "msm_otg"), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 49 | REGULATOR_SUPPLY("iris_vddxo", "wcnss_wlan.0"), |
Ankit Verma | 6fe41b0 | 2012-09-13 16:12:11 +0530 | [diff] [blame] | 50 | REGULATOR_SUPPLY("bha_vddxo", "bt_power"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 51 | }; |
| 52 | VREG_CONSUMERS(L5) = { |
| 53 | REGULATOR_SUPPLY("8921_l5", NULL), |
Sahitya Tummala | b4d883f | 2011-08-23 10:44:51 +0530 | [diff] [blame] | 54 | REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.1"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 55 | }; |
| 56 | VREG_CONSUMERS(L6) = { |
| 57 | REGULATOR_SUPPLY("8921_l6", NULL), |
Sahitya Tummala | b4d883f | 2011-08-23 10:44:51 +0530 | [diff] [blame] | 58 | REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.3"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 59 | }; |
| 60 | VREG_CONSUMERS(L7) = { |
| 61 | REGULATOR_SUPPLY("8921_l7", NULL), |
Subhash Jadavani | 937c750 | 2012-06-01 15:34:46 +0530 | [diff] [blame] | 62 | REGULATOR_SUPPLY("sdc_vdd_io", "msm_sdcc.3"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 63 | }; |
| 64 | VREG_CONSUMERS(L8) = { |
| 65 | REGULATOR_SUPPLY("8921_l8", NULL), |
Jeyaprakash Soundrapandian | f0d4d01 | 2012-01-16 15:12:20 -0800 | [diff] [blame] | 66 | REGULATOR_SUPPLY("cam_vana", "4-001a"), |
Punit Soni | 5785010 | 2012-09-26 11:31:27 -0700 | [diff] [blame] | 67 | REGULATOR_SUPPLY("cam_vana", "4-0010"), |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 68 | REGULATOR_SUPPLY("cam_vana", "4-0048"), |
Jeyaprakash Soundrapandian | f0d4d01 | 2012-01-16 15:12:20 -0800 | [diff] [blame] | 69 | REGULATOR_SUPPLY("cam_vana", "4-006c"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 70 | REGULATOR_SUPPLY("cam_vana", "4-0034"), |
Sreesudhan Ramakrish Ramkumar | 8002a79 | 2012-04-09 17:42:58 -0700 | [diff] [blame] | 71 | REGULATOR_SUPPLY("cam_vana", "4-0020"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 72 | }; |
| 73 | VREG_CONSUMERS(L9) = { |
| 74 | REGULATOR_SUPPLY("8921_l9", NULL), |
Anirudh Ghayal | 2917a5a | 2012-02-05 19:51:07 -0800 | [diff] [blame] | 75 | REGULATOR_SUPPLY("vdd", "3-0024"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 76 | }; |
| 77 | VREG_CONSUMERS(L10) = { |
| 78 | REGULATOR_SUPPLY("8921_l10", NULL), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 79 | REGULATOR_SUPPLY("iris_vddpa", "wcnss_wlan.0"), |
Ankit Verma | 6fe41b0 | 2012-09-13 16:12:11 +0530 | [diff] [blame] | 80 | REGULATOR_SUPPLY("bha_vddpa", "bt_power"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 81 | }; |
| 82 | VREG_CONSUMERS(L11) = { |
| 83 | REGULATOR_SUPPLY("8921_l11", NULL), |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 84 | REGULATOR_SUPPLY("dsi1_avdd", "mipi_dsi.1"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 85 | }; |
| 86 | VREG_CONSUMERS(L12) = { |
Jeyaprakash Soundrapandian | f0d4d01 | 2012-01-16 15:12:20 -0800 | [diff] [blame] | 87 | REGULATOR_SUPPLY("cam_vdig", "4-001a"), |
Punit Soni | 5785010 | 2012-09-26 11:31:27 -0700 | [diff] [blame] | 88 | REGULATOR_SUPPLY("cam_vdig", "4-0010"), |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 89 | REGULATOR_SUPPLY("cam_vdig", "4-0048"), |
Jeyaprakash Soundrapandian | f0d4d01 | 2012-01-16 15:12:20 -0800 | [diff] [blame] | 90 | REGULATOR_SUPPLY("cam_vdig", "4-006c"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 91 | REGULATOR_SUPPLY("cam_vdig", "4-0034"), |
Sreesudhan Ramakrish Ramkumar | 8002a79 | 2012-04-09 17:42:58 -0700 | [diff] [blame] | 92 | REGULATOR_SUPPLY("cam_vdig", "4-0020"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 93 | REGULATOR_SUPPLY("8921_l12", NULL), |
| 94 | }; |
David Collins | d459ace | 2012-08-31 12:13:28 -0700 | [diff] [blame] | 95 | VREG_CONSUMERS(L13) = { |
| 96 | REGULATOR_SUPPLY("8921_l13", NULL), |
| 97 | }; |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 98 | VREG_CONSUMERS(L14) = { |
| 99 | REGULATOR_SUPPLY("8921_l14", NULL), |
David Keitel | 663abad | 2012-09-04 21:00:27 -0700 | [diff] [blame] | 100 | REGULATOR_SUPPLY("vreg_xoadc", "pm8921-charger"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 101 | }; |
| 102 | VREG_CONSUMERS(L15) = { |
| 103 | REGULATOR_SUPPLY("8921_l15", NULL), |
| 104 | }; |
| 105 | VREG_CONSUMERS(L16) = { |
| 106 | REGULATOR_SUPPLY("8921_l16", NULL), |
Jeyaprakash Soundrapandian | f0d4d01 | 2012-01-16 15:12:20 -0800 | [diff] [blame] | 107 | REGULATOR_SUPPLY("cam_vaf", "4-001a"), |
Punit Soni | 5785010 | 2012-09-26 11:31:27 -0700 | [diff] [blame] | 108 | REGULATOR_SUPPLY("cam_vaf", "4-0010"), |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 109 | REGULATOR_SUPPLY("cam_vaf", "4-0048"), |
Jeyaprakash Soundrapandian | f0d4d01 | 2012-01-16 15:12:20 -0800 | [diff] [blame] | 110 | REGULATOR_SUPPLY("cam_vaf", "4-006c"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 111 | REGULATOR_SUPPLY("cam_vaf", "4-0034"), |
Sreesudhan Ramakrish Ramkumar | 8002a79 | 2012-04-09 17:42:58 -0700 | [diff] [blame] | 112 | REGULATOR_SUPPLY("cam_vaf", "4-0020"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 113 | }; |
| 114 | VREG_CONSUMERS(L17) = { |
| 115 | REGULATOR_SUPPLY("8921_l17", NULL), |
| 116 | }; |
| 117 | VREG_CONSUMERS(L18) = { |
| 118 | REGULATOR_SUPPLY("8921_l18", NULL), |
| 119 | }; |
David Collins | 1bf88da | 2012-05-03 14:58:34 -0700 | [diff] [blame] | 120 | VREG_CONSUMERS(L21) = { |
| 121 | REGULATOR_SUPPLY("8921_l21", NULL), |
| 122 | }; |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 123 | VREG_CONSUMERS(L22) = { |
| 124 | REGULATOR_SUPPLY("8921_l22", NULL), |
| 125 | }; |
| 126 | VREG_CONSUMERS(L23) = { |
| 127 | REGULATOR_SUPPLY("8921_l23", NULL), |
Manu Gautam | 91223e0 | 2011-11-08 15:27:22 +0530 | [diff] [blame] | 128 | REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.0"), |
| 129 | REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.1"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 130 | }; |
| 131 | VREG_CONSUMERS(L24) = { |
| 132 | REGULATOR_SUPPLY("8921_l24", NULL), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 133 | REGULATOR_SUPPLY("riva_vddmx", "wcnss_wlan.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 134 | }; |
| 135 | VREG_CONSUMERS(L25) = { |
| 136 | REGULATOR_SUPPLY("8921_l25", NULL), |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 137 | REGULATOR_SUPPLY("VDDD_CDC_D", "tabla-slim"), |
| 138 | REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla-slim"), |
Swaminathan Sathappan | 2316e08 | 2012-02-03 14:07:17 -0800 | [diff] [blame] | 139 | REGULATOR_SUPPLY("VDDD_CDC_D", "tabla2x-slim"), |
| 140 | REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla2x-slim"), |
Kuirong Wang | f8c5e14 | 2012-06-21 16:17:32 -0700 | [diff] [blame] | 141 | REGULATOR_SUPPLY("VDDD_CDC_D", "0-000d"), |
| 142 | REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "0-000d"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 143 | }; |
| 144 | VREG_CONSUMERS(L26) = { |
| 145 | REGULATOR_SUPPLY("8921_l26", NULL), |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 146 | REGULATOR_SUPPLY("core_vdd", "pil-q6v4-lpass"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 147 | }; |
| 148 | VREG_CONSUMERS(L27) = { |
| 149 | REGULATOR_SUPPLY("8921_l27", NULL), |
| 150 | }; |
| 151 | VREG_CONSUMERS(L28) = { |
| 152 | REGULATOR_SUPPLY("8921_l28", NULL), |
| 153 | }; |
David Collins | 1bf88da | 2012-05-03 14:58:34 -0700 | [diff] [blame] | 154 | VREG_CONSUMERS(L29) = { |
| 155 | REGULATOR_SUPPLY("8921_l29", NULL), |
| 156 | }; |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 157 | VREG_CONSUMERS(S2) = { |
| 158 | REGULATOR_SUPPLY("8921_s2", NULL), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 159 | REGULATOR_SUPPLY("iris_vddrfa", "wcnss_wlan.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 160 | }; |
| 161 | VREG_CONSUMERS(S3) = { |
| 162 | REGULATOR_SUPPLY("8921_s3", NULL), |
Hemant Kumar | 6ddad59 | 2011-08-03 19:31:56 -0700 | [diff] [blame] | 163 | REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_otg"), |
Manu Gautam | dccbca4 | 2011-11-08 15:13:38 +0530 | [diff] [blame] | 164 | REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_ehci_host.0"), |
| 165 | REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_ehci_host.1"), |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame] | 166 | REGULATOR_SUPPLY("HSIC_VDDCX", "msm_hsic_host"), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 167 | REGULATOR_SUPPLY("riva_vddcx", "wcnss_wlan.0"), |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 168 | REGULATOR_SUPPLY("vp_pcie", "msm_pcie"), |
| 169 | REGULATOR_SUPPLY("vptx_pcie", "msm_pcie"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 170 | }; |
| 171 | VREG_CONSUMERS(S4) = { |
| 172 | REGULATOR_SUPPLY("8921_s4", NULL), |
Subhash Jadavani | 937c750 | 2012-06-01 15:34:46 +0530 | [diff] [blame] | 173 | REGULATOR_SUPPLY("sdc_vdd_io", "msm_sdcc.1"), |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 174 | REGULATOR_SUPPLY("VDDIO_CDC", "tabla-slim"), |
| 175 | REGULATOR_SUPPLY("CDC_VDD_CP", "tabla-slim"), |
| 176 | REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla-slim"), |
| 177 | REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla-slim"), |
Swaminathan Sathappan | 2316e08 | 2012-02-03 14:07:17 -0800 | [diff] [blame] | 178 | REGULATOR_SUPPLY("VDDIO_CDC", "tabla2x-slim"), |
| 179 | REGULATOR_SUPPLY("CDC_VDD_CP", "tabla2x-slim"), |
| 180 | REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla2x-slim"), |
| 181 | REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla2x-slim"), |
Kuirong Wang | f8c5e14 | 2012-06-21 16:17:32 -0700 | [diff] [blame] | 182 | REGULATOR_SUPPLY("VDDIO_CDC", "0-000d"), |
| 183 | REGULATOR_SUPPLY("CDC_VDD_CP", "0-000d"), |
| 184 | REGULATOR_SUPPLY("CDC_VDDA_TX", "0-000d"), |
| 185 | REGULATOR_SUPPLY("CDC_VDDA_RX", "0-000d"), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 186 | REGULATOR_SUPPLY("riva_vddpx", "wcnss_wlan.0"), |
Ankit Verma | 6fe41b0 | 2012-09-13 16:12:11 +0530 | [diff] [blame] | 187 | REGULATOR_SUPPLY("bha_vddpx", "bt_power"), |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 188 | REGULATOR_SUPPLY("vcc_i2c", "3-005b"), |
Anirudh Ghayal | 2917a5a | 2012-02-05 19:51:07 -0800 | [diff] [blame] | 189 | REGULATOR_SUPPLY("vcc_i2c", "3-0024"), |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 190 | REGULATOR_SUPPLY("vddp", "0-0048"), |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 191 | REGULATOR_SUPPLY("hdmi_lvl_tsl", "hdmi_msm.0"), |
Stepan Moskovchenko | fdea940 | 2012-09-10 18:51:43 -0700 | [diff] [blame] | 192 | REGULATOR_SUPPLY("vdd-io", "spi0.2"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 193 | }; |
| 194 | VREG_CONSUMERS(S5) = { |
| 195 | REGULATOR_SUPPLY("8921_s5", NULL), |
Matt Wagantall | f5cc389 | 2012-06-07 19:47:02 -0700 | [diff] [blame] | 196 | REGULATOR_SUPPLY("krait0", "acpuclk-8064"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 197 | }; |
| 198 | VREG_CONSUMERS(S6) = { |
| 199 | REGULATOR_SUPPLY("8921_s6", NULL), |
Matt Wagantall | f5cc389 | 2012-06-07 19:47:02 -0700 | [diff] [blame] | 200 | REGULATOR_SUPPLY("krait1", "acpuclk-8064"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 201 | }; |
| 202 | VREG_CONSUMERS(S7) = { |
| 203 | REGULATOR_SUPPLY("8921_s7", NULL), |
| 204 | }; |
David Collins | 1bf88da | 2012-05-03 14:58:34 -0700 | [diff] [blame] | 205 | VREG_CONSUMERS(S8) = { |
| 206 | REGULATOR_SUPPLY("8921_s8", NULL), |
| 207 | }; |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 208 | VREG_CONSUMERS(LVS1) = { |
| 209 | REGULATOR_SUPPLY("8921_lvs1", NULL), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 210 | REGULATOR_SUPPLY("iris_vddio", "wcnss_wlan.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 211 | }; |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 212 | VREG_CONSUMERS(LVS3) = { |
| 213 | REGULATOR_SUPPLY("8921_lvs3", NULL), |
| 214 | }; |
| 215 | VREG_CONSUMERS(LVS4) = { |
| 216 | REGULATOR_SUPPLY("8921_lvs4", NULL), |
| 217 | }; |
| 218 | VREG_CONSUMERS(LVS5) = { |
| 219 | REGULATOR_SUPPLY("8921_lvs5", NULL), |
Jeyaprakash Soundrapandian | f0d4d01 | 2012-01-16 15:12:20 -0800 | [diff] [blame] | 220 | REGULATOR_SUPPLY("cam_vio", "4-001a"), |
Punit Soni | 5785010 | 2012-09-26 11:31:27 -0700 | [diff] [blame] | 221 | REGULATOR_SUPPLY("cam_vio", "4-0010"), |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 222 | REGULATOR_SUPPLY("cam_vio", "4-0048"), |
Jeyaprakash Soundrapandian | f0d4d01 | 2012-01-16 15:12:20 -0800 | [diff] [blame] | 223 | REGULATOR_SUPPLY("cam_vio", "4-006c"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 224 | REGULATOR_SUPPLY("cam_vio", "4-0034"), |
Sreesudhan Ramakrish Ramkumar | 8002a79 | 2012-04-09 17:42:58 -0700 | [diff] [blame] | 225 | REGULATOR_SUPPLY("cam_vio", "4-0020"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 226 | }; |
| 227 | VREG_CONSUMERS(LVS6) = { |
| 228 | REGULATOR_SUPPLY("8921_lvs6", NULL), |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 229 | REGULATOR_SUPPLY("vdd_pcie_vph", "msm_pcie"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 230 | }; |
| 231 | VREG_CONSUMERS(LVS7) = { |
| 232 | REGULATOR_SUPPLY("8921_lvs7", NULL), |
Matt Wagantall | 52dd062 | 2012-02-02 18:26:16 -0800 | [diff] [blame] | 233 | REGULATOR_SUPPLY("pll_vdd", "pil_riva"), |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 234 | REGULATOR_SUPPLY("lvds_vdda", "lvds.0"), |
| 235 | REGULATOR_SUPPLY("dsi1_vddio", "mipi_dsi.1"), |
Ravishangar Kalyanam | ad32002 | 2012-07-23 18:26:09 -0700 | [diff] [blame] | 236 | REGULATOR_SUPPLY("dsi_pll_vddio", "mdp.0"), |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 237 | REGULATOR_SUPPLY("hdmi_vdda", "hdmi_msm.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 238 | }; |
| 239 | VREG_CONSUMERS(USB_OTG) = { |
| 240 | REGULATOR_SUPPLY("8921_usb_otg", NULL), |
Hemant Kumar | d86c488 | 2012-01-24 19:39:37 -0800 | [diff] [blame] | 241 | REGULATOR_SUPPLY("vbus_otg", "msm_otg"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 242 | }; |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 243 | VREG_CONSUMERS(8821_S0) = { |
| 244 | REGULATOR_SUPPLY("8821_s0", NULL), |
Matt Wagantall | f5cc389 | 2012-06-07 19:47:02 -0700 | [diff] [blame] | 245 | REGULATOR_SUPPLY("krait2", "acpuclk-8064"), |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 246 | }; |
| 247 | VREG_CONSUMERS(8821_S1) = { |
| 248 | REGULATOR_SUPPLY("8821_s1", NULL), |
Matt Wagantall | f5cc389 | 2012-06-07 19:47:02 -0700 | [diff] [blame] | 249 | REGULATOR_SUPPLY("krait3", "acpuclk-8064"), |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 250 | }; |
Jay Chokshi | 1de4f9d | 2012-02-07 16:11:31 -0800 | [diff] [blame] | 251 | VREG_CONSUMERS(EXT_MPP8) = { |
| 252 | REGULATOR_SUPPLY("ext_mpp8", NULL), |
Hemant Kumar | 1d66e1c | 2012-02-13 15:24:59 -0800 | [diff] [blame] | 253 | REGULATOR_SUPPLY("vbus", "msm_ehci_host.1"), |
Jay Chokshi | 1de4f9d | 2012-02-07 16:11:31 -0800 | [diff] [blame] | 254 | }; |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 255 | VREG_CONSUMERS(EXT_3P3V) = { |
| 256 | REGULATOR_SUPPLY("ext_3p3v", NULL), |
Stepan Moskovchenko | fdea940 | 2012-09-10 18:51:43 -0700 | [diff] [blame] | 257 | REGULATOR_SUPPLY("vdd-phy", "spi0.2"), |
Pavankumar Kondeti | 57fc896 | 2012-07-06 08:20:18 +0530 | [diff] [blame] | 258 | REGULATOR_SUPPLY("mhl_usb_hs_switch", "msm_otg"), |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 259 | REGULATOR_SUPPLY("lvds_vccs_3p3v", "lvds.0"), |
| 260 | REGULATOR_SUPPLY("dsi1_vccs_3p3v", "mipi_dsi.1"), |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 261 | REGULATOR_SUPPLY("hdmi_mux_vdd", "hdmi_msm.0"), |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 262 | REGULATOR_SUPPLY("pcie_ext_3p3v", "msm_pcie"), |
Venkat Gopalakrishnan | b9d8bbd | 2012-12-04 19:36:47 -0800 | [diff] [blame] | 263 | REGULATOR_SUPPLY("sata_ext_3p3v", "ahci.0"), |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 264 | }; |
David Collins | 390fc33 | 2012-02-07 14:38:16 -0800 | [diff] [blame] | 265 | VREG_CONSUMERS(EXT_TS_SW) = { |
| 266 | REGULATOR_SUPPLY("ext_ts_sw", NULL), |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 267 | REGULATOR_SUPPLY("vdd_ana", "3-005b"), |
David Collins | 390fc33 | 2012-02-07 14:38:16 -0800 | [diff] [blame] | 268 | }; |
Jay Chokshi | 1b7eaa9 | 2012-04-04 14:53:14 -0700 | [diff] [blame] | 269 | VREG_CONSUMERS(AVC_1P2V) = { |
| 270 | REGULATOR_SUPPLY("avc_1p2v", NULL), |
| 271 | }; |
| 272 | VREG_CONSUMERS(AVC_1P8V) = { |
| 273 | REGULATOR_SUPPLY("avc_1p8v", NULL), |
| 274 | }; |
| 275 | VREG_CONSUMERS(AVC_2P2V) = { |
| 276 | REGULATOR_SUPPLY("avc_2p2v", NULL), |
| 277 | }; |
| 278 | VREG_CONSUMERS(AVC_5V) = { |
| 279 | REGULATOR_SUPPLY("avc_5v", NULL), |
| 280 | }; |
| 281 | VREG_CONSUMERS(AVC_3P3V) = { |
| 282 | REGULATOR_SUPPLY("avc_3p3v", NULL), |
| 283 | }; |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 284 | |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 285 | /* Regulators that are only present when using PM8921 */ |
| 286 | VREG_CONSUMERS(S1) = { |
| 287 | REGULATOR_SUPPLY("8921_s1", NULL), |
| 288 | }; |
| 289 | VREG_CONSUMERS(LVS2) = { |
| 290 | REGULATOR_SUPPLY("8921_lvs2", NULL), |
| 291 | REGULATOR_SUPPLY("iris_vdddig", "wcnss_wlan.0"), |
| 292 | }; |
| 293 | VREG_CONSUMERS(HDMI_MVS) = { |
| 294 | REGULATOR_SUPPLY("8921_hdmi_mvs", NULL), |
| 295 | REGULATOR_SUPPLY("hdmi_mvs", "hdmi_msm.0"), |
| 296 | }; |
| 297 | VREG_CONSUMERS(NCP) = { |
| 298 | REGULATOR_SUPPLY("8921_ncp", NULL), |
| 299 | }; |
| 300 | VREG_CONSUMERS(EXT_5V) = { |
| 301 | REGULATOR_SUPPLY("ext_5v", NULL), |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 302 | REGULATOR_SUPPLY("vbus", "msm_ehci_host.0"), |
| 303 | }; |
| 304 | |
| 305 | /* Regulators that are only present when using PM8917 */ |
| 306 | VREG_CONSUMERS(8917_S1) = { |
| 307 | REGULATOR_SUPPLY("8921_s1", NULL), |
| 308 | REGULATOR_SUPPLY("iris_vdddig", "wcnss_wlan.0"), |
| 309 | }; |
| 310 | VREG_CONSUMERS(L30) = { |
| 311 | REGULATOR_SUPPLY("8917_l30", NULL), |
| 312 | }; |
| 313 | VREG_CONSUMERS(L31) = { |
| 314 | REGULATOR_SUPPLY("8917_l31", NULL), |
| 315 | }; |
| 316 | VREG_CONSUMERS(L32) = { |
| 317 | REGULATOR_SUPPLY("8917_l32", NULL), |
| 318 | }; |
| 319 | VREG_CONSUMERS(L33) = { |
| 320 | REGULATOR_SUPPLY("8917_l33", NULL), |
| 321 | }; |
| 322 | VREG_CONSUMERS(L34) = { |
| 323 | REGULATOR_SUPPLY("8917_l34", NULL), |
| 324 | }; |
| 325 | VREG_CONSUMERS(L35) = { |
| 326 | REGULATOR_SUPPLY("8917_l35", NULL), |
| 327 | }; |
| 328 | VREG_CONSUMERS(L36) = { |
| 329 | REGULATOR_SUPPLY("8917_l36", NULL), |
| 330 | }; |
| 331 | VREG_CONSUMERS(BOOST) = { |
| 332 | REGULATOR_SUPPLY("8917_boost", NULL), |
| 333 | REGULATOR_SUPPLY("ext_ddr3", NULL), |
| 334 | REGULATOR_SUPPLY("vbus", "msm_ehci_host.0"), |
| 335 | REGULATOR_SUPPLY("hdmi_mvs", "hdmi_msm.0"), |
| 336 | }; |
| 337 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 338 | #define PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, _modes, _ops, \ |
| 339 | _apply_uV, _pull_down, _always_on, _supply_regulator, \ |
| 340 | _system_uA, _enable_time, _reg_id) \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 341 | { \ |
| 342 | .init_data = { \ |
| 343 | .constraints = { \ |
| 344 | .valid_modes_mask = _modes, \ |
| 345 | .valid_ops_mask = _ops, \ |
| 346 | .min_uV = _min_uV, \ |
| 347 | .max_uV = _max_uV, \ |
| 348 | .input_uV = _max_uV, \ |
| 349 | .apply_uV = _apply_uV, \ |
| 350 | .always_on = _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 351 | .name = _name, \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 352 | }, \ |
| 353 | .num_consumer_supplies = \ |
| 354 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 355 | .consumer_supplies = vreg_consumers_##_id, \ |
| 356 | .supply_regulator = _supply_regulator, \ |
| 357 | }, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 358 | .id = _reg_id, \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 359 | .pull_down_enable = _pull_down, \ |
| 360 | .system_uA = _system_uA, \ |
| 361 | .enable_time = _enable_time, \ |
| 362 | } |
| 363 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 364 | #define PM8XXX_LDO(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 365 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 366 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 367 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 368 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 369 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 370 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 371 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 372 | #define PM8XXX_NLDO1200(_id, _name, _always_on, _pull_down, _min_uV, \ |
| 373 | _max_uV, _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 374 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 375 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 376 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 377 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 378 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 379 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 380 | #define PM8XXX_SMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 381 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 382 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 383 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 384 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 385 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 386 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 387 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 388 | #define PM8XXX_FTSMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 389 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 390 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL, \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 391 | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS \ |
| 392 | | REGULATOR_CHANGE_MODE, 0, _pull_down, _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 393 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 394 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 395 | #define PM8XXX_VS(_id, _name, _always_on, _pull_down, _enable_time, \ |
| 396 | _supply_regulator, _reg_id) \ |
| 397 | PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \ |
| 398 | _pull_down, _always_on, _supply_regulator, 0, _enable_time, \ |
| 399 | _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 400 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 401 | #define PM8XXX_VS300(_id, _name, _always_on, _pull_down, _enable_time, \ |
| 402 | _supply_regulator, _reg_id) \ |
| 403 | PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \ |
| 404 | _pull_down, _always_on, _supply_regulator, 0, _enable_time, \ |
| 405 | _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 406 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 407 | #define PM8XXX_NCP(_id, _name, _always_on, _min_uV, _max_uV, _enable_time, \ |
| 408 | _supply_regulator, _reg_id) \ |
| 409 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, 0, \ |
| 410 | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, 0, \ |
| 411 | _always_on, _supply_regulator, 0, _enable_time, _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 412 | |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 413 | #define PM8XXX_BOOST(_id, _name, _always_on, _min_uV, _max_uV, _enable_time, \ |
| 414 | _supply_regulator, _reg_id) \ |
| 415 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, 0, \ |
| 416 | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, 0, \ |
| 417 | _always_on, _supply_regulator, 0, _enable_time, _reg_id) |
| 418 | |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 419 | /* Pin control initialization */ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 420 | #define PM8XXX_PC(_id, _name, _always_on, _pin_fn, _pin_ctrl, \ |
| 421 | _supply_regulator, _reg_id) \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 422 | { \ |
| 423 | .init_data = { \ |
| 424 | .constraints = { \ |
| 425 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 426 | .always_on = _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 427 | .name = _name, \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 428 | }, \ |
| 429 | .num_consumer_supplies = \ |
| 430 | ARRAY_SIZE(vreg_consumers_##_id##_PC), \ |
| 431 | .consumer_supplies = vreg_consumers_##_id##_PC, \ |
| 432 | .supply_regulator = _supply_regulator, \ |
| 433 | }, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 434 | .id = _reg_id, \ |
| 435 | .pin_fn = PM8XXX_VREG_PIN_FN_##_pin_fn, \ |
| 436 | .pin_ctrl = _pin_ctrl, \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 437 | } |
| 438 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 439 | #define GPIO_VREG(_id, _reg_name, _gpio_label, _gpio, _supply_regulator) \ |
| 440 | [GPIO_VREG_ID_##_id] = { \ |
| 441 | .init_data = { \ |
| 442 | .constraints = { \ |
| 443 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 444 | }, \ |
| 445 | .num_consumer_supplies = \ |
| 446 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 447 | .consumer_supplies = vreg_consumers_##_id, \ |
| 448 | .supply_regulator = _supply_regulator, \ |
| 449 | }, \ |
| 450 | .regulator_name = _reg_name, \ |
| 451 | .gpio_label = _gpio_label, \ |
| 452 | .gpio = _gpio, \ |
| 453 | } |
| 454 | |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 455 | #define SAW_VREG_INIT(_id, _name, _min_uV, _max_uV) \ |
| 456 | { \ |
| 457 | .constraints = { \ |
| 458 | .name = _name, \ |
Michael Bohan | ee3ce19c | 2012-11-13 14:57:40 -0800 | [diff] [blame] | 459 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | \ |
| 460 | REGULATOR_CHANGE_STATUS, \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 461 | .min_uV = _min_uV, \ |
| 462 | .max_uV = _max_uV, \ |
| 463 | }, \ |
| 464 | .num_consumer_supplies = ARRAY_SIZE(vreg_consumers_##_id), \ |
| 465 | .consumer_supplies = vreg_consumers_##_id, \ |
| 466 | } |
| 467 | |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 468 | #define RPM_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, _default_uV, \ |
| 469 | _peak_uA, _avg_uA, _pull_down, _pin_ctrl, _freq, _pin_fn, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 470 | _force_mode, _sleep_set_force_mode, _power_mode, _state, \ |
| 471 | _sleep_selectable, _always_on, _supply_regulator, _system_uA) \ |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 472 | { \ |
| 473 | .init_data = { \ |
| 474 | .constraints = { \ |
| 475 | .valid_modes_mask = _modes, \ |
| 476 | .valid_ops_mask = _ops, \ |
| 477 | .min_uV = _min_uV, \ |
| 478 | .max_uV = _max_uV, \ |
| 479 | .input_uV = _min_uV, \ |
| 480 | .apply_uV = _apply_uV, \ |
| 481 | .always_on = _always_on, \ |
| 482 | }, \ |
| 483 | .num_consumer_supplies = \ |
| 484 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 485 | .consumer_supplies = vreg_consumers_##_id, \ |
| 486 | .supply_regulator = _supply_regulator, \ |
| 487 | }, \ |
| 488 | .id = RPM_VREG_ID_PM8921_##_id, \ |
| 489 | .default_uV = _default_uV, \ |
| 490 | .peak_uA = _peak_uA, \ |
| 491 | .avg_uA = _avg_uA, \ |
| 492 | .pull_down_enable = _pull_down, \ |
| 493 | .pin_ctrl = _pin_ctrl, \ |
| 494 | .freq = RPM_VREG_FREQ_##_freq, \ |
| 495 | .pin_fn = _pin_fn, \ |
| 496 | .force_mode = _force_mode, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 497 | .sleep_set_force_mode = _sleep_set_force_mode, \ |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 498 | .power_mode = _power_mode, \ |
| 499 | .state = _state, \ |
| 500 | .sleep_selectable = _sleep_selectable, \ |
| 501 | .system_uA = _system_uA, \ |
| 502 | } |
| 503 | |
| 504 | #define RPM_LDO(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \ |
| 505 | _supply_regulator, _system_uA, _init_peak_uA) \ |
| 506 | RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
| 507 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \ |
| 508 | | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \ |
| 509 | | REGULATOR_CHANGE_DRMS, 0, _max_uV, _init_peak_uA, 0, _pd, \ |
| 510 | RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8960_NONE, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 511 | RPM_VREG_FORCE_MODE_8960_NONE, \ |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 512 | RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \ |
| 513 | RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \ |
| 514 | _supply_regulator, _system_uA) |
| 515 | |
| 516 | #define RPM_SMPS(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \ |
David Collins | 3d2b945 | 2012-03-19 11:00:30 -0700 | [diff] [blame] | 517 | _supply_regulator, _system_uA, _freq, _force_mode, \ |
| 518 | _sleep_set_force_mode) \ |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 519 | RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
| 520 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \ |
| 521 | | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \ |
| 522 | | REGULATOR_CHANGE_DRMS, 0, _max_uV, _system_uA, 0, _pd, \ |
| 523 | RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \ |
David Collins | 3d2b945 | 2012-03-19 11:00:30 -0700 | [diff] [blame] | 524 | RPM_VREG_FORCE_MODE_8960_##_force_mode, \ |
| 525 | RPM_VREG_FORCE_MODE_8960_##_sleep_set_force_mode, \ |
| 526 | RPM_VREG_POWER_MODE_8960_PWM, RPM_VREG_STATE_OFF, \ |
| 527 | _sleep_selectable, _always_on, _supply_regulator, _system_uA) |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 528 | |
| 529 | #define RPM_VS(_id, _always_on, _pd, _sleep_selectable, _supply_regulator) \ |
| 530 | RPM_INIT(_id, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, 0, 1000, 1000, _pd, \ |
| 531 | RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8960_NONE, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 532 | RPM_VREG_FORCE_MODE_8960_NONE, \ |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 533 | RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \ |
| 534 | RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \ |
| 535 | _supply_regulator, 0) |
| 536 | |
| 537 | #define RPM_NCP(_id, _always_on, _sleep_selectable, _min_uV, _max_uV, \ |
| 538 | _supply_regulator, _freq) \ |
| 539 | RPM_INIT(_id, _min_uV, _max_uV, 0, REGULATOR_CHANGE_VOLTAGE \ |
| 540 | | REGULATOR_CHANGE_STATUS, 0, _max_uV, 1000, 1000, 0, \ |
| 541 | RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 542 | RPM_VREG_FORCE_MODE_8960_NONE, \ |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 543 | RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \ |
| 544 | RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \ |
| 545 | _supply_regulator, 0) |
| 546 | |
| 547 | /* Pin control initialization */ |
| 548 | #define RPM_PC_INIT(_id, _always_on, _pin_fn, _pin_ctrl, _supply_regulator) \ |
| 549 | { \ |
| 550 | .init_data = { \ |
| 551 | .constraints = { \ |
| 552 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 553 | .always_on = _always_on, \ |
| 554 | }, \ |
| 555 | .num_consumer_supplies = \ |
| 556 | ARRAY_SIZE(vreg_consumers_##_id##_PC), \ |
| 557 | .consumer_supplies = vreg_consumers_##_id##_PC, \ |
| 558 | .supply_regulator = _supply_regulator, \ |
| 559 | }, \ |
| 560 | .id = RPM_VREG_ID_PM8921_##_id##_PC, \ |
| 561 | .pin_fn = RPM_VREG_PIN_FN_8960_##_pin_fn, \ |
| 562 | .pin_ctrl = _pin_ctrl, \ |
| 563 | } |
| 564 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 565 | /* GPIO regulator constraints */ |
| 566 | struct gpio_regulator_platform_data |
| 567 | apq8064_gpio_regulator_pdata[] __devinitdata = { |
| 568 | /* ID vreg_name gpio_label gpio supply */ |
| 569 | GPIO_VREG(EXT_5V, "ext_5v", "ext_5v_en", PM8921_MPP_PM_TO_SYS(7), NULL), |
| 570 | GPIO_VREG(EXT_3P3V, "ext_3p3v", "ext_3p3v_en", |
| 571 | APQ8064_EXT_3P3V_REG_EN_GPIO, NULL), |
David Collins | 390fc33 | 2012-02-07 14:38:16 -0800 | [diff] [blame] | 572 | GPIO_VREG(EXT_TS_SW, "ext_ts_sw", "ext_ts_sw_en", |
| 573 | PM8921_GPIO_PM_TO_SYS(23), "ext_3p3v"), |
Jay Chokshi | 1de4f9d | 2012-02-07 16:11:31 -0800 | [diff] [blame] | 574 | GPIO_VREG(EXT_MPP8, "ext_mpp8", "ext_mpp8_en", |
| 575 | PM8921_MPP_PM_TO_SYS(8), NULL), |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 576 | }; |
| 577 | |
Jay Chokshi | 1b7eaa9 | 2012-04-04 14:53:14 -0700 | [diff] [blame] | 578 | struct gpio_regulator_platform_data |
| 579 | mpq8064_gpio_regulator_pdata[] __devinitdata = { |
Jay Chokshi | 1b7eaa9 | 2012-04-04 14:53:14 -0700 | [diff] [blame] | 580 | GPIO_VREG(AVC_1P2V, "avc_1p2v", "avc_1p2v_en", SX150X_GPIO(4, 2), NULL), |
| 581 | GPIO_VREG(AVC_1P8V, "avc_1p8v", "avc_1p8v_en", SX150X_GPIO(4, 4), NULL), |
| 582 | GPIO_VREG(AVC_2P2V, "avc_2p2v", "avc_2p2v_en", |
| 583 | SX150X_GPIO(4, 14), NULL), |
| 584 | GPIO_VREG(AVC_5V, "avc_5v", "avc_5v_en", SX150X_GPIO(4, 3), NULL), |
| 585 | GPIO_VREG(AVC_3P3V, "avc_3p3v", "avc_3p3v_en", |
| 586 | SX150X_GPIO(4, 15), "avc_5v"), |
| 587 | }; |
| 588 | |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 589 | /* SAW regulator constraints */ |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 590 | struct regulator_init_data msm8064_saw_regulator_pdata_8921_s5 = |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 591 | /* ID vreg_name min_uV max_uV */ |
Tianyi Gou | dff5106 | 2012-06-04 20:22:23 -0700 | [diff] [blame] | 592 | SAW_VREG_INIT(S5, "8921_s5", 850000, 1300000); |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 593 | struct regulator_init_data msm8064_saw_regulator_pdata_8921_s6 = |
Tianyi Gou | dff5106 | 2012-06-04 20:22:23 -0700 | [diff] [blame] | 594 | SAW_VREG_INIT(S6, "8921_s6", 850000, 1300000); |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 595 | |
| 596 | struct regulator_init_data msm8064_saw_regulator_pdata_8821_s0 = |
| 597 | /* ID vreg_name min_uV max_uV */ |
Tianyi Gou | dff5106 | 2012-06-04 20:22:23 -0700 | [diff] [blame] | 598 | SAW_VREG_INIT(8821_S0, "8821_s0", 850000, 1300000); |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 599 | struct regulator_init_data msm8064_saw_regulator_pdata_8821_s1 = |
Tianyi Gou | dff5106 | 2012-06-04 20:22:23 -0700 | [diff] [blame] | 600 | SAW_VREG_INIT(8821_S1, "8821_s1", 850000, 1300000); |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 601 | |
| 602 | /* PM8921 regulator constraints */ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 603 | struct pm8xxx_regulator_platform_data |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 604 | msm8064_pm8921_regulator_pdata[] __devinitdata = { |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 605 | /* |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 606 | * ID name always_on pd min_uV max_uV en_t supply |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 607 | * system_uA reg_ID |
| 608 | */ |
Matt Wagantall | ed36d82 | 2012-05-25 18:13:40 -0700 | [diff] [blame] | 609 | PM8XXX_NLDO1200(L26, "8921_l26", 0, 1, 375000, 1050000, 200, "8921_s7", |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 610 | 0, 1), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 611 | |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 612 | /* ID name always_on pd en_t supply reg_ID */ |
| 613 | PM8XXX_VS300(USB_OTG, "8921_usb_otg", 0, 0, 0, "ext_5v", 2), |
| 614 | PM8XXX_VS300(HDMI_MVS, "8921_hdmi_mvs", 0, 1, 0, "ext_5v", 3), |
| 615 | }; |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 616 | |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 617 | /* PM8917 regulator constraints */ |
| 618 | struct pm8xxx_regulator_platform_data |
| 619 | msm8064_pm8917_regulator_pdata[] __devinitdata = { |
| 620 | /* |
| 621 | * ID name always_on pd min_uV max_uV en_t supply |
| 622 | * system_uA reg_ID |
| 623 | */ |
| 624 | PM8XXX_NLDO1200(L26, "8921_l26", 0, 1, 375000, 1050000, 200, "8921_s7", |
| 625 | 0, 1), |
| 626 | PM8XXX_LDO(L30, "8917_l30", 0, 1, 1800000, 1800000, 200, NULL, |
| 627 | 0, 2), |
| 628 | PM8XXX_LDO(L31, "8917_l31", 0, 1, 1800000, 1800000, 200, NULL, |
| 629 | 0, 3), |
| 630 | PM8XXX_LDO(L32, "8917_l32", 0, 1, 2800000, 2800000, 200, NULL, |
| 631 | 0, 4), |
| 632 | PM8XXX_LDO(L33, "8917_l33", 0, 1, 2800000, 2800000, 200, NULL, |
| 633 | 0, 5), |
| 634 | PM8XXX_LDO(L34, "8917_l34", 0, 1, 1800000, 1800000, 200, NULL, |
| 635 | 0, 6), |
| 636 | PM8XXX_LDO(L35, "8917_l35", 0, 1, 3000000, 3000000, 200, NULL, |
| 637 | 0, 7), |
| 638 | PM8XXX_LDO(L36, "8917_l36", 0, 1, 1800000, 1800000, 200, NULL, |
| 639 | 0, 8), |
| 640 | |
| 641 | /* |
| 642 | * ID name always_on min_uV max_uV en_t supply reg_ID |
| 643 | */ |
| 644 | PM8XXX_BOOST(BOOST, "8917_boost", 0, 5000000, 5000000, 500, NULL, 9), |
| 645 | |
| 646 | /* ID name always_on pd en_t supply reg_ID */ |
| 647 | PM8XXX_VS300(USB_OTG, "8921_usb_otg", 0, 1, 0, "8917_boost", 10), |
| 648 | }; |
| 649 | |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 650 | static struct rpm_regulator_init_data |
| 651 | apq8064_rpm_regulator_init_data[] __devinitdata = { |
David Collins | 3d2b945 | 2012-03-19 11:00:30 -0700 | [diff] [blame] | 652 | /* ID a_on pd ss min_uV max_uV supply sys_uA freq fm ss_fm */ |
| 653 | RPM_SMPS(S1, 1, 1, 0, 1225000, 1225000, NULL, 100000, 3p20, NONE, NONE), |
| 654 | RPM_SMPS(S2, 0, 1, 0, 1300000, 1300000, NULL, 0, 1p60, NONE, NONE), |
| 655 | RPM_SMPS(S3, 0, 1, 1, 500000, 1150000, NULL, 100000, 4p80, NONE, NONE), |
David Collins | 423c05d | 2012-04-26 17:31:02 -0700 | [diff] [blame] | 656 | RPM_SMPS(S4, 1, 1, 0, 1800000, 1800000, NULL, 100000, 1p60, AUTO, AUTO), |
David Collins | fd487fd | 2012-06-18 13:07:31 -0700 | [diff] [blame] | 657 | RPM_SMPS(S7, 0, 0, 0, 1300000, 1300000, NULL, 100000, 3p20, NONE, NONE), |
David Collins | 1bf88da | 2012-05-03 14:58:34 -0700 | [diff] [blame] | 658 | RPM_SMPS(S8, 0, 1, 0, 2200000, 2200000, NULL, 0, 1p60, NONE, NONE), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 659 | |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 660 | /* ID a_on pd ss min_uV max_uV supply sys_uA init_ip */ |
David Collins | 423c05d | 2012-04-26 17:31:02 -0700 | [diff] [blame] | 661 | RPM_LDO(L1, 1, 1, 0, 1100000, 1100000, "8921_s4", 0, 1000), |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 662 | RPM_LDO(L2, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0), |
| 663 | RPM_LDO(L3, 0, 1, 0, 3075000, 3075000, NULL, 0, 0), |
David Collins | 423c05d | 2012-04-26 17:31:02 -0700 | [diff] [blame] | 664 | RPM_LDO(L4, 1, 1, 0, 1800000, 1800000, NULL, 0, 10000), |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 665 | RPM_LDO(L5, 0, 1, 0, 2950000, 2950000, NULL, 0, 0), |
| 666 | RPM_LDO(L6, 0, 1, 0, 2950000, 2950000, NULL, 0, 0), |
| 667 | RPM_LDO(L7, 0, 1, 0, 1850000, 2950000, NULL, 0, 0), |
| 668 | RPM_LDO(L8, 0, 1, 0, 2800000, 2800000, NULL, 0, 0), |
Anirudh Ghayal | 62cec44 | 2012-02-17 13:02:39 -0800 | [diff] [blame] | 669 | RPM_LDO(L9, 0, 1, 0, 3000000, 3000000, NULL, 0, 0), |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 670 | RPM_LDO(L10, 0, 1, 0, 2900000, 2900000, NULL, 0, 0), |
| 671 | RPM_LDO(L11, 0, 1, 0, 3000000, 3000000, NULL, 0, 0), |
| 672 | RPM_LDO(L12, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0), |
David Collins | d459ace | 2012-08-31 12:13:28 -0700 | [diff] [blame] | 673 | RPM_LDO(L13, 0, 0, 0, 2220000, 2220000, NULL, 0, 0), |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 674 | RPM_LDO(L14, 0, 1, 0, 1800000, 1800000, NULL, 0, 0), |
| 675 | RPM_LDO(L15, 0, 1, 0, 1800000, 2950000, NULL, 0, 0), |
| 676 | RPM_LDO(L16, 0, 1, 0, 2800000, 2800000, NULL, 0, 0), |
| 677 | RPM_LDO(L17, 0, 1, 0, 2000000, 2000000, NULL, 0, 0), |
| 678 | RPM_LDO(L18, 0, 1, 0, 1300000, 1800000, "8921_s4", 0, 0), |
David Collins | 1bf88da | 2012-05-03 14:58:34 -0700 | [diff] [blame] | 679 | RPM_LDO(L21, 0, 1, 0, 1050000, 1050000, NULL, 0, 0), |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 680 | RPM_LDO(L22, 0, 1, 0, 2600000, 2600000, NULL, 0, 0), |
| 681 | RPM_LDO(L23, 0, 1, 0, 1800000, 1800000, NULL, 0, 0), |
| 682 | RPM_LDO(L24, 0, 1, 1, 750000, 1150000, "8921_s1", 10000, 10000), |
David Collins | 62debe8 | 2012-06-06 17:01:03 -0700 | [diff] [blame] | 683 | RPM_LDO(L25, 1, 1, 0, 1250000, 1250000, "8921_s1", 10000, 10000), |
David Collins | fd487fd | 2012-06-18 13:07:31 -0700 | [diff] [blame] | 684 | RPM_LDO(L27, 0, 0, 0, 1100000, 1100000, "8921_s7", 0, 0), |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 685 | RPM_LDO(L28, 0, 1, 0, 1050000, 1050000, "8921_s7", 0, 0), |
David Collins | 1bf88da | 2012-05-03 14:58:34 -0700 | [diff] [blame] | 686 | RPM_LDO(L29, 0, 1, 0, 2000000, 2000000, NULL, 0, 0), |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 687 | |
| 688 | /* ID a_on pd ss supply */ |
| 689 | RPM_VS(LVS1, 0, 1, 0, "8921_s4"), |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 690 | RPM_VS(LVS3, 0, 1, 0, "8921_s4"), |
| 691 | RPM_VS(LVS4, 0, 1, 0, "8921_s4"), |
| 692 | RPM_VS(LVS5, 0, 1, 0, "8921_s4"), |
| 693 | RPM_VS(LVS6, 0, 1, 0, "8921_s4"), |
Jay Chokshi | 9dace16 | 2012-03-13 19:07:57 -0700 | [diff] [blame] | 694 | RPM_VS(LVS7, 0, 1, 1, "8921_s4"), |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 695 | }; |
| 696 | |
| 697 | static struct rpm_regulator_init_data |
| 698 | apq8064_rpm_regulator_pm8921_init_data[] __devinitdata = { |
| 699 | /* ID a_on pd ss supply */ |
| 700 | RPM_VS(LVS2, 0, 1, 0, "8921_s1"), |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 701 | |
| 702 | /* ID a_on ss min_uV max_uV supply freq */ |
| 703 | RPM_NCP(NCP, 0, 0, 1800000, 1800000, "8921_l6", 1p60), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 704 | }; |
| 705 | |
| 706 | int msm8064_pm8921_regulator_pdata_len __devinitdata = |
| 707 | ARRAY_SIZE(msm8064_pm8921_regulator_pdata); |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 708 | int msm8064_pm8917_regulator_pdata_len __devinitdata = |
| 709 | ARRAY_SIZE(msm8064_pm8917_regulator_pdata); |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 710 | |
Matt Wagantall | f5cc389 | 2012-06-07 19:47:02 -0700 | [diff] [blame] | 711 | #define RPM_REG_MAP(_id, _sleep_also, _voter, _supply, _dev_name) \ |
| 712 | { \ |
| 713 | .vreg_id = RPM_VREG_ID_PM8921_##_id, \ |
| 714 | .sleep_also = _sleep_also, \ |
| 715 | .voter = _voter, \ |
| 716 | .supply = _supply, \ |
| 717 | .dev_name = _dev_name, \ |
| 718 | } |
| 719 | static struct rpm_regulator_consumer_mapping |
| 720 | msm_rpm_regulator_consumer_mapping[] __devinitdata = { |
| 721 | RPM_REG_MAP(LVS7, 0, 1, "krait0_hfpll", "acpuclk-8064"), |
| 722 | RPM_REG_MAP(LVS7, 0, 2, "krait1_hfpll", "acpuclk-8064"), |
| 723 | RPM_REG_MAP(LVS7, 0, 4, "krait2_hfpll", "acpuclk-8064"), |
| 724 | RPM_REG_MAP(LVS7, 0, 5, "krait3_hfpll", "acpuclk-8064"), |
| 725 | RPM_REG_MAP(LVS7, 0, 6, "l2_hfpll", "acpuclk-8064"), |
| 726 | RPM_REG_MAP(L24, 0, 1, "krait0_mem", "acpuclk-8064"), |
| 727 | RPM_REG_MAP(L24, 0, 2, "krait1_mem", "acpuclk-8064"), |
| 728 | RPM_REG_MAP(L24, 0, 4, "krait2_mem", "acpuclk-8064"), |
| 729 | RPM_REG_MAP(L24, 0, 5, "krait3_mem", "acpuclk-8064"), |
| 730 | RPM_REG_MAP(S3, 0, 1, "krait0_dig", "acpuclk-8064"), |
| 731 | RPM_REG_MAP(S3, 0, 2, "krait1_dig", "acpuclk-8064"), |
| 732 | RPM_REG_MAP(S3, 0, 4, "krait2_dig", "acpuclk-8064"), |
| 733 | RPM_REG_MAP(S3, 0, 5, "krait3_dig", "acpuclk-8064"), |
| 734 | }; |
| 735 | |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 736 | struct rpm_regulator_platform_data apq8064_rpm_regulator_pdata __devinitdata = { |
David Collins | bbc92bc | 2012-07-31 16:39:11 -0700 | [diff] [blame] | 737 | .init_data = apq8064_rpm_regulator_init_data, |
| 738 | .num_regulators = ARRAY_SIZE(apq8064_rpm_regulator_init_data), |
| 739 | .version = RPM_VREG_VERSION_8960, |
| 740 | .vreg_id_vdd_mem = RPM_VREG_ID_PM8921_L24, |
| 741 | .vreg_id_vdd_dig = RPM_VREG_ID_PM8921_S3, |
| 742 | .requires_tcxo_workaround = true, |
| 743 | .consumer_map = msm_rpm_regulator_consumer_mapping, |
Matt Wagantall | f5cc389 | 2012-06-07 19:47:02 -0700 | [diff] [blame] | 744 | .consumer_map_len = ARRAY_SIZE(msm_rpm_regulator_consumer_mapping), |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 745 | }; |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 746 | |
| 747 | /* Regulators that are only present when using PM8921 */ |
| 748 | struct rpm_regulator_platform_data |
| 749 | apq8064_rpm_regulator_pm8921_pdata __devinitdata = { |
| 750 | .init_data = apq8064_rpm_regulator_pm8921_init_data, |
| 751 | .num_regulators = ARRAY_SIZE(apq8064_rpm_regulator_pm8921_init_data), |
| 752 | .version = RPM_VREG_VERSION_8960, |
| 753 | .vreg_id_vdd_mem = RPM_VREG_ID_PM8921_L24, |
| 754 | .vreg_id_vdd_dig = RPM_VREG_ID_PM8921_S3, |
| 755 | .requires_tcxo_workaround = true, |
| 756 | }; |
| 757 | |
| 758 | /* |
| 759 | * Fix up regulator consumer data that moves to a different regulator when |
| 760 | * PM8917 is used. |
| 761 | */ |
| 762 | void __init configure_apq8064_pm8917_power_grid(void) |
| 763 | { |
| 764 | static struct rpm_regulator_init_data *rpm_data; |
| 765 | int i; |
| 766 | |
| 767 | for (i = 0; i < ARRAY_SIZE(apq8064_rpm_regulator_init_data); i++) { |
| 768 | rpm_data = &apq8064_rpm_regulator_init_data[i]; |
| 769 | if (rpm_data->id == RPM_VREG_ID_PM8921_S1) { |
| 770 | rpm_data->init_data.consumer_supplies |
| 771 | = vreg_consumers_8917_S1; |
| 772 | rpm_data->init_data.num_consumer_supplies |
| 773 | = ARRAY_SIZE(vreg_consumers_8917_S1); |
| 774 | } |
| 775 | } |
David Collins | e93ed7d | 2012-10-02 15:05:28 -0700 | [diff] [blame] | 776 | |
| 777 | /* |
| 778 | * Switch to 8960_PM8917 rpm-regulator version so that TCXO workaround |
| 779 | * is applied to PM8917 regulators L25, L26, L27, and L28. |
| 780 | */ |
| 781 | apq8064_rpm_regulator_pdata.version = RPM_VREG_VERSION_8960_PM8917; |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 782 | } |