1 // SPDX-License-Identifier: GPL-2.0-only
3 * PCM3168A codec spi driver
5 * Copyright (C) 2015 Imagination Technologies Ltd.
7 * Author: Damien Horsley <Damien.Horsley@imgtec.com>
10 #include <linux/init.h>
11 #include <linux/module.h>
12 #include <linux/spi/spi.h>
14 #include <sound/soc.h>
18 static int pcm3168a_spi_probe(struct spi_device *spi)
20 struct regmap *regmap;
22 regmap = devm_regmap_init_spi(spi, &pcm3168a_regmap);
24 return PTR_ERR(regmap);
26 return pcm3168a_probe(&spi->dev, regmap);
29 static int pcm3168a_spi_remove(struct spi_device *spi)
31 pcm3168a_remove(&spi->dev);
36 static const struct spi_device_id pcm3168a_spi_id[] = {
40 MODULE_DEVICE_TABLE(spi, pcm3168a_spi_id);
42 static const struct of_device_id pcm3168a_of_match[] = {
43 { .compatible = "ti,pcm3168a", },
46 MODULE_DEVICE_TABLE(of, pcm3168a_of_match);
48 static struct spi_driver pcm3168a_spi_driver = {
49 .probe = pcm3168a_spi_probe,
50 .remove = pcm3168a_spi_remove,
51 .id_table = pcm3168a_spi_id,
54 .of_match_table = pcm3168a_of_match,
55 .pm = &pcm3168a_pm_ops,
58 module_spi_driver(pcm3168a_spi_driver);
60 MODULE_DESCRIPTION("PCM3168A SPI codec driver");
61 MODULE_AUTHOR("Damien Horsley <Damien.Horsley@imgtec.com>");
62 MODULE_LICENSE("GPL v2");