Commit c66ee6a7 authored by Sugar Zhang's avatar Sugar Zhang Committed by Tao Huang
Browse files

ASoC: rockchip: Add support for rk3568 i2s


Signed-off-by: default avatarSugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I5d4abfd94e627417258bc937b58eec6deee04d3c
parent b1cd8926
......@@ -1107,6 +1107,12 @@ static const struct txrx_config rk3308_txrx_config[] = {
{ 0xff310000, 0x308, RK3308_I2S1_CLK_TXONLY, RK3308_I2S1_CLK_RXONLY },
};
static const struct txrx_config rk3568_txrx_config[] = {
{ 0xfe410000, 0x504, RK3568_I2S1_CLK_TXONLY, RK3568_I2S1_CLK_RXONLY },
{ 0xfe430000, 0x504, RK3568_I2S3_CLK_TXONLY, RK3568_I2S3_CLK_RXONLY },
{ 0xfe430000, 0x508, RK3568_I2S3_MCLK_TXONLY, RK3568_I2S3_MCLK_RXONLY },
};
static const struct txrx_config rv1126_txrx_config[] = {
{ 0xff800000, 0x10260, RV1126_I2S0_CLK_TXONLY, RV1126_I2S0_CLK_RXONLY },
};
......@@ -1132,6 +1138,13 @@ static struct rk_i2s_soc_data rk3308_i2s_soc_data = {
.init = common_soc_init,
};
static struct rk_i2s_soc_data rk3568_i2s_soc_data = {
.softrst_offset = 0x0400,
.configs = rk3568_txrx_config,
.config_count = ARRAY_SIZE(rk3568_txrx_config),
.init = common_soc_init,
};
static struct rk_i2s_soc_data rv1126_i2s_soc_data = {
.softrst_offset = 0x0300,
.configs = rv1126_txrx_config,
......@@ -1143,6 +1156,7 @@ static const struct of_device_id rockchip_i2s_tdm_match[] = {
{ .compatible = "rockchip,px30-i2s-tdm", .data = &px30_i2s_soc_data },
{ .compatible = "rockchip,rk1808-i2s-tdm", .data = &rk1808_i2s_soc_data },
{ .compatible = "rockchip,rk3308-i2s-tdm", .data = &rk3308_i2s_soc_data },
{ .compatible = "rockchip,rk3568-i2s-tdm", .data = &rk3568_i2s_soc_data },
{ .compatible = "rockchip,rv1126-i2s-tdm", .data = &rv1126_i2s_soc_data },
{},
};
......
......@@ -340,6 +340,37 @@ enum {
RK3308_I2S1_8CH_CLK_IN_RX_SRC_FROM_RX | \
RK3308_I2S1_8CH_CLK_IN_TX_SRC_FROM_RX)
/* RK3568 GRF CONFIGS*/
#define RK3568_I2S1_MCLK_OUT_SRC_FROM_TX HIWORD_UPDATE(1, 5, 5)
#define RK3568_I2S1_MCLK_OUT_SRC_FROM_RX HIWORD_UPDATE(0, 5, 5)
#define RK3568_I2S1_CLK_TXONLY \
RK3568_I2S1_MCLK_OUT_SRC_FROM_TX
#define RK3568_I2S1_CLK_RXONLY \
RK3568_I2S1_MCLK_OUT_SRC_FROM_RX
#define RK3568_I2S3_MCLK_OUT_SRC_FROM_TX HIWORD_UPDATE(0, 15, 15)
#define RK3568_I2S3_MCLK_OUT_SRC_FROM_RX HIWORD_UPDATE(1, 15, 15)
#define RK3568_I2S3_SCLK_SRC_FROM_TX HIWORD_UPDATE(1, 7, 7)
#define RK3568_I2S3_SCLK_SRC_FROM_RX HIWORD_UPDATE(0, 7, 7)
#define RK3568_I2S3_LRCK_SRC_FROM_TX HIWORD_UPDATE(1, 6, 6)
#define RK3568_I2S3_LRCK_SRC_FROM_RX HIWORD_UPDATE(0, 6, 6)
#define RK3568_I2S3_MCLK_TXONLY \
RK3568_I2S3_MCLK_OUT_SRC_FROM_TX
#define RK3568_I2S3_CLK_TXONLY \
(RK3568_I2S3_SCLK_SRC_FROM_TX | \
RK3568_I2S3_LRCK_SRC_FROM_TX)
#define RK3568_I2S3_MCLK_RXONLY \
RK3568_I2S3_MCLK_OUT_SRC_FROM_RX
#define RK3568_I2S3_CLK_RXONLY \
(RK3568_I2S3_SCLK_SRC_FROM_RX | \
RK3568_I2S3_LRCK_SRC_FROM_RX)
/* RV1126 GRF CONFIGS*/
#define RV1126_I2S0_MCLK_OUT_SRC_FROM_TX HIWORD_UPDATE(0, 9, 9)
#define RV1126_I2S0_MCLK_OUT_SRC_FROM_RX HIWORD_UPDATE(1, 9, 9)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment