diff options
author | Bengt Jonsson <bengt.g.jonsson@stericsson.com> | 2011-04-01 08:43:33 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2011-05-24 16:20:23 -0400 |
commit | 1032fbfd792f2b384ac16a63993b8fae5eea9083 (patch) | |
tree | 9d9955103fc7aad7f59dda3f523569aca3df7b62 /drivers/mfd/db8500-prcmu.c | |
parent | f0e733f32e56ded9309a8b8da3a77d47beb3cbdd (diff) |
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>
Diffstat (limited to 'drivers/mfd/db8500-prcmu.c')
-rw-r--r-- | drivers/mfd/db8500-prcmu.c | 179 |
1 files changed, 179 insertions, 0 deletions
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index c44725bd8b9a..e63782107e2f 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <linux/uaccess.h> | 28 | #include <linux/uaccess.h> |
29 | #include <linux/mfd/core.h> | 29 | #include <linux/mfd/core.h> |
30 | #include <linux/mfd/db8500-prcmu.h> | 30 | #include <linux/mfd/db8500-prcmu.h> |
31 | #include <linux/regulator/db8500-prcmu.h> | ||
32 | #include <linux/regulator/machine.h> | ||
31 | #include <mach/hardware.h> | 33 | #include <mach/hardware.h> |
32 | #include <mach/irqs.h> | 34 | #include <mach/irqs.h> |
33 | #include <mach/db8500-regs.h> | 35 | #include <mach/db8500-regs.h> |
@@ -1824,9 +1826,186 @@ void __init prcmu_early_init(void) | |||
1824 | } | 1826 | } |
1825 | } | 1827 | } |
1826 | 1828 | ||
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 | |||
1827 | static struct mfd_cell db8500_prcmu_devs[] = { | 2005 | static struct mfd_cell db8500_prcmu_devs[] = { |
1828 | { | 2006 | { |
1829 | .name = "db8500-prcmu-regulators", | 2007 | .name = "db8500-prcmu-regulators", |
2008 | .mfd_data = &db8500_regulators, | ||
1830 | }, | 2009 | }, |
1831 | { | 2010 | { |
1832 | .name = "cpufreq-u8500", | 2011 | .name = "cpufreq-u8500", |