Btrfs: fix list transaction->pending_ordered corruption
[linux/fpc-iii.git] / sound / soc / codecs / ad193x-spi.c
blob390cef9b9dc20d3427453e16208a6ffb43e22a70
1 /*
2 * AD1938/AD1939 audio driver
4 * Copyright 2014 Analog Devices Inc.
6 * Licensed under the GPL-2.
7 */
9 #include <linux/module.h>
10 #include <linux/spi/spi.h>
11 #include <linux/regmap.h>
13 #include <sound/soc.h>
15 #include "ad193x.h"
17 static int ad193x_spi_probe(struct spi_device *spi)
19 struct regmap_config config;
21 config = ad193x_regmap_config;
22 config.val_bits = 8;
23 config.reg_bits = 16;
24 config.read_flag_mask = 0x09;
25 config.write_flag_mask = 0x08;
27 return ad193x_probe(&spi->dev, devm_regmap_init_spi(spi, &config));
30 static int ad193x_spi_remove(struct spi_device *spi)
32 snd_soc_unregister_codec(&spi->dev);
33 return 0;
36 static struct spi_driver ad193x_spi_driver = {
37 .driver = {
38 .name = "ad193x",
39 .owner = THIS_MODULE,
41 .probe = ad193x_spi_probe,
42 .remove = ad193x_spi_remove,
44 module_spi_driver(ad193x_spi_driver);
46 MODULE_DESCRIPTION("ASoC AD1938/AD1939 audio CODEC driver");
47 MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
48 MODULE_LICENSE("GPL");