diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-10-27 12:43:40 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-10-27 12:43:40 +0400 |
commit | bb14eb0da72afb69be261b28ec858cbd5a35e089 (patch) | |
tree | fa72a87d21e506c990b63657d782936311cfa7cf /sound/soc/codecs/tlv320dac33.c | |
parent | 9430148d800dd929ad73da4c6afb67f793f8af43 (diff) | |
parent | 5927f94700e860ae27ff24e7f3bc9e4f7b9922eb (diff) | |
download | linux-bb14eb0da72afb69be261b28ec858cbd5a35e089.tar.xz |
Merge branch 'topic/asoc' into for-linus
Diffstat (limited to 'sound/soc/codecs/tlv320dac33.c')
-rw-r--r-- | sound/soc/codecs/tlv320dac33.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index 243d17711211..dc8a2b2bdc1c 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c @@ -55,13 +55,13 @@ #define BURST_BASEFREQ_HZ 49152000 #define SAMPLES_TO_US(rate, samples) \ - (1000000000 / ((rate * 1000) / samples)) + (1000000000 / (((rate) * 1000) / (samples))) #define US_TO_SAMPLES(rate, us) \ - (rate / (1000000 / (us < 1000000 ? us : 1000000))) + ((rate) / (1000000 / ((us) < 1000000 ? (us) : 1000000))) #define UTHR_FROM_PERIOD_SIZE(samples, playrate, burstrate) \ - ((samples * 5000) / ((burstrate * 5000) / (burstrate - playrate))) + (((samples)*5000) / (((burstrate)*5000) / ((burstrate) - (playrate)))) static void dac33_calculate_times(struct snd_pcm_substream *substream); static int dac33_prepare_chip(struct snd_pcm_substream *substream); @@ -627,18 +627,6 @@ static const struct snd_soc_dapm_route audio_map[] = { {"RIGHT_LO", NULL, "Codec Power"}, }; -static int dac33_add_widgets(struct snd_soc_codec *codec) -{ - struct snd_soc_dapm_context *dapm = &codec->dapm; - - snd_soc_dapm_new_controls(dapm, dac33_dapm_widgets, - ARRAY_SIZE(dac33_dapm_widgets)); - /* set up audio path interconnects */ - snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); - - return 0; -} - static int dac33_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) { @@ -1451,15 +1439,11 @@ static int dac33_soc_probe(struct snd_soc_codec *codec) } } - snd_soc_add_controls(codec, dac33_snd_controls, - ARRAY_SIZE(dac33_snd_controls)); /* Only add the FIFO controls, if we have valid IRQ number */ if (dac33->irq >= 0) snd_soc_add_controls(codec, dac33_mode_snd_controls, ARRAY_SIZE(dac33_mode_snd_controls)); - dac33_add_widgets(codec); - err_power: return ret; } @@ -1502,6 +1486,13 @@ static struct snd_soc_codec_driver soc_codec_dev_tlv320dac33 = { .remove = dac33_soc_remove, .suspend = dac33_soc_suspend, .resume = dac33_soc_resume, + + .controls = dac33_snd_controls, + .num_controls = ARRAY_SIZE(dac33_snd_controls), + .dapm_widgets = dac33_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(dac33_dapm_widgets), + .dapm_routes = audio_map, + .num_dapm_routes = ARRAY_SIZE(audio_map), }; #define DAC33_RATES (SNDRV_PCM_RATE_44100 | \ |