diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-11-25 10:03:55 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-11-25 10:03:55 +0100 |
commit | 458d299264ea398cfd5ac216e3b0ef218a68937e (patch) | |
tree | a67a1d39d798d3c51e685d8d0623b28307019d29 | |
parent | d1c9a38291a3b77627b6c4bfb980142c9fba3521 (diff) | |
download | hda-emu-458d299264ea398cfd5ac216e3b0ef218a68937e.tar.gz |
Allow the direct pin config via -P option
Like -H option, now hda-emu accepts the pin config value directly
specified via -P option like 0x0a=0x12345678.
-rw-r--r-- | README | 3 | ||||
-rw-r--r-- | hda-emu.c | 11 |
2 files changed, 13 insertions, 1 deletions
@@ -420,7 +420,8 @@ the pin-default contents found in hwC0D0/init_pin_configs sysfs file. You can also pass an external file name to -P option instead of the sysfs files in the input file. The file must contain a pair of register and pin-config value in each line just like in *_pin_configs -sysfs files. +sysfs files. Also, you can pass a pin config directly via -P optoin, +e.g. -P 0x0a=0x12345678. Similarly, you can give the initial hints strings either from sysfs file in alsa-info.sh output or an external file via -H option. Also, @@ -1092,6 +1092,17 @@ static int override_pincfg(struct xhda_codec *codec, char *pincfg) struct xhda_sysfs_list *sys; int is_fw_file, is_in_pincfg; + if (strchr(pincfg, '=')) { + /* direct pincfg string */ + int reg, val; + if (sscanf(pincfg, "%i %i", ®, &val) != 2) { + hda_log(HDA_LOG_ERR, "Invalid pincfg %s\n", pincfg); + return -EINVAL; + } + set_pincfg(codec, reg, val); + return 0; + } + for (sys = codec->sysfs_list; sys; sys = sys->next) { if (sys->type == XHDA_SYS_PINCFG && !strcmp(sys->id, pincfg)) { |