Skip to content

Commit

Permalink
ALSA: hda - Always allow access for POWER_STATE verbs via regmap
Browse files Browse the repository at this point in the history
The hdac regmap code checks whether the codec is powered on while
accessing, but there must be an exception -- the verbs to control the
power state.

Currently HD-audio driver doesn't access them via regmap, so this
patch doesn't fix any current behavior, but it's just for future.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Apr 9, 2015
1 parent 664c715 commit 9efe273
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sound/hda/hdac_regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static int hda_reg_read(void *context, unsigned int reg, unsigned int *val)
int verb = get_verb(reg);
int err;

if (!codec_is_running(codec))
if (!codec_is_running(codec) && verb != AC_VERB_GET_POWER_STATE)
return -EAGAIN;
reg |= (codec->addr << 28);
if (is_stereo_amp_verb(reg))
Expand All @@ -265,16 +265,16 @@ static int hda_reg_write(void *context, unsigned int reg, unsigned int val)
unsigned int verb;
int i, bytes, err;

if (!codec_is_running(codec))
return codec->lazy_cache ? 0 : -EAGAIN;

reg &= ~0x00080000U; /* drop GET bit */
reg |= (codec->addr << 28);
verb = get_verb(reg);

if (!codec_is_running(codec) && verb != AC_VERB_SET_POWER_STATE)
return codec->lazy_cache ? 0 : -EAGAIN;

if (is_stereo_amp_verb(reg))
return hda_reg_write_stereo_amp(codec, reg, val);

verb = get_verb(reg);
if (verb == AC_VERB_SET_PROC_COEF)
return hda_reg_write_coef(codec, reg, val);

Expand Down

0 comments on commit 9efe273

Please sign in to comment.