[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <21942343-5e76-2fa3-b394-c1cef4abd9e1@microchip.com>
Date: Fri, 1 Mar 2019 10:07:02 +0000
From: <Claudiu.Beznea@...rochip.com>
To: <sam@...nborg.org>
CC: <lee.jones@...aro.org>, <robh+dt@...nel.org>,
<mark.rutland@....com>, <Nicolas.Ferre@...rochip.com>,
<alexandre.belloni@...tlin.com>, <Ludovic.Desroches@...rochip.com>,
<bbrezillon@...nel.org>, <airlied@...ux.ie>, <daniel@...ll.ch>,
<thierry.reding@...il.com>, <devicetree@...r.kernel.org>,
<linux-pwm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<dri-devel@...ts.freedesktop.org>,
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 1/7] drm: atmel-hlcdc: add config option for clock
selection
On 28.02.2019 23:25, Sam Ravnborg wrote:
> Hi Claudiu
>
> On Wed, Feb 27, 2019 at 04:24:16PM +0000, Claudiu.Beznea@...rochip.com wrote:
>> From: Claudiu Beznea <claudiu.beznea@...rochip.com>
>>
>> SAM9x60 LCD Controller has no option to select clock source as previous
>> controllers have. To be able to use the same driver even for this LCD
>> controller add a config option to know if controller supports this.
>>
>> Signed-off-by: Claudiu Beznea <claudiu.beznea@...rochip.com>
>> ---
>> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 12 +++++++-----
>> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h | 2 ++
>> 2 files changed, 9 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
>> index 8070a558d7b1..17a7a18f6a07 100644
>> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
>> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
>> @@ -78,7 +78,8 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_crtc *c)
>> unsigned long mode_rate;
>> struct videomode vm;
>> unsigned long prate;
>> - unsigned int cfg;
>> + unsigned int mask = ATMEL_HLCDC_CLKDIV_MASK | ATMEL_HLCDC_CLKPOL;
>> + unsigned int cfg = 0;
>> int div;
> Here cfg and mask has initial values.
>
>>
>> vm.vfront_porch = adj->crtc_vsync_start - adj->crtc_vdisplay;
>> @@ -101,7 +102,10 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_crtc *c)
>> (adj->crtc_hdisplay - 1) |
>> ((adj->crtc_vdisplay - 1) << 16));
>>
>> - cfg = ATMEL_HLCDC_CLKSEL;
>> + if (!crtc->dc->desc->fixed_clksrc) {
>> + cfg = ATMEL_HLCDC_CLKSEL;
>> + mask |= ATMEL_HLCDC_CLKSEL;
>> + }
> And here mask is bitwise or with ATMEL_HLCDC_CLKSEL - fine.
> But cfg is directly assigned.
I directly assigned it here because it was the first time it was used.
I will use a "|" operation as you suggest in next version.
> If cfg was bitwise or the ATMEL_HLCDC_CLKSEL value then the code was prepared
> to have extra flags added above these lines.
>
> Only a small change and no functional difference.
>
> With or without this change:
> Reviewed-by: Sam Ravnborg <sam@...nborg.org>
>
>
Powered by blists - more mailing lists