From: Wolfgang Denk Date: Wed, 04 Feb 2009 22:34:46 +0100 Subject: [U-Boot] [PATCH 3/9] i.MX31: support GPIO as a chip-select in the mxc_spi driver In-Reply-To: References: Message-ID: <20090204213446.5A7038322908@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Guennadi Liakhovetski, In message 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 ... > + 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