diff options
author | Sean Cross <xobs@kosagi.com> | 2014-07-31 10:43:36 +0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-08-16 17:17:13 -0500 |
commit | 567e4f98922ce5542f8c2aa469a0c6ddf182b6ea (patch) | |
tree | bd2eb1ea42d43c17654422256aa1092e3262e336 /sound/soc/codecs/es8328-spi.c | |
parent | d4f7facde1796c8b3eb2f79e1fd903d7b776972f (diff) | |
download | linux-stable-567e4f98922ce5542f8c2aa469a0c6ddf182b6ea.tar.gz linux-stable-567e4f98922ce5542f8c2aa469a0c6ddf182b6ea.tar.bz2 linux-stable-567e4f98922ce5542f8c2aa469a0c6ddf182b6ea.zip |
ASoC: add es8328 codec driver
Add a codec driver for the Everest ES8328. It supports two separate audio
outputs and two separate audio inputs.
Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/es8328-spi.c')
-rw-r--r-- | sound/soc/codecs/es8328-spi.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/sound/soc/codecs/es8328-spi.c b/sound/soc/codecs/es8328-spi.c new file mode 100644 index 000000000000..8fbd935e1c76 --- /dev/null +++ b/sound/soc/codecs/es8328-spi.c @@ -0,0 +1,49 @@ +/* + * es8328.c -- ES8328 ALSA SoC SPI Audio driver + * + * Copyright 2014 Sutajio Ko-Usagi PTE LTD + * + * Author: Sean Cross <xobs@kosagi.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include <linux/module.h> +#include <linux/regmap.h> +#include <linux/spi/spi.h> +#include <sound/soc.h> +#include "es8328.h" + +static const struct of_device_id es8328_of_match[] = { + { .compatible = "everest,es8328", }, + { } +}; +MODULE_DEVICE_TABLE(of, es8328_of_match); + +static int es8328_spi_probe(struct spi_device *spi) +{ + return es8328_probe(&spi->dev, + devm_regmap_init_spi(spi, &es8328_regmap_config)); +} + +static int es8328_spi_remove(struct spi_device *spi) +{ + snd_soc_unregister_codec(&spi->dev); + return 0; +} + +static struct spi_driver es8328_spi_driver = { + .driver = { + .name = "es8328", + .of_match_table = es8328_of_match, + }, + .probe = es8328_spi_probe, + .remove = es8328_spi_remove, +}; + +module_spi_driver(es8328_spi_driver); +MODULE_DESCRIPTION("ASoC ES8328 audio CODEC SPI driver"); +MODULE_AUTHOR("Sean Cross <xobs@kosagi.com>"); +MODULE_LICENSE("GPL"); |