pcm1681.c (16695971bec3b8b2398f7ab8dfa4c5a22bfcf95d) pcm1681.c (b9281f99e30f795f28f6ea216289900b6e870d01)
1/*
2 * PCM1681 ASoC codec driver
3 *
4 * Copyright (c) StreamUnlimited GmbH 2013
5 * Marek Belisko <marek.belisko@streamunlimited.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License

--- 192 unchanged lines hidden (view full) ---

201}
202
203static const struct snd_soc_dai_ops pcm1681_dai_ops = {
204 .set_fmt = pcm1681_set_dai_fmt,
205 .hw_params = pcm1681_hw_params,
206 .digital_mute = pcm1681_digital_mute,
207};
208
1/*
2 * PCM1681 ASoC codec driver
3 *
4 * Copyright (c) StreamUnlimited GmbH 2013
5 * Marek Belisko <marek.belisko@streamunlimited.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License

--- 192 unchanged lines hidden (view full) ---

201}
202
203static const struct snd_soc_dai_ops pcm1681_dai_ops = {
204 .set_fmt = pcm1681_set_dai_fmt,
205 .hw_params = pcm1681_hw_params,
206 .digital_mute = pcm1681_digital_mute,
207};
208
209static const struct snd_soc_dapm_widget pcm1681_dapm_widgets[] = {
210SND_SOC_DAPM_OUTPUT("VOUT1"),
211SND_SOC_DAPM_OUTPUT("VOUT2"),
212SND_SOC_DAPM_OUTPUT("VOUT3"),
213SND_SOC_DAPM_OUTPUT("VOUT4"),
214SND_SOC_DAPM_OUTPUT("VOUT5"),
215SND_SOC_DAPM_OUTPUT("VOUT6"),
216SND_SOC_DAPM_OUTPUT("VOUT7"),
217SND_SOC_DAPM_OUTPUT("VOUT8"),
218};
219
220static const struct snd_soc_dapm_route pcm1681_dapm_routes[] = {
221 { "VOUT1", NULL, "Playback" },
222 { "VOUT2", NULL, "Playback" },
223 { "VOUT3", NULL, "Playback" },
224 { "VOUT4", NULL, "Playback" },
225 { "VOUT5", NULL, "Playback" },
226 { "VOUT6", NULL, "Playback" },
227 { "VOUT7", NULL, "Playback" },
228 { "VOUT8", NULL, "Playback" },
229};
230
209static const DECLARE_TLV_DB_SCALE(pcm1681_dac_tlv, -6350, 50, 1);
210
211static const struct snd_kcontrol_new pcm1681_controls[] = {
212 SOC_DOUBLE_R_TLV("Channel 1/2 Playback Volume",
213 PCM1681_ATT_CONTROL(1), PCM1681_ATT_CONTROL(2), 0,
214 0x7f, 0, pcm1681_dac_tlv),
215 SOC_DOUBLE_R_TLV("Channel 3/4 Playback Volume",
216 PCM1681_ATT_CONTROL(3), PCM1681_ATT_CONTROL(4), 0,

--- 36 unchanged lines hidden (view full) ---

253 .num_reg_defaults = ARRAY_SIZE(pcm1681_reg_defaults),
254 .writeable_reg = pcm1681_writeable_reg,
255 .readable_reg = pcm1681_accessible_reg,
256};
257
258static struct snd_soc_codec_driver soc_codec_dev_pcm1681 = {
259 .controls = pcm1681_controls,
260 .num_controls = ARRAY_SIZE(pcm1681_controls),
231static const DECLARE_TLV_DB_SCALE(pcm1681_dac_tlv, -6350, 50, 1);
232
233static const struct snd_kcontrol_new pcm1681_controls[] = {
234 SOC_DOUBLE_R_TLV("Channel 1/2 Playback Volume",
235 PCM1681_ATT_CONTROL(1), PCM1681_ATT_CONTROL(2), 0,
236 0x7f, 0, pcm1681_dac_tlv),
237 SOC_DOUBLE_R_TLV("Channel 3/4 Playback Volume",
238 PCM1681_ATT_CONTROL(3), PCM1681_ATT_CONTROL(4), 0,

--- 36 unchanged lines hidden (view full) ---

275 .num_reg_defaults = ARRAY_SIZE(pcm1681_reg_defaults),
276 .writeable_reg = pcm1681_writeable_reg,
277 .readable_reg = pcm1681_accessible_reg,
278};
279
280static struct snd_soc_codec_driver soc_codec_dev_pcm1681 = {
281 .controls = pcm1681_controls,
282 .num_controls = ARRAY_SIZE(pcm1681_controls),
283 .dapm_widgets = pcm1681_dapm_widgets,
284 .num_dapm_widgets = ARRAY_SIZE(pcm1681_dapm_widgets),
285 .dapm_routes = pcm1681_dapm_routes,
286 .num_dapm_routes = ARRAY_SIZE(pcm1681_dapm_routes),
261};
262
263static const struct i2c_device_id pcm1681_i2c_id[] = {
264 {"pcm1681", 0},
265 {}
266};
267MODULE_DEVICE_TABLE(i2c, pcm1681_i2c_id);
268

--- 45 unchanged lines hidden ---
287};
288
289static const struct i2c_device_id pcm1681_i2c_id[] = {
290 {"pcm1681", 0},
291 {}
292};
293MODULE_DEVICE_TABLE(i2c, pcm1681_i2c_id);
294

--- 45 unchanged lines hidden ---