cx20442.c (99bdc3880c611c7f2061fbd5372ef81b40217e26) cx20442.c (51fb1a8704f6bccfcf5248f9edc2751c272fbdf2)
1/*
2 * cx20442.c -- CX20442 ALSA Soc Audio driver
3 *
4 * Copyright 2009 Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
5 *
6 * Initially based on sound/soc/codecs/wm8400.c
7 * Copyright 2008, 2009 Wolfson Microelectronics PLC.
8 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>

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

81 {"Input Mixer", NULL, "MIC Bias"},
82
83 {"TELIN Bias", NULL, "TELIN"},
84 {"Input Mixer", NULL, "TELIN Bias"},
85
86 {"ADC", NULL, "Input Mixer"},
87};
88
1/*
2 * cx20442.c -- CX20442 ALSA Soc Audio driver
3 *
4 * Copyright 2009 Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
5 *
6 * Initially based on sound/soc/codecs/wm8400.c
7 * Copyright 2008, 2009 Wolfson Microelectronics PLC.
8 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>

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

81 {"Input Mixer", NULL, "MIC Bias"},
82
83 {"TELIN Bias", NULL, "TELIN"},
84 {"Input Mixer", NULL, "TELIN Bias"},
85
86 {"ADC", NULL, "Input Mixer"},
87};
88
89static int cx20442_add_widgets(struct snd_soc_codec *codec)
90{
91 struct snd_soc_dapm_context *dapm = &codec->dapm;
92
93 snd_soc_dapm_new_controls(dapm, cx20442_dapm_widgets,
94 ARRAY_SIZE(cx20442_dapm_widgets));
95 snd_soc_dapm_add_routes(dapm, cx20442_audio_map,
96 ARRAY_SIZE(cx20442_audio_map));
97
98 return 0;
99}
100
101static unsigned int cx20442_read_reg_cache(struct snd_soc_codec *codec,
102 unsigned int reg)
103{
104 u8 *reg_cache = codec->reg_cache;
105
106 if (reg >= codec->driver->reg_cache_size)
107 return -EINVAL;
108

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

339{
340 struct cx20442_priv *cx20442;
341
342 cx20442 = kzalloc(sizeof(struct cx20442_priv), GFP_KERNEL);
343 if (cx20442 == NULL)
344 return -ENOMEM;
345 snd_soc_codec_set_drvdata(codec, cx20442);
346
89static unsigned int cx20442_read_reg_cache(struct snd_soc_codec *codec,
90 unsigned int reg)
91{
92 u8 *reg_cache = codec->reg_cache;
93
94 if (reg >= codec->driver->reg_cache_size)
95 return -EINVAL;
96

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

327{
328 struct cx20442_priv *cx20442;
329
330 cx20442 = kzalloc(sizeof(struct cx20442_priv), GFP_KERNEL);
331 if (cx20442 == NULL)
332 return -ENOMEM;
333 snd_soc_codec_set_drvdata(codec, cx20442);
334
347 cx20442_add_widgets(codec);
348
349 cx20442->control_data = NULL;
350 codec->hw_write = NULL;
351 codec->card->pop_time = 0;
352
353 return 0;
354}
355
356/* power down chip */

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

372static struct snd_soc_codec_driver cx20442_codec_dev = {
373 .probe = cx20442_codec_probe,
374 .remove = cx20442_codec_remove,
375 .reg_cache_default = &cx20442_reg,
376 .reg_cache_size = 1,
377 .reg_word_size = sizeof(u8),
378 .read = cx20442_read_reg_cache,
379 .write = cx20442_write,
335 cx20442->control_data = NULL;
336 codec->hw_write = NULL;
337 codec->card->pop_time = 0;
338
339 return 0;
340}
341
342/* power down chip */

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

358static struct snd_soc_codec_driver cx20442_codec_dev = {
359 .probe = cx20442_codec_probe,
360 .remove = cx20442_codec_remove,
361 .reg_cache_default = &cx20442_reg,
362 .reg_cache_size = 1,
363 .reg_word_size = sizeof(u8),
364 .read = cx20442_read_reg_cache,
365 .write = cx20442_write,
366 .dapm_widgets = cx20442_dapm_widgets,
367 .num_dapm_widgets = ARRAY_SIZE(cx20442_dapm_widgets),
368 .dapm_routes = cx20442_audio_map,
369 .num_dapm_routes = ARRAY_SIZE(cx20442_audio_map),
380};
381
382static int cx20442_platform_probe(struct platform_device *pdev)
383{
384 return snd_soc_register_codec(&pdev->dev,
385 &cx20442_codec_dev, &cx20442_dai, 1);
386}
387

--- 31 unchanged lines hidden ---
370};
371
372static int cx20442_platform_probe(struct platform_device *pdev)
373{
374 return snd_soc_register_codec(&pdev->dev,
375 &cx20442_codec_dev, &cx20442_dai, 1);
376}
377

--- 31 unchanged lines hidden ---