Re: [PATCH v5 1/4] drm/panel: p079zca: refactor panel driver to support multiple panels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 02, 2018 at 12:27:18PM +0200, Heiko Stuebner wrote:
> From: huang lin <hl@xxxxxxxxxxxxxx>
> 
> 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@xxxxxxxxxxxxxx>
> Signed-off-by: Heiko Stuebner <heiko@xxxxxxxxx>
> ---
>  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

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux