diff options
-rw-r--r-- | drivers/mfd/ab8500-sysctrl.c | 24 | ||||
-rw-r--r-- | include/linux/mfd/abx500/ab8500-sysctrl.h | 5 | ||||
-rw-r--r-- | include/linux/mfd/abx500/ab8500.h | 2 |
3 files changed, 31 insertions, 0 deletions
diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c index 3aaff6043e18..236324e1136d 100644 --- a/drivers/mfd/ab8500-sysctrl.c +++ b/drivers/mfd/ab8500-sysctrl.c | |||
@@ -113,11 +113,35 @@ int ab8500_sysctrl_write(u16 reg, u8 mask, u8 value) | |||
113 | static int ab8500_sysctrl_probe(struct platform_device *pdev) | 113 | static int ab8500_sysctrl_probe(struct platform_device *pdev) |
114 | { | 114 | { |
115 | struct ab8500_platform_data *plat; | 115 | struct ab8500_platform_data *plat; |
116 | struct ab8500_sysctrl_platform_data *pdata; | ||
116 | 117 | ||
117 | sysctrl_dev = &pdev->dev; | 118 | sysctrl_dev = &pdev->dev; |
118 | plat = dev_get_platdata(pdev->dev.parent); | 119 | plat = dev_get_platdata(pdev->dev.parent); |
119 | if (plat->pm_power_off) | 120 | if (plat->pm_power_off) |
120 | pm_power_off = ab8500_power_off; | 121 | pm_power_off = ab8500_power_off; |
122 | |||
123 | pdata = plat->sysctrl; | ||
124 | |||
125 | if (pdata) { | ||
126 | int ret, i, j; | ||
127 | |||
128 | for (i = AB8500_SYSCLKREQ1RFCLKBUF; | ||
129 | i <= AB8500_SYSCLKREQ8RFCLKBUF; i++) { | ||
130 | j = i - AB8500_SYSCLKREQ1RFCLKBUF; | ||
131 | ret = ab8500_sysctrl_write(i, 0xff, | ||
132 | pdata->initial_req_buf_config[j]); | ||
133 | dev_dbg(&pdev->dev, | ||
134 | "Setting SysClkReq%dRfClkBuf 0x%X\n", | ||
135 | j + 1, | ||
136 | pdata->initial_req_buf_config[j]); | ||
137 | if (ret < 0) { | ||
138 | dev_err(&pdev->dev, | ||
139 | "unable to set sysClkReq%dRfClkBuf: " | ||
140 | "%d\n", j + 1, ret); | ||
141 | } | ||
142 | } | ||
143 | } | ||
144 | |||
121 | return 0; | 145 | return 0; |
122 | } | 146 | } |
123 | 147 | ||
diff --git a/include/linux/mfd/abx500/ab8500-sysctrl.h b/include/linux/mfd/abx500/ab8500-sysctrl.h index 10eb50973c39..ebf12e793db9 100644 --- a/include/linux/mfd/abx500/ab8500-sysctrl.h +++ b/include/linux/mfd/abx500/ab8500-sysctrl.h | |||
@@ -37,6 +37,11 @@ static inline int ab8500_sysctrl_clear(u16 reg, u8 bits) | |||
37 | return ab8500_sysctrl_write(reg, bits, 0); | 37 | return ab8500_sysctrl_write(reg, bits, 0); |
38 | } | 38 | } |
39 | 39 | ||
40 | /* Configuration data for SysClkReq1RfClkBuf - SysClkReq8RfClkBuf */ | ||
41 | struct ab8500_sysctrl_platform_data { | ||
42 | u8 initial_req_buf_config[8]; | ||
43 | }; | ||
44 | |||
40 | /* Registers */ | 45 | /* Registers */ |
41 | #define AB8500_TURNONSTATUS 0x100 | 46 | #define AB8500_TURNONSTATUS 0x100 |
42 | #define AB8500_RESETSTATUS 0x101 | 47 | #define AB8500_RESETSTATUS 0x101 |
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 6119b2fbad97..5251bca56326 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
@@ -270,6 +270,7 @@ struct regulator_reg_init; | |||
270 | struct regulator_init_data; | 270 | struct regulator_init_data; |
271 | struct ab8500_gpio_platform_data; | 271 | struct ab8500_gpio_platform_data; |
272 | struct ab8500_codec_platform_data; | 272 | struct ab8500_codec_platform_data; |
273 | struct ab8500_sysctrl_platform_data; | ||
273 | 274 | ||
274 | /** | 275 | /** |
275 | * struct ab8500_platform_data - AB8500 platform data | 276 | * struct ab8500_platform_data - AB8500 platform data |
@@ -291,6 +292,7 @@ struct ab8500_platform_data { | |||
291 | struct regulator_init_data *regulator; | 292 | struct regulator_init_data *regulator; |
292 | struct ab8500_gpio_platform_data *gpio; | 293 | struct ab8500_gpio_platform_data *gpio; |
293 | struct ab8500_codec_platform_data *codec; | 294 | struct ab8500_codec_platform_data *codec; |
295 | struct ab8500_sysctrl_platform_data *sysctrl; | ||
294 | }; | 296 | }; |
295 | 297 | ||
296 | extern int ab8500_init(struct ab8500 *ab8500, | 298 | extern int ab8500_init(struct ab8500 *ab8500, |