Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/tlv320aic3x', 'asoc/topic/…
Browse files Browse the repository at this point in the history
…width', 'asoc/topic/wm0010', 'asoc/topic/wm8904' and 'asoc/topic/wm8962' into asoc-next
  • Loading branch information
Mark Brown committed Aug 4, 2014
6 parents c5e64c7 + 3e3e292 + 563fe71 + 5bca396 + 8bfcab7 + d782195 commit e99a866
Show file tree
Hide file tree
Showing 60 changed files with 360 additions and 304 deletions.
33 changes: 33 additions & 0 deletions Documentation/devicetree/bindings/sound/wm8904.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
WM8904 audio CODEC

This device supports I2C only.

Required properties:
- compatible: "wlf,wm8904"
- reg: the I2C address of the device.
- clock-names: "mclk"
- clocks: reference to
<Documentation/devicetree/bindings/clock/clock-bindings.txt>

Pins on the device (for linking into audio routes):

* IN1L
* IN1R
* IN2L
* IN2R
* IN3L
* IN3R
* HPOUTL
* HPOUTR
* LINEOUTL
* LINEOUTR
* MICBIAS

Examples:

codec: wm8904@1a {
compatible = "wlf,wm8904";
reg = <0x1a>;
clocks = <&pck0>;
clock-names = "mclk";
};
1 change: 1 addition & 0 deletions include/sound/wm8962.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#define WM8962_GPIO_FN_MICSCD 22

struct wm8962_pdata {
struct clk *mclk;
int gpio_base;
u32 gpio_init[WM8962_MAX_GPIO];

Expand Down
12 changes: 6 additions & 6 deletions sound/soc/codecs/88pm860x-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,11 +945,11 @@ static int pm860x_pcm_hw_params(struct snd_pcm_substream *substream,
unsigned char inf = 0, mask = 0;

/* bit size */
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
inf &= ~PCM_INF2_18WL;
break;
case SNDRV_PCM_FORMAT_S18_3LE:
case 18:
inf |= PCM_INF2_18WL;
break;
default:
Expand Down Expand Up @@ -1044,11 +1044,11 @@ static int pm860x_i2s_hw_params(struct snd_pcm_substream *substream,
unsigned char inf;

/* bit size */
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
inf = 0;
break;
case SNDRV_PCM_FORMAT_S18_3LE:
case 18:
inf = PCM_INF2_18WL;
break;
default:
Expand Down
8 changes: 4 additions & 4 deletions sound/soc/codecs/adau17x1.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,14 @@ static int adau17x1_hw_params(struct snd_pcm_substream *substream,
if (adau->dai_fmt != SND_SOC_DAIFMT_RIGHT_J)
return 0;

switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
val = ADAU17X1_SERIAL_PORT1_DELAY16;
break;
case SNDRV_PCM_FORMAT_S24_LE:
case 24:
val = ADAU17X1_SERIAL_PORT1_DELAY8;
break;
case SNDRV_PCM_FORMAT_S32_LE:
case 32:
val = ADAU17X1_SERIAL_PORT1_DELAY0;
break;
default:
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/codecs/max98088.c
Original file line number Diff line number Diff line change
Expand Up @@ -1299,12 +1299,12 @@ static int max98088_dai2_hw_params(struct snd_pcm_substream *substream,

rate = params_rate(params);

switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
snd_soc_update_bits(codec, M98088_REG_1C_DAI2_FORMAT,
M98088_DAI_WS, 0);
break;
case SNDRV_PCM_FORMAT_S24_LE:
case 24:
snd_soc_update_bits(codec, M98088_REG_1C_DAI2_FORMAT,
M98088_DAI_WS, M98088_DAI_WS);
break;
Expand Down
12 changes: 6 additions & 6 deletions sound/soc/codecs/max98095.c
Original file line number Diff line number Diff line change
Expand Up @@ -1280,12 +1280,12 @@ static int max98095_dai2_hw_params(struct snd_pcm_substream *substream,

rate = params_rate(params);

switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
snd_soc_update_bits(codec, M98095_034_DAI2_FORMAT,
M98095_DAI_WS, 0);
break;
case SNDRV_PCM_FORMAT_S24_LE:
case 24:
snd_soc_update_bits(codec, M98095_034_DAI2_FORMAT,
M98095_DAI_WS, M98095_DAI_WS);
break;
Expand Down Expand Up @@ -1341,12 +1341,12 @@ static int max98095_dai3_hw_params(struct snd_pcm_substream *substream,

rate = params_rate(params);

switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
snd_soc_update_bits(codec, M98095_03E_DAI3_FORMAT,
M98095_DAI_WS, 0);
break;
case SNDRV_PCM_FORMAT_S24_LE:
case 24:
snd_soc_update_bits(codec, M98095_03E_DAI3_FORMAT,
M98095_DAI_WS, M98095_DAI_WS);
break;
Expand Down
10 changes: 5 additions & 5 deletions sound/soc/codecs/rt5631.c
Original file line number Diff line number Diff line change
Expand Up @@ -1370,16 +1370,16 @@ static int rt5631_hifi_pcm_params(struct snd_pcm_substream *substream,
return coeff;
}

switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
break;
case SNDRV_PCM_FORMAT_S20_3LE:
case 20:
iface |= RT5631_SDP_I2S_DL_20;
break;
case SNDRV_PCM_FORMAT_S24_LE:
case 24:
iface |= RT5631_SDP_I2S_DL_24;
break;
case SNDRV_PCM_FORMAT_S8:
case 8:
iface |= RT5631_SDP_I2S_DL_8;
break;
default:
Expand Down
10 changes: 5 additions & 5 deletions sound/soc/codecs/rt5651.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,16 +1366,16 @@ static int rt5651_hw_params(struct snd_pcm_substream *substream,
dev_dbg(dai->dev, "bclk_ms is %d and pre_div is %d for iis %d\n",
bclk_ms, pre_div, dai->id);

switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
break;
case SNDRV_PCM_FORMAT_S20_3LE:
case 20:
val_len |= RT5651_I2S_DL_20;
break;
case SNDRV_PCM_FORMAT_S24_LE:
case 24:
val_len |= RT5651_I2S_DL_24;
break;
case SNDRV_PCM_FORMAT_S8:
case 8:
val_len |= RT5651_I2S_DL_8;
break;
default:
Expand Down
10 changes: 5 additions & 5 deletions sound/soc/codecs/sgtl5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,25 +724,25 @@ static int sgtl5000_pcm_hw_params(struct snd_pcm_substream *substream,
return ret;

/* set i2s data format */
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
if (sgtl5000->fmt == SND_SOC_DAIFMT_RIGHT_J)
return -EINVAL;
i2s_ctl |= SGTL5000_I2S_DLEN_16 << SGTL5000_I2S_DLEN_SHIFT;
i2s_ctl |= SGTL5000_I2S_SCLKFREQ_32FS <<
SGTL5000_I2S_SCLKFREQ_SHIFT;
break;
case SNDRV_PCM_FORMAT_S20_3LE:
case 20:
i2s_ctl |= SGTL5000_I2S_DLEN_20 << SGTL5000_I2S_DLEN_SHIFT;
i2s_ctl |= SGTL5000_I2S_SCLKFREQ_64FS <<
SGTL5000_I2S_SCLKFREQ_SHIFT;
break;
case SNDRV_PCM_FORMAT_S24_LE:
case 24:
i2s_ctl |= SGTL5000_I2S_DLEN_24 << SGTL5000_I2S_DLEN_SHIFT;
i2s_ctl |= SGTL5000_I2S_SCLKFREQ_64FS <<
SGTL5000_I2S_SCLKFREQ_SHIFT;
break;
case SNDRV_PCM_FORMAT_S32_LE:
case 32:
if (sgtl5000->fmt == SND_SOC_DAIFMT_RIGHT_J)
return -EINVAL;
i2s_ctl |= SGTL5000_I2S_DLEN_32 << SGTL5000_I2S_DLEN_SHIFT;
Expand Down
10 changes: 5 additions & 5 deletions sound/soc/codecs/si476x.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,17 @@ static int si476x_codec_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}

switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S8:
switch (params_width(params)) {
case 8:
width = SI476X_PCM_FORMAT_S8;
break;
case SNDRV_PCM_FORMAT_S16_LE:
case 16:
width = SI476X_PCM_FORMAT_S16_LE;
break;
case SNDRV_PCM_FORMAT_S20_3LE:
case 20:
width = SI476X_PCM_FORMAT_S20_3LE;
break;
case SNDRV_PCM_FORMAT_S24_LE:
case 24:
width = SI476X_PCM_FORMAT_S24_LE;
break;
default:
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/codecs/sn95031.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,12 +661,12 @@ static int sn95031_pcm_hw_params(struct snd_pcm_substream *substream,
{
unsigned int format, rate;

switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
format = BIT(4)|BIT(5);
break;

case SNDRV_PCM_FORMAT_S24_LE:
case 24:
format = 0;
break;
default:
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/codecs/ssm2518.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,11 @@ static int ssm2518_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;

if (ssm2518->right_j) {
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
ctrl1 |= SSM2518_SAI_CTRL1_FMT_RJ_16BIT;
break;
case SNDRV_PCM_FORMAT_S24_LE:
case 24:
ctrl1 |= SSM2518_SAI_CTRL1_FMT_RJ_24BIT;
break;
default:
Expand Down
10 changes: 5 additions & 5 deletions sound/soc/codecs/ssm2602.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,17 +275,17 @@ static int ssm2602_hw_params(struct snd_pcm_substream *substream,
regmap_write(ssm2602->regmap, SSM2602_SRATE, srate);

/* bit size */
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
iface = 0x0;
break;
case SNDRV_PCM_FORMAT_S20_3LE:
case 20:
iface = 0x4;
break;
case SNDRV_PCM_FORMAT_S24_LE:
case 24:
iface = 0x8;
break;
case SNDRV_PCM_FORMAT_S32_LE:
case 32:
iface = 0xc;
break;
default:
Expand Down
19 changes: 6 additions & 13 deletions sound/soc/codecs/sta32x.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,15 +678,11 @@ static int sta32x_hw_params(struct snd_pcm_substream *substream,

confb = snd_soc_read(codec, STA32X_CONFB);
confb &= ~(STA32X_CONFB_SAI_MASK | STA32X_CONFB_SAIFB);
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S24_LE:
case SNDRV_PCM_FORMAT_S24_BE:
case SNDRV_PCM_FORMAT_S24_3LE:
case SNDRV_PCM_FORMAT_S24_3BE:
switch (params_width(params)) {
case 24:
pr_debug("24bit\n");
/* fall through */
case SNDRV_PCM_FORMAT_S32_LE:
case SNDRV_PCM_FORMAT_S32_BE:
case 32:
pr_debug("24bit or 32bit\n");
switch (sta32x->format) {
case SND_SOC_DAIFMT_I2S:
Expand All @@ -701,8 +697,7 @@ static int sta32x_hw_params(struct snd_pcm_substream *substream,
}

break;
case SNDRV_PCM_FORMAT_S20_3LE:
case SNDRV_PCM_FORMAT_S20_3BE:
case 20:
pr_debug("20bit\n");
switch (sta32x->format) {
case SND_SOC_DAIFMT_I2S:
Expand All @@ -717,8 +712,7 @@ static int sta32x_hw_params(struct snd_pcm_substream *substream,
}

break;
case SNDRV_PCM_FORMAT_S18_3LE:
case SNDRV_PCM_FORMAT_S18_3BE:
case 18:
pr_debug("18bit\n");
switch (sta32x->format) {
case SND_SOC_DAIFMT_I2S:
Expand All @@ -733,8 +727,7 @@ static int sta32x_hw_params(struct snd_pcm_substream *substream,
}

break;
case SNDRV_PCM_FORMAT_S16_LE:
case SNDRV_PCM_FORMAT_S16_BE:
case 16:
pr_debug("16bit\n");
switch (sta32x->format) {
case SND_SOC_DAIFMT_I2S:
Expand Down
8 changes: 4 additions & 4 deletions sound/soc/codecs/sta529.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,16 @@ static int sta529_hw_params(struct snd_pcm_substream *substream,
int pdata, play_freq_val, record_freq_val;
int bclk_to_fs_ratio;

switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
pdata = 1;
bclk_to_fs_ratio = 0;
break;
case SNDRV_PCM_FORMAT_S24_LE:
case 24:
pdata = 2;
bclk_to_fs_ratio = 1;
break;
case SNDRV_PCM_FORMAT_S32_LE:
case 32:
pdata = 3;
bclk_to_fs_ratio = 2;
break;
Expand Down
8 changes: 4 additions & 4 deletions sound/soc/codecs/tas5086.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,14 @@ static int tas5086_hw_params(struct snd_pcm_substream *substream,
}

/* ... then add the offset for the sample bit depth. */
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
switch (params_width(params)) {
case 16:
val += 0;
break;
case SNDRV_PCM_FORMAT_S20_3LE:
case 20:
val += 1;
break;
case SNDRV_PCM_FORMAT_S24_3LE:
case 24:
val += 2;
break;
default:
Expand Down
Loading

0 comments on commit e99a866

Please sign in to comment.