• Takashi Iwai's avatar
    ALSA: hda - Add a fake stereo amp register support · d313e0a8
    Takashi Iwai authored
    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: default avatarTakashi Iwai <tiwai@suse.de>
    d313e0a8
hdac_regmap.c 9.94 KB