2023-11-01 09:19:25

by Tomi Valkeinen

[permalink] [raw]
Subject: [PATCH 06/10] drm/tidss: Check for K2G in in dispc_softreset()

K2G doesn't have softreset feature. Instead of having every caller of
dispc_softreset() check for K2G, move the check into dispc_softreset(),
and make dispc_softreset() return 0 in case of K2G.

Signed-off-by: Tomi Valkeinen <[email protected]>
---
drivers/gpu/drm/tidss/tidss_dispc.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c
index cdbb88289082..f204a0701e9f 100644
--- a/drivers/gpu/drm/tidss/tidss_dispc.c
+++ b/drivers/gpu/drm/tidss/tidss_dispc.c
@@ -2707,6 +2707,10 @@ static int dispc_softreset(struct dispc_device *dispc)
u32 val;
int ret;

+ /* K2G display controller does not support soft reset */
+ if (dispc->feat->subrev == DISPC_K2G)
+ return 0;
+
/* Soft reset */
REG_FLD_MOD(dispc, DSS_SYSCONFIG, 1, 1, 1);
/* Wait for reset to complete */
@@ -2831,12 +2835,9 @@ int dispc_init(struct tidss_device *tidss)

tidss->dispc = dispc;

- /* K2G display controller does not support soft reset */
- if (feat->subrev != DISPC_K2G) {
- r = dispc_softreset(dispc);
- if (r)
- return r;
- }
+ r = dispc_softreset(dispc);
+ if (r)
+ return r;

return 0;
}

--
2.34.1


2023-11-01 14:22:38

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH 06/10] drm/tidss: Check for K2G in in dispc_softreset()

Hi Tomi,

Thank you for the patch.

On Wed, Nov 01, 2023 at 11:17:43AM +0200, Tomi Valkeinen wrote:
> K2G doesn't have softreset feature. Instead of having every caller of
> dispc_softreset() check for K2G, move the check into dispc_softreset(),
> and make dispc_softreset() return 0 in case of K2G.
>
> Signed-off-by: Tomi Valkeinen <[email protected]>

Reviewed-by: Laurent Pinchart <[email protected]>

> ---
> drivers/gpu/drm/tidss/tidss_dispc.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c
> index cdbb88289082..f204a0701e9f 100644
> --- a/drivers/gpu/drm/tidss/tidss_dispc.c
> +++ b/drivers/gpu/drm/tidss/tidss_dispc.c
> @@ -2707,6 +2707,10 @@ static int dispc_softreset(struct dispc_device *dispc)
> u32 val;
> int ret;
>
> + /* K2G display controller does not support soft reset */
> + if (dispc->feat->subrev == DISPC_K2G)
> + return 0;
> +
> /* Soft reset */
> REG_FLD_MOD(dispc, DSS_SYSCONFIG, 1, 1, 1);
> /* Wait for reset to complete */
> @@ -2831,12 +2835,9 @@ int dispc_init(struct tidss_device *tidss)
>
> tidss->dispc = dispc;
>
> - /* K2G display controller does not support soft reset */
> - if (feat->subrev != DISPC_K2G) {
> - r = dispc_softreset(dispc);
> - if (r)
> - return r;
> - }
> + r = dispc_softreset(dispc);
> + if (r)
> + return r;
>
> return 0;
> }
>

--
Regards,

Laurent Pinchart