]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda - Add a fake stereo amp register support
authorTakashi Iwai <tiwai@suse.de>
Wed, 4 Mar 2015 19:43:20 +0000 (20:43 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 23 Mar 2015 12:19:42 +0000 (13:19 +0100)
commitc28ce64cc941053370c9dfdaa7e7059f2dc43bae
treebee10919b779f05bda95eb8c5ac2610226e79396
parent74cf158914fd48297238238f6e449a805fb8d87c
ALSA: hda - Add a fake stereo amp register support

HD-audio spec is inconvenient regarding the handling of stereo volume
controls.  It can set and get only single channel at once (although
there is a special option to set the same value to both channels).
This patch provides a fake pseudo-register via the regmap access so
that the stereo channels can be read and written by a single call.
It'd be useful, for example, for implementing DAPM widgets.

A stereo amp pseudo register consists of the encoding like the normal
amp verbs but it has both SET_LEFT (bit 13) and SET_RIGHT (bit 12)
bits set.  The regmap reads and writes a 16bit value for this pseudo
register where the upper 8bit is for the right chanel and the lower
8bit for the left channel.

Note that the driver doesn't recognize conflicts when both stereo and
mono channel registers are mixed.  Mixing them would certainly confuse
the operation.  So, use carefully.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/hda_regmap.h
sound/hda/hdac_regmap.c