blob: 9a8da1511c34bb88a2dd6b91432299456b46557f [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001// SPDX-License-Identifier: GPL-2.0-only
Charles Keepaxbbed2972015-02-22 16:43:21 +00002/*
3 * wm8804-spi.c -- WM8804 S/PDIF transceiver driver - SPI
4 *
5 * Copyright 2015 Cirrus Logic Inc
6 *
7 * Author: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Charles Keepaxbbed2972015-02-22 16:43:21 +00008 */
9
10#include <linux/init.h>
11#include <linux/module.h>
12#include <linux/spi/spi.h>
13
14#include "wm8804.h"
15
16static int wm8804_spi_probe(struct spi_device *spi)
17{
18 struct regmap *regmap;
19
20 regmap = devm_regmap_init_spi(spi, &wm8804_regmap_config);
21 if (IS_ERR(regmap))
22 return PTR_ERR(regmap);
23
24 return wm8804_probe(&spi->dev, regmap);
25}
26
27static int wm8804_spi_remove(struct spi_device *spi)
28{
29 wm8804_remove(&spi->dev);
30 return 0;
31}
32
33static const struct of_device_id wm8804_of_match[] = {
34 { .compatible = "wlf,wm8804", },
35 { }
36};
37MODULE_DEVICE_TABLE(of, wm8804_of_match);
38
39static struct spi_driver wm8804_spi_driver = {
40 .driver = {
41 .name = "wm8804",
Charles Keepax1a606672015-04-07 12:55:10 +010042 .pm = &wm8804_pm,
Charles Keepaxbbed2972015-02-22 16:43:21 +000043 .of_match_table = wm8804_of_match,
44 },
45 .probe = wm8804_spi_probe,
46 .remove = wm8804_spi_remove
47};
48
49module_spi_driver(wm8804_spi_driver);
50
51MODULE_DESCRIPTION("ASoC WM8804 driver - SPI");
52MODULE_AUTHOR("Charles Keepax <ckeepax@opensource.wolfsonmicro.com>");
53MODULE_LICENSE("GPL");