[U-Boot] [PATCH 3/9] i.MX31: support GPIO as a chip-select in the mxc_spi driver

Wolfgang Denk wd at denx.de
Wed Feb 4 22:34:46 CET 2009


Dear Guennadi Liakhovetski,

In message <Pine.LNX.4.64.0902041539490.6279 at axis700.grange> you wrote:
> Some SPI devices have special requirements on chip-select handling.
> With this patch we can use a GPIO as a chip-select and strictly follow
> the SPI_XFER_BEGIN and SPI_XFER_END flags.
> 
> Signed-off-by: Guennadi Liakhovetski <lg at denx.de>
...
> +	if (mxcs->gpio > 0 && (flags & SPI_XFER_BEGIN))
> +		mx31_gpio_set(mxcs->gpio, !!(mxcs->ctrl_reg & MXC_CSPICTRL_SSPOL));
> +

If you really need the '!!' then I consider the code to be broken.

Omit?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A woman should have compassion.
	-- Kirk, "Catspaw", stardate 3018.2


More information about the U-Boot mailing list