Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
[deliverable/linux.git] / sound / soc / codecs / adav801.c
CommitLineData
0c2d6964
LPC
1/*
2 * ADAV801 audio driver
3 *
4 * Copyright 2014 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2.
7 */
8
9#include <linux/module.h>
10#include <linux/spi/spi.h>
11#include <linux/regmap.h>
12
13#include <sound/soc.h>
14
15#include "adav80x.h"
16
17static const struct spi_device_id adav80x_spi_id[] = {
18 { "adav801", 0 },
19 { }
20};
21MODULE_DEVICE_TABLE(spi, adav80x_spi_id);
22
23static int adav80x_spi_probe(struct spi_device *spi)
24{
25 struct regmap_config config;
26
27 config = adav80x_regmap_config;
28 config.read_flag_mask = 0x01;
29
30 return adav80x_bus_probe(&spi->dev, devm_regmap_init_spi(spi, &config));
31}
32
33static int adav80x_spi_remove(struct spi_device *spi)
34{
35 snd_soc_unregister_codec(&spi->dev);
36 return 0;
37}
38
39static struct spi_driver adav80x_spi_driver = {
40 .driver = {
41 .name = "adav801",
42 .owner = THIS_MODULE,
43 },
44 .probe = adav80x_spi_probe,
45 .remove = adav80x_spi_remove,
46 .id_table = adav80x_spi_id,
47};
48module_spi_driver(adav80x_spi_driver);
49
50MODULE_DESCRIPTION("ASoC ADAV801 driver");
51MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
52MODULE_AUTHOR("Yi Li <yi.li@analog.com>>");
53MODULE_LICENSE("GPL");
This page took 0.158971 seconds and 5 git commands to generate.