Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276000
b: refs/heads/master
c: 6107159
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Nov 23, 2011
1 parent d004455 commit 4f7931d
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 101 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 77088cc97315e9bc713e335fb082ad26d065a4cf
refs/heads/master: 61071594f64ed12328046f94716d1d744bddc0a1
1 change: 1 addition & 0 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5648,6 +5648,7 @@ F: drivers/media/video/*7146*
F: include/media/*7146*

SAMSUNG AUDIO (ASoC) DRIVERS
M: Jassi Brar <jassisinghbrar@gmail.com>
M: Sangbeom Kim <sbkim73@samsung.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Supported
Expand Down
24 changes: 12 additions & 12 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ static bool alc_dyn_adc_pcm_resetup(struct hda_codec *codec, int cur)
return false;
}

static inline hda_nid_t get_capsrc(struct alc_spec *spec, int idx)
{
return spec->capsrc_nids ?
spec->capsrc_nids[idx] : spec->adc_nids[idx];
}

/* select the given imux item; either unmute exclusively or select the route */
static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx,
unsigned int idx, bool force)
Expand All @@ -303,8 +309,7 @@ static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx,
adc_idx = spec->dyn_adc_idx[idx];
}

nid = spec->capsrc_nids ?
spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx];
nid = get_capsrc(spec, adc_idx);

/* no selection? */
num_conns = snd_hda_get_conn_list(codec, nid, NULL);
Expand Down Expand Up @@ -1058,8 +1063,7 @@ static bool alc_rebuild_imux_for_auto_mic(struct hda_codec *codec)
hda_nid_t pin = spec->imux_pins[i];
int c;
for (c = 0; c < spec->num_adc_nids; c++) {
hda_nid_t cap = spec->capsrc_nids ?
spec->capsrc_nids[c] : spec->adc_nids[c];
hda_nid_t cap = get_capsrc(spec, c);
int idx = get_connection_index(codec, cap, pin);
if (idx >= 0) {
imux->items[i].index = idx;
Expand Down Expand Up @@ -1969,10 +1973,8 @@ static int alc_build_controls(struct hda_codec *codec)
if (!kctl)
kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
for (i = 0; kctl && i < kctl->count; i++) {
const hda_nid_t *nids = spec->capsrc_nids;
if (!nids)
nids = spec->adc_nids;
err = snd_hda_add_nid(codec, kctl, i, nids[i]);
err = snd_hda_add_nid(codec, kctl, i,
get_capsrc(spec, i));
if (err < 0)
return err;
}
Expand Down Expand Up @@ -2759,8 +2761,7 @@ static int alc_auto_create_input_ctls(struct hda_codec *codec)
}

for (c = 0; c < num_adcs; c++) {
hda_nid_t cap = spec->capsrc_nids ?
spec->capsrc_nids[c] : spec->adc_nids[c];
hda_nid_t cap = get_capsrc(spec, c);
idx = get_connection_index(codec, cap, pin);
if (idx >= 0) {
spec->imux_pins[imux->num_items] = pin;
Expand Down Expand Up @@ -3706,8 +3707,7 @@ static int init_capsrc_for_pin(struct hda_codec *codec, hda_nid_t pin)
if (!pin)
return 0;
for (i = 0; i < spec->num_adc_nids; i++) {
hda_nid_t cap = spec->capsrc_nids ?
spec->capsrc_nids[i] : spec->adc_nids[i];
hda_nid_t cap = get_capsrc(spec, i);
int idx;

idx = get_connection_index(codec, cap, pin);
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/codecs/adau1373.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ static const char *adau1373_bass_hpf_cutoff_text[] = {
};

static const unsigned int adau1373_bass_tlv[] = {
TLV_DB_RANGE_HEAD(3),
TLV_DB_RANGE_HEAD(4),
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),
Expand Down
8 changes: 3 additions & 5 deletions trunk/sound/soc/codecs/cs4271.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/codecs/rt5631.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -95625, 375, 0);
static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);
/* {0, +20, +24, +30, +35, +40, +44, +50, +52}dB */
static unsigned int mic_bst_tlv[] = {
TLV_DB_RANGE_HEAD(7),
TLV_DB_RANGE_HEAD(6),
0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0),
2, 2, TLV_DB_SCALE_ITEM(2400, 0, 0),
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/codecs/sgtl5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ static const DECLARE_TLV_DB_SCALE(capture_6db_attenuate, -600, 600, 0);

/* tlv for mic gain, 0db 20db 30db 40db */
static const unsigned int mic_gain_tlv[] = {
TLV_DB_RANGE_HEAD(2),
TLV_DB_RANGE_HEAD(4),
0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
1, 3, TLV_DB_SCALE_ITEM(2000, 1000, 0),
};
Expand Down
63 changes: 1 addition & 62 deletions trunk/sound/soc/codecs/sta32x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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]);
Expand All @@ -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, \
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/codecs/sta32x.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/codecs/wm8731.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
snd_soc_write(codec, WM8731_PWR, 0xffff);
regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies),
wm8731->supplies);
codec->cache_sync = 1;
break;
}
codec->dapm.bias_level = level;
Expand Down
3 changes: 0 additions & 3 deletions trunk/sound/soc/codecs/wm8753.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions trunk/sound/soc/codecs/wm8962.c
Original file line number Diff line number Diff line change
Expand Up @@ -1973,7 +1973,7 @@ static int wm8962_reset(struct snd_soc_codec *codec)
static const DECLARE_TLV_DB_SCALE(inpga_tlv, -2325, 75, 0);
static const DECLARE_TLV_DB_SCALE(mixin_tlv, -1500, 300, 0);
static const unsigned int mixinpga_tlv[] = {
TLV_DB_RANGE_HEAD(5),
TLV_DB_RANGE_HEAD(7),
0, 1, TLV_DB_SCALE_ITEM(0, 600, 0),
2, 2, TLV_DB_SCALE_ITEM(1300, 1300, 0),
3, 4, TLV_DB_SCALE_ITEM(1800, 200, 0),
Expand All @@ -1988,7 +1988,7 @@ static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0);
static const DECLARE_TLV_DB_SCALE(out_tlv, -12100, 100, 1);
static const DECLARE_TLV_DB_SCALE(hp_tlv, -700, 100, 0);
static const unsigned int classd_tlv[] = {
TLV_DB_RANGE_HEAD(2),
TLV_DB_RANGE_HEAD(7),
0, 6, TLV_DB_SCALE_ITEM(0, 150, 0),
7, 7, TLV_DB_SCALE_ITEM(1200, 0, 0),
};
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/codecs/wm8993.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static const DECLARE_TLV_DB_SCALE(drc_comp_threash, -4500, 75, 0);
static const DECLARE_TLV_DB_SCALE(drc_comp_amp, -2250, 75, 0);
static const DECLARE_TLV_DB_SCALE(drc_min_tlv, -1800, 600, 0);
static const unsigned int drc_max_tlv[] = {
TLV_DB_RANGE_HEAD(2),
TLV_DB_RANGE_HEAD(4),
0, 2, TLV_DB_SCALE_ITEM(1200, 600, 0),
3, 3, TLV_DB_SCALE_ITEM(3600, 0, 0),
};
Expand Down
10 changes: 5 additions & 5 deletions trunk/sound/soc/codecs/wm9081.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
Expand All @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions trunk/sound/soc/codecs/wm9090.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,19 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec)
}

static const unsigned int in_tlv[] = {
TLV_DB_RANGE_HEAD(3),
TLV_DB_RANGE_HEAD(6),
0, 0, TLV_DB_SCALE_ITEM(-600, 0, 0),
1, 3, TLV_DB_SCALE_ITEM(-350, 350, 0),
4, 6, TLV_DB_SCALE_ITEM(600, 600, 0),
};
static const unsigned int mix_tlv[] = {
TLV_DB_RANGE_HEAD(2),
TLV_DB_RANGE_HEAD(4),
0, 2, TLV_DB_SCALE_ITEM(-1200, 300, 0),
3, 3, TLV_DB_SCALE_ITEM(0, 0, 0),
};
static const DECLARE_TLV_DB_SCALE(out_tlv, -5700, 100, 0);
static const unsigned int spkboost_tlv[] = {
TLV_DB_RANGE_HEAD(2),
TLV_DB_RANGE_HEAD(7),
0, 6, TLV_DB_SCALE_ITEM(0, 150, 0),
7, 7, TLV_DB_SCALE_ITEM(1200, 0, 0),
};
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/codecs/wm_hubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static const DECLARE_TLV_DB_SCALE(outmix_tlv, -2100, 300, 0);
static const DECLARE_TLV_DB_SCALE(spkmixout_tlv, -1800, 600, 1);
static const DECLARE_TLV_DB_SCALE(outpga_tlv, -5700, 100, 0);
static const unsigned int spkboost_tlv[] = {
TLV_DB_RANGE_HEAD(2),
TLV_DB_RANGE_HEAD(7),
0, 6, TLV_DB_SCALE_ITEM(0, 150, 0),
7, 7, TLV_DB_SCALE_ITEM(1200, 0, 0),
};
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/fsl/fsl_ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4f7931d

Please sign in to comment.