2023-07-18 08:56:00

by Robert Foss

[permalink] [raw]
Subject: Re: [PATCH v3] drm: adv7511: Fix low refresh rate register for ADV7533/5

On Tue, Jul 18, 2023 at 10:42 AM Alexandru Ardelean <[email protected]> wrote:
>
> From: Bogdan Togorean <[email protected]>
>
> For ADV7533 and ADV7535 low refresh rate is selected using
> bits [3:2] of 0x4a main register.
> So depending on ADV model write 0xfb or 0x4a register.
>
> Fixes: 2437e7cd88e8 ("drm/bridge: adv7533: Initial support for ADV7533")
> Reviewed-by: Nuno Sa <[email protected]>
> Signed-off-by: Bogdan Togorean <[email protected]>
> Signed-off-by: Alexandru Ardelean <[email protected]>
> ---
>
> Changelog v2 -> v3:
> * https://lore.kernel.org/dri-devel/[email protected]/T/#u
> * Added my S-o-b tag back
>
> Changelog v1 -> v2:
> * https://lore.kernel.org/dri-devel/[email protected]/
> * added Fixes: tag
> * added Reviewed-by: tag for Nuno
>
>
> drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> index ddceafa7b637..09290a377957 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -786,8 +786,13 @@ static void adv7511_mode_set(struct adv7511 *adv7511,
> else
> low_refresh_rate = ADV7511_LOW_REFRESH_RATE_NONE;
>
> - regmap_update_bits(adv7511->regmap, 0xfb,
> - 0x6, low_refresh_rate << 1);
> + if (adv7511->type == ADV7511)
> + regmap_update_bits(adv7511->regmap, 0xfb,
> + 0x6, low_refresh_rate << 1);
> + else
> + regmap_update_bits(adv7511->regmap, 0x4a,
> + 0xc, low_refresh_rate << 2);
> +
> regmap_update_bits(adv7511->regmap, 0x17,
> 0x60, (vsync_polarity << 6) | (hsync_polarity << 5));
>
> --
> 2.41.0
>

This looks good, but I'm seeing some checkpatch style warnings, with
those fixed feel free to add my r-b.

CHECK: Alignment should match open parenthesis
#32: FILE: drivers/gpu/drm/bridge/adv7511/adv7511_drv.c:791:
+ regmap_update_bits(adv7511->regmap, 0xfb,
+ 0x6, low_refresh_rate << 1);

CHECK: Alignment should match open parenthesis
#35: FILE: drivers/gpu/drm/bridge/adv7511/adv7511_drv.c:794:
+ regmap_update_bits(adv7511->regmap, 0x4a,
+ 0xc, low_refresh_rate << 2);

total: 0 errors, 0 warnings, 2 checks, 15 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

Commit 1955dfe734e4 ("drm: adv7511: Fix low refresh rate register for
ADV7533/5") has style problems, please review.

NOTE: If any of the errors are false positives, please report


2023-07-18 12:04:35

by Alexandru Ardelean

[permalink] [raw]
Subject: Re: [PATCH v3] drm: adv7511: Fix low refresh rate register for ADV7533/5

On Tue, Jul 18, 2023 at 11:50 AM Robert Foss <[email protected]> wrote:
>
> On Tue, Jul 18, 2023 at 10:42 AM Alexandru Ardelean <[email protected]> wrote:
> >
> > From: Bogdan Togorean <[email protected]>
> >
> > For ADV7533 and ADV7535 low refresh rate is selected using
> > bits [3:2] of 0x4a main register.
> > So depending on ADV model write 0xfb or 0x4a register.
> >
> > Fixes: 2437e7cd88e8 ("drm/bridge: adv7533: Initial support for ADV7533")
> > Reviewed-by: Nuno Sa <[email protected]>
> > Signed-off-by: Bogdan Togorean <[email protected]>
> > Signed-off-by: Alexandru Ardelean <[email protected]>
> > ---
> >
> > Changelog v2 -> v3:
> > * https://lore.kernel.org/dri-devel/[email protected]/T/#u
> > * Added my S-o-b tag back
> >
> > Changelog v1 -> v2:
> > * https://lore.kernel.org/dri-devel/[email protected]/
> > * added Fixes: tag
> > * added Reviewed-by: tag for Nuno
> >
> >
> > drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 9 +++++++--
> > 1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > index ddceafa7b637..09290a377957 100644
> > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > @@ -786,8 +786,13 @@ static void adv7511_mode_set(struct adv7511 *adv7511,
> > else
> > low_refresh_rate = ADV7511_LOW_REFRESH_RATE_NONE;
> >
> > - regmap_update_bits(adv7511->regmap, 0xfb,
> > - 0x6, low_refresh_rate << 1);
> > + if (adv7511->type == ADV7511)
> > + regmap_update_bits(adv7511->regmap, 0xfb,
> > + 0x6, low_refresh_rate << 1);
> > + else
> > + regmap_update_bits(adv7511->regmap, 0x4a,
> > + 0xc, low_refresh_rate << 2);
> > +
> > regmap_update_bits(adv7511->regmap, 0x17,
> > 0x60, (vsync_polarity << 6) | (hsync_polarity << 5));
> >
> > --
> > 2.41.0
> >
>
> This looks good, but I'm seeing some checkpatch style warnings, with
> those fixed feel free to add my r-b.

Thanks.
Will do.
May I ask what options you are using for checkpatch.pl?
I don't seem to get those warnings.
And I'm basing on an "exynos-drm-fixes"branch from here
https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git/
(I'll admit it may not be the correct branch)

# /scripts/checkpatch.pl
v3-0001-drm-adv7511-Fix-low-refresh-rate-register-for-ADV.patch
total: 0 errors, 0 warnings, 15 lines checked

v3-0001-drm-adv7511-Fix-low-refresh-rate-register-for-ADV.patch has no
obvious style problems and is ready for submission.


>
> CHECK: Alignment should match open parenthesis
> #32: FILE: drivers/gpu/drm/bridge/adv7511/adv7511_drv.c:791:
> + regmap_update_bits(adv7511->regmap, 0xfb,
> + 0x6, low_refresh_rate << 1);
>
> CHECK: Alignment should match open parenthesis
> #35: FILE: drivers/gpu/drm/bridge/adv7511/adv7511_drv.c:794:
> + regmap_update_bits(adv7511->regmap, 0x4a,
> + 0xc, low_refresh_rate << 2);
>
> total: 0 errors, 0 warnings, 2 checks, 15 lines checked
>
> NOTE: For some of the reported defects, checkpatch may be able to
> mechanically convert to the typical style using --fix or --fix-inplace.
>
> Commit 1955dfe734e4 ("drm: adv7511: Fix low refresh rate register for
> ADV7533/5") has style problems, please review.
>
> NOTE: If any of the errors are false positives, please report

2023-07-18 12:29:47

by Nuno Sá

[permalink] [raw]
Subject: Re: [PATCH v3] drm: adv7511: Fix low refresh rate register for ADV7533/5

On Tue, 2023-07-18 at 14:45 +0300, Alexandru Ardelean wrote:
> On Tue, Jul 18, 2023 at 11:50 AM Robert Foss <[email protected]> wrote:
> >
> > On Tue, Jul 18, 2023 at 10:42 AM Alexandru Ardelean <[email protected]>
> > wrote:
> > >
> > > From: Bogdan Togorean <[email protected]>
> > >
> > > For ADV7533 and ADV7535 low refresh rate is selected using
> > > bits [3:2] of 0x4a main register.
> > > So depending on ADV model write 0xfb or 0x4a register.
> > >
> > > Fixes: 2437e7cd88e8 ("drm/bridge: adv7533: Initial support for ADV7533")
> > > Reviewed-by: Nuno Sa <[email protected]>
> > > Signed-off-by: Bogdan Togorean <[email protected]>
> > > Signed-off-by: Alexandru Ardelean <[email protected]>
> > > ---
> > >
> > > Changelog v2 -> v3:
> > > *
> > > https://lore.kernel.org/dri-devel/[email protected]/T/#u
> > > * Added my S-o-b tag back
> > >
> > > Changelog v1 -> v2:
> > > *
> > > https://lore.kernel.org/dri-devel/[email protected]/
> > > * added Fixes: tag
> > > * added Reviewed-by: tag for Nuno
> > >
> > >
> > >  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 9 +++++++--
> > >  1 file changed, 7 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > > b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > > index ddceafa7b637..09290a377957 100644
> > > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > > @@ -786,8 +786,13 @@ static void adv7511_mode_set(struct adv7511 *adv7511,
> > >         else
> > >                 low_refresh_rate = ADV7511_LOW_REFRESH_RATE_NONE;
> > >
> > > -       regmap_update_bits(adv7511->regmap, 0xfb,
> > > -               0x6, low_refresh_rate << 1);
> > > +       if (adv7511->type == ADV7511)
> > > +               regmap_update_bits(adv7511->regmap, 0xfb,
> > > +                       0x6, low_refresh_rate << 1);
> > > +       else
> > > +               regmap_update_bits(adv7511->regmap, 0x4a,
> > > +                       0xc, low_refresh_rate << 2);
> > > +
> > >         regmap_update_bits(adv7511->regmap, 0x17,
> > >                 0x60, (vsync_polarity << 6) | (hsync_polarity << 5));
> > >
> > > --
> > > 2.41.0
> > >
> >
> > This looks good, but I'm seeing some checkpatch style warnings, with
> > those fixed feel free to add my r-b.
>
> Thanks.
> Will do.
> May I ask what options you are using for checkpatch.pl?

'--strict' should trigger those CHECKS...

Cool enough (or not) it seems the option is not really there when you type 
--help


- Nuno Sá