0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include <linux/init.h>
0011 #include <linux/module.h>
0012 #include <linux/spi/spi.h>
0013
0014 #include "wm8804.h"
0015
0016 static int wm8804_spi_probe(struct spi_device *spi)
0017 {
0018 struct regmap *regmap;
0019
0020 regmap = devm_regmap_init_spi(spi, &wm8804_regmap_config);
0021 if (IS_ERR(regmap))
0022 return PTR_ERR(regmap);
0023
0024 return wm8804_probe(&spi->dev, regmap);
0025 }
0026
0027 static void wm8804_spi_remove(struct spi_device *spi)
0028 {
0029 wm8804_remove(&spi->dev);
0030 }
0031
0032 static const struct of_device_id wm8804_of_match[] = {
0033 { .compatible = "wlf,wm8804", },
0034 { }
0035 };
0036 MODULE_DEVICE_TABLE(of, wm8804_of_match);
0037
0038 static struct spi_driver wm8804_spi_driver = {
0039 .driver = {
0040 .name = "wm8804",
0041 .pm = &wm8804_pm,
0042 .of_match_table = wm8804_of_match,
0043 },
0044 .probe = wm8804_spi_probe,
0045 .remove = wm8804_spi_remove
0046 };
0047
0048 module_spi_driver(wm8804_spi_driver);
0049
0050 MODULE_DESCRIPTION("ASoC WM8804 driver - SPI");
0051 MODULE_AUTHOR("Charles Keepax <ckeepax@opensource.wolfsonmicro.com>");
0052 MODULE_LICENSE("GPL");