media: v4l: rcar_fdp1: Change platform dependency to ARCH_RENESAS
[linux/fpc-iii.git] / sound / soc / codecs / pcm3168a-i2c.c
blob6feb0901dfeba0e516cb1c519139f3a5cfcd5cc5
1 /*
2 * PCM3168A codec i2c 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/i2c.h>
14 #include <linux/init.h>
15 #include <linux/module.h>
17 #include <sound/soc.h>
19 #include "pcm3168a.h"
21 static int pcm3168a_i2c_probe(struct i2c_client *i2c,
22 const struct i2c_device_id *id)
24 struct regmap *regmap;
26 regmap = devm_regmap_init_i2c(i2c, &pcm3168a_regmap);
27 if (IS_ERR(regmap))
28 return PTR_ERR(regmap);
30 return pcm3168a_probe(&i2c->dev, regmap);
33 static int pcm3168a_i2c_remove(struct i2c_client *i2c)
35 pcm3168a_remove(&i2c->dev);
37 return 0;
40 static const struct i2c_device_id pcm3168a_i2c_id[] = {
41 { "pcm3168a", },
42 { }
44 MODULE_DEVICE_TABLE(i2c, pcm3168a_i2c_id);
46 static const struct of_device_id pcm3168a_of_match[] = {
47 { .compatible = "ti,pcm3168a", },
48 { }
50 MODULE_DEVICE_TABLE(of, pcm3168a_of_match);
52 static struct i2c_driver pcm3168a_i2c_driver = {
53 .probe = pcm3168a_i2c_probe,
54 .remove = pcm3168a_i2c_remove,
55 .id_table = pcm3168a_i2c_id,
56 .driver = {
57 .name = "pcm3168a",
58 .of_match_table = pcm3168a_of_match,
59 .pm = &pcm3168a_pm_ops,
62 module_i2c_driver(pcm3168a_i2c_driver);
64 MODULE_DESCRIPTION("PCM3168A I2C codec driver");
65 MODULE_AUTHOR("Damien Horsley <Damien.Horsley@imgtec.com>");
66 MODULE_LICENSE("GPL v2");