Support Anbernic RG351V Panel
Subsystems (4)
v3 cover Support Anbernic RG351V Panel
From: Chris Morgan <[email protected]>
Add support for the Anbernic RG351V panel. This panel is mostly identical to the one used in the 353 series, except it has a different panel ID when queried (0x4000 for the 351V, 0x3052 for the 353 panel) and will not work without the inclusion of the MIPI_DSI_CLOCK_NON_CONTINUOUS flag.
Updates from V2:
- Modified the driver so that we only apply the MIPI_DSI_CLOCK_NON_CONTINUOUS flag when the compatible matches a panel (the 351v) that needs it.
- Updated the binding documentation to be consistent with existing panels.
Updates from V1:
- Revised text in devicetree documentation to remove references to specific hardware.
Chris Morgan (2):
dt-bindings: display: newvision,nv3051d: Add Anbernic 351V drm/panel: nv3051d: Add Support for Anbernic 351V
.../bindings/display/panel/newvision,nv3051d.yaml | 5 ++--- drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-)
Signature · 1 line
2.34.1
PATCH v3 1/2 dt-bindings: display: newvision, nv3051d: Add Anbernic 351V
From: Chris Morgan <[email protected]>
Document the Anbernic RG351V panel, which is identical to the panel used in their 353 series except for in inclusion of an additional DSI format flag.
--- .../devicetree/bindings/display/panel/newvision,nv3051d.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml +2 -3
@@ -7,9 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: NewVision NV3051D based LCD panel description: | - The NewVision NV3051D is a driver chip used to drive DSI panels. For now, - this driver only supports the 640x480 panels found in the Anbernic RG353 - based devices. + The NewVision NV3051D is a driver chip used to drive DSI panels. maintainers: - Chris Morgan <[email protected]>
@@ -21,6 +19,7 @@ properties: compatible: items: - enum: + - anbernic,rg351v-panel - anbernic,rg353p-panel - anbernic,rg353v-panel - const: newvision,nv3051d
Signature · 1 line
2.34.1
Re: [PATCH V3 1/2] dt-bindings: display: newvision,nv3051d: Add Anbernic 351V
Quoted 7 lines · Chris Morgan
From: Chris Morgan <[email protected]>
Document the Anbernic RG351V panel, which is identical to the panel used in their 353 series except for in inclusion of an additional DSI format flag.
Signed-off-by Chris Morgan <[email protected]>
Thanks,
Conor.
Quoted 30 lines
--- .../devicetree/bindings/display/panel/newvision,nv3051d.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml +2
-3@@ -7,9 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: NewVision NV3051D based LCD panel description: | - The NewVision NV3051D is a driver chip used to drive DSI panels. For now, - this driver only supports the 640x480 panels found in the Anbernic RG353 - based devices. + The NewVision NV3051D is a driver chip used to drive DSI panels. maintainers: - Chris Morgan <[email protected]>@@ -21,6 +19,7 @@ properties: compatible: items: - enum: + - anbernic,rg351v-panel - anbernic,rg353p-panel - anbernic,rg353v-panel - const: newvision,nv3051dSignature · 1 line
2.34.1
PATCH v3 2/2 drm/panel: nv3051d: Add Support for Anbernic 351V
In reply to Chris MorganFrom: Chris Morgan <[email protected]>
Add support for the Anbernic 351V. Just like the 353 series the underlying vendor is unknown/unmarked (at least not visible in a non-destructive manner). The panel had slightly different init sequences and timings in the BSP kernel, but works fine with the same ones used in the existing driver. The panel will not work without the inclusion of the MIPI_DSI_CLOCK_NON_CONTINUOUS flag, and this flag prevents the 353 series from working correctly, so a new compatible string is added.
Tested colors and timings using modetest and all seem to work identical to the 353 otherwise.
--- drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/panel/panel-newvision-nv3051d.c +8 -0
@@ -354,6 +354,7 @@ static const struct drm_panel_funcs panel_nv3051d_funcs = {static int panel_nv3051d_probe (struct mipi_dsi_device *dsi) {struct device *dev = &dsi->dev; +struct device_node *np = dev->of_node;struct panel_nv3051d *ctx;int ret;
@@ -388,6 +389,13 @@ static int panel_nv3051d_probe(struct mipi_dsi_device *dsi) dsi->mode_flags =MIPI_DSI_MODE_VIDEO |MIPI_DSI_MODE_VIDEO_BURST |MIPI_DSI_MODE_LPM |MIPI_DSI_MODE_NO_EOT_PACKET ; +/* +* The panel in the RG351V is identical to the 353P, except it +* requires MIPI_DSI_CLOCK_NON_CONTINUOUS to operate correctly. +*/ +if (of_device_is_compatible (np,"anbernic,rg351v-panel" )) + dsi->mode_flags |=MIPI_DSI_CLOCK_NON_CONTINUOUS ; +drm_panel_init (&ctx->panel, &dsi->dev, &panel_nv3051d_funcs,DRM_MODE_CONNECTOR_DSI );
Signature · 1 line
2.34.1
Re: [PATCH V3 2/2] drm/panel: nv3051d: Add Support for Anbernic 351V
Quoted 24 lines · Chris Morgan
From: Chris Morgan <[email protected]>
Add support for the Anbernic 351V. Just like the 353 series the underlying vendor is unknown/unmarked (at least not visible in a non-destructive manner). The panel had slightly different init sequences and timings in the BSP kernel, but works fine with the same ones used in the existing driver. The panel will not work without the inclusion of the
MIPI_DSI_CLOCK_NON_CONTINUOUSflag, and this flag prevents the 353 series from working correctly, so a new compatible string is added.Tested colors and timings using modetest and all seem to work identical to the 353 otherwise.
Signed-off-by Chris Morgan <[email protected]>--- drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/gpu/drm/panel/panel-newvision-nv3051d.c +0
-0
drivers/gpu/drm/panel/panel-newvision-nv3051d.c static const struct drm_panel_funcs panel_nv3051d_funcs = { · line 357
Quoted 4 lines
drivers/gpu/drm/panel/panel-newvision-nv3051d.c +1
-0@@ -354,6 +354,7 @@ static const struct drm_panel_funcs panel_nv3051d_funcs = {static int panel_nv3051d_probe (struct mipi_dsi_device *dsi) {struct device *dev = &dsi->dev; +struct device_node *np = dev->of_node;
Hi Chris,
Thanks for the patch.
It mostly looks good to me, but just one question here -- why not pass in dev->of_node directly into of_device_is_compatible()?
Thanks,
Jessica Zhang
Quoted 19 lines
drivers/gpu/drm/panel/panel-newvision-nv3051d.c +6
-0struct panel_nv3051d *ctx;int ret;@@ -388,6 +389,13 @@ static int panel_nv3051d_probe(struct mipi_dsi_device *dsi) dsi->mode_flags =MIPI_DSI_MODE_VIDEO |MIPI_DSI_MODE_VIDEO_BURST |MIPI_DSI_MODE_LPM |MIPI_DSI_MODE_NO_EOT_PACKET ; +/* +* The panel in the RG351V is identical to the 353P, except it +* requires MIPI_DSI_CLOCK_NON_CONTINUOUS to operate correctly. +*/ +if (of_device_is_compatible (np,"anbernic,rg351v-panel" )) + dsi->mode_flags |= MIPI_DSI_CLOCK_NON_CONTINUOUS; > +drm_panel_init (&ctx->panel, &dsi->dev, &panel_nv3051d_funcs,DRM_MODE_CONNECTOR_DSI );Signature · 1 line
2.34.1
Re: [PATCH V3 2/2] drm/panel: nv3051d: Add Support for Anbernic 351V
Quoted 34 lines · Jessica Zhang
Quoted 24 lines · Chris Morgan
From: Chris Morgan <[email protected]>
Add support for the Anbernic 351V. Just like the 353 series the underlying vendor is unknown/unmarked (at least not visible in a non-destructive manner). The panel had slightly different init sequences and timings in the BSP kernel, but works fine with the same ones used in the existing driver. The panel will not work without the inclusion of the
MIPI_DSI_CLOCK_NON_CONTINUOUSflag, and this flag prevents the 353 series from working correctly, so a new compatible string is added.Tested colors and timings using modetest and all seem to work identical to the 353 otherwise.
Signed-off-by Chris Morgan <[email protected]>--- drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/gpu/drm/panel/panel-newvision-nv3051d.c +0
-0drivers/gpu/drm/panel/panel-newvision-nv3051d.c static const struct drm_panel_funcs panel_nv3051d_funcs = { · line 357
Quoted 4 lines
drivers/gpu/drm/panel/panel-newvision-nv3051d.c +1
-0@@ -354,6 +354,7 @@ static const struct drm_panel_funcs panel_nv3051d_funcs = {static int panel_nv3051d_probe (struct mipi_dsi_device *dsi) {struct device *dev = &dsi->dev; +struct device_node *np = dev->of_node;Hi Chris,
Quoted 4 lines
Thanks for the patch.
It mostly looks good to me, but just one question here -- why not pass in
dev->of_nodedirectly intoof_device_is_compatible()?
It was an oversight on my part. I'll modify and resend, sorry about that.
Thank you.
Quoted 21 lines
Thanks,
Jessica Zhang
Quoted 16 lines
drivers/gpu/drm/panel/panel-newvision-nv3051d.c +6
-0struct panel_nv3051d *ctx;int ret;@@ -388,6 +389,13 @@ static int panel_nv3051d_probe(struct mipi_dsi_device *dsi) dsi->mode_flags =MIPI_DSI_MODE_VIDEO |MIPI_DSI_MODE_VIDEO_BURST |MIPI_DSI_MODE_LPM |MIPI_DSI_MODE_NO_EOT_PACKET ; +/* +* The panel in the RG351V is identical to the 353P, except it +* requires MIPI_DSI_CLOCK_NON_CONTINUOUS to operate correctly. +*/ +if (of_device_is_compatible (np,"anbernic,rg351v-panel" )) + dsi->mode_flags |= MIPI_DSI_CLOCK_NON_CONTINUOUS; > +drm_panel_init (&ctx->panel, &dsi->dev, &panel_nv3051d_funcs,DRM_MODE_CONNECTOR_DSI );Signature · 1 line
2.34.1