175a6faf6SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only 2a9b17a63SDamien.Horsley /* 3a9b17a63SDamien.Horsley * PCM3168A codec i2c driver 4a9b17a63SDamien.Horsley * 5a9b17a63SDamien.Horsley * Copyright (C) 2015 Imagination Technologies Ltd. 6a9b17a63SDamien.Horsley * 7a9b17a63SDamien.Horsley * Author: Damien Horsley <Damien.Horsley@imgtec.com> 8a9b17a63SDamien.Horsley */ 9a9b17a63SDamien.Horsley 10a9b17a63SDamien.Horsley #include <linux/i2c.h> 11a9b17a63SDamien.Horsley #include <linux/init.h> 12a9b17a63SDamien.Horsley #include <linux/module.h> 13a9b17a63SDamien.Horsley 14a9b17a63SDamien.Horsley #include <sound/soc.h> 15a9b17a63SDamien.Horsley 16a9b17a63SDamien.Horsley #include "pcm3168a.h" 17a9b17a63SDamien.Horsley 187f7d7214SStephen Kitt static int pcm3168a_i2c_probe(struct i2c_client *i2c) 19a9b17a63SDamien.Horsley { 20a9b17a63SDamien.Horsley struct regmap *regmap; 21a9b17a63SDamien.Horsley 22a9b17a63SDamien.Horsley regmap = devm_regmap_init_i2c(i2c, &pcm3168a_regmap); 23a9b17a63SDamien.Horsley if (IS_ERR(regmap)) 24a9b17a63SDamien.Horsley return PTR_ERR(regmap); 25a9b17a63SDamien.Horsley 26a9b17a63SDamien.Horsley return pcm3168a_probe(&i2c->dev, regmap); 27a9b17a63SDamien.Horsley } 28a9b17a63SDamien.Horsley 29ed5c2f5fSUwe Kleine-König static void pcm3168a_i2c_remove(struct i2c_client *i2c) 30a9b17a63SDamien.Horsley { 31a9b17a63SDamien.Horsley pcm3168a_remove(&i2c->dev); 32a9b17a63SDamien.Horsley } 33a9b17a63SDamien.Horsley 34a9b17a63SDamien.Horsley static const struct i2c_device_id pcm3168a_i2c_id[] = { 35a9b17a63SDamien.Horsley { "pcm3168a", }, 36a9b17a63SDamien.Horsley { } 37a9b17a63SDamien.Horsley }; 38a9b17a63SDamien.Horsley MODULE_DEVICE_TABLE(i2c, pcm3168a_i2c_id); 39a9b17a63SDamien.Horsley 40a9b17a63SDamien.Horsley static const struct of_device_id pcm3168a_of_match[] = { 41a9b17a63SDamien.Horsley { .compatible = "ti,pcm3168a", }, 42a9b17a63SDamien.Horsley { } 43a9b17a63SDamien.Horsley }; 44a9b17a63SDamien.Horsley MODULE_DEVICE_TABLE(of, pcm3168a_of_match); 45a9b17a63SDamien.Horsley 46a9b17a63SDamien.Horsley static struct i2c_driver pcm3168a_i2c_driver = { 47*9abcd240SUwe Kleine-König .probe = pcm3168a_i2c_probe, 48a9b17a63SDamien.Horsley .remove = pcm3168a_i2c_remove, 49a9b17a63SDamien.Horsley .id_table = pcm3168a_i2c_id, 50a9b17a63SDamien.Horsley .driver = { 51a9b17a63SDamien.Horsley .name = "pcm3168a", 52a9b17a63SDamien.Horsley .of_match_table = pcm3168a_of_match, 53a9b17a63SDamien.Horsley .pm = &pcm3168a_pm_ops, 54a9b17a63SDamien.Horsley }, 55a9b17a63SDamien.Horsley }; 56a9b17a63SDamien.Horsley module_i2c_driver(pcm3168a_i2c_driver); 57a9b17a63SDamien.Horsley 58a9b17a63SDamien.Horsley MODULE_DESCRIPTION("PCM3168A I2C codec driver"); 59a9b17a63SDamien.Horsley MODULE_AUTHOR("Damien Horsley <Damien.Horsley@imgtec.com>"); 60a9b17a63SDamien.Horsley MODULE_LICENSE("GPL v2"); 61