From: "Guido Günther" <guido.gunther@puri.sm>
To: Ondrej Jirman <megous@megous.com>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
Purism Kernel Team <kernel@puri.sm>,
Samuel Holland <samuel@sholland.org>,
David Airlie <airlied@linux.ie>,
Linus Walleij <linus.walleij@linaro.org>,
Bhushan Shah <bshah@kde.org>, Chen-Yu Tsai <wens@csie.org>,
Rob Herring <robh+dt@kernel.org>,
linux-kernel@vger.kernel.org, Martijn Braam <martijn@brixit.nl>,
linux-sunxi@googlegroups.com,
Thierry Reding <thierry.reding@gmail.com>,
Maxime Ripard <mripard@kernel.org>,
Daniel Vetter <daniel@ffwll.ch>, Sam Ravnborg <sam@ravnborg.org>,
Luca Weiss <luca@z3ntu.xyz>,
linux-arm-kernel@lists.infradead.org,
Icenowy Zheng <icenowy@aosc.io>
Subject: Re: [PATCH v6 05/13] drm/panel: st7703: Rename functions from jh057n prefix to st7703
Date: Wed, 1 Jul 2020 18:01:03 +0200 [thread overview]
Message-ID: <20200701160103.GD174356@bogon.m.sigxcpu.org> (raw)
In-Reply-To: <20200701103126.1512615-6-megous@megous.com>
Hi,
On Wed, Jul 01, 2020 at 12:31:18PM +0200, Ondrej Jirman wrote:
> This is done so that code that's not specific to a particular
> jh057n panel is named after the controller. Functions specific
> to the panel are kept named after the panel.
Reviewed-by: Guido Günther <agx@sigxcpu.org>
>
> Signed-off-by: Ondrej Jirman <megous@megous.com>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/gpu/drm/panel/panel-sitronix-st7703.c | 90 ++++++++++---------
> 1 file changed, 46 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> index 38ff742bc120..511af659f273 100644
> --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> @@ -1,6 +1,8 @@
> // SPDX-License-Identifier: GPL-2.0
> /*
> - * Rockteck jh057n00900 5.5" MIPI-DSI panel driver
> + * Driver for panels based on Sitronix ST7703 controller, souch as:
> + *
> + * - Rocktech jh057n00900 5.5" MIPI-DSI panel
> *
> * Copyright (C) Purism SPC 2019
> */
> @@ -21,7 +23,7 @@
> #include <drm/drm_panel.h>
> #include <drm/drm_print.h>
>
> -#define DRV_NAME "panel-rocktech-jh057n00900"
> +#define DRV_NAME "panel-sitronix-st7703"
>
> /* Manufacturer specific Commands send via DSI */
> #define ST7703_CMD_ALL_PIXEL_OFF 0x22
> @@ -45,7 +47,7 @@
> #define ST7703_CMD_SETGIP1 0xE9
> #define ST7703_CMD_SETGIP2 0xEA
>
> -struct jh057n {
> +struct st7703 {
> struct device *dev;
> struct drm_panel panel;
> struct gpio_desc *reset_gpio;
> @@ -56,9 +58,9 @@ struct jh057n {
> struct dentry *debugfs;
> };
>
> -static inline struct jh057n *panel_to_jh057n(struct drm_panel *panel)
> +static inline struct st7703 *panel_to_st7703(struct drm_panel *panel)
> {
> - return container_of(panel, struct jh057n, panel);
> + return container_of(panel, struct st7703, panel);
> }
>
> #define dsi_generic_write_seq(dsi, seq...) do { \
> @@ -69,7 +71,7 @@ static inline struct jh057n *panel_to_jh057n(struct drm_panel *panel)
> return ret; \
> } while (0)
>
> -static int jh057n_init_sequence(struct jh057n *ctx)
> +static int jh057n_init_sequence(struct st7703 *ctx)
> {
> struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
> struct device *dev = ctx->dev;
> @@ -141,9 +143,9 @@ static int jh057n_init_sequence(struct jh057n *ctx)
> return 0;
> }
>
> -static int jh057n_enable(struct drm_panel *panel)
> +static int st7703_enable(struct drm_panel *panel)
> {
> - struct jh057n *ctx = panel_to_jh057n(panel);
> + struct st7703 *ctx = panel_to_st7703(panel);
> int ret;
>
> ret = jh057n_init_sequence(ctx);
> @@ -156,17 +158,17 @@ static int jh057n_enable(struct drm_panel *panel)
> return 0;
> }
>
> -static int jh057n_disable(struct drm_panel *panel)
> +static int st7703_disable(struct drm_panel *panel)
> {
> - struct jh057n *ctx = panel_to_jh057n(panel);
> + struct st7703 *ctx = panel_to_st7703(panel);
> struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
>
> return mipi_dsi_dcs_set_display_off(dsi);
> }
>
> -static int jh057n_unprepare(struct drm_panel *panel)
> +static int st7703_unprepare(struct drm_panel *panel)
> {
> - struct jh057n *ctx = panel_to_jh057n(panel);
> + struct st7703 *ctx = panel_to_st7703(panel);
>
> if (!ctx->prepared)
> return 0;
> @@ -178,9 +180,9 @@ static int jh057n_unprepare(struct drm_panel *panel)
> return 0;
> }
>
> -static int jh057n_prepare(struct drm_panel *panel)
> +static int st7703_prepare(struct drm_panel *panel)
> {
> - struct jh057n *ctx = panel_to_jh057n(panel);
> + struct st7703 *ctx = panel_to_st7703(panel);
> int ret;
>
> if (ctx->prepared)
> @@ -230,10 +232,10 @@ static const struct drm_display_mode default_mode = {
> .height_mm = 130,
> };
>
> -static int jh057n_get_modes(struct drm_panel *panel,
> +static int st7703_get_modes(struct drm_panel *panel,
> struct drm_connector *connector)
> {
> - struct jh057n *ctx = panel_to_jh057n(panel);
> + struct st7703 *ctx = panel_to_st7703(panel);
> struct drm_display_mode *mode;
>
> mode = drm_mode_duplicate(connector->dev, &default_mode);
> @@ -254,17 +256,17 @@ static int jh057n_get_modes(struct drm_panel *panel,
> return 1;
> }
>
> -static const struct drm_panel_funcs jh057n_drm_funcs = {
> - .disable = jh057n_disable,
> - .unprepare = jh057n_unprepare,
> - .prepare = jh057n_prepare,
> - .enable = jh057n_enable,
> - .get_modes = jh057n_get_modes,
> +static const struct drm_panel_funcs st7703_drm_funcs = {
> + .disable = st7703_disable,
> + .unprepare = st7703_unprepare,
> + .prepare = st7703_prepare,
> + .enable = st7703_enable,
> + .get_modes = st7703_get_modes,
> };
>
> static int allpixelson_set(void *data, u64 val)
> {
> - struct jh057n *ctx = data;
> + struct st7703 *ctx = data;
> struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
>
> DRM_DEV_DEBUG_DRIVER(ctx->dev, "Setting all pixels on\n");
> @@ -282,7 +284,7 @@ static int allpixelson_set(void *data, u64 val)
> DEFINE_SIMPLE_ATTRIBUTE(allpixelson_fops, NULL,
> allpixelson_set, "%llu\n");
>
> -static void jh057n_debugfs_init(struct jh057n *ctx)
> +static void st7703_debugfs_init(struct st7703 *ctx)
> {
> ctx->debugfs = debugfs_create_dir(DRV_NAME, NULL);
>
> @@ -290,16 +292,16 @@ static void jh057n_debugfs_init(struct jh057n *ctx)
> &allpixelson_fops);
> }
>
> -static void jh057n_debugfs_remove(struct jh057n *ctx)
> +static void st7703_debugfs_remove(struct st7703 *ctx)
> {
> debugfs_remove_recursive(ctx->debugfs);
> ctx->debugfs = NULL;
> }
>
> -static int jh057n_probe(struct mipi_dsi_device *dsi)
> +static int st7703_probe(struct mipi_dsi_device *dsi)
> {
> struct device *dev = &dsi->dev;
> - struct jh057n *ctx;
> + struct st7703 *ctx;
> int ret;
>
> ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
> @@ -340,7 +342,7 @@ static int jh057n_probe(struct mipi_dsi_device *dsi)
> return ret;
> }
>
> - drm_panel_init(&ctx->panel, dev, &jh057n_drm_funcs,
> + drm_panel_init(&ctx->panel, dev, &st7703_drm_funcs,
> DRM_MODE_CONNECTOR_DSI);
>
> ret = drm_panel_of_backlight(&ctx->panel);
> @@ -363,13 +365,13 @@ static int jh057n_probe(struct mipi_dsi_device *dsi)
> default_mode.vrefresh,
> mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes);
>
> - jh057n_debugfs_init(ctx);
> + st7703_debugfs_init(ctx);
> return 0;
> }
>
> -static void jh057n_shutdown(struct mipi_dsi_device *dsi)
> +static void st7703_shutdown(struct mipi_dsi_device *dsi)
> {
> - struct jh057n *ctx = mipi_dsi_get_drvdata(dsi);
> + struct st7703 *ctx = mipi_dsi_get_drvdata(dsi);
> int ret;
>
> ret = drm_panel_unprepare(&ctx->panel);
> @@ -383,12 +385,12 @@ static void jh057n_shutdown(struct mipi_dsi_device *dsi)
> ret);
> }
>
> -static int jh057n_remove(struct mipi_dsi_device *dsi)
> +static int st7703_remove(struct mipi_dsi_device *dsi)
> {
> - struct jh057n *ctx = mipi_dsi_get_drvdata(dsi);
> + struct st7703 *ctx = mipi_dsi_get_drvdata(dsi);
> int ret;
>
> - jh057n_shutdown(dsi);
> + st7703_shutdown(dsi);
>
> ret = mipi_dsi_detach(dsi);
> if (ret < 0)
> @@ -397,28 +399,28 @@ static int jh057n_remove(struct mipi_dsi_device *dsi)
>
> drm_panel_remove(&ctx->panel);
>
> - jh057n_debugfs_remove(ctx);
> + st7703_debugfs_remove(ctx);
>
> return 0;
> }
>
> -static const struct of_device_id jh057n_of_match[] = {
> +static const struct of_device_id st7703_of_match[] = {
> { .compatible = "rocktech,jh057n00900" },
> { /* sentinel */ }
> };
> -MODULE_DEVICE_TABLE(of, jh057n_of_match);
> +MODULE_DEVICE_TABLE(of, st7703_of_match);
>
> -static struct mipi_dsi_driver jh057n_driver = {
> - .probe = jh057n_probe,
> - .remove = jh057n_remove,
> - .shutdown = jh057n_shutdown,
> +static struct mipi_dsi_driver st7703_driver = {
> + .probe = st7703_probe,
> + .remove = st7703_remove,
> + .shutdown = st7703_shutdown,
> .driver = {
> .name = DRV_NAME,
> - .of_match_table = jh057n_of_match,
> + .of_match_table = st7703_of_match,
> },
> };
> -module_mipi_dsi_driver(jh057n_driver);
> +module_mipi_dsi_driver(st7703_driver);
>
> MODULE_AUTHOR("Guido Günther <agx@sigxcpu.org>");
> -MODULE_DESCRIPTION("DRM driver for Rocktech JH057N00900 MIPI DSI panel");
> +MODULE_DESCRIPTION("DRM driver for Sitronix ST7703 based MIPI DSI panels");
> MODULE_LICENSE("GPL v2");
> --
> 2.27.0
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-07-01 16:02 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-01 10:31 [PATCH v6 00/13] Add support for PinePhone LCD panel Ondrej Jirman
2020-07-01 10:31 ` [PATCH v6 01/13] dt-bindings: vendor-prefixes: Add Xingbangda Ondrej Jirman
2020-07-01 10:31 ` [PATCH v6 02/13] dt-bindings: panel: Convert rocktech, jh057n00900 to yaml Ondrej Jirman
2020-07-01 15:58 ` [PATCH v6 02/13] dt-bindings: panel: Convert rocktech,jh057n00900 " Guido Günther
2020-07-01 16:07 ` Sam Ravnborg
2020-07-01 16:32 ` Ondřej Jirman
2020-07-01 10:31 ` [PATCH v6 03/13] dt-bindings: panel: Add compatible for Xingbangda XBD599 panel Ondrej Jirman
2020-07-01 10:31 ` [PATCH v6 04/13] drm/panel: rocktech-jh057n00900: Rename the driver to st7703 Ondrej Jirman
2020-07-01 16:00 ` Guido Günther
2020-07-01 10:31 ` [PATCH v6 05/13] drm/panel: st7703: Rename functions from jh057n prefix " Ondrej Jirman
2020-07-01 16:01 ` Guido Günther [this message]
2020-07-01 10:31 ` [PATCH v6 06/13] drm/panel: st7703: Prepare for supporting multiple panels Ondrej Jirman
2020-07-01 16:02 ` Guido Günther
2020-07-01 10:31 ` [PATCH v6 07/13] drm/panel: st7703: Move code specific to jh057n closer together Ondrej Jirman
2020-07-01 16:02 ` Guido Günther
2020-07-01 10:31 ` [PATCH v6 08/13] drm/panel: st7703: Move generic part of init sequence to enable callback Ondrej Jirman
2020-07-01 16:02 ` Guido Günther
2020-07-01 10:31 ` [PATCH v6 09/13] drm/panel: st7703: Add support for Xingbangda XBD599 Ondrej Jirman
2020-07-01 16:03 ` Guido Günther
2020-07-01 10:31 ` [PATCH v6 10/13] drm/panel: st7703: Enter sleep after display off Ondrej Jirman
2020-07-01 16:04 ` Guido Günther
2020-07-01 10:31 ` [PATCH v6 11/13] drm/panel: st7703: Assert reset prior to powering down the regulators Ondrej Jirman
2020-07-01 16:04 ` Guido Günther
2020-07-01 10:31 ` [PATCH v6 12/13] arm64: dts: sun50i-a64-pinephone: Enable LCD support on PinePhone Ondrej Jirman
2020-07-01 10:31 ` [PATCH v6 13/13] arm64: dts: sun50i-a64-pinephone: Add touchscreen support Ondrej Jirman
2020-07-01 12:01 ` Icenowy Zheng
2020-07-01 18:57 ` Ondřej Jirman
2020-07-01 15:25 ` [PATCH v6 00/13] Add support for PinePhone LCD panel Sam Ravnborg
2020-07-01 16:30 ` Ondřej Jirman
2020-07-01 16:37 ` Linus Walleij
2020-07-01 15:54 ` Guido Günther
2020-07-01 16:42 ` Ondřej Jirman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200701160103.GD174356@bogon.m.sigxcpu.org \
--to=guido.gunther@puri.sm \
--cc=airlied@linux.ie \
--cc=bshah@kde.org \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=icenowy@aosc.io \
--cc=kernel@puri.sm \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=luca@z3ntu.xyz \
--cc=martijn@brixit.nl \
--cc=megous@megous.com \
--cc=mripard@kernel.org \
--cc=robh+dt@kernel.org \
--cc=sam@ravnborg.org \
--cc=samuel@sholland.org \
--cc=thierry.reding@gmail.com \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).