From 023a3f3a1c4f9be9cc1ae92579ba816120fb5807 Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Tue, 24 Aug 2021 18:15:59 +0800 Subject: ASoC: rockchip: spdif: Mark SPDIF_SMPDR as volatile This patch marks SPDIF_SMPDR as volatile to make it resaonable, which also requires marking it as readable, even though it isn't. Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629800162-12824-2-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown --- sound/soc/rockchip/rockchip_spdif.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/soc') diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c index 73226a46d489..8baa473db0d2 100644 --- a/sound/soc/rockchip/rockchip_spdif.c +++ b/sound/soc/rockchip/rockchip_spdif.c @@ -247,6 +247,7 @@ static bool rk_spdif_rd_reg(struct device *dev, unsigned int reg) case SPDIF_INTCR: case SPDIF_INTSR: case SPDIF_XFER: + case SPDIF_SMPDR: return true; default: return false; @@ -258,6 +259,7 @@ static bool rk_spdif_volatile_reg(struct device *dev, unsigned int reg) switch (reg) { case SPDIF_INTSR: case SPDIF_SDBLR: + case SPDIF_SMPDR: return true; default: return false; -- cgit v1.2.3 From acc8b9d117912c2d5952868fba0d4fca49cde3c8 Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Tue, 24 Aug 2021 18:16:00 +0800 Subject: ASoC: rockchip: spdif: Fix some coding style This patch fix some coding style. Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629800162-12824-3-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown --- sound/soc/rockchip/rockchip_spdif.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c index 8baa473db0d2..92b27b6d6019 100644 --- a/sound/soc/rockchip/rockchip_spdif.c +++ b/sound/soc/rockchip/rockchip_spdif.c @@ -103,8 +103,8 @@ static int __maybe_unused rk_spdif_runtime_resume(struct device *dev) } static int rk_spdif_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params, - struct snd_soc_dai *dai) + struct snd_pcm_hw_params *params, + struct snd_soc_dai *dai) { struct rk_spdif_dev *spdif = snd_soc_dai_get_drvdata(dai); unsigned int val = SPDIF_CFGR_HALFWORD_ENABLE; @@ -137,15 +137,15 @@ static int rk_spdif_hw_params(struct snd_pcm_substream *substream, } ret = regmap_update_bits(spdif->regmap, SPDIF_CFGR, - SPDIF_CFGR_CLK_DIV_MASK | SPDIF_CFGR_HALFWORD_ENABLE | - SDPIF_CFGR_VDW_MASK, - val); + SPDIF_CFGR_CLK_DIV_MASK | + SPDIF_CFGR_HALFWORD_ENABLE | + SDPIF_CFGR_VDW_MASK, val); return ret; } static int rk_spdif_trigger(struct snd_pcm_substream *substream, - int cmd, struct snd_soc_dai *dai) + int cmd, struct snd_soc_dai *dai) { struct rk_spdif_dev *spdif = snd_soc_dai_get_drvdata(dai); int ret; @@ -155,31 +155,31 @@ static int rk_spdif_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ret = regmap_update_bits(spdif->regmap, SPDIF_DMACR, - SPDIF_DMACR_TDE_ENABLE | - SPDIF_DMACR_TDL_MASK, - SPDIF_DMACR_TDE_ENABLE | - SPDIF_DMACR_TDL(16)); + SPDIF_DMACR_TDE_ENABLE | + SPDIF_DMACR_TDL_MASK, + SPDIF_DMACR_TDE_ENABLE | + SPDIF_DMACR_TDL(16)); if (ret != 0) return ret; ret = regmap_update_bits(spdif->regmap, SPDIF_XFER, - SPDIF_XFER_TXS_START, - SPDIF_XFER_TXS_START); + SPDIF_XFER_TXS_START, + SPDIF_XFER_TXS_START); break; case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ret = regmap_update_bits(spdif->regmap, SPDIF_DMACR, - SPDIF_DMACR_TDE_ENABLE, - SPDIF_DMACR_TDE_DISABLE); + SPDIF_DMACR_TDE_ENABLE, + SPDIF_DMACR_TDE_DISABLE); if (ret != 0) return ret; ret = regmap_update_bits(spdif->regmap, SPDIF_XFER, - SPDIF_XFER_TXS_START, - SPDIF_XFER_TXS_STOP); + SPDIF_XFER_TXS_START, + SPDIF_XFER_TXS_STOP); break; default: ret = -EINVAL; @@ -293,7 +293,7 @@ static int rk_spdif_probe(struct platform_device *pdev) grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf"); if (IS_ERR(grf)) { dev_err(&pdev->dev, - "rockchip_spdif missing 'rockchip,grf' \n"); + "rockchip_spdif missing 'rockchip,grf'\n"); return PTR_ERR(grf); } -- cgit v1.2.3 From c5d4f09feb9f74e704d87a304f0c20001488fe10 Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Tue, 24 Aug 2021 18:16:01 +0800 Subject: ASoC: rockchip: spdif: Add support for rk3568 spdif This patch adds support for rk3568 spdif which is the same with rk3366. Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1629800162-12824-4-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown --- sound/soc/rockchip/rockchip_spdif.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/soc') diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c index 92b27b6d6019..d027ca4b1796 100644 --- a/sound/soc/rockchip/rockchip_spdif.c +++ b/sound/soc/rockchip/rockchip_spdif.c @@ -58,6 +58,8 @@ static const struct of_device_id rk_spdif_match[] __maybe_unused = { .data = (void *)RK_SPDIF_RK3366 }, { .compatible = "rockchip,rk3399-spdif", .data = (void *)RK_SPDIF_RK3366 }, + { .compatible = "rockchip,rk3568-spdif", + .data = (void *)RK_SPDIF_RK3366 }, {}, }; MODULE_DEVICE_TABLE(of, rk_spdif_match); -- cgit v1.2.3