提交 3c512b19 编写于 作者: L Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (28 commits)
  ALSA: hda - Fix jack-detection control of VT1708
  ALSA: hda - cut and paste typo in cs420x_models[]
  ALSA: hda/realtek - Minor cleanup
  ALSA: hda/realtek - Fix missing inits of item indices for auto-mic
  ALSA: hda - Fix invalid pin and GPIO for Apple laptops with CS codecs
  ALSA: hda - Check subdevice mask in snd_hda_check_board_codec_sid_config()
  ALSA: hda - fail ELD reading early
  ALSA: lx6464es - fix device communication via command bus
  ALSA: lx6464es - command buffer API cleanup
  ALSA: hda - repoll ELD content for multiple times
  ALSA: hdspm - Fix PCI ID for PCIe RME MADI cards
  ASoC: Ensure WM8731 register cache is synced when resuming from disabled
  ALSA: cs5535 - Fix an endianness conversion
  ASoC: cs4271: Fix wrong mask parameter in some snd_soc_update_bits calls
  ASoC: wm_hubs: fix DB_RANGE size
  ASoC: wm9090: fix DB_RANGE size
  ASoC: wm8993: fix DB_RANGE size
  ASoC: wm8962: fix DB_RANGE size
  ASoC: sgtl5000: fix DB_RANGE size
  ASoC: rt5631: fix DB_RANGE size
  ...
...@@ -5667,7 +5667,6 @@ F: drivers/media/video/*7146* ...@@ -5667,7 +5667,6 @@ F: drivers/media/video/*7146*
F: include/media/*7146* F: include/media/*7146*
SAMSUNG AUDIO (ASoC) DRIVERS SAMSUNG AUDIO (ASoC) DRIVERS
M: Jassi Brar <jassisinghbrar@gmail.com>
M: Sangbeom Kim <sbkim73@samsung.com> M: Sangbeom Kim <sbkim73@samsung.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers) L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Supported S: Supported
......
...@@ -148,7 +148,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au, ...@@ -148,7 +148,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
struct cs5535audio_dma_desc *desc = struct cs5535audio_dma_desc *desc =
&((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i]; &((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i];
desc->addr = cpu_to_le32(addr); desc->addr = cpu_to_le32(addr);
desc->size = cpu_to_le32(period_bytes); desc->size = cpu_to_le16(period_bytes);
desc->ctlreserved = cpu_to_le16(PRD_EOP); desc->ctlreserved = cpu_to_le16(PRD_EOP);
desc_addr += sizeof(struct cs5535audio_dma_desc); desc_addr += sizeof(struct cs5535audio_dma_desc);
addr += period_bytes; addr += period_bytes;
......
...@@ -4046,9 +4046,9 @@ int snd_hda_check_board_codec_sid_config(struct hda_codec *codec, ...@@ -4046,9 +4046,9 @@ int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
/* Search for codec ID */ /* Search for codec ID */
for (q = tbl; q->subvendor; q++) { for (q = tbl; q->subvendor; q++) {
unsigned long vendorid = (q->subdevice) | (q->subvendor << 16); unsigned int mask = 0xffff0000 | q->subdevice_mask;
unsigned int id = (q->subdevice | (q->subvendor << 16)) & mask;
if (vendorid == codec->subsystem_id) if ((codec->subsystem_id & mask) == id)
break; break;
} }
......
...@@ -347,18 +347,28 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld, ...@@ -347,18 +347,28 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
unsigned int val = hdmi_get_eld_data(codec, nid, i); unsigned int val = hdmi_get_eld_data(codec, nid, i);
/*
* Graphics driver might be writing to ELD buffer right now.
* Just abort. The caller will repoll after a while.
*/
if (!(val & AC_ELDD_ELD_VALID)) { if (!(val & AC_ELDD_ELD_VALID)) {
if (!i) {
snd_printd(KERN_INFO
"HDMI: invalid ELD data\n");
ret = -EINVAL;
goto error;
}
snd_printd(KERN_INFO snd_printd(KERN_INFO
"HDMI: invalid ELD data byte %d\n", i); "HDMI: invalid ELD data byte %d\n", i);
val = 0; ret = -EINVAL;
} else goto error;
val &= AC_ELDD_ELD_DATA; }
val &= AC_ELDD_ELD_DATA;
/*
* The first byte cannot be zero. This can happen on some DVI
* connections. Some Intel chips may also need some 250ms delay
* to return non-zero ELD data, even when the graphics driver
* correctly writes ELD content before setting ELD_valid bit.
*/
if (!val && !i) {
snd_printdd(KERN_INFO "HDMI: 0 ELD data\n");
ret = -EINVAL;
goto error;
}
buf[i] = val; buf[i] = val;
} }
......
...@@ -58,6 +58,8 @@ struct cs_spec { ...@@ -58,6 +58,8 @@ struct cs_spec {
unsigned int gpio_mask; unsigned int gpio_mask;
unsigned int gpio_dir; unsigned int gpio_dir;
unsigned int gpio_data; unsigned int gpio_data;
unsigned int gpio_eapd_hp; /* EAPD GPIO bit for headphones */
unsigned int gpio_eapd_speaker; /* EAPD GPIO bit for speakers */
struct hda_pcm pcm_rec[2]; /* PCM information */ struct hda_pcm pcm_rec[2]; /* PCM information */
...@@ -76,6 +78,7 @@ enum { ...@@ -76,6 +78,7 @@ enum {
CS420X_MBP53, CS420X_MBP53,
CS420X_MBP55, CS420X_MBP55,
CS420X_IMAC27, CS420X_IMAC27,
CS420X_APPLE,
CS420X_AUTO, CS420X_AUTO,
CS420X_MODELS CS420X_MODELS
}; };
...@@ -928,10 +931,9 @@ static void cs_automute(struct hda_codec *codec) ...@@ -928,10 +931,9 @@ static void cs_automute(struct hda_codec *codec)
spdif_present ? 0 : PIN_OUT); spdif_present ? 0 : PIN_OUT);
} }
} }
if (spec->board_config == CS420X_MBP53 || if (spec->gpio_eapd_hp) {
spec->board_config == CS420X_MBP55 || unsigned int gpio = hp_present ?
spec->board_config == CS420X_IMAC27) { spec->gpio_eapd_hp : spec->gpio_eapd_speaker;
unsigned int gpio = hp_present ? 0x02 : 0x08;
snd_hda_codec_write(codec, 0x01, 0, snd_hda_codec_write(codec, 0x01, 0,
AC_VERB_SET_GPIO_DATA, gpio); AC_VERB_SET_GPIO_DATA, gpio);
} }
...@@ -1276,6 +1278,7 @@ static const char * const cs420x_models[CS420X_MODELS] = { ...@@ -1276,6 +1278,7 @@ static const char * const cs420x_models[CS420X_MODELS] = {
[CS420X_MBP53] = "mbp53", [CS420X_MBP53] = "mbp53",
[CS420X_MBP55] = "mbp55", [CS420X_MBP55] = "mbp55",
[CS420X_IMAC27] = "imac27", [CS420X_IMAC27] = "imac27",
[CS420X_APPLE] = "apple",
[CS420X_AUTO] = "auto", [CS420X_AUTO] = "auto",
}; };
...@@ -1285,7 +1288,13 @@ static const struct snd_pci_quirk cs420x_cfg_tbl[] = { ...@@ -1285,7 +1288,13 @@ static const struct snd_pci_quirk cs420x_cfg_tbl[] = {
SND_PCI_QUIRK(0x10de, 0x0d94, "MacBookAir 3,1(2)", CS420X_MBP55), SND_PCI_QUIRK(0x10de, 0x0d94, "MacBookAir 3,1(2)", CS420X_MBP55),
SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55), SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
SND_PCI_QUIRK(0x10de, 0xcb89, "MacBookPro 7,1", CS420X_MBP55), SND_PCI_QUIRK(0x10de, 0xcb89, "MacBookPro 7,1", CS420X_MBP55),
SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27), /* this conflicts with too many other models */
/*SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),*/
{} /* terminator */
};
static const struct snd_pci_quirk cs420x_codec_cfg_tbl[] = {
SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS420X_APPLE),
{} /* terminator */ {} /* terminator */
}; };
...@@ -1367,6 +1376,10 @@ static int patch_cs420x(struct hda_codec *codec) ...@@ -1367,6 +1376,10 @@ static int patch_cs420x(struct hda_codec *codec)
spec->board_config = spec->board_config =
snd_hda_check_board_config(codec, CS420X_MODELS, snd_hda_check_board_config(codec, CS420X_MODELS,
cs420x_models, cs420x_cfg_tbl); cs420x_models, cs420x_cfg_tbl);
if (spec->board_config < 0)
spec->board_config =
snd_hda_check_board_codec_sid_config(codec,
CS420X_MODELS, NULL, cs420x_codec_cfg_tbl);
if (spec->board_config >= 0) if (spec->board_config >= 0)
fix_pincfg(codec, spec->board_config, cs_pincfgs); fix_pincfg(codec, spec->board_config, cs_pincfgs);
...@@ -1374,10 +1387,11 @@ static int patch_cs420x(struct hda_codec *codec) ...@@ -1374,10 +1387,11 @@ static int patch_cs420x(struct hda_codec *codec)
case CS420X_IMAC27: case CS420X_IMAC27:
case CS420X_MBP53: case CS420X_MBP53:
case CS420X_MBP55: case CS420X_MBP55:
/* GPIO1 = headphones */ case CS420X_APPLE:
/* GPIO3 = speakers */ spec->gpio_eapd_hp = 2; /* GPIO1 = headphones */
spec->gpio_mask = 0x0a; spec->gpio_eapd_speaker = 8; /* GPIO3 = speakers */
spec->gpio_dir = 0x0a; spec->gpio_mask = spec->gpio_dir =
spec->gpio_eapd_hp | spec->gpio_eapd_speaker;
break; break;
} }
......
...@@ -69,6 +69,7 @@ struct hdmi_spec_per_pin { ...@@ -69,6 +69,7 @@ struct hdmi_spec_per_pin {
struct hda_codec *codec; struct hda_codec *codec;
struct hdmi_eld sink_eld; struct hdmi_eld sink_eld;
struct delayed_work work; struct delayed_work work;
int repoll_count;
}; };
struct hdmi_spec { struct hdmi_spec {
...@@ -748,7 +749,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, int pin_idx, ...@@ -748,7 +749,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, int pin_idx,
* Unsolicited events * Unsolicited events
*/ */
static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry); static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll);
static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
{ {
...@@ -766,7 +767,7 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) ...@@ -766,7 +767,7 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
if (pin_idx < 0) if (pin_idx < 0)
return; return;
hdmi_present_sense(&spec->pins[pin_idx], true); hdmi_present_sense(&spec->pins[pin_idx], 1);
} }
static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res)
...@@ -960,7 +961,7 @@ static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx) ...@@ -960,7 +961,7 @@ static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx)
return 0; return 0;
} }
static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry) static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
{ {
struct hda_codec *codec = per_pin->codec; struct hda_codec *codec = per_pin->codec;
struct hdmi_eld *eld = &per_pin->sink_eld; struct hdmi_eld *eld = &per_pin->sink_eld;
...@@ -989,7 +990,7 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry) ...@@ -989,7 +990,7 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry)
if (eld_valid) { if (eld_valid) {
if (!snd_hdmi_get_eld(eld, codec, pin_nid)) if (!snd_hdmi_get_eld(eld, codec, pin_nid))
snd_hdmi_show_eld(eld); snd_hdmi_show_eld(eld);
else if (retry) { else if (repoll) {
queue_delayed_work(codec->bus->workq, queue_delayed_work(codec->bus->workq,
&per_pin->work, &per_pin->work,
msecs_to_jiffies(300)); msecs_to_jiffies(300));
...@@ -1004,7 +1005,10 @@ static void hdmi_repoll_eld(struct work_struct *work) ...@@ -1004,7 +1005,10 @@ static void hdmi_repoll_eld(struct work_struct *work)
struct hdmi_spec_per_pin *per_pin = struct hdmi_spec_per_pin *per_pin =
container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work); container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work);
hdmi_present_sense(per_pin, false); if (per_pin->repoll_count++ > 6)
per_pin->repoll_count = 0;
hdmi_present_sense(per_pin, per_pin->repoll_count);
} }
static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)
...@@ -1235,7 +1239,7 @@ static int generic_hdmi_build_jack(struct hda_codec *codec, int pin_idx) ...@@ -1235,7 +1239,7 @@ static int generic_hdmi_build_jack(struct hda_codec *codec, int pin_idx)
if (err < 0) if (err < 0)
return err; return err;
hdmi_present_sense(per_pin, false); hdmi_present_sense(per_pin, 0);
return 0; return 0;
} }
......
...@@ -277,6 +277,12 @@ static bool alc_dyn_adc_pcm_resetup(struct hda_codec *codec, int cur) ...@@ -277,6 +277,12 @@ static bool alc_dyn_adc_pcm_resetup(struct hda_codec *codec, int cur)
return false; 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 */ /* 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, static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx,
unsigned int idx, bool force) unsigned int idx, bool force)
...@@ -303,8 +309,7 @@ static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx, ...@@ -303,8 +309,7 @@ static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx,
adc_idx = spec->dyn_adc_idx[idx]; adc_idx = spec->dyn_adc_idx[idx];
} }
nid = spec->capsrc_nids ? nid = get_capsrc(spec, adc_idx);
spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx];
/* no selection? */ /* no selection? */
num_conns = snd_hda_get_conn_list(codec, nid, NULL); num_conns = snd_hda_get_conn_list(codec, nid, NULL);
...@@ -1054,8 +1059,19 @@ static bool alc_rebuild_imux_for_auto_mic(struct hda_codec *codec) ...@@ -1054,8 +1059,19 @@ static bool alc_rebuild_imux_for_auto_mic(struct hda_codec *codec)
spec->imux_pins[2] = spec->dock_mic_pin; spec->imux_pins[2] = spec->dock_mic_pin;
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
strcpy(imux->items[i].label, texts[i]); strcpy(imux->items[i].label, texts[i]);
if (spec->imux_pins[i]) if (spec->imux_pins[i]) {
hda_nid_t pin = spec->imux_pins[i];
int c;
for (c = 0; c < spec->num_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;
break;
}
}
imux->num_items = i + 1; imux->num_items = i + 1;
}
} }
spec->num_mux_defs = 1; spec->num_mux_defs = 1;
spec->input_mux = imux; spec->input_mux = imux;
...@@ -1957,10 +1973,8 @@ static int alc_build_controls(struct hda_codec *codec) ...@@ -1957,10 +1973,8 @@ static int alc_build_controls(struct hda_codec *codec)
if (!kctl) if (!kctl)
kctl = snd_hda_find_mixer_ctl(codec, "Input Source"); kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
for (i = 0; kctl && i < kctl->count; i++) { for (i = 0; kctl && i < kctl->count; i++) {
const hda_nid_t *nids = spec->capsrc_nids; err = snd_hda_add_nid(codec, kctl, i,
if (!nids) get_capsrc(spec, i));
nids = spec->adc_nids;
err = snd_hda_add_nid(codec, kctl, i, nids[i]);
if (err < 0) if (err < 0)
return err; return err;
} }
...@@ -2747,8 +2761,7 @@ static int alc_auto_create_input_ctls(struct hda_codec *codec) ...@@ -2747,8 +2761,7 @@ static int alc_auto_create_input_ctls(struct hda_codec *codec)
} }
for (c = 0; c < num_adcs; c++) { for (c = 0; c < num_adcs; c++) {
hda_nid_t cap = spec->capsrc_nids ? hda_nid_t cap = get_capsrc(spec, c);
spec->capsrc_nids[c] : spec->adc_nids[c];
idx = get_connection_index(codec, cap, pin); idx = get_connection_index(codec, cap, pin);
if (idx >= 0) { if (idx >= 0) {
spec->imux_pins[imux->num_items] = pin; spec->imux_pins[imux->num_items] = pin;
...@@ -3694,8 +3707,7 @@ static int init_capsrc_for_pin(struct hda_codec *codec, hda_nid_t pin) ...@@ -3694,8 +3707,7 @@ static int init_capsrc_for_pin(struct hda_codec *codec, hda_nid_t pin)
if (!pin) if (!pin)
return 0; return 0;
for (i = 0; i < spec->num_adc_nids; i++) { for (i = 0; i < spec->num_adc_nids; i++) {
hda_nid_t cap = spec->capsrc_nids ? hda_nid_t cap = get_capsrc(spec, i);
spec->capsrc_nids[i] : spec->adc_nids[i];
int idx; int idx;
idx = get_connection_index(codec, cap, pin); idx = get_connection_index(codec, cap, pin);
......
...@@ -1641,6 +1641,8 @@ static const struct snd_pci_quirk stac92hd73xx_codec_id_cfg_tbl[] = { ...@@ -1641,6 +1641,8 @@ static const struct snd_pci_quirk stac92hd73xx_codec_id_cfg_tbl[] = {
"Alienware M17x", STAC_ALIENWARE_M17X), "Alienware M17x", STAC_ALIENWARE_M17X),
SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a, SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a,
"Alienware M17x", STAC_ALIENWARE_M17X), "Alienware M17x", STAC_ALIENWARE_M17X),
SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0490,
"Alienware M17x", STAC_ALIENWARE_M17X),
{} /* terminator */ {} /* terminator */
}; };
......
...@@ -208,6 +208,7 @@ struct via_spec { ...@@ -208,6 +208,7 @@ struct via_spec {
/* work to check hp jack state */ /* work to check hp jack state */
struct hda_codec *codec; struct hda_codec *codec;
struct delayed_work vt1708_hp_work; struct delayed_work vt1708_hp_work;
int hp_work_active;
int vt1708_jack_detect; int vt1708_jack_detect;
int vt1708_hp_present; int vt1708_hp_present;
...@@ -305,27 +306,35 @@ enum { ...@@ -305,27 +306,35 @@ enum {
static void analog_low_current_mode(struct hda_codec *codec); static void analog_low_current_mode(struct hda_codec *codec);
static bool is_aa_path_mute(struct hda_codec *codec); static bool is_aa_path_mute(struct hda_codec *codec);
static void vt1708_start_hp_work(struct via_spec *spec) #define hp_detect_with_aa(codec) \
(snd_hda_get_bool_hint(codec, "analog_loopback_hp_detect") == 1 && \
!is_aa_path_mute(codec))
static void vt1708_stop_hp_work(struct via_spec *spec)
{ {
if (spec->codec_type != VT1708 || spec->autocfg.hp_pins[0] == 0) if (spec->codec_type != VT1708 || spec->autocfg.hp_pins[0] == 0)
return; return;
snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, if (spec->hp_work_active) {
!spec->vt1708_jack_detect); snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, 1);
if (!delayed_work_pending(&spec->vt1708_hp_work)) cancel_delayed_work_sync(&spec->vt1708_hp_work);
schedule_delayed_work(&spec->vt1708_hp_work, spec->hp_work_active = 0;
msecs_to_jiffies(100)); }
} }
static void vt1708_stop_hp_work(struct via_spec *spec) static void vt1708_update_hp_work(struct via_spec *spec)
{ {
if (spec->codec_type != VT1708 || spec->autocfg.hp_pins[0] == 0) if (spec->codec_type != VT1708 || spec->autocfg.hp_pins[0] == 0)
return; return;
if (snd_hda_get_bool_hint(spec->codec, "analog_loopback_hp_detect") == 1 if (spec->vt1708_jack_detect &&
&& !is_aa_path_mute(spec->codec)) (spec->active_streams || hp_detect_with_aa(spec->codec))) {
return; if (!spec->hp_work_active) {
snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, 0);
!spec->vt1708_jack_detect); schedule_delayed_work(&spec->vt1708_hp_work,
cancel_delayed_work_sync(&spec->vt1708_hp_work); msecs_to_jiffies(100));
spec->hp_work_active = 1;
}
} else if (!hp_detect_with_aa(spec->codec))
vt1708_stop_hp_work(spec);
} }
static void set_widgets_power_state(struct hda_codec *codec) static void set_widgets_power_state(struct hda_codec *codec)
...@@ -343,12 +352,7 @@ static int analog_input_switch_put(struct snd_kcontrol *kcontrol, ...@@ -343,12 +352,7 @@ static int analog_input_switch_put(struct snd_kcontrol *kcontrol,
set_widgets_power_state(codec); set_widgets_power_state(codec);
analog_low_current_mode(snd_kcontrol_chip(kcontrol)); analog_low_current_mode(snd_kcontrol_chip(kcontrol));
if (snd_hda_get_bool_hint(codec, "analog_loopback_hp_detect") == 1) { vt1708_update_hp_work(codec->spec);
if (is_aa_path_mute(codec))
vt1708_start_hp_work(codec->spec);
else
vt1708_stop_hp_work(codec->spec);
}
return change; return change;
} }
...@@ -1154,7 +1158,7 @@ static int via_playback_multi_pcm_prepare(struct hda_pcm_stream *hinfo, ...@@ -1154,7 +1158,7 @@ static int via_playback_multi_pcm_prepare(struct hda_pcm_stream *hinfo,
spec->cur_dac_stream_tag = stream_tag; spec->cur_dac_stream_tag = stream_tag;
spec->cur_dac_format = format; spec->cur_dac_format = format;
mutex_unlock(&spec->config_mutex); mutex_unlock(&spec->config_mutex);
vt1708_start_hp_work(spec); vt1708_update_hp_work(spec);
return 0; return 0;
} }
...@@ -1174,7 +1178,7 @@ static int via_playback_hp_pcm_prepare(struct hda_pcm_stream *hinfo, ...@@ -1174,7 +1178,7 @@ static int via_playback_hp_pcm_prepare(struct hda_pcm_stream *hinfo,
spec->cur_hp_stream_tag = stream_tag; spec->cur_hp_stream_tag = stream_tag;
spec->cur_hp_format = format; spec->cur_hp_format = format;
mutex_unlock(&spec->config_mutex); mutex_unlock(&spec->config_mutex);
vt1708_start_hp_work(spec); vt1708_update_hp_work(spec);
return 0; return 0;
} }
...@@ -1188,7 +1192,7 @@ static int via_playback_multi_pcm_cleanup(struct hda_pcm_stream *hinfo, ...@@ -1188,7 +1192,7 @@ static int via_playback_multi_pcm_cleanup(struct hda_pcm_stream *hinfo,
snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); snd_hda_multi_out_analog_cleanup(codec, &spec->multiout);
spec->active_streams &= ~STREAM_MULTI_OUT; spec->active_streams &= ~STREAM_MULTI_OUT;
mutex_unlock(&spec->config_mutex); mutex_unlock(&spec->config_mutex);
vt1708_stop_hp_work(spec); vt1708_update_hp_work(spec);
return 0; return 0;
} }
...@@ -1203,7 +1207,7 @@ static int via_playback_hp_pcm_cleanup(struct hda_pcm_stream *hinfo, ...@@ -1203,7 +1207,7 @@ static int via_playback_hp_pcm_cleanup(struct hda_pcm_stream *hinfo,
snd_hda_codec_setup_stream(codec, spec->hp_dac_nid, 0, 0, 0); snd_hda_codec_setup_stream(codec, spec->hp_dac_nid, 0, 0, 0);
spec->active_streams &= ~STREAM_INDEP_HP; spec->active_streams &= ~STREAM_INDEP_HP;
mutex_unlock(&spec->config_mutex); mutex_unlock(&spec->config_mutex);
vt1708_stop_hp_work(spec); vt1708_update_hp_work(spec);
return 0; return 0;
} }
...@@ -1645,7 +1649,8 @@ static void via_hp_automute(struct hda_codec *codec) ...@@ -1645,7 +1649,8 @@ static void via_hp_automute(struct hda_codec *codec)
int nums; int nums;
struct via_spec *spec = codec->spec; struct via_spec *spec = codec->spec;
if (!spec->hp_independent_mode && spec->autocfg.hp_pins[0]) if (!spec->hp_independent_mode && spec->autocfg.hp_pins[0] &&
(spec->codec_type != VT1708 || spec->vt1708_jack_detect))
present = snd_hda_jack_detect(codec, spec->autocfg.hp_pins[0]); present = snd_hda_jack_detect(codec, spec->autocfg.hp_pins[0]);
if (spec->smart51_enabled) if (spec->smart51_enabled)
...@@ -2612,8 +2617,6 @@ static int vt1708_jack_detect_get(struct snd_kcontrol *kcontrol, ...@@ -2612,8 +2617,6 @@ static int vt1708_jack_detect_get(struct snd_kcontrol *kcontrol,
if (spec->codec_type != VT1708) if (spec->codec_type != VT1708)
return 0; return 0;
spec->vt1708_jack_detect =
!((snd_hda_codec_read(codec, 0x1, 0, 0xf84, 0) >> 8) & 0x1);
ucontrol->value.integer.value[0] = spec->vt1708_jack_detect; ucontrol->value.integer.value[0] = spec->vt1708_jack_detect;
return 0; return 0;
} }
...@@ -2623,18 +2626,22 @@ static int vt1708_jack_detect_put(struct snd_kcontrol *kcontrol, ...@@ -2623,18 +2626,22 @@ static int vt1708_jack_detect_put(struct snd_kcontrol *kcontrol,
{ {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct via_spec *spec = codec->spec; struct via_spec *spec = codec->spec;
int change; int val;
if (spec->codec_type != VT1708) if (spec->codec_type != VT1708)
return 0; return 0;
spec->vt1708_jack_detect = ucontrol->value.integer.value[0]; val = !!ucontrol->value.integer.value[0];
change = (0x1 & (snd_hda_codec_read(codec, 0x1, 0, 0xf84, 0) >> 8)) if (spec->vt1708_jack_detect == val)
== !spec->vt1708_jack_detect; return 0;
if (spec->vt1708_jack_detect) { spec->vt1708_jack_detect = val;
if (spec->vt1708_jack_detect &&
snd_hda_get_bool_hint(codec, "analog_loopback_hp_detect") != 1) {
mute_aa_path(codec, 1); mute_aa_path(codec, 1);
notify_aa_path_ctls(codec); notify_aa_path_ctls(codec);
} }
return change; via_hp_automute(codec);
vt1708_update_hp_work(spec);
return 1;
} }
static const struct snd_kcontrol_new vt1708_jack_detect_ctl = { static const struct snd_kcontrol_new vt1708_jack_detect_ctl = {
...@@ -2771,6 +2778,7 @@ static int via_init(struct hda_codec *codec) ...@@ -2771,6 +2778,7 @@ static int via_init(struct hda_codec *codec)
via_auto_init_unsol_event(codec); via_auto_init_unsol_event(codec);
via_hp_automute(codec); via_hp_automute(codec);
vt1708_update_hp_work(spec);
return 0; return 0;
} }
...@@ -2787,7 +2795,9 @@ static void vt1708_update_hp_jack_state(struct work_struct *work) ...@@ -2787,7 +2795,9 @@ static void vt1708_update_hp_jack_state(struct work_struct *work)
spec->vt1708_hp_present ^= 1; spec->vt1708_hp_present ^= 1;
via_hp_automute(spec->codec); via_hp_automute(spec->codec);
} }
vt1708_start_hp_work(spec); if (spec->vt1708_jack_detect)
schedule_delayed_work(&spec->vt1708_hp_work,
msecs_to_jiffies(100));
} }
static int get_mux_nids(struct hda_codec *codec) static int get_mux_nids(struct hda_codec *codec)
......
...@@ -78,10 +78,15 @@ unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port) ...@@ -78,10 +78,15 @@ unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port)
return ioread32(address); return ioread32(address);
} }
void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, u32 len) static void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data,
u32 len)
{ {
void __iomem *address = lx_dsp_register(chip, port); u32 __iomem *address = lx_dsp_register(chip, port);
memcpy_fromio(data, address, len*sizeof(u32)); int i;
/* we cannot use memcpy_fromio */
for (i = 0; i != len; ++i)
data[i] = ioread32(address + i);
} }
...@@ -91,11 +96,15 @@ void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data) ...@@ -91,11 +96,15 @@ void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data)
iowrite32(data, address); iowrite32(data, address);
} }
void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, const u32 *data, static void lx_dsp_reg_writebuf(struct lx6464es *chip, int port,
u32 len) const u32 *data, u32 len)
{ {
void __iomem *address = lx_dsp_register(chip, port); u32 __iomem *address = lx_dsp_register(chip, port);
memcpy_toio(address, data, len*sizeof(u32)); int i;
/* we cannot use memcpy_to */
for (i = 0; i != len; ++i)
iowrite32(data[i], address + i);
} }
......
...@@ -72,10 +72,7 @@ enum { ...@@ -72,10 +72,7 @@ enum {
}; };
unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port); unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port);
void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, u32 len);
void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data); void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data);
void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, const u32 *data,
u32 len);
/* plx register access */ /* plx register access */
enum { enum {
......
...@@ -6518,7 +6518,7 @@ static int __devinit snd_hdspm_create(struct snd_card *card, ...@@ -6518,7 +6518,7 @@ static int __devinit snd_hdspm_create(struct snd_card *card,
hdspm->io_type = AES32; hdspm->io_type = AES32;
hdspm->card_name = "RME AES32"; hdspm->card_name = "RME AES32";
hdspm->midiPorts = 2; hdspm->midiPorts = 2;
} else if ((hdspm->firmware_rev == 0xd5) || } else if ((hdspm->firmware_rev == 0xd2) ||
((hdspm->firmware_rev >= 0xc8) && ((hdspm->firmware_rev >= 0xc8) &&
(hdspm->firmware_rev <= 0xcf))) { (hdspm->firmware_rev <= 0xcf))) {
hdspm->io_type = MADI; hdspm->io_type = MADI;
......
...@@ -245,7 +245,7 @@ static const char *adau1373_bass_hpf_cutoff_text[] = { ...@@ -245,7 +245,7 @@ static const char *adau1373_bass_hpf_cutoff_text[] = {
}; };
static const unsigned int adau1373_bass_tlv[] = { 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), 0, 2, TLV_DB_SCALE_ITEM(-600, 600, 1),
3, 4, TLV_DB_SCALE_ITEM(950, 250, 0), 3, 4, TLV_DB_SCALE_ITEM(950, 250, 0),
5, 7, TLV_DB_SCALE_ITEM(1400, 150, 0), 5, 7, TLV_DB_SCALE_ITEM(1400, 150, 0),
......
...@@ -434,7 +434,8 @@ static int cs4271_soc_suspend(struct snd_soc_codec *codec, pm_message_t mesg) ...@@ -434,7 +434,8 @@ static int cs4271_soc_suspend(struct snd_soc_codec *codec, pm_message_t mesg)
{ {
int ret; int ret;
/* Set power-down bit */ /* Set power-down bit */
ret = snd_soc_update_bits(codec, CS4271_MODE2, 0, CS4271_MODE2_PDN); ret = snd_soc_update_bits(codec, CS4271_MODE2, CS4271_MODE2_PDN,
CS4271_MODE2_PDN);
if (ret < 0) if (ret < 0)
return ret; return ret;
return 0; return 0;
...@@ -501,8 +502,9 @@ static int cs4271_probe(struct snd_soc_codec *codec) ...@@ -501,8 +502,9 @@ static int cs4271_probe(struct snd_soc_codec *codec)
return ret; return ret;
} }
ret = snd_soc_update_bits(codec, CS4271_MODE2, 0, ret = snd_soc_update_bits(codec, CS4271_MODE2,
CS4271_MODE2_PDN | CS4271_MODE2_CPEN); CS4271_MODE2_PDN | CS4271_MODE2_CPEN,
CS4271_MODE2_PDN | CS4271_MODE2_CPEN);
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = snd_soc_update_bits(codec, CS4271_MODE2, CS4271_MODE2_PDN, 0); ret = snd_soc_update_bits(codec, CS4271_MODE2, CS4271_MODE2_PDN, 0);
......
...@@ -177,7 +177,7 @@ static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -95625, 375, 0); ...@@ -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); static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);
/* {0, +20, +24, +30, +35, +40, +44, +50, +52}dB */ /* {0, +20, +24, +30, +35, +40, +44, +50, +52}dB */
static unsigned int mic_bst_tlv[] = { static unsigned int mic_bst_tlv[] = {
TLV_DB_RANGE_HEAD(6), TLV_DB_RANGE_HEAD(7),
0, 0, TLV_DB_SCALE_ITEM(0, 0, 0), 0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0), 1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0),
2, 2, TLV_DB_SCALE_ITEM(2400, 0, 0), 2, 2, TLV_DB_SCALE_ITEM(2400, 0, 0),
......
...@@ -365,7 +365,7 @@ static const DECLARE_TLV_DB_SCALE(capture_6db_attenuate, -600, 600, 0); ...@@ -365,7 +365,7 @@ static const DECLARE_TLV_DB_SCALE(capture_6db_attenuate, -600, 600, 0);
/* tlv for mic gain, 0db 20db 30db 40db */ /* tlv for mic gain, 0db 20db 30db 40db */
static const unsigned int mic_gain_tlv[] = { static const unsigned int mic_gain_tlv[] = {
TLV_DB_RANGE_HEAD(4), TLV_DB_RANGE_HEAD(2),
0, 0, TLV_DB_SCALE_ITEM(0, 0, 0), 0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
1, 3, TLV_DB_SCALE_ITEM(2000, 1000, 0), 1, 3, TLV_DB_SCALE_ITEM(2000, 1000, 0),
}; };
......
...@@ -76,6 +76,8 @@ struct sta32x_priv { ...@@ -76,6 +76,8 @@ struct sta32x_priv {
unsigned int mclk; unsigned int mclk;
unsigned int format; unsigned int format;
u32 coef_shadow[STA32X_COEF_COUNT];
}; };
static const DECLARE_TLV_DB_SCALE(mvol_tlv, -12700, 50, 1); static const DECLARE_TLV_DB_SCALE(mvol_tlv, -12700, 50, 1);
...@@ -227,6 +229,7 @@ static int sta32x_coefficient_put(struct snd_kcontrol *kcontrol, ...@@ -227,6 +229,7 @@ static int sta32x_coefficient_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 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 numcoef = kcontrol->private_value >> 16;
int index = kcontrol->private_value & 0xffff; int index = kcontrol->private_value & 0xffff;
unsigned int cfud; unsigned int cfud;
...@@ -239,6 +242,11 @@ static int sta32x_coefficient_put(struct snd_kcontrol *kcontrol, ...@@ -239,6 +242,11 @@ static int sta32x_coefficient_put(struct snd_kcontrol *kcontrol,
snd_soc_write(codec, STA32X_CFUD, cfud); snd_soc_write(codec, STA32X_CFUD, cfud);
snd_soc_write(codec, STA32X_CFADDR2, index); 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++) for (i = 0; i < 3 * numcoef; i++)
snd_soc_write(codec, STA32X_B1CF1 + i, snd_soc_write(codec, STA32X_B1CF1 + i,
ucontrol->value.bytes.data[i]); ucontrol->value.bytes.data[i]);
...@@ -252,6 +260,48 @@ static int sta32x_coefficient_put(struct snd_kcontrol *kcontrol, ...@@ -252,6 +260,48 @@ static int sta32x_coefficient_put(struct snd_kcontrol *kcontrol,
return 0; 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) \ #define SINGLE_COEF(xname, index) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.info = sta32x_coefficient_info, \ .info = sta32x_coefficient_info, \
...@@ -661,7 +711,7 @@ static int sta32x_set_bias_level(struct snd_soc_codec *codec, ...@@ -661,7 +711,7 @@ static int sta32x_set_bias_level(struct snd_soc_codec *codec,
return ret; return ret;
} }
snd_soc_cache_sync(codec); sta32x_cache_sync(codec);
} }
/* Power up to mute */ /* Power up to mute */
...@@ -790,6 +840,17 @@ static int sta32x_probe(struct snd_soc_codec *codec) ...@@ -790,6 +840,17 @@ static int sta32x_probe(struct snd_soc_codec *codec)
STA32X_CxCFG_OM_MASK, STA32X_CxCFG_OM_MASK,
2 << STA32X_CxCFG_OM_SHIFT); 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); sta32x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
/* Bias level configuration will have done an extra enable */ /* Bias level configuration will have done an extra enable */
regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
/* STA326 register addresses */ /* STA326 register addresses */
#define STA32X_REGISTER_COUNT 0x2d #define STA32X_REGISTER_COUNT 0x2d
#define STA32X_COEF_COUNT 62
#define STA32X_CONFA 0x00 #define STA32X_CONFA 0x00
#define STA32X_CONFB 0x01 #define STA32X_CONFB 0x01
......
...@@ -453,6 +453,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, ...@@ -453,6 +453,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
snd_soc_write(codec, WM8731_PWR, 0xffff); snd_soc_write(codec, WM8731_PWR, 0xffff);
regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies),
wm8731->supplies); wm8731->supplies);
codec->cache_sync = 1;
break; break;
} }
codec->dapm.bias_level = level; codec->dapm.bias_level = level;
......
...@@ -190,6 +190,9 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol, ...@@ -190,6 +190,9 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol,
struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec); struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
u16 ioctl; u16 ioctl;
if (wm8753->dai_func == ucontrol->value.integer.value[0])
return 0;
if (codec->active) if (codec->active)
return -EBUSY; return -EBUSY;
......
...@@ -1973,7 +1973,7 @@ static int wm8962_reset(struct snd_soc_codec *codec) ...@@ -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(inpga_tlv, -2325, 75, 0);
static const DECLARE_TLV_DB_SCALE(mixin_tlv, -1500, 300, 0); static const DECLARE_TLV_DB_SCALE(mixin_tlv, -1500, 300, 0);
static const unsigned int mixinpga_tlv[] = { static const unsigned int mixinpga_tlv[] = {
TLV_DB_RANGE_HEAD(7), TLV_DB_RANGE_HEAD(5),
0, 1, TLV_DB_SCALE_ITEM(0, 600, 0), 0, 1, TLV_DB_SCALE_ITEM(0, 600, 0),
2, 2, TLV_DB_SCALE_ITEM(1300, 1300, 0), 2, 2, TLV_DB_SCALE_ITEM(1300, 1300, 0),
3, 4, TLV_DB_SCALE_ITEM(1800, 200, 0), 3, 4, TLV_DB_SCALE_ITEM(1800, 200, 0),
...@@ -1988,7 +1988,7 @@ static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0); ...@@ -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(out_tlv, -12100, 100, 1);
static const DECLARE_TLV_DB_SCALE(hp_tlv, -700, 100, 0); static const DECLARE_TLV_DB_SCALE(hp_tlv, -700, 100, 0);
static const unsigned int classd_tlv[] = { static const unsigned int classd_tlv[] = {
TLV_DB_RANGE_HEAD(7), TLV_DB_RANGE_HEAD(2),
0, 6, TLV_DB_SCALE_ITEM(0, 150, 0), 0, 6, TLV_DB_SCALE_ITEM(0, 150, 0),
7, 7, TLV_DB_SCALE_ITEM(1200, 0, 0), 7, 7, TLV_DB_SCALE_ITEM(1200, 0, 0),
}; };
......
...@@ -512,7 +512,7 @@ static const DECLARE_TLV_DB_SCALE(drc_comp_threash, -4500, 75, 0); ...@@ -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_comp_amp, -2250, 75, 0);
static const DECLARE_TLV_DB_SCALE(drc_min_tlv, -1800, 600, 0); static const DECLARE_TLV_DB_SCALE(drc_min_tlv, -1800, 600, 0);
static const unsigned int drc_max_tlv[] = { static const unsigned int drc_max_tlv[] = {
TLV_DB_RANGE_HEAD(4), TLV_DB_RANGE_HEAD(2),
0, 2, TLV_DB_SCALE_ITEM(1200, 600, 0), 0, 2, TLV_DB_SCALE_ITEM(1200, 600, 0),
3, 3, TLV_DB_SCALE_ITEM(3600, 0, 0), 3, 3, TLV_DB_SCALE_ITEM(3600, 0, 0),
}; };
......
...@@ -807,7 +807,6 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec, ...@@ -807,7 +807,6 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec,
mdelay(100); mdelay(100);
/* Normal bias enable & soft start off */ /* Normal bias enable & soft start off */
reg |= WM9081_BIAS_ENA;
reg &= ~WM9081_VMID_RAMP; reg &= ~WM9081_VMID_RAMP;
snd_soc_write(codec, WM9081_VMID_CONTROL, reg); snd_soc_write(codec, WM9081_VMID_CONTROL, reg);
...@@ -818,7 +817,7 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec, ...@@ -818,7 +817,7 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec,
} }
/* VMID 2*240k */ /* VMID 2*240k */
reg = snd_soc_read(codec, WM9081_BIAS_CONTROL_1); reg = snd_soc_read(codec, WM9081_VMID_CONTROL);
reg &= ~WM9081_VMID_SEL_MASK; reg &= ~WM9081_VMID_SEL_MASK;
reg |= 0x04; reg |= 0x04;
snd_soc_write(codec, WM9081_VMID_CONTROL, reg); snd_soc_write(codec, WM9081_VMID_CONTROL, reg);
...@@ -830,14 +829,15 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec, ...@@ -830,14 +829,15 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec,
break; break;
case SND_SOC_BIAS_OFF: case SND_SOC_BIAS_OFF:
/* Startup bias source */ /* Startup bias source and disable bias */
reg = snd_soc_read(codec, WM9081_BIAS_CONTROL_1); reg = snd_soc_read(codec, WM9081_BIAS_CONTROL_1);
reg |= WM9081_BIAS_SRC; reg |= WM9081_BIAS_SRC;
reg &= ~WM9081_BIAS_ENA;
snd_soc_write(codec, WM9081_BIAS_CONTROL_1, reg); snd_soc_write(codec, WM9081_BIAS_CONTROL_1, reg);
/* Disable VMID and biases with soft ramping */ /* Disable VMID with soft ramping */
reg = snd_soc_read(codec, WM9081_VMID_CONTROL); reg = snd_soc_read(codec, WM9081_VMID_CONTROL);
reg &= ~(WM9081_VMID_SEL_MASK | WM9081_BIAS_ENA); reg &= ~WM9081_VMID_SEL_MASK;
reg |= WM9081_VMID_RAMP; reg |= WM9081_VMID_RAMP;
snd_soc_write(codec, WM9081_VMID_CONTROL, reg); snd_soc_write(codec, WM9081_VMID_CONTROL, reg);
......
...@@ -177,19 +177,19 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec) ...@@ -177,19 +177,19 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec)
} }
static const unsigned int in_tlv[] = { static const unsigned int in_tlv[] = {
TLV_DB_RANGE_HEAD(6), TLV_DB_RANGE_HEAD(3),
0, 0, TLV_DB_SCALE_ITEM(-600, 0, 0), 0, 0, TLV_DB_SCALE_ITEM(-600, 0, 0),
1, 3, TLV_DB_SCALE_ITEM(-350, 350, 0), 1, 3, TLV_DB_SCALE_ITEM(-350, 350, 0),
4, 6, TLV_DB_SCALE_ITEM(600, 600, 0), 4, 6, TLV_DB_SCALE_ITEM(600, 600, 0),
}; };
static const unsigned int mix_tlv[] = { static const unsigned int mix_tlv[] = {
TLV_DB_RANGE_HEAD(4), TLV_DB_RANGE_HEAD(2),
0, 2, TLV_DB_SCALE_ITEM(-1200, 300, 0), 0, 2, TLV_DB_SCALE_ITEM(-1200, 300, 0),
3, 3, TLV_DB_SCALE_ITEM(0, 0, 0), 3, 3, TLV_DB_SCALE_ITEM(0, 0, 0),
}; };
static const DECLARE_TLV_DB_SCALE(out_tlv, -5700, 100, 0); static const DECLARE_TLV_DB_SCALE(out_tlv, -5700, 100, 0);
static const unsigned int spkboost_tlv[] = { static const unsigned int spkboost_tlv[] = {
TLV_DB_RANGE_HEAD(7), TLV_DB_RANGE_HEAD(2),
0, 6, TLV_DB_SCALE_ITEM(0, 150, 0), 0, 6, TLV_DB_SCALE_ITEM(0, 150, 0),
7, 7, TLV_DB_SCALE_ITEM(1200, 0, 0), 7, 7, TLV_DB_SCALE_ITEM(1200, 0, 0),
}; };
......
...@@ -40,7 +40,7 @@ static const DECLARE_TLV_DB_SCALE(outmix_tlv, -2100, 300, 0); ...@@ -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(spkmixout_tlv, -1800, 600, 1);
static const DECLARE_TLV_DB_SCALE(outpga_tlv, -5700, 100, 0); static const DECLARE_TLV_DB_SCALE(outpga_tlv, -5700, 100, 0);
static const unsigned int spkboost_tlv[] = { static const unsigned int spkboost_tlv[] = {
TLV_DB_RANGE_HEAD(7), TLV_DB_RANGE_HEAD(2),
0, 6, TLV_DB_SCALE_ITEM(0, 150, 0), 0, 6, TLV_DB_SCALE_ITEM(0, 150, 0),
7, 7, TLV_DB_SCALE_ITEM(1200, 0, 0), 7, 7, TLV_DB_SCALE_ITEM(1200, 0, 0),
}; };
......
...@@ -694,6 +694,7 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev) ...@@ -694,6 +694,7 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev)
/* Initialize the the device_attribute structure */ /* Initialize the the device_attribute structure */
dev_attr = &ssi_private->dev_attr; dev_attr = &ssi_private->dev_attr;
sysfs_attr_init(&dev_attr->attr);
dev_attr->attr.name = "statistics"; dev_attr->attr.name = "statistics";
dev_attr->attr.mode = S_IRUGO; dev_attr->attr.mode = S_IRUGO;
dev_attr->show = fsl_sysfs_ssi_show; dev_attr->show = fsl_sysfs_ssi_show;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册