drm/panel: drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions
Subsystems (3)
v4 cover drm/panel: drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions
Changes from v3:
- fixed code style issues
- removed redundant error printout
Avinal Kumar (2):
drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped
functions
drivers/gpu/drm/drm_mipi_dsi.c | 28 +++++++++++++++++++ .../drm/panel/panel-panasonic-vvx10f034n00.c | 14 ++++++++-- include/drm/drm_mipi_dsi.h | 1 + 3 files changed, 40 insertions(+), 3 deletions(-)
Signature · 1 line
2.53.0
PATCH v4 1/2 drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi
Add mipi_dsi_shutdown_peripheral_multi function and mark mipi_dsi_shutdown_peripheral function as deprecated.
--- drivers/gpu/drm/drm_mipi_dsi.c | 28 ++++++++++++++++++++++++++++ include/drm/drm_mipi_dsi.h | 1 + 2 files changed, 29 insertions(+)
drivers/gpu/drm/drm_mipi_dsi.c +28 -0
@@ -587,6 +587,9 @@ EXPORT_SYMBOL(mipi_dsi_create_packet);* mipi_dsi_shutdown_peripheral() - sends a Shutdown Peripheral command * @dsi: DSI peripheral device * +* This function is deprecated. Use mipi_dsi_shutdown_peripheral_multi() +* instead. +* * Return: 0 on success or a negative error code on failure. */ int mipi_dsi_shutdown_peripheral (struct mipi_dsi_device *dsi)
@@ -1980,6 +1983,31 @@ void mipi_dsi_dcs_set_tear_scanline_multi(struct mipi_dsi_multi_context *ctx, }EXPORT_SYMBOL (mipi_dsi_dcs_set_tear_scanline_multi); +/** +* mipi_dsi_shutdown_peripheral_multi() - sends a Shutdown Peripheral command +* @ctx: Context for multiple DSI transactions +* +* Like mipi_dsi_shutdown_peripheral() but deals with errors in a way that +* makes it convenient to make serial calls in a row. +*/ +void mipi_dsi_shutdown_peripheral_multi (struct mipi_dsi_multi_context *ctx) +{ +struct mipi_dsi_device *dsi = ctx->dsi; +struct device *dev = &dsi->dev; +int ret; + +if (ctx->accum_err) +return ; + + ret =mipi_dsi_shutdown_peripheral (dsi); +if (ret <0 ) { + ctx->accum_err = ret; +dev_err (dev,"Failed to shutdown peripheral: %d\n" , + ctx->accum_err); + } +} +EXPORT_SYMBOL (mipi_dsi_shutdown_peripheral_multi); +static int mipi_dsi_drv_probe (struct device *dev) {struct mipi_dsi_driver *drv =to_mipi_dsi_driver (dev->driver);
include/drm/drm_mipi_dsi.h +1 -0
@@ -393,6 +393,7 @@ void mipi_dsi_dcs_set_page_address_multi(struct mipi_dsi_multi_context *ctx,void mipi_dsi_dcs_set_tear_scanline_multi (struct mipi_dsi_multi_context *ctx,u16 scanline);void mipi_dsi_dcs_set_tear_off_multi (struct mipi_dsi_multi_context *ctx); +void mipi_dsi_shutdown_peripheral_multi (struct mipi_dsi_multi_context *ctx);/** * mipi_dsi_generic_write_seq_multi - transmit data using a generic write packet
Signature · 1 line
2.53.0
Re: [PATCH v4 1/2] drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi
Hi,
drivers/gpu/drm/drm_mipi_dsi.c void mipi_dsi_dcs_set_tear_scanline_multi(struct mipi_dsi_multi_context *ctx, · line 1991
Quoted 11 lines · Avinal Kumar
drivers/gpu/drm/drm_mipi_dsi.c +6
-0@@ -1980,6 +1983,31 @@ void mipi_dsi_dcs_set_tear_scanline_multi(struct mipi_dsi_multi_context *ctx, }EXPORT_SYMBOL (mipi_dsi_dcs_set_tear_scanline_multi); +/** +* mipi_dsi_shutdown_peripheral_multi() - sends a Shutdown Peripheral command +* @ctx: Context for multiple DSI transactions +* +* Like mipi_dsi_shutdown_peripheral() but deals with errors in a way that +* makes it convenient to make serial calls in a row.
Between v3 and v4, you changed:
make several calls in a row
to
make serial calls in a row
Is there a reason why? Not that it matters a whole lot, but the old wording seemed fine and it matches the wording in the description of all of the other _multi functions.
Other than that weird nit, this looks OK to me:
I'm pretty curious why you changed it between v3 and v4, though.
-Doug
PATCH v4 2/2 drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions
In reply to Avinal KumarChanges the panasonic-vvx10f034n00 panel to multi
style functions for improved error handling and
removes redundant error printout.
--- .../gpu/drm/panel/panel-panasonic-vvx10f034n00.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +11 -3
@@ -44,14 +44,23 @@ static inline struct wuxga_nt_panel *to_wuxga_nt_panel(struct drm_panel *panel)static int wuxga_nt_panel_on (struct wuxga_nt_panel *wuxga_nt) { -return mipi_dsi_turn_on_peripheral (wuxga_nt->dsi); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = wuxga_nt->dsi + }; + +mipi_dsi_turn_on_peripheral_multi (&dsi_ctx); +return dsi_ctx.accum_err; }static int wuxga_nt_panel_disable (struct drm_panel *panel) {struct wuxga_nt_panel *wuxga_nt =to_wuxga_nt_panel (panel); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = wuxga_nt->dsi + }; -return mipi_dsi_shutdown_peripheral (wuxga_nt->dsi); +mipi_dsi_shutdown_peripheral_multi (&dsi_ctx); +return dsi_ctx.accum_err; }static int wuxga_nt_panel_unprepare (struct drm_panel *panel)
@@ -95,7 +104,6 @@ static int wuxga_nt_panel_prepare(struct drm_panel *panel) ret =wuxga_nt_panel_on (wuxga_nt);if (ret <0 ) { -dev_err (panel->dev,"failed to set panel on: %d\n" , ret); goto poweroff; }
Signature · 1 line
2.53.0
Re: [PATCH v4 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions
Hi,
Quoted 4 lines · Avinal Kumar
Changes the panasonic-vvx10f034n00 panel to multi
style functions for improved error handling and
removes redundant error printout.
nit: Linux folks generally like the "imperative" statements. So the above would be better as:
Change the panasonic-vvx10f034n00 panel to multi style functions for improved error handling and remove redundant error printout.
In other words, use "change" not "changes" and "remove" not "removes".
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c static int wuxga_nt_panel_prepare(struct drm_panel *panel) · line 108
Quoted 7 lines
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +0
-1@@ -95,7 +104,6 @@ static int wuxga_nt_panel_prepare(struct drm_panel *panel) ret =wuxga_nt_panel_on (wuxga_nt);if (ret <0 ) { -dev_err (panel->dev,"failed to set panel on: %d\n" , ret); goto poweroff; }
Now that you've removed the error printout (and thus it's a one-liner inside the "if" test), you need to remove the braces. Linux style guidelines are pretty strict about this. Hopefully it's pretty easy to spin a v5 with that? Otherwise, this looks fine to me.
-Doug
Re: [PATCH v4 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions
Hi,
Quoted 20 lines · Doug Anderson
Hi,
Quoted 4 lines · Avinal Kumar
Changes the panasonic-vvx10f034n00 panel to multi
style functions for improved error handling and
removes redundant error printout.nit: Linux folks generally like the "imperative" statements. So the above would be better as:
Change the panasonic-vvx10f034n00 panel to multi style functions for improved error handling and remove redundant error printout.
In other words, use "change" not "changes" and "remove" not "removes".
Quoted 2 lines
(quoted diff) +0
-0@@ -95,7 +104,6 @@ static int wuxga_nt_panel_prepare(struct drm_panel *panel)
Quoted 10 lines
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c static int wuxga_nt_panel_prepare(struct drm_panel *panel) · line 108
Quoted 5 lines
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +0
-1ret =wuxga_nt_panel_on (wuxga_nt);if (ret <0 ) { -dev_err (panel->dev,"failed to set panel on: %d\n" , ret); goto poweroff; }Now that you've removed the error printout (and thus it's a one-liner inside the "if" test), you need to remove the braces. Linux style guidelines are pretty strict about this. Hopefully it's pretty easy to spin a v5 with that? Otherwise, this looks fine to me.
Actually, looking at it one more time, the code should probably just look like:
ret = wuxga_nt_panel_on(wuxga_nt);
if (ret < 0)
regulator_disable(wuxga_nt->supply);
return ret;
The "goto" is pretty overkill here.