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>
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
);
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
);
40 static const struct i2c_device_id pcm3168a_i2c_id
[] = {
44 MODULE_DEVICE_TABLE(i2c
, pcm3168a_i2c_id
);
46 static const struct of_device_id pcm3168a_of_match
[] = {
47 { .compatible
= "ti,pcm3168a", },
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
,
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");