From 07fd0a70217206719c821676ceab5db1f0651e49 Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Sun, 20 Nov 2011 15:10:27 +0100 Subject: [PATCH] --- yaml --- r: 275990 b: refs/heads/master c: 0aed4a95ce3b39acfceb38ab7f93c7906b4a27f8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/MAINTAINERS | 3 +- trunk/include/linux/mfd/wm8994/registers.h | 15 ------ trunk/sound/soc/codecs/adau1373.c | 2 +- trunk/sound/soc/codecs/cs4271.c | 8 ++- trunk/sound/soc/codecs/sta32x.c | 63 +--------------------- trunk/sound/soc/codecs/sta32x.h | 1 - trunk/sound/soc/codecs/wm8753.c | 3 -- trunk/sound/soc/codecs/wm8994.c | 43 +++++---------- trunk/sound/soc/codecs/wm9081.c | 10 ++-- trunk/sound/soc/fsl/fsl_ssi.c | 1 - 11 files changed, 27 insertions(+), 124 deletions(-) diff --git a/[refs] b/[refs] index 58610eff3cd7..74ba89179c96 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ef0cd47093a6c4b8a1f17d7be02a966f7805ff41 +refs/heads/master: 0aed4a95ce3b39acfceb38ab7f93c7906b4a27f8 diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index fd7e441b5ea7..4808256446f2 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -5648,6 +5648,7 @@ F: drivers/media/video/*7146* F: include/media/*7146* SAMSUNG AUDIO (ASoC) DRIVERS +M: Jassi Brar M: Sangbeom Kim L: alsa-devel@alsa-project.org (moderated for non-subscribers) S: Supported @@ -6121,7 +6122,7 @@ F: sound/ SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC) M: Liam Girdwood M: Mark Brown -T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git +T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git L: alsa-devel@alsa-project.org (moderated for non-subscribers) W: http://alsa-project.org/main/index.php/ASoC S: Supported diff --git a/trunk/include/linux/mfd/wm8994/registers.h b/trunk/include/linux/mfd/wm8994/registers.h index 83a9caec0e43..fae295048a8b 100644 --- a/trunk/include/linux/mfd/wm8994/registers.h +++ b/trunk/include/linux/mfd/wm8994/registers.h @@ -1962,21 +1962,6 @@ #define WM8958_MICB2_DISCH_SHIFT 0 /* MICB2_DISCH */ #define WM8958_MICB2_DISCH_WIDTH 1 /* MICB2_DISCH */ -/* - * R210 (0xD2) - Mic Detect 3 - */ -#define WM8958_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */ -#define WM8958_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */ -#define WM8958_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */ -#define WM8958_MICD_VALID 0x0002 /* MICD_VALID */ -#define WM8958_MICD_VALID_MASK 0x0002 /* MICD_VALID */ -#define WM8958_MICD_VALID_SHIFT 1 /* MICD_VALID */ -#define WM8958_MICD_VALID_WIDTH 1 /* MICD_VALID */ -#define WM8958_MICD_STS 0x0001 /* MICD_STS */ -#define WM8958_MICD_STS_MASK 0x0001 /* MICD_STS */ -#define WM8958_MICD_STS_SHIFT 0 /* MICD_STS */ -#define WM8958_MICD_STS_WIDTH 1 /* MICD_STS */ - /* * R76 (0x4C) - Charge Pump (1) */ diff --git a/trunk/sound/soc/codecs/adau1373.c b/trunk/sound/soc/codecs/adau1373.c index 1ccf8dd47576..45c63028b40d 100644 --- a/trunk/sound/soc/codecs/adau1373.c +++ b/trunk/sound/soc/codecs/adau1373.c @@ -245,7 +245,7 @@ static const char *adau1373_bass_hpf_cutoff_text[] = { }; static const unsigned int adau1373_bass_tlv[] = { - TLV_DB_RANGE_HEAD(4), + TLV_DB_RANGE_HEAD(3), 0, 2, TLV_DB_SCALE_ITEM(-600, 600, 1), 3, 4, TLV_DB_SCALE_ITEM(950, 250, 0), 5, 7, TLV_DB_SCALE_ITEM(1400, 150, 0), diff --git a/trunk/sound/soc/codecs/cs4271.c b/trunk/sound/soc/codecs/cs4271.c index 69fde1506fe1..23d1bd5dadda 100644 --- a/trunk/sound/soc/codecs/cs4271.c +++ b/trunk/sound/soc/codecs/cs4271.c @@ -434,8 +434,7 @@ static int cs4271_soc_suspend(struct snd_soc_codec *codec, pm_message_t mesg) { int ret; /* Set power-down bit */ - ret = snd_soc_update_bits(codec, CS4271_MODE2, CS4271_MODE2_PDN, - CS4271_MODE2_PDN); + ret = snd_soc_update_bits(codec, CS4271_MODE2, 0, CS4271_MODE2_PDN); if (ret < 0) return ret; return 0; @@ -502,9 +501,8 @@ static int cs4271_probe(struct snd_soc_codec *codec) return ret; } - ret = snd_soc_update_bits(codec, CS4271_MODE2, - CS4271_MODE2_PDN | CS4271_MODE2_CPEN, - CS4271_MODE2_PDN | CS4271_MODE2_CPEN); + ret = snd_soc_update_bits(codec, CS4271_MODE2, 0, + CS4271_MODE2_PDN | CS4271_MODE2_CPEN); if (ret < 0) return ret; ret = snd_soc_update_bits(codec, CS4271_MODE2, CS4271_MODE2_PDN, 0); diff --git a/trunk/sound/soc/codecs/sta32x.c b/trunk/sound/soc/codecs/sta32x.c index d2f37152f940..bb82408ab8e1 100644 --- a/trunk/sound/soc/codecs/sta32x.c +++ b/trunk/sound/soc/codecs/sta32x.c @@ -76,8 +76,6 @@ struct sta32x_priv { unsigned int mclk; unsigned int format; - - u32 coef_shadow[STA32X_COEF_COUNT]; }; static const DECLARE_TLV_DB_SCALE(mvol_tlv, -12700, 50, 1); @@ -229,7 +227,6 @@ static int sta32x_coefficient_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); - struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); int numcoef = kcontrol->private_value >> 16; int index = kcontrol->private_value & 0xffff; unsigned int cfud; @@ -242,11 +239,6 @@ static int sta32x_coefficient_put(struct snd_kcontrol *kcontrol, snd_soc_write(codec, STA32X_CFUD, cfud); snd_soc_write(codec, STA32X_CFADDR2, index); - for (i = 0; i < numcoef && (index + i < STA32X_COEF_COUNT); i++) - sta32x->coef_shadow[index + i] = - (ucontrol->value.bytes.data[3 * i] << 16) - | (ucontrol->value.bytes.data[3 * i + 1] << 8) - | (ucontrol->value.bytes.data[3 * i + 2]); for (i = 0; i < 3 * numcoef; i++) snd_soc_write(codec, STA32X_B1CF1 + i, ucontrol->value.bytes.data[i]); @@ -260,48 +252,6 @@ static int sta32x_coefficient_put(struct snd_kcontrol *kcontrol, return 0; } -int sta32x_sync_coef_shadow(struct snd_soc_codec *codec) -{ - struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); - unsigned int cfud; - int i; - - /* preserve reserved bits in STA32X_CFUD */ - cfud = snd_soc_read(codec, STA32X_CFUD) & 0xf0; - - for (i = 0; i < STA32X_COEF_COUNT; i++) { - snd_soc_write(codec, STA32X_CFADDR2, i); - snd_soc_write(codec, STA32X_B1CF1, - (sta32x->coef_shadow[i] >> 16) & 0xff); - snd_soc_write(codec, STA32X_B1CF2, - (sta32x->coef_shadow[i] >> 8) & 0xff); - snd_soc_write(codec, STA32X_B1CF3, - (sta32x->coef_shadow[i]) & 0xff); - /* chip documentation does not say if the bits are - * self-clearing, so do it explicitly */ - snd_soc_write(codec, STA32X_CFUD, cfud); - snd_soc_write(codec, STA32X_CFUD, cfud | 0x01); - } - return 0; -} - -int sta32x_cache_sync(struct snd_soc_codec *codec) -{ - unsigned int mute; - int rc; - - if (!codec->cache_sync) - return 0; - - /* mute during register sync */ - mute = snd_soc_read(codec, STA32X_MMUTE); - snd_soc_write(codec, STA32X_MMUTE, mute | STA32X_MMUTE_MMUTE); - sta32x_sync_coef_shadow(codec); - rc = snd_soc_cache_sync(codec); - snd_soc_write(codec, STA32X_MMUTE, mute); - return rc; -} - #define SINGLE_COEF(xname, index) \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ .info = sta32x_coefficient_info, \ @@ -711,7 +661,7 @@ static int sta32x_set_bias_level(struct snd_soc_codec *codec, return ret; } - sta32x_cache_sync(codec); + snd_soc_cache_sync(codec); } /* Power up to mute */ @@ -840,17 +790,6 @@ static int sta32x_probe(struct snd_soc_codec *codec) STA32X_CxCFG_OM_MASK, 2 << STA32X_CxCFG_OM_SHIFT); - /* initialize coefficient shadow RAM with reset values */ - for (i = 4; i <= 49; i += 5) - sta32x->coef_shadow[i] = 0x400000; - for (i = 50; i <= 54; i++) - sta32x->coef_shadow[i] = 0x7fffff; - sta32x->coef_shadow[55] = 0x5a9df7; - sta32x->coef_shadow[56] = 0x7fffff; - sta32x->coef_shadow[59] = 0x7fffff; - sta32x->coef_shadow[60] = 0x400000; - sta32x->coef_shadow[61] = 0x400000; - sta32x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); /* Bias level configuration will have done an extra enable */ regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); diff --git a/trunk/sound/soc/codecs/sta32x.h b/trunk/sound/soc/codecs/sta32x.h index d8e32a6262ee..b97ee5a75667 100644 --- a/trunk/sound/soc/codecs/sta32x.h +++ b/trunk/sound/soc/codecs/sta32x.h @@ -19,7 +19,6 @@ /* STA326 register addresses */ #define STA32X_REGISTER_COUNT 0x2d -#define STA32X_COEF_COUNT 62 #define STA32X_CONFA 0x00 #define STA32X_CONFB 0x01 diff --git a/trunk/sound/soc/codecs/wm8753.c b/trunk/sound/soc/codecs/wm8753.c index 3a629d0d690e..a9504710bb69 100644 --- a/trunk/sound/soc/codecs/wm8753.c +++ b/trunk/sound/soc/codecs/wm8753.c @@ -190,9 +190,6 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol, struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec); u16 ioctl; - if (wm8753->dai_func == ucontrol->value.integer.value[0]) - return 0; - if (codec->active) return -EBUSY; diff --git a/trunk/sound/soc/codecs/wm8994.c b/trunk/sound/soc/codecs/wm8994.c index 9c982e47eb99..6b73efd26991 100644 --- a/trunk/sound/soc/codecs/wm8994.c +++ b/trunk/sound/soc/codecs/wm8994.c @@ -56,7 +56,7 @@ static int wm8994_retune_mobile_base[] = { static int wm8994_readable(struct snd_soc_codec *codec, unsigned int reg) { struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); - struct wm8994 *control = codec->control_data; + struct wm8994 *control = wm8994->control_data; switch (reg) { case WM8994_GPIO_1: @@ -3030,34 +3030,19 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data) { struct wm8994_priv *wm8994 = data; struct snd_soc_codec *codec = wm8994->codec; - int reg, count; - - /* We may occasionally read a detection without an impedence - * range being provided - if that happens loop again. - */ - count = 10; - do { - reg = snd_soc_read(codec, WM8958_MIC_DETECT_3); - if (reg < 0) { - dev_err(codec->dev, - "Failed to read mic detect status: %d\n", - reg); - return IRQ_NONE; - } - - if (!(reg & WM8958_MICD_VALID)) { - dev_dbg(codec->dev, "Mic detect data not valid\n"); - goto out; - } - - if (!(reg & WM8958_MICD_STS) || (reg & WM8958_MICD_LVL_MASK)) - break; + int reg; - msleep(1); - } while (count--); + reg = snd_soc_read(codec, WM8958_MIC_DETECT_3); + if (reg < 0) { + dev_err(codec->dev, "Failed to read mic detect status: %d\n", + reg); + return IRQ_NONE; + } - if (count == 0) - dev_warn(codec->dev, "No impedence range reported for jack\n"); + if (!(reg & WM8958_MICD_VALID)) { + dev_dbg(codec->dev, "Mic detect data not valid\n"); + goto out; + } #ifndef CONFIG_SND_SOC_WM8994_MODULE trace_snd_soc_jack_irq(dev_name(codec->dev)); @@ -3195,9 +3180,9 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) wm8994_request_irq(codec->control_data, WM8994_IRQ_FIFOS_ERR, wm8994_fifo_error, "FIFO error", codec); - wm8994_request_irq(codec->control_data, WM8994_IRQ_TEMP_WARN, + wm8994_request_irq(wm8994->control_data, WM8994_IRQ_TEMP_WARN, wm8994_temp_warn, "Thermal warning", codec); - wm8994_request_irq(codec->control_data, WM8994_IRQ_TEMP_SHUT, + wm8994_request_irq(wm8994->control_data, WM8994_IRQ_TEMP_SHUT, wm8994_temp_shut, "Thermal shutdown", codec); ret = wm8994_request_irq(codec->control_data, WM8994_IRQ_DCS_DONE, diff --git a/trunk/sound/soc/codecs/wm9081.c b/trunk/sound/soc/codecs/wm9081.c index 4a398c3bfe84..3cd35a02c28c 100644 --- a/trunk/sound/soc/codecs/wm9081.c +++ b/trunk/sound/soc/codecs/wm9081.c @@ -807,6 +807,7 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec, mdelay(100); /* Normal bias enable & soft start off */ + reg |= WM9081_BIAS_ENA; reg &= ~WM9081_VMID_RAMP; snd_soc_write(codec, WM9081_VMID_CONTROL, reg); @@ -817,7 +818,7 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec, } /* VMID 2*240k */ - reg = snd_soc_read(codec, WM9081_VMID_CONTROL); + reg = snd_soc_read(codec, WM9081_BIAS_CONTROL_1); reg &= ~WM9081_VMID_SEL_MASK; reg |= 0x04; snd_soc_write(codec, WM9081_VMID_CONTROL, reg); @@ -829,15 +830,14 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec, break; case SND_SOC_BIAS_OFF: - /* Startup bias source and disable bias */ + /* Startup bias source */ reg = snd_soc_read(codec, WM9081_BIAS_CONTROL_1); reg |= WM9081_BIAS_SRC; - reg &= ~WM9081_BIAS_ENA; snd_soc_write(codec, WM9081_BIAS_CONTROL_1, reg); - /* Disable VMID with soft ramping */ + /* Disable VMID and biases with soft ramping */ reg = snd_soc_read(codec, WM9081_VMID_CONTROL); - reg &= ~WM9081_VMID_SEL_MASK; + reg &= ~(WM9081_VMID_SEL_MASK | WM9081_BIAS_ENA); reg |= WM9081_VMID_RAMP; snd_soc_write(codec, WM9081_VMID_CONTROL, reg); diff --git a/trunk/sound/soc/fsl/fsl_ssi.c b/trunk/sound/soc/fsl/fsl_ssi.c index 83c4bd5b2dd7..0268cf989736 100644 --- a/trunk/sound/soc/fsl/fsl_ssi.c +++ b/trunk/sound/soc/fsl/fsl_ssi.c @@ -694,7 +694,6 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev) /* Initialize the the device_attribute structure */ dev_attr = &ssi_private->dev_attr; - sysfs_attr_init(&dev_attr->attr); dev_attr->attr.name = "statistics"; dev_attr->attr.mode = S_IRUGO; dev_attr->show = fsl_sysfs_ssi_show;