Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: ux500: move ab8500_regulator_plat_data into driver

There is only one instance of ab8500_regulator_platform_data, and it's
safe to assume we won't ever merge another one, so it's rather pointless
to pass it through multiple levels of platform data pointers.

This moves the structure and everything referenced by it into the
driver that uses it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Arnd Bergmann and committed by
Linus Walleij
79886be0 37dc78d9

+452 -499
+1 -2
arch/arm/mach-ux500/Makefile
··· 5 5 obj-y := cpu.o id.o pm.o 6 6 obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o 7 7 obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o 8 - obj-$(CONFIG_MACH_MOP500) += board-mop500-regulators.o \ 9 - board-mop500-audio.o 8 + obj-$(CONFIG_MACH_MOP500) += board-mop500-audio.o 10 9 obj-$(CONFIG_SMP) += platsmp.o 11 10 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 12 11 obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
-465
arch/arm/mach-ux500/board-mop500-regulators.c
··· 1 - /* 2 - * Copyright (C) ST-Ericsson SA 2010 3 - * 4 - * License Terms: GNU General Public License v2 5 - * 6 - * Authors: Sundar Iyer <sundar.iyer@stericsson.com> 7 - * Bengt Jonsson <bengt.g.jonsson@stericsson.com> 8 - * Daniel Willerud <daniel.willerud@stericsson.com> 9 - * 10 - * MOP500 board specific initialization for regulators 11 - */ 12 - #include <linux/kernel.h> 13 - #include <linux/regulator/machine.h> 14 - #include <linux/regulator/ab8500.h> 15 - #include "board-mop500-regulators.h" 16 - 17 - static struct regulator_consumer_supply ab8500_vaux1_consumers[] = { 18 - /* Main display, u8500 R3 uib */ 19 - REGULATOR_SUPPLY("vddi", "mcde_disp_sony_acx424akp.0"), 20 - /* Main display, u8500 uib and ST uib */ 21 - REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.0"), 22 - /* Secondary display, ST uib */ 23 - REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.1"), 24 - /* SFH7741 proximity sensor */ 25 - REGULATOR_SUPPLY("vcc", "gpio-keys.0"), 26 - /* BH1780GLS ambient light sensor */ 27 - REGULATOR_SUPPLY("vcc", "2-0029"), 28 - /* lsm303dlh accelerometer */ 29 - REGULATOR_SUPPLY("vdd", "2-0018"), 30 - /* lsm303dlhc accelerometer */ 31 - REGULATOR_SUPPLY("vdd", "2-0019"), 32 - /* lsm303dlh magnetometer */ 33 - REGULATOR_SUPPLY("vdd", "2-001e"), 34 - /* Rohm BU21013 Touchscreen devices */ 35 - REGULATOR_SUPPLY("avdd", "3-005c"), 36 - REGULATOR_SUPPLY("avdd", "3-005d"), 37 - /* Synaptics RMI4 Touchscreen device */ 38 - REGULATOR_SUPPLY("vdd", "3-004b"), 39 - /* L3G4200D Gyroscope device */ 40 - REGULATOR_SUPPLY("vdd", "2-0068"), 41 - /* Ambient light sensor device */ 42 - REGULATOR_SUPPLY("vdd", "3-0029"), 43 - /* Pressure sensor device */ 44 - REGULATOR_SUPPLY("vdd", "2-005c"), 45 - /* Cypress TrueTouch Touchscreen device */ 46 - REGULATOR_SUPPLY("vcpin", "spi8.0"), 47 - /* Camera device */ 48 - REGULATOR_SUPPLY("vaux12v5", "mmio_camera"), 49 - }; 50 - 51 - static struct regulator_consumer_supply ab8500_vaux2_consumers[] = { 52 - /* On-board eMMC power */ 53 - REGULATOR_SUPPLY("vmmc", "sdi4"), 54 - /* AB8500 audio codec */ 55 - REGULATOR_SUPPLY("vcc-N2158", "ab8500-codec.0"), 56 - /* AB8500 accessory detect 1 */ 57 - REGULATOR_SUPPLY("vcc-N2158", "ab8500-acc-det.0"), 58 - /* AB8500 Tv-out device */ 59 - REGULATOR_SUPPLY("vcc-N2158", "mcde_tv_ab8500.4"), 60 - /* AV8100 HDMI device */ 61 - REGULATOR_SUPPLY("vcc-N2158", "av8100_hdmi.3"), 62 - }; 63 - 64 - static struct regulator_consumer_supply ab8500_vaux3_consumers[] = { 65 - REGULATOR_SUPPLY("v-SD-STM", "stm"), 66 - /* External MMC slot power */ 67 - REGULATOR_SUPPLY("vmmc", "sdi0"), 68 - }; 69 - 70 - static struct regulator_consumer_supply ab8500_vtvout_consumers[] = { 71 - /* TV-out DENC supply */ 72 - REGULATOR_SUPPLY("vtvout", "ab8500-denc.0"), 73 - /* Internal general-purpose ADC */ 74 - REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"), 75 - /* ADC for charger */ 76 - REGULATOR_SUPPLY("vddadc", "ab8500-charger.0"), 77 - /* AB8500 Tv-out device */ 78 - REGULATOR_SUPPLY("vtvout", "mcde_tv_ab8500.4"), 79 - }; 80 - 81 - static struct regulator_consumer_supply ab8500_vaud_consumers[] = { 82 - /* AB8500 audio-codec main supply */ 83 - REGULATOR_SUPPLY("vaud", "ab8500-codec.0"), 84 - }; 85 - 86 - static struct regulator_consumer_supply ab8500_vamic1_consumers[] = { 87 - /* AB8500 audio-codec Mic1 supply */ 88 - REGULATOR_SUPPLY("vamic1", "ab8500-codec.0"), 89 - }; 90 - 91 - static struct regulator_consumer_supply ab8500_vamic2_consumers[] = { 92 - /* AB8500 audio-codec Mic2 supply */ 93 - REGULATOR_SUPPLY("vamic2", "ab8500-codec.0"), 94 - }; 95 - 96 - static struct regulator_consumer_supply ab8500_vdmic_consumers[] = { 97 - /* AB8500 audio-codec DMic supply */ 98 - REGULATOR_SUPPLY("vdmic", "ab8500-codec.0"), 99 - }; 100 - 101 - static struct regulator_consumer_supply ab8500_vintcore_consumers[] = { 102 - /* SoC core supply, no device */ 103 - REGULATOR_SUPPLY("v-intcore", NULL), 104 - /* USB Transceiver */ 105 - REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"), 106 - /* Handled by abx500 clk driver */ 107 - REGULATOR_SUPPLY("v-intcore", "abx500-clk.0"), 108 - }; 109 - 110 - static struct regulator_consumer_supply ab8500_vana_consumers[] = { 111 - /* DB8500 DSI */ 112 - REGULATOR_SUPPLY("vdddsi1v2", "mcde"), 113 - REGULATOR_SUPPLY("vdddsi1v2", "b2r2_core"), 114 - REGULATOR_SUPPLY("vdddsi1v2", "b2r2_1_core"), 115 - REGULATOR_SUPPLY("vdddsi1v2", "dsilink.0"), 116 - REGULATOR_SUPPLY("vdddsi1v2", "dsilink.1"), 117 - REGULATOR_SUPPLY("vdddsi1v2", "dsilink.2"), 118 - /* DB8500 CSI */ 119 - REGULATOR_SUPPLY("vddcsi1v2", "mmio_camera"), 120 - }; 121 - 122 - /* ab8500 regulator register initialization */ 123 - static struct ab8500_regulator_reg_init ab8500_reg_init[] = { 124 - /* 125 - * VanaRequestCtrl = HP/LP depending on VxRequest 126 - * VextSupply1RequestCtrl = HP/LP depending on VxRequest 127 - */ 128 - INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL2, 0xf0, 0x00), 129 - /* 130 - * VextSupply2RequestCtrl = HP/LP depending on VxRequest 131 - * VextSupply3RequestCtrl = HP/LP depending on VxRequest 132 - * Vaux1RequestCtrl = HP/LP depending on VxRequest 133 - * Vaux2RequestCtrl = HP/LP depending on VxRequest 134 - */ 135 - INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL3, 0xff, 0x00), 136 - /* 137 - * Vaux3RequestCtrl = HP/LP depending on VxRequest 138 - * SwHPReq = Control through SWValid disabled 139 - */ 140 - INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL4, 0x07, 0x00), 141 - /* 142 - * VanaSysClkReq1HPValid = disabled 143 - * Vaux1SysClkReq1HPValid = disabled 144 - * Vaux2SysClkReq1HPValid = disabled 145 - * Vaux3SysClkReq1HPValid = disabled 146 - */ 147 - INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID1, 0xe8, 0x00), 148 - /* 149 - * VextSupply1SysClkReq1HPValid = disabled 150 - * VextSupply2SysClkReq1HPValid = disabled 151 - * VextSupply3SysClkReq1HPValid = SysClkReq1 controlled 152 - */ 153 - INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID2, 0x70, 0x40), 154 - /* 155 - * VanaHwHPReq1Valid = disabled 156 - * Vaux1HwHPreq1Valid = disabled 157 - * Vaux2HwHPReq1Valid = disabled 158 - * Vaux3HwHPReqValid = disabled 159 - */ 160 - INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID1, 0xe8, 0x00), 161 - /* 162 - * VextSupply1HwHPReq1Valid = disabled 163 - * VextSupply2HwHPReq1Valid = disabled 164 - * VextSupply3HwHPReq1Valid = disabled 165 - */ 166 - INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID2, 0x07, 0x00), 167 - /* 168 - * VanaHwHPReq2Valid = disabled 169 - * Vaux1HwHPReq2Valid = disabled 170 - * Vaux2HwHPReq2Valid = disabled 171 - * Vaux3HwHPReq2Valid = disabled 172 - */ 173 - INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID1, 0xe8, 0x00), 174 - /* 175 - * VextSupply1HwHPReq2Valid = disabled 176 - * VextSupply2HwHPReq2Valid = disabled 177 - * VextSupply3HwHPReq2Valid = HWReq2 controlled 178 - */ 179 - INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID2, 0x07, 0x04), 180 - /* 181 - * VanaSwHPReqValid = disabled 182 - * Vaux1SwHPReqValid = disabled 183 - */ 184 - INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID1, 0xa0, 0x00), 185 - /* 186 - * Vaux2SwHPReqValid = disabled 187 - * Vaux3SwHPReqValid = disabled 188 - * VextSupply1SwHPReqValid = disabled 189 - * VextSupply2SwHPReqValid = disabled 190 - * VextSupply3SwHPReqValid = disabled 191 - */ 192 - INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID2, 0x1f, 0x00), 193 - /* 194 - * SysClkReq2Valid1 = SysClkReq2 controlled 195 - * SysClkReq3Valid1 = disabled 196 - * SysClkReq4Valid1 = SysClkReq4 controlled 197 - * SysClkReq5Valid1 = disabled 198 - * SysClkReq6Valid1 = SysClkReq6 controlled 199 - * SysClkReq7Valid1 = disabled 200 - * SysClkReq8Valid1 = disabled 201 - */ 202 - INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID1, 0xfe, 0x2a), 203 - /* 204 - * SysClkReq2Valid2 = disabled 205 - * SysClkReq3Valid2 = disabled 206 - * SysClkReq4Valid2 = disabled 207 - * SysClkReq5Valid2 = disabled 208 - * SysClkReq6Valid2 = SysClkReq6 controlled 209 - * SysClkReq7Valid2 = disabled 210 - * SysClkReq8Valid2 = disabled 211 - */ 212 - INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID2, 0xfe, 0x20), 213 - /* 214 - * VTVoutEna = disabled 215 - * Vintcore12Ena = disabled 216 - * Vintcore12Sel = 1.25 V 217 - * Vintcore12LP = inactive (HP) 218 - * VTVoutLP = inactive (HP) 219 - */ 220 - INIT_REGULATOR_REGISTER(AB8500_REGUMISC1, 0xfe, 0x10), 221 - /* 222 - * VaudioEna = disabled 223 - * VdmicEna = disabled 224 - * Vamic1Ena = disabled 225 - * Vamic2Ena = disabled 226 - */ 227 - INIT_REGULATOR_REGISTER(AB8500_VAUDIOSUPPLY, 0x1e, 0x00), 228 - /* 229 - * Vamic1_dzout = high-Z when Vamic1 is disabled 230 - * Vamic2_dzout = high-Z when Vamic2 is disabled 231 - */ 232 - INIT_REGULATOR_REGISTER(AB8500_REGUCTRL1VAMIC, 0x03, 0x00), 233 - /* 234 - * VPll = Hw controlled (NOTE! PRCMU bits) 235 - * VanaRegu = force off 236 - */ 237 - INIT_REGULATOR_REGISTER(AB8500_VPLLVANAREGU, 0x0f, 0x02), 238 - /* 239 - * VrefDDREna = disabled 240 - * VrefDDRSleepMode = inactive (no pulldown) 241 - */ 242 - INIT_REGULATOR_REGISTER(AB8500_VREFDDR, 0x03, 0x00), 243 - /* 244 - * VextSupply1Regu = force LP 245 - * VextSupply2Regu = force OFF 246 - * VextSupply3Regu = force HP (-> STBB2=LP and TPS=LP) 247 - * ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0 248 - * ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0 249 - */ 250 - INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0xff, 0x13), 251 - /* 252 - * Vaux1Regu = force HP 253 - * Vaux2Regu = force off 254 - */ 255 - INIT_REGULATOR_REGISTER(AB8500_VAUX12REGU, 0x0f, 0x01), 256 - /* 257 - * Vaux3Regu = force off 258 - */ 259 - INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3REGU, 0x03, 0x00), 260 - /* 261 - * Vaux1Sel = 2.8 V 262 - */ 263 - INIT_REGULATOR_REGISTER(AB8500_VAUX1SEL, 0x0f, 0x0C), 264 - /* 265 - * Vaux2Sel = 2.9 V 266 - */ 267 - INIT_REGULATOR_REGISTER(AB8500_VAUX2SEL, 0x0f, 0x0d), 268 - /* 269 - * Vaux3Sel = 2.91 V 270 - */ 271 - INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3SEL, 0x07, 0x07), 272 - /* 273 - * VextSupply12LP = disabled (no LP) 274 - */ 275 - INIT_REGULATOR_REGISTER(AB8500_REGUCTRL2SPARE, 0x01, 0x00), 276 - /* 277 - * Vaux1Disch = short discharge time 278 - * Vaux2Disch = short discharge time 279 - * Vaux3Disch = short discharge time 280 - * Vintcore12Disch = short discharge time 281 - * VTVoutDisch = short discharge time 282 - * VaudioDisch = short discharge time 283 - */ 284 - INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH, 0xfc, 0x00), 285 - /* 286 - * VanaDisch = short discharge time 287 - * VdmicPullDownEna = pulldown disabled when Vdmic is disabled 288 - * VdmicDisch = short discharge time 289 - */ 290 - INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH2, 0x16, 0x00), 291 - }; 292 - 293 - /* AB8500 regulators */ 294 - static struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = { 295 - /* supplies to the display/camera */ 296 - [AB8500_LDO_AUX1] = { 297 - .supply_regulator = "ab8500-ext-supply3", 298 - .constraints = { 299 - .name = "V-DISPLAY", 300 - .min_uV = 2800000, 301 - .max_uV = 3300000, 302 - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 303 - REGULATOR_CHANGE_STATUS, 304 - .boot_on = 1, /* display is on at boot */ 305 - }, 306 - .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux1_consumers), 307 - .consumer_supplies = ab8500_vaux1_consumers, 308 - }, 309 - /* supplies to the on-board eMMC */ 310 - [AB8500_LDO_AUX2] = { 311 - .supply_regulator = "ab8500-ext-supply3", 312 - .constraints = { 313 - .name = "V-eMMC1", 314 - .min_uV = 1100000, 315 - .max_uV = 3300000, 316 - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 317 - REGULATOR_CHANGE_STATUS | 318 - REGULATOR_CHANGE_MODE, 319 - .valid_modes_mask = REGULATOR_MODE_NORMAL | 320 - REGULATOR_MODE_IDLE, 321 - }, 322 - .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux2_consumers), 323 - .consumer_supplies = ab8500_vaux2_consumers, 324 - }, 325 - /* supply for VAUX3, supplies to SDcard slots */ 326 - [AB8500_LDO_AUX3] = { 327 - .supply_regulator = "ab8500-ext-supply3", 328 - .constraints = { 329 - .name = "V-MMC-SD", 330 - .min_uV = 1100000, 331 - .max_uV = 3300000, 332 - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 333 - REGULATOR_CHANGE_STATUS | 334 - REGULATOR_CHANGE_MODE, 335 - .valid_modes_mask = REGULATOR_MODE_NORMAL | 336 - REGULATOR_MODE_IDLE, 337 - }, 338 - .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux3_consumers), 339 - .consumer_supplies = ab8500_vaux3_consumers, 340 - }, 341 - /* supply for tvout, gpadc, TVOUT LDO */ 342 - [AB8500_LDO_TVOUT] = { 343 - .constraints = { 344 - .name = "V-TVOUT", 345 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 346 - }, 347 - .num_consumer_supplies = ARRAY_SIZE(ab8500_vtvout_consumers), 348 - .consumer_supplies = ab8500_vtvout_consumers, 349 - }, 350 - /* supply for ab8500-vaudio, VAUDIO LDO */ 351 - [AB8500_LDO_AUDIO] = { 352 - .constraints = { 353 - .name = "V-AUD", 354 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 355 - }, 356 - .num_consumer_supplies = ARRAY_SIZE(ab8500_vaud_consumers), 357 - .consumer_supplies = ab8500_vaud_consumers, 358 - }, 359 - /* supply for v-anamic1 VAMic1-LDO */ 360 - [AB8500_LDO_ANAMIC1] = { 361 - .constraints = { 362 - .name = "V-AMIC1", 363 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 364 - }, 365 - .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic1_consumers), 366 - .consumer_supplies = ab8500_vamic1_consumers, 367 - }, 368 - /* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */ 369 - [AB8500_LDO_ANAMIC2] = { 370 - .constraints = { 371 - .name = "V-AMIC2", 372 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 373 - }, 374 - .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic2_consumers), 375 - .consumer_supplies = ab8500_vamic2_consumers, 376 - }, 377 - /* supply for v-dmic, VDMIC LDO */ 378 - [AB8500_LDO_DMIC] = { 379 - .constraints = { 380 - .name = "V-DMIC", 381 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 382 - }, 383 - .num_consumer_supplies = ARRAY_SIZE(ab8500_vdmic_consumers), 384 - .consumer_supplies = ab8500_vdmic_consumers, 385 - }, 386 - /* supply for v-intcore12, VINTCORE12 LDO */ 387 - [AB8500_LDO_INTCORE] = { 388 - .constraints = { 389 - .name = "V-INTCORE", 390 - .min_uV = 1250000, 391 - .max_uV = 1350000, 392 - .input_uV = 1800000, 393 - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 394 - REGULATOR_CHANGE_STATUS | 395 - REGULATOR_CHANGE_MODE | 396 - REGULATOR_CHANGE_DRMS, 397 - .valid_modes_mask = REGULATOR_MODE_NORMAL | 398 - REGULATOR_MODE_IDLE, 399 - }, 400 - .num_consumer_supplies = ARRAY_SIZE(ab8500_vintcore_consumers), 401 - .consumer_supplies = ab8500_vintcore_consumers, 402 - }, 403 - /* supply for U8500 CSI-DSI, VANA LDO */ 404 - [AB8500_LDO_ANA] = { 405 - .constraints = { 406 - .name = "V-CSI-DSI", 407 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 408 - }, 409 - .num_consumer_supplies = ARRAY_SIZE(ab8500_vana_consumers), 410 - .consumer_supplies = ab8500_vana_consumers, 411 - }, 412 - }; 413 - 414 - /* supply for VextSupply3 */ 415 - static struct regulator_consumer_supply ab8500_ext_supply3_consumers[] = { 416 - /* SIM supply for 3 V SIM cards */ 417 - REGULATOR_SUPPLY("vinvsim", "sim-detect.0"), 418 - }; 419 - 420 - /* 421 - * AB8500 external regulators 422 - */ 423 - static struct regulator_init_data ab8500_ext_regulators[] = { 424 - /* fixed Vbat supplies VSMPS1_EXT_1V8 */ 425 - [AB8500_EXT_SUPPLY1] = { 426 - .constraints = { 427 - .name = "ab8500-ext-supply1", 428 - .min_uV = 1800000, 429 - .max_uV = 1800000, 430 - .initial_mode = REGULATOR_MODE_IDLE, 431 - .boot_on = 1, 432 - .always_on = 1, 433 - }, 434 - }, 435 - /* fixed Vbat supplies VSMPS2_EXT_1V36 and VSMPS5_EXT_1V15 */ 436 - [AB8500_EXT_SUPPLY2] = { 437 - .constraints = { 438 - .name = "ab8500-ext-supply2", 439 - .min_uV = 1360000, 440 - .max_uV = 1360000, 441 - }, 442 - }, 443 - /* fixed Vbat supplies VSMPS3_EXT_3V4 and VSMPS4_EXT_3V4 */ 444 - [AB8500_EXT_SUPPLY3] = { 445 - .constraints = { 446 - .name = "ab8500-ext-supply3", 447 - .min_uV = 3400000, 448 - .max_uV = 3400000, 449 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 450 - .boot_on = 1, 451 - }, 452 - .num_consumer_supplies = 453 - ARRAY_SIZE(ab8500_ext_supply3_consumers), 454 - .consumer_supplies = ab8500_ext_supply3_consumers, 455 - }, 456 - }; 457 - 458 - struct ab8500_regulator_platform_data ab8500_regulator_plat_data = { 459 - .reg_init = ab8500_reg_init, 460 - .num_reg_init = ARRAY_SIZE(ab8500_reg_init), 461 - .regulator = ab8500_regulators, 462 - .num_regulator = ARRAY_SIZE(ab8500_regulators), 463 - .ext_regulator = ab8500_ext_regulators, 464 - .num_ext_regulator = ARRAY_SIZE(ab8500_ext_regulators), 465 - };
-16
arch/arm/mach-ux500/board-mop500-regulators.h
··· 1 - /* 2 - * Copyright (C) ST-Ericsson SA 2010 3 - * 4 - * License Terms: GNU General Public License v2 5 - * 6 - * Author: Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson 7 - * 8 - * MOP500 board specific initialization for regulators 9 - */ 10 - 11 - #ifndef __BOARD_MOP500_REGULATORS_H 12 - #define __BOARD_MOP500_REGULATORS_H 13 - 14 - extern struct ab8500_regulator_platform_data ab8500_regulator_plat_data; 15 - 16 - #endif
-2
arch/arm/mach-ux500/cpu-db8500.c
··· 28 28 29 29 #include "setup.h" 30 30 31 - #include "board-mop500-regulators.h" 32 31 #include "board-mop500.h" 33 32 #include "db8500-regs.h" 34 33 #include "id.h" 35 34 36 35 static struct ab8500_platform_data ab8500_platdata = { 37 - .regulator = &ab8500_regulator_plat_data, 38 36 }; 39 37 40 38 static struct prcmu_pdata db8500_prcmu_pdata = {
+451 -14
drivers/regulator/ab8500-ext.c
··· 25 25 #include <linux/mfd/abx500/ab8500.h> 26 26 #include <linux/regulator/ab8500.h> 27 27 28 + static struct regulator_consumer_supply ab8500_vaux1_consumers[] = { 29 + /* Main display, u8500 R3 uib */ 30 + REGULATOR_SUPPLY("vddi", "mcde_disp_sony_acx424akp.0"), 31 + /* Main display, u8500 uib and ST uib */ 32 + REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.0"), 33 + /* Secondary display, ST uib */ 34 + REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.1"), 35 + /* SFH7741 proximity sensor */ 36 + REGULATOR_SUPPLY("vcc", "gpio-keys.0"), 37 + /* BH1780GLS ambient light sensor */ 38 + REGULATOR_SUPPLY("vcc", "2-0029"), 39 + /* lsm303dlh accelerometer */ 40 + REGULATOR_SUPPLY("vdd", "2-0018"), 41 + /* lsm303dlhc accelerometer */ 42 + REGULATOR_SUPPLY("vdd", "2-0019"), 43 + /* lsm303dlh magnetometer */ 44 + REGULATOR_SUPPLY("vdd", "2-001e"), 45 + /* Rohm BU21013 Touchscreen devices */ 46 + REGULATOR_SUPPLY("avdd", "3-005c"), 47 + REGULATOR_SUPPLY("avdd", "3-005d"), 48 + /* Synaptics RMI4 Touchscreen device */ 49 + REGULATOR_SUPPLY("vdd", "3-004b"), 50 + /* L3G4200D Gyroscope device */ 51 + REGULATOR_SUPPLY("vdd", "2-0068"), 52 + /* Ambient light sensor device */ 53 + REGULATOR_SUPPLY("vdd", "3-0029"), 54 + /* Pressure sensor device */ 55 + REGULATOR_SUPPLY("vdd", "2-005c"), 56 + /* Cypress TrueTouch Touchscreen device */ 57 + REGULATOR_SUPPLY("vcpin", "spi8.0"), 58 + /* Camera device */ 59 + REGULATOR_SUPPLY("vaux12v5", "mmio_camera"), 60 + }; 61 + 62 + static struct regulator_consumer_supply ab8500_vaux2_consumers[] = { 63 + /* On-board eMMC power */ 64 + REGULATOR_SUPPLY("vmmc", "sdi4"), 65 + /* AB8500 audio codec */ 66 + REGULATOR_SUPPLY("vcc-N2158", "ab8500-codec.0"), 67 + /* AB8500 accessory detect 1 */ 68 + REGULATOR_SUPPLY("vcc-N2158", "ab8500-acc-det.0"), 69 + /* AB8500 Tv-out device */ 70 + REGULATOR_SUPPLY("vcc-N2158", "mcde_tv_ab8500.4"), 71 + /* AV8100 HDMI device */ 72 + REGULATOR_SUPPLY("vcc-N2158", "av8100_hdmi.3"), 73 + }; 74 + 75 + static struct regulator_consumer_supply ab8500_vaux3_consumers[] = { 76 + REGULATOR_SUPPLY("v-SD-STM", "stm"), 77 + /* External MMC slot power */ 78 + REGULATOR_SUPPLY("vmmc", "sdi0"), 79 + }; 80 + 81 + static struct regulator_consumer_supply ab8500_vtvout_consumers[] = { 82 + /* TV-out DENC supply */ 83 + REGULATOR_SUPPLY("vtvout", "ab8500-denc.0"), 84 + /* Internal general-purpose ADC */ 85 + REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"), 86 + /* ADC for charger */ 87 + REGULATOR_SUPPLY("vddadc", "ab8500-charger.0"), 88 + /* AB8500 Tv-out device */ 89 + REGULATOR_SUPPLY("vtvout", "mcde_tv_ab8500.4"), 90 + }; 91 + 92 + static struct regulator_consumer_supply ab8500_vaud_consumers[] = { 93 + /* AB8500 audio-codec main supply */ 94 + REGULATOR_SUPPLY("vaud", "ab8500-codec.0"), 95 + }; 96 + 97 + static struct regulator_consumer_supply ab8500_vamic1_consumers[] = { 98 + /* AB8500 audio-codec Mic1 supply */ 99 + REGULATOR_SUPPLY("vamic1", "ab8500-codec.0"), 100 + }; 101 + 102 + static struct regulator_consumer_supply ab8500_vamic2_consumers[] = { 103 + /* AB8500 audio-codec Mic2 supply */ 104 + REGULATOR_SUPPLY("vamic2", "ab8500-codec.0"), 105 + }; 106 + 107 + static struct regulator_consumer_supply ab8500_vdmic_consumers[] = { 108 + /* AB8500 audio-codec DMic supply */ 109 + REGULATOR_SUPPLY("vdmic", "ab8500-codec.0"), 110 + }; 111 + 112 + static struct regulator_consumer_supply ab8500_vintcore_consumers[] = { 113 + /* SoC core supply, no device */ 114 + REGULATOR_SUPPLY("v-intcore", NULL), 115 + /* USB Transceiver */ 116 + REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"), 117 + /* Handled by abx500 clk driver */ 118 + REGULATOR_SUPPLY("v-intcore", "abx500-clk.0"), 119 + }; 120 + 121 + static struct regulator_consumer_supply ab8500_vana_consumers[] = { 122 + /* DB8500 DSI */ 123 + REGULATOR_SUPPLY("vdddsi1v2", "mcde"), 124 + REGULATOR_SUPPLY("vdddsi1v2", "b2r2_core"), 125 + REGULATOR_SUPPLY("vdddsi1v2", "b2r2_1_core"), 126 + REGULATOR_SUPPLY("vdddsi1v2", "dsilink.0"), 127 + REGULATOR_SUPPLY("vdddsi1v2", "dsilink.1"), 128 + REGULATOR_SUPPLY("vdddsi1v2", "dsilink.2"), 129 + /* DB8500 CSI */ 130 + REGULATOR_SUPPLY("vddcsi1v2", "mmio_camera"), 131 + }; 132 + 133 + /* ab8500 regulator register initialization */ 134 + static struct ab8500_regulator_reg_init ab8500_reg_init[] = { 135 + /* 136 + * VanaRequestCtrl = HP/LP depending on VxRequest 137 + * VextSupply1RequestCtrl = HP/LP depending on VxRequest 138 + */ 139 + INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL2, 0xf0, 0x00), 140 + /* 141 + * VextSupply2RequestCtrl = HP/LP depending on VxRequest 142 + * VextSupply3RequestCtrl = HP/LP depending on VxRequest 143 + * Vaux1RequestCtrl = HP/LP depending on VxRequest 144 + * Vaux2RequestCtrl = HP/LP depending on VxRequest 145 + */ 146 + INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL3, 0xff, 0x00), 147 + /* 148 + * Vaux3RequestCtrl = HP/LP depending on VxRequest 149 + * SwHPReq = Control through SWValid disabled 150 + */ 151 + INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL4, 0x07, 0x00), 152 + /* 153 + * VanaSysClkReq1HPValid = disabled 154 + * Vaux1SysClkReq1HPValid = disabled 155 + * Vaux2SysClkReq1HPValid = disabled 156 + * Vaux3SysClkReq1HPValid = disabled 157 + */ 158 + INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID1, 0xe8, 0x00), 159 + /* 160 + * VextSupply1SysClkReq1HPValid = disabled 161 + * VextSupply2SysClkReq1HPValid = disabled 162 + * VextSupply3SysClkReq1HPValid = SysClkReq1 controlled 163 + */ 164 + INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID2, 0x70, 0x40), 165 + /* 166 + * VanaHwHPReq1Valid = disabled 167 + * Vaux1HwHPreq1Valid = disabled 168 + * Vaux2HwHPReq1Valid = disabled 169 + * Vaux3HwHPReqValid = disabled 170 + */ 171 + INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID1, 0xe8, 0x00), 172 + /* 173 + * VextSupply1HwHPReq1Valid = disabled 174 + * VextSupply2HwHPReq1Valid = disabled 175 + * VextSupply3HwHPReq1Valid = disabled 176 + */ 177 + INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID2, 0x07, 0x00), 178 + /* 179 + * VanaHwHPReq2Valid = disabled 180 + * Vaux1HwHPReq2Valid = disabled 181 + * Vaux2HwHPReq2Valid = disabled 182 + * Vaux3HwHPReq2Valid = disabled 183 + */ 184 + INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID1, 0xe8, 0x00), 185 + /* 186 + * VextSupply1HwHPReq2Valid = disabled 187 + * VextSupply2HwHPReq2Valid = disabled 188 + * VextSupply3HwHPReq2Valid = HWReq2 controlled 189 + */ 190 + INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID2, 0x07, 0x04), 191 + /* 192 + * VanaSwHPReqValid = disabled 193 + * Vaux1SwHPReqValid = disabled 194 + */ 195 + INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID1, 0xa0, 0x00), 196 + /* 197 + * Vaux2SwHPReqValid = disabled 198 + * Vaux3SwHPReqValid = disabled 199 + * VextSupply1SwHPReqValid = disabled 200 + * VextSupply2SwHPReqValid = disabled 201 + * VextSupply3SwHPReqValid = disabled 202 + */ 203 + INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID2, 0x1f, 0x00), 204 + /* 205 + * SysClkReq2Valid1 = SysClkReq2 controlled 206 + * SysClkReq3Valid1 = disabled 207 + * SysClkReq4Valid1 = SysClkReq4 controlled 208 + * SysClkReq5Valid1 = disabled 209 + * SysClkReq6Valid1 = SysClkReq6 controlled 210 + * SysClkReq7Valid1 = disabled 211 + * SysClkReq8Valid1 = disabled 212 + */ 213 + INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID1, 0xfe, 0x2a), 214 + /* 215 + * SysClkReq2Valid2 = disabled 216 + * SysClkReq3Valid2 = disabled 217 + * SysClkReq4Valid2 = disabled 218 + * SysClkReq5Valid2 = disabled 219 + * SysClkReq6Valid2 = SysClkReq6 controlled 220 + * SysClkReq7Valid2 = disabled 221 + * SysClkReq8Valid2 = disabled 222 + */ 223 + INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID2, 0xfe, 0x20), 224 + /* 225 + * VTVoutEna = disabled 226 + * Vintcore12Ena = disabled 227 + * Vintcore12Sel = 1.25 V 228 + * Vintcore12LP = inactive (HP) 229 + * VTVoutLP = inactive (HP) 230 + */ 231 + INIT_REGULATOR_REGISTER(AB8500_REGUMISC1, 0xfe, 0x10), 232 + /* 233 + * VaudioEna = disabled 234 + * VdmicEna = disabled 235 + * Vamic1Ena = disabled 236 + * Vamic2Ena = disabled 237 + */ 238 + INIT_REGULATOR_REGISTER(AB8500_VAUDIOSUPPLY, 0x1e, 0x00), 239 + /* 240 + * Vamic1_dzout = high-Z when Vamic1 is disabled 241 + * Vamic2_dzout = high-Z when Vamic2 is disabled 242 + */ 243 + INIT_REGULATOR_REGISTER(AB8500_REGUCTRL1VAMIC, 0x03, 0x00), 244 + /* 245 + * VPll = Hw controlled (NOTE! PRCMU bits) 246 + * VanaRegu = force off 247 + */ 248 + INIT_REGULATOR_REGISTER(AB8500_VPLLVANAREGU, 0x0f, 0x02), 249 + /* 250 + * VrefDDREna = disabled 251 + * VrefDDRSleepMode = inactive (no pulldown) 252 + */ 253 + INIT_REGULATOR_REGISTER(AB8500_VREFDDR, 0x03, 0x00), 254 + /* 255 + * VextSupply1Regu = force LP 256 + * VextSupply2Regu = force OFF 257 + * VextSupply3Regu = force HP (-> STBB2=LP and TPS=LP) 258 + * ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0 259 + * ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0 260 + */ 261 + INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0xff, 0x13), 262 + /* 263 + * Vaux1Regu = force HP 264 + * Vaux2Regu = force off 265 + */ 266 + INIT_REGULATOR_REGISTER(AB8500_VAUX12REGU, 0x0f, 0x01), 267 + /* 268 + * Vaux3Regu = force off 269 + */ 270 + INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3REGU, 0x03, 0x00), 271 + /* 272 + * Vaux1Sel = 2.8 V 273 + */ 274 + INIT_REGULATOR_REGISTER(AB8500_VAUX1SEL, 0x0f, 0x0C), 275 + /* 276 + * Vaux2Sel = 2.9 V 277 + */ 278 + INIT_REGULATOR_REGISTER(AB8500_VAUX2SEL, 0x0f, 0x0d), 279 + /* 280 + * Vaux3Sel = 2.91 V 281 + */ 282 + INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3SEL, 0x07, 0x07), 283 + /* 284 + * VextSupply12LP = disabled (no LP) 285 + */ 286 + INIT_REGULATOR_REGISTER(AB8500_REGUCTRL2SPARE, 0x01, 0x00), 287 + /* 288 + * Vaux1Disch = short discharge time 289 + * Vaux2Disch = short discharge time 290 + * Vaux3Disch = short discharge time 291 + * Vintcore12Disch = short discharge time 292 + * VTVoutDisch = short discharge time 293 + * VaudioDisch = short discharge time 294 + */ 295 + INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH, 0xfc, 0x00), 296 + /* 297 + * VanaDisch = short discharge time 298 + * VdmicPullDownEna = pulldown disabled when Vdmic is disabled 299 + * VdmicDisch = short discharge time 300 + */ 301 + INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH2, 0x16, 0x00), 302 + }; 303 + 304 + /* AB8500 regulators */ 305 + static struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = { 306 + /* supplies to the display/camera */ 307 + [AB8500_LDO_AUX1] = { 308 + .supply_regulator = "ab8500-ext-supply3", 309 + .constraints = { 310 + .name = "V-DISPLAY", 311 + .min_uV = 2800000, 312 + .max_uV = 3300000, 313 + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 314 + REGULATOR_CHANGE_STATUS, 315 + .boot_on = 1, /* display is on at boot */ 316 + }, 317 + .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux1_consumers), 318 + .consumer_supplies = ab8500_vaux1_consumers, 319 + }, 320 + /* supplies to the on-board eMMC */ 321 + [AB8500_LDO_AUX2] = { 322 + .supply_regulator = "ab8500-ext-supply3", 323 + .constraints = { 324 + .name = "V-eMMC1", 325 + .min_uV = 1100000, 326 + .max_uV = 3300000, 327 + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 328 + REGULATOR_CHANGE_STATUS | 329 + REGULATOR_CHANGE_MODE, 330 + .valid_modes_mask = REGULATOR_MODE_NORMAL | 331 + REGULATOR_MODE_IDLE, 332 + }, 333 + .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux2_consumers), 334 + .consumer_supplies = ab8500_vaux2_consumers, 335 + }, 336 + /* supply for VAUX3, supplies to SDcard slots */ 337 + [AB8500_LDO_AUX3] = { 338 + .supply_regulator = "ab8500-ext-supply3", 339 + .constraints = { 340 + .name = "V-MMC-SD", 341 + .min_uV = 1100000, 342 + .max_uV = 3300000, 343 + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 344 + REGULATOR_CHANGE_STATUS | 345 + REGULATOR_CHANGE_MODE, 346 + .valid_modes_mask = REGULATOR_MODE_NORMAL | 347 + REGULATOR_MODE_IDLE, 348 + }, 349 + .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux3_consumers), 350 + .consumer_supplies = ab8500_vaux3_consumers, 351 + }, 352 + /* supply for tvout, gpadc, TVOUT LDO */ 353 + [AB8500_LDO_TVOUT] = { 354 + .constraints = { 355 + .name = "V-TVOUT", 356 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 357 + }, 358 + .num_consumer_supplies = ARRAY_SIZE(ab8500_vtvout_consumers), 359 + .consumer_supplies = ab8500_vtvout_consumers, 360 + }, 361 + /* supply for ab8500-vaudio, VAUDIO LDO */ 362 + [AB8500_LDO_AUDIO] = { 363 + .constraints = { 364 + .name = "V-AUD", 365 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 366 + }, 367 + .num_consumer_supplies = ARRAY_SIZE(ab8500_vaud_consumers), 368 + .consumer_supplies = ab8500_vaud_consumers, 369 + }, 370 + /* supply for v-anamic1 VAMic1-LDO */ 371 + [AB8500_LDO_ANAMIC1] = { 372 + .constraints = { 373 + .name = "V-AMIC1", 374 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 375 + }, 376 + .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic1_consumers), 377 + .consumer_supplies = ab8500_vamic1_consumers, 378 + }, 379 + /* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */ 380 + [AB8500_LDO_ANAMIC2] = { 381 + .constraints = { 382 + .name = "V-AMIC2", 383 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 384 + }, 385 + .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic2_consumers), 386 + .consumer_supplies = ab8500_vamic2_consumers, 387 + }, 388 + /* supply for v-dmic, VDMIC LDO */ 389 + [AB8500_LDO_DMIC] = { 390 + .constraints = { 391 + .name = "V-DMIC", 392 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 393 + }, 394 + .num_consumer_supplies = ARRAY_SIZE(ab8500_vdmic_consumers), 395 + .consumer_supplies = ab8500_vdmic_consumers, 396 + }, 397 + /* supply for v-intcore12, VINTCORE12 LDO */ 398 + [AB8500_LDO_INTCORE] = { 399 + .constraints = { 400 + .name = "V-INTCORE", 401 + .min_uV = 1250000, 402 + .max_uV = 1350000, 403 + .input_uV = 1800000, 404 + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 405 + REGULATOR_CHANGE_STATUS | 406 + REGULATOR_CHANGE_MODE | 407 + REGULATOR_CHANGE_DRMS, 408 + .valid_modes_mask = REGULATOR_MODE_NORMAL | 409 + REGULATOR_MODE_IDLE, 410 + }, 411 + .num_consumer_supplies = ARRAY_SIZE(ab8500_vintcore_consumers), 412 + .consumer_supplies = ab8500_vintcore_consumers, 413 + }, 414 + /* supply for U8500 CSI-DSI, VANA LDO */ 415 + [AB8500_LDO_ANA] = { 416 + .constraints = { 417 + .name = "V-CSI-DSI", 418 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 419 + }, 420 + .num_consumer_supplies = ARRAY_SIZE(ab8500_vana_consumers), 421 + .consumer_supplies = ab8500_vana_consumers, 422 + }, 423 + }; 424 + 425 + /* supply for VextSupply3 */ 426 + static struct regulator_consumer_supply ab8500_ext_supply3_consumers[] = { 427 + /* SIM supply for 3 V SIM cards */ 428 + REGULATOR_SUPPLY("vinvsim", "sim-detect.0"), 429 + }; 430 + 431 + /* 432 + * AB8500 external regulators 433 + */ 434 + static struct regulator_init_data ab8500_ext_regulators[] = { 435 + /* fixed Vbat supplies VSMPS1_EXT_1V8 */ 436 + [AB8500_EXT_SUPPLY1] = { 437 + .constraints = { 438 + .name = "ab8500-ext-supply1", 439 + .min_uV = 1800000, 440 + .max_uV = 1800000, 441 + .initial_mode = REGULATOR_MODE_IDLE, 442 + .boot_on = 1, 443 + .always_on = 1, 444 + }, 445 + }, 446 + /* fixed Vbat supplies VSMPS2_EXT_1V36 and VSMPS5_EXT_1V15 */ 447 + [AB8500_EXT_SUPPLY2] = { 448 + .constraints = { 449 + .name = "ab8500-ext-supply2", 450 + .min_uV = 1360000, 451 + .max_uV = 1360000, 452 + }, 453 + }, 454 + /* fixed Vbat supplies VSMPS3_EXT_3V4 and VSMPS4_EXT_3V4 */ 455 + [AB8500_EXT_SUPPLY3] = { 456 + .constraints = { 457 + .name = "ab8500-ext-supply3", 458 + .min_uV = 3400000, 459 + .max_uV = 3400000, 460 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 461 + .boot_on = 1, 462 + }, 463 + .num_consumer_supplies = 464 + ARRAY_SIZE(ab8500_ext_supply3_consumers), 465 + .consumer_supplies = ab8500_ext_supply3_consumers, 466 + }, 467 + }; 468 + 469 + static struct ab8500_regulator_platform_data ab8500_regulator_plat_data = { 470 + .reg_init = ab8500_reg_init, 471 + .num_reg_init = ARRAY_SIZE(ab8500_reg_init), 472 + .regulator = ab8500_regulators, 473 + .num_regulator = ARRAY_SIZE(ab8500_regulators), 474 + .ext_regulator = ab8500_ext_regulators, 475 + .num_ext_regulator = ARRAY_SIZE(ab8500_ext_regulators), 476 + }; 477 + 28 478 /** 29 479 * struct ab8500_ext_regulator_info - ab8500 regulator information 30 480 * @dev: device pointer ··· 794 344 static int ab8500_ext_regulator_probe(struct platform_device *pdev) 795 345 { 796 346 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); 797 - struct ab8500_platform_data *ppdata; 798 - struct ab8500_regulator_platform_data *pdata; 347 + struct ab8500_regulator_platform_data *pdata = &ab8500_regulator_plat_data; 799 348 struct device_node *np = pdev->dev.of_node; 800 349 struct regulator_config config = { }; 801 350 int i, err; ··· 812 363 813 364 if (!ab8500) { 814 365 dev_err(&pdev->dev, "null mfd parent\n"); 815 - return -EINVAL; 816 - } 817 - 818 - ppdata = dev_get_platdata(ab8500->dev); 819 - if (!ppdata) { 820 - dev_err(&pdev->dev, "null parent pdata\n"); 821 - return -EINVAL; 822 - } 823 - 824 - pdata = ppdata->regulator; 825 - if (!pdata) { 826 - dev_err(&pdev->dev, "null pdata\n"); 827 366 return -EINVAL; 828 367 } 829 368