1 // SPDX-License-Identifier: GPL-2.0 2 // 3 // Driver for SRC4XXX codecs 4 // 5 // Copyright 2021-2022 Deqx Pty Ltd 6 // Author: Matt Flax <flatmax@flatmax.com> 7 8 #include <linux/i2c.h> 9 #include <linux/mod_devicetable.h> 10 #include <linux/module.h> 11 #include <linux/regmap.h> 12 13 #include "src4xxx.h" 14 15 static int src4xxx_i2c_probe(struct i2c_client *i2c, 16 const struct i2c_device_id *id) 17 { 18 return src4xxx_probe(&i2c->dev, 19 devm_regmap_init_i2c(i2c, &src4xxx_regmap_config), NULL); 20 } 21 22 static const struct i2c_device_id src4xxx_i2c_ids[] = { 23 { "src4392", 0 }, 24 { } 25 }; 26 MODULE_DEVICE_TABLE(i2c, src4xxx_i2c_ids); 27 28 static const struct of_device_id src4xxx_of_match[] = { 29 { .compatible = "ti,src4392", }, 30 { } 31 }; 32 MODULE_DEVICE_TABLE(of, src4xxx_of_match); 33 34 35 static struct i2c_driver src4xxx_i2c_driver = { 36 .driver = { 37 .name = "src4xxx", 38 .of_match_table = of_match_ptr(src4xxx_of_match), 39 }, 40 .probe = src4xxx_i2c_probe, 41 .id_table = src4xxx_i2c_ids, 42 }; 43 module_i2c_driver(src4xxx_i2c_driver); 44 45 MODULE_DESCRIPTION("ASoC SRC4392 CODEC I2C driver"); 46 MODULE_AUTHOR("Matt Flax <flatmax@flatmax.com>"); 47 MODULE_LICENSE("GPL"); 48