Skip to content

Commit f2bd6f5

Browse files
AaronDotbroonie
authored andcommitted
ASoC: loongson: Use BIT() macro
Where applicable, use BIT() macro instead of shift operation to improve readability. Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Link: https://patch.msgid.link/ccca555c96f18c0ecf5f1544c82945ba651d105f.1725844530.git.zhoubinbin@loongson.cn Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 241c044 commit f2bd6f5

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

sound/soc/loongson/loongson_dma.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
#include "loongson_i2s.h"
1818

1919
/* DMA dma_order Register */
20-
#define DMA_ORDER_STOP (1 << 4) /* DMA stop */
21-
#define DMA_ORDER_START (1 << 3) /* DMA start */
22-
#define DMA_ORDER_ASK_VALID (1 << 2) /* DMA ask valid flag */
23-
#define DMA_ORDER_AXI_UNCO (1 << 1) /* Uncache access */
24-
#define DMA_ORDER_ADDR_64 (1 << 0) /* 64bits address support */
20+
#define DMA_ORDER_STOP BIT(4) /* DMA stop */
21+
#define DMA_ORDER_START BIT(3) /* DMA start */
22+
#define DMA_ORDER_ASK_VALID BIT(2) /* DMA ask valid flag */
23+
#define DMA_ORDER_AXI_UNCO BIT(1) /* Uncache access */
24+
#define DMA_ORDER_ADDR_64 BIT(0) /* 64bits address support */
2525

2626
#define DMA_ORDER_ASK_MASK (~0x1fUL) /* Ask addr mask */
2727
#define DMA_ORDER_CTRL_MASK (0x0fUL) /* Control mask */

sound/soc/loongson/loongson_i2s.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@
2727
#define LS_I2S_RX_ORDER 0x110 /* RX DMA Order */
2828

2929
/* Loongson I2S Control Register */
30-
#define I2S_CTRL_MCLK_READY (1 << 16) /* MCLK ready */
31-
#define I2S_CTRL_MASTER (1 << 15) /* Master mode */
32-
#define I2S_CTRL_MSB (1 << 14) /* MSB bit order */
33-
#define I2S_CTRL_RX_EN (1 << 13) /* RX enable */
34-
#define I2S_CTRL_TX_EN (1 << 12) /* TX enable */
35-
#define I2S_CTRL_RX_DMA_EN (1 << 11) /* DMA RX enable */
36-
#define I2S_CTRL_CLK_READY (1 << 8) /* BCLK ready */
37-
#define I2S_CTRL_TX_DMA_EN (1 << 7) /* DMA TX enable */
38-
#define I2S_CTRL_RESET (1 << 4) /* Controller soft reset */
39-
#define I2S_CTRL_MCLK_EN (1 << 3) /* Enable MCLK */
40-
#define I2S_CTRL_RX_INT_EN (1 << 1) /* RX interrupt enable */
41-
#define I2S_CTRL_TX_INT_EN (1 << 0) /* TX interrupt enable */
30+
#define I2S_CTRL_MCLK_READY BIT(16) /* MCLK ready */
31+
#define I2S_CTRL_MASTER BIT(15) /* Master mode */
32+
#define I2S_CTRL_MSB BIT(14) /* MSB bit order */
33+
#define I2S_CTRL_RX_EN BIT(13) /* RX enable */
34+
#define I2S_CTRL_TX_EN BIT(12) /* TX enable */
35+
#define I2S_CTRL_RX_DMA_EN BIT(11) /* DMA RX enable */
36+
#define I2S_CTRL_CLK_READY BIT(8) /* BCLK ready */
37+
#define I2S_CTRL_TX_DMA_EN BIT(7) /* DMA TX enable */
38+
#define I2S_CTRL_RESET BIT(4) /* Controller soft reset */
39+
#define I2S_CTRL_MCLK_EN BIT(3) /* Enable MCLK */
40+
#define I2S_CTRL_RX_INT_EN BIT(1) /* RX interrupt enable */
41+
#define I2S_CTRL_TX_INT_EN BIT(0) /* TX interrupt enable */
4242

4343
#define LS_I2S_DRVNAME "loongson-i2s"
4444

0 commit comments

Comments
 (0)