Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sebastian Reichel and committed by
Lee Jones
86f955d2 55143439

+50 -1
+50 -1
drivers/mfd/motorola-cpcap.c
··· 18 18 #include <linux/regmap.h> 19 19 #include <linux/sysfs.h> 20 20 21 + #include <linux/mfd/core.h> 21 22 #include <linux/mfd/motorola-cpcap.h> 22 23 #include <linux/spi/spi.h> 23 24 ··· 217 216 .val_format_endian = REGMAP_ENDIAN_LITTLE, 218 217 }; 219 218 219 + static const struct mfd_cell cpcap_mfd_devices[] = { 220 + { 221 + .name = "cpcap_adc", 222 + .of_compatible = "motorola,mapphone-cpcap-adc", 223 + }, { 224 + .name = "cpcap_battery", 225 + .of_compatible = "motorola,cpcap-battery", 226 + }, { 227 + .name = "cpcap-charger", 228 + .of_compatible = "motorola,mapphone-cpcap-charger", 229 + }, { 230 + .name = "cpcap-regulator", 231 + .of_compatible = "motorola,mapphone-cpcap-regulator", 232 + }, { 233 + .name = "cpcap-rtc", 234 + .of_compatible = "motorola,cpcap-rtc", 235 + }, { 236 + .name = "cpcap-pwrbutton", 237 + .of_compatible = "motorola,cpcap-pwrbutton", 238 + }, { 239 + .name = "cpcap-usb-phy", 240 + .of_compatible = "motorola,mapphone-cpcap-usb-phy", 241 + }, { 242 + .name = "cpcap-led", 243 + .id = 0, 244 + .of_compatible = "motorola,cpcap-led-red", 245 + }, { 246 + .name = "cpcap-led", 247 + .id = 1, 248 + .of_compatible = "motorola,cpcap-led-green", 249 + }, { 250 + .name = "cpcap-led", 251 + .id = 2, 252 + .of_compatible = "motorola,cpcap-led-blue", 253 + }, { 254 + .name = "cpcap-led", 255 + .id = 3, 256 + .of_compatible = "motorola,cpcap-led-adl", 257 + }, { 258 + .name = "cpcap-led", 259 + .id = 4, 260 + .of_compatible = "motorola,cpcap-led-cp", 261 + }, { 262 + .name = "cpcap-codec", 263 + } 264 + }; 265 + 220 266 static int cpcap_probe(struct spi_device *spi) 221 267 { 222 268 const struct of_device_id *match; ··· 308 260 if (ret) 309 261 return ret; 310 262 311 - return devm_of_platform_populate(&cpcap->spi->dev); 263 + return devm_mfd_add_devices(&spi->dev, 0, cpcap_mfd_devices, 264 + ARRAY_SIZE(cpcap_mfd_devices), NULL, 0, NULL); 312 265 } 313 266 314 267 static struct spi_driver cpcap_driver = {