Re: [RESENT PATCH] drm/panel: support Innolux P097PFG panel

From: Brian Norris
Date: Thu Nov 30 2017 - 21:55:07 EST


One more comment:

On Thu, Nov 30, 2017 at 02:14:40PM +0800, Lin Huang wrote:
> Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
> it refactor Innolux P079ZCA panel driver, let it support
> multi panel, and add support P097PFG panel in this driver.
>
> Signed-off-by: Lin Huang <hl@xxxxxxxxxxxxxx>
>
> ---
> drivers/gpu/drm/panel/panel-innolux-p079zca.c | 178 ++++++++++++++++++++------
> 1 file changed, 136 insertions(+), 42 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> index 6ba9344..a40798f 100644
> --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
...

> @@ -209,20 +284,39 @@ static const struct drm_panel_funcs innolux_panel_funcs = {
> };
>
> static const struct of_device_id innolux_of_match[] = {
> - { .compatible = "innolux,p079zca", },
> - { }
> + { .compatible = "innolux,p079zca",
> + .data = &innolux_p079zca_panel_desc
> + },
> + { .compatible = "innolux,p097pfg",
> + .data = &innolux_p097pfg_panel_desc
> + }
> };
> MODULE_DEVICE_TABLE(of, innolux_of_match);
>
> -static int innolux_panel_add(struct innolux_panel *innolux)
> +static int innolux_panel_add(struct mipi_dsi_device *dsi,
> + const struct panel_desc_dsi *desc)
> {
> - struct device *dev = &innolux->link->dev;
> + struct innolux_panel *innolux;
> + struct device *dev = &dsi->dev;
> struct device_node *np;
> int err;
>
> - innolux->supply = devm_regulator_get(dev, "power");
> - if (IS_ERR(innolux->supply))
> - return PTR_ERR(innolux->supply);
> + innolux = devm_kzalloc(dev, sizeof(*innolux), GFP_KERNEL);
> + if (!innolux)
> + return -ENOMEM;
> +
> + innolux->dsi_desc = desc;
> + innolux->vddi = devm_regulator_get_optional(dev, "power");
> + if (IS_ERR(innolux->vddi))
> + return PTR_ERR(innolux->vddi);
> +
> + innolux->avdd = devm_regulator_get(dev, "ppvarp");

This name ("ppvarp" and the "ppvarn" below) are names from our board
schematics, not from the panel datasheet. I would think these should be
"vdd" and "vee", like your variable names.

Brian

> + if (IS_ERR(innolux->avdd))
> + return PTR_ERR(innolux->avdd);
> +
> + innolux->avee = devm_regulator_get(dev, "ppvarn");
> + if (IS_ERR(innolux->avee))
> + return PTR_ERR(innolux->avee);
>
> innolux->enable_gpio = devm_gpiod_get_optional(dev, "enable",
> GPIOD_OUT_HIGH);
...