Skip to content

Commit 2e7115a

Browse files
KhanhNguyen-RVCnashif
authored andcommitted
drivers: mipi_dsi: Add support Renesas RA MIPI DSI for RA8P1
Update the Renesas RA MIPI DSI driver and bindings to align with RA8P1 SoC support: - Add SoC-specific PHY PLL multiplier ranges - RA8D1: 20–180 - RA8P1: 40–375 - Correct t_init limit from 15 bits to 19 bits as specified in HUM - Update devicetree bindings: - Clarify `pll-div` as input frequency divisor - Add `pll-out-div` property as output frequency divisor Signed-off-by: Khanh Nguyen <[email protected]>
1 parent ea85a8b commit 2e7115a

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

drivers/mipi_dsi/dsi_renesas_ra.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,19 @@ static int mipi_dsi_renesas_ra_init(const struct device *dev)
224224
return 0;
225225
}
226226

227+
#if defined(CONFIG_SOC_SERIES_RA8D1)
228+
#define RENESAS_RA_PHY_PLL_MUL_INT_MIN 20
229+
#define RENESAS_RA_PHY_PLL_MUL_INT_MAX 180
230+
#elif defined(CONFIG_SOC_SERIES_RA8P1)
231+
#define RENESAS_RA_PHY_PLL_MUL_INT_MIN 40
232+
#define RENESAS_RA_PHY_PLL_MUL_INT_MAX 375
233+
#else
234+
#error "Unsupported SoC series"
235+
#endif
236+
227237
#define RENESAS_RA_MIPI_PHYS_SETTING_DEFINE(n) \
228238
static const mipi_phy_timing_t mipi_phy_##n##_timing = { \
229-
.t_init = CLAMP(DT_PROP(DT_INST_CHILD(n, phys_timing), t_init), 0, 0x7FFF), \
239+
.t_init = CLAMP(DT_PROP(DT_INST_CHILD(n, phys_timing), t_init), 0, 0x7FFFF), \
230240
.dphytim2_b = \
231241
{ \
232242
.t_clk_prep = \
@@ -266,8 +276,12 @@ static int mipi_dsi_renesas_ra_init(const struct device *dev)
266276
.pll_settings = \
267277
{ \
268278
.div = DT_INST_PROP(n, pll_div) - 1, \
279+
.pll_div = DT_INST_ENUM_IDX_OR(n, pll_out_div, 0), \
269280
.mul_frac = DT_INST_ENUM_IDX(n, pll_mul_frac), \
270-
.mul_int = CLAMP(DT_INST_PROP(n, pll_mul_int), 20, 180) - 1, \
281+
.mul_int = CLAMP(DT_INST_PROP(n, pll_mul_int), \
282+
RENESAS_RA_PHY_PLL_MUL_INT_MIN, \
283+
RENESAS_RA_PHY_PLL_MUL_INT_MAX) - \
284+
1, \
271285
}, \
272286
.lp_divisor = CLAMP(DT_INST_PROP(n, lp_divisor), 1, 32) - 1, \
273287
.p_timing = &mipi_phy_##n##_timing, \

dts/bindings/mipi-dsi/renesas,ra-mipi-dsi.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ properties:
2323
type: int
2424
enum: [1, 2, 3, 4]
2525
description:
26-
PHY PLL divisor.
26+
PHY PLL input frequency divisor.
2727

2828
pll-mul-int:
2929
type: int
@@ -36,6 +36,12 @@ properties:
3636
description:
3737
PHY PLL fractional multiplier.
3838

39+
pll-out-div:
40+
type: int
41+
enum: [1, 2, 4, 8]
42+
description: |
43+
PHY PLL output frequency divisor.
44+
3945
lp-divisor:
4046
type: int
4147
description:

0 commit comments

Comments
 (0)