2 * AD1938/AD1939 audio driver
4 * Copyright 2014 Analog Devices Inc.
6 * Licensed under the GPL-2.
9 #include <linux/module.h>
10 #include <linux/spi/spi.h>
11 #include <linux/regmap.h>
13 #include <sound/soc.h>
17 static int ad193x_spi_probe(struct spi_device
*spi
)
19 struct regmap_config config
;
21 config
= ad193x_regmap_config
;
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
);
36 static struct spi_driver ad193x_spi_driver
= {
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");