From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Tue, 05 Feb 2008 11:51:56 -0500 Subject: [U-Boot-Users] [PATCH v2] spi: Kill spi_chipsel table and introduce spi_setup() In-Reply-To: <1202214493-11719-1-git-send-email-hskinnemoen@atmel.com> References: <1202214493-11719-1-git-send-email-hskinnemoen@atmel.com> Message-ID: <47A8942C.4010506@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Haavard Skinnemoen wrote: > No need to add an extra layer of indirection and externals all over > the place. Just let the board code define two functions, > spi_cs_activate() and spi_cs_deactivate, and use them to do any > board-specific magic with the chipselects. > > Not all drivers may need those extra functions however. If that's the > case, the board code may just leave them out (assuming they know what > the driver needs) or rely on the linker to strip them out (assuming > --gc-sections is being used.) > > Also introduce a new function, spi_setup(), which must be called to > initialize communications parameters for a given slave. This function > will also check if the given chipselect id is valid. The driver may > call spi_cs_is_valid(), which is defined by the board code if > necessary, to verify that a given chipselect id is valid on the > current board. > > Changed in v2: > - Convert the mpc8xxx_spi driver and the mpc8349emds board to the > new API. > > Signed-off-by: Haavard Skinnemoen > --- > I haven't tested if the boards affected by this patch still work, or > even build, so use with care. I'd very much like some feedback on > whether this API change is a good thing or not though. > Thanks Haavard! I'll try this out on the MPC8349EMDS some time today or tonight. regards, Ben