[PATCH 0/4] RK3588 Audio Support
This patchset refactors the Rockchip I2S/TDM driver in order to support the RK3588 SoC, and then adds the necessary compatible string to load the driver for it.
Patch 1 rectifies a problem with the bindings where we were too strict about requiring the rockchip,grf property. Most features of this audio device don't need access to the GRF to function.
Patch 2 modifies the driver to adjust its behaviour to what the changed bindings now allow, namely using most things without the GRF.
Patch 3 and 4 are boring compatible string stuff that enables RK3588 support. No special data is needed to initialise the driver for this instance of the I2S/TDM IP.
Nicolas Frattaroli (4): ASoC: dt-bindings: rockchip: i2s-tdm: Make grf property optional ASoC: rockchip: i2s_tdm: Make the grf property optional ASoC: dt-bindings: rockchip: i2s-tdm: Add RK3588 compatible ASoC: rockchip: i2s_tdm: Add support for RK3588
.../bindings/sound/rockchip,i2s-tdm.yaml | 2 +- sound/soc/rockchip/rockchip_i2s_tdm.c | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-)
Turns out most things don't require the GRF, so making the property optional is the obvious move.
Signed-off-by: Nicolas Frattaroli frattaroli.nicolas@gmail.com --- Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml | 1 - 1 file changed, 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml b/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml index 6a7c004bef17..8646cdc692d7 100644 --- a/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml +++ b/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml @@ -135,7 +135,6 @@ required: - clock-names - resets - reset-names - - rockchip,grf - "#sound-dai-cells"
additionalProperties: false
On 25/10/2022 08:41, Nicolas Frattaroli wrote:
Turns out most things don't require the GRF, so making the property optional is the obvious move.
Signed-off-by: Nicolas Frattaroli frattaroli.nicolas@gmail.com
Acked-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
Best regards, Krzysztof
Only IO Multiplex and two TRCM modes need access to the GRF, so making it a hard requirement is not a wise idea, as it complicates support for newer SoCs which do not do these things.
Signed-off-by: Nicolas Frattaroli frattaroli.nicolas@gmail.com --- sound/soc/rockchip/rockchip_i2s_tdm.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index 2550bd2a5e78..917f17107891 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -756,6 +756,12 @@ static int rockchip_i2s_io_multiplex(struct snd_pcm_substream *substream, if (!i2s_tdm->io_multiplex) return 0;
+ if (IS_ERR_OR_NULL(i2s_tdm->grf)) { + dev_err(i2s_tdm->dev, + "io multiplex not supported for this device\n"); + return -EINVAL; + } + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { struct snd_pcm_str *playback_str = &substream->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK]; @@ -1222,6 +1228,12 @@ static int common_soc_init(struct device *dev, u32 addr) if (trcm == TRCM_TXRX) return 0;
+ if (IS_ERR_OR_NULL(i2s_tdm->grf)) { + dev_err(i2s_tdm->dev, + "no grf present but non-txrx TRCM specified\n"); + return -EINVAL; + } + for (i = 0; i < i2s_tdm->soc_data->config_count; i++) { if (addr != configs[i].addr) continue; @@ -1568,10 +1580,6 @@ static int rockchip_i2s_tdm_probe(struct platform_device *pdev) return ret;
i2s_tdm->grf = syscon_regmap_lookup_by_phandle(node, "rockchip,grf"); - if (IS_ERR(i2s_tdm->grf)) - return dev_err_probe(i2s_tdm->dev, PTR_ERR(i2s_tdm->grf), - "Error in rockchip,grf\n"); - i2s_tdm->tx_reset = devm_reset_control_get_optional_exclusive(&pdev->dev, "tx-m"); if (IS_ERR(i2s_tdm->tx_reset)) {
This adds the compatible string for the RK3588 SoC.
Signed-off-by: Nicolas Frattaroli frattaroli.nicolas@gmail.com --- Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml | 1 + 1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml b/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml index 8646cdc692d7..0503f4f3fb1a 100644 --- a/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml +++ b/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml @@ -21,6 +21,7 @@ properties: - rockchip,rk1808-i2s-tdm - rockchip,rk3308-i2s-tdm - rockchip,rk3568-i2s-tdm + - rockchip,rk3588-i2s-tdm - rockchip,rv1126-i2s-tdm
reg:
On 25/10/2022 08:41, Nicolas Frattaroli wrote:
This adds the compatible string for the RK3588 SoC.
Signed-off-by: Nicolas Frattaroli frattaroli.nicolas@gmail.com
Acked-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
Best regards, Krzysztof
This adds support for the RK3588 SoC to the I2S/TDM driver. --- sound/soc/rockchip/rockchip_i2s_tdm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index 917f17107891..08b90ec5cc80 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -1318,6 +1318,7 @@ static const struct of_device_id rockchip_i2s_tdm_match[] = { { .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,rk3588-i2s-tdm" }, { .compatible = "rockchip,rv1126-i2s-tdm", .data = &rv1126_i2s_soc_data }, {}, }; @@ -1556,7 +1557,7 @@ static int rockchip_i2s_tdm_probe(struct platform_device *pdev) i2s_tdm->dev = &pdev->dev;
of_id = of_match_device(rockchip_i2s_tdm_match, &pdev->dev); - if (!of_id || !of_id->data) + if (!of_id) return -EINVAL;
spin_lock_init(&i2s_tdm->lock);
On Dienstag, 25. Oktober 2022 14:41:32 CEST Nicolas Frattaroli wrote:
This adds support for the RK3588 SoC to the I2S/TDM driver.
sound/soc/rockchip/rockchip_i2s_tdm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index 917f17107891..08b90ec5cc80 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -1318,6 +1318,7 @@ static const struct of_device_id rockchip_i2s_tdm_match[] = { { .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,rk3588-i2s-tdm" }, { .compatible = "rockchip,rv1126-i2s-tdm", .data = &rv1126_i2s_soc_data }, {},
}; @@ -1556,7 +1557,7 @@ static int rockchip_i2s_tdm_probe(struct platform_device *pdev) i2s_tdm->dev = &pdev->dev;
of_id = of_match_device(rockchip_i2s_tdm_match, &pdev->dev);
- if (!of_id || !of_id->data)
if (!of_id) return -EINVAL;
spin_lock_init(&i2s_tdm->lock);
Oops, forgot the signoff on this one. For this purpose:
Signed-off-by: Nicolas Frattaroli frattaroli.nicolas@gmail.com
My apologies.
On Tue, 25 Oct 2022 14:41:28 +0200, Nicolas Frattaroli wrote:
This patchset refactors the Rockchip I2S/TDM driver in order to support the RK3588 SoC, and then adds the necessary compatible string to load the driver for it.
Patch 1 rectifies a problem with the bindings where we were too strict about requiring the rockchip,grf property. Most features of this audio device don't need access to the GRF to function.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/4] ASoC: dt-bindings: rockchip: i2s-tdm: Make grf property optional commit: 1024a5b29e90a18530588b3f161e81cf3fae7dcf [2/4] ASoC: rockchip: i2s_tdm: Make the grf property optional commit: d980004e349049a3fcbffc6096d14896f6a122ed [3/4] ASoC: dt-bindings: rockchip: i2s-tdm: Add RK3588 compatible commit: 0643fd3669f5c33bab5b05a813459a2d00a83465 [4/4] ASoC: rockchip: i2s_tdm: Add support for RK3588 commit: c619bd4268ff9895760dab303b4eb15ed3d0f7e9
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
participants (3)
-
Krzysztof Kozlowski
-
Mark Brown
-
Nicolas Frattaroli