12 #include <linux/module.h>
13 #include <linux/i2c.h>
14 #include <linux/slab.h>
25 #define MAX9768_CTRL 3
28 #define MAX9768_CTRL_PWM 0x15
29 #define MAX9768_CTRL_FILTERLESS 0x16
38 static struct reg_default max9768_default_regs[] = {
43 static int max9768_get_gpio(
struct snd_kcontrol *kcontrol,
50 ucontrol->
value.integer.value[0] = !
val;
55 static int max9768_set_gpio(
struct snd_kcontrol *kcontrol,
66 static const unsigned int volume_tlv[] = {
148 .probe = max9768_probe,
149 .controls = max9768_volume,
153 static const struct regmap_config max9768_i2c_regmap_config = {
157 .reg_defaults = max9768_default_regs,
158 .num_reg_defaults =
ARRAY_SIZE(max9768_default_regs),
165 struct max9768 *max9768;
188 i2c_set_clientdata(client, max9768);
191 if (IS_ERR(max9768->
regmap)) {
192 err = PTR_ERR(max9768->
regmap);
198 goto err_regmap_free;
215 struct max9768 *max9768 = i2c_get_clientdata(client);
234 static struct i2c_driver max9768_i2c_driver = {
239 .probe = max9768_i2c_probe,
241 .id_table = max9768_i2c_id,