Re: [PATCH v2 3/3] drm/panel-fannal-c3003: Add fannal c3004 DSI panel

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

 



On 05/06/2023 17:35, Paulo Pavacic wrote:
> Fannal C3004 is a 480x800 display made by fannal that requires
> DCS initialization sequences.
> 
> Signed-off-by: Paulo Pavacic <pavacic.p@xxxxxxxxx>
> ---

> v3 changelog:
>  - using generic mipi_dsi_dcs_write_seq

This is marked as v2?

>  - removed success prints
>  - removed some comments
>  - simplified code/removed support for different panels
>  - changed namespace from fann to fannal
> v2 changelog:
>  - renamed from panel-mipi-dsi-bringup
>  - only one MAINTAINER e-mail
> ---
>  MAINTAINERS     


> +static int fannal_panel_probe(struct mipi_dsi_device *dsi)
> +{
> +	struct device *dev = &dsi->dev;
> +	struct fannal_panel_data *panel_data;
> +	int ret;
> +
> +	panel_data = devm_kzalloc(&dsi->dev, sizeof(*panel_data), GFP_KERNEL);
> +
> +	if (!panel_data)
> +		return -ENOMEM;
> +
> +	panel_data->reset = devm_gpiod_get_optional(
> +		dev, "reset", GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE);

dev should be in previous line

Why this is nonexclusive? How many instances of same driver are
expecting to get this on one system?

> +
> +	if (IS_ERR(panel_data->reset)) {
> +		ret = PTR_ERR(panel_data->reset);
> +		dev_err(dev,
> +			"error: probe: get reset GPIO: (%d) Check the fdt\n",
> +			ret);

return dev_err_probe

> +		return ret;
> +	}
> +
> +	mipi_dsi_set_drvdata(dsi, panel_data);
> +
> +	dsi->format = MIPI_DSI_FMT_RGB888;
> +	dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS |
> +			  MIPI_DSI_MODE_VSYNC_FLUSH | MIPI_DSI_MODE_VIDEO_HSE |
> +			  MIPI_DSI_MODE_NO_EOT_PACKET |
> +			  MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_VIDEO;
> +	dsi->lanes = 2;
> +
> +	gpiod_set_value_cansleep(panel_data->reset, 1);

So you leave the panel in reset state?
> +
> +	drm_panel_init(&panel_data->panel, dev, &fannal_panel_funcs,
> +		       DRM_MODE_CONNECTOR_DSI);
> +	dev_set_drvdata(dev, panel_data);
> +
> +	drm_panel_add(&panel_data->panel);
> +
> +	ret = mipi_dsi_attach(dsi);
> +	if (ret) {
> +		drm_panel_remove(&panel_data->panel);
> +		dev_err(dev, "error: probe fail: can't attach mipi_dsi!\n");

No need to shout, skip exclamation mark.


Best regards,
Krzysztof




[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