diff options
author | Keyon Jie <yang.jie@linux.intel.com> | 2018-09-02 22:47:09 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-09-03 17:47:40 -0400 |
commit | f7c50fa636f72490baceb1664ba64973137266f2 (patch) | |
tree | 7c3e2b37558196af6fa12802294d3c1a70e79cde | |
parent | 5a7b44a8df822e0667fc76ed7130252523993bda (diff) |
ALSA: hda: Fix several mismatch for register mask and value
E.g. for snd_hdac_ext_link_clear_stream_id(), we should set (1 << stream)
as mask, and 0 as value, here correct it and several similar mismatches.
And, here also remove unreadable register_mask usage for those mask value
updating.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/hda/ext/hdac_ext_stream.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/sound/hda/ext/hdac_ext_stream.c b/sound/hda/ext/hdac_ext_stream.c index 1bd27576db98..a835558ddbc9 100644 --- a/sound/hda/ext/hdac_ext_stream.c +++ b/sound/hda/ext/hdac_ext_stream.c | |||
@@ -146,7 +146,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_decouple); | |||
146 | */ | 146 | */ |
147 | void snd_hdac_ext_link_stream_start(struct hdac_ext_stream *stream) | 147 | void snd_hdac_ext_link_stream_start(struct hdac_ext_stream *stream) |
148 | { | 148 | { |
149 | snd_hdac_updatel(stream->pplc_addr, AZX_REG_PPLCCTL, 0, AZX_PPLCCTL_RUN); | 149 | snd_hdac_updatel(stream->pplc_addr, AZX_REG_PPLCCTL, |
150 | AZX_PPLCCTL_RUN, AZX_PPLCCTL_RUN); | ||
150 | } | 151 | } |
151 | EXPORT_SYMBOL_GPL(snd_hdac_ext_link_stream_start); | 152 | EXPORT_SYMBOL_GPL(snd_hdac_ext_link_stream_start); |
152 | 153 | ||
@@ -171,7 +172,8 @@ void snd_hdac_ext_link_stream_reset(struct hdac_ext_stream *stream) | |||
171 | 172 | ||
172 | snd_hdac_ext_link_stream_clear(stream); | 173 | snd_hdac_ext_link_stream_clear(stream); |
173 | 174 | ||
174 | snd_hdac_updatel(stream->pplc_addr, AZX_REG_PPLCCTL, 0, AZX_PPLCCTL_STRST); | 175 | snd_hdac_updatel(stream->pplc_addr, AZX_REG_PPLCCTL, |
176 | AZX_PPLCCTL_STRST, AZX_PPLCCTL_STRST); | ||
175 | udelay(3); | 177 | udelay(3); |
176 | timeout = 50; | 178 | timeout = 50; |
177 | do { | 179 | do { |
@@ -242,7 +244,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_link_set_stream_id); | |||
242 | void snd_hdac_ext_link_clear_stream_id(struct hdac_ext_link *link, | 244 | void snd_hdac_ext_link_clear_stream_id(struct hdac_ext_link *link, |
243 | int stream) | 245 | int stream) |
244 | { | 246 | { |
245 | snd_hdac_updatew(link->ml_addr, AZX_REG_ML_LOSIDV, 0, (1 << stream)); | 247 | snd_hdac_updatew(link->ml_addr, AZX_REG_ML_LOSIDV, (1 << stream), 0); |
246 | } | 248 | } |
247 | EXPORT_SYMBOL_GPL(snd_hdac_ext_link_clear_stream_id); | 249 | EXPORT_SYMBOL_GPL(snd_hdac_ext_link_clear_stream_id); |
248 | 250 | ||
@@ -415,7 +417,6 @@ void snd_hdac_ext_stream_spbcap_enable(struct hdac_bus *bus, | |||
415 | bool enable, int index) | 417 | bool enable, int index) |
416 | { | 418 | { |
417 | u32 mask = 0; | 419 | u32 mask = 0; |
418 | u32 register_mask = 0; | ||
419 | 420 | ||
420 | if (!bus->spbcap) { | 421 | if (!bus->spbcap) { |
421 | dev_err(bus->dev, "Address of SPB capability is NULL\n"); | 422 | dev_err(bus->dev, "Address of SPB capability is NULL\n"); |
@@ -424,12 +425,8 @@ void snd_hdac_ext_stream_spbcap_enable(struct hdac_bus *bus, | |||
424 | 425 | ||
425 | mask |= (1 << index); | 426 | mask |= (1 << index); |
426 | 427 | ||
427 | register_mask = readl(bus->spbcap + AZX_REG_SPB_SPBFCCTL); | ||
428 | |||
429 | mask |= register_mask; | ||
430 | |||
431 | if (enable) | 428 | if (enable) |
432 | snd_hdac_updatel(bus->spbcap, AZX_REG_SPB_SPBFCCTL, 0, mask); | 429 | snd_hdac_updatel(bus->spbcap, AZX_REG_SPB_SPBFCCTL, mask, mask); |
433 | else | 430 | else |
434 | snd_hdac_updatel(bus->spbcap, AZX_REG_SPB_SPBFCCTL, mask, 0); | 431 | snd_hdac_updatel(bus->spbcap, AZX_REG_SPB_SPBFCCTL, mask, 0); |
435 | } | 432 | } |
@@ -503,7 +500,6 @@ void snd_hdac_ext_stream_drsm_enable(struct hdac_bus *bus, | |||
503 | bool enable, int index) | 500 | bool enable, int index) |
504 | { | 501 | { |
505 | u32 mask = 0; | 502 | u32 mask = 0; |
506 | u32 register_mask = 0; | ||
507 | 503 | ||
508 | if (!bus->drsmcap) { | 504 | if (!bus->drsmcap) { |
509 | dev_err(bus->dev, "Address of DRSM capability is NULL\n"); | 505 | dev_err(bus->dev, "Address of DRSM capability is NULL\n"); |
@@ -512,12 +508,8 @@ void snd_hdac_ext_stream_drsm_enable(struct hdac_bus *bus, | |||
512 | 508 | ||
513 | mask |= (1 << index); | 509 | mask |= (1 << index); |
514 | 510 | ||
515 | register_mask = readl(bus->drsmcap + AZX_REG_SPB_SPBFCCTL); | ||
516 | |||
517 | mask |= register_mask; | ||
518 | |||
519 | if (enable) | 511 | if (enable) |
520 | snd_hdac_updatel(bus->drsmcap, AZX_REG_DRSM_CTL, 0, mask); | 512 | snd_hdac_updatel(bus->drsmcap, AZX_REG_DRSM_CTL, mask, mask); |
521 | else | 513 | else |
522 | snd_hdac_updatel(bus->drsmcap, AZX_REG_DRSM_CTL, mask, 0); | 514 | snd_hdac_updatel(bus->drsmcap, AZX_REG_DRSM_CTL, mask, 0); |
523 | } | 515 | } |