From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 6BBEDB7255 for ; Sat, 20 Jun 2009 01:31:56 +1000 (EST) MIME-Version: 1.0 In-Reply-To: <20090619132501.GA10886@oksana.dev.rtsoft.ru> References: <4A39DC80.7030906@arvoo.nl> <20090618130955.GA1369@oksana.dev.rtsoft.ru> <20090619132501.GA10886@oksana.dev.rtsoft.ru> From: Grant Likely Date: Fri, 19 Jun 2009 09:31:33 -0600 Message-ID: Subject: Re: [PATCH -mm][POWERPC] mpc8xxx : allow SPI without cs. To: avorontsov@ru.mvista.com Content-Type: text/plain; charset=ISO-8859-1 Cc: spi-devel-general@lists.sourceforge.net, Rini van Zetten , linuxppc-dev list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, Jun 19, 2009 at 7:25 AM, Anton Vorontsov wrote: > Surely we can hide the bridge into the SPI controller driver, > but I think it would be beneficial to "factor-out" it to a > stand-alone entity, so that other SPI controllers could work > with this setup without any modifications (oh and btw, we could > also create a bridge called "gpio-chipselects-bridge", and > factor out all GPIO stuff from the drivers). > > There are two options of how we can factor out chip-select > machines... the bad and the ugly. :-) No, the first one is bad, > but the second should be OK. [...] > 2. Another option (which I like more), is to create "SPI chip- > =A0 select machine driver framework", so we could (finally) > =A0 separate two SPI entities: SPI IO and SPI chip-select machine. > =A0 CS machines of different flavours: GPIO, built-in, and > =A0 board-specific (!) with a lot of demuxing magic. I agree, I think your option 2 is the way to go. It would probably need to be implemented as some form of logical bridge so that SPI requests don't go straight to the IO driver, but first go through the CS machine so that the CS driver can do funky stuff like inserting or modifying SPI requests before they go to the hardware. g. --=20 Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.