1*a9b17a63SDamien.Horsley /* 2*a9b17a63SDamien.Horsley * PCM3168A codec i2c driver 3*a9b17a63SDamien.Horsley * 4*a9b17a63SDamien.Horsley * Copyright (C) 2015 Imagination Technologies Ltd. 5*a9b17a63SDamien.Horsley * 6*a9b17a63SDamien.Horsley * Author: Damien Horsley <Damien.Horsley@imgtec.com> 7*a9b17a63SDamien.Horsley * 8*a9b17a63SDamien.Horsley * This program is free software; you can redistribute it and/or modify it 9*a9b17a63SDamien.Horsley * under the terms and conditions of the GNU General Public License, 10*a9b17a63SDamien.Horsley * version 2, as published by the Free Software Foundation. 11*a9b17a63SDamien.Horsley */ 12*a9b17a63SDamien.Horsley 13*a9b17a63SDamien.Horsley #include <linux/i2c.h> 14*a9b17a63SDamien.Horsley #include <linux/init.h> 15*a9b17a63SDamien.Horsley #include <linux/module.h> 16*a9b17a63SDamien.Horsley 17*a9b17a63SDamien.Horsley #include <sound/soc.h> 18*a9b17a63SDamien.Horsley 19*a9b17a63SDamien.Horsley #include "pcm3168a.h" 20*a9b17a63SDamien.Horsley 21*a9b17a63SDamien.Horsley static int pcm3168a_i2c_probe(struct i2c_client *i2c, 22*a9b17a63SDamien.Horsley const struct i2c_device_id *id) 23*a9b17a63SDamien.Horsley { 24*a9b17a63SDamien.Horsley struct regmap *regmap; 25*a9b17a63SDamien.Horsley 26*a9b17a63SDamien.Horsley regmap = devm_regmap_init_i2c(i2c, &pcm3168a_regmap); 27*a9b17a63SDamien.Horsley if (IS_ERR(regmap)) 28*a9b17a63SDamien.Horsley return PTR_ERR(regmap); 29*a9b17a63SDamien.Horsley 30*a9b17a63SDamien.Horsley return pcm3168a_probe(&i2c->dev, regmap); 31*a9b17a63SDamien.Horsley } 32*a9b17a63SDamien.Horsley 33*a9b17a63SDamien.Horsley static int pcm3168a_i2c_remove(struct i2c_client *i2c) 34*a9b17a63SDamien.Horsley { 35*a9b17a63SDamien.Horsley pcm3168a_remove(&i2c->dev); 36*a9b17a63SDamien.Horsley 37*a9b17a63SDamien.Horsley return 0; 38*a9b17a63SDamien.Horsley } 39*a9b17a63SDamien.Horsley 40*a9b17a63SDamien.Horsley static const struct i2c_device_id pcm3168a_i2c_id[] = { 41*a9b17a63SDamien.Horsley { "pcm3168a", }, 42*a9b17a63SDamien.Horsley { } 43*a9b17a63SDamien.Horsley }; 44*a9b17a63SDamien.Horsley MODULE_DEVICE_TABLE(i2c, pcm3168a_i2c_id); 45*a9b17a63SDamien.Horsley 46*a9b17a63SDamien.Horsley static const struct of_device_id pcm3168a_of_match[] = { 47*a9b17a63SDamien.Horsley { .compatible = "ti,pcm3168a", }, 48*a9b17a63SDamien.Horsley { } 49*a9b17a63SDamien.Horsley }; 50*a9b17a63SDamien.Horsley MODULE_DEVICE_TABLE(of, pcm3168a_of_match); 51*a9b17a63SDamien.Horsley 52*a9b17a63SDamien.Horsley static struct i2c_driver pcm3168a_i2c_driver = { 53*a9b17a63SDamien.Horsley .probe = pcm3168a_i2c_probe, 54*a9b17a63SDamien.Horsley .remove = pcm3168a_i2c_remove, 55*a9b17a63SDamien.Horsley .id_table = pcm3168a_i2c_id, 56*a9b17a63SDamien.Horsley .driver = { 57*a9b17a63SDamien.Horsley .name = "pcm3168a", 58*a9b17a63SDamien.Horsley .of_match_table = pcm3168a_of_match, 59*a9b17a63SDamien.Horsley .pm = &pcm3168a_pm_ops, 60*a9b17a63SDamien.Horsley }, 61*a9b17a63SDamien.Horsley }; 62*a9b17a63SDamien.Horsley module_i2c_driver(pcm3168a_i2c_driver); 63*a9b17a63SDamien.Horsley 64*a9b17a63SDamien.Horsley MODULE_DESCRIPTION("PCM3168A I2C codec driver"); 65*a9b17a63SDamien.Horsley MODULE_AUTHOR("Damien Horsley <Damien.Horsley@imgtec.com>"); 66*a9b17a63SDamien.Horsley MODULE_LICENSE("GPL v2"); 67