Commit a1efd49ee269e0eeb9af12d52031853d08928810
1 parent
9ca9f6d58b
Exists in
smarc_8mq_lf_v2020.04
and in
11 other branches
dm: sound: Fix up header ordering
Tidy up the ordering of header files in the sounds files. Signed-off-by: Simon Glass <sjg@chromium.org>
Showing 3 changed files with 27 additions and 28 deletions Side-by-side Diff
drivers/sound/max98095.c
... | ... | @@ -11,16 +11,15 @@ |
11 | 11 | */ |
12 | 12 | |
13 | 13 | #include <common.h> |
14 | -#include <asm/arch/clk.h> | |
15 | -#include <asm/arch/cpu.h> | |
16 | -#include <asm/arch/power.h> | |
17 | -#include <asm/gpio.h> | |
18 | -#include <asm/io.h> | |
19 | -#include <common.h> | |
20 | 14 | #include <div64.h> |
21 | 15 | #include <fdtdec.h> |
22 | 16 | #include <i2c.h> |
23 | 17 | #include <sound.h> |
18 | +#include <asm/gpio.h> | |
19 | +#include <asm/io.h> | |
20 | +#include <asm/arch/clk.h> | |
21 | +#include <asm/arch/cpu.h> | |
22 | +#include <asm/arch/power.h> | |
24 | 23 | #include "i2s.h" |
25 | 24 | #include "max98095.h" |
26 | 25 |
drivers/sound/samsung-i2s.c
... | ... | @@ -4,13 +4,13 @@ |
4 | 4 | * R. Chandrasekar <rcsekar@samsung.com> |
5 | 5 | */ |
6 | 6 | |
7 | +#include <common.h> | |
8 | +#include <i2s.h> | |
9 | +#include <sound.h> | |
7 | 10 | #include <asm/arch/clk.h> |
8 | 11 | #include <asm/arch/pinmux.h> |
9 | 12 | #include <asm/arch/i2s-regs.h> |
10 | 13 | #include <asm/io.h> |
11 | -#include <common.h> | |
12 | -#include <sound.h> | |
13 | -#include <i2s.h> | |
14 | 14 | |
15 | 15 | #define FIC_TX2COUNT(x) (((x) >> 24) & 0xf) |
16 | 16 | #define FIC_TX1COUNT(x) (((x) >> 16) & 0xf) |
... | ... | @@ -170,7 +170,7 @@ |
170 | 170 | default: |
171 | 171 | debug("%s: Invalid format priority [0x%x]\n", __func__, |
172 | 172 | (fmt & SND_SOC_DAIFMT_FORMAT_MASK)); |
173 | - return -1; | |
173 | + return -ERANGE; | |
174 | 174 | } |
175 | 175 | |
176 | 176 | /* |
... | ... | @@ -189,7 +189,7 @@ |
189 | 189 | default: |
190 | 190 | debug("%s: Invalid clock ploarity input [0x%x]\n", __func__, |
191 | 191 | (fmt & SND_SOC_DAIFMT_INV_MASK)); |
192 | - return -1; | |
192 | + return -ERANGE; | |
193 | 193 | } |
194 | 194 | |
195 | 195 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
196 | 196 | |
... | ... | @@ -201,13 +201,13 @@ |
201 | 201 | ret = i2s_set_sysclk_dir(i2s_reg, SND_SOC_CLOCK_OUT); |
202 | 202 | if (ret != 0) { |
203 | 203 | debug("%s:set i2s clock direction failed\n", __func__); |
204 | - return -1; | |
204 | + return ret; | |
205 | 205 | } |
206 | 206 | break; |
207 | 207 | default: |
208 | 208 | debug("%s: Invalid master selection [0x%x]\n", __func__, |
209 | 209 | (fmt & SND_SOC_DAIFMT_MASTER_MASK)); |
210 | - return -1; | |
210 | + return -ERANGE; | |
211 | 211 | } |
212 | 212 | |
213 | 213 | mod &= ~(MOD_SDF_MASK | MOD_LR_RLOW | MOD_SLAVE); |
... | ... | @@ -248,7 +248,7 @@ |
248 | 248 | default: |
249 | 249 | debug("%s: Invalid sample size input [0x%x]\n", |
250 | 250 | __func__, blc); |
251 | - return -1; | |
251 | + return -ERANGE; | |
252 | 252 | } |
253 | 253 | writel(mod, &i2s_reg->mod); |
254 | 254 | |
... | ... | @@ -265,7 +265,7 @@ |
265 | 265 | |
266 | 266 | if (data_size < FIFO_LENGTH) { |
267 | 267 | debug("%s : Invalid data size\n", __func__); |
268 | - return -1; /* invalid pcm data size */ | |
268 | + return -ENODATA; /* invalid pcm data size */ | |
269 | 269 | } |
270 | 270 | |
271 | 271 | /* fill the tx buffer before stating the tx transmit */ |
... | ... | @@ -284,7 +284,7 @@ |
284 | 284 | if (get_timer(start) > TIMEOUT_I2S_TX) { |
285 | 285 | i2s_txctrl(i2s_reg, I2S_TX_OFF); |
286 | 286 | debug("%s: I2S Transfer Timeout\n", __func__); |
287 | - return -1; | |
287 | + return -ETIMEDOUT; | |
288 | 288 | } |
289 | 289 | } |
290 | 290 | } |
291 | 291 | |
292 | 292 | |
293 | 293 | |
294 | 294 | |
... | ... | @@ -312,20 +312,20 @@ |
312 | 312 | ret = set_epll_clk(pi2s_tx->audio_pll_clk); |
313 | 313 | } else { |
314 | 314 | debug("%s: unsupported i2s-%d bus\n", __func__, pi2s_tx->id); |
315 | - return -1; | |
315 | + return -ERANGE; | |
316 | 316 | } |
317 | 317 | |
318 | - if (ret != 0) { | |
318 | + if (ret) { | |
319 | 319 | debug("%s: epll clock set rate failed\n", __func__); |
320 | - return -1; | |
320 | + return ret; | |
321 | 321 | } |
322 | 322 | |
323 | 323 | /* Select Clk Source for Audio 0 or 1 */ |
324 | 324 | ret = set_i2s_clk_source(pi2s_tx->id); |
325 | - if (ret == -1) { | |
325 | + if (ret) { | |
326 | 326 | debug("%s: unsupported clock for i2s-%d\n", __func__, |
327 | 327 | pi2s_tx->id); |
328 | - return -1; | |
328 | + return ret; | |
329 | 329 | } |
330 | 330 | |
331 | 331 | if (pi2s_tx->id == 0) { |
332 | 332 | |
... | ... | @@ -341,10 +341,10 @@ |
341 | 341 | (pi2s_tx->samplingrate * (pi2s_tx->rfs)), |
342 | 342 | pi2s_tx->id); |
343 | 343 | } |
344 | - if (ret == -1) { | |
344 | + if (ret) { | |
345 | 345 | debug("%s: unsupported prescalar for i2s-%d\n", __func__, |
346 | 346 | pi2s_tx->id); |
347 | - return -1; | |
347 | + return ret; | |
348 | 348 | } |
349 | 349 | |
350 | 350 | /* Configure I2s format */ |
... | ... | @@ -355,7 +355,7 @@ |
355 | 355 | ret = i2s_set_samplesize(i2s_reg, pi2s_tx->bitspersample); |
356 | 356 | if (ret != 0) { |
357 | 357 | debug("%s:set sample rate failed\n", __func__); |
358 | - return -1; | |
358 | + return ret; | |
359 | 359 | } |
360 | 360 | |
361 | 361 | i2s_set_bitclk_framesize(i2s_reg, pi2s_tx->bfs); |
drivers/sound/wm8994.c
... | ... | @@ -4,15 +4,15 @@ |
4 | 4 | * R. Chandrasekar <rcsekar@samsung.com> |
5 | 5 | */ |
6 | 6 | #include <common.h> |
7 | -#include <asm/arch/clk.h> | |
8 | -#include <asm/arch/cpu.h> | |
9 | -#include <asm/gpio.h> | |
10 | -#include <asm/io.h> | |
11 | 7 | #include <div64.h> |
12 | 8 | #include <fdtdec.h> |
13 | 9 | #include <i2c.h> |
14 | 10 | #include <i2s.h> |
15 | 11 | #include <sound.h> |
12 | +#include <asm/gpio.h> | |
13 | +#include <asm/io.h> | |
14 | +#include <asm/arch/clk.h> | |
15 | +#include <asm/arch/cpu.h> | |
16 | 16 | #include <asm/arch/sound.h> |
17 | 17 | #include "wm8994.h" |
18 | 18 | #include "wm8994_registers.h" |