[alsa-devel] idt blue jack patch

Takashi Iwai tiwai at suse.de
Fri Feb 20 18:18:31 CET 2009

At Fri, 20 Feb 2009 09:00:01 +0800,
Wu Fengguang wrote:
> Hi Tobin,
> Here are the Linux and WinXP pin configurations.
> Both Linux and WinXP configure node 0x0c as an output pin.
> However the driver seems to be offering three schemes:
>         scheme desc             0xC dev
> ------------------------------------------------------
>         IDS_CONFIG_OPEN         Speaker_Side/LineIn
>         IDS_CONFIG_51           LineIn
>         IDS_CONFIG_71           Speaker_Side
> Paulo, maybe you can run these commands to switch between
> linein/lineout modes:
>         # wget http://www.kernel.org/pub/linux/kernel/people/tiwai/misc/hda-verb-0.3.tar.bz2
>         # set PIN_IN mode
>         hda-verb /dev/snd/hwC0D2 0x0c SET_PIN_WIDGET_CONTROL 0x20
>         # set PIN_OUT mode
>         hda-verb /dev/snd/hwC0D2 0x0c SET_PIN_WIDGET_CONTROL 0x40

Regarding the default pin configurations.
I made a series of patches to add the interface to change the default
pincfg values dynamically via hwdep sysfs.  The patches are found in
test/hda-pincfg branch of sound git tree

and included in the very latest alsa-driver-unstable snapshot

Basically, you can get / set the default pincfg values on the fly, and
trigger the codec reconfiguration after that.

The init_pin_configs file shows the initial default pincfgs set by BIOS.

	# cat /sys/class/sound/hwC0D0/init_pin_configs
	0x14 0x9993013f
	0x15 0x01014c10
	0x16 0x99030120
	0x18 0x01a19c30
	0x19 0x02a11c31
	0x1a 0x01813c32
	0x1b 0x02211c1f
	0x1c 0x99330133
	0x1d 0x411111f0
	0x1e 0x411111f0
	0x1f 0x411111f0

Then, you can override the default value by writing to
override_pin_configs sysfs file.

	# cat /sys/class/sound/hwC0D0/override_pin_configs
	# echo 0x1d 0x02a11c30 > /sys/class/sound/hwC0D0/override_pin_configs
	# cat /sys/class/sound/hwC0D0/override_pin_configs
	0x1d 0x02a11c30

Note that this value won't appear in init_pin_configs.

Also, there is another file, cur_pin_configs.  This contains the
pincfgs that are set by the driver explicitly.  For example,
the static pincfg table in patch_sigmatel.c appears here.

Then you can trigger the codec reconfiguration by

	# echo 1 > /sys/class/sound/hwC0D0/reconfig

This will re-setup the driver based on the given pin configs.

Unfortunately, in the current scenario, it can't override the static
pincfg table in the driver like in patch_sigmatel.c.  It's just for
fixing and BIOS setup.


More information about the Alsa-devel mailing list