Commit 0cee4db2 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/fix/ac97', 'asoc/fix/atmel',...

Merge remote-tracking branches 'asoc/fix/ac97', 'asoc/fix/atmel', 'asoc/fix/intel', 'asoc/fix/rt286', 'asoc/fix/rt5640', 'asoc/fix/samsung', 'asoc/fix/sgtl5000', 'asoc/fix/sta32x', 'asoc/fix/tlv320aic3x' and 'asoc/fix/wm8731' into asoc-linus
...@@ -4953,6 +4953,16 @@ F: Documentation/input/multi-touch-protocol.txt ...@@ -4953,6 +4953,16 @@ F: Documentation/input/multi-touch-protocol.txt
F: drivers/input/input-mt.c F: drivers/input/input-mt.c
K: \b(ABS|SYN)_MT_ K: \b(ABS|SYN)_MT_
INTEL ASoC BDW/HSW DRIVERS
M: Jie Yang <yang.jie@linux.intel.com>
L: alsa-devel@alsa-project.org
S: Supported
F: sound/soc/intel/sst-haswell*
F: sound/soc/intel/sst-dsp*
F: sound/soc/intel/sst-firmware.c
F: sound/soc/intel/broadwell.c
F: sound/soc/intel/haswell.c
INTEL C600 SERIES SAS CONTROLLER DRIVER INTEL C600 SERIES SAS CONTROLLER DRIVER
M: Intel SCU Linux support <intel-linux-scu@intel.com> M: Intel SCU Linux support <intel-linux-scu@intel.com>
M: Artur Paszkiewicz <artur.paszkiewicz@intel.com> M: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
......
...@@ -368,7 +368,7 @@ port@0 { ...@@ -368,7 +368,7 @@ port@0 {
}; };
i2s1: i2s@13960000 { i2s1: i2s@13960000 {
compatible = "samsung,s5pv210-i2s"; compatible = "samsung,s3c6410-i2s";
reg = <0x13960000 0x100>; reg = <0x13960000 0x100>;
clocks = <&clock CLK_I2S1>; clocks = <&clock CLK_I2S1>;
clock-names = "iis"; clock-names = "iis";
...@@ -378,7 +378,7 @@ i2s1: i2s@13960000 { ...@@ -378,7 +378,7 @@ i2s1: i2s@13960000 {
}; };
i2s2: i2s@13970000 { i2s2: i2s@13970000 {
compatible = "samsung,s5pv210-i2s"; compatible = "samsung,s3c6410-i2s";
reg = <0x13970000 0x100>; reg = <0x13970000 0x100>;
clocks = <&clock CLK_I2S2>; clocks = <&clock CLK_I2S2>;
clock-names = "iis"; clock-names = "iis";
......
...@@ -498,6 +498,7 @@ int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg, ...@@ -498,6 +498,7 @@ int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
unsigned int mask, unsigned int value); unsigned int mask, unsigned int value);
#ifdef CONFIG_SND_SOC_AC97_BUS #ifdef CONFIG_SND_SOC_AC97_BUS
struct snd_ac97 *snd_soc_alloc_ac97_codec(struct snd_soc_codec *codec);
struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec); struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec);
void snd_soc_free_ac97_codec(struct snd_ac97 *ac97); void snd_soc_free_ac97_codec(struct snd_ac97 *ac97);
......
...@@ -348,7 +348,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -348,7 +348,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
struct atmel_pcm_dma_params *dma_params; struct atmel_pcm_dma_params *dma_params;
int dir, channels, bits; int dir, channels, bits;
u32 tfmr, rfmr, tcmr, rcmr; u32 tfmr, rfmr, tcmr, rcmr;
int start_event;
int ret; int ret;
int fslen, fslen_ext; int fslen, fslen_ext;
...@@ -457,19 +456,10 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -457,19 +456,10 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
* The SSC transmit clock is obtained from the BCLK signal on * The SSC transmit clock is obtained from the BCLK signal on
* on the TK line, and the SSC receive clock is * on the TK line, and the SSC receive clock is
* generated from the transmit clock. * generated from the transmit clock.
*
* For single channel data, one sample is transferred
* on the falling edge of the LRC clock.
* For two channel data, one sample is
* transferred on both edges of the LRC clock.
*/ */
start_event = ((channels == 1)
? SSC_START_FALLING_RF
: SSC_START_EDGE_RF);
rcmr = SSC_BF(RCMR_PERIOD, 0) rcmr = SSC_BF(RCMR_PERIOD, 0)
| SSC_BF(RCMR_STTDLY, START_DELAY) | SSC_BF(RCMR_STTDLY, START_DELAY)
| SSC_BF(RCMR_START, start_event) | SSC_BF(RCMR_START, SSC_START_FALLING_RF)
| SSC_BF(RCMR_CKI, SSC_CKI_RISING) | SSC_BF(RCMR_CKI, SSC_CKI_RISING)
| SSC_BF(RCMR_CKO, SSC_CKO_NONE) | SSC_BF(RCMR_CKO, SSC_CKO_NONE)
| SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ?
...@@ -478,14 +468,14 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -478,14 +468,14 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
rfmr = SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE) rfmr = SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
| SSC_BF(RFMR_FSOS, SSC_FSOS_NONE) | SSC_BF(RFMR_FSOS, SSC_FSOS_NONE)
| SSC_BF(RFMR_FSLEN, 0) | SSC_BF(RFMR_FSLEN, 0)
| SSC_BF(RFMR_DATNB, 0) | SSC_BF(RFMR_DATNB, (channels - 1))
| SSC_BIT(RFMR_MSBF) | SSC_BIT(RFMR_MSBF)
| SSC_BF(RFMR_LOOP, 0) | SSC_BF(RFMR_LOOP, 0)
| SSC_BF(RFMR_DATLEN, (bits - 1)); | SSC_BF(RFMR_DATLEN, (bits - 1));
tcmr = SSC_BF(TCMR_PERIOD, 0) tcmr = SSC_BF(TCMR_PERIOD, 0)
| SSC_BF(TCMR_STTDLY, START_DELAY) | SSC_BF(TCMR_STTDLY, START_DELAY)
| SSC_BF(TCMR_START, start_event) | SSC_BF(TCMR_START, SSC_START_FALLING_RF)
| SSC_BF(TCMR_CKI, SSC_CKI_FALLING) | SSC_BF(TCMR_CKI, SSC_CKI_FALLING)
| SSC_BF(TCMR_CKO, SSC_CKO_NONE) | SSC_BF(TCMR_CKO, SSC_CKO_NONE)
| SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ? | SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ?
...@@ -495,7 +485,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -495,7 +485,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
| SSC_BF(TFMR_FSDEN, 0) | SSC_BF(TFMR_FSDEN, 0)
| SSC_BF(TFMR_FSOS, SSC_FSOS_NONE) | SSC_BF(TFMR_FSOS, SSC_FSOS_NONE)
| SSC_BF(TFMR_FSLEN, 0) | SSC_BF(TFMR_FSLEN, 0)
| SSC_BF(TFMR_DATNB, 0) | SSC_BF(TFMR_DATNB, (channels - 1))
| SSC_BIT(TFMR_MSBF) | SSC_BIT(TFMR_MSBF)
| SSC_BF(TFMR_DATDEF, 0) | SSC_BF(TFMR_DATDEF, 0)
| SSC_BF(TFMR_DATLEN, (bits - 1)); | SSC_BF(TFMR_DATLEN, (bits - 1));
...@@ -512,7 +502,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -512,7 +502,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
rcmr = SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period) rcmr = SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period)
| SSC_BF(RCMR_STTDLY, 1) | SSC_BF(RCMR_STTDLY, 1)
| SSC_BF(RCMR_START, SSC_START_RISING_RF) | SSC_BF(RCMR_START, SSC_START_RISING_RF)
| SSC_BF(RCMR_CKI, SSC_CKI_RISING) | SSC_BF(RCMR_CKI, SSC_CKI_FALLING)
| SSC_BF(RCMR_CKO, SSC_CKO_NONE) | SSC_BF(RCMR_CKO, SSC_CKO_NONE)
| SSC_BF(RCMR_CKS, SSC_CKS_DIV); | SSC_BF(RCMR_CKS, SSC_CKS_DIV);
...@@ -527,7 +517,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -527,7 +517,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
tcmr = SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period) tcmr = SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period)
| SSC_BF(TCMR_STTDLY, 1) | SSC_BF(TCMR_STTDLY, 1)
| SSC_BF(TCMR_START, SSC_START_RISING_RF) | SSC_BF(TCMR_START, SSC_START_RISING_RF)
| SSC_BF(TCMR_CKI, SSC_CKI_RISING) | SSC_BF(TCMR_CKI, SSC_CKI_FALLING)
| SSC_BF(TCMR_CKO, SSC_CKO_CONTINUOUS) | SSC_BF(TCMR_CKO, SSC_CKO_CONTINUOUS)
| SSC_BF(TCMR_CKS, SSC_CKS_DIV); | SSC_BF(TCMR_CKS, SSC_CKS_DIV);
...@@ -556,7 +546,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -556,7 +546,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
rcmr = SSC_BF(RCMR_PERIOD, 0) rcmr = SSC_BF(RCMR_PERIOD, 0)
| SSC_BF(RCMR_STTDLY, START_DELAY) | SSC_BF(RCMR_STTDLY, START_DELAY)
| SSC_BF(RCMR_START, SSC_START_RISING_RF) | SSC_BF(RCMR_START, SSC_START_RISING_RF)
| SSC_BF(RCMR_CKI, SSC_CKI_RISING) | SSC_BF(RCMR_CKI, SSC_CKI_FALLING)
| SSC_BF(RCMR_CKO, SSC_CKO_NONE) | SSC_BF(RCMR_CKO, SSC_CKO_NONE)
| SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ?
SSC_CKS_PIN : SSC_CKS_CLOCK); SSC_CKS_PIN : SSC_CKS_CLOCK);
......
...@@ -305,6 +305,8 @@ static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic) ...@@ -305,6 +305,8 @@ static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic)
*hp = false; *hp = false;
*mic = false; *mic = false;
if (!rt286->codec)
return -EINVAL;
if (rt286->pdata.cbj_en) { if (rt286->pdata.cbj_en) {
regmap_read(rt286->regmap, RT286_GET_HP_SENSE, &buf); regmap_read(rt286->regmap, RT286_GET_HP_SENSE, &buf);
*hp = buf & 0x80000000; *hp = buf & 0x80000000;
...@@ -417,6 +419,8 @@ static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, 0, 1000, 0); ...@@ -417,6 +419,8 @@ static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, 0, 1000, 0);
static const struct snd_kcontrol_new rt286_snd_controls[] = { static const struct snd_kcontrol_new rt286_snd_controls[] = {
SOC_DOUBLE_R_TLV("DAC0 Playback Volume", RT286_DACL_GAIN, SOC_DOUBLE_R_TLV("DAC0 Playback Volume", RT286_DACL_GAIN,
RT286_DACR_GAIN, 0, 0x7f, 0, out_vol_tlv), RT286_DACR_GAIN, 0, 0x7f, 0, out_vol_tlv),
SOC_DOUBLE_R("ADC0 Capture Switch", RT286_ADCL_GAIN,
RT286_ADCR_GAIN, 7, 1, 1),
SOC_DOUBLE_R_TLV("ADC0 Capture Volume", RT286_ADCL_GAIN, SOC_DOUBLE_R_TLV("ADC0 Capture Volume", RT286_ADCL_GAIN,
RT286_ADCR_GAIN, 0, 0x7f, 0, out_vol_tlv), RT286_ADCR_GAIN, 0, 0x7f, 0, out_vol_tlv),
SOC_SINGLE_TLV("AMIC Volume", RT286_MIC_GAIN, SOC_SINGLE_TLV("AMIC Volume", RT286_MIC_GAIN,
...@@ -538,32 +542,6 @@ static int rt286_set_dmic1_event(struct snd_soc_dapm_widget *w, ...@@ -538,32 +542,6 @@ static int rt286_set_dmic1_event(struct snd_soc_dapm_widget *w,
return 0; return 0;
} }
static int rt286_adc_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_codec *codec = w->codec;
unsigned int nid;
nid = (w->reg >> 20) & 0xff;
switch (event) {
case SND_SOC_DAPM_POST_PMU:
snd_soc_update_bits(codec,
VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, nid, 0),
0x7080, 0x7000);
break;
case SND_SOC_DAPM_PRE_PMD:
snd_soc_update_bits(codec,
VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, nid, 0),
0x7080, 0x7080);
break;
default:
return 0;
}
return 0;
}
static int rt286_vref_event(struct snd_soc_dapm_widget *w, static int rt286_vref_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) struct snd_kcontrol *kcontrol, int event)
{ {
...@@ -667,12 +645,10 @@ static const struct snd_soc_dapm_widget rt286_dapm_widgets[] = { ...@@ -667,12 +645,10 @@ static const struct snd_soc_dapm_widget rt286_dapm_widgets[] = {
SND_SOC_DAPM_ADC("ADC 1", NULL, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_ADC("ADC 1", NULL, SND_SOC_NOPM, 0, 0),
/* ADC Mux */ /* ADC Mux */
SND_SOC_DAPM_MUX_E("ADC 0 Mux", RT286_SET_POWER(RT286_ADC_IN1), 0, 1, SND_SOC_DAPM_MUX("ADC 0 Mux", RT286_SET_POWER(RT286_ADC_IN1), 0, 1,
&rt286_adc0_mux, rt286_adc_event, SND_SOC_DAPM_PRE_PMD | &rt286_adc0_mux),
SND_SOC_DAPM_POST_PMU), SND_SOC_DAPM_MUX("ADC 1 Mux", RT286_SET_POWER(RT286_ADC_IN2), 0, 1,
SND_SOC_DAPM_MUX_E("ADC 1 Mux", RT286_SET_POWER(RT286_ADC_IN2), 0, 1, &rt286_adc1_mux),
&rt286_adc1_mux, rt286_adc_event, SND_SOC_DAPM_PRE_PMD |
SND_SOC_DAPM_POST_PMU),
/* Audio Interface */ /* Audio Interface */
SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0),
......
...@@ -2124,6 +2124,7 @@ MODULE_DEVICE_TABLE(of, rt5640_of_match); ...@@ -2124,6 +2124,7 @@ MODULE_DEVICE_TABLE(of, rt5640_of_match);
static struct acpi_device_id rt5640_acpi_match[] = { static struct acpi_device_id rt5640_acpi_match[] = {
{ "INT33CA", 0 }, { "INT33CA", 0 },
{ "10EC5640", 0 }, { "10EC5640", 0 },
{ "10EC5642", 0 },
{ }, { },
}; };
MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match); MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match);
......
...@@ -483,21 +483,21 @@ static int sgtl5000_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) ...@@ -483,21 +483,21 @@ static int sgtl5000_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
/* setting i2s data format */ /* setting i2s data format */
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_DSP_A: case SND_SOC_DAIFMT_DSP_A:
i2sctl |= SGTL5000_I2S_MODE_PCM; i2sctl |= SGTL5000_I2S_MODE_PCM << SGTL5000_I2S_MODE_SHIFT;
break; break;
case SND_SOC_DAIFMT_DSP_B: case SND_SOC_DAIFMT_DSP_B:
i2sctl |= SGTL5000_I2S_MODE_PCM; i2sctl |= SGTL5000_I2S_MODE_PCM << SGTL5000_I2S_MODE_SHIFT;
i2sctl |= SGTL5000_I2S_LRALIGN; i2sctl |= SGTL5000_I2S_LRALIGN;
break; break;
case SND_SOC_DAIFMT_I2S: case SND_SOC_DAIFMT_I2S:
i2sctl |= SGTL5000_I2S_MODE_I2S_LJ; i2sctl |= SGTL5000_I2S_MODE_I2S_LJ << SGTL5000_I2S_MODE_SHIFT;
break; break;
case SND_SOC_DAIFMT_RIGHT_J: case SND_SOC_DAIFMT_RIGHT_J:
i2sctl |= SGTL5000_I2S_MODE_RJ; i2sctl |= SGTL5000_I2S_MODE_RJ << SGTL5000_I2S_MODE_SHIFT;
i2sctl |= SGTL5000_I2S_LRPOL; i2sctl |= SGTL5000_I2S_LRPOL;
break; break;
case SND_SOC_DAIFMT_LEFT_J: case SND_SOC_DAIFMT_LEFT_J:
i2sctl |= SGTL5000_I2S_MODE_I2S_LJ; i2sctl |= SGTL5000_I2S_MODE_I2S_LJ << SGTL5000_I2S_MODE_SHIFT;
i2sctl |= SGTL5000_I2S_LRALIGN; i2sctl |= SGTL5000_I2S_LRALIGN;
break; break;
default: default:
...@@ -1462,6 +1462,9 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, ...@@ -1462,6 +1462,9 @@ static int sgtl5000_i2c_probe(struct i2c_client *client,
if (ret) if (ret)
return ret; return ret;
/* Need 8 clocks before I2C accesses */
udelay(1);
/* read chip information */ /* read chip information */
ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ID, &reg); ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ID, &reg);
if (ret) if (ret)
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
#define STA32X_CONFF_OCFG_MASK 0x03 #define STA32X_CONFF_OCFG_MASK 0x03
#define STA32X_CONFF_OCFG_SHIFT 0 #define STA32X_CONFF_OCFG_SHIFT 0
#define STA32X_CONFF_IDE 0x04 #define STA32X_CONFF_IDE 0x04
#define STA32X_CONFF_IDE_SHIFT 3 #define STA32X_CONFF_IDE_SHIFT 2
#define STA32X_CONFF_BCLE 0x08 #define STA32X_CONFF_BCLE 0x08
#define STA32X_CONFF_ECLE 0x20 #define STA32X_CONFF_ECLE 0x20
#define STA32X_CONFF_PWDN 0x40 #define STA32X_CONFF_PWDN 0x40
......
...@@ -1046,7 +1046,7 @@ static int aic3x_prepare(struct snd_pcm_substream *substream, ...@@ -1046,7 +1046,7 @@ static int aic3x_prepare(struct snd_pcm_substream *substream,
delay += aic3x->tdm_delay; delay += aic3x->tdm_delay;
/* Configure data delay */ /* Configure data delay */
snd_soc_write(codec, AIC3X_ASD_INTF_CTRLC, aic3x->tdm_delay); snd_soc_write(codec, AIC3X_ASD_INTF_CTRLC, delay);
return 0; return 0;
} }
......
...@@ -717,6 +717,8 @@ static int wm8731_i2c_probe(struct i2c_client *i2c, ...@@ -717,6 +717,8 @@ static int wm8731_i2c_probe(struct i2c_client *i2c,
if (wm8731 == NULL) if (wm8731 == NULL)
return -ENOMEM; return -ENOMEM;
mutex_init(&wm8731->lock);
wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap); wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap);
if (IS_ERR(wm8731->regmap)) { if (IS_ERR(wm8731->regmap)) {
ret = PTR_ERR(wm8731->regmap); ret = PTR_ERR(wm8731->regmap);
......
...@@ -344,23 +344,27 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec) ...@@ -344,23 +344,27 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec)
struct snd_ac97 *ac97; struct snd_ac97 *ac97;
int ret = 0; int ret = 0;
ac97 = snd_soc_new_ac97_codec(codec); ac97 = snd_soc_alloc_ac97_codec(codec);
if (IS_ERR(ac97)) { if (IS_ERR(ac97)) {
ret = PTR_ERR(ac97); ret = PTR_ERR(ac97);
dev_err(codec->dev, "Failed to register AC97 codec\n"); dev_err(codec->dev, "Failed to register AC97 codec\n");
return ret; return ret;
} }
snd_soc_codec_set_drvdata(codec, ac97);
ret = wm9705_reset(codec); ret = wm9705_reset(codec);
if (ret) if (ret)
goto reset_err; goto err_put_device;
ret = device_add(&ac97->dev);
if (ret)
goto err_put_device;
snd_soc_codec_set_drvdata(codec, ac97);
return 0; return 0;
reset_err: err_put_device:
snd_soc_free_ac97_codec(ac97); put_device(&ac97->dev);
return ret; return ret;
} }
......
...@@ -666,7 +666,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec) ...@@ -666,7 +666,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec);
int ret = 0; int ret = 0;
wm9712->ac97 = snd_soc_new_ac97_codec(codec); wm9712->ac97 = snd_soc_alloc_ac97_codec(codec);
if (IS_ERR(wm9712->ac97)) { if (IS_ERR(wm9712->ac97)) {
ret = PTR_ERR(wm9712->ac97); ret = PTR_ERR(wm9712->ac97);
dev_err(codec->dev, "Failed to register AC97 codec: %d\n", ret); dev_err(codec->dev, "Failed to register AC97 codec: %d\n", ret);
...@@ -675,15 +675,19 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec) ...@@ -675,15 +675,19 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
ret = wm9712_reset(codec, 0); ret = wm9712_reset(codec, 0);
if (ret < 0) if (ret < 0)
goto reset_err; goto err_put_device;
ret = device_add(&wm9712->ac97->dev);
if (ret)
goto err_put_device;
/* set alc mux to none */ /* set alc mux to none */
ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000); ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000);
return 0; return 0;
reset_err: err_put_device:
snd_soc_free_ac97_codec(wm9712->ac97); put_device(&wm9712->ac97->dev);
return ret; return ret;
} }
......
...@@ -1225,7 +1225,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec) ...@@ -1225,7 +1225,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec);
int ret = 0, reg; int ret = 0, reg;
wm9713->ac97 = snd_soc_new_ac97_codec(codec); wm9713->ac97 = snd_soc_alloc_ac97_codec(codec);
if (IS_ERR(wm9713->ac97)) if (IS_ERR(wm9713->ac97))
return PTR_ERR(wm9713->ac97); return PTR_ERR(wm9713->ac97);
...@@ -1234,7 +1234,11 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec) ...@@ -1234,7 +1234,11 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
wm9713_reset(codec, 0); wm9713_reset(codec, 0);
ret = wm9713_reset(codec, 1); ret = wm9713_reset(codec, 1);
if (ret < 0) if (ret < 0)
goto reset_err; goto err_put_device;
ret = device_add(&wm9713->ac97->dev);
if (ret)
goto err_put_device;
/* unmute the adc - move to kcontrol */ /* unmute the adc - move to kcontrol */
reg = ac97_read(codec, AC97_CD) & 0x7fff; reg = ac97_read(codec, AC97_CD) & 0x7fff;
...@@ -1242,8 +1246,8 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec) ...@@ -1242,8 +1246,8 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
return 0; return 0;
reset_err: err_put_device:
snd_soc_free_ac97_codec(wm9713->ac97); put_device(&wm9713->ac97->dev);
return ret; return ret;
} }
......
...@@ -651,11 +651,11 @@ static void hsw_notification_work(struct work_struct *work) ...@@ -651,11 +651,11 @@ static void hsw_notification_work(struct work_struct *work)
} }
/* tell DSP that notification has been handled */ /* tell DSP that notification has been handled */
sst_dsp_shim_update_bits_unlocked(hsw->dsp, SST_IPCD, sst_dsp_shim_update_bits(hsw->dsp, SST_IPCD,
SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE); SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE);
/* unmask busy interrupt */ /* unmask busy interrupt */
sst_dsp_shim_update_bits_unlocked(hsw->dsp, SST_IMRX, SST_IMRX_BUSY, 0); sst_dsp_shim_update_bits(hsw->dsp, SST_IMRX, SST_IMRX_BUSY, 0);
} }
static struct ipc_message *reply_find_msg(struct sst_hsw *hsw, u32 header) static struct ipc_message *reply_find_msg(struct sst_hsw *hsw, u32 header)
......
...@@ -58,6 +58,7 @@ enum sst_algo_ops { ...@@ -58,6 +58,7 @@ enum sst_algo_ops {
#define SST_BLOCK_TIMEOUT 1000 #define SST_BLOCK_TIMEOUT 1000
#define FW_SIGNATURE_SIZE 4 #define FW_SIGNATURE_SIZE 4
#define FW_NAME_SIZE 32
/* stream states */ /* stream states */
enum sst_stream_states { enum sst_stream_states {
...@@ -426,7 +427,7 @@ struct intel_sst_drv { ...@@ -426,7 +427,7 @@ struct intel_sst_drv {
* Holder for firmware name. Due to async call it needs to be * Holder for firmware name. Due to async call it needs to be
* persistent till worker thread gets called * persistent till worker thread gets called
*/ */
char firmware_name[20]; char firmware_name[FW_NAME_SIZE];
}; };
/* misc definitions */ /* misc definitions */
......
...@@ -47,7 +47,7 @@ struct sst_machines { ...@@ -47,7 +47,7 @@ struct sst_machines {
char board[32]; char board[32];
char machine[32]; char machine[32];
void (*machine_quirk)(void); void (*machine_quirk)(void);
char firmware[32]; char firmware[FW_NAME_SIZE];
struct sst_platform_info *pdata; struct sst_platform_info *pdata;
}; };
...@@ -350,7 +350,7 @@ static struct sst_machines sst_acpi_bytcr[] = { ...@@ -350,7 +350,7 @@ static struct sst_machines sst_acpi_bytcr[] = {
/* Cherryview-based platforms: CherryTrail and Braswell */ /* Cherryview-based platforms: CherryTrail and Braswell */
static struct sst_machines sst_acpi_chv[] = { static struct sst_machines sst_acpi_chv[] = {
{"10EC5670", "cht-bsw", "cht-bsw-rt5672", NULL, "fw_sst_22a8.bin", {"10EC5670", "cht-bsw", "cht-bsw-rt5672", NULL, "intel/fw_sst_22a8.bin",
&chv_platform_data }, &chv_platform_data },
{}, {},
}; };
......
...@@ -48,15 +48,18 @@ static void soc_ac97_device_release(struct device *dev) ...@@ -48,15 +48,18 @@ static void soc_ac97_device_release(struct device *dev)
} }
/** /**
* snd_soc_new_ac97_codec - initailise AC97 device * snd_soc_alloc_ac97_codec() - Allocate new a AC'97 device
* @codec: audio codec * @codec: The CODEC for which to create the AC'97 device
* *
* Initialises AC97 codec resources for use by ad-hoc devices only. * Allocated a new snd_ac97 device and intializes it, but does not yet register
* it. The caller is responsible to either call device_add(&ac97->dev) to
* register the device, or to call put_device(&ac97->dev) to free the device.
*
* Returns: A snd_ac97 device or a PTR_ERR in case of an error.
*/ */
struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec) struct snd_ac97 *snd_soc_alloc_ac97_codec(struct snd_soc_codec *codec)
{ {
struct snd_ac97 *ac97; struct snd_ac97 *ac97;
int ret;
ac97 = kzalloc(sizeof(struct snd_ac97), GFP_KERNEL); ac97 = kzalloc(sizeof(struct snd_ac97), GFP_KERNEL);
if (ac97 == NULL) if (ac97 == NULL)
...@@ -73,7 +76,28 @@ struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec) ...@@ -73,7 +76,28 @@ struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec)
codec->component.card->snd_card->number, 0, codec->component.card->snd_card->number, 0,
codec->component.name); codec->component.name);
ret = device_register(&ac97->dev); device_initialize(&ac97->dev);
return ac97;
}
EXPORT_SYMBOL(snd_soc_alloc_ac97_codec);
/**
* snd_soc_new_ac97_codec - initailise AC97 device
* @codec: audio codec
*
* Initialises AC97 codec resources for use by ad-hoc devices only.
*/
struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec)
{
struct snd_ac97 *ac97;
int ret;
ac97 = snd_soc_alloc_ac97_codec(codec);
if (IS_ERR(ac97))
return ac97;
ret = device_add(&ac97->dev);
if (ret) { if (ret) {
put_device(&ac97->dev); put_device(&ac97->dev);
return ERR_PTR(ret); return ERR_PTR(ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment