diff options
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 4a09ce90ca4b..5f189518697a 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
@@ -35,6 +35,9 @@ | |||
35 | #include <asm/reboot.h> | 35 | #include <asm/reboot.h> |
36 | #include <asm/portmux.h> | 36 | #include <asm/portmux.h> |
37 | #include <asm/dpmc.h> | 37 | #include <asm/dpmc.h> |
38 | #ifdef CONFIG_REGULATOR_ADP_SWITCH | ||
39 | #include <linux/regulator/adp_switch.h> | ||
40 | #endif | ||
38 | #ifdef CONFIG_REGULATOR_AD5398 | 41 | #ifdef CONFIG_REGULATOR_AD5398 |
39 | #include <linux/regulator/ad5398.h> | 42 | #include <linux/regulator/ad5398.h> |
40 | #endif | 43 | #endif |
@@ -2008,6 +2011,93 @@ static struct platform_device bfin_ac97 = { | |||
2008 | }; | 2011 | }; |
2009 | #endif | 2012 | #endif |
2010 | 2013 | ||
2014 | #if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE) | ||
2015 | #define REGULATOR_ADP122 "adp122" | ||
2016 | #define REGULATOR_ADP150 "adp150" | ||
2017 | |||
2018 | static struct regulator_consumer_supply adp122_consumers = { | ||
2019 | .supply = REGULATOR_ADP122, | ||
2020 | }; | ||
2021 | |||
2022 | static struct regulator_consumer_supply adp150_consumers = { | ||
2023 | .supply = REGULATOR_ADP150, | ||
2024 | }; | ||
2025 | |||
2026 | static struct regulator_init_data adp_switch_regulator_data[] = { | ||
2027 | { | ||
2028 | .constraints = { | ||
2029 | .name = REGULATOR_ADP122, | ||
2030 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
2031 | }, | ||
2032 | .num_consumer_supplies = 1, /* only 1 */ | ||
2033 | .consumer_supplies = &adp122_consumers, | ||
2034 | .driver_data = (void *)GPIO_PF2, /* gpio port only */ | ||
2035 | }, | ||
2036 | { | ||
2037 | .constraints = { | ||
2038 | .name = REGULATOR_ADP150, | ||
2039 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
2040 | }, | ||
2041 | .num_consumer_supplies = 1, /* only 1 */ | ||
2042 | .consumer_supplies = &adp150_consumers, | ||
2043 | .driver_data = (void *)GPIO_PF3, /* gpio port only */ | ||
2044 | }, | ||
2045 | }; | ||
2046 | |||
2047 | static struct adp_switch_platform_data adp_switch_pdata = { | ||
2048 | .regulator_num = ARRAY_SIZE(adp_switch_regulator_data), | ||
2049 | .regulator_data = adp_switch_regulator_data, | ||
2050 | }; | ||
2051 | |||
2052 | static struct platform_device adp_switch_device = { | ||
2053 | .name = "adp_switch", | ||
2054 | .id = 0, | ||
2055 | .dev = { | ||
2056 | .platform_data = &adp_switch_pdata, | ||
2057 | }, | ||
2058 | }; | ||
2059 | |||
2060 | #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \ | ||
2061 | defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE) | ||
2062 | static struct regulator_bulk_data adp122_bulk_data = { | ||
2063 | .supply = REGULATOR_ADP122, | ||
2064 | }; | ||
2065 | |||
2066 | static struct regulator_userspace_consumer_data adp122_userspace_comsumer_data = { | ||
2067 | .name = REGULATOR_ADP122, | ||
2068 | .num_supplies = 1, | ||
2069 | .supplies = &adp122_bulk_data, | ||
2070 | }; | ||
2071 | |||
2072 | static struct platform_device adp122_userspace_consumer_device = { | ||
2073 | .name = "reg-userspace-consumer", | ||
2074 | .id = 0, | ||
2075 | .dev = { | ||
2076 | .platform_data = &adp122_userspace_comsumer_data, | ||
2077 | }, | ||
2078 | }; | ||
2079 | |||
2080 | static struct regulator_bulk_data adp150_bulk_data = { | ||
2081 | .supply = REGULATOR_ADP150, | ||
2082 | }; | ||
2083 | |||
2084 | static struct regulator_userspace_consumer_data adp150_userspace_comsumer_data = { | ||
2085 | .name = REGULATOR_ADP150, | ||
2086 | .num_supplies = 1, | ||
2087 | .supplies = &adp150_bulk_data, | ||
2088 | }; | ||
2089 | |||
2090 | static struct platform_device adp150_userspace_consumer_device = { | ||
2091 | .name = "reg-userspace-consumer", | ||
2092 | .id = 1, | ||
2093 | .dev = { | ||
2094 | .platform_data = &adp150_userspace_comsumer_data, | ||
2095 | }, | ||
2096 | }; | ||
2097 | #endif | ||
2098 | #endif | ||
2099 | |||
2100 | |||
2011 | static struct platform_device *stamp_devices[] __initdata = { | 2101 | static struct platform_device *stamp_devices[] __initdata = { |
2012 | 2102 | ||
2013 | &bfin_dpmc, | 2103 | &bfin_dpmc, |
@@ -2138,6 +2228,15 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
2138 | &ad5398_userspace_consumer_device, | 2228 | &ad5398_userspace_consumer_device, |
2139 | #endif | 2229 | #endif |
2140 | #endif | 2230 | #endif |
2231 | |||
2232 | #if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE) | ||
2233 | &adp_switch_device, | ||
2234 | #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \ | ||
2235 | defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE) | ||
2236 | &adp122_userspace_consumer_device, | ||
2237 | &adp150_userspace_consumer_device, | ||
2238 | #endif | ||
2239 | #endif | ||
2141 | }; | 2240 | }; |
2142 | 2241 | ||
2143 | static int __init stamp_init(void) | 2242 | static int __init stamp_init(void) |