[PATCH 1/2] video: Add i.MX23/28 framebuffer driver

Li Frank-B20596 B20596 at freescale.com
Thu Feb 10 05:08:04 EST 2011


> Li Frank-B20596 wrote:
> > > +
> > > +	/* if it was disabled, re-enable the mode again */
> > > +	reg = readl(host->base + CTRL);
> > > +	reg |= CTRL_DOTCLK_MODE;
> > > +	writel(reg, host->base + CTRL);
> >
> > writel(CTRL_DOTCLK_MODE, host->base + CTRL_SET)
> > CTRL_SET is CTRL+0x4
> > SET and CLR register is easier than Read and write back.
> 
> But you must always check, if the register really has such a SET and
> CLEAR
> feature. Not all registers have this feature...

That's a reason why I suggest use register header that generate from xml. 
HW_XX_CTRL_SET will exist if there are such register in hardware.
If hardware have not such register, there are not _SET and _CLR. 

Compiler will report error if user use _SET but hardware not such register. 

> 
> But in this case you are right.
> 
> But I would prefer:
> #define SET 4
> #define CLEAR 8
> [...]
> writel(CTRL_DOTCLK_MODE, host->base + CTRL + SET)
> :-)
> 
> Regards,
> Juergen





More information about the linux-arm-kernel mailing list