Skip to content

Commit 1032fbf

Browse files
Bengt JonssonLinus Walleij
authored andcommitted
mach-ux500: voltage domain regulators for DB8500
The DB8500 has ePOD:s (electronic power domains) which are possible to switch on/off to deactivate silicon blocks on the DB8500 SoC by cutting their power without retention. We model these as simple regulators with one bit on/off settings. Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Sundar Iyer <sundar.iyer@stericsson.com> Signed-off-by: Jonas Aberg <jonas.aberg@stericsson.com> Signed-off-by: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com> Signed-off-by: Martin Persson <martin.persson@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent f0e733f commit 1032fbf

6 files changed

Lines changed: 791 additions & 0 deletions

File tree

‎arch/arm/mach-ux500/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ config UX500_SOC_DB5500
1717
config UX500_SOC_DB8500
1818
bool "DB8500"
1919
select MFD_DB8500_PRCMU
20+
select REGULATOR_DB8500_PRCMU
2021

2122
endmenu
2223

‎drivers/mfd/db8500-prcmu.c‎

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include <linux/uaccess.h>
2929
#include <linux/mfd/core.h>
3030
#include <linux/mfd/db8500-prcmu.h>
31+
#include <linux/regulator/db8500-prcmu.h>
32+
#include <linux/regulator/machine.h>
3133
#include <mach/hardware.h>
3234
#include <mach/irqs.h>
3335
#include <mach/db8500-regs.h>
@@ -1824,9 +1826,186 @@ void __init prcmu_early_init(void)
18241826
}
18251827
}
18261828

1829+
/*
1830+
* Power domain switches (ePODs) modeled as regulators for the DB8500 SoC
1831+
*/
1832+
static struct regulator_consumer_supply db8500_vape_consumers[] = {
1833+
REGULATOR_SUPPLY("v-ape", NULL),
1834+
REGULATOR_SUPPLY("v-i2c", "nmk-i2c.0"),
1835+
REGULATOR_SUPPLY("v-i2c", "nmk-i2c.1"),
1836+
REGULATOR_SUPPLY("v-i2c", "nmk-i2c.2"),
1837+
REGULATOR_SUPPLY("v-i2c", "nmk-i2c.3"),
1838+
/* "v-mmc" changed to "vcore" in the mainline kernel */
1839+
REGULATOR_SUPPLY("vcore", "sdi0"),
1840+
REGULATOR_SUPPLY("vcore", "sdi1"),
1841+
REGULATOR_SUPPLY("vcore", "sdi2"),
1842+
REGULATOR_SUPPLY("vcore", "sdi3"),
1843+
REGULATOR_SUPPLY("vcore", "sdi4"),
1844+
REGULATOR_SUPPLY("v-dma", "dma40.0"),
1845+
REGULATOR_SUPPLY("v-ape", "ab8500-usb.0"),
1846+
/* "v-uart" changed to "vcore" in the mainline kernel */
1847+
REGULATOR_SUPPLY("vcore", "uart0"),
1848+
REGULATOR_SUPPLY("vcore", "uart1"),
1849+
REGULATOR_SUPPLY("vcore", "uart2"),
1850+
REGULATOR_SUPPLY("v-ape", "nmk-ske-keypad.0"),
1851+
};
1852+
1853+
static struct regulator_consumer_supply db8500_vsmps2_consumers[] = {
1854+
/* CG2900 and CW1200 power to off-chip peripherals */
1855+
REGULATOR_SUPPLY("gbf_1v8", "cg2900-uart.0"),
1856+
REGULATOR_SUPPLY("wlan_1v8", "cw1200.0"),
1857+
REGULATOR_SUPPLY("musb_1v8", "ab8500-usb.0"),
1858+
/* AV8100 regulator */
1859+
REGULATOR_SUPPLY("hdmi_1v8", "0-0070"),
1860+
};
1861+
1862+
static struct regulator_consumer_supply db8500_b2r2_mcde_consumers[] = {
1863+
REGULATOR_SUPPLY("vsupply", "b2r2.0"),
1864+
REGULATOR_SUPPLY("vsupply", "mcde.0"),
1865+
};
1866+
1867+
static struct regulator_init_data db8500_regulators[DB8500_NUM_REGULATORS] = {
1868+
[DB8500_REGULATOR_VAPE] = {
1869+
.constraints = {
1870+
.name = "db8500-vape",
1871+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1872+
},
1873+
.consumer_supplies = db8500_vape_consumers,
1874+
.num_consumer_supplies = ARRAY_SIZE(db8500_vape_consumers),
1875+
},
1876+
[DB8500_REGULATOR_VARM] = {
1877+
.constraints = {
1878+
.name = "db8500-varm",
1879+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1880+
},
1881+
},
1882+
[DB8500_REGULATOR_VMODEM] = {
1883+
.constraints = {
1884+
.name = "db8500-vmodem",
1885+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1886+
},
1887+
},
1888+
[DB8500_REGULATOR_VPLL] = {
1889+
.constraints = {
1890+
.name = "db8500-vpll",
1891+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1892+
},
1893+
},
1894+
[DB8500_REGULATOR_VSMPS1] = {
1895+
.constraints = {
1896+
.name = "db8500-vsmps1",
1897+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1898+
},
1899+
},
1900+
[DB8500_REGULATOR_VSMPS2] = {
1901+
.constraints = {
1902+
.name = "db8500-vsmps2",
1903+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1904+
},
1905+
.consumer_supplies = db8500_vsmps2_consumers,
1906+
.num_consumer_supplies = ARRAY_SIZE(db8500_vsmps2_consumers),
1907+
},
1908+
[DB8500_REGULATOR_VSMPS3] = {
1909+
.constraints = {
1910+
.name = "db8500-vsmps3",
1911+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1912+
},
1913+
},
1914+
[DB8500_REGULATOR_VRF1] = {
1915+
.constraints = {
1916+
.name = "db8500-vrf1",
1917+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1918+
},
1919+
},
1920+
[DB8500_REGULATOR_SWITCH_SVAMMDSP] = {
1921+
.supply_regulator = "db8500-vape",
1922+
.constraints = {
1923+
.name = "db8500-sva-mmdsp",
1924+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1925+
},
1926+
},
1927+
[DB8500_REGULATOR_SWITCH_SVAMMDSPRET] = {
1928+
.constraints = {
1929+
/* "ret" means "retention" */
1930+
.name = "db8500-sva-mmdsp-ret",
1931+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1932+
},
1933+
},
1934+
[DB8500_REGULATOR_SWITCH_SVAPIPE] = {
1935+
.supply_regulator = "db8500-vape",
1936+
.constraints = {
1937+
.name = "db8500-sva-pipe",
1938+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1939+
},
1940+
},
1941+
[DB8500_REGULATOR_SWITCH_SIAMMDSP] = {
1942+
.supply_regulator = "db8500-vape",
1943+
.constraints = {
1944+
.name = "db8500-sia-mmdsp",
1945+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1946+
},
1947+
},
1948+
[DB8500_REGULATOR_SWITCH_SIAMMDSPRET] = {
1949+
.constraints = {
1950+
.name = "db8500-sia-mmdsp-ret",
1951+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1952+
},
1953+
},
1954+
[DB8500_REGULATOR_SWITCH_SIAPIPE] = {
1955+
.supply_regulator = "db8500-vape",
1956+
.constraints = {
1957+
.name = "db8500-sia-pipe",
1958+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1959+
},
1960+
},
1961+
[DB8500_REGULATOR_SWITCH_SGA] = {
1962+
.supply_regulator = "db8500-vape",
1963+
.constraints = {
1964+
.name = "db8500-sga",
1965+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1966+
},
1967+
},
1968+
[DB8500_REGULATOR_SWITCH_B2R2_MCDE] = {
1969+
.supply_regulator = "db8500-vape",
1970+
.constraints = {
1971+
.name = "db8500-b2r2-mcde",
1972+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1973+
},
1974+
.consumer_supplies = db8500_b2r2_mcde_consumers,
1975+
.num_consumer_supplies = ARRAY_SIZE(db8500_b2r2_mcde_consumers),
1976+
},
1977+
[DB8500_REGULATOR_SWITCH_ESRAM12] = {
1978+
.supply_regulator = "db8500-vape",
1979+
.constraints = {
1980+
.name = "db8500-esram12",
1981+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1982+
},
1983+
},
1984+
[DB8500_REGULATOR_SWITCH_ESRAM12RET] = {
1985+
.constraints = {
1986+
.name = "db8500-esram12-ret",
1987+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1988+
},
1989+
},
1990+
[DB8500_REGULATOR_SWITCH_ESRAM34] = {
1991+
.supply_regulator = "db8500-vape",
1992+
.constraints = {
1993+
.name = "db8500-esram34",
1994+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
1995+
},
1996+
},
1997+
[DB8500_REGULATOR_SWITCH_ESRAM34RET] = {
1998+
.constraints = {
1999+
.name = "db8500-esram34-ret",
2000+
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
2001+
},
2002+
},
2003+
};
2004+
18272005
static struct mfd_cell db8500_prcmu_devs[] = {
18282006
{
18292007
.name = "db8500-prcmu-regulators",
2008+
.mfd_data = &db8500_regulators,
18302009
},
18312010
{
18322011
.name = "cpufreq-u8500",

‎drivers/regulator/Kconfig‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,13 @@ config REGULATOR_AB8500
274274
This driver supports the regulators found on the ST-Ericsson mixed
275275
signal AB8500 PMIC
276276

277+
config REGULATOR_DB8500_PRCMU
278+
bool "ST-Ericsson DB8500 Voltage Domain Regulators"
279+
depends on MFD_DB8500_PRCMU
280+
help
281+
This driver supports the voltage domain regulators controlled by the
282+
DB8500 PRCMU
283+
277284
config REGULATOR_TPS6586X
278285
tristate "TI TPS6586X Power regulators"
279286
depends on MFD_TPS6586X

‎drivers/regulator/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ obj-$(CONFIG_REGULATOR_TPS6524X) += tps6524x-regulator.o
4141
obj-$(CONFIG_REGULATOR_88PM8607) += 88pm8607.o
4242
obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o
4343
obj-$(CONFIG_REGULATOR_AB8500) += ab8500.o
44+
obj-$(CONFIG_REGULATOR_DB8500_PRCMU) += db8500-prcmu.o
4445

4546
ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG

0 commit comments

Comments
 (0)