Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * CS4271 I2C audio driver
0004  *
0005  * Copyright (c) 2010 Alexander Sverdlin <subaparts@yandex.ru>
0006  */
0007 
0008 #include <linux/module.h>
0009 #include <linux/i2c.h>
0010 #include <linux/regmap.h>
0011 #include <sound/soc.h>
0012 #include "cs4271.h"
0013 
0014 static int cs4271_i2c_probe(struct i2c_client *client)
0015 {
0016     struct regmap_config config;
0017 
0018     config = cs4271_regmap_config;
0019     config.reg_bits = 8;
0020     config.val_bits = 8;
0021 
0022     return cs4271_probe(&client->dev,
0023                 devm_regmap_init_i2c(client, &config));
0024 }
0025 
0026 static const struct i2c_device_id cs4271_i2c_id[] = {
0027     { "cs4271", 0 },
0028     { }
0029 };
0030 MODULE_DEVICE_TABLE(i2c, cs4271_i2c_id);
0031 
0032 static struct i2c_driver cs4271_i2c_driver = {
0033     .driver = {
0034         .name = "cs4271",
0035         .of_match_table = of_match_ptr(cs4271_dt_ids),
0036     },
0037     .probe_new = cs4271_i2c_probe,
0038     .id_table = cs4271_i2c_id,
0039 };
0040 module_i2c_driver(cs4271_i2c_driver);
0041 
0042 MODULE_DESCRIPTION("ASoC CS4271 I2C Driver");
0043 MODULE_AUTHOR("Alexander Sverdlin <subaparts@yandex.ru>");
0044 MODULE_LICENSE("GPL");