diff --git a/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.txt b/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.txt index db130be87d47..ea0bb169bfb5 100644 --- a/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.txt +++ b/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.txt @@ -28,6 +28,8 @@ Required properties: register pcm dmaengine, only just register dai. if the dai is part of multi-dais, the property should be present. Please refer to rockchip,multidais.txt about multi-dais usage. +- rockchip,playback-only: Specify that the controller only has playback capability. +- rockchip,capture-only: Specify that the controller only has capture capability. Optional properties: - rockchip,i2s-rx-route: This is a variable length array, that shows the mapping diff --git a/Documentation/devicetree/bindings/sound/rockchip-i2s.txt b/Documentation/devicetree/bindings/sound/rockchip-i2s.txt index d48733811bcd..02ed62aa626e 100644 --- a/Documentation/devicetree/bindings/sound/rockchip-i2s.txt +++ b/Documentation/devicetree/bindings/sound/rockchip-i2s.txt @@ -43,6 +43,8 @@ Required properties: register pcm dmaengine, only just register dai. if the dai is part of multi-dais, the property should be present. Please refer to rockchip,multidais.txt about multi-dais usage. +- rockchip,playback-only: Specify that the controller only has playback capability. +- rockchip,capture-only: Specify that the controller only has capture capability. Required properties for controller which support multi channels playback/capture: diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 04ff6894924e..003cf1300511 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -705,6 +705,11 @@ static int rockchip_i2s_probe(struct platform_device *pdev) soc_dai->capture.channels_max = val; } + if (of_property_read_bool(node, "rockchip,playback-only")) + soc_dai->capture.channels_min = 0; + else if (of_property_read_bool(node, "rockchip,capture-only")) + soc_dai->playback.channels_min = 0; + i2s->bclk_fs = 64; if (!of_property_read_u32(node, "rockchip,bclk-fs", &val)) { if ((val >= 32) && (val % 2 == 0)) diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index a4ebb32da83d..6079974b7d81 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -1370,6 +1370,11 @@ static int rockchip_i2s_tdm_probe(struct platform_device *pdev) } } + if (of_property_read_bool(node, "rockchip,playback-only")) + soc_dai->capture.channels_min = 0; + else if (of_property_read_bool(node, "rockchip,capture-only")) + soc_dai->playback.channels_min = 0; + i2s_tdm->grf = syscon_regmap_lookup_by_phandle(node, "rockchip,grf"); if (IS_ERR(i2s_tdm->grf)) return PTR_ERR(i2s_tdm->grf);