mbox series

[V2,0/3] drm/panel: Add NewVision NV3051D Panels

Message ID 20220920145905.20595-1-macroalpha82@gmail.com
Headers show
Series drm/panel: Add NewVision NV3051D Panels | expand

Message

Chris Morgan Sept. 20, 2022, 2:59 p.m. UTC
From: Chris Morgan <macromorgan@hotmail.com>

Add the NewVision NV3051D panel as found on the Anbernic RG353P and
RG353V. The underlying LCD panel itself is unknown (the NV3051D is
the controller), so the device name is used for the panel with a
fallback to the driver IC.

Changes from V1:
 - Changed compatible string to the driver IC.
 - Updated documentation to use new compatible string with board
   name.
 - Refactored somewhat to make it easier to support other LCD panels
   with this kernel module.
 - Added support for 60hz mode. Adjusted pixel clock to ensure proper
   60hz and 120hz (previously was running at 124hz).
 - Added vendor prefix for NewVision. Anbernic vendor prefix added in
   https://lore.kernel.org/linux-devicetree/20220906210324.28986-2-macroalpha82@gmail.com

Chris Morgan (3):
  dt-bindings: vendor-prefixes: add NewVision vendor prefix
  dt-bindings: display: panel: Add NewVision NV3051D bindings
  drm/panel: Add NewVision NV3051D MIPI-DSI LCD panel

 .../display/panel/newvision,nv3051d.yaml      |  55 ++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 drivers/gpu/drm/panel/Kconfig                 |   9 +
 drivers/gpu/drm/panel/Makefile                |   1 +
 .../gpu/drm/panel/panel-newvision-nv3051d.c   | 513 ++++++++++++++++++
 5 files changed, 580 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml
 create mode 100644 drivers/gpu/drm/panel/panel-newvision-nv3051d.c

Comments

Chris Morgan Sept. 21, 2022, 2:38 p.m. UTC | #1
On Wed, Sep 21, 2022 at 08:51:34AM +0200, Krzysztof Kozlowski wrote:
> On 20/09/2022 16:59, Chris Morgan wrote:
> > From: Chris Morgan <macromorgan@hotmail.com>
> > 
> > Add documentation for the NewVision NV3051D panel bindings.
> > Note that for the two expected consumers of this panel binding
> > the underlying LCD model is unknown. Name "anbernic,rg353p-panel"
> > is used because the hardware itself is known as "anbernic,rg353p".
> > 
> > Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> > ---
> >  .../display/panel/newvision,nv3051d.yaml      | 55 +++++++++++++++++++
> >  1 file changed, 55 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml b/Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml
> > new file mode 100644
> > index 000000000000..d90bca4171c2
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml
> > @@ -0,0 +1,55 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevicetree.org%2Fschemas%2Fdisplay%2Fpanel%2Fnewvision%2Cnv3051d.yaml%23&amp;data=05%7C01%7C%7C844872fdf91b413aa65a08da9b9db9e7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637993398994635658%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=eTM2IFjR0TKPlQNYfoq3Poao8QYLSHRVaqiXtufJ7VA%3D&amp;reserved=0
> > +$schema: https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevicetree.org%2Fmeta-schemas%2Fcore.yaml%23&amp;data=05%7C01%7C%7C844872fdf91b413aa65a08da9b9db9e7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637993398994635658%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=sjb7x2Z2wKu1C8mMBW1epwuXipe8V26zxpHcCAuKLZY%3D&amp;reserved=0
> > +
> > +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.
> > +
> > +maintainers:
> > +  - Chris Morgan <macromorgan@hotmail.com>
> > +
> > +allOf:
> > +  - $ref: panel-common.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    items:
> > +      - enum:
> > +          - anbernic,rg353p-panel
> 
> Are these vendor prefixs documented?

Yes, they are in another patch series referenced in the cover letter.
They were added for the Anbernic devicetrees and should (I believe)
land in 6.1.

> 
> > +          - anbernic,rg353v-panel
> > +      - const: newvision,nv3051d
> 
> Blank line.
> 

Ack.

> > +  reg: true
> > +  backlight: true
> > +  port: true
> > +  reset-gpios: true
> > +  vdd-supply:
> > +    description: regulator that supplies the vdd voltage
> 
> Skip description and make it just "true". It's kind of obvious.
> 

Ack.

> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - backlight
> > +  - vdd-supply
> 
> Best regards,
> Krzysztof
Krzysztof Kozlowski Sept. 21, 2022, 3:21 p.m. UTC | #2
On 21/09/2022 16:38, Chris Morgan wrote:
>>> +  compatible:
>>> +    items:
>>> +      - enum:
>>> +          - anbernic,rg353p-panel
>>
>> Are these vendor prefixs documented?
> 
> Yes, they are in another patch series referenced in the cover letter.
> They were added for the Anbernic devicetrees and should (I believe)
> land in 6.1.

OK... you still need to test your bindings. Your patch was clearly not
tested before sending. :(

Best regards,
Krzysztof
Chris Morgan Sept. 21, 2022, 3:50 p.m. UTC | #3
On Wed, Sep 21, 2022 at 05:21:19PM +0200, Krzysztof Kozlowski wrote:
> On 21/09/2022 16:38, Chris Morgan wrote:
> >>> +  compatible:
> >>> +    items:
> >>> +      - enum:
> >>> +          - anbernic,rg353p-panel
> >>
> >> Are these vendor prefixs documented?
> > 
> > Yes, they are in another patch series referenced in the cover letter.
> > They were added for the Anbernic devicetrees and should (I believe)
> > land in 6.1.
> 
> OK... you still need to test your bindings. Your patch was clearly not
> tested before sending. :(

I did: yamllint, make dt_binding_check (with DT_SCHEMA_FILES specified), and
make dtbs_check (with DT_SCHEMA_FILES specified again). That's the proper
testing flow correct? In this case it's the pre-requisite that's causing
the issue as I see on a pristine master tree I'm warned about the missing
vendor prefix for anbernic. Should I wait for that to go upstream before
I submit this again?

I'll make the other change about the space and the description of the
vdd-supply when I resubmit. Are we good with the panel compatibles? I'm
still not entirely sure the best thing to name them as I have no part
number whatsoever except the driver IC.

Thank you.

> 
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski Sept. 21, 2022, 3:57 p.m. UTC | #4
On 21/09/2022 17:50, Chris Morgan wrote:
> On Wed, Sep 21, 2022 at 05:21:19PM +0200, Krzysztof Kozlowski wrote:
>> On 21/09/2022 16:38, Chris Morgan wrote:
>>>>> +  compatible:
>>>>> +    items:
>>>>> +      - enum:
>>>>> +          - anbernic,rg353p-panel
>>>>
>>>> Are these vendor prefixs documented?
>>>
>>> Yes, they are in another patch series referenced in the cover letter.
>>> They were added for the Anbernic devicetrees and should (I believe)
>>> land in 6.1.
>>
>> OK... you still need to test your bindings. Your patch was clearly not
>> tested before sending. :(
> 
> I did: yamllint, make dt_binding_check (with DT_SCHEMA_FILES specified), and
> make dtbs_check (with DT_SCHEMA_FILES specified again). 

I have doubts. So if you say you did it, then you probably did not look
at the results... or whatever other reason the test was not effective,
because your binding cannot pass the dt_binding_check.

> That's the proper
> testing flow correct? In this case it's the pre-requisite that's causing
> the issue as I see on a pristine master tree I'm warned about the missing
> vendor prefix for anbernic. Should I wait for that to go upstream before
> I submit this again?

Not really. The testing fails on wrong compatible in example.

Best regards,
Krzysztof
Chris Morgan Sept. 21, 2022, 4:17 p.m. UTC | #5
On Wed, Sep 21, 2022 at 05:57:55PM +0200, Krzysztof Kozlowski wrote:
> On 21/09/2022 17:50, Chris Morgan wrote:
> > On Wed, Sep 21, 2022 at 05:21:19PM +0200, Krzysztof Kozlowski wrote:
> >> On 21/09/2022 16:38, Chris Morgan wrote:
> >>>>> +  compatible:
> >>>>> +    items:
> >>>>> +      - enum:
> >>>>> +          - anbernic,rg353p-panel
> >>>>
> >>>> Are these vendor prefixs documented?
> >>>
> >>> Yes, they are in another patch series referenced in the cover letter.
> >>> They were added for the Anbernic devicetrees and should (I believe)
> >>> land in 6.1.
> >>
> >> OK... you still need to test your bindings. Your patch was clearly not
> >> tested before sending. :(
> > 
> > I did: yamllint, make dt_binding_check (with DT_SCHEMA_FILES specified), and
> > make dtbs_check (with DT_SCHEMA_FILES specified again). 
> 
> I have doubts. So if you say you did it, then you probably did not look
> at the results... or whatever other reason the test was not effective,
> because your binding cannot pass the dt_binding_check.
> 
> > That's the proper
> > testing flow correct? In this case it's the pre-requisite that's causing
> > the issue as I see on a pristine master tree I'm warned about the missing
> > vendor prefix for anbernic. Should I wait for that to go upstream before
> > I submit this again?
> 
> Not really. The testing fails on wrong compatible in example.

My mistake, I see what I did wrong and apologize for the trouble. I
misinterpreted the error I did get (I expected an issue with a missing
vendor string, but as you correctly point out the received error is
not for that). I'll correct and resend. Would you be so kind as to
confirm if you're okay with the "anbernic,rg353-panel", "newvision,nv3051d"
strings?

Thank you once again and I apologize for my mistake.

> 
> Best regards,
> Krzysztof
>
Chris Morgan Sept. 24, 2022, 5:51 p.m. UTC | #6
On Sat, Sep 24, 2022 at 12:07:44PM -0500, Rob Herring wrote:
> On Tue, Sep 20, 2022 at 09:59:04AM -0500, Chris Morgan wrote:
> > From: Chris Morgan <macromorgan@hotmail.com>
> > 
> > Add documentation for the NewVision NV3051D panel bindings.
> > Note that for the two expected consumers of this panel binding
> > the underlying LCD model is unknown. Name "anbernic,rg353p-panel"
> > is used because the hardware itself is known as "anbernic,rg353p".
> > 
> > Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> > ---
> >  .../display/panel/newvision,nv3051d.yaml      | 55 +++++++++++++++++++
> >  1 file changed, 55 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml b/Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml
> > new file mode 100644
> > index 000000000000..d90bca4171c2
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml
> > @@ -0,0 +1,55 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevicetree.org%2Fschemas%2Fdisplay%2Fpanel%2Fnewvision%2Cnv3051d.yaml%23&amp;data=05%7C01%7C%7C4f204345128d4cb827ca08da9e4f4d06%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637996360672620588%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=9%2B66S0t1p9EqWBdmaLBj8pKte2fjzsmL%2FSbmmD8eNi0%3D&amp;reserved=0
> > +$schema: https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevicetree.org%2Fmeta-schemas%2Fcore.yaml%23&amp;data=05%7C01%7C%7C4f204345128d4cb827ca08da9e4f4d06%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637996360672620588%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=r%2BzTHlte226t9fXktNC9k4NO%2FE2RomRIxuWBuRshIw0%3D&amp;reserved=0
> > +
> > +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.
> > +
> > +maintainers:
> > +  - Chris Morgan <macromorgan@hotmail.com>
> > +
> > +allOf:
> > +  - $ref: panel-common.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    items:
> > +      - enum:
> > +          - anbernic,rg353p-panel
> > +          - anbernic,rg353v-panel
> 
> Is 'panel' redundant? IOW, could 'rg353v' identify something else other 
> than the panel?

It is not redundant, the device itself is identified as "anbernic,rg353v".
I don't have a part number for the LCD panel itself, only the controller IC.

Thank you.

> 
> Rob