1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2018 Kirill Marinushkin <kmarinushkin@birdec.tech>
8 #include <linux/module.h>
9 #include <linux/spi/spi.h>
10 #include <sound/soc.h>
14 static int pcm3060_spi_probe(struct spi_device *spi)
16 struct pcm3060_priv *priv;
18 priv = devm_kzalloc(&spi->dev, sizeof(*priv), GFP_KERNEL);
22 spi_set_drvdata(spi, priv);
24 priv->regmap = devm_regmap_init_spi(spi, &pcm3060_regmap);
25 if (IS_ERR(priv->regmap))
26 return PTR_ERR(priv->regmap);
28 return pcm3060_probe(&spi->dev);
31 static const struct spi_device_id pcm3060_spi_id[] = {
32 { .name = "pcm3060" },
35 MODULE_DEVICE_TABLE(spi, pcm3060_spi_id);
38 static const struct of_device_id pcm3060_of_match[] = {
39 { .compatible = "ti,pcm3060" },
42 MODULE_DEVICE_TABLE(of, pcm3060_of_match);
43 #endif /* CONFIG_OF */
45 static struct spi_driver pcm3060_spi_driver = {
49 .of_match_table = pcm3060_of_match,
50 #endif /* CONFIG_OF */
52 .id_table = pcm3060_spi_id,
53 .probe = pcm3060_spi_probe,
56 module_spi_driver(pcm3060_spi_driver);
58 MODULE_DESCRIPTION("PCM3060 SPI driver");
59 MODULE_AUTHOR("Kirill Marinushkin <kmarinushkin@birdec.tech>");
60 MODULE_LICENSE("GPL v2");