wm8737.c (f01387d2693813eb5271a3448e6a082322c7d75d) wm8737.c (a5d0de23b203cc40df7196858b7a6ad546bb8408)
1/*
2 * wm8737.c -- WM8737 ALSA SoC Audio driver
3 *
4 * Copyright 2010 Wolfson Microelectronics plc
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

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

362 if (i == ARRAY_SIZE(coeff_div)) {
363 dev_err(codec->dev, "%dHz MCLK can't support %dHz\n",
364 wm8737->mclk, params_rate(params));
365 return -EINVAL;
366 }
367
368 clocking |= coeff_div[i].usb | (coeff_div[i].sr << WM8737_SR_SHIFT);
369
1/*
2 * wm8737.c -- WM8737 ALSA SoC Audio driver
3 *
4 * Copyright 2010 Wolfson Microelectronics plc
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

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

362 if (i == ARRAY_SIZE(coeff_div)) {
363 dev_err(codec->dev, "%dHz MCLK can't support %dHz\n",
364 wm8737->mclk, params_rate(params));
365 return -EINVAL;
366 }
367
368 clocking |= coeff_div[i].usb | (coeff_div[i].sr << WM8737_SR_SHIFT);
369
370 switch (params_format(params)) {
371 case SNDRV_PCM_FORMAT_S16_LE:
370 switch (params_width(params)) {
371 case 16:
372 break;
372 break;
373 case SNDRV_PCM_FORMAT_S20_3LE:
373 case 20:
374 af |= 0x8;
375 break;
374 af |= 0x8;
375 break;
376 case SNDRV_PCM_FORMAT_S24_LE:
376 case 24:
377 af |= 0x10;
378 break;
377 af |= 0x10;
378 break;
379 case SNDRV_PCM_FORMAT_S32_LE:
379 case 32:
380 af |= 0x18;
381 break;
382 default:
383 return -EINVAL;
384 }
385
386 snd_soc_update_bits(codec, WM8737_AUDIO_FORMAT, WM8737_WL_MASK, af);
387 snd_soc_update_bits(codec, WM8737_CLOCKING,

--- 399 unchanged lines hidden ---
380 af |= 0x18;
381 break;
382 default:
383 return -EINVAL;
384 }
385
386 snd_soc_update_bits(codec, WM8737_AUDIO_FORMAT, WM8737_WL_MASK, af);
387 snd_soc_update_bits(codec, WM8737_CLOCKING,

--- 399 unchanged lines hidden ---