[PATCH v5 1/4] drm/panel: p079zca: refactor panel driver to support multiple panels
Thierry Reding
thierry.reding at gmail.com
Tue Jul 10 10:57:43 UTC 2018
On Mon, Jul 02, 2018 at 12:27:18PM +0200, Heiko Stuebner wrote:
> From: huang lin <hl at rock-chips.com>
>
> Refactor Innolux P079ZCA panel driver, let it support
> multi panels from Innolux that share similar power sequences.
>
> Panels may require different power supplies so use regulator bulk
> interfaces and define per panel supply-names.
>
> Changes in v2:
> - Change regulator property name to meet the panel datasheet
> Changes in v3:
> - this patch only refactor P079ZCA panel to support multi panel,
> support P097PFG panel in another patch
> Changes in v4:
> - Modify the patch which suggest by Thierry
> Changes in v5:
> - use regulator_bulk to handle different supply number
>
> Signed-off-by: Lin Huang <hl at rock-chips.com>
> Signed-off-by: Heiko Stuebner <heiko at sntech.de>
> ---
> drivers/gpu/drm/panel/panel-innolux-p079zca.c | 143 ++++++++++++------
> 1 file changed, 100 insertions(+), 43 deletions(-)
Applied with minor changes, see below.
> diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> index bb53e0850764..840ad4a6a6a6 100644
> --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> @@ -20,12 +20,29 @@
>
> #include <video/mipi_display.h>
>
> +struct panel_desc {
> + const struct drm_display_mode *modes;
I renamed this to "mode" because there is always only one.
> + unsigned int bpc;
> + struct {
> + unsigned int width;
> + unsigned int height;
> + } size;
> +
> + unsigned long flags;
> + enum mipi_dsi_pixel_format format;
> + unsigned int lanes;
> + const char * const *supply_names;
> + unsigned int num_supplies;
> +};
> +
> struct innolux_panel {
> struct drm_panel base;
> struct mipi_dsi_device *link;
> + const struct panel_desc *desc;
>
> struct backlight_device *backlight;
> - struct regulator *supply;
> + struct regulator_bulk_data *supplies;
> + unsigned int num_supplies;
> struct gpio_desc *enable_gpio;
>
> bool prepared;
> @@ -77,9 +94,7 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
> /* T8: 80ms - 1000ms */
> msleep(80);
>
> - err = regulator_disable(innolux->supply);
> - if (err < 0)
> - return err;
> + regulator_bulk_disable(innolux->desc->num_supplies, innolux->supplies);
I kept the error check and return here.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180710/1c58b03f/attachment.sig>
More information about the dri-devel
mailing list