blob: 0a174236f5730db37bf3b05002b0cf54a4295f72 [file] [log] [blame]
Thomas Gleixnerc942fdd2019-05-27 08:55:06 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Axel Linc973b8a2014-10-06 23:09:47 +08002/*
3 * CS4271 I2C audio driver
4 *
5 * Copyright (c) 2010 Alexander Sverdlin <subaparts@yandex.ru>
Axel Linc973b8a2014-10-06 23:09:47 +08006 */
7
8#include <linux/module.h>
9#include <linux/i2c.h>
10#include <linux/regmap.h>
11#include <sound/soc.h>
12#include "cs4271.h"
13
14static int cs4271_i2c_probe(struct i2c_client *client,
15 const struct i2c_device_id *id)
16{
17 struct regmap_config config;
18
19 config = cs4271_regmap_config;
20 config.reg_bits = 8;
21 config.val_bits = 8;
22
23 return cs4271_probe(&client->dev,
24 devm_regmap_init_i2c(client, &config));
25}
26
Axel Linc973b8a2014-10-06 23:09:47 +080027static const struct i2c_device_id cs4271_i2c_id[] = {
28 { "cs4271", 0 },
29 { }
30};
31MODULE_DEVICE_TABLE(i2c, cs4271_i2c_id);
32
33static struct i2c_driver cs4271_i2c_driver = {
34 .driver = {
35 .name = "cs4271",
Axel Linc973b8a2014-10-06 23:09:47 +080036 .of_match_table = of_match_ptr(cs4271_dt_ids),
37 },
38 .probe = cs4271_i2c_probe,
Axel Linc973b8a2014-10-06 23:09:47 +080039 .id_table = cs4271_i2c_id,
40};
41module_i2c_driver(cs4271_i2c_driver);
42
43MODULE_DESCRIPTION("ASoC CS4271 I2C Driver");
44MODULE_AUTHOR("Alexander Sverdlin <subaparts@yandex.ru>");
45MODULE_LICENSE("GPL");