summaryrefslogtreecommitdiff
path: root/sound/pci/hda/patch_hdmi.c
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2013-02-19 19:11:26 +0400
committerTakashi Iwai <tiwai@suse.de>2013-02-19 21:28:38 +0400
commit92c69e796b83f922c81a5cf7968cb114a7fa14c6 (patch)
tree1a6612d2e6e27d5e588b67dfbc70d76446dd2e4c /sound/pci/hda/patch_hdmi.c
parent4bd038f9d80216a6e95c5c36fae5054a83ea75d7 (diff)
downloadlinux-92c69e796b83f922c81a5cf7968cb114a7fa14c6.tar.xz
ALSA: hda - hdmi: Notify userspace when ELD control changes
ELD validity can change during the lifetime of a presence detect, so we need to be able to listen for changes on the ELD control. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_hdmi.c')
-rw-r--r--sound/pci/hda/patch_hdmi.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index e77735d804a3..21425fb51fe0 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -75,6 +75,7 @@ struct hdmi_spec_per_pin {
struct hda_codec *codec;
struct hdmi_eld sink_eld;
struct delayed_work work;
+ struct snd_kcontrol *eld_ctl;
int repoll_count;
bool non_pcm;
bool chmap_set; /* channel-map override by ALSA API? */
@@ -413,6 +414,7 @@ static int hdmi_create_eld_ctl(struct hda_codec *codec, int pin_idx,
if (err < 0)
return err;
+ spec->pins[pin_idx].eld_ctl = kctl;
return 0;
}
@@ -1220,11 +1222,14 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
}
mutex_lock(&pin_eld->lock);
- if (pin_eld->eld_valid && !eld->eld_valid)
+ if (pin_eld->eld_valid && !eld->eld_valid) {
update_eld = true;
+ eld_changed = true;
+ }
if (update_eld) {
pin_eld->eld_valid = eld->eld_valid;
- eld_changed = memcmp(pin_eld->eld_buffer, eld->eld_buffer,
+ eld_changed = pin_eld->eld_size != eld->eld_size ||
+ memcmp(pin_eld->eld_buffer, eld->eld_buffer,
eld->eld_size) != 0;
if (eld_changed)
memcpy(pin_eld->eld_buffer, eld->eld_buffer,
@@ -1233,6 +1238,11 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
pin_eld->info = eld->info;
}
mutex_unlock(&pin_eld->lock);
+
+ if (eld_changed)
+ snd_ctl_notify(codec->bus->card,
+ SNDRV_CTL_EVENT_MASK_VALUE | SNDRV_CTL_EVENT_MASK_INFO,
+ &per_pin->eld_ctl->id);
}
static void hdmi_repoll_eld(struct work_struct *work)