* [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup
@ 2025-07-23 10:01 Tomi Valkeinen
2025-07-23 10:01 ` [PATCH 1/2] phy: cdns-dphy: Store hs_clk_rate and return it Tomi Valkeinen
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Tomi Valkeinen @ 2025-07-23 10:01 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I
Cc: linux-phy, linux-kernel, Parth Pancholi, Devarsh Thakkar,
Francesco Dolcini, Tomi Valkeinen, Aradhya Bhatia,
Jayesh Choudhary
A cdns-dphy improvement to return the actual hs clock rate, and a
cleanup to remove leftover code.
These were part of a Cadence DSI series:
https://lore.kernel.org/all/20250618-cdns-dsi-impro-v4-0-862c841dbe02%40ideasonboard.com/
but are now separately here for easier merging.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
Tomi Valkeinen (2):
phy: cdns-dphy: Store hs_clk_rate and return it
phy: cdns-dphy: Remove leftover code
drivers/phy/cadence/cdns-dphy.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
---
base-commit: 89be9a83ccf1f88522317ce02f854f30d6115c41
change-id: 20250723-cdns-dphy-hs-clk-rate-fix-a8857a5789dd
Best regards,
--
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] phy: cdns-dphy: Store hs_clk_rate and return it
2025-07-23 10:01 [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup Tomi Valkeinen
@ 2025-07-23 10:01 ` Tomi Valkeinen
2025-07-23 10:01 ` [PATCH 2/2] phy: cdns-dphy: Remove leftover code Tomi Valkeinen
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Tomi Valkeinen @ 2025-07-23 10:01 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I
Cc: linux-phy, linux-kernel, Parth Pancholi, Devarsh Thakkar,
Francesco Dolcini, Tomi Valkeinen, Aradhya Bhatia,
Jayesh Choudhary
The DPHY driver does not return the actual hs_clk_rate, so the DSI
driver has no idea what clock was actually achieved. Set the realized
hs_clk_rate to the opts struct, so that the DSI driver gets it back.
Reviewed-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
Tested-by: Parth Pancholi <parth.pancholi@toradex.com>
Tested-by: Jayesh Choudhary <j-choudhary@ti.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
drivers/phy/cadence/cdns-dphy.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/phy/cadence/cdns-dphy.c b/drivers/phy/cadence/cdns-dphy.c
index ed87a3970f83..f79ec4fab409 100644
--- a/drivers/phy/cadence/cdns-dphy.c
+++ b/drivers/phy/cadence/cdns-dphy.c
@@ -79,6 +79,7 @@ struct cdns_dphy_cfg {
u8 pll_ipdiv;
u8 pll_opdiv;
u16 pll_fbdiv;
+ u32 hs_clk_rate;
unsigned int nlanes;
};
@@ -154,6 +155,9 @@ static int cdns_dsi_get_dphy_pll_cfg(struct cdns_dphy *dphy,
cfg->pll_ipdiv,
pll_ref_hz);
+ cfg->hs_clk_rate = div_u64((u64)pll_ref_hz * cfg->pll_fbdiv,
+ 2 * cfg->pll_opdiv * cfg->pll_ipdiv);
+
return 0;
}
@@ -297,6 +301,7 @@ static int cdns_dphy_config_from_opts(struct phy *phy,
if (ret)
return ret;
+ opts->hs_clk_rate = cfg->hs_clk_rate;
opts->wakeup = cdns_dphy_get_wakeup_time_ns(dphy) / 1000;
return 0;
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] phy: cdns-dphy: Remove leftover code
2025-07-23 10:01 [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup Tomi Valkeinen
2025-07-23 10:01 ` [PATCH 1/2] phy: cdns-dphy: Store hs_clk_rate and return it Tomi Valkeinen
@ 2025-07-23 10:01 ` Tomi Valkeinen
2025-08-05 12:03 ` [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup Tomi Valkeinen
2025-08-12 16:41 ` Vinod Koul
3 siblings, 0 replies; 8+ messages in thread
From: Tomi Valkeinen @ 2025-07-23 10:01 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I
Cc: linux-phy, linux-kernel, Parth Pancholi, Devarsh Thakkar,
Francesco Dolcini, Tomi Valkeinen, Aradhya Bhatia,
Jayesh Choudhary
The code in cdns-dphy has probably been part of a DSI driver in the
past. Remove DSI defines and variables which are not used or do not
actually do anything. Also rename cdns_dsi_get_dphy_pll_cfg() to
cdns_dphy_get_pll_cfg(), i.e. drop the "dsi", as it's not relevant here.
Reviewed-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
Tested-by: Parth Pancholi <parth.pancholi@toradex.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Tested-by: Jayesh Choudhary <j-choudhary@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
drivers/phy/cadence/cdns-dphy.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/phy/cadence/cdns-dphy.c b/drivers/phy/cadence/cdns-dphy.c
index f79ec4fab409..33a42e72362e 100644
--- a/drivers/phy/cadence/cdns-dphy.c
+++ b/drivers/phy/cadence/cdns-dphy.c
@@ -55,14 +55,6 @@
#define DPHY_PSM_CFG_FROM_REG BIT(0)
#define DPHY_PSM_CLK_DIV(x) ((x) << 1)
-#define DSI_HBP_FRAME_OVERHEAD 12
-#define DSI_HSA_FRAME_OVERHEAD 14
-#define DSI_HFP_FRAME_OVERHEAD 6
-#define DSI_HSS_VSS_VSE_FRAME_OVERHEAD 4
-#define DSI_BLANKING_FRAME_OVERHEAD 6
-#define DSI_NULL_FRAME_OVERHEAD 6
-#define DSI_EOT_PKT_SIZE 4
-
#define DPHY_TX_J721E_WIZ_PLL_CTRL 0xF04
#define DPHY_TX_J721E_WIZ_STATUS 0xF08
#define DPHY_TX_J721E_WIZ_RST_CTRL 0xF0C
@@ -117,10 +109,9 @@ static const unsigned int tx_bands[] = {
870, 950, 1000, 1200, 1400, 1600, 1800, 2000, 2200, 2500
};
-static int cdns_dsi_get_dphy_pll_cfg(struct cdns_dphy *dphy,
- struct cdns_dphy_cfg *cfg,
- struct phy_configure_opts_mipi_dphy *opts,
- unsigned int *dsi_hfp_ext)
+static int cdns_dphy_get_pll_cfg(struct cdns_dphy *dphy,
+ struct cdns_dphy_cfg *cfg,
+ struct phy_configure_opts_mipi_dphy *opts)
{
unsigned long pll_ref_hz = clk_get_rate(dphy->pll_ref_clk);
u64 dlane_bps;
@@ -289,15 +280,13 @@ static int cdns_dphy_config_from_opts(struct phy *phy,
struct cdns_dphy_cfg *cfg)
{
struct cdns_dphy *dphy = phy_get_drvdata(phy);
- unsigned int dsi_hfp_ext = 0;
int ret;
ret = phy_mipi_dphy_config_validate(opts);
if (ret)
return ret;
- ret = cdns_dsi_get_dphy_pll_cfg(dphy, cfg,
- opts, &dsi_hfp_ext);
+ ret = cdns_dphy_get_pll_cfg(dphy, cfg, opts);
if (ret)
return ret;
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup
2025-07-23 10:01 [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup Tomi Valkeinen
2025-07-23 10:01 ` [PATCH 1/2] phy: cdns-dphy: Store hs_clk_rate and return it Tomi Valkeinen
2025-07-23 10:01 ` [PATCH 2/2] phy: cdns-dphy: Remove leftover code Tomi Valkeinen
@ 2025-08-05 12:03 ` Tomi Valkeinen
2025-08-06 10:54 ` Vinod Koul
2025-08-12 16:41 ` Vinod Koul
3 siblings, 1 reply; 8+ messages in thread
From: Tomi Valkeinen @ 2025-08-05 12:03 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I
Cc: linux-phy, linux-kernel, Parth Pancholi, Devarsh Thakkar,
Francesco Dolcini, Aradhya Bhatia, Jayesh Choudhary
Hi Vinod, Kishon,
On 23/07/2025 13:01, Tomi Valkeinen wrote:
> A cdns-dphy improvement to return the actual hs clock rate, and a
> cleanup to remove leftover code.
>
> These were part of a Cadence DSI series:
>
> https://lore.kernel.org/all/20250618-cdns-dsi-impro-v4-0-862c841dbe02%40ideasonboard.com/
>
> but are now separately here for easier merging.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> ---
> Tomi Valkeinen (2):
> phy: cdns-dphy: Store hs_clk_rate and return it
> phy: cdns-dphy: Remove leftover code
>
> drivers/phy/cadence/cdns-dphy.c | 24 +++++++++---------------
> 1 file changed, 9 insertions(+), 15 deletions(-)
> ---
> base-commit: 89be9a83ccf1f88522317ce02f854f30d6115c41
> change-id: 20250723-cdns-dphy-hs-clk-rate-fix-a8857a5789dd
Is this good to merge, and if so, do you have any estimate when? While
this is independent from the DSI series, I'd rather push the DSI series
into drm-misc about the same time, so both would appear in linux-next
relatively together.
Tomi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup
2025-08-05 12:03 ` [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup Tomi Valkeinen
@ 2025-08-06 10:54 ` Vinod Koul
2025-08-12 6:02 ` devarsh
0 siblings, 1 reply; 8+ messages in thread
From: Vinod Koul @ 2025-08-06 10:54 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Kishon Vijay Abraham I, linux-phy, linux-kernel, Parth Pancholi,
Devarsh Thakkar, Francesco Dolcini, Aradhya Bhatia,
Jayesh Choudhary
On 05-08-25, 15:03, Tomi Valkeinen wrote:
> Hi Vinod, Kishon,
>
> On 23/07/2025 13:01, Tomi Valkeinen wrote:
> > A cdns-dphy improvement to return the actual hs clock rate, and a
> > cleanup to remove leftover code.
> >
> > These were part of a Cadence DSI series:
> >
> > https://lore.kernel.org/all/20250618-cdns-dsi-impro-v4-0-862c841dbe02%40ideasonboard.com/
> >
> > but are now separately here for easier merging.
> >
> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> > ---
> > Tomi Valkeinen (2):
> > phy: cdns-dphy: Store hs_clk_rate and return it
> > phy: cdns-dphy: Remove leftover code
> >
> > drivers/phy/cadence/cdns-dphy.c | 24 +++++++++---------------
> > 1 file changed, 9 insertions(+), 15 deletions(-)
> > ---
> > base-commit: 89be9a83ccf1f88522317ce02f854f30d6115c41
> > change-id: 20250723-cdns-dphy-hs-clk-rate-fix-a8857a5789dd
>
> Is this good to merge, and if so, do you have any estimate when? While
> this is independent from the DSI series, I'd rather push the DSI series
> into drm-misc about the same time, so both would appear in linux-next
> relatively together.
I will start taking patches after merge window closes next monday, so
next week should be a good estimate
--
~Vinod
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup
2025-08-06 10:54 ` Vinod Koul
@ 2025-08-12 6:02 ` devarsh
2025-08-18 13:05 ` Devarsh Thakkar
0 siblings, 1 reply; 8+ messages in thread
From: devarsh @ 2025-08-12 6:02 UTC (permalink / raw)
To: Vinod Koul, Tomi Valkeinen, kishon
Cc: linux-phy, linux-kernel, Parth Pancholi, Francesco Dolcini,
Aradhya Bhatia, Jayesh Choudhary
Hi Vinod, Kishon,
On 06/08/25 16:24, Vinod Koul wrote:
> On 05-08-25, 15:03, Tomi Valkeinen wrote:
>> Hi Vinod, Kishon,
>>
>> On 23/07/2025 13:01, Tomi Valkeinen wrote:
>>> A cdns-dphy improvement to return the actual hs clock rate, and a
>>> cleanup to remove leftover code.
>>>
>>> These were part of a Cadence DSI series:
>>>
>>> https://lore.kernel.org/all/20250618-cdns-dsi-impro-v4-0-862c841dbe02%40ideasonboard.com/
>>>
>>> but are now separately here for easier merging.
>>>
>>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>> ---
>>> Tomi Valkeinen (2):
>>> phy: cdns-dphy: Store hs_clk_rate and return it
>>> phy: cdns-dphy: Remove leftover code
>>>
>>> drivers/phy/cadence/cdns-dphy.c | 24 +++++++++---------------
>>> 1 file changed, 9 insertions(+), 15 deletions(-)
>>> ---
>>> base-commit: 89be9a83ccf1f88522317ce02f854f30d6115c41
>>> change-id: 20250723-cdns-dphy-hs-clk-rate-fix-a8857a5789dd
>>
>> Is this good to merge, and if so, do you have any estimate when? While
>> this is independent from the DSI series, I'd rather push the DSI series
>> into drm-misc about the same time, so both would appear in linux-next
>> relatively together.
>
> I will start taking patches after merge window closes next monday, so
> next week should be a good estimate
On top of this series [1], we have the cadence DPHY fixes for fixing PLL
lockup timeout [2] and one more patch which enables lower resolutions
[3], both have been reviewed and tested too.
Would it be possible for you too merge all 3 together in below order ?
[1]:
https://lore.kernel.org/all/cc0e4cf5-1bd9-4ae3-a130-0483dbfc6335@ideasonboard.com/
[2]: https://lore.kernel.org/all/20250704125915.1224738-1-devarsht@ti.com/
[3]: https://lore.kernel.org/all/20250807052002.717807-1-h-shenoy@ti.com/
Kindly let us know if anything required from our side.
Regards
Devarsh
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup
2025-07-23 10:01 [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup Tomi Valkeinen
` (2 preceding siblings ...)
2025-08-05 12:03 ` [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup Tomi Valkeinen
@ 2025-08-12 16:41 ` Vinod Koul
3 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2025-08-12 16:41 UTC (permalink / raw)
To: Kishon Vijay Abraham I, Tomi Valkeinen
Cc: linux-phy, linux-kernel, Parth Pancholi, Devarsh Thakkar,
Francesco Dolcini, Aradhya Bhatia, Jayesh Choudhary
On Wed, 23 Jul 2025 13:01:27 +0300, Tomi Valkeinen wrote:
> A cdns-dphy improvement to return the actual hs clock rate, and a
> cleanup to remove leftover code.
>
> These were part of a Cadence DSI series:
>
> https://lore.kernel.org/all/20250618-cdns-dsi-impro-v4-0-862c841dbe02%40ideasonboard.com/
>
> [...]
Applied, thanks!
[1/2] phy: cdns-dphy: Store hs_clk_rate and return it
commit: 7ac3644d1e82ae6c7ad3767a3f2594faffd12264
[2/2] phy: cdns-dphy: Remove leftover code
commit: b659c5cc993767a42ad1a712dd357522099c5c37
Best regards,
--
~Vinod
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup
2025-08-12 6:02 ` devarsh
@ 2025-08-18 13:05 ` Devarsh Thakkar
0 siblings, 0 replies; 8+ messages in thread
From: Devarsh Thakkar @ 2025-08-18 13:05 UTC (permalink / raw)
To: Vinod Koul, Tomi Valkeinen, kishon
Cc: linux-phy, linux-kernel, Parth Pancholi, Francesco Dolcini,
Aradhya Bhatia, Jayesh Choudhary
Gentle reminder.
Hi Vinod,
On 12/08/25 11:32, devarsh wrote:
> Hi Vinod, Kishon,
>
> On 06/08/25 16:24, Vinod Koul wrote:
>> On 05-08-25, 15:03, Tomi Valkeinen wrote:
>>> Hi Vinod, Kishon,
>>>
>>> On 23/07/2025 13:01, Tomi Valkeinen wrote:
>>>> A cdns-dphy improvement to return the actual hs clock rate, and a
>>>> cleanup to remove leftover code.
>>>>
>>>> These were part of a Cadence DSI series:
>>>>
>>>> https://lore.kernel.org/all/20250618-cdns-dsi-impro-v4-0-862c841dbe02%40ideasonboard.com/
>>>>
>>>> but are now separately here for easier merging.
>>>>
>>>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>>> ---
>>>> Tomi Valkeinen (2):
>>>> phy: cdns-dphy: Store hs_clk_rate and return it
>>>> phy: cdns-dphy: Remove leftover code
>>>>
>>>> drivers/phy/cadence/cdns-dphy.c | 24 +++++++++---------------
>>>> 1 file changed, 9 insertions(+), 15 deletions(-)
>>>> ---
>>>> base-commit: 89be9a83ccf1f88522317ce02f854f30d6115c41
>>>> change-id: 20250723-cdns-dphy-hs-clk-rate-fix-a8857a5789dd
>>>
>>> Is this good to merge, and if so, do you have any estimate when? While
>>> this is independent from the DSI series, I'd rather push the DSI series
>>> into drm-misc about the same time, so both would appear in linux-next
>>> relatively together.
>>
>> I will start taking patches after merge window closes next monday, so
>> next week should be a good estimate
>
> On top of this series [1], we have the cadence DPHY fixes for fixing PLL
> lockup timeout [2] and one more patch which enables lower resolutions
> [3], both have been reviewed and tested too.
>
> Would it be possible for you too merge all 3 together in below order ?
>
> [1]:
> https://lore.kernel.org/all/cc0e4cf5-1bd9-4ae3-a130-0483dbfc6335@ideasonboard.com/
> [2]: https://lore.kernel.org/all/20250704125915.1224738-1-devarsht@ti.com/
> [3]: https://lore.kernel.org/all/20250807052002.717807-1-h-shenoy@ti.com/
>
As I understand we see [1] got merged to linux-next but [2] and [3] are
still pending. Could you please let us know if anything further required
on our side for these two i.e. [2] and [3] ?
Regards
Devarsh
> Kindly let us know if anything required from our side.
>
> Regards
> Devarsh
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-08-18 13:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-23 10:01 [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup Tomi Valkeinen
2025-07-23 10:01 ` [PATCH 1/2] phy: cdns-dphy: Store hs_clk_rate and return it Tomi Valkeinen
2025-07-23 10:01 ` [PATCH 2/2] phy: cdns-dphy: Remove leftover code Tomi Valkeinen
2025-08-05 12:03 ` [PATCH 0/2] phy: cdns-dphy: hs-clk improvement and a cleanup Tomi Valkeinen
2025-08-06 10:54 ` Vinod Koul
2025-08-12 6:02 ` devarsh
2025-08-18 13:05 ` Devarsh Thakkar
2025-08-12 16:41 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).