27
27
#define DRV_NAME "acp_i2s_playcap"
28
28
#define I2S_MASTER_MODE_ENABLE 1
29
29
#define I2S_MODE_ENABLE 0
30
- #define I2S_FORMAT_MODE GENMASK(1, 1)
31
30
#define LRCLK_DIV_FIELD GENMASK(10, 2)
32
31
#define BCLK_DIV_FIELD GENMASK(23, 11)
32
+ #define ACP63_LRCLK_DIV_FIELD GENMASK(12, 2)
33
+ #define ACP63_BCLK_DIV_FIELD GENMASK(23, 13)
33
34
34
35
static inline void acp_set_i2s_clk (struct acp_dev_data * adata , int dai_id )
35
36
{
36
37
u32 i2s_clk_reg , val ;
38
+ struct acp_chip_info * chip ;
39
+ struct device * dev ;
37
40
41
+ dev = adata -> dev ;
42
+ chip = dev_get_platdata (dev );
38
43
switch (dai_id ) {
39
44
case I2S_SP_INSTANCE :
40
45
i2s_clk_reg = ACP_I2STDM0_MSTRCLKGEN ;
@@ -52,8 +57,16 @@ static inline void acp_set_i2s_clk(struct acp_dev_data *adata, int dai_id)
52
57
53
58
val = I2S_MASTER_MODE_ENABLE ;
54
59
val |= I2S_MODE_ENABLE & BIT (1 );
55
- val |= FIELD_PREP (LRCLK_DIV_FIELD , adata -> lrclk_div );
56
- val |= FIELD_PREP (BCLK_DIV_FIELD , adata -> bclk_div );
60
+
61
+ switch (chip -> acp_rev ) {
62
+ case ACP63_DEV :
63
+ val |= FIELD_PREP (ACP63_LRCLK_DIV_FIELD , adata -> lrclk_div );
64
+ val |= FIELD_PREP (ACP63_BCLK_DIV_FIELD , adata -> bclk_div );
65
+ break ;
66
+ default :
67
+ val |= FIELD_PREP (LRCLK_DIV_FIELD , adata -> lrclk_div );
68
+ val |= FIELD_PREP (BCLK_DIV_FIELD , adata -> bclk_div );
69
+ }
57
70
writel (val , adata -> acp_base + i2s_clk_reg );
58
71
}
59
72
0 commit comments