Loading...
1// SPDX-License-Identifier: GPL-2.0-only
2/*
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>
8 */
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 void wm8804_spi_remove(struct spi_device *spi)
28{
29 wm8804_remove(&spi->dev);
30}
31
32static const struct of_device_id wm8804_of_match[] = {
33 { .compatible = "wlf,wm8804", },
34 { }
35};
36MODULE_DEVICE_TABLE(of, wm8804_of_match);
37
38static struct spi_driver wm8804_spi_driver = {
39 .driver = {
40 .name = "wm8804",
41 .pm = &wm8804_pm,
42 .of_match_table = wm8804_of_match,
43 },
44 .probe = wm8804_spi_probe,
45 .remove = wm8804_spi_remove
46};
47
48module_spi_driver(wm8804_spi_driver);
49
50MODULE_DESCRIPTION("ASoC WM8804 driver - SPI");
51MODULE_AUTHOR("Charles Keepax <ckeepax@opensource.wolfsonmicro.com>");
52MODULE_LICENSE("GPL");
1/*
2 * wm8804-spi.c -- WM8804 S/PDIF transceiver driver - SPI
3 *
4 * Copyright 2015 Cirrus Logic Inc
5 *
6 * Author: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/spi/spi.h>
16
17#include "wm8804.h"
18
19static int wm8804_spi_probe(struct spi_device *spi)
20{
21 struct regmap *regmap;
22
23 regmap = devm_regmap_init_spi(spi, &wm8804_regmap_config);
24 if (IS_ERR(regmap))
25 return PTR_ERR(regmap);
26
27 return wm8804_probe(&spi->dev, regmap);
28}
29
30static int wm8804_spi_remove(struct spi_device *spi)
31{
32 wm8804_remove(&spi->dev);
33 return 0;
34}
35
36static const struct of_device_id wm8804_of_match[] = {
37 { .compatible = "wlf,wm8804", },
38 { }
39};
40MODULE_DEVICE_TABLE(of, wm8804_of_match);
41
42static struct spi_driver wm8804_spi_driver = {
43 .driver = {
44 .name = "wm8804",
45 .pm = &wm8804_pm,
46 .of_match_table = wm8804_of_match,
47 },
48 .probe = wm8804_spi_probe,
49 .remove = wm8804_spi_remove
50};
51
52module_spi_driver(wm8804_spi_driver);
53
54MODULE_DESCRIPTION("ASoC WM8804 driver - SPI");
55MODULE_AUTHOR("Charles Keepax <ckeepax@opensource.wolfsonmicro.com>");
56MODULE_LICENSE("GPL");