diff mbox series

[2/5] drm/bridge: tc358762: Switch to atomic ops

Message ID 20230615201902.566182-2-marex@denx.de (mailing list archive)
State Accepted
Headers show
Series [1/5] drm/bridge: tc358762: Split register programming from pre-enable to enable | expand

Commit Message

Marek Vasut June 15, 2023, 8:18 p.m. UTC
Switch the bridge driver over to atomic ops. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@gmail.com>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Robert Foss <rfoss@kernel.org>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/bridge/tc358762.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Comments

Sam Ravnborg June 16, 2023, 7:02 p.m. UTC | #1
On Thu, Jun 15, 2023 at 10:18:59PM +0200, Marek Vasut wrote:
> Switch the bridge driver over to atomic ops. No functional change.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

(I hope one day all bridge drivers are converted to atomic ops...)

> ---
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Cc: Robert Foss <rfoss@kernel.org>
> Cc: dri-devel@lists.freedesktop.org
> ---
>  drivers/gpu/drm/bridge/tc358762.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc358762.c
> index df9703eacab1f..5e00c08b99540 100644
> --- a/drivers/gpu/drm/bridge/tc358762.c
> +++ b/drivers/gpu/drm/bridge/tc358762.c
> @@ -126,7 +126,7 @@ static int tc358762_init(struct tc358762 *ctx)
>  	return tc358762_clear_error(ctx);
>  }
>  
> -static void tc358762_post_disable(struct drm_bridge *bridge)
> +static void tc358762_post_disable(struct drm_bridge *bridge, struct drm_bridge_state *state)
>  {
>  	struct tc358762 *ctx = bridge_to_tc358762(bridge);
>  	int ret;
> @@ -148,7 +148,7 @@ static void tc358762_post_disable(struct drm_bridge *bridge)
>  		dev_err(ctx->dev, "error disabling regulators (%d)\n", ret);
>  }
>  
> -static void tc358762_pre_enable(struct drm_bridge *bridge)
> +static void tc358762_pre_enable(struct drm_bridge *bridge, struct drm_bridge_state *state)
>  {
>  	struct tc358762 *ctx = bridge_to_tc358762(bridge);
>  	int ret;
> @@ -165,7 +165,7 @@ static void tc358762_pre_enable(struct drm_bridge *bridge)
>  	ctx->pre_enabled = true;
>  }
>  
> -static void tc358762_enable(struct drm_bridge *bridge)
> +static void tc358762_enable(struct drm_bridge *bridge, struct drm_bridge_state *state)
>  {
>  	struct tc358762 *ctx = bridge_to_tc358762(bridge);
>  	int ret;
> @@ -185,9 +185,12 @@ static int tc358762_attach(struct drm_bridge *bridge,
>  }
>  
>  static const struct drm_bridge_funcs tc358762_bridge_funcs = {
> -	.post_disable = tc358762_post_disable,
> -	.pre_enable = tc358762_pre_enable,
> -	.enable = tc358762_enable,
> +	.atomic_post_disable = tc358762_post_disable,
> +	.atomic_pre_enable = tc358762_pre_enable,
> +	.atomic_enable = tc358762_enable,
> +	.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
> +	.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
> +	.atomic_reset = drm_atomic_helper_bridge_reset,
>  	.attach = tc358762_attach,
>  };
>  
> -- 
> 2.39.2
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc358762.c
index df9703eacab1f..5e00c08b99540 100644
--- a/drivers/gpu/drm/bridge/tc358762.c
+++ b/drivers/gpu/drm/bridge/tc358762.c
@@ -126,7 +126,7 @@  static int tc358762_init(struct tc358762 *ctx)
 	return tc358762_clear_error(ctx);
 }
 
-static void tc358762_post_disable(struct drm_bridge *bridge)
+static void tc358762_post_disable(struct drm_bridge *bridge, struct drm_bridge_state *state)
 {
 	struct tc358762 *ctx = bridge_to_tc358762(bridge);
 	int ret;
@@ -148,7 +148,7 @@  static void tc358762_post_disable(struct drm_bridge *bridge)
 		dev_err(ctx->dev, "error disabling regulators (%d)\n", ret);
 }
 
-static void tc358762_pre_enable(struct drm_bridge *bridge)
+static void tc358762_pre_enable(struct drm_bridge *bridge, struct drm_bridge_state *state)
 {
 	struct tc358762 *ctx = bridge_to_tc358762(bridge);
 	int ret;
@@ -165,7 +165,7 @@  static void tc358762_pre_enable(struct drm_bridge *bridge)
 	ctx->pre_enabled = true;
 }
 
-static void tc358762_enable(struct drm_bridge *bridge)
+static void tc358762_enable(struct drm_bridge *bridge, struct drm_bridge_state *state)
 {
 	struct tc358762 *ctx = bridge_to_tc358762(bridge);
 	int ret;
@@ -185,9 +185,12 @@  static int tc358762_attach(struct drm_bridge *bridge,
 }
 
 static const struct drm_bridge_funcs tc358762_bridge_funcs = {
-	.post_disable = tc358762_post_disable,
-	.pre_enable = tc358762_pre_enable,
-	.enable = tc358762_enable,
+	.atomic_post_disable = tc358762_post_disable,
+	.atomic_pre_enable = tc358762_pre_enable,
+	.atomic_enable = tc358762_enable,
+	.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
+	.atomic_reset = drm_atomic_helper_bridge_reset,
 	.attach = tc358762_attach,
 };