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 WM8776

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

+27
+18
Documentation/devicetree/bindings/sound/wm8776.txt
··· 1 + WM8776 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,wm8776" 9 + 10 + - reg : the I2C address of the device for I2C, the chip select 11 + number for SPI. 12 + 13 + Example: 14 + 15 + codec: wm8776@1a { 16 + compatible = "wlf,wm8776"; 17 + reg = <0x1a>; 18 + };
+9
sound/soc/codecs/wm8776.c
··· 18 18 #include <linux/delay.h> 19 19 #include <linux/pm.h> 20 20 #include <linux/i2c.h> 21 + #include <linux/of_device.h> 21 22 #include <linux/platform_device.h> 22 23 #include <linux/spi/spi.h> 23 24 #include <linux/slab.h> ··· 453 452 .reg_cache_default = wm8776_reg, 454 453 }; 455 454 455 + static const struct of_device_id wm8776_of_match[] = { 456 + { .compatible = "wlf,wm8776", }, 457 + { } 458 + }; 459 + MODULE_DEVICE_TABLE(of, wm8776_of_match); 460 + 456 461 #if defined(CONFIG_SPI_MASTER) 457 462 static int __devinit wm8776_spi_probe(struct spi_device *spi) 458 463 { ··· 490 483 .driver = { 491 484 .name = "wm8776", 492 485 .owner = THIS_MODULE, 486 + .of_match_table = wm8776_of_match, 493 487 }, 494 488 .probe = wm8776_spi_probe, 495 489 .remove = __devexit_p(wm8776_spi_remove), ··· 535 527 .driver = { 536 528 .name = "wm8776", 537 529 .owner = THIS_MODULE, 530 + .of_match_table = wm8776_of_match, 538 531 }, 539 532 .probe = wm8776_i2c_probe, 540 533 .remove = __devexit_p(wm8776_i2c_remove),