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

ASoC: Add device tree binding for WM8728

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>

+27
+18
Documentation/devicetree/bindings/sound/wm8728.txt
··· 1 + WM8728 audio CODEC 2 + 3 + This device supports both I2C and SPI (configured with pin strapping 4 + on the board). 5 + 6 + Required properties: 7 + 8 + - compatible : "wlf,wm8728" 9 + 10 + - reg : the I2C address of the device for I2C, the chip select 11 + number for SPI. 12 + 13 + Example: 14 + 15 + codec: wm8728@1a { 16 + compatible = "wlf,wm8728"; 17 + reg = <0x1a>; 18 + };
+9
sound/soc/codecs/wm8728.c
··· 19 19 #include <linux/platform_device.h> 20 20 #include <linux/spi/spi.h> 21 21 #include <linux/slab.h> 22 + #include <linux/of_device.h> 22 23 #include <sound/core.h> 23 24 #include <sound/pcm.h> 24 25 #include <sound/pcm_params.h> ··· 270 269 .num_dapm_routes = ARRAY_SIZE(wm8728_intercon), 271 270 }; 272 271 272 + static const struct of_device_id wm8728_of_match[] = { 273 + { .compatible = "wlf,wm8728", }, 274 + { } 275 + }; 276 + MODULE_DEVICE_TABLE(of, wm8728_of_match); 277 + 273 278 #if defined(CONFIG_SPI_MASTER) 274 279 static int __devinit wm8728_spi_probe(struct spi_device *spi) 275 280 { ··· 307 300 .driver = { 308 301 .name = "wm8728", 309 302 .owner = THIS_MODULE, 303 + .of_match_table = wm8728_of_match, 310 304 }, 311 305 .probe = wm8728_spi_probe, 312 306 .remove = __devexit_p(wm8728_spi_remove), ··· 352 344 .driver = { 353 345 .name = "wm8728", 354 346 .owner = THIS_MODULE, 347 + .of_match_table = wm8728_of_match, 355 348 }, 356 349 .probe = wm8728_i2c_probe, 357 350 .remove = __devexit_p(wm8728_i2c_remove),