diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-05-15 06:20:52 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-05-15 06:20:52 -0400 |
commit | 2bf2778e0fb38255e55ab5e10022132b0a72420e (patch) | |
tree | 42465838d7072b36de4644acc11424dc3c97c7f3 /sound/soc/pxa/magician.c | |
parent | 2baaec28068d07db3d4ae6ba885fa07255b2ad79 (diff) |
ASoC: Optimize switch/case in magician.c
Use default to optimize the switch/case in magicial_playback_hw_params(),
which also fixes the compile warnings below:
sound/soc/pxa/magician.c:89: warning: 'acds' may be used uninitialized in this function
sound/soc/pxa/magician.c:89: warning: 'acps' may be used uninitialized in this function
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc/pxa/magician.c')
-rw-r--r-- | sound/soc/pxa/magician.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/soc/pxa/magician.c b/sound/soc/pxa/magician.c index 0625c342a1c9..c89a3cdf31e4 100644 --- a/sound/soc/pxa/magician.c +++ b/sound/soc/pxa/magician.c | |||
@@ -106,7 +106,7 @@ static int magician_playback_hw_params(struct snd_pcm_substream *substream, | |||
106 | /* 513156 Hz ~= _2_ * 8000 Hz * 32 (+0.23%) */ | 106 | /* 513156 Hz ~= _2_ * 8000 Hz * 32 (+0.23%) */ |
107 | acds = PXA_SSP_CLK_AUDIO_DIV_16; | 107 | acds = PXA_SSP_CLK_AUDIO_DIV_16; |
108 | break; | 108 | break; |
109 | case 32: | 109 | default: /* 32 */ |
110 | /* 1026312 Hz ~= _2_ * 8000 Hz * 64 (+0.23%) */ | 110 | /* 1026312 Hz ~= _2_ * 8000 Hz * 64 (+0.23%) */ |
111 | acds = PXA_SSP_CLK_AUDIO_DIV_8; | 111 | acds = PXA_SSP_CLK_AUDIO_DIV_8; |
112 | } | 112 | } |
@@ -118,7 +118,7 @@ static int magician_playback_hw_params(struct snd_pcm_substream *substream, | |||
118 | /* 351375 Hz ~= 11025 Hz * 32 (-0.41%) */ | 118 | /* 351375 Hz ~= 11025 Hz * 32 (-0.41%) */ |
119 | acds = PXA_SSP_CLK_AUDIO_DIV_4; | 119 | acds = PXA_SSP_CLK_AUDIO_DIV_4; |
120 | break; | 120 | break; |
121 | case 32: | 121 | default: /* 32 */ |
122 | /* 702750 Hz ~= 11025 Hz * 64 (-0.41%) */ | 122 | /* 702750 Hz ~= 11025 Hz * 64 (-0.41%) */ |
123 | acds = PXA_SSP_CLK_AUDIO_DIV_2; | 123 | acds = PXA_SSP_CLK_AUDIO_DIV_2; |
124 | } | 124 | } |
@@ -130,7 +130,7 @@ static int magician_playback_hw_params(struct snd_pcm_substream *substream, | |||
130 | /* 702750 Hz ~= 22050 Hz * 32 (-0.41%) */ | 130 | /* 702750 Hz ~= 22050 Hz * 32 (-0.41%) */ |
131 | acds = PXA_SSP_CLK_AUDIO_DIV_2; | 131 | acds = PXA_SSP_CLK_AUDIO_DIV_2; |
132 | break; | 132 | break; |
133 | case 32: | 133 | default: /* 32 */ |
134 | /* 1405500 Hz ~= 22050 Hz * 64 (-0.41%) */ | 134 | /* 1405500 Hz ~= 22050 Hz * 64 (-0.41%) */ |
135 | acds = PXA_SSP_CLK_AUDIO_DIV_1; | 135 | acds = PXA_SSP_CLK_AUDIO_DIV_1; |
136 | } | 136 | } |
@@ -142,7 +142,7 @@ static int magician_playback_hw_params(struct snd_pcm_substream *substream, | |||
142 | /* 1405500 Hz ~= 44100 Hz * 32 (-0.41%) */ | 142 | /* 1405500 Hz ~= 44100 Hz * 32 (-0.41%) */ |
143 | acds = PXA_SSP_CLK_AUDIO_DIV_2; | 143 | acds = PXA_SSP_CLK_AUDIO_DIV_2; |
144 | break; | 144 | break; |
145 | case 32: | 145 | default: /* 32 */ |
146 | /* 2811000 Hz ~= 44100 Hz * 64 (-0.41%) */ | 146 | /* 2811000 Hz ~= 44100 Hz * 64 (-0.41%) */ |
147 | acds = PXA_SSP_CLK_AUDIO_DIV_1; | 147 | acds = PXA_SSP_CLK_AUDIO_DIV_1; |
148 | } | 148 | } |
@@ -154,19 +154,20 @@ static int magician_playback_hw_params(struct snd_pcm_substream *substream, | |||
154 | /* 1529375 Hz ~= 48000 Hz * 32 (-0.44%) */ | 154 | /* 1529375 Hz ~= 48000 Hz * 32 (-0.44%) */ |
155 | acds = PXA_SSP_CLK_AUDIO_DIV_2; | 155 | acds = PXA_SSP_CLK_AUDIO_DIV_2; |
156 | break; | 156 | break; |
157 | case 32: | 157 | default: /* 32 */ |
158 | /* 3058750 Hz ~= 48000 Hz * 64 (-0.44%) */ | 158 | /* 3058750 Hz ~= 48000 Hz * 64 (-0.44%) */ |
159 | acds = PXA_SSP_CLK_AUDIO_DIV_1; | 159 | acds = PXA_SSP_CLK_AUDIO_DIV_1; |
160 | } | 160 | } |
161 | break; | 161 | break; |
162 | case 96000: | 162 | case 96000: |
163 | default: | ||
163 | acps = 12235000; | 164 | acps = 12235000; |
164 | switch (width) { | 165 | switch (width) { |
165 | case 16: | 166 | case 16: |
166 | /* 3058750 Hz ~= 96000 Hz * 32 (-0.44%) */ | 167 | /* 3058750 Hz ~= 96000 Hz * 32 (-0.44%) */ |
167 | acds = PXA_SSP_CLK_AUDIO_DIV_1; | 168 | acds = PXA_SSP_CLK_AUDIO_DIV_1; |
168 | break; | 169 | break; |
169 | case 32: | 170 | default: /* 32 */ |
170 | /* 6117500 Hz ~= 96000 Hz * 64 (-0.44%) */ | 171 | /* 6117500 Hz ~= 96000 Hz * 64 (-0.44%) */ |
171 | acds = PXA_SSP_CLK_AUDIO_DIV_2; | 172 | acds = PXA_SSP_CLK_AUDIO_DIV_2; |
172 | div4 = PXA_SSP_CLK_SCDB_1; | 173 | div4 = PXA_SSP_CLK_SCDB_1; |