* [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC
@ 2024-11-08 10:49 Claudiu
2024-11-08 10:49 ` [PATCH v2 01/25] clk: renesas: r9a08g045-cpg: Add clocks, resets and power domains support for SSI Claudiu
` (24 more replies)
0 siblings, 25 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Hi,
Series enables the audio support for the Renesas RZ/G3S
SoC along with runtime PM and suspend to RAM.
Patches:
- 01/25 - add clock, reset and power domain support
- 02-04/25 - update versaclock3 clock generator driver to support the
5L35023 hardware variant; versaclock3 provides clocks for
the audio devices (SSIF, DA7212 codec)
- 05/25 - add pin control support for audio
- 06-20/25 - add SSIF support for the RZ/G3S SoC; fixes and cleanups
were also included
- 21-25/25 - add device tree support
Merge strategy, if any:
- clock patches (01-04/25) can go through the Renesas tree
- pinctrl patch (05/25) can go though the Renesas tree
- audio patches (06-20/25) can go through the audio tree
- device tree patches (21-25/25) can go through the Renesas tree
Thank you,
Claudiu Beznea
Changes in v2:
- fixed typos pointed out in the review process
- dropped da7213 patches already applied
- dropped patch "ASoC: sh: rz-ssi: Use a proper bitmask for clear bits"
as requested in the review process
Claudiu Beznea (25):
clk: renesas: r9a08g045-cpg: Add clocks, resets and power domains
support for SSI
clk: versaclock3: Prepare for the addition of 5L35023 device
dt-bindings: clock: versaclock3: Document 5L35023 Versa3 clock
generator
clk: versaclock3: Add support for the 5L35023 variant
pinctrl: renesas: rzg2l: Add audio clock pins
ASoC: sh: rz-ssi: Terminate all the DMA transactions
ASoC: sh: rz-ssi: Use only the proper amount of dividers
ASoC: sh: rz-ssi: Fix typo on SSI_RATES macro comment
ASoC: sh: rz-ssi: Remove pdev member of struct rz_ssi_priv
ASoC: sh: rz-ssi: Remove the rz_ssi_get_dai() function
ASoC: sh: rz-ssi: Remove the first argument of rz_ssi_stream_is_play()
ASoC: sh: rz-ssi: Use readl_poll_timeout_atomic()
ASoC: sh: rz-ssi: Use temporary variable for struct device
ASoC: sh: rz-ssi: Use goto label names that specify their actions
ASoC: sh: rz-ssi: Rely on the ASoC subsystem to runtime resume/suspend
the SSI
ASoC: sh: rz-ssi: Enable runtime PM autosuspend support
ASoC: sh: rz-ssi: Add runtime PM support
ASoC: sh: rz-ssi: Issue software reset in hw_params API
ASoC: sh: rz-ssi: Add suspend to RAM support
ASoC: dt-bindings: renesas,rz-ssi: Document the Renesas RZ/G3S SoC
arm64: dts: renesas: r9a08g045: Add SSI nodes
arm64: dts: renesas: rzg3s-smarc-som: Add versa3 clock generator node
arm64: dts: renesas: Add da7212 audio codec node
arm64: dts: renesas: rzg3s-smarc: Enable SSI3
arm64: dts: renesas: rzg3s-smarc: Add sound card
.../bindings/clock/renesas,5p35023.yaml | 1 +
.../bindings/sound/renesas,rz-ssi.yaml | 1 +
arch/arm64/boot/dts/renesas/r9a08g045.dtsi | 96 ++++++++
.../boot/dts/renesas/rzg3s-smarc-som.dtsi | 47 +++-
arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 66 +++++
drivers/clk/clk-versaclock3.c | 67 ++++--
drivers/clk/renesas/r9a08g045-cpg.c | 20 ++
drivers/pinctrl/renesas/pinctrl-rzg2l.c | 2 +
sound/soc/renesas/rz-ssi.c | 226 +++++++++++-------
9 files changed, 415 insertions(+), 111 deletions(-)
--
2.39.2
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH v2 01/25] clk: renesas: r9a08g045-cpg: Add clocks, resets and power domains support for SSI
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-10 8:31 ` Biju Das
2024-11-08 10:49 ` [PATCH v2 02/25] clk: versaclock3: Prepare for the addition of 5L35023 device Claudiu
` (23 subsequent siblings)
24 siblings, 1 reply; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Add SSI clocks, resets and power domains support for the SSI blocks
available on the Renesas RZ/G3S SoC.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
drivers/clk/renesas/r9a08g045-cpg.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/clk/renesas/r9a08g045-cpg.c b/drivers/clk/renesas/r9a08g045-cpg.c
index b2ae8cdc4723..d71e77624fac 100644
--- a/drivers/clk/renesas/r9a08g045-cpg.c
+++ b/drivers/clk/renesas/r9a08g045-cpg.c
@@ -209,6 +209,14 @@ static const struct rzg2l_mod_clk r9a08g045_mod_clks[] = {
DEF_MOD("sdhi2_imclk2", R9A08G045_SDHI2_IMCLK2, CLK_SD2_DIV4, 0x554, 9),
DEF_MOD("sdhi2_clk_hs", R9A08G045_SDHI2_CLK_HS, R9A08G045_CLK_SD2, 0x554, 10),
DEF_MOD("sdhi2_aclk", R9A08G045_SDHI2_ACLK, R9A08G045_CLK_P1, 0x554, 11),
+ DEF_MOD("ssi0_pclk", R9A08G045_SSI0_PCLK2, R9A08G045_CLK_P0, 0x570, 0),
+ DEF_MOD("ssi0_sfr", R9A08G045_SSI0_PCLK_SFR, R9A08G045_CLK_P0, 0x570, 1),
+ DEF_MOD("ssi1_pclk", R9A08G045_SSI1_PCLK2, R9A08G045_CLK_P0, 0x570, 2),
+ DEF_MOD("ssi1_sfr", R9A08G045_SSI1_PCLK_SFR, R9A08G045_CLK_P0, 0x570, 3),
+ DEF_MOD("ssi2_pclk", R9A08G045_SSI2_PCLK2, R9A08G045_CLK_P0, 0x570, 4),
+ DEF_MOD("ssi2_sfr", R9A08G045_SSI2_PCLK_SFR, R9A08G045_CLK_P0, 0x570, 5),
+ DEF_MOD("ssi3_pclk", R9A08G045_SSI3_PCLK2, R9A08G045_CLK_P0, 0x570, 6),
+ DEF_MOD("ssi3_sfr", R9A08G045_SSI3_PCLK_SFR, R9A08G045_CLK_P0, 0x570, 7),
DEF_MOD("usb0_host", R9A08G045_USB_U2H0_HCLK, R9A08G045_CLK_P1, 0x578, 0),
DEF_MOD("usb1_host", R9A08G045_USB_U2H1_HCLK, R9A08G045_CLK_P1, 0x578, 1),
DEF_MOD("usb0_func", R9A08G045_USB_U2P_EXR_CPUCLK, R9A08G045_CLK_P1, 0x578, 2),
@@ -238,6 +246,10 @@ static const struct rzg2l_reset r9a08g045_resets[] = {
DEF_RST(R9A08G045_SDHI0_IXRST, 0x854, 0),
DEF_RST(R9A08G045_SDHI1_IXRST, 0x854, 1),
DEF_RST(R9A08G045_SDHI2_IXRST, 0x854, 2),
+ DEF_RST(R9A08G045_SSI0_RST_M2_REG, 0x870, 0),
+ DEF_RST(R9A08G045_SSI1_RST_M2_REG, 0x870, 1),
+ DEF_RST(R9A08G045_SSI2_RST_M2_REG, 0x870, 2),
+ DEF_RST(R9A08G045_SSI3_RST_M2_REG, 0x870, 3),
DEF_RST(R9A08G045_USB_U2H0_HRESETN, 0x878, 0),
DEF_RST(R9A08G045_USB_U2H1_HRESETN, 0x878, 1),
DEF_RST(R9A08G045_USB_U2P_EXL_SYSRST, 0x878, 2),
@@ -286,6 +298,14 @@ static const struct rzg2l_cpg_pm_domain_init_data r9a08g045_pm_domains[] = {
DEF_REG_CONF(CPG_BUS_PERI_COM_MSTOP, BIT(1)), 0),
DEF_PD("sdhi2", R9A08G045_PD_SDHI2,
DEF_REG_CONF(CPG_BUS_PERI_COM_MSTOP, BIT(11)), 0),
+ DEF_PD("ssi0", R9A08G045_PD_SSI0,
+ DEF_REG_CONF(CPG_BUS_MCPU1_MSTOP, BIT(10)), 0),
+ DEF_PD("ssi1", R9A08G045_PD_SSI1,
+ DEF_REG_CONF(CPG_BUS_MCPU1_MSTOP, BIT(11)), 0),
+ DEF_PD("ssi2", R9A08G045_PD_SSI2,
+ DEF_REG_CONF(CPG_BUS_MCPU1_MSTOP, BIT(12)), 0),
+ DEF_PD("ssi3", R9A08G045_PD_SSI3,
+ DEF_REG_CONF(CPG_BUS_MCPU1_MSTOP, BIT(13)), 0),
DEF_PD("usb0", R9A08G045_PD_USB0,
DEF_REG_CONF(CPG_BUS_PERI_COM_MSTOP, GENMASK(6, 5)), 0),
DEF_PD("usb1", R9A08G045_PD_USB1,
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 02/25] clk: versaclock3: Prepare for the addition of 5L35023 device
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
2024-11-08 10:49 ` [PATCH v2 01/25] clk: renesas: r9a08g045-cpg: Add clocks, resets and power domains support for SSI Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-10 8:32 ` Biju Das
2024-11-08 10:49 ` [PATCH v2 03/25] dt-bindings: clock: versaclock3: Document 5L35023 Versa3 clock generator Claudiu
` (22 subsequent siblings)
24 siblings, 1 reply; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
The 5P35023 and 5L35035 Versa 3 clock generator variants are different but
the versaclock3 driver could be used with small adjustments. The features
that are implemented in driver and differs b/w variants are the PLL2 Fvco
and clock sel bit for SE2 clock. Adjust the driver to prepare for the
addition of 5L35023 device.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
drivers/clk/clk-versaclock3.c | 61 ++++++++++++++++++++++++-----------
1 file changed, 43 insertions(+), 18 deletions(-)
diff --git a/drivers/clk/clk-versaclock3.c b/drivers/clk/clk-versaclock3.c
index 76d7ea1964c3..1398d16df5d0 100644
--- a/drivers/clk/clk-versaclock3.c
+++ b/drivers/clk/clk-versaclock3.c
@@ -78,9 +78,6 @@
#define VC3_PLL1_VCO_MIN 300000000UL
#define VC3_PLL1_VCO_MAX 600000000UL
-#define VC3_PLL2_VCO_MIN 400000000UL
-#define VC3_PLL2_VCO_MAX 1200000000UL
-
#define VC3_PLL3_VCO_MIN 300000000UL
#define VC3_PLL3_VCO_MAX 800000000UL
@@ -147,9 +144,13 @@ struct vc3_pfd_data {
u8 mdiv2_bitmsk;
};
+struct vc3_vco {
+ unsigned long min;
+ unsigned long max;
+};
+
struct vc3_pll_data {
- unsigned long vco_min;
- unsigned long vco_max;
+ struct vc3_vco vco;
u8 num;
u8 int_div_msb_offs;
u8 int_div_lsb_offs;
@@ -166,12 +167,17 @@ struct vc3_div_data {
struct vc3_hw_data {
struct clk_hw hw;
struct regmap *regmap;
- const void *data;
+ void *data;
u32 div_int;
u32 div_frc;
};
+struct vc3_hw_cfg {
+ struct vc3_vco pll2_vco;
+ u32 se2_clk_sel_msk;
+};
+
static const struct clk_div_table div1_divs[] = {
{ .val = 0, .div = 1, }, { .val = 1, .div = 4, },
{ .val = 2, .div = 5, }, { .val = 3, .div = 6, },
@@ -386,10 +392,10 @@ static long vc3_pll_round_rate(struct clk_hw *hw, unsigned long rate,
const struct vc3_pll_data *pll = vc3->data;
u64 div_frc;
- if (rate < pll->vco_min)
- rate = pll->vco_min;
- if (rate > pll->vco_max)
- rate = pll->vco_max;
+ if (rate < pll->vco.min)
+ rate = pll->vco.min;
+ if (rate > pll->vco.max)
+ rate = pll->vco.max;
vc3->div_int = rate / *parent_rate;
@@ -680,8 +686,10 @@ static struct vc3_hw_data clk_pll[] = {
.num = VC3_PLL1,
.int_div_msb_offs = VC3_PLL1_LOOP_FILTER_N_DIV_MSB,
.int_div_lsb_offs = VC3_PLL1_VCO_N_DIVIDER,
- .vco_min = VC3_PLL1_VCO_MIN,
- .vco_max = VC3_PLL1_VCO_MAX
+ .vco = {
+ .min = VC3_PLL1_VCO_MIN,
+ .max = VC3_PLL1_VCO_MAX
+ }
},
.hw.init = &(struct clk_init_data) {
.name = "pll1",
@@ -698,8 +706,6 @@ static struct vc3_hw_data clk_pll[] = {
.num = VC3_PLL2,
.int_div_msb_offs = VC3_PLL2_FB_INT_DIV_MSB,
.int_div_lsb_offs = VC3_PLL2_FB_INT_DIV_LSB,
- .vco_min = VC3_PLL2_VCO_MIN,
- .vco_max = VC3_PLL2_VCO_MAX
},
.hw.init = &(struct clk_init_data) {
.name = "pll2",
@@ -716,8 +722,10 @@ static struct vc3_hw_data clk_pll[] = {
.num = VC3_PLL3,
.int_div_msb_offs = VC3_PLL3_LOOP_FILTER_N_DIV_MSB,
.int_div_lsb_offs = VC3_PLL3_N_DIVIDER,
- .vco_min = VC3_PLL3_VCO_MIN,
- .vco_max = VC3_PLL3_VCO_MAX
+ .vco = {
+ .min = VC3_PLL3_VCO_MIN,
+ .max = VC3_PLL3_VCO_MAX
+ }
},
.hw.init = &(struct clk_init_data) {
.name = "pll3",
@@ -901,7 +909,6 @@ static struct vc3_hw_data clk_mux[] = {
[VC3_SE2_MUX] = {
.data = &(struct vc3_clk_data) {
.offs = VC3_SE2_CTRL_REG0,
- .bitmsk = VC3_SE2_CTRL_REG0_SE2_CLK_SEL
},
.hw.init = &(struct clk_init_data) {
.name = "se2_mux",
@@ -982,6 +989,7 @@ static int vc3_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
u8 settings[NUM_CONFIG_REGISTERS];
+ const struct vc3_hw_cfg *data;
struct regmap *regmap;
const char *name;
int ret, i;
@@ -1029,9 +1037,16 @@ static int vc3_probe(struct i2c_client *client)
clk_pfd[i].hw.init->name);
}
+ data = i2c_get_match_data(client);
+
/* Register pll's */
for (i = 0; i < ARRAY_SIZE(clk_pll); i++) {
clk_pll[i].regmap = regmap;
+ if (i == VC3_PLL2) {
+ struct vc3_pll_data *pll_data = clk_pll[i].data;
+
+ pll_data->vco = data->pll2_vco;
+ }
ret = devm_clk_hw_register(dev, &clk_pll[i].hw);
if (ret)
return dev_err_probe(dev, ret, "%s failed\n",
@@ -1059,6 +1074,11 @@ static int vc3_probe(struct i2c_client *client)
/* Register clk muxes */
for (i = 0; i < ARRAY_SIZE(clk_mux); i++) {
clk_mux[i].regmap = regmap;
+ if (i == VC3_SE2_MUX) {
+ struct vc3_clk_data *clk_data = clk_mux[i].data;
+
+ clk_data->bitmsk = data->se2_clk_sel_msk;
+ }
ret = devm_clk_hw_register(dev, &clk_mux[i].hw);
if (ret)
return dev_err_probe(dev, ret, "%s failed\n",
@@ -1108,8 +1128,13 @@ static int vc3_probe(struct i2c_client *client)
return ret;
}
+static const struct vc3_hw_cfg vc3_5p = {
+ .pll2_vco = { .min = 400000000UL, .max = 1200000000UL },
+ .se2_clk_sel_msk = BIT(6),
+};
+
static const struct of_device_id dev_ids[] = {
- { .compatible = "renesas,5p35023" },
+ { .compatible = "renesas,5p35023", .data = &vc3_5p },
{ /* Sentinel */ }
};
MODULE_DEVICE_TABLE(of, dev_ids);
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 03/25] dt-bindings: clock: versaclock3: Document 5L35023 Versa3 clock generator
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
2024-11-08 10:49 ` [PATCH v2 01/25] clk: renesas: r9a08g045-cpg: Add clocks, resets and power domains support for SSI Claudiu
2024-11-08 10:49 ` [PATCH v2 02/25] clk: versaclock3: Prepare for the addition of 5L35023 device Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-10 8:31 ` Biju Das
2024-11-08 10:49 ` [PATCH v2 04/25] clk: versaclock3: Add support for the 5L35023 variant Claudiu
` (21 subsequent siblings)
24 siblings, 1 reply; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea,
Krzysztof Kozlowski
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
There are some differences b/w 5L35023 and 5P35023 Versa3 clock
generator variants but the same driver could be used with minimal
adjustments. The identified differences are PLL2 Fvco, the clock sel
bit for SE2 clock and different default values for some registers.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- collected tags
Documentation/devicetree/bindings/clock/renesas,5p35023.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/clock/renesas,5p35023.yaml b/Documentation/devicetree/bindings/clock/renesas,5p35023.yaml
index 42b6f80613f3..162d38035188 100644
--- a/Documentation/devicetree/bindings/clock/renesas,5p35023.yaml
+++ b/Documentation/devicetree/bindings/clock/renesas,5p35023.yaml
@@ -31,6 +31,7 @@ description: |
properties:
compatible:
enum:
+ - renesas,5l35023
- renesas,5p35023
reg:
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 04/25] clk: versaclock3: Add support for the 5L35023 variant
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (2 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 03/25] dt-bindings: clock: versaclock3: Document 5L35023 Versa3 clock generator Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-10 8:33 ` Biju Das
2024-11-08 10:49 ` [PATCH v2 05/25] pinctrl: renesas: rzg2l: Add audio clock pins Claudiu
` (20 subsequent siblings)
24 siblings, 1 reply; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Add support for the 5L35023 variant of the Versa 3 clock generator.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
drivers/clk/clk-versaclock3.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/clk/clk-versaclock3.c b/drivers/clk/clk-versaclock3.c
index 1398d16df5d0..9fe27dace111 100644
--- a/drivers/clk/clk-versaclock3.c
+++ b/drivers/clk/clk-versaclock3.c
@@ -1133,8 +1133,14 @@ static const struct vc3_hw_cfg vc3_5p = {
.se2_clk_sel_msk = BIT(6),
};
+static const struct vc3_hw_cfg vc3_5l = {
+ .pll2_vco = { .min = 30000000UL, .max = 130000000UL },
+ .se2_clk_sel_msk = BIT(0),
+};
+
static const struct of_device_id dev_ids[] = {
{ .compatible = "renesas,5p35023", .data = &vc3_5p },
+ { .compatible = "renesas,5l35023", .data = &vc3_5l },
{ /* Sentinel */ }
};
MODULE_DEVICE_TABLE(of, dev_ids);
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 05/25] pinctrl: renesas: rzg2l: Add audio clock pins
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (3 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 04/25] clk: versaclock3: Add support for the 5L35023 variant Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-10 8:33 ` Biju Das
2024-11-08 10:49 ` [PATCH v2 06/25] ASoC: sh: rz-ssi: Terminate all the DMA transactions Claudiu
` (19 subsequent siblings)
24 siblings, 1 reply; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Add audio clock pins. These are used by audio IPs as input pins to feed
them with audio clocks.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
drivers/pinctrl/renesas/pinctrl-rzg2l.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index 8ffb9430a134..1190ca4b1808 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -2086,6 +2086,8 @@ static const struct rzg2l_dedicated_configs rzg3s_dedicated_pins[] = {
PIN_CFG_SOFT_PS)) },
{ "TDO", RZG2L_SINGLE_PIN_PACK(0x1, 1, (PIN_CFG_IOLH_A | PIN_CFG_SOFT_PS)) },
{ "WDTOVF_PERROUT#", RZG2L_SINGLE_PIN_PACK(0x6, 0, PIN_CFG_IOLH_A | PIN_CFG_SOFT_PS) },
+ { "AUDIO_CLK1", RZG2L_SINGLE_PIN_PACK(0x2, 0, PIN_CFG_IEN) },
+ { "AUDIO_CLK2", RZG2L_SINGLE_PIN_PACK(0x2, 1, PIN_CFG_IEN) },
{ "SD0_CLK", RZG2L_SINGLE_PIN_PACK(0x10, 0, (PIN_CFG_IOLH_B | PIN_CFG_IO_VMC_SD0)) },
{ "SD0_CMD", RZG2L_SINGLE_PIN_PACK(0x10, 1, (PIN_CFG_IOLH_B | PIN_CFG_IEN |
PIN_CFG_IO_VMC_SD0)) },
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 06/25] ASoC: sh: rz-ssi: Terminate all the DMA transactions
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (4 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 05/25] pinctrl: renesas: rzg2l: Add audio clock pins Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-10 8:37 ` Biju Das
2024-11-11 0:45 ` Kuninori Morimoto
2024-11-08 10:49 ` [PATCH v2 07/25] ASoC: sh: rz-ssi: Use only the proper amount of dividers Claudiu
` (18 subsequent siblings)
24 siblings, 2 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea, stable
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
In case of full duplex the 1st closed stream doesn't benefit from the
dmaengine_terminate_async(). Call it after the companion stream is
closed.
Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support")
Cc: stable@vger.kernel.org
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
sound/soc/renesas/rz-ssi.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index 6efd017aaa7f..2d8721156099 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -415,8 +415,12 @@ static int rz_ssi_stop(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
rz_ssi_reg_mask_setl(ssi, SSICR, SSICR_TEN | SSICR_REN, 0);
/* Cancel all remaining DMA transactions */
- if (rz_ssi_is_dma_enabled(ssi))
- dmaengine_terminate_async(strm->dma_ch);
+ if (rz_ssi_is_dma_enabled(ssi)) {
+ if (ssi->playback.dma_ch)
+ dmaengine_terminate_async(ssi->playback.dma_ch);
+ if (ssi->capture.dma_ch)
+ dmaengine_terminate_async(ssi->capture.dma_ch);
+ }
rz_ssi_set_idle(ssi);
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 07/25] ASoC: sh: rz-ssi: Use only the proper amount of dividers
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (5 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 06/25] ASoC: sh: rz-ssi: Terminate all the DMA transactions Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 08/25] ASoC: sh: rz-ssi: Fix typo on SSI_RATES macro comment Claudiu
` (17 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
There is no need to populate the ckdv[] with invalid dividers as that
part will not be indexed anyway. The ssi->audio_mck/bclk_rate should
always be >= 0.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
sound/soc/renesas/rz-ssi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index 2d8721156099..b4439505929f 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -258,8 +258,7 @@ static void rz_ssi_stream_quit(struct rz_ssi_priv *ssi,
static int rz_ssi_clk_setup(struct rz_ssi_priv *ssi, unsigned int rate,
unsigned int channels)
{
- static s8 ckdv[16] = { 1, 2, 4, 8, 16, 32, 64, 128,
- 6, 12, 24, 48, 96, -1, -1, -1 };
+ static s8 ckdv[] = { 1, 2, 4, 8, 16, 32, 64, 128, 6, 12, 24, 48, 96 };
unsigned int channel_bits = 32; /* System Word Length */
unsigned long bclk_rate = rate * channels * channel_bits;
unsigned int div;
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 08/25] ASoC: sh: rz-ssi: Fix typo on SSI_RATES macro comment
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (6 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 07/25] ASoC: sh: rz-ssi: Use only the proper amount of dividers Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 09/25] ASoC: sh: rz-ssi: Remove pdev member of struct rz_ssi_priv Claudiu
` (16 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
The SSI_RATES macro covers 8KHz-48KHz audio frequencies. Update macro
comment to reflect it.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
sound/soc/renesas/rz-ssi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index b4439505929f..a4d65be17eb1 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -71,7 +71,7 @@
#define PREALLOC_BUFFER (SZ_32K)
#define PREALLOC_BUFFER_MAX (SZ_32K)
-#define SSI_RATES SNDRV_PCM_RATE_8000_48000 /* 8k-44.1kHz */
+#define SSI_RATES SNDRV_PCM_RATE_8000_48000 /* 8k-48kHz */
#define SSI_FMTS SNDRV_PCM_FMTBIT_S16_LE
#define SSI_CHAN_MIN 2
#define SSI_CHAN_MAX 2
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 09/25] ASoC: sh: rz-ssi: Remove pdev member of struct rz_ssi_priv
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (7 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 08/25] ASoC: sh: rz-ssi: Fix typo on SSI_RATES macro comment Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 10/25] ASoC: sh: rz-ssi: Remove the rz_ssi_get_dai() function Claudiu
` (15 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Remove the pdev member of struct rz_ssi_priv as it is not used.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
sound/soc/renesas/rz-ssi.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index a4d65be17eb1..a359235b55af 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -99,7 +99,6 @@ struct rz_ssi_stream {
struct rz_ssi_priv {
void __iomem *base;
- struct platform_device *pdev;
struct reset_control *rstc;
struct device *dev;
struct clk *sfr_clk;
@@ -1043,7 +1042,6 @@ static int rz_ssi_probe(struct platform_device *pdev)
if (!ssi)
return -ENOMEM;
- ssi->pdev = pdev;
ssi->dev = &pdev->dev;
ssi->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(ssi->base))
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 10/25] ASoC: sh: rz-ssi: Remove the rz_ssi_get_dai() function
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (8 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 09/25] ASoC: sh: rz-ssi: Remove pdev member of struct rz_ssi_priv Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 11/25] ASoC: sh: rz-ssi: Remove the first argument of rz_ssi_stream_is_play() Claudiu
` (14 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Remove the rz_ssi_get_dai() function as there are already helpers that
can give the same output that rz_ssi_get_dai() gives.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
sound/soc/renesas/rz-ssi.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index a359235b55af..4c33663a0ae4 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -162,14 +162,6 @@ static void rz_ssi_reg_mask_setl(struct rz_ssi_priv *priv, uint reg,
writel(val, (priv->base + reg));
}
-static inline struct snd_soc_dai *
-rz_ssi_get_dai(struct snd_pcm_substream *substream)
-{
- struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
-
- return snd_soc_rtd_to_cpu(rtd, 0);
-}
-
static inline bool rz_ssi_stream_is_play(struct rz_ssi_priv *ssi,
struct snd_pcm_substream *substream)
{
@@ -243,15 +235,15 @@ static void rz_ssi_stream_init(struct rz_ssi_stream *strm,
static void rz_ssi_stream_quit(struct rz_ssi_priv *ssi,
struct rz_ssi_stream *strm)
{
- struct snd_soc_dai *dai = rz_ssi_get_dai(strm->substream);
+ struct device *dev = ssi->dev;
rz_ssi_set_substream(strm, NULL);
if (strm->oerr_num > 0)
- dev_info(dai->dev, "overrun = %d\n", strm->oerr_num);
+ dev_info(dev, "overrun = %d\n", strm->oerr_num);
if (strm->uerr_num > 0)
- dev_info(dai->dev, "underrun = %d\n", strm->uerr_num);
+ dev_info(dev, "underrun = %d\n", strm->uerr_num);
}
static int rz_ssi_clk_setup(struct rz_ssi_priv *ssi, unsigned int rate,
@@ -988,7 +980,8 @@ static int rz_ssi_pcm_open(struct snd_soc_component *component,
static snd_pcm_uframes_t rz_ssi_pcm_pointer(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{
- struct snd_soc_dai *dai = rz_ssi_get_dai(substream);
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
+ struct snd_soc_dai *dai = snd_soc_rtd_to_cpu(rtd, 0);
struct rz_ssi_priv *ssi = snd_soc_dai_get_drvdata(dai);
struct rz_ssi_stream *strm = rz_ssi_stream_get(ssi, substream);
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 11/25] ASoC: sh: rz-ssi: Remove the first argument of rz_ssi_stream_is_play()
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (9 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 10/25] ASoC: sh: rz-ssi: Remove the rz_ssi_get_dai() function Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 12/25] ASoC: sh: rz-ssi: Use readl_poll_timeout_atomic() Claudiu
` (13 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
The first argument of the rz_ssi_stream_is_play() is not used. Remove it.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- fixed typos in patch title and description
- collected tags
sound/soc/renesas/rz-ssi.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index 4c33663a0ae4..f230d63339e8 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -162,8 +162,7 @@ static void rz_ssi_reg_mask_setl(struct rz_ssi_priv *priv, uint reg,
writel(val, (priv->base + reg));
}
-static inline bool rz_ssi_stream_is_play(struct rz_ssi_priv *ssi,
- struct snd_pcm_substream *substream)
+static inline bool rz_ssi_stream_is_play(struct snd_pcm_substream *substream)
{
return substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
}
@@ -337,7 +336,7 @@ static void rz_ssi_set_idle(struct rz_ssi_priv *ssi)
static int rz_ssi_start(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
{
- bool is_play = rz_ssi_stream_is_play(ssi, strm->substream);
+ bool is_play = rz_ssi_stream_is_play(strm->substream);
bool is_full_duplex;
u32 ssicr, ssifcr;
@@ -674,7 +673,7 @@ static int rz_ssi_dma_transfer(struct rz_ssi_priv *ssi,
*/
return 0;
- dir = rz_ssi_stream_is_play(ssi, substream) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
+ dir = rz_ssi_stream_is_play(substream) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
/* Always transfer 1 period */
amount = runtime->period_size;
@@ -800,7 +799,7 @@ static int rz_ssi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
if (ssi->dma_rt) {
bool is_playback;
- is_playback = rz_ssi_stream_is_play(ssi, substream);
+ is_playback = rz_ssi_stream_is_play(substream);
ret = rz_ssi_dma_slave_config(ssi, ssi->playback.dma_ch,
is_playback);
/* Fallback to pio */
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 12/25] ASoC: sh: rz-ssi: Use readl_poll_timeout_atomic()
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (10 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 11/25] ASoC: sh: rz-ssi: Remove the first argument of rz_ssi_stream_is_play() Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 13/25] ASoC: sh: rz-ssi: Use temporary variable for struct device Claudiu
` (12 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Use readl_poll_timeout_atomic() instead of hardcoding something similar.
While at it replace dev_info() with dev_warn_ratelimited() as the
rz_ssi_set_idle() can also be called from IRQ context and if the SSI
idle is not properly set this is at least a warning for user.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
sound/soc/renesas/rz-ssi.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index f230d63339e8..aa175803867f 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -9,6 +9,7 @@
#include <linux/clk.h>
#include <linux/dmaengine.h>
#include <linux/io.h>
+#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/reset.h>
@@ -307,7 +308,8 @@ static int rz_ssi_clk_setup(struct rz_ssi_priv *ssi, unsigned int rate,
static void rz_ssi_set_idle(struct rz_ssi_priv *ssi)
{
- int timeout;
+ u32 tmp;
+ int ret;
/* Disable irqs */
rz_ssi_reg_mask_setl(ssi, SSICR, SSICR_TUIEN | SSICR_TOIEN |
@@ -320,15 +322,9 @@ static void rz_ssi_set_idle(struct rz_ssi_priv *ssi)
SSISR_RUIRQ), 0);
/* Wait for idle */
- timeout = 100;
- while (--timeout) {
- if (rz_ssi_reg_readl(ssi, SSISR) & SSISR_IIRQ)
- break;
- udelay(1);
- }
-
- if (!timeout)
- dev_info(ssi->dev, "timeout waiting for SSI idle\n");
+ ret = readl_poll_timeout_atomic(ssi->base + SSISR, tmp, (tmp & SSISR_IIRQ), 1, 100);
+ if (ret)
+ dev_warn_ratelimited(ssi->dev, "timeout waiting for SSI idle\n");
/* Hold FIFOs in reset */
rz_ssi_reg_mask_setl(ssi, SSIFCR, 0, SSIFCR_FIFO_RST);
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 13/25] ASoC: sh: rz-ssi: Use temporary variable for struct device
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (11 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 12/25] ASoC: sh: rz-ssi: Use readl_poll_timeout_atomic() Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 14/25] ASoC: sh: rz-ssi: Use goto label names that specify their actions Claudiu
` (11 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Use a temporary variable for the struct device pointers to avoid
dereferencing.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
sound/soc/renesas/rz-ssi.c | 62 +++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 31 deletions(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index aa175803867f..2f56c63582e7 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -1021,36 +1021,37 @@ static const struct snd_soc_component_driver rz_ssi_soc_component = {
static int rz_ssi_probe(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
struct rz_ssi_priv *ssi;
struct clk *audio_clk;
struct resource *res;
int ret;
- ssi = devm_kzalloc(&pdev->dev, sizeof(*ssi), GFP_KERNEL);
+ ssi = devm_kzalloc(dev, sizeof(*ssi), GFP_KERNEL);
if (!ssi)
return -ENOMEM;
- ssi->dev = &pdev->dev;
+ ssi->dev = dev;
ssi->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(ssi->base))
return PTR_ERR(ssi->base);
ssi->phys = res->start;
- ssi->clk = devm_clk_get(&pdev->dev, "ssi");
+ ssi->clk = devm_clk_get(dev, "ssi");
if (IS_ERR(ssi->clk))
return PTR_ERR(ssi->clk);
- ssi->sfr_clk = devm_clk_get(&pdev->dev, "ssi_sfr");
+ ssi->sfr_clk = devm_clk_get(dev, "ssi_sfr");
if (IS_ERR(ssi->sfr_clk))
return PTR_ERR(ssi->sfr_clk);
- audio_clk = devm_clk_get(&pdev->dev, "audio_clk1");
+ audio_clk = devm_clk_get(dev, "audio_clk1");
if (IS_ERR(audio_clk))
return dev_err_probe(&pdev->dev, PTR_ERR(audio_clk),
"no audio clk1");
ssi->audio_clk_1 = clk_get_rate(audio_clk);
- audio_clk = devm_clk_get(&pdev->dev, "audio_clk2");
+ audio_clk = devm_clk_get(dev, "audio_clk2");
if (IS_ERR(audio_clk))
return dev_err_probe(&pdev->dev, PTR_ERR(audio_clk),
"no audio clk2");
@@ -1063,13 +1064,13 @@ static int rz_ssi_probe(struct platform_device *pdev)
ssi->audio_mck = ssi->audio_clk_1 ? ssi->audio_clk_1 : ssi->audio_clk_2;
/* Detect DMA support */
- ret = rz_ssi_dma_request(ssi, &pdev->dev);
+ ret = rz_ssi_dma_request(ssi, dev);
if (ret < 0) {
- dev_warn(&pdev->dev, "DMA not available, using PIO\n");
+ dev_warn(dev, "DMA not available, using PIO\n");
ssi->playback.transfer = rz_ssi_pio_send;
ssi->capture.transfer = rz_ssi_pio_recv;
} else {
- dev_info(&pdev->dev, "DMA enabled");
+ dev_info(dev, "DMA enabled");
ssi->playback.transfer = rz_ssi_dma_transfer;
ssi->capture.transfer = rz_ssi_dma_transfer;
}
@@ -1078,7 +1079,7 @@ static int rz_ssi_probe(struct platform_device *pdev)
ssi->capture.priv = ssi;
spin_lock_init(&ssi->lock);
- dev_set_drvdata(&pdev->dev, ssi);
+ dev_set_drvdata(dev, ssi);
/* Error Interrupt */
ssi->irq_int = platform_get_irq_byname(pdev, "int_req");
@@ -1087,12 +1088,11 @@ static int rz_ssi_probe(struct platform_device *pdev)
return ssi->irq_int;
}
- ret = devm_request_irq(&pdev->dev, ssi->irq_int, &rz_ssi_interrupt,
- 0, dev_name(&pdev->dev), ssi);
+ ret = devm_request_irq(dev, ssi->irq_int, &rz_ssi_interrupt,
+ 0, dev_name(dev), ssi);
if (ret < 0) {
rz_ssi_release_dma_channels(ssi);
- return dev_err_probe(&pdev->dev, ret,
- "irq request error (int_req)\n");
+ return dev_err_probe(dev, ret, "irq request error (int_req)\n");
}
if (!rz_ssi_is_dma_enabled(ssi)) {
@@ -1104,11 +1104,11 @@ static int rz_ssi_probe(struct platform_device *pdev)
if (ssi->irq_rt < 0)
return ssi->irq_rt;
- ret = devm_request_irq(&pdev->dev, ssi->irq_rt,
+ ret = devm_request_irq(dev, ssi->irq_rt,
&rz_ssi_interrupt, 0,
- dev_name(&pdev->dev), ssi);
+ dev_name(dev), ssi);
if (ret < 0)
- return dev_err_probe(&pdev->dev, ret,
+ return dev_err_probe(dev, ret,
"irq request error (dma_rt)\n");
} else {
if (ssi->irq_tx < 0)
@@ -1117,50 +1117,50 @@ static int rz_ssi_probe(struct platform_device *pdev)
if (ssi->irq_rx < 0)
return ssi->irq_rx;
- ret = devm_request_irq(&pdev->dev, ssi->irq_tx,
+ ret = devm_request_irq(dev, ssi->irq_tx,
&rz_ssi_interrupt, 0,
- dev_name(&pdev->dev), ssi);
+ dev_name(dev), ssi);
if (ret < 0)
- return dev_err_probe(&pdev->dev, ret,
+ return dev_err_probe(dev, ret,
"irq request error (dma_tx)\n");
- ret = devm_request_irq(&pdev->dev, ssi->irq_rx,
+ ret = devm_request_irq(dev, ssi->irq_rx,
&rz_ssi_interrupt, 0,
- dev_name(&pdev->dev), ssi);
+ dev_name(dev), ssi);
if (ret < 0)
- return dev_err_probe(&pdev->dev, ret,
+ return dev_err_probe(dev, ret,
"irq request error (dma_rx)\n");
}
}
- ssi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
+ ssi->rstc = devm_reset_control_get_exclusive(dev, NULL);
if (IS_ERR(ssi->rstc)) {
ret = PTR_ERR(ssi->rstc);
goto err_reset;
}
reset_control_deassert(ssi->rstc);
- pm_runtime_enable(&pdev->dev);
- ret = pm_runtime_resume_and_get(&pdev->dev);
+ pm_runtime_enable(dev);
+ ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
- dev_err(&pdev->dev, "pm_runtime_resume_and_get failed\n");
+ dev_err(dev, "pm_runtime_resume_and_get failed\n");
goto err_pm;
}
- ret = devm_snd_soc_register_component(&pdev->dev, &rz_ssi_soc_component,
+ ret = devm_snd_soc_register_component(dev, &rz_ssi_soc_component,
rz_ssi_soc_dai,
ARRAY_SIZE(rz_ssi_soc_dai));
if (ret < 0) {
- dev_err(&pdev->dev, "failed to register snd component\n");
+ dev_err(dev, "failed to register snd component\n");
goto err_snd_soc;
}
return 0;
err_snd_soc:
- pm_runtime_put(ssi->dev);
+ pm_runtime_put(dev);
err_pm:
- pm_runtime_disable(ssi->dev);
+ pm_runtime_disable(dev);
reset_control_assert(ssi->rstc);
err_reset:
rz_ssi_release_dma_channels(ssi);
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 14/25] ASoC: sh: rz-ssi: Use goto label names that specify their actions
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (12 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 13/25] ASoC: sh: rz-ssi: Use temporary variable for struct device Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 15/25] ASoC: sh: rz-ssi: Rely on the ASoC subsystem to runtime resume/suspend the SSI Claudiu
` (10 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Use goto label names that specify their action. In this way we can have
a better understanding of what is the action associated with the label
by just reading the label name.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
sound/soc/renesas/rz-ssi.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index 2f56c63582e7..4af381f6d470 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -1084,15 +1084,15 @@ static int rz_ssi_probe(struct platform_device *pdev)
/* Error Interrupt */
ssi->irq_int = platform_get_irq_byname(pdev, "int_req");
if (ssi->irq_int < 0) {
- rz_ssi_release_dma_channels(ssi);
- return ssi->irq_int;
+ ret = ssi->irq_int;
+ goto err_release_dma_chs;
}
ret = devm_request_irq(dev, ssi->irq_int, &rz_ssi_interrupt,
0, dev_name(dev), ssi);
if (ret < 0) {
- rz_ssi_release_dma_channels(ssi);
- return dev_err_probe(dev, ret, "irq request error (int_req)\n");
+ dev_err_probe(dev, ret, "irq request error (int_req)\n");
+ goto err_release_dma_chs;
}
if (!rz_ssi_is_dma_enabled(ssi)) {
@@ -1136,7 +1136,7 @@ static int rz_ssi_probe(struct platform_device *pdev)
ssi->rstc = devm_reset_control_get_exclusive(dev, NULL);
if (IS_ERR(ssi->rstc)) {
ret = PTR_ERR(ssi->rstc);
- goto err_reset;
+ goto err_release_dma_chs;
}
reset_control_deassert(ssi->rstc);
@@ -1152,17 +1152,17 @@ static int rz_ssi_probe(struct platform_device *pdev)
ARRAY_SIZE(rz_ssi_soc_dai));
if (ret < 0) {
dev_err(dev, "failed to register snd component\n");
- goto err_snd_soc;
+ goto err_pm_put;
}
return 0;
-err_snd_soc:
+err_pm_put:
pm_runtime_put(dev);
err_pm:
pm_runtime_disable(dev);
reset_control_assert(ssi->rstc);
-err_reset:
+err_release_dma_chs:
rz_ssi_release_dma_channels(ssi);
return ret;
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 15/25] ASoC: sh: rz-ssi: Rely on the ASoC subsystem to runtime resume/suspend the SSI
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (13 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 14/25] ASoC: sh: rz-ssi: Use goto label names that specify their actions Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 16/25] ASoC: sh: rz-ssi: Enable runtime PM autosuspend support Claudiu
` (9 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
The ASoC subsystem takes care of runtime resume/suspend the audio
devices when needed. Just enable the runtime PM on the SSI driver and
let the subsystem runtime resume/suspend it. While at it use directly
the devm_pm_runtime_enable().
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
sound/soc/renesas/rz-ssi.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index 4af381f6d470..35172630be8b 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -1140,11 +1140,10 @@ static int rz_ssi_probe(struct platform_device *pdev)
}
reset_control_deassert(ssi->rstc);
- pm_runtime_enable(dev);
- ret = pm_runtime_resume_and_get(dev);
+ ret = devm_pm_runtime_enable(dev);
if (ret < 0) {
- dev_err(dev, "pm_runtime_resume_and_get failed\n");
- goto err_pm;
+ dev_err(dev, "Failed to enable runtime PM!\n");
+ goto err_reset;
}
ret = devm_snd_soc_register_component(dev, &rz_ssi_soc_component,
@@ -1152,15 +1151,12 @@ static int rz_ssi_probe(struct platform_device *pdev)
ARRAY_SIZE(rz_ssi_soc_dai));
if (ret < 0) {
dev_err(dev, "failed to register snd component\n");
- goto err_pm_put;
+ goto err_reset;
}
return 0;
-err_pm_put:
- pm_runtime_put(dev);
-err_pm:
- pm_runtime_disable(dev);
+err_reset:
reset_control_assert(ssi->rstc);
err_release_dma_chs:
rz_ssi_release_dma_channels(ssi);
@@ -1174,8 +1170,6 @@ static void rz_ssi_remove(struct platform_device *pdev)
rz_ssi_release_dma_channels(ssi);
- pm_runtime_put(ssi->dev);
- pm_runtime_disable(ssi->dev);
reset_control_assert(ssi->rstc);
}
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 16/25] ASoC: sh: rz-ssi: Enable runtime PM autosuspend support
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (14 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 15/25] ASoC: sh: rz-ssi: Rely on the ASoC subsystem to runtime resume/suspend the SSI Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 17/25] ASoC: sh: rz-ssi: Add runtime PM support Claudiu
` (8 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Enable runtime PM autosuspend support. The chosen autosuspend delay is
zero for immediate autosuspend. In case there are users that need a
different autosuspend delay, it can be adjusted through sysfs.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
sound/soc/renesas/rz-ssi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index 35172630be8b..01e8b6a4e8a8 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -1140,6 +1140,9 @@ static int rz_ssi_probe(struct platform_device *pdev)
}
reset_control_deassert(ssi->rstc);
+ /* Default 0 for power saving. Can be overridden via sysfs. */
+ pm_runtime_set_autosuspend_delay(dev, 0);
+ pm_runtime_use_autosuspend(dev);
ret = devm_pm_runtime_enable(dev);
if (ret < 0) {
dev_err(dev, "Failed to enable runtime PM!\n");
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 17/25] ASoC: sh: rz-ssi: Add runtime PM support
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (15 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 16/25] ASoC: sh: rz-ssi: Enable runtime PM autosuspend support Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 18/25] ASoC: sh: rz-ssi: Issue software reset in hw_params API Claudiu
` (7 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Add runtime PM support to the ssi driver. This assert/de-assert the
reset lines on runtime suspend/resume. Along with it the de-assertion of
the reset line from probe function was removed as it is not necessary
anymore.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
sound/soc/renesas/rz-ssi.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index 01e8b6a4e8a8..d0e2665ec830 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -1139,14 +1139,13 @@ static int rz_ssi_probe(struct platform_device *pdev)
goto err_release_dma_chs;
}
- reset_control_deassert(ssi->rstc);
/* Default 0 for power saving. Can be overridden via sysfs. */
pm_runtime_set_autosuspend_delay(dev, 0);
pm_runtime_use_autosuspend(dev);
ret = devm_pm_runtime_enable(dev);
if (ret < 0) {
dev_err(dev, "Failed to enable runtime PM!\n");
- goto err_reset;
+ goto err_release_dma_chs;
}
ret = devm_snd_soc_register_component(dev, &rz_ssi_soc_component,
@@ -1154,13 +1153,11 @@ static int rz_ssi_probe(struct platform_device *pdev)
ARRAY_SIZE(rz_ssi_soc_dai));
if (ret < 0) {
dev_err(dev, "failed to register snd component\n");
- goto err_reset;
+ goto err_release_dma_chs;
}
return 0;
-err_reset:
- reset_control_assert(ssi->rstc);
err_release_dma_chs:
rz_ssi_release_dma_channels(ssi);
@@ -1182,10 +1179,29 @@ static const struct of_device_id rz_ssi_of_match[] = {
};
MODULE_DEVICE_TABLE(of, rz_ssi_of_match);
+static int rz_ssi_runtime_suspend(struct device *dev)
+{
+ struct rz_ssi_priv *ssi = dev_get_drvdata(dev);
+
+ return reset_control_assert(ssi->rstc);
+}
+
+static int rz_ssi_runtime_resume(struct device *dev)
+{
+ struct rz_ssi_priv *ssi = dev_get_drvdata(dev);
+
+ return reset_control_deassert(ssi->rstc);
+}
+
+static const struct dev_pm_ops rz_ssi_pm_ops = {
+ RUNTIME_PM_OPS(rz_ssi_runtime_suspend, rz_ssi_runtime_resume, NULL)
+};
+
static struct platform_driver rz_ssi_driver = {
.driver = {
.name = "rz-ssi-pcm-audio",
.of_match_table = rz_ssi_of_match,
+ .pm = pm_ptr(&rz_ssi_pm_ops),
},
.probe = rz_ssi_probe,
.remove = rz_ssi_remove,
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 18/25] ASoC: sh: rz-ssi: Issue software reset in hw_params API
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (16 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 17/25] ASoC: sh: rz-ssi: Add runtime PM support Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 19/25] ASoC: sh: rz-ssi: Add suspend to RAM support Claudiu
` (6 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
The code initially issued software reset on SNDRV_PCM_TRIGGER_START
action only before starting the first stream. This can be easily moved to
hw_params() as the action is similar to setting the clocks. Moreover,
according to the hardware manual (Table 35.7 Bits Initialized by Software
Reset of the SSIFCR.SSIRST Bit) the software reset action acts also on the
clock dividers bits. Due to this issue the software reset in hw_params()
before configuring the clock dividers. This also simplifies the code in
trigger API.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
sound/soc/renesas/rz-ssi.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index d0e2665ec830..10dd973a1c85 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -388,6 +388,15 @@ static int rz_ssi_start(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
return 0;
}
+static int rz_ssi_swreset(struct rz_ssi_priv *ssi)
+{
+ u32 tmp;
+
+ rz_ssi_reg_mask_setl(ssi, SSIFCR, SSIFCR_SSIRST, SSIFCR_SSIRST);
+ rz_ssi_reg_mask_setl(ssi, SSIFCR, SSIFCR_SSIRST, 0);
+ return readl_poll_timeout_atomic(ssi->base + SSIFCR, tmp, !(tmp & SSIFCR_SSIRST), 1, 5);
+}
+
static int rz_ssi_stop(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
{
strm->running = 0;
@@ -782,14 +791,6 @@ static int rz_ssi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
- /* Soft Reset */
- if (!rz_ssi_is_stream_running(&ssi->playback) &&
- !rz_ssi_is_stream_running(&ssi->capture)) {
- rz_ssi_reg_mask_setl(ssi, SSIFCR, 0, SSIFCR_SSIRST);
- rz_ssi_reg_mask_setl(ssi, SSIFCR, SSIFCR_SSIRST, 0);
- udelay(5);
- }
-
rz_ssi_stream_init(strm, substream);
if (ssi->dma_rt) {
@@ -914,6 +915,7 @@ static int rz_ssi_dai_hw_params(struct snd_pcm_substream *substream,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS)->min;
unsigned int channels = params_channels(params);
unsigned int rate = params_rate(params);
+ int ret;
if (sample_bits != 16) {
dev_err(ssi->dev, "Unsupported sample width: %d\n",
@@ -940,6 +942,10 @@ static int rz_ssi_dai_hw_params(struct snd_pcm_substream *substream,
rz_ssi_cache_hw_params(ssi, rate, channels, strm->sample_width,
sample_bits);
+ ret = rz_ssi_swreset(ssi);
+ if (ret)
+ return ret;
+
return rz_ssi_clk_setup(ssi, rate, channels);
}
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 19/25] ASoC: sh: rz-ssi: Add suspend to RAM support
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (17 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 18/25] ASoC: sh: rz-ssi: Issue software reset in hw_params API Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 20/25] ASoC: dt-bindings: renesas,rz-ssi: Document the Renesas RZ/G3S SoC Claudiu
` (5 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
The SSIF-2 IP is available on the Renesas RZ/G3S SoC. The Renesas RZ/G3S
SoC supports a power-saving mode where power to most of the SoC
components is turned off. Add suspend/resume support to the SSIF-2 driver
to support this power-saving mode.
On SNDRV_PCM_TRIGGER_SUSPEND trigger the SSI is stopped (the stream
user pointer is left untouched to avoid breaking user space and the dma
buffer pointer is set to zero), on SNDRV_PCM_TRIGGER_RESUME software reset
is issued for the SSIF-2 IP and the clocks are re-configured.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
sound/soc/renesas/rz-ssi.c | 46 ++++++++++++++++++++++++++++++++++++--
1 file changed, 44 insertions(+), 2 deletions(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index 10dd973a1c85..c6bedb58d3ae 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -782,6 +782,32 @@ static int rz_ssi_dma_request(struct rz_ssi_priv *ssi, struct device *dev)
return -ENODEV;
}
+static int rz_ssi_trigger_resume(struct rz_ssi_priv *ssi)
+{
+ int ret;
+
+ if (rz_ssi_is_stream_running(&ssi->playback) ||
+ rz_ssi_is_stream_running(&ssi->capture))
+ return 0;
+
+ ret = rz_ssi_swreset(ssi);
+ if (ret)
+ return ret;
+
+ return rz_ssi_clk_setup(ssi, ssi->hw_params_cache.rate,
+ ssi->hw_params_cache.channels);
+}
+
+static void rz_ssi_streams_suspend(struct rz_ssi_priv *ssi)
+{
+ if (rz_ssi_is_stream_running(&ssi->playback) ||
+ rz_ssi_is_stream_running(&ssi->capture))
+ return;
+
+ ssi->playback.dma_buffer_pos = 0;
+ ssi->capture.dma_buffer_pos = 0;
+}
+
static int rz_ssi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{
@@ -790,8 +816,16 @@ static int rz_ssi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
int ret = 0, i, num_transfer = 1;
switch (cmd) {
+ case SNDRV_PCM_TRIGGER_RESUME:
+ ret = rz_ssi_trigger_resume(ssi);
+ if (ret)
+ return ret;
+
+ fallthrough;
+
case SNDRV_PCM_TRIGGER_START:
- rz_ssi_stream_init(strm, substream);
+ if (cmd == SNDRV_PCM_TRIGGER_START)
+ rz_ssi_stream_init(strm, substream);
if (ssi->dma_rt) {
bool is_playback;
@@ -819,6 +853,12 @@ static int rz_ssi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
ret = rz_ssi_start(ssi, strm);
break;
+
+ case SNDRV_PCM_TRIGGER_SUSPEND:
+ rz_ssi_stop(ssi, strm);
+ rz_ssi_streams_suspend(ssi);
+ break;
+
case SNDRV_PCM_TRIGGER_STOP:
rz_ssi_stop(ssi, strm);
rz_ssi_stream_quit(ssi, strm);
@@ -958,7 +998,8 @@ static const struct snd_soc_dai_ops rz_ssi_dai_ops = {
static const struct snd_pcm_hardware rz_ssi_pcm_hardware = {
.info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP |
- SNDRV_PCM_INFO_MMAP_VALID,
+ SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_RESUME,
.buffer_bytes_max = PREALLOC_BUFFER,
.period_bytes_min = 32,
.period_bytes_max = 8192,
@@ -1201,6 +1242,7 @@ static int rz_ssi_runtime_resume(struct device *dev)
static const struct dev_pm_ops rz_ssi_pm_ops = {
RUNTIME_PM_OPS(rz_ssi_runtime_suspend, rz_ssi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
};
static struct platform_driver rz_ssi_driver = {
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 20/25] ASoC: dt-bindings: renesas,rz-ssi: Document the Renesas RZ/G3S SoC
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (18 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 19/25] ASoC: sh: rz-ssi: Add suspend to RAM support Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 21/25] arm64: dts: renesas: r9a08g045: Add SSI nodes Claudiu
` (4 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea,
Krzysztof Kozlowski
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
The SSI IP variant present on the Renesas RZ/G3S SoC is similar to the
one found on the Renesas RZ/G2{UL, L, LC} SoCs. Add documentation for
it.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- collected tags
Documentation/devicetree/bindings/sound/renesas,rz-ssi.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/sound/renesas,rz-ssi.yaml b/Documentation/devicetree/bindings/sound/renesas,rz-ssi.yaml
index f4610eaed1e1..cab615f79ee4 100644
--- a/Documentation/devicetree/bindings/sound/renesas,rz-ssi.yaml
+++ b/Documentation/devicetree/bindings/sound/renesas,rz-ssi.yaml
@@ -19,6 +19,7 @@ properties:
- renesas,r9a07g043-ssi # RZ/G2UL and RZ/Five
- renesas,r9a07g044-ssi # RZ/G2{L,LC}
- renesas,r9a07g054-ssi # RZ/V2L
+ - renesas,r9a08g045-ssi # RZ/G3S
- const: renesas,rz-ssi
reg:
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 21/25] arm64: dts: renesas: r9a08g045: Add SSI nodes
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (19 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 20/25] ASoC: dt-bindings: renesas,rz-ssi: Document the Renesas RZ/G3S SoC Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 22/25] arm64: dts: renesas: rzg3s-smarc-som: Add versa3 clock generator node Claudiu
` (3 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Add DT nodes for the SSI IPs available on the Renesas RZ/G3S SoC. Along
with it external audio clocks were added. Board device tree could use it
and update the frequencies.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
arch/arm64/boot/dts/renesas/r9a08g045.dtsi | 96 ++++++++++++++++++++++
1 file changed, 96 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi
index be8a0a768c65..24c6388cd0d5 100644
--- a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi
@@ -14,6 +14,22 @@ / {
#address-cells = <2>;
#size-cells = <2>;
+ audio_clk1: audio-clk1 {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ /* This value must be overridden by boards that provide it. */
+ clock-frequency = <0>;
+ status = "disabled";
+ };
+
+ audio_clk2: audio-clk2 {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ /* This value must be overridden by boards that provide it. */
+ clock-frequency = <0>;
+ status = "disabled";
+ };
+
cpus {
#address-cells = <1>;
#size-cells = <0>;
@@ -187,6 +203,86 @@ i2c3: i2c@10090c00 {
status = "disabled";
};
+ ssi0: ssi@100a8000 {
+ compatible = "renesas,r9a08g045-ssi",
+ "renesas,rz-ssi";
+ reg = <0 0x100a8000 0 0x400>;
+ interrupts = <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 241 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 242 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "int_req", "dma_rx", "dma_tx";
+ clocks = <&cpg CPG_MOD R9A08G045_SSI0_PCLK2>,
+ <&cpg CPG_MOD R9A08G045_SSI0_PCLK_SFR>,
+ <&audio_clk1>, <&audio_clk2>;
+ clock-names = "ssi", "ssi_sfr", "audio_clk1", "audio_clk2";
+ resets = <&cpg R9A08G045_SSI0_RST_M2_REG>;
+ dmas = <&dmac 0x2665>, <&dmac 0x2666>;
+ dma-names = "tx", "rx";
+ power-domains = <&cpg>;
+ #sound-dai-cells = <0>;
+ status = "disabled";
+ };
+
+ ssi1: ssi@100a8400 {
+ compatible = "renesas,r9a08g045-ssi",
+ "renesas,rz-ssi";
+ reg = <0 0x100a8400 0 0x400>;
+ interrupts = <GIC_SPI 243 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 244 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 245 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "int_req", "dma_rx", "dma_tx";
+ clocks = <&cpg CPG_MOD R9A08G045_SSI1_PCLK2>,
+ <&cpg CPG_MOD R9A08G045_SSI1_PCLK_SFR>,
+ <&audio_clk1>, <&audio_clk2>;
+ clock-names = "ssi", "ssi_sfr", "audio_clk1", "audio_clk2";
+ resets = <&cpg R9A08G045_SSI1_RST_M2_REG>;
+ dmas = <&dmac 0x2669>, <&dmac 0x266a>;
+ dma-names = "tx", "rx";
+ power-domains = <&cpg>;
+ #sound-dai-cells = <0>;
+ status = "disabled";
+ };
+
+ ssi2: ssi@100a8800 {
+ compatible = "renesas,r9a08g045-ssi",
+ "renesas,rz-ssi";
+ reg = <0 0x100a8800 0 0x400>;
+ interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 247 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 248 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "int_req", "dma_rx", "dma_tx";
+ clocks = <&cpg CPG_MOD R9A08G045_SSI2_PCLK2>,
+ <&cpg CPG_MOD R9A08G045_SSI2_PCLK_SFR>,
+ <&audio_clk1>, <&audio_clk2>;
+ clock-names = "ssi", "ssi_sfr", "audio_clk1", "audio_clk2";
+ resets = <&cpg R9A08G045_SSI2_RST_M2_REG>;
+ dmas = <&dmac 0x266d>, <&dmac 0x266e>;
+ dma-names = "tx", "rx";
+ power-domains = <&cpg>;
+ #sound-dai-cells = <0>;
+ status = "disabled";
+ };
+
+ ssi3: ssi@100a8c00 {
+ compatible = "renesas,r9a08g045-ssi",
+ "renesas,rz-ssi";
+ reg = <0 0x100a8c00 0 0x400>;
+ interrupts = <GIC_SPI 249 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 250 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 251 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "int_req", "dma_rx", "dma_tx";
+ clocks = <&cpg CPG_MOD R9A08G045_SSI3_PCLK2>,
+ <&cpg CPG_MOD R9A08G045_SSI3_PCLK_SFR>,
+ <&audio_clk1>, <&audio_clk2>;
+ clock-names = "ssi", "ssi_sfr", "audio_clk1", "audio_clk2";
+ resets = <&cpg R9A08G045_SSI3_RST_M2_REG>;
+ dmas = <&dmac 0x2671>, <&dmac 0x2672>;
+ dma-names = "tx", "rx";
+ power-domains = <&cpg>;
+ #sound-dai-cells = <0>;
+ status = "disabled";
+ };
+
cpg: clock-controller@11010000 {
compatible = "renesas,r9a08g045-cpg";
reg = <0 0x11010000 0 0x10000>;
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 22/25] arm64: dts: renesas: rzg3s-smarc-som: Add versa3 clock generator node
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (20 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 21/25] arm64: dts: renesas: r9a08g045: Add SSI nodes Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 23/25] arm64: dts: renesas: Add da7212 audio codec node Claudiu
` (2 subsequent siblings)
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Add versa3 clock generator node. It provides the clocks for the Ethernet
PHY, PCIe, audio devices.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
.../boot/dts/renesas/rzg3s-smarc-som.dtsi | 30 +++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi
index 2ed01d391554..6e58d47d85b0 100644
--- a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi
@@ -92,6 +92,12 @@ vcc_sdhi2: regulator2 {
gpios = <&pinctrl RZG2L_GPIO(8, 1) GPIO_ACTIVE_HIGH>;
enable-active-high;
};
+
+ x3_clk: x3-clock {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <24000000>;
+ };
};
#if SW_CONFIG3 == SW_ON
@@ -152,6 +158,30 @@ &extal_clk {
&i2c1 {
status = "okay";
+
+ versa3: clock-generator@68 {
+ compatible = "renesas,5l35023";
+ reg = <0x68>;
+ clocks = <&x3_clk>;
+ #clock-cells = <1>;
+ assigned-clocks = <&versa3 0>,
+ <&versa3 1>,
+ <&versa3 2>,
+ <&versa3 3>,
+ <&versa3 4>,
+ <&versa3 5>;
+ assigned-clock-rates = <24000000>,
+ <12288000>,
+ <11289600>,
+ <25000000>,
+ <100000000>,
+ <100000000>;
+ renesas,settings = [
+ 80 00 11 19 4c 42 dc 2f 06 7d 20 1a 5f 1e f2 27
+ 00 40 00 00 00 00 00 00 06 0c 19 02 3f f0 90 86
+ a0 80 30 30 9c
+ ];
+ };
};
#if SW_CONFIG2 == SW_ON
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 23/25] arm64: dts: renesas: Add da7212 audio codec node
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (21 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 22/25] arm64: dts: renesas: rzg3s-smarc-som: Add versa3 clock generator node Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-08 10:49 ` [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3 Claudiu
2024-11-08 10:49 ` [PATCH v2 25/25] arm64: dts: renesas: rzg3s-smarc: Add sound card Claudiu
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Add the da7212 audio codec node. Along with it regulators nodes were
reworked to be able to re-use them on da7212.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
.../boot/dts/renesas/rzg3s-smarc-som.dtsi | 17 ++++++++++----
arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 23 +++++++++++++++++++
2 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi
index 6e58d47d85b0..5ee9dac4aebb 100644
--- a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi
@@ -63,7 +63,6 @@ vcc_sdhi0: regulator0 {
enable-active-high;
};
-#if SW_CONFIG2 == SW_ON
vccq_sdhi0: regulator1 {
compatible = "regulator-gpio";
regulator-name = "SDHI0 VccQ";
@@ -73,8 +72,8 @@ vccq_sdhi0: regulator1 {
gpios-states = <1>;
states = <3300000 1>, <1800000 0>;
};
-#else
- reg_1p8v: regulator1 {
+
+ reg_1p8v: regulator2 {
compatible = "regulator-fixed";
regulator-name = "fixed-1.8V";
regulator-min-microvolt = <1800000>;
@@ -82,9 +81,17 @@ reg_1p8v: regulator1 {
regulator-boot-on;
regulator-always-on;
};
-#endif
- vcc_sdhi2: regulator2 {
+ reg_3p3v: regulator3 {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-3.3V";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ vcc_sdhi2: regulator4 {
compatible = "regulator-fixed";
regulator-name = "SDHI2 Vcc";
regulator-min-microvolt = <3300000>;
diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
index 4509151344c4..4aa99814b808 100644
--- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
@@ -68,6 +68,29 @@ &i2c0 {
status = "okay";
clock-frequency = <1000000>;
+
+ da7212: codec@1a {
+ compatible = "dlg,da7212";
+ reg = <0x1a>;
+
+ #sound-dai-cells = <0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ clocks = <&versa3 1>;
+ clock-names = "mclk";
+
+ dlg,micbias1-lvl = <2500>;
+ dlg,micbias2-lvl = <2500>;
+ dlg,dmic-data-sel = "lrise_rfall";
+ dlg,dmic-samplephase = "between_clkedge";
+ dlg,dmic-clkrate = <3000000>;
+
+ VDDA-supply = <®_1p8v>;
+ VDDSP-supply = <®_3p3v>;
+ VDDMIC-supply = <®_3p3v>;
+ VDDIO-supply = <®_1p8v>;
+ };
};
&pinctrl {
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (22 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 23/25] arm64: dts: renesas: Add da7212 audio codec node Claudiu
@ 2024-11-08 10:49 ` Claudiu
2024-11-10 8:54 ` Biju Das
2024-11-08 10:49 ` [PATCH v2 25/25] arm64: dts: renesas: rzg3s-smarc: Add sound card Claudiu
24 siblings, 1 reply; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Enable SSI3.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 26 ++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
index 4aa99814b808..6dd439e68bd4 100644
--- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
@@ -64,6 +64,11 @@ vccq_sdhi1: regulator-vccq-sdhi1 {
};
};
+&audio_clk2 {
+ clock-frequency = <12288000>;
+ status = "okay";
+};
+
&i2c0 {
status = "okay";
@@ -94,6 +99,11 @@ da7212: codec@1a {
};
&pinctrl {
+ audio_clock_pins: audio-clock {
+ pins = "AUDIO_CLK1", "AUDIO_CLK2";
+ input-enable;
+ };
+
key-1-gpio-hog {
gpio-hog;
gpios = <RZG2L_GPIO(18, 0) GPIO_ACTIVE_LOW>;
@@ -151,6 +161,13 @@ cd {
pinmux = <RZG2L_PORT_PINMUX(0, 2, 1)>; /* SD1_CD */
};
};
+
+ ssi3_pins: ssi3 {
+ pinmux = <RZG2L_PORT_PINMUX(18, 2, 8)>, /* BCK */
+ <RZG2L_PORT_PINMUX(18, 3, 8)>, /* RCK */
+ <RZG2L_PORT_PINMUX(18, 4, 8)>, /* TXD */
+ <RZG2L_PORT_PINMUX(18, 5, 8)>; /* RXD */
+ };
};
&scif0 {
@@ -171,3 +188,12 @@ &sdhi1 {
max-frequency = <125000000>;
status = "okay";
};
+
+&ssi3 {
+ clocks = <&cpg CPG_MOD R9A08G045_SSI3_PCLK2>,
+ <&cpg CPG_MOD R9A08G045_SSI3_PCLK_SFR>,
+ <&versa3 2>, <&audio_clk2>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&ssi3_pins>, <&audio_clock_pins>;
+ status = "okay";
+};
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2 25/25] arm64: dts: renesas: rzg3s-smarc: Add sound card
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
` (23 preceding siblings ...)
2024-11-08 10:49 ` [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3 Claudiu
@ 2024-11-08 10:49 ` Claudiu
24 siblings, 0 replies; 42+ messages in thread
From: Claudiu @ 2024-11-08 10:49 UTC (permalink / raw)
To: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, claudiu.beznea, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Add sound card with SSI3 as CPU DAI and DA7212 as codec DAI.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
Changes in v2:
- none
arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
index 6dd439e68bd4..89673bbaee6d 100644
--- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
@@ -44,6 +44,23 @@ key-3 {
};
};
+ snd_rzg3s: sound {
+ compatible = "simple-audio-card";
+ simple-audio-card,format = "i2s";
+ simple-audio-card,bitclock-master = <&cpu_dai>;
+ simple-audio-card,frame-master = <&cpu_dai>;
+ simple-audio-card,mclk-fs = <256>;
+
+ cpu_dai: simple-audio-card,cpu {
+ sound-dai = <&ssi3>;
+ };
+
+ codec_dai: simple-audio-card,codec {
+ sound-dai = <&da7212>;
+ clocks = <&versa3 1>;
+ };
+ };
+
vcc_sdhi1: regulator-vcc-sdhi1 {
compatible = "regulator-fixed";
regulator-name = "SDHI1 Vcc";
--
2.39.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* RE: [PATCH v2 03/25] dt-bindings: clock: versaclock3: Document 5L35023 Versa3 clock generator
2024-11-08 10:49 ` [PATCH v2 03/25] dt-bindings: clock: versaclock3: Document 5L35023 Versa3 clock generator Claudiu
@ 2024-11-10 8:31 ` Biju Das
0 siblings, 0 replies; 42+ messages in thread
From: Biju Das @ 2024-11-10 8:31 UTC (permalink / raw)
To: Claudiu.Beznea, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu.Beznea, Claudiu Beznea, Krzysztof Kozlowski
Hi Claudiu,
Thanks for the patch.
> -----Original Message-----
> From: Claudiu <claudiu.beznea@tuxon.dev>
> Sent: 08 November 2024 10:50
> Subject: [PATCH v2 03/25] dt-bindings: clock: versaclock3: Document 5L35023 Versa3 clock generator
>
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> There are some differences b/w 5L35023 and 5P35023 Versa3 clock generator variants but the same driver
> could be used with minimal adjustments. The identified differences are PLL2 Fvco, the clock sel bit
> for SE2 clock and different default values for some registers.
>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Cheers,
Biju
> ---
>
> Changes in v2:
> - collected tags
>
> Documentation/devicetree/bindings/clock/renesas,5p35023.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/clock/renesas,5p35023.yaml
> b/Documentation/devicetree/bindings/clock/renesas,5p35023.yaml
> index 42b6f80613f3..162d38035188 100644
> --- a/Documentation/devicetree/bindings/clock/renesas,5p35023.yaml
> +++ b/Documentation/devicetree/bindings/clock/renesas,5p35023.yaml
> @@ -31,6 +31,7 @@ description: |
> properties:
> compatible:
> enum:
> + - renesas,5l35023
> - renesas,5p35023
>
> reg:
> --
> 2.39.2
^ permalink raw reply [flat|nested] 42+ messages in thread
* RE: [PATCH v2 01/25] clk: renesas: r9a08g045-cpg: Add clocks, resets and power domains support for SSI
2024-11-08 10:49 ` [PATCH v2 01/25] clk: renesas: r9a08g045-cpg: Add clocks, resets and power domains support for SSI Claudiu
@ 2024-11-10 8:31 ` Biju Das
0 siblings, 0 replies; 42+ messages in thread
From: Biju Das @ 2024-11-10 8:31 UTC (permalink / raw)
To: Claudiu.Beznea, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu.Beznea, Claudiu Beznea
Hi Claudiu,
Thanks for the patch,
> -----Original Message-----
> From: Claudiu <claudiu.beznea@tuxon.dev>
> Sent: 08 November 2024 10:50
> Subject: [PATCH v2 01/25] clk: renesas: r9a08g045-cpg: Add clocks, resets and power domains support
> for SSI
>
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Add SSI clocks, resets and power domains support for the SSI blocks available on the Renesas RZ/G3S
> SoC.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Cheers,
Biju
> ---
>
> Changes in v2:
> - none
>
> drivers/clk/renesas/r9a08g045-cpg.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/drivers/clk/renesas/r9a08g045-cpg.c b/drivers/clk/renesas/r9a08g045-cpg.c
> index b2ae8cdc4723..d71e77624fac 100644
> --- a/drivers/clk/renesas/r9a08g045-cpg.c
> +++ b/drivers/clk/renesas/r9a08g045-cpg.c
> @@ -209,6 +209,14 @@ static const struct rzg2l_mod_clk r9a08g045_mod_clks[] = {
> DEF_MOD("sdhi2_imclk2", R9A08G045_SDHI2_IMCLK2, CLK_SD2_DIV4, 0x554, 9),
> DEF_MOD("sdhi2_clk_hs", R9A08G045_SDHI2_CLK_HS, R9A08G045_CLK_SD2, 0x554, 10),
> DEF_MOD("sdhi2_aclk", R9A08G045_SDHI2_ACLK, R9A08G045_CLK_P1, 0x554, 11),
> + DEF_MOD("ssi0_pclk", R9A08G045_SSI0_PCLK2, R9A08G045_CLK_P0, 0x570, 0),
> + DEF_MOD("ssi0_sfr", R9A08G045_SSI0_PCLK_SFR, R9A08G045_CLK_P0, 0x570, 1),
> + DEF_MOD("ssi1_pclk", R9A08G045_SSI1_PCLK2, R9A08G045_CLK_P0, 0x570, 2),
> + DEF_MOD("ssi1_sfr", R9A08G045_SSI1_PCLK_SFR, R9A08G045_CLK_P0, 0x570, 3),
> + DEF_MOD("ssi2_pclk", R9A08G045_SSI2_PCLK2, R9A08G045_CLK_P0, 0x570, 4),
> + DEF_MOD("ssi2_sfr", R9A08G045_SSI2_PCLK_SFR, R9A08G045_CLK_P0, 0x570, 5),
> + DEF_MOD("ssi3_pclk", R9A08G045_SSI3_PCLK2, R9A08G045_CLK_P0, 0x570, 6),
> + DEF_MOD("ssi3_sfr", R9A08G045_SSI3_PCLK_SFR, R9A08G045_CLK_P0, 0x570, 7),
> DEF_MOD("usb0_host", R9A08G045_USB_U2H0_HCLK, R9A08G045_CLK_P1, 0x578, 0),
> DEF_MOD("usb1_host", R9A08G045_USB_U2H1_HCLK, R9A08G045_CLK_P1, 0x578, 1),
> DEF_MOD("usb0_func", R9A08G045_USB_U2P_EXR_CPUCLK, R9A08G045_CLK_P1, 0x578, 2),
> @@ -238,6 +246,10 @@ static const struct rzg2l_reset r9a08g045_resets[] = {
> DEF_RST(R9A08G045_SDHI0_IXRST, 0x854, 0),
> DEF_RST(R9A08G045_SDHI1_IXRST, 0x854, 1),
> DEF_RST(R9A08G045_SDHI2_IXRST, 0x854, 2),
> + DEF_RST(R9A08G045_SSI0_RST_M2_REG, 0x870, 0),
> + DEF_RST(R9A08G045_SSI1_RST_M2_REG, 0x870, 1),
> + DEF_RST(R9A08G045_SSI2_RST_M2_REG, 0x870, 2),
> + DEF_RST(R9A08G045_SSI3_RST_M2_REG, 0x870, 3),
> DEF_RST(R9A08G045_USB_U2H0_HRESETN, 0x878, 0),
> DEF_RST(R9A08G045_USB_U2H1_HRESETN, 0x878, 1),
> DEF_RST(R9A08G045_USB_U2P_EXL_SYSRST, 0x878, 2), @@ -286,6 +298,14 @@ static const struct
> rzg2l_cpg_pm_domain_init_data r9a08g045_pm_domains[] = {
> DEF_REG_CONF(CPG_BUS_PERI_COM_MSTOP, BIT(1)), 0),
> DEF_PD("sdhi2", R9A08G045_PD_SDHI2,
> DEF_REG_CONF(CPG_BUS_PERI_COM_MSTOP, BIT(11)), 0),
> + DEF_PD("ssi0", R9A08G045_PD_SSI0,
> + DEF_REG_CONF(CPG_BUS_MCPU1_MSTOP, BIT(10)), 0),
> + DEF_PD("ssi1", R9A08G045_PD_SSI1,
> + DEF_REG_CONF(CPG_BUS_MCPU1_MSTOP, BIT(11)), 0),
> + DEF_PD("ssi2", R9A08G045_PD_SSI2,
> + DEF_REG_CONF(CPG_BUS_MCPU1_MSTOP, BIT(12)), 0),
> + DEF_PD("ssi3", R9A08G045_PD_SSI3,
> + DEF_REG_CONF(CPG_BUS_MCPU1_MSTOP, BIT(13)), 0),
> DEF_PD("usb0", R9A08G045_PD_USB0,
> DEF_REG_CONF(CPG_BUS_PERI_COM_MSTOP, GENMASK(6, 5)), 0),
> DEF_PD("usb1", R9A08G045_PD_USB1,
> --
> 2.39.2
^ permalink raw reply [flat|nested] 42+ messages in thread
* RE: [PATCH v2 02/25] clk: versaclock3: Prepare for the addition of 5L35023 device
2024-11-08 10:49 ` [PATCH v2 02/25] clk: versaclock3: Prepare for the addition of 5L35023 device Claudiu
@ 2024-11-10 8:32 ` Biju Das
0 siblings, 0 replies; 42+ messages in thread
From: Biju Das @ 2024-11-10 8:32 UTC (permalink / raw)
To: Claudiu.Beznea, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu.Beznea, Claudiu Beznea
Hi Claudiu,
Thanks for the patch.
> -----Original Message-----
> From: Claudiu <claudiu.beznea@tuxon.dev>
> Sent: 08 November 2024 10:50
> Subject: [PATCH v2 02/25] clk: versaclock3: Prepare for the addition of 5L35023 device
>
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> The 5P35023 and 5L35035 Versa 3 clock generator variants are different but the versaclock3 driver
> could be used with small adjustments. The features that are implemented in driver and differs b/w
> variants are the PLL2 Fvco and clock sel bit for SE2 clock. Adjust the driver to prepare for the
> addition of 5L35023 device.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Cheers,
Biju
> ---
>
> Changes in v2:
> - none
>
> drivers/clk/clk-versaclock3.c | 61 ++++++++++++++++++++++++-----------
> 1 file changed, 43 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/clk/clk-versaclock3.c b/drivers/clk/clk-versaclock3.c index
> 76d7ea1964c3..1398d16df5d0 100644
> --- a/drivers/clk/clk-versaclock3.c
> +++ b/drivers/clk/clk-versaclock3.c
> @@ -78,9 +78,6 @@
> #define VC3_PLL1_VCO_MIN 300000000UL
> #define VC3_PLL1_VCO_MAX 600000000UL
>
> -#define VC3_PLL2_VCO_MIN 400000000UL
> -#define VC3_PLL2_VCO_MAX 1200000000UL
> -
> #define VC3_PLL3_VCO_MIN 300000000UL
> #define VC3_PLL3_VCO_MAX 800000000UL
>
> @@ -147,9 +144,13 @@ struct vc3_pfd_data {
> u8 mdiv2_bitmsk;
> };
>
> +struct vc3_vco {
> + unsigned long min;
> + unsigned long max;
> +};
> +
> struct vc3_pll_data {
> - unsigned long vco_min;
> - unsigned long vco_max;
> + struct vc3_vco vco;
> u8 num;
> u8 int_div_msb_offs;
> u8 int_div_lsb_offs;
> @@ -166,12 +167,17 @@ struct vc3_div_data { struct vc3_hw_data {
> struct clk_hw hw;
> struct regmap *regmap;
> - const void *data;
> + void *data;
>
> u32 div_int;
> u32 div_frc;
> };
>
> +struct vc3_hw_cfg {
> + struct vc3_vco pll2_vco;
> + u32 se2_clk_sel_msk;
> +};
> +
> static const struct clk_div_table div1_divs[] = {
> { .val = 0, .div = 1, }, { .val = 1, .div = 4, },
> { .val = 2, .div = 5, }, { .val = 3, .div = 6, }, @@ -386,10 +392,10 @@ static long
> vc3_pll_round_rate(struct clk_hw *hw, unsigned long rate,
> const struct vc3_pll_data *pll = vc3->data;
> u64 div_frc;
>
> - if (rate < pll->vco_min)
> - rate = pll->vco_min;
> - if (rate > pll->vco_max)
> - rate = pll->vco_max;
> + if (rate < pll->vco.min)
> + rate = pll->vco.min;
> + if (rate > pll->vco.max)
> + rate = pll->vco.max;
>
> vc3->div_int = rate / *parent_rate;
>
> @@ -680,8 +686,10 @@ static struct vc3_hw_data clk_pll[] = {
> .num = VC3_PLL1,
> .int_div_msb_offs = VC3_PLL1_LOOP_FILTER_N_DIV_MSB,
> .int_div_lsb_offs = VC3_PLL1_VCO_N_DIVIDER,
> - .vco_min = VC3_PLL1_VCO_MIN,
> - .vco_max = VC3_PLL1_VCO_MAX
> + .vco = {
> + .min = VC3_PLL1_VCO_MIN,
> + .max = VC3_PLL1_VCO_MAX
> + }
> },
> .hw.init = &(struct clk_init_data) {
> .name = "pll1",
> @@ -698,8 +706,6 @@ static struct vc3_hw_data clk_pll[] = {
> .num = VC3_PLL2,
> .int_div_msb_offs = VC3_PLL2_FB_INT_DIV_MSB,
> .int_div_lsb_offs = VC3_PLL2_FB_INT_DIV_LSB,
> - .vco_min = VC3_PLL2_VCO_MIN,
> - .vco_max = VC3_PLL2_VCO_MAX
> },
> .hw.init = &(struct clk_init_data) {
> .name = "pll2",
> @@ -716,8 +722,10 @@ static struct vc3_hw_data clk_pll[] = {
> .num = VC3_PLL3,
> .int_div_msb_offs = VC3_PLL3_LOOP_FILTER_N_DIV_MSB,
> .int_div_lsb_offs = VC3_PLL3_N_DIVIDER,
> - .vco_min = VC3_PLL3_VCO_MIN,
> - .vco_max = VC3_PLL3_VCO_MAX
> + .vco = {
> + .min = VC3_PLL3_VCO_MIN,
> + .max = VC3_PLL3_VCO_MAX
> + }
> },
> .hw.init = &(struct clk_init_data) {
> .name = "pll3",
> @@ -901,7 +909,6 @@ static struct vc3_hw_data clk_mux[] = {
> [VC3_SE2_MUX] = {
> .data = &(struct vc3_clk_data) {
> .offs = VC3_SE2_CTRL_REG0,
> - .bitmsk = VC3_SE2_CTRL_REG0_SE2_CLK_SEL
> },
> .hw.init = &(struct clk_init_data) {
> .name = "se2_mux",
> @@ -982,6 +989,7 @@ static int vc3_probe(struct i2c_client *client) {
> struct device *dev = &client->dev;
> u8 settings[NUM_CONFIG_REGISTERS];
> + const struct vc3_hw_cfg *data;
> struct regmap *regmap;
> const char *name;
> int ret, i;
> @@ -1029,9 +1037,16 @@ static int vc3_probe(struct i2c_client *client)
> clk_pfd[i].hw.init->name);
> }
>
> + data = i2c_get_match_data(client);
> +
> /* Register pll's */
> for (i = 0; i < ARRAY_SIZE(clk_pll); i++) {
> clk_pll[i].regmap = regmap;
> + if (i == VC3_PLL2) {
> + struct vc3_pll_data *pll_data = clk_pll[i].data;
> +
> + pll_data->vco = data->pll2_vco;
> + }
> ret = devm_clk_hw_register(dev, &clk_pll[i].hw);
> if (ret)
> return dev_err_probe(dev, ret, "%s failed\n", @@ -1059,6 +1074,11 @@ static int
> vc3_probe(struct i2c_client *client)
> /* Register clk muxes */
> for (i = 0; i < ARRAY_SIZE(clk_mux); i++) {
> clk_mux[i].regmap = regmap;
> + if (i == VC3_SE2_MUX) {
> + struct vc3_clk_data *clk_data = clk_mux[i].data;
> +
> + clk_data->bitmsk = data->se2_clk_sel_msk;
> + }
> ret = devm_clk_hw_register(dev, &clk_mux[i].hw);
> if (ret)
> return dev_err_probe(dev, ret, "%s failed\n", @@ -1108,8 +1128,13 @@ static int
> vc3_probe(struct i2c_client *client)
> return ret;
> }
>
> +static const struct vc3_hw_cfg vc3_5p = {
> + .pll2_vco = { .min = 400000000UL, .max = 1200000000UL },
> + .se2_clk_sel_msk = BIT(6),
> +};
> +
> static const struct of_device_id dev_ids[] = {
> - { .compatible = "renesas,5p35023" },
> + { .compatible = "renesas,5p35023", .data = &vc3_5p },
> { /* Sentinel */ }
> };
> MODULE_DEVICE_TABLE(of, dev_ids);
> --
> 2.39.2
^ permalink raw reply [flat|nested] 42+ messages in thread
* RE: [PATCH v2 04/25] clk: versaclock3: Add support for the 5L35023 variant
2024-11-08 10:49 ` [PATCH v2 04/25] clk: versaclock3: Add support for the 5L35023 variant Claudiu
@ 2024-11-10 8:33 ` Biju Das
0 siblings, 0 replies; 42+ messages in thread
From: Biju Das @ 2024-11-10 8:33 UTC (permalink / raw)
To: Claudiu.Beznea, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu.Beznea, Claudiu Beznea
Hi Claudiu,
Thanks for the patch.
> -----Original Message-----
> From: Claudiu <claudiu.beznea@tuxon.dev>
> Sent: 08 November 2024 10:50
> Subject: [PATCH v2 04/25] clk: versaclock3: Add support for the 5L35023 variant
>
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Add support for the 5L35023 variant of the Versa 3 clock generator.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Cheers,
Biju
> ---
>
> Changes in v2:
> - none
>
> drivers/clk/clk-versaclock3.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/clk/clk-versaclock3.c b/drivers/clk/clk-versaclock3.c index
> 1398d16df5d0..9fe27dace111 100644
> --- a/drivers/clk/clk-versaclock3.c
> +++ b/drivers/clk/clk-versaclock3.c
> @@ -1133,8 +1133,14 @@ static const struct vc3_hw_cfg vc3_5p = {
> .se2_clk_sel_msk = BIT(6),
> };
>
> +static const struct vc3_hw_cfg vc3_5l = {
> + .pll2_vco = { .min = 30000000UL, .max = 130000000UL },
> + .se2_clk_sel_msk = BIT(0),
> +};
> +
> static const struct of_device_id dev_ids[] = {
> { .compatible = "renesas,5p35023", .data = &vc3_5p },
> + { .compatible = "renesas,5l35023", .data = &vc3_5l },
> { /* Sentinel */ }
> };
> MODULE_DEVICE_TABLE(of, dev_ids);
> --
> 2.39.2
^ permalink raw reply [flat|nested] 42+ messages in thread
* RE: [PATCH v2 05/25] pinctrl: renesas: rzg2l: Add audio clock pins
2024-11-08 10:49 ` [PATCH v2 05/25] pinctrl: renesas: rzg2l: Add audio clock pins Claudiu
@ 2024-11-10 8:33 ` Biju Das
0 siblings, 0 replies; 42+ messages in thread
From: Biju Das @ 2024-11-10 8:33 UTC (permalink / raw)
To: Claudiu.Beznea, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu.Beznea, Claudiu Beznea
Hi Claudiu,
Thanks for the patch.
> -----Original Message-----
> From: Claudiu <claudiu.beznea@tuxon.dev>
> Sent: 08 November 2024 10:50
> Subject: [PATCH v2 05/25] pinctrl: renesas: rzg2l: Add audio clock pins
>
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Add audio clock pins. These are used by audio IPs as input pins to feed them with audio clocks.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Cheers,
Biju
> ---
>
> Changes in v2:
> - none
>
> drivers/pinctrl/renesas/pinctrl-rzg2l.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
> index 8ffb9430a134..1190ca4b1808 100644
> --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
> +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
> @@ -2086,6 +2086,8 @@ static const struct rzg2l_dedicated_configs rzg3s_dedicated_pins[] = {
> PIN_CFG_SOFT_PS)) },
> { "TDO", RZG2L_SINGLE_PIN_PACK(0x1, 1, (PIN_CFG_IOLH_A | PIN_CFG_SOFT_PS)) },
> { "WDTOVF_PERROUT#", RZG2L_SINGLE_PIN_PACK(0x6, 0, PIN_CFG_IOLH_A | PIN_CFG_SOFT_PS) },
> + { "AUDIO_CLK1", RZG2L_SINGLE_PIN_PACK(0x2, 0, PIN_CFG_IEN) },
> + { "AUDIO_CLK2", RZG2L_SINGLE_PIN_PACK(0x2, 1, PIN_CFG_IEN) },
> { "SD0_CLK", RZG2L_SINGLE_PIN_PACK(0x10, 0, (PIN_CFG_IOLH_B | PIN_CFG_IO_VMC_SD0)) },
> { "SD0_CMD", RZG2L_SINGLE_PIN_PACK(0x10, 1, (PIN_CFG_IOLH_B | PIN_CFG_IEN |
> PIN_CFG_IO_VMC_SD0)) },
> --
> 2.39.2
^ permalink raw reply [flat|nested] 42+ messages in thread
* RE: [PATCH v2 06/25] ASoC: sh: rz-ssi: Terminate all the DMA transactions
2024-11-08 10:49 ` [PATCH v2 06/25] ASoC: sh: rz-ssi: Terminate all the DMA transactions Claudiu
@ 2024-11-10 8:37 ` Biju Das
2024-11-11 11:15 ` Claudiu Beznea
2024-11-11 0:45 ` Kuninori Morimoto
1 sibling, 1 reply; 42+ messages in thread
From: Biju Das @ 2024-11-10 8:37 UTC (permalink / raw)
To: Claudiu.Beznea, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu.Beznea, Claudiu Beznea, stable@vger.kernel.org
> -----Original Message-----
> From: Claudiu <claudiu.beznea@tuxon.dev>
> Sent: 08 November 2024 10:50
> To: geert+renesas@glider.be; mturquette@baylibre.com; sboyd@kernel.org; robh@kernel.org;
> krzk+dt@kernel.org; conor+dt@kernel.org; Biju Das <biju.das.jz@bp.renesas.com>; Prabhakar Mahadev Lad
> <prabhakar.mahadev-lad.rj@bp.renesas.com>; lgirdwood@gmail.com; broonie@kernel.org;
> magnus.damm@gmail.com; linus.walleij@linaro.org; perex@perex.cz; tiwai@suse.com;
> p.zabel@pengutronix.de
> Cc: linux-renesas-soc@vger.kernel.org; linux-clk@vger.kernel.org; devicetree@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-sound@vger.kernel.org; linux-gpio@vger.kernel.org; Claudiu.Beznea
> <claudiu.beznea@tuxon.dev>; Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>; stable@vger.kernel.org
> Subject: [PATCH v2 06/25] ASoC: sh: rz-ssi: Terminate all the DMA transactions
>
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> In case of full duplex the 1st closed stream doesn't benefit from the dmaengine_terminate_async().
> Call it after the companion stream is closed.
>
> Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support")
Maybe add fixes tag for full duplex case as the separation of
Playback/ Capture is introduced in that patch.
> Cc: stable@vger.kernel.org
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Cheers,
Biju
> ---
>
> Changes in v2:
> - none
>
> sound/soc/renesas/rz-ssi.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c index 6efd017aaa7f..2d8721156099
> 100644
> --- a/sound/soc/renesas/rz-ssi.c
> +++ b/sound/soc/renesas/rz-ssi.c
> @@ -415,8 +415,12 @@ static int rz_ssi_stop(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
> rz_ssi_reg_mask_setl(ssi, SSICR, SSICR_TEN | SSICR_REN, 0);
>
> /* Cancel all remaining DMA transactions */
> - if (rz_ssi_is_dma_enabled(ssi))
> - dmaengine_terminate_async(strm->dma_ch);
> + if (rz_ssi_is_dma_enabled(ssi)) {
> + if (ssi->playback.dma_ch)
> + dmaengine_terminate_async(ssi->playback.dma_ch);
> + if (ssi->capture.dma_ch)
> + dmaengine_terminate_async(ssi->capture.dma_ch);
> + }
>
> rz_ssi_set_idle(ssi);
>
> --
> 2.39.2
^ permalink raw reply [flat|nested] 42+ messages in thread
* RE: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
2024-11-08 10:49 ` [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3 Claudiu
@ 2024-11-10 8:54 ` Biju Das
2024-11-11 11:19 ` Claudiu Beznea
0 siblings, 1 reply; 42+ messages in thread
From: Biju Das @ 2024-11-10 8:54 UTC (permalink / raw)
To: Claudiu.Beznea, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu.Beznea, Claudiu Beznea
Hi Claudiu,
Thanks for the patch.
> -----Original Message-----
> From: Claudiu <claudiu.beznea@tuxon.dev>
> Sent: 08 November 2024 10:50
> Subject: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
>
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Enable SSI3.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---
>
> Changes in v2:
> - none
>
> arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 26 ++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-
> smarc.dtsi
> index 4aa99814b808..6dd439e68bd4 100644
> --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
> +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
> @@ -64,6 +64,11 @@ vccq_sdhi1: regulator-vccq-sdhi1 {
> };
> };
>
&audio_clk1 {
assigned-clocks = <&versa3 xx>;
clock-frequency = <11289600>;
};
Maybe add audio_clk1, so that it described properly in clock tree??
Cheers,
Biju
> +&audio_clk2 {
> + clock-frequency = <12288000>;
> + status = "okay";
> +};
> +
> &i2c0 {
> status = "okay";
>
> @@ -94,6 +99,11 @@ da7212: codec@1a {
> };
>
> &pinctrl {
> + audio_clock_pins: audio-clock {
> + pins = "AUDIO_CLK1", "AUDIO_CLK2";
> + input-enable;
> + };
> +
> key-1-gpio-hog {
> gpio-hog;
> gpios = <RZG2L_GPIO(18, 0) GPIO_ACTIVE_LOW>; @@ -151,6 +161,13 @@ cd {
> pinmux = <RZG2L_PORT_PINMUX(0, 2, 1)>; /* SD1_CD */
> };
> };
> +
> + ssi3_pins: ssi3 {
> + pinmux = <RZG2L_PORT_PINMUX(18, 2, 8)>, /* BCK */
> + <RZG2L_PORT_PINMUX(18, 3, 8)>, /* RCK */
> + <RZG2L_PORT_PINMUX(18, 4, 8)>, /* TXD */
> + <RZG2L_PORT_PINMUX(18, 5, 8)>; /* RXD */
> + };
> };
>
> &scif0 {
> @@ -171,3 +188,12 @@ &sdhi1 {
> max-frequency = <125000000>;
> status = "okay";
> };
> +
> +&ssi3 {
> + clocks = <&cpg CPG_MOD R9A08G045_SSI3_PCLK2>,
> + <&cpg CPG_MOD R9A08G045_SSI3_PCLK_SFR>,
> + <&versa3 2>, <&audio_clk2>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&ssi3_pins>, <&audio_clock_pins>;
> + status = "okay";
> +};
> --
> 2.39.2
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v2 06/25] ASoC: sh: rz-ssi: Terminate all the DMA transactions
2024-11-08 10:49 ` [PATCH v2 06/25] ASoC: sh: rz-ssi: Terminate all the DMA transactions Claudiu
2024-11-10 8:37 ` Biju Das
@ 2024-11-11 0:45 ` Kuninori Morimoto
2024-11-11 11:16 ` Claudiu Beznea
1 sibling, 1 reply; 42+ messages in thread
From: Kuninori Morimoto @ 2024-11-11 0:45 UTC (permalink / raw)
To: Claudiu
Cc: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel,
linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, Claudiu Beznea, stable
Hi Claudiu
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> In case of full duplex the 1st closed stream doesn't benefit from the
> dmaengine_terminate_async(). Call it after the companion stream is
> closed.
>
> Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
(snip)
> sound/soc/renesas/rz-ssi.c | 8 ++++++--
We are now using "renesas" dir, so, you want to use "ASoC: renesas:"
instead of "ASoC: sh:" in Subject ?
Thank you for your help !!
Best regards
---
Kuninori Morimoto
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v2 06/25] ASoC: sh: rz-ssi: Terminate all the DMA transactions
2024-11-10 8:37 ` Biju Das
@ 2024-11-11 11:15 ` Claudiu Beznea
0 siblings, 0 replies; 42+ messages in thread
From: Claudiu Beznea @ 2024-11-11 11:15 UTC (permalink / raw)
To: Biju Das, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu Beznea, stable@vger.kernel.org
Hi, Biju,
On 10.11.2024 10:37, Biju Das wrote:
>
>
>> -----Original Message-----
>> From: Claudiu <claudiu.beznea@tuxon.dev>
>> Sent: 08 November 2024 10:50
>> To: geert+renesas@glider.be; mturquette@baylibre.com; sboyd@kernel.org; robh@kernel.org;
>> krzk+dt@kernel.org; conor+dt@kernel.org; Biju Das <biju.das.jz@bp.renesas.com>; Prabhakar Mahadev Lad
>> <prabhakar.mahadev-lad.rj@bp.renesas.com>; lgirdwood@gmail.com; broonie@kernel.org;
>> magnus.damm@gmail.com; linus.walleij@linaro.org; perex@perex.cz; tiwai@suse.com;
>> p.zabel@pengutronix.de
>> Cc: linux-renesas-soc@vger.kernel.org; linux-clk@vger.kernel.org; devicetree@vger.kernel.org; linux-
>> kernel@vger.kernel.org; linux-sound@vger.kernel.org; linux-gpio@vger.kernel.org; Claudiu.Beznea
>> <claudiu.beznea@tuxon.dev>; Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>; stable@vger.kernel.org
>> Subject: [PATCH v2 06/25] ASoC: sh: rz-ssi: Terminate all the DMA transactions
>>
>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>
>> In case of full duplex the 1st closed stream doesn't benefit from the dmaengine_terminate_async().
>> Call it after the companion stream is closed.
>>
>> Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support")
>
> Maybe add fixes tag for full duplex case as the separation of
> Playback/ Capture is introduced in that patch.
OK
>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
>
> Cheers,
> Biju
>
>> ---
>>
>> Changes in v2:
>> - none
>>
>> sound/soc/renesas/rz-ssi.c | 8 ++++++--
>> 1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c index 6efd017aaa7f..2d8721156099
>> 100644
>> --- a/sound/soc/renesas/rz-ssi.c
>> +++ b/sound/soc/renesas/rz-ssi.c
>> @@ -415,8 +415,12 @@ static int rz_ssi_stop(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
>> rz_ssi_reg_mask_setl(ssi, SSICR, SSICR_TEN | SSICR_REN, 0);
>>
>> /* Cancel all remaining DMA transactions */
>> - if (rz_ssi_is_dma_enabled(ssi))
>> - dmaengine_terminate_async(strm->dma_ch);
>> + if (rz_ssi_is_dma_enabled(ssi)) {
>> + if (ssi->playback.dma_ch)
>> + dmaengine_terminate_async(ssi->playback.dma_ch);
>> + if (ssi->capture.dma_ch)
>> + dmaengine_terminate_async(ssi->capture.dma_ch);
>> + }
>>
>> rz_ssi_set_idle(ssi);
>>
>> --
>> 2.39.2
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v2 06/25] ASoC: sh: rz-ssi: Terminate all the DMA transactions
2024-11-11 0:45 ` Kuninori Morimoto
@ 2024-11-11 11:16 ` Claudiu Beznea
0 siblings, 0 replies; 42+ messages in thread
From: Claudiu Beznea @ 2024-11-11 11:16 UTC (permalink / raw)
To: Kuninori Morimoto
Cc: geert+renesas, mturquette, sboyd, robh, krzk+dt, conor+dt,
biju.das.jz, prabhakar.mahadev-lad.rj, lgirdwood, broonie,
magnus.damm, linus.walleij, perex, tiwai, p.zabel,
linux-renesas-soc, linux-clk, devicetree, linux-kernel,
linux-sound, linux-gpio, Claudiu Beznea, stable
Hi, Kuninori,
On 11.11.2024 02:45, Kuninori Morimoto wrote:
>
> Hi Claudiu
>
>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>
>> In case of full duplex the 1st closed stream doesn't benefit from the
>> dmaengine_terminate_async(). Call it after the companion stream is
>> closed.
>>
>> Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> (snip)
>> sound/soc/renesas/rz-ssi.c | 8 ++++++--
>
> We are now using "renesas" dir, so, you want to use "ASoC: renesas:"
> instead of "ASoC: sh:" in Subject ?
You're right! I'll update it.
Thank you,
Claudiu Beznea
>
>
> Thank you for your help !!
>
> Best regards
> ---
> Kuninori Morimoto
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
2024-11-10 8:54 ` Biju Das
@ 2024-11-11 11:19 ` Claudiu Beznea
2024-11-11 11:30 ` Biju Das
0 siblings, 1 reply; 42+ messages in thread
From: Claudiu Beznea @ 2024-11-11 11:19 UTC (permalink / raw)
To: Biju Das, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu Beznea
Hi, Biju,
On 10.11.2024 10:54, Biju Das wrote:
> Hi Claudiu,
>
> Thanks for the patch.
>
>
>> -----Original Message-----
>> From: Claudiu <claudiu.beznea@tuxon.dev>
>> Sent: 08 November 2024 10:50
>> Subject: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
>>
>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>
>> Enable SSI3.
>>
>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>> ---
>>
>> Changes in v2:
>> - none
>>
>> arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 26 ++++++++++++++++++++
>> 1 file changed, 26 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-
>> smarc.dtsi
>> index 4aa99814b808..6dd439e68bd4 100644
>> --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
>> +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
>> @@ -64,6 +64,11 @@ vccq_sdhi1: regulator-vccq-sdhi1 {
>> };
>> };
>>
>
> &audio_clk1 {
> assigned-clocks = <&versa3 xx>;
> clock-frequency = <11289600>;
> };
audio_clk1 node is in the RZ/G3S dtsi to keep the compilation happy.
For this board the audio clock1 for the SSI 3 is from <&versa3 2>.
If we fill in the audio_clk1 here it will be useless, there will be no
consumers for it and it is not available on board.
Thank you,
Claudiu Beznea
>
> Maybe add audio_clk1, so that it described properly in clock tree??
>
> Cheers,
> Biju
>
>> +&audio_clk2 {
>> + clock-frequency = <12288000>;
>> + status = "okay";
>> +};
>> +
>> &i2c0 {
>> status = "okay";
>>
>> @@ -94,6 +99,11 @@ da7212: codec@1a {
>> };
>>
>> &pinctrl {
>> + audio_clock_pins: audio-clock {
>> + pins = "AUDIO_CLK1", "AUDIO_CLK2";
>> + input-enable;
>> + };
>> +
>> key-1-gpio-hog {
>> gpio-hog;
>> gpios = <RZG2L_GPIO(18, 0) GPIO_ACTIVE_LOW>; @@ -151,6 +161,13 @@ cd {
>> pinmux = <RZG2L_PORT_PINMUX(0, 2, 1)>; /* SD1_CD */
>> };
>> };
>> +
>> + ssi3_pins: ssi3 {
>> + pinmux = <RZG2L_PORT_PINMUX(18, 2, 8)>, /* BCK */
>> + <RZG2L_PORT_PINMUX(18, 3, 8)>, /* RCK */
>> + <RZG2L_PORT_PINMUX(18, 4, 8)>, /* TXD */
>> + <RZG2L_PORT_PINMUX(18, 5, 8)>; /* RXD */
>> + };
>> };
>>
>> &scif0 {
>> @@ -171,3 +188,12 @@ &sdhi1 {
>> max-frequency = <125000000>;
>> status = "okay";
>> };
>> +
>> +&ssi3 {
>> + clocks = <&cpg CPG_MOD R9A08G045_SSI3_PCLK2>,
>> + <&cpg CPG_MOD R9A08G045_SSI3_PCLK_SFR>,
>> + <&versa3 2>, <&audio_clk2>;
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&ssi3_pins>, <&audio_clock_pins>;
>> + status = "okay";
>> +};
>> --
>> 2.39.2
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* RE: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
2024-11-11 11:19 ` Claudiu Beznea
@ 2024-11-11 11:30 ` Biju Das
2024-11-12 8:31 ` Claudiu Beznea
0 siblings, 1 reply; 42+ messages in thread
From: Biju Das @ 2024-11-11 11:30 UTC (permalink / raw)
To: Claudiu.Beznea, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu Beznea
Hi Claudiu,
> -----Original Message-----
> From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
> Sent: 11 November 2024 11:20
> Subject: Re: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
>
> Hi, Biju,
>
> On 10.11.2024 10:54, Biju Das wrote:
> > Hi Claudiu,
> >
> > Thanks for the patch.
> >
> >
> >> -----Original Message-----
> >> From: Claudiu <claudiu.beznea@tuxon.dev>
> >> Sent: 08 November 2024 10:50
> >> Subject: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable
> >> SSI3
> >>
> >> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >>
> >> Enable SSI3.
> >>
> >> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >> ---
> >>
> >> Changes in v2:
> >> - none
> >>
> >> arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 26
> >> ++++++++++++++++++++
> >> 1 file changed, 26 insertions(+)
> >>
> >> diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
> >> b/arch/arm64/boot/dts/renesas/rzg3s-
> >> smarc.dtsi
> >> index 4aa99814b808..6dd439e68bd4 100644
> >> --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
> >> +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
> >> @@ -64,6 +64,11 @@ vccq_sdhi1: regulator-vccq-sdhi1 {
> >> };
> >> };
> >>
> >
> > &audio_clk1 {
> > assigned-clocks = <&versa3 xx>;
> > clock-frequency = <11289600>;
> > };
>
> audio_clk1 node is in the RZ/G3S dtsi to keep the compilation happy.
>
> For this board the audio clock1 for the SSI 3 is from <&versa3 2>.
>
> If we fill in the audio_clk1 here it will be useless, there will be no consumers for it and it is not
> available on board.
As per SSI IP needs external clks AUDIO_CLK1 and AUDIO_CLK2.
AUDIO_CLK1 is provided by versa3 generator and
AUDIO_CLK2 is provided by Crystal.
Currently AUDIO_CLK2 it reports a frequency of 12288000 which is a multiple of 48kHz
whereas for AUDIO_CLK1, it reports a frequency of 0. By defining the node, it will report as the value as
11289600 which is a multiple of 44.1kHZ.
From the schematic we know that versa 3 is providing this clock and the audio_clk1 has
a frequency of "11289600".
Cheers,
Biju
>
> Thank you,
> Claudiu Beznea
>
> >
> > Maybe add audio_clk1, so that it described properly in clock tree??
> >
> > Cheers,
> > Biju
> >
> >> +&audio_clk2 {
> >> + clock-frequency = <12288000>;
> >> + status = "okay";
> >> +};
> >> +
> >> &i2c0 {
> >> status = "okay";
> >>
> >> @@ -94,6 +99,11 @@ da7212: codec@1a { };
> >>
> >> &pinctrl {
> >> + audio_clock_pins: audio-clock {
> >> + pins = "AUDIO_CLK1", "AUDIO_CLK2";
> >> + input-enable;
> >> + };
> >> +
> >> key-1-gpio-hog {
> >> gpio-hog;
> >> gpios = <RZG2L_GPIO(18, 0) GPIO_ACTIVE_LOW>; @@ -151,6 +161,13 @@ cd {
> >> pinmux = <RZG2L_PORT_PINMUX(0, 2, 1)>; /* SD1_CD */
> >> };
> >> };
> >> +
> >> + ssi3_pins: ssi3 {
> >> + pinmux = <RZG2L_PORT_PINMUX(18, 2, 8)>, /* BCK */
> >> + <RZG2L_PORT_PINMUX(18, 3, 8)>, /* RCK */
> >> + <RZG2L_PORT_PINMUX(18, 4, 8)>, /* TXD */
> >> + <RZG2L_PORT_PINMUX(18, 5, 8)>; /* RXD */
> >> + };
> >> };
> >>
> >> &scif0 {
> >> @@ -171,3 +188,12 @@ &sdhi1 {
> >> max-frequency = <125000000>;
> >> status = "okay";
> >> };
> >> +
> >> +&ssi3 {
> >> + clocks = <&cpg CPG_MOD R9A08G045_SSI3_PCLK2>,
> >> + <&cpg CPG_MOD R9A08G045_SSI3_PCLK_SFR>,
> >> + <&versa3 2>, <&audio_clk2>;
> >> + pinctrl-names = "default";
> >> + pinctrl-0 = <&ssi3_pins>, <&audio_clock_pins>;
> >> + status = "okay";
> >> +};
> >> --
> >> 2.39.2
> >
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
2024-11-11 11:30 ` Biju Das
@ 2024-11-12 8:31 ` Claudiu Beznea
2024-11-12 9:03 ` Biju Das
0 siblings, 1 reply; 42+ messages in thread
From: Claudiu Beznea @ 2024-11-12 8:31 UTC (permalink / raw)
To: Biju Das, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu Beznea
Hi, Biju,
On 11.11.2024 13:30, Biju Das wrote:
> Hi Claudiu,
>
>> -----Original Message-----
>> From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
>> Sent: 11 November 2024 11:20
>> Subject: Re: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
>>
>> Hi, Biju,
>>
>> On 10.11.2024 10:54, Biju Das wrote:
>>> Hi Claudiu,
>>>
>>> Thanks for the patch.
>>>
>>>
>>>> -----Original Message-----
>>>> From: Claudiu <claudiu.beznea@tuxon.dev>
>>>> Sent: 08 November 2024 10:50
>>>> Subject: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable
>>>> SSI3
>>>>
>>>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>>>
>>>> Enable SSI3.
>>>>
>>>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>>> ---
>>>>
>>>> Changes in v2:
>>>> - none
>>>>
>>>> arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 26
>>>> ++++++++++++++++++++
>>>> 1 file changed, 26 insertions(+)
>>>>
>>>> diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
>>>> b/arch/arm64/boot/dts/renesas/rzg3s-
>>>> smarc.dtsi
>>>> index 4aa99814b808..6dd439e68bd4 100644
>>>> --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
>>>> +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
>>>> @@ -64,6 +64,11 @@ vccq_sdhi1: regulator-vccq-sdhi1 {
>>>> };
>>>> };
>>>>
>>>
>>> &audio_clk1 {
>>> assigned-clocks = <&versa3 xx>;
>>> clock-frequency = <11289600>;
>>> };
>>
>> audio_clk1 node is in the RZ/G3S dtsi to keep the compilation happy.
>>
>> For this board the audio clock1 for the SSI 3 is from <&versa3 2>.
>>
>> If we fill in the audio_clk1 here it will be useless, there will be no consumers for it and it is not
>> available on board.
>
> As per SSI IP needs external clks AUDIO_CLK1 and AUDIO_CLK2.
>
> AUDIO_CLK1 is provided by versa3 generator and
> AUDIO_CLK2 is provided by Crystal.
>
> Currently AUDIO_CLK2 it reports a frequency of 12288000 which is a multiple of 48kHz
> whereas for AUDIO_CLK1, it reports a frequency of 0.
Why? You mentioned above that "AUDIO_CLK1 is provided by versa3 generator".
It will report the frequency provided by the versa3 clock generator, isn't it?
> By defining the node, it will report as the value as
> 11289600 which is a multiple of 44.1kHZ.
Defining the node as you proposed have no meaning as it will be anyway
disabled (see the dtsi) and will appear nowhere as no driver will be probed
for it.
Defining it's frequency and enabling will have no meaning either for the
SSI3, as the SSI3 is connected to <&versa3 2> (as of the binding proposed
in this patch).
>
> From the schematic we know that versa 3 is providing this clock and the audio_clk1 has
> a frequency of "11289600".
<&versa3 2> connected to AUDIO_CLK1 pin is configured at 11.2896MHz in this
series. See patch 22/25:
+ versa3: clock-generator@68 {
+ compatible = "renesas,5l35023";
+ reg = <0x68>;
+ clocks = <&x3_clk>;
+ #clock-cells = <1>;
+ assigned-clocks = <&versa3 0>,
+ <&versa3 1>,
+ *<&versa3 2>*,
+ <&versa3 3>,
+ <&versa3 4>,
+ <&versa3 5>;
+ assigned-clock-rates = <24000000>,
+ <12288000>,
+ *<11289600>*,
+ <25000000>,
+ <100000000>,
+ <100000000>;
+ renesas,settings = [
+ 80 00 11 19 4c 42 dc 2f 06 7d 20 1a 5f 1e f2 27
+ 00 40 00 00 00 00 00 00 06 0c 19 02 3f f0 90 86
+ a0 80 30 30 9c
+ ];
+ };
Thank you,
Claudiu Beznea
>
> Cheers,
> Biju
>
>
>>
>> Thank you,
>> Claudiu Beznea
>>
>>>
>>> Maybe add audio_clk1, so that it described properly in clock tree??
>>>
>>> Cheers,
>>> Biju
>>>
>>>> +&audio_clk2 {
>>>> + clock-frequency = <12288000>;
>>>> + status = "okay";
>>>> +};
>>>> +
>>>> &i2c0 {
>>>> status = "okay";
>>>>
>>>> @@ -94,6 +99,11 @@ da7212: codec@1a { };
>>>>
>>>> &pinctrl {
>>>> + audio_clock_pins: audio-clock {
>>>> + pins = "AUDIO_CLK1", "AUDIO_CLK2";
>>>> + input-enable;
>>>> + };
>>>> +
>>>> key-1-gpio-hog {
>>>> gpio-hog;
>>>> gpios = <RZG2L_GPIO(18, 0) GPIO_ACTIVE_LOW>; @@ -151,6 +161,13 @@ cd {
>>>> pinmux = <RZG2L_PORT_PINMUX(0, 2, 1)>; /* SD1_CD */
>>>> };
>>>> };
>>>> +
>>>> + ssi3_pins: ssi3 {
>>>> + pinmux = <RZG2L_PORT_PINMUX(18, 2, 8)>, /* BCK */
>>>> + <RZG2L_PORT_PINMUX(18, 3, 8)>, /* RCK */
>>>> + <RZG2L_PORT_PINMUX(18, 4, 8)>, /* TXD */
>>>> + <RZG2L_PORT_PINMUX(18, 5, 8)>; /* RXD */
>>>> + };
>>>> };
>>>>
>>>> &scif0 {
>>>> @@ -171,3 +188,12 @@ &sdhi1 {
>>>> max-frequency = <125000000>;
>>>> status = "okay";
>>>> };
>>>> +
>>>> +&ssi3 {
>>>> + clocks = <&cpg CPG_MOD R9A08G045_SSI3_PCLK2>,
>>>> + <&cpg CPG_MOD R9A08G045_SSI3_PCLK_SFR>,
>>>> + <&versa3 2>, <&audio_clk2>;
>>>> + pinctrl-names = "default";
>>>> + pinctrl-0 = <&ssi3_pins>, <&audio_clock_pins>;
>>>> + status = "okay";
>>>> +};
>>>> --
>>>> 2.39.2
>>>
^ permalink raw reply [flat|nested] 42+ messages in thread
* RE: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
2024-11-12 8:31 ` Claudiu Beznea
@ 2024-11-12 9:03 ` Biju Das
2024-11-12 9:11 ` Claudiu Beznea
0 siblings, 1 reply; 42+ messages in thread
From: Biju Das @ 2024-11-12 9:03 UTC (permalink / raw)
To: Claudiu.Beznea, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu Beznea
Hi Claudiu,
> -----Original Message-----
> From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
> Sent: 12 November 2024 08:31
> Subject: Re: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
>
> Hi, Biju,
>
> On 11.11.2024 13:30, Biju Das wrote:
> > Hi Claudiu,
> >
> >> -----Original Message-----
> >> From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
> >> Sent: 11 November 2024 11:20
> >> Subject: Re: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc:
> >> Enable SSI3
> >>
> >> Hi, Biju,
> >>
> >> On 10.11.2024 10:54, Biju Das wrote:
> >>> Hi Claudiu,
> >>>
> >>> Thanks for the patch.
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: Claudiu <claudiu.beznea@tuxon.dev>
> >>>> Sent: 08 November 2024 10:50
> >>>> Subject: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable
> >>>> SSI3
> >>>>
> >>>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >>>>
> >>>> Enable SSI3.
> >>>>
> >>>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >>>> ---
> >>>>
> >>>> Changes in v2:
> >>>> - none
> >>>>
> >>>> arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 26
> >>>> ++++++++++++++++++++
> >>>> 1 file changed, 26 insertions(+)
> >>>>
> >>>> diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
> >>>> b/arch/arm64/boot/dts/renesas/rzg3s-
> >>>> smarc.dtsi
> >>>> index 4aa99814b808..6dd439e68bd4 100644
> >>>> --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
> >>>> +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
> >>>> @@ -64,6 +64,11 @@ vccq_sdhi1: regulator-vccq-sdhi1 {
> >>>> };
> >>>> };
> >>>>
> >>>
> >>> &audio_clk1 {
> >>> assigned-clocks = <&versa3 xx>;
> >>> clock-frequency = <11289600>; };
> >>
> >> audio_clk1 node is in the RZ/G3S dtsi to keep the compilation happy.
> >>
> >> For this board the audio clock1 for the SSI 3 is from <&versa3 2>.
> >>
> >> If we fill in the audio_clk1 here it will be useless, there will be
> >> no consumers for it and it is not available on board.
> >
> > As per SSI IP needs external clks AUDIO_CLK1 and AUDIO_CLK2.
> >
> > AUDIO_CLK1 is provided by versa3 generator and
> > AUDIO_CLK2 is provided by Crystal.
> >
> > Currently AUDIO_CLK2 it reports a frequency of 12288000 which is a
> > multiple of 48kHz whereas for AUDIO_CLK1, it reports a frequency of 0.
>
> Why? You mentioned above that "AUDIO_CLK1 is provided by versa3 generator".
Output from versa3 generator is connector to AUDIO_CLK1 pin that you described in
SoC dtsi node with the entries
+ audio_clk1: audio-clk1 {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ /* This value must be overridden by boards that provide it. */
+ clock-frequency = <0>;
+ status = "disabled";
+ };
This needs to be overridden by board dts, where versa3 is providing this clk.
Currently there is no relation between this SoC device node and versa3 clk output for audio clk1.
Cheers,
Biju
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
2024-11-12 9:03 ` Biju Das
@ 2024-11-12 9:11 ` Claudiu Beznea
2024-11-12 9:21 ` Biju Das
0 siblings, 1 reply; 42+ messages in thread
From: Claudiu Beznea @ 2024-11-12 9:11 UTC (permalink / raw)
To: Biju Das, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu Beznea
On 12.11.2024 11:03, Biju Das wrote:
> Hi Claudiu,
>
>> -----Original Message-----
>> From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
>> Sent: 12 November 2024 08:31
>> Subject: Re: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
>>
>> Hi, Biju,
>>
>> On 11.11.2024 13:30, Biju Das wrote:
>>> Hi Claudiu,
>>>
>>>> -----Original Message-----
>>>> From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
>>>> Sent: 11 November 2024 11:20
>>>> Subject: Re: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc:
>>>> Enable SSI3
>>>>
>>>> Hi, Biju,
>>>>
>>>> On 10.11.2024 10:54, Biju Das wrote:
>>>>> Hi Claudiu,
>>>>>
>>>>> Thanks for the patch.
>>>>>
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Claudiu <claudiu.beznea@tuxon.dev>
>>>>>> Sent: 08 November 2024 10:50
>>>>>> Subject: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable
>>>>>> SSI3
>>>>>>
>>>>>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>>>>>
>>>>>> Enable SSI3.
>>>>>>
>>>>>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>>>>> ---
>>>>>>
>>>>>> Changes in v2:
>>>>>> - none
>>>>>>
>>>>>> arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 26
>>>>>> ++++++++++++++++++++
>>>>>> 1 file changed, 26 insertions(+)
>>>>>>
>>>>>> diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
>>>>>> b/arch/arm64/boot/dts/renesas/rzg3s-
>>>>>> smarc.dtsi
>>>>>> index 4aa99814b808..6dd439e68bd4 100644
>>>>>> --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
>>>>>> +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
>>>>>> @@ -64,6 +64,11 @@ vccq_sdhi1: regulator-vccq-sdhi1 {
>>>>>> };
>>>>>> };
>>>>>>
>>>>>
>>>>> &audio_clk1 {
>>>>> assigned-clocks = <&versa3 xx>;
>>>>> clock-frequency = <11289600>; };
>>>>
>>>> audio_clk1 node is in the RZ/G3S dtsi to keep the compilation happy.
>>>>
>>>> For this board the audio clock1 for the SSI 3 is from <&versa3 2>.
>>>>
>>>> If we fill in the audio_clk1 here it will be useless, there will be
>>>> no consumers for it and it is not available on board.
>>>
>>> As per SSI IP needs external clks AUDIO_CLK1 and AUDIO_CLK2.
>>>
>>> AUDIO_CLK1 is provided by versa3 generator and
>>> AUDIO_CLK2 is provided by Crystal.
>>>
>>> Currently AUDIO_CLK2 it reports a frequency of 12288000 which is a
>>> multiple of 48kHz whereas for AUDIO_CLK1, it reports a frequency of 0.
>>
>> Why? You mentioned above that "AUDIO_CLK1 is provided by versa3 generator".
>
> Output from versa3 generator is connector to AUDIO_CLK1
According to schematics this is true.
> that you described in
> SoC dtsi node with the entries
>
> + audio_clk1: audio-clk1 {
> + compatible = "fixed-clock";
> + #clock-cells = <0>;
> + /* This value must be overridden by boards that provide it. */
> + clock-frequency = <0>;
> + status = "disabled";
> + };
That is a clock node, placeholder in the DTSI, to make compilation happy.
>
> This needs to be overridden by board dts,
Only if used, otherwise is an useless node.
> where versa3 is providing this clk.
> Currently there is no relation between this SoC device node and versa3 clk output for audio clk1.
I may be wrong or I many not understand what you are trying to say, but
isn't what this patch does? See this diff from this patch:
+&ssi3 {
+ clocks = <&cpg CPG_MOD R9A08G045_SSI3_PCLK2>,
+ <&cpg CPG_MOD R9A08G045_SSI3_PCLK_SFR>,
+ <&versa3 2>, <&audio_clk2>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&ssi3_pins>, <&audio_clock_pins>;
+ status = "okay";
+};
^ permalink raw reply [flat|nested] 42+ messages in thread
* RE: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
2024-11-12 9:11 ` Claudiu Beznea
@ 2024-11-12 9:21 ` Biju Das
0 siblings, 0 replies; 42+ messages in thread
From: Biju Das @ 2024-11-12 9:21 UTC (permalink / raw)
To: Claudiu.Beznea, geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Prabhakar Mahadev Lad, lgirdwood@gmail.com,
broonie@kernel.org, magnus.damm@gmail.com,
linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
Claudiu Beznea
Hi Claudiu,
> Subject: Re: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3
>
>
>
> On 12.11.2024 11:03, Biju Das wrote:
> > Hi Claudiu,
> >
> >> -----Original Message-----
> >> From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
> >> Sent: 12 November 2024 08:31
> >> Subject: Re: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc:
> >> Enable SSI3
> >>
> >> Hi, Biju,
> >>
> >> On 11.11.2024 13:30, Biju Das wrote:
> >>> Hi Claudiu,
> >>>
> >>>> -----Original Message-----
> >>>> From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
> >>>> Sent: 11 November 2024 11:20
> >>>> Subject: Re: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc:
> >>>> Enable SSI3
> >>>>
> >>>> Hi, Biju,
> >>>>
> >>>> On 10.11.2024 10:54, Biju Das wrote:
> >>>>> Hi Claudiu,
> >>>>>
> >>>>> Thanks for the patch.
> >>>>>
> >>>>>
> >>>>>> -----Original Message-----
> >>>>>> From: Claudiu <claudiu.beznea@tuxon.dev>
> >>>>>> Sent: 08 November 2024 10:50
> >>>>>> Subject: [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc:
> >>>>>> Enable
> >>>>>> SSI3
> >>>>>>
> >>>>>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >>>>>>
> >>>>>> Enable SSI3.
> >>>>>>
> >>>>>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >>>>>> ---
> >>>>>>
> >>>>>> Changes in v2:
> >>>>>> - none
> >>>>>>
> >>>>>> arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 26
> >>>>>> ++++++++++++++++++++
> >>>>>> 1 file changed, 26 insertions(+)
> >>>>>>
> >>>>>> diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
> >>>>>> b/arch/arm64/boot/dts/renesas/rzg3s-
> >>>>>> smarc.dtsi
> >>>>>> index 4aa99814b808..6dd439e68bd4 100644
> >>>>>> --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
> >>>>>> +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
> >>>>>> @@ -64,6 +64,11 @@ vccq_sdhi1: regulator-vccq-sdhi1 {
> >>>>>> };
> >>>>>> };
> >>>>>>
> >>>>>
> >>>>> &audio_clk1 {
> >>>>> assigned-clocks = <&versa3 xx>;
> >>>>> clock-frequency = <11289600>; };
> >>>>
> >>>> audio_clk1 node is in the RZ/G3S dtsi to keep the compilation happy.
> >>>>
> >>>> For this board the audio clock1 for the SSI 3 is from <&versa3 2>.
> >>>>
> >>>> If we fill in the audio_clk1 here it will be useless, there will be
> >>>> no consumers for it and it is not available on board.
> >>>
> >>> As per SSI IP needs external clks AUDIO_CLK1 and AUDIO_CLK2.
> >>>
> >>> AUDIO_CLK1 is provided by versa3 generator and
> >>> AUDIO_CLK2 is provided by Crystal.
> >>>
> >>> Currently AUDIO_CLK2 it reports a frequency of 12288000 which is a
> >>> multiple of 48kHz whereas for AUDIO_CLK1, it reports a frequency of 0.
> >>
> >> Why? You mentioned above that "AUDIO_CLK1 is provided by versa3 generator".
> >
> > Output from versa3 generator is connector to AUDIO_CLK1
>
> According to schematics this is true.
>
>
> > that you described in
> > SoC dtsi node with the entries
> >
> > + audio_clk1: audio-clk1 {
> > + compatible = "fixed-clock";
> > + #clock-cells = <0>;
> > + /* This value must be overridden by boards that provide it. */
> > + clock-frequency = <0>;
> > + status = "disabled";
> > + };
>
> That is a clock node, placeholder in the DTSI, to make compilation happy.
>
> >
> > This needs to be overridden by board dts,
>
> Only if used, otherwise is an useless node.
I agree it is an useless node, if there is no relation between versa 3 output and
audio_clk1 node.
>
> > where versa3 is providing this clk.
> > Currently there is no relation between this SoC device node and versa3 clk output for audio clk1.
>
> I may be wrong or I many not understand what you are trying to say, but isn't what this patch does?
> See this diff from this patch:
The ssi3 definitions are OK. audio_clk2 node, we described crystal frequency of 12288000.
Other audio_clk1 node is useless node, even though versa3 is providing required clock
with 11289600.
I am not sure is this definition is required or not as I am not a DT expert??
Cheers,
Biju
>
> +&ssi3 {
> + clocks = <&cpg CPG_MOD R9A08G045_SSI3_PCLK2>,
> + <&cpg CPG_MOD R9A08G045_SSI3_PCLK_SFR>,
> + <&versa3 2>, <&audio_clk2>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&ssi3_pins>, <&audio_clock_pins>;
> + status = "okay";
> +};
^ permalink raw reply [flat|nested] 42+ messages in thread
end of thread, other threads:[~2024-11-12 9:21 UTC | newest]
Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08 10:49 [PATCH v2 00/25] Add audio support for the Renesas RZ/G3S SoC Claudiu
2024-11-08 10:49 ` [PATCH v2 01/25] clk: renesas: r9a08g045-cpg: Add clocks, resets and power domains support for SSI Claudiu
2024-11-10 8:31 ` Biju Das
2024-11-08 10:49 ` [PATCH v2 02/25] clk: versaclock3: Prepare for the addition of 5L35023 device Claudiu
2024-11-10 8:32 ` Biju Das
2024-11-08 10:49 ` [PATCH v2 03/25] dt-bindings: clock: versaclock3: Document 5L35023 Versa3 clock generator Claudiu
2024-11-10 8:31 ` Biju Das
2024-11-08 10:49 ` [PATCH v2 04/25] clk: versaclock3: Add support for the 5L35023 variant Claudiu
2024-11-10 8:33 ` Biju Das
2024-11-08 10:49 ` [PATCH v2 05/25] pinctrl: renesas: rzg2l: Add audio clock pins Claudiu
2024-11-10 8:33 ` Biju Das
2024-11-08 10:49 ` [PATCH v2 06/25] ASoC: sh: rz-ssi: Terminate all the DMA transactions Claudiu
2024-11-10 8:37 ` Biju Das
2024-11-11 11:15 ` Claudiu Beznea
2024-11-11 0:45 ` Kuninori Morimoto
2024-11-11 11:16 ` Claudiu Beznea
2024-11-08 10:49 ` [PATCH v2 07/25] ASoC: sh: rz-ssi: Use only the proper amount of dividers Claudiu
2024-11-08 10:49 ` [PATCH v2 08/25] ASoC: sh: rz-ssi: Fix typo on SSI_RATES macro comment Claudiu
2024-11-08 10:49 ` [PATCH v2 09/25] ASoC: sh: rz-ssi: Remove pdev member of struct rz_ssi_priv Claudiu
2024-11-08 10:49 ` [PATCH v2 10/25] ASoC: sh: rz-ssi: Remove the rz_ssi_get_dai() function Claudiu
2024-11-08 10:49 ` [PATCH v2 11/25] ASoC: sh: rz-ssi: Remove the first argument of rz_ssi_stream_is_play() Claudiu
2024-11-08 10:49 ` [PATCH v2 12/25] ASoC: sh: rz-ssi: Use readl_poll_timeout_atomic() Claudiu
2024-11-08 10:49 ` [PATCH v2 13/25] ASoC: sh: rz-ssi: Use temporary variable for struct device Claudiu
2024-11-08 10:49 ` [PATCH v2 14/25] ASoC: sh: rz-ssi: Use goto label names that specify their actions Claudiu
2024-11-08 10:49 ` [PATCH v2 15/25] ASoC: sh: rz-ssi: Rely on the ASoC subsystem to runtime resume/suspend the SSI Claudiu
2024-11-08 10:49 ` [PATCH v2 16/25] ASoC: sh: rz-ssi: Enable runtime PM autosuspend support Claudiu
2024-11-08 10:49 ` [PATCH v2 17/25] ASoC: sh: rz-ssi: Add runtime PM support Claudiu
2024-11-08 10:49 ` [PATCH v2 18/25] ASoC: sh: rz-ssi: Issue software reset in hw_params API Claudiu
2024-11-08 10:49 ` [PATCH v2 19/25] ASoC: sh: rz-ssi: Add suspend to RAM support Claudiu
2024-11-08 10:49 ` [PATCH v2 20/25] ASoC: dt-bindings: renesas,rz-ssi: Document the Renesas RZ/G3S SoC Claudiu
2024-11-08 10:49 ` [PATCH v2 21/25] arm64: dts: renesas: r9a08g045: Add SSI nodes Claudiu
2024-11-08 10:49 ` [PATCH v2 22/25] arm64: dts: renesas: rzg3s-smarc-som: Add versa3 clock generator node Claudiu
2024-11-08 10:49 ` [PATCH v2 23/25] arm64: dts: renesas: Add da7212 audio codec node Claudiu
2024-11-08 10:49 ` [PATCH v2 24/25] arm64: dts: renesas: rzg3s-smarc: Enable SSI3 Claudiu
2024-11-10 8:54 ` Biju Das
2024-11-11 11:19 ` Claudiu Beznea
2024-11-11 11:30 ` Biju Das
2024-11-12 8:31 ` Claudiu Beznea
2024-11-12 9:03 ` Biju Das
2024-11-12 9:11 ` Claudiu Beznea
2024-11-12 9:21 ` Biju Das
2024-11-08 10:49 ` [PATCH v2 25/25] arm64: dts: renesas: rzg3s-smarc: Add sound card Claudiu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox