diff options
author | Sebastian Reichel <sre@kernel.org> | 2018-08-29 05:31:04 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2018-10-23 03:58:34 -0400 |
commit | 86f955d29ff83e15da62ad5de53a5480309da078 (patch) | |
tree | cab6b7d0d869beb5ee038ca874f059e7f0e91dae | |
parent | 55143439b7b501882bea9d95a54adfe00ffc79a3 (diff) |
mfd: motorola-cpcap: Add audio-codec support
Add support for the audio-codec node by converting from
devm_of_platform_populate() to devm_mfd_add_devices().
Tested-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r-- | drivers/mfd/motorola-cpcap.c | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c index 5276911caaec..20d9692640e1 100644 --- a/drivers/mfd/motorola-cpcap.c +++ b/drivers/mfd/motorola-cpcap.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/regmap.h> | 18 | #include <linux/regmap.h> |
19 | #include <linux/sysfs.h> | 19 | #include <linux/sysfs.h> |
20 | 20 | ||
21 | #include <linux/mfd/core.h> | ||
21 | #include <linux/mfd/motorola-cpcap.h> | 22 | #include <linux/mfd/motorola-cpcap.h> |
22 | #include <linux/spi/spi.h> | 23 | #include <linux/spi/spi.h> |
23 | 24 | ||
@@ -216,6 +217,53 @@ static const struct regmap_config cpcap_regmap_config = { | |||
216 | .val_format_endian = REGMAP_ENDIAN_LITTLE, | 217 | .val_format_endian = REGMAP_ENDIAN_LITTLE, |
217 | }; | 218 | }; |
218 | 219 | ||
220 | static const struct mfd_cell cpcap_mfd_devices[] = { | ||
221 | { | ||
222 | .name = "cpcap_adc", | ||
223 | .of_compatible = "motorola,mapphone-cpcap-adc", | ||
224 | }, { | ||
225 | .name = "cpcap_battery", | ||
226 | .of_compatible = "motorola,cpcap-battery", | ||
227 | }, { | ||
228 | .name = "cpcap-charger", | ||
229 | .of_compatible = "motorola,mapphone-cpcap-charger", | ||
230 | }, { | ||
231 | .name = "cpcap-regulator", | ||
232 | .of_compatible = "motorola,mapphone-cpcap-regulator", | ||
233 | }, { | ||
234 | .name = "cpcap-rtc", | ||
235 | .of_compatible = "motorola,cpcap-rtc", | ||
236 | }, { | ||
237 | .name = "cpcap-pwrbutton", | ||
238 | .of_compatible = "motorola,cpcap-pwrbutton", | ||
239 | }, { | ||
240 | .name = "cpcap-usb-phy", | ||
241 | .of_compatible = "motorola,mapphone-cpcap-usb-phy", | ||
242 | }, { | ||
243 | .name = "cpcap-led", | ||
244 | .id = 0, | ||
245 | .of_compatible = "motorola,cpcap-led-red", | ||
246 | }, { | ||
247 | .name = "cpcap-led", | ||
248 | .id = 1, | ||
249 | .of_compatible = "motorola,cpcap-led-green", | ||
250 | }, { | ||
251 | .name = "cpcap-led", | ||
252 | .id = 2, | ||
253 | .of_compatible = "motorola,cpcap-led-blue", | ||
254 | }, { | ||
255 | .name = "cpcap-led", | ||
256 | .id = 3, | ||
257 | .of_compatible = "motorola,cpcap-led-adl", | ||
258 | }, { | ||
259 | .name = "cpcap-led", | ||
260 | .id = 4, | ||
261 | .of_compatible = "motorola,cpcap-led-cp", | ||
262 | }, { | ||
263 | .name = "cpcap-codec", | ||
264 | } | ||
265 | }; | ||
266 | |||
219 | static int cpcap_probe(struct spi_device *spi) | 267 | static int cpcap_probe(struct spi_device *spi) |
220 | { | 268 | { |
221 | const struct of_device_id *match; | 269 | const struct of_device_id *match; |
@@ -260,7 +308,8 @@ static int cpcap_probe(struct spi_device *spi) | |||
260 | if (ret) | 308 | if (ret) |
261 | return ret; | 309 | return ret; |
262 | 310 | ||
263 | return devm_of_platform_populate(&cpcap->spi->dev); | 311 | return devm_mfd_add_devices(&spi->dev, 0, cpcap_mfd_devices, |
312 | ARRAY_SIZE(cpcap_mfd_devices), NULL, 0, NULL); | ||
264 | } | 313 | } |
265 | 314 | ||
266 | static struct spi_driver cpcap_driver = { | 315 | static struct spi_driver cpcap_driver = { |