Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * PCM3168A codec spi driver
0004  *
0005  * Copyright (C) 2015 Imagination Technologies Ltd.
0006  *
0007  * Author: Damien Horsley <Damien.Horsley@imgtec.com>
0008  */
0009 
0010 #include <linux/init.h>
0011 #include <linux/module.h>
0012 #include <linux/spi/spi.h>
0013 
0014 #include <sound/soc.h>
0015 
0016 #include "pcm3168a.h"
0017 
0018 static int pcm3168a_spi_probe(struct spi_device *spi)
0019 {
0020     struct regmap *regmap;
0021 
0022     regmap = devm_regmap_init_spi(spi, &pcm3168a_regmap);
0023     if (IS_ERR(regmap))
0024         return PTR_ERR(regmap);
0025 
0026     return pcm3168a_probe(&spi->dev, regmap);
0027 }
0028 
0029 static void pcm3168a_spi_remove(struct spi_device *spi)
0030 {
0031     pcm3168a_remove(&spi->dev);
0032 }
0033 
0034 static const struct spi_device_id pcm3168a_spi_id[] = {
0035     { "pcm3168a", },
0036     { },
0037 };
0038 MODULE_DEVICE_TABLE(spi, pcm3168a_spi_id);
0039 
0040 static const struct of_device_id pcm3168a_of_match[] = {
0041     { .compatible = "ti,pcm3168a", },
0042     { }
0043 };
0044 MODULE_DEVICE_TABLE(of, pcm3168a_of_match);
0045 
0046 static struct spi_driver pcm3168a_spi_driver = {
0047     .probe      = pcm3168a_spi_probe,
0048     .remove     = pcm3168a_spi_remove,
0049     .id_table   = pcm3168a_spi_id,
0050     .driver = {
0051         .name   = "pcm3168a",
0052         .of_match_table = pcm3168a_of_match,
0053         .pm     = &pcm3168a_pm_ops,
0054     },
0055 };
0056 module_spi_driver(pcm3168a_spi_driver);
0057 
0058 MODULE_DESCRIPTION("PCM3168A SPI codec driver");
0059 MODULE_AUTHOR("Damien Horsley <Damien.Horsley@imgtec.com>");
0060 MODULE_LICENSE("GPL v2");