1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm8804-spi.c -- WM8804 S/PDIF transceiver driver - SPI
5 * Copyright 2015 Cirrus Logic Inc
7 * Author: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
10 #include <linux/init.h>
11 #include <linux/module.h>
12 #include <linux/spi/spi.h>
16 static int wm8804_spi_probe(struct spi_device
*spi
)
18 struct regmap
*regmap
;
20 regmap
= devm_regmap_init_spi(spi
, &wm8804_regmap_config
);
22 return PTR_ERR(regmap
);
24 return wm8804_probe(&spi
->dev
, regmap
);
27 static int wm8804_spi_remove(struct spi_device
*spi
)
29 wm8804_remove(&spi
->dev
);
33 static const struct of_device_id wm8804_of_match
[] = {
34 { .compatible
= "wlf,wm8804", },
37 MODULE_DEVICE_TABLE(of
, wm8804_of_match
);
39 static struct spi_driver wm8804_spi_driver
= {
43 .of_match_table
= wm8804_of_match
,
45 .probe
= wm8804_spi_probe
,
46 .remove
= wm8804_spi_remove
49 module_spi_driver(wm8804_spi_driver
);
51 MODULE_DESCRIPTION("ASoC WM8804 driver - SPI");
52 MODULE_AUTHOR("Charles Keepax <ckeepax@opensource.wolfsonmicro.com>");
53 MODULE_LICENSE("GPL");