14e6bedd3SMatt Flax // SPDX-License-Identifier: GPL-2.0 24e6bedd3SMatt Flax // 34e6bedd3SMatt Flax // Driver for SRC4XXX codecs 44e6bedd3SMatt Flax // 54e6bedd3SMatt Flax // Copyright 2021-2022 Deqx Pty Ltd 64e6bedd3SMatt Flax // Author: Matt Flax <flatmax@flatmax.com> 74e6bedd3SMatt Flax 84e6bedd3SMatt Flax #include <linux/i2c.h> 94e6bedd3SMatt Flax #include <linux/mod_devicetable.h> 104e6bedd3SMatt Flax #include <linux/module.h> 114e6bedd3SMatt Flax #include <linux/regmap.h> 124e6bedd3SMatt Flax 134e6bedd3SMatt Flax #include "src4xxx.h" 144e6bedd3SMatt Flax 15830a35aaSUwe Kleine-König static int src4xxx_i2c_probe(struct i2c_client *i2c) 164e6bedd3SMatt Flax { 174e6bedd3SMatt Flax return src4xxx_probe(&i2c->dev, 184e6bedd3SMatt Flax devm_regmap_init_i2c(i2c, &src4xxx_regmap_config), NULL); 194e6bedd3SMatt Flax } 204e6bedd3SMatt Flax 214e6bedd3SMatt Flax static const struct i2c_device_id src4xxx_i2c_ids[] = { 224e6bedd3SMatt Flax { "src4392", 0 }, 234e6bedd3SMatt Flax { } 244e6bedd3SMatt Flax }; 254e6bedd3SMatt Flax MODULE_DEVICE_TABLE(i2c, src4xxx_i2c_ids); 264e6bedd3SMatt Flax 27*075a430dSKrzysztof Kozlowski static const struct of_device_id src4xxx_of_match[] __maybe_unused = { 284e6bedd3SMatt Flax { .compatible = "ti,src4392", }, 294e6bedd3SMatt Flax { } 304e6bedd3SMatt Flax }; 314e6bedd3SMatt Flax MODULE_DEVICE_TABLE(of, src4xxx_of_match); 324e6bedd3SMatt Flax 334e6bedd3SMatt Flax 344e6bedd3SMatt Flax static struct i2c_driver src4xxx_i2c_driver = { 354e6bedd3SMatt Flax .driver = { 364e6bedd3SMatt Flax .name = "src4xxx", 374e6bedd3SMatt Flax .of_match_table = of_match_ptr(src4xxx_of_match), 384e6bedd3SMatt Flax }, 39830a35aaSUwe Kleine-König .probe_new = src4xxx_i2c_probe, 404e6bedd3SMatt Flax .id_table = src4xxx_i2c_ids, 414e6bedd3SMatt Flax }; 424e6bedd3SMatt Flax module_i2c_driver(src4xxx_i2c_driver); 434e6bedd3SMatt Flax 444e6bedd3SMatt Flax MODULE_DESCRIPTION("ASoC SRC4392 CODEC I2C driver"); 454e6bedd3SMatt Flax MODULE_AUTHOR("Matt Flax <flatmax@flatmax.com>"); 464e6bedd3SMatt Flax MODULE_LICENSE("GPL"); 47