summaryrefslogtreecommitdiffstats
path: root/sound/hda/hdac_device.c
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2015-08-21 15:47:43 +0530
committerTakashi Iwai <tiwai@suse.de>2015-08-21 12:34:50 +0200
commit18dfd79d92e5292611ac4944a67bd837dd7632c9 (patch)
treec267a5d259dd31483d4e32ed004483aa506f3b42 /sound/hda/hdac_device.c
parentd51783c15f7548229e49331d254a738be8ac865c (diff)
downloadlinux-18dfd79d92e5292611ac4944a67bd837dd7632c9.tar.bz2
ALSA: hdac: add snd_hdac_refresh_widget_sysfs()
Some codecs like Intel HDMI by default do not show up all the pins, they have to be manually enabled, so we need to refresh the codec widgets and then recreate the sysfs tree. So add new API snd_hdac_refresh_widget_sysfs() to do this. It should be be used by codec driver after sending magic verbs to codec Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/hda/hdac_device.c')
-rw-r--r--sound/hda/hdac_device.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c
index df7039ebe1fa..aa6d6cec2380 100644
--- a/sound/hda/hdac_device.c
+++ b/sound/hda/hdac_device.c
@@ -372,6 +372,34 @@ int snd_hdac_refresh_widgets(struct hdac_device *codec)
}
EXPORT_SYMBOL_GPL(snd_hdac_refresh_widgets);
+/**
+ * snd_hdac_refresh_widget_sysfs - Reset the codec widgets and reinit the
+ * codec sysfs
+ * @codec: the codec object
+ *
+ * first we need to remove sysfs, then refresh widgets and lastly
+ * recreate it
+ */
+int snd_hdac_refresh_widget_sysfs(struct hdac_device *codec)
+{
+ int ret;
+
+ hda_widget_sysfs_exit(codec);
+ ret = snd_hdac_refresh_widgets(codec);
+ if (ret) {
+ dev_err(&codec->dev, "failed to refresh widget: %d\n", ret);
+ return ret;
+ }
+ ret = hda_widget_sysfs_init(codec);
+ if (ret) {
+ dev_err(&codec->dev, "failed to init sysfs: %d\n", ret);
+ return ret;
+ }
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(snd_hdac_refresh_widget_sysfs);
+
/* return CONNLIST_LEN parameter of the given widget */
static unsigned int get_num_conns(struct hdac_device *codec, hda_nid_t nid)
{