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

Juergen Beisert jbe at pengutronix.de
Thu Feb 10 04:46:33 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...

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

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-8766-939 228     |
Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |



More information about the linux-arm-kernel mailing list