Skip to content

Commit

Permalink
ALSA: hda - Handle a few verbs as read-only
Browse files Browse the repository at this point in the history
Although they can be written, handle a few verbs as read-only in
regmap interface: CONFIG_DEFAULT, CONV and CVT_CHAN_COUNT.  These are
either updated in PCM or HDMI management code in a volatile manner, or
just needed only as parameter, thus they don't need to be written at
resume sync.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Mar 26, 2015
1 parent 40ba66a commit 8bc174e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sound/hda/hdac_regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,19 @@ static bool hda_writeable_reg(struct device *dev, unsigned int reg)
switch (verb) {
case AC_VERB_GET_CONNECT_SEL:
case AC_VERB_GET_SDI_SELECT:
case AC_VERB_GET_CONV:
case AC_VERB_GET_PIN_WIDGET_CONTROL:
case AC_VERB_GET_UNSOLICITED_RESPONSE: /* only as SET_UNSOLICITED_ENABLE */
case AC_VERB_GET_BEEP_CONTROL:
case AC_VERB_GET_EAPD_BTLENABLE:
case AC_VERB_GET_DIGI_CONVERT_1:
case AC_VERB_GET_DIGI_CONVERT_2: /* only for beep control */
case AC_VERB_GET_VOLUME_KNOB_CONTROL:
case AC_VERB_GET_CONFIG_DEFAULT:
case AC_VERB_GET_GPIO_MASK:
case AC_VERB_GET_GPIO_DIRECTION:
case AC_VERB_GET_GPIO_DATA: /* not for volatile read */
case AC_VERB_GET_GPIO_WAKE_MASK:
case AC_VERB_GET_GPIO_UNSOLICITED_RSP_MASK:
case AC_VERB_GET_GPIO_STICKY_MASK:
case AC_VERB_GET_CVT_CHAN_COUNT:
return true;
}

Expand All @@ -123,6 +120,13 @@ static bool hda_readable_reg(struct device *dev, unsigned int reg)
case AC_VERB_GET_CONNECT_LIST:
case AC_VERB_GET_SUBSYSTEM_ID:
return true;
/* below are basically writable, but disabled for reducing unnecessary
* writes at sync
*/
case AC_VERB_GET_CONFIG_DEFAULT: /* usually just read */
case AC_VERB_GET_CONV: /* managed in PCM code */
case AC_VERB_GET_CVT_CHAN_COUNT: /* managed in HDMI CA code */
return true;
}

return hda_writeable_reg(dev, reg);
Expand Down

0 comments on commit 8bc174e

Please sign in to comment.