]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: Intel: avs: Replace hardcodes with SD_CTL_STREAM_RESET
authorCezary Rojewski <cezary.rojewski@intel.com>
Thu, 7 Jul 2022 12:41:51 +0000 (14:41 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 8 Jul 2022 17:53:26 +0000 (18:53 +0100)
Improve readability of CLDMA reset operation by making use of
already defined SD_CTL_STREAM_RESET.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707124153.1858249-11-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/avs/cldma.c

index d100c6ba4d8aa667cb664ce589c60060ff93980f..d7a9390b5e483c91dc0939da1fbdb1d1aeaaacff 100644 (file)
@@ -176,17 +176,17 @@ int hda_cldma_reset(struct hda_cldma *cl)
                return ret;
        }
 
-       snd_hdac_stream_updateb(cl, SD_CTL, 1, 1);
-       ret = snd_hdac_stream_readb_poll(cl, SD_CTL, reg, (reg & 1), AVS_CL_OP_INTERVAL_US,
-                                        AVS_CL_OP_TIMEOUT_US);
+       snd_hdac_stream_updateb(cl, SD_CTL, SD_CTL_STREAM_RESET, SD_CTL_STREAM_RESET);
+       ret = snd_hdac_stream_readb_poll(cl, SD_CTL, reg, (reg & SD_CTL_STREAM_RESET),
+                                        AVS_CL_OP_INTERVAL_US, AVS_CL_OP_TIMEOUT_US);
        if (ret < 0) {
                dev_err(cl->dev, "cldma set SRST failed: %d\n", ret);
                return ret;
        }
 
-       snd_hdac_stream_updateb(cl, SD_CTL, 1, 0);
-       ret = snd_hdac_stream_readb_poll(cl, SD_CTL, reg, !(reg & 1), AVS_CL_OP_INTERVAL_US,
-                                        AVS_CL_OP_TIMEOUT_US);
+       snd_hdac_stream_updateb(cl, SD_CTL, SD_CTL_STREAM_RESET, 0);
+       ret = snd_hdac_stream_readb_poll(cl, SD_CTL, reg, !(reg & SD_CTL_STREAM_RESET),
+                                        AVS_CL_OP_INTERVAL_US, AVS_CL_OP_TIMEOUT_US);
        if (ret < 0) {
                dev_err(cl->dev, "cldma unset SRST failed: %d\n", ret);
                return ret;