lm4857.c (bf61c8840efe60fd8f91446860b63338fb424158) | lm4857.c (07ccc0f4f190070aaba8fb587307f7fefad97981) |
---|---|
1/* 2 * LM4857 AMP driver 3 * 4 * Copyright 2007 Wolfson Microelectronics PLC. 5 * Author: Graeme Gregory 6 * graeme.gregory@wolfsonmicro.com 7 * Copyright 2011 Lars-Peter Clausen <lars@metafoo.de> 8 * --- 160 unchanged lines hidden (view full) --- 169 {"LS", NULL, "IN"}, 170 {"HP", NULL, "IN"}, 171 {"EP", NULL, "IN"}, 172}; 173 174static int lm4857_probe(struct snd_soc_codec *codec) 175{ 176 struct lm4857 *lm4857 = snd_soc_codec_get_drvdata(codec); | 1/* 2 * LM4857 AMP driver 3 * 4 * Copyright 2007 Wolfson Microelectronics PLC. 5 * Author: Graeme Gregory 6 * graeme.gregory@wolfsonmicro.com 7 * Copyright 2011 Lars-Peter Clausen <lars@metafoo.de> 8 * --- 160 unchanged lines hidden (view full) --- 169 {"LS", NULL, "IN"}, 170 {"HP", NULL, "IN"}, 171 {"EP", NULL, "IN"}, 172}; 173 174static int lm4857_probe(struct snd_soc_codec *codec) 175{ 176 struct lm4857 *lm4857 = snd_soc_codec_get_drvdata(codec); |
177 struct snd_soc_dapm_context *dapm = &codec->dapm; 178 int ret; | |
179 180 codec->control_data = lm4857->i2c; 181 | 177 178 codec->control_data = lm4857->i2c; 179 |
182 ret = snd_soc_add_codec_controls(codec, lm4857_controls, 183 ARRAY_SIZE(lm4857_controls)); 184 if (ret) 185 return ret; 186 187 ret = snd_soc_dapm_new_controls(dapm, lm4857_dapm_widgets, 188 ARRAY_SIZE(lm4857_dapm_widgets)); 189 if (ret) 190 return ret; 191 192 ret = snd_soc_dapm_add_routes(dapm, lm4857_routes, 193 ARRAY_SIZE(lm4857_routes)); 194 if (ret) 195 return ret; 196 197 snd_soc_dapm_new_widgets(dapm); 198 | |
199 return 0; 200} 201 202static struct snd_soc_codec_driver soc_codec_dev_lm4857 = { 203 .write = lm4857_write, 204 .read = lm4857_read, 205 .probe = lm4857_probe, 206 .reg_cache_size = ARRAY_SIZE(lm4857_default_regs), 207 .reg_word_size = sizeof(uint8_t), 208 .reg_cache_default = lm4857_default_regs, 209 .set_bias_level = lm4857_set_bias_level, | 180 return 0; 181} 182 183static struct snd_soc_codec_driver soc_codec_dev_lm4857 = { 184 .write = lm4857_write, 185 .read = lm4857_read, 186 .probe = lm4857_probe, 187 .reg_cache_size = ARRAY_SIZE(lm4857_default_regs), 188 .reg_word_size = sizeof(uint8_t), 189 .reg_cache_default = lm4857_default_regs, 190 .set_bias_level = lm4857_set_bias_level, |
191 192 .controls = lm4857_controls, 193 .num_controls = ARRAY_SIZE(lm4857_controls), 194 .dapm_widgets = lm4857_dapm_widgets, 195 .num_dapm_widgets = ARRAY_SIZE(lm4857_dapm_widgets), 196 .dapm_routes = lm4857_routes, 197 .num_dapm_routes = ARRAY_SIZE(lm4857_routes), |
|
210}; 211 212static int lm4857_i2c_probe(struct i2c_client *i2c, 213 const struct i2c_device_id *id) 214{ 215 struct lm4857 *lm4857; 216 int ret; 217 --- 40 unchanged lines hidden --- | 198}; 199 200static int lm4857_i2c_probe(struct i2c_client *i2c, 201 const struct i2c_device_id *id) 202{ 203 struct lm4857 *lm4857; 204 int ret; 205 --- 40 unchanged lines hidden --- |