aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-11-25 09:57:27 +0100
committerTakashi Iwai <tiwai@suse.de>2013-11-25 09:57:27 +0100
commitd1c9a38291a3b77627b6c4bfb980142c9fba3521 (patch)
tree48cd02de009c45fc06eb53b39b6d75e9cc8cc60d
parent8b184c637acd2fc647a52e4198244cf85669eab4 (diff)
downloadhda-emu-d1c9a38291a3b77627b6c4bfb980142c9fba3521.tar.gz
Allow to pass a direct hint via -H option
If a string with '=' is passed to -H option, hda-emu parses the value and handles as a hint string directly.
-rw-r--r--README3
-rw-r--r--hda-emu.c9
2 files changed, 11 insertions, 1 deletions
diff --git a/README b/README
index 6e31a44..914e67d 100644
--- a/README
+++ b/README
@@ -423,7 +423,8 @@ register and pin-config value in each line just like in *_pin_configs
sysfs files.
Similarly, you can give the initial hints strings either from sysfs
-file in alsa-info.sh output or an external file via -H option.
+file in alsa-info.sh output or an external file via -H option. Also,
+you can pass a hint directrly via -H option, e.g. -H "jack_detect=0".
If you want to debug a certain jack-plug state at the initial time,
pass the pin NID to turn on via -j option. When nothing is set, all
diff --git a/hda-emu.c b/hda-emu.c
index 4ac9e34..6d74f2e 100644
--- a/hda-emu.c
+++ b/hda-emu.c
@@ -1146,6 +1146,15 @@ static int load_init_hints(struct xhda_codec *codec, char *hints)
char buf[256];
struct xhda_sysfs_list *sys;
+ if (strchr(hints, '=')) {
+ /* direct hint string */
+ if (_parse_hints(_codec, hints)) {
+ hda_log(HDA_LOG_ERR, "Invalid hints %s\n", hints);
+ return -EINVAL;
+ }
+ return 0;
+ }
+
for (sys = codec->sysfs_list; sys; sys = sys->next) {
if (sys->type == XHDA_SYS_HINTS &&
!strcmp(sys->id, hints)) {