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

Anatolij Gustschin agust at denx.de
Wed Feb 4 21:28:51 CET 2009


Hello Guennadi,

> diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
> index 9267341..eacd36c 100644
> --- a/drivers/spi/mxc_spi.c
> +++ b/drivers/spi/mxc_spi.c
<snip>
> @@ -91,6 +94,9 @@ static u32 spi_xchg_single(struct spi_slave *slave, u32 data,
>  	struct mxc_spi_slave *mxcs = to_mxc_spi_slave(slave);
>  	unsigned int cfg_reg = reg_read(mxcs->base + MXC_CSPICTRL);
>  
> +	if (mxcs->gpio > 0 && (flags & SPI_XFER_BEGIN))
> +		mx31_gpio_set(mxcs->gpio, !!(mxcs->ctrl_reg & MXC_CSPICTRL_SSPOL));

above line to long (> 80 chars).

Also you add mx31_gpio_* calls from the new mx31 GPIO driver to
this driver unconditionally. I think, this will break linking
for imx31_litekit and mx31ads boards as these boards include the
mxc_spi driver but do not define CONFIG_MX31_GPIO. How can we
separate this? Or am I missing something?

> @@ -100,6 +106,9 @@ static u32 spi_xchg_single(struct spi_slave *slave, u32 data,
>  	while (reg_read(mxcs->base + MXC_CSPICTRL) & MXC_CSPICTRL_XCH)
>  		;
>  
> +	if (mxcs->gpio > 0 && (flags & SPI_XFER_END))
> +		mx31_gpio_set(mxcs->gpio, !(mxcs->ctrl_reg & MXC_CSPICTRL_SSPOL));

above line to long (> 80 chars).

Best regargs,
Anatolij



More information about the U-Boot mailing list