2 * PCM3168A codec spi driver
4 * Copyright (C) 2015 Imagination Technologies Ltd.
6 * Author: Damien Horsley <Damien.Horsley@imgtec.com>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
13 #include <linux/init.h>
14 #include <linux/module.h>
15 #include <linux/spi/spi.h>
17 #include <sound/soc.h>
21 static int pcm3168a_spi_probe(struct spi_device *spi)
23 struct regmap *regmap;
25 regmap = devm_regmap_init_spi(spi, &pcm3168a_regmap);
27 return PTR_ERR(regmap);
29 return pcm3168a_probe(&spi->dev, regmap);
32 static int pcm3168a_spi_remove(struct spi_device *spi)
34 pcm3168a_remove(&spi->dev);
39 static const struct spi_device_id pcm3168a_spi_id[] = {
43 MODULE_DEVICE_TABLE(spi, pcm3168a_spi_id);
45 static const struct of_device_id pcm3168a_of_match[] = {
46 { .compatible = "ti,pcm3168a", },
49 MODULE_DEVICE_TABLE(of, pcm3168a_of_match);
51 static struct spi_driver pcm3168a_spi_driver = {
52 .probe = pcm3168a_spi_probe,
53 .remove = pcm3168a_spi_remove,
54 .id_table = pcm3168a_spi_id,
57 .of_match_table = pcm3168a_of_match,
58 .pm = &pcm3168a_pm_ops,
61 module_spi_driver(pcm3168a_spi_driver);
63 MODULE_DESCRIPTION("PCM3168A SPI codec driver");
64 MODULE_AUTHOR("Damien Horsley <Damien.Horsley@imgtec.com>");
65 MODULE_LICENSE("GPL v2");