diff mbox series

[1/4] media: rockchip/rga: add rk3228-rga to rockchip_rga_match[]

Message ID 20200120194158.25357-1-justin.swartz@risingedge.co.za (mailing list archive)
State New, archived
Headers show
Series [1/4] media: rockchip/rga: add rk3228-rga to rockchip_rga_match[] | expand

Commit Message

Justin Swartz Jan. 20, 2020, 7:41 p.m. UTC
Add an entry to the rockchip_rga_match array for "rockchip,rk3228-rga"

Signed-off-by: Justin Swartz <justin.swartz@risingedge.co.za>
---
 drivers/media/platform/rockchip/rga/rga.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Ezequiel Garcia Jan. 21, 2020, 10:45 a.m. UTC | #1
On Mon, 2020-01-20 at 19:41 +0000, Justin Swartz wrote:
> Add an entry to the rockchip_rga_match array for "rockchip,rk3228-rga"
> 
> Signed-off-by: Justin Swartz <justin.swartz@risingedge.co.za>
> ---
>  drivers/media/platform/rockchip/rga/rga.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c
> index e9ff12b6b..268116cd5 100644
> --- a/drivers/media/platform/rockchip/rga/rga.c
> +++ b/drivers/media/platform/rockchip/rga/rga.c
> @@ -956,6 +956,9 @@ static const struct dev_pm_ops rga_pm = {
>  
>  static const struct of_device_id rockchip_rga_match[] = {
>  	{
> +		.compatible = "rockchip,rk3228-rga",
> +	},

Unless you need to tune something in the driver
specifically for rk3228, then you don't need a
new compatible string.

As the name implies, it's just a "compatible",
so you may simply declare your rga dts node as
compatible to "rockchip,rk3288-rga".

(Of course, this means we shouldn't have added
the rk3399 compatible string.)

Regards,
Ezequiel
Justin Swartz Jan. 21, 2020, 11:51 a.m. UTC | #2
Hi Ezequiel,

On 2020-01-21 12:45, Ezequiel Garcia wrote:

> On Mon, 2020-01-20 at 19:41 +0000, Justin Swartz wrote:
> 
>> Add an entry to the rockchip_rga_match array for "rockchip,rk3228-rga"
>> 
>> Signed-off-by: Justin Swartz <justin.swartz@risingedge.co.za>
>> ---
>> drivers/media/platform/rockchip/rga/rga.c | 3 +++
>> 1 file changed, 3 insertions(+)
>> 
>> diff --git a/drivers/media/platform/rockchip/rga/rga.c 
>> b/drivers/media/platform/rockchip/rga/rga.c
>> index e9ff12b6b..268116cd5 100644
>> --- a/drivers/media/platform/rockchip/rga/rga.c
>> +++ b/drivers/media/platform/rockchip/rga/rga.c
>> @@ -956,6 +956,9 @@ static const struct dev_pm_ops rga_pm = {
>> 
>> static const struct of_device_id rockchip_rga_match[] = {
>> {
>> +        .compatible = "rockchip,rk3228-rga",
>> +    },
> 
> Unless you need to tune something in the driver
> specifically for rk3228, then you don't need a
> new compatible string.
> 
> As the name implies, it's just a "compatible",
> so you may simply declare your rga dts node as
> compatible to "rockchip,rk3288-rga".
> 
> (Of course, this means we shouldn't have added
> the rk3399 compatible string.)

Thank you for the clarification.
Heiko Stuebner Jan. 21, 2020, 1:01 p.m. UTC | #3
Hi Ezequiel,

Am Dienstag, 21. Januar 2020, 11:45:01 CET schrieb Ezequiel Garcia:
> On Mon, 2020-01-20 at 19:41 +0000, Justin Swartz wrote:
> > Add an entry to the rockchip_rga_match array for "rockchip,rk3228-rga"
> > 
> > Signed-off-by: Justin Swartz <justin.swartz@risingedge.co.za>
> > ---
> >  drivers/media/platform/rockchip/rga/rga.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c
> > index e9ff12b6b..268116cd5 100644
> > --- a/drivers/media/platform/rockchip/rga/rga.c
> > +++ b/drivers/media/platform/rockchip/rga/rga.c
> > @@ -956,6 +956,9 @@ static const struct dev_pm_ops rga_pm = {
> >  
> >  static const struct of_device_id rockchip_rga_match[] = {
> >  	{
> > +		.compatible = "rockchip,rk3228-rga",
> > +	},
> 
> Unless you need to tune something in the driver
> specifically for rk3228, then you don't need a
> new compatible string.
> 
> As the name implies, it's just a "compatible",
> so you may simply declare your rga dts node as
> compatible to "rockchip,rk3288-rga".
> 
> (Of course, this means we shouldn't have added
> the rk3399 compatible string.)

small correction, we normally do that in two parts in the dts,
	compatible = "rockchip,rk3228-rga", "rockchip,rk3288-rga"

etc. So the compatible needs to be added to binding document but
not necessarily to the driver but does leave us the option of later
defining that new compatible in the driver to handle quirks that may
be discovered later on, without needing to adapt existing devicetrees.


Heiko
Justin Swartz Jan. 21, 2020, 10:02 p.m. UTC | #4
This patchset aims to enable use of Rockchip's RGA, a 2D raster
graphic acceleration unit, on rk322x based devices.

Changed in v3:
  - Relocate rga node to the correct position in rk322x.dtsi, as
    indicated by Johan Jonker.

Changes in v2:
  - Remove unnecessary "rockchip,rk3228-rga" device tree compatibility
    string patch, as advised by Ezequiel Garcia.

  - Use both "rockchip,rk3228-rga" and "rockchip,rk3288-rga" in the
    rga node's compatibility property, as suggested by Heiko Stuebner.

Justin Swartz (2):
  ARM: dts: rockchip: add rga node for rk322x
  ARM: dts: rockchip: enable rga for rk3229-xms6

 arch/arm/boot/dts/rk3229-xms6.dts |  4 ++++
 arch/arm/boot/dts/rk322x.dtsi     | 11 +++++++++++
 2 files changed, 15 insertions(+)
Rob Herring (Arm) Feb. 3, 2020, 10:36 a.m. UTC | #5
On Tue, Jan 21, 2020 at 10:02:39PM +0000, Justin Swartz wrote:
> This patchset aims to enable use of Rockchip's RGA, a 2D raster
> graphic acceleration unit, on rk322x based devices.
> 
> Changed in v3:
>   - Relocate rga node to the correct position in rk322x.dtsi, as
>     indicated by Johan Jonker.
> 
> Changes in v2:
>   - Remove unnecessary "rockchip,rk3228-rga" device tree compatibility
>     string patch, as advised by Ezequiel Garcia.

Why's that? You're using the string still, it needs to be documented.

Rob
diff mbox series

Patch

diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c
index e9ff12b6b..268116cd5 100644
--- a/drivers/media/platform/rockchip/rga/rga.c
+++ b/drivers/media/platform/rockchip/rga/rga.c
@@ -956,6 +956,9 @@  static const struct dev_pm_ops rga_pm = {
 
 static const struct of_device_id rockchip_rga_match[] = {
 	{
+		.compatible = "rockchip,rk3228-rga",
+	},
+	{
 		.compatible = "rockchip,rk3288-rga",
 	},
 	{