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