Updated from Linux LTS 3.10.21 to 3.10.22
This commit is contained in:
@@ -2446,12 +2446,8 @@ static int create_out_jack_modes(struct hda_codec *codec, int num_pins,
|
||||
|
||||
for (i = 0; i < num_pins; i++) {
|
||||
hda_nid_t pin = pins[i];
|
||||
if (pin == spec->hp_mic_pin) {
|
||||
int ret = create_hp_mic_jack_mode(codec, pin);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (pin == spec->hp_mic_pin)
|
||||
continue;
|
||||
}
|
||||
if (get_out_jack_num_items(codec, pin) > 1) {
|
||||
struct snd_kcontrol_new *knew;
|
||||
char name[44];
|
||||
@@ -2704,7 +2700,7 @@ static int hp_mic_jack_mode_put(struct snd_kcontrol *kcontrol,
|
||||
val &= ~(AC_PINCTL_VREFEN | PIN_HP);
|
||||
val |= get_vref_idx(vref_caps, idx) | PIN_IN;
|
||||
} else
|
||||
val = snd_hda_get_default_vref(codec, nid);
|
||||
val = snd_hda_get_default_vref(codec, nid) | PIN_IN;
|
||||
}
|
||||
snd_hda_set_pin_ctl_cache(codec, nid, val);
|
||||
call_hp_automute(codec, NULL);
|
||||
@@ -2724,9 +2720,6 @@ static int create_hp_mic_jack_mode(struct hda_codec *codec, hda_nid_t pin)
|
||||
struct hda_gen_spec *spec = codec->spec;
|
||||
struct snd_kcontrol_new *knew;
|
||||
|
||||
if (get_out_jack_num_items(codec, pin) <= 1 &&
|
||||
get_in_jack_num_items(codec, pin) <= 1)
|
||||
return 0; /* no need */
|
||||
knew = snd_hda_gen_add_kctl(spec, "Headphone Mic Jack Mode",
|
||||
&hp_mic_jack_mode_enum);
|
||||
if (!knew)
|
||||
@@ -2755,6 +2748,42 @@ static int add_loopback_list(struct hda_gen_spec *spec, hda_nid_t mix, int idx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* return true if either a volume or a mute amp is found for the given
|
||||
* aamix path; the amp has to be either in the mixer node or its direct leaf
|
||||
*/
|
||||
static bool look_for_mix_leaf_ctls(struct hda_codec *codec, hda_nid_t mix_nid,
|
||||
hda_nid_t pin, unsigned int *mix_val,
|
||||
unsigned int *mute_val)
|
||||
{
|
||||
int idx, num_conns;
|
||||
const hda_nid_t *list;
|
||||
hda_nid_t nid;
|
||||
|
||||
idx = snd_hda_get_conn_index(codec, mix_nid, pin, true);
|
||||
if (idx < 0)
|
||||
return false;
|
||||
|
||||
*mix_val = *mute_val = 0;
|
||||
if (nid_has_volume(codec, mix_nid, HDA_INPUT))
|
||||
*mix_val = HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT);
|
||||
if (nid_has_mute(codec, mix_nid, HDA_INPUT))
|
||||
*mute_val = HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT);
|
||||
if (*mix_val && *mute_val)
|
||||
return true;
|
||||
|
||||
/* check leaf node */
|
||||
num_conns = snd_hda_get_conn_list(codec, mix_nid, &list);
|
||||
if (num_conns < idx)
|
||||
return false;
|
||||
nid = list[idx];
|
||||
if (!*mix_val && nid_has_volume(codec, nid, HDA_OUTPUT))
|
||||
*mix_val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT);
|
||||
if (!*mute_val && nid_has_mute(codec, nid, HDA_OUTPUT))
|
||||
*mute_val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT);
|
||||
|
||||
return *mix_val || *mute_val;
|
||||
}
|
||||
|
||||
/* create input playback/capture controls for the given pin */
|
||||
static int new_analog_input(struct hda_codec *codec, int input_idx,
|
||||
hda_nid_t pin, const char *ctlname, int ctlidx,
|
||||
@@ -2762,12 +2791,11 @@ static int new_analog_input(struct hda_codec *codec, int input_idx,
|
||||
{
|
||||
struct hda_gen_spec *spec = codec->spec;
|
||||
struct nid_path *path;
|
||||
unsigned int val;
|
||||
unsigned int mix_val, mute_val;
|
||||
int err, idx;
|
||||
|
||||
if (!nid_has_volume(codec, mix_nid, HDA_INPUT) &&
|
||||
!nid_has_mute(codec, mix_nid, HDA_INPUT))
|
||||
return 0; /* no need for analog loopback */
|
||||
if (!look_for_mix_leaf_ctls(codec, mix_nid, pin, &mix_val, &mute_val))
|
||||
return 0;
|
||||
|
||||
path = snd_hda_add_new_path(codec, pin, mix_nid, 0);
|
||||
if (!path)
|
||||
@@ -2776,20 +2804,18 @@ static int new_analog_input(struct hda_codec *codec, int input_idx,
|
||||
spec->loopback_paths[input_idx] = snd_hda_get_path_idx(codec, path);
|
||||
|
||||
idx = path->idx[path->depth - 1];
|
||||
if (nid_has_volume(codec, mix_nid, HDA_INPUT)) {
|
||||
val = HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT);
|
||||
err = __add_pb_vol_ctrl(spec, HDA_CTL_WIDGET_VOL, ctlname, ctlidx, val);
|
||||
if (mix_val) {
|
||||
err = __add_pb_vol_ctrl(spec, HDA_CTL_WIDGET_VOL, ctlname, ctlidx, mix_val);
|
||||
if (err < 0)
|
||||
return err;
|
||||
path->ctls[NID_PATH_VOL_CTL] = val;
|
||||
path->ctls[NID_PATH_VOL_CTL] = mix_val;
|
||||
}
|
||||
|
||||
if (nid_has_mute(codec, mix_nid, HDA_INPUT)) {
|
||||
val = HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT);
|
||||
err = __add_pb_sw_ctrl(spec, HDA_CTL_WIDGET_MUTE, ctlname, ctlidx, val);
|
||||
if (mute_val) {
|
||||
err = __add_pb_sw_ctrl(spec, HDA_CTL_WIDGET_MUTE, ctlname, ctlidx, mute_val);
|
||||
if (err < 0)
|
||||
return err;
|
||||
path->ctls[NID_PATH_MUTE_CTL] = val;
|
||||
path->ctls[NID_PATH_MUTE_CTL] = mute_val;
|
||||
}
|
||||
|
||||
path->active = true;
|
||||
@@ -4370,6 +4396,17 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
/* create "Headphone Mic Jack Mode" if no input selection is
|
||||
* available (or user specifies add_jack_modes hint)
|
||||
*/
|
||||
if (spec->hp_mic_pin &&
|
||||
(spec->auto_mic || spec->input_mux.num_items == 1 ||
|
||||
spec->add_jack_modes)) {
|
||||
err = create_hp_mic_jack_mode(codec, spec->hp_mic_pin);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (spec->add_jack_modes) {
|
||||
if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
|
||||
err = create_out_jack_modes(codec, cfg->line_outs,
|
||||
|
||||
@@ -1774,6 +1774,7 @@ enum {
|
||||
ALC889_FIXUP_IMAC91_VREF,
|
||||
ALC882_FIXUP_INV_DMIC,
|
||||
ALC882_FIXUP_NO_PRIMARY_HP,
|
||||
ALC887_FIXUP_ASUS_BASS,
|
||||
};
|
||||
|
||||
static void alc889_fixup_coef(struct hda_codec *codec,
|
||||
@@ -2095,6 +2096,13 @@ static const struct hda_fixup alc882_fixups[] = {
|
||||
.type = HDA_FIXUP_FUNC,
|
||||
.v.func = alc882_fixup_no_primary_hp,
|
||||
},
|
||||
[ALC887_FIXUP_ASUS_BASS] = {
|
||||
.type = HDA_FIXUP_PINS,
|
||||
.v.pins = (const struct hda_pintbl[]) {
|
||||
{0x16, 0x99130130}, /* bass speaker */
|
||||
{}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static const struct snd_pci_quirk alc882_fixup_tbl[] = {
|
||||
@@ -2128,6 +2136,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
|
||||
SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
|
||||
SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
|
||||
SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
|
||||
SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
|
||||
SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
|
||||
SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
|
||||
SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
|
||||
@@ -4597,6 +4606,7 @@ static int patch_alc662(struct hda_codec *codec)
|
||||
case 0x10ec0272:
|
||||
case 0x10ec0663:
|
||||
case 0x10ec0665:
|
||||
case 0x10ec0668:
|
||||
set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
|
||||
break;
|
||||
case 0x10ec0273:
|
||||
@@ -4654,6 +4664,7 @@ static int patch_alc680(struct hda_codec *codec)
|
||||
*/
|
||||
static const struct hda_codec_preset snd_hda_preset_realtek[] = {
|
||||
{ .id = 0x10ec0221, .name = "ALC221", .patch = patch_alc269 },
|
||||
{ .id = 0x10ec0231, .name = "ALC231", .patch = patch_alc269 },
|
||||
{ .id = 0x10ec0233, .name = "ALC233", .patch = patch_alc269 },
|
||||
{ .id = 0x10ec0255, .name = "ALC255", .patch = patch_alc269 },
|
||||
{ .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 },
|
||||
|
||||
@@ -111,6 +111,7 @@ static int bf5xx_i2s_hw_params(struct snd_pcm_substream *substream,
|
||||
bf5xx_i2s->tcr2 |= 7;
|
||||
bf5xx_i2s->rcr2 |= 7;
|
||||
sport_handle->wdsize = 1;
|
||||
break;
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
bf5xx_i2s->tcr2 |= 15;
|
||||
bf5xx_i2s->rcr2 |= 15;
|
||||
|
||||
@@ -257,7 +257,7 @@ static int ak4642_dai_startup(struct snd_pcm_substream *substream,
|
||||
* This operation came from example code of
|
||||
* "ASAHI KASEI AK4642" (japanese) manual p94.
|
||||
*/
|
||||
snd_soc_write(codec, SG_SL1, PMMP | MGAIN0);
|
||||
snd_soc_update_bits(codec, SG_SL1, PMMP | MGAIN0, PMMP | MGAIN0);
|
||||
snd_soc_write(codec, TIMER, ZTM(0x3) | WTM(0x3));
|
||||
snd_soc_write(codec, ALC_CTL1, ALC | LMTH0);
|
||||
snd_soc_update_bits(codec, PW_MGMT1, PMADL, PMADL);
|
||||
|
||||
@@ -1454,6 +1454,8 @@ static void arizona_enable_fll(struct arizona_fll *fll,
|
||||
/* Clear any pending completions */
|
||||
try_wait_for_completion(&fll->ok);
|
||||
|
||||
regmap_update_bits(arizona->regmap, fll->base + 1,
|
||||
ARIZONA_FLL1_FREERUN, 0);
|
||||
regmap_update_bits(arizona->regmap, fll->base + 1,
|
||||
ARIZONA_FLL1_ENA, ARIZONA_FLL1_ENA);
|
||||
if (fll->ref_src >= 0 && fll->sync_src >= 0 &&
|
||||
@@ -1473,6 +1475,8 @@ static void arizona_disable_fll(struct arizona_fll *fll)
|
||||
struct arizona *arizona = fll->arizona;
|
||||
bool change;
|
||||
|
||||
regmap_update_bits(arizona->regmap, fll->base + 1,
|
||||
ARIZONA_FLL1_FREERUN, ARIZONA_FLL1_FREERUN);
|
||||
regmap_update_bits_check(arizona->regmap, fll->base + 1,
|
||||
ARIZONA_FLL1_ENA, 0, &change);
|
||||
regmap_update_bits(arizona->regmap, fll->base + 0x11,
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
#define CS42L52_MICB_CTL 0x11
|
||||
#define CS42L52_MIC_CTL_MIC_SEL_MASK 0xBF
|
||||
#define CS42L52_MIC_CTL_MIC_SEL_SHIFT 6
|
||||
#define CS42L52_MIC_CTL_TYPE_MASK 0xDF
|
||||
#define CS42L52_MIC_CTL_TYPE_MASK 0x20
|
||||
#define CS42L52_MIC_CTL_TYPE_SHIFT 5
|
||||
|
||||
|
||||
|
||||
@@ -37,6 +37,47 @@ struct wm5110_priv {
|
||||
struct arizona_fll fll[2];
|
||||
};
|
||||
|
||||
static const struct reg_default wm5110_sysclk_revd_patch[] = {
|
||||
{ 0x3093, 0x1001 },
|
||||
{ 0x30E3, 0x1301 },
|
||||
{ 0x3133, 0x1201 },
|
||||
{ 0x3183, 0x1501 },
|
||||
{ 0x31D3, 0x1401 },
|
||||
};
|
||||
|
||||
static int wm5110_sysclk_ev(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
struct snd_soc_codec *codec = w->codec;
|
||||
struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
|
||||
struct regmap *regmap = codec->control_data;
|
||||
const struct reg_default *patch = NULL;
|
||||
int i, patch_size;
|
||||
|
||||
switch (arizona->rev) {
|
||||
case 3:
|
||||
patch = wm5110_sysclk_revd_patch;
|
||||
patch_size = ARRAY_SIZE(wm5110_sysclk_revd_patch);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_POST_PMU:
|
||||
if (patch)
|
||||
for (i = 0; i < patch_size; i++)
|
||||
regmap_write(regmap, patch[i].reg,
|
||||
patch[i].def);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0);
|
||||
static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
|
||||
static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0);
|
||||
@@ -386,7 +427,7 @@ static const struct snd_kcontrol_new wm5110_aec_loopback_mux =
|
||||
|
||||
static const struct snd_soc_dapm_widget wm5110_dapm_widgets[] = {
|
||||
SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT,
|
||||
0, NULL, 0),
|
||||
0, wm5110_sysclk_ev, SND_SOC_DAPM_POST_PMU),
|
||||
SND_SOC_DAPM_SUPPLY("ASYNCCLK", ARIZONA_ASYNC_CLOCK_1,
|
||||
ARIZONA_ASYNC_CLK_ENA_SHIFT, 0, NULL, 0),
|
||||
SND_SOC_DAPM_SUPPLY("OPCLK", ARIZONA_OUTPUT_SYSTEM_CLOCK,
|
||||
|
||||
@@ -3686,6 +3686,8 @@ static int wm8962_i2c_probe(struct i2c_client *i2c,
|
||||
if (ret < 0)
|
||||
goto err_enable;
|
||||
|
||||
regcache_cache_only(wm8962->regmap, true);
|
||||
|
||||
/* The drivers should power up as needed */
|
||||
regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies);
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ struct imx_pcm_runtime_data {
|
||||
struct hrtimer hrt;
|
||||
int poll_time_ns;
|
||||
struct snd_pcm_substream *substream;
|
||||
atomic_t running;
|
||||
atomic_t playing;
|
||||
atomic_t capturing;
|
||||
};
|
||||
|
||||
static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt)
|
||||
@@ -54,7 +55,7 @@ static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt)
|
||||
struct pt_regs regs;
|
||||
unsigned long delta;
|
||||
|
||||
if (!atomic_read(&iprtd->running))
|
||||
if (!atomic_read(&iprtd->playing) && !atomic_read(&iprtd->capturing))
|
||||
return HRTIMER_NORESTART;
|
||||
|
||||
get_fiq_regs(®s);
|
||||
@@ -122,7 +123,6 @@ static int snd_imx_pcm_prepare(struct snd_pcm_substream *substream)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fiq_enable;
|
||||
static int imx_pcm_fiq;
|
||||
|
||||
static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
|
||||
@@ -134,23 +134,27 @@ static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
|
||||
case SNDRV_PCM_TRIGGER_START:
|
||||
case SNDRV_PCM_TRIGGER_RESUME:
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
|
||||
atomic_set(&iprtd->running, 1);
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||
atomic_set(&iprtd->playing, 1);
|
||||
else
|
||||
atomic_set(&iprtd->capturing, 1);
|
||||
hrtimer_start(&iprtd->hrt, ns_to_ktime(iprtd->poll_time_ns),
|
||||
HRTIMER_MODE_REL);
|
||||
if (++fiq_enable == 1)
|
||||
enable_fiq(imx_pcm_fiq);
|
||||
|
||||
enable_fiq(imx_pcm_fiq);
|
||||
break;
|
||||
|
||||
case SNDRV_PCM_TRIGGER_STOP:
|
||||
case SNDRV_PCM_TRIGGER_SUSPEND:
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
||||
atomic_set(&iprtd->running, 0);
|
||||
|
||||
if (--fiq_enable == 0)
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||
atomic_set(&iprtd->playing, 0);
|
||||
else
|
||||
atomic_set(&iprtd->capturing, 0);
|
||||
if (!atomic_read(&iprtd->playing) &&
|
||||
!atomic_read(&iprtd->capturing))
|
||||
disable_fiq(imx_pcm_fiq);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -198,7 +202,8 @@ static int snd_imx_open(struct snd_pcm_substream *substream)
|
||||
|
||||
iprtd->substream = substream;
|
||||
|
||||
atomic_set(&iprtd->running, 0);
|
||||
atomic_set(&iprtd->playing, 0);
|
||||
atomic_set(&iprtd->capturing, 0);
|
||||
hrtimer_init(&iprtd->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
|
||||
iprtd->hrt.function = snd_hrtimer_callback;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user