From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mundt Date: Mon, 04 Aug 2008 05:49:03 +0000 Subject: Re: [RFT PATCH] SuperH HSPI controller driver. Message-Id: <20080804054903.GB11682@linux-sh.org> List-Id: References: <20080721090744.GA16714@roarinelk.homelinux.net> In-Reply-To: <20080721090744.GA16714@roarinelk.homelinux.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-sh@vger.kernel.org On Mon, Aug 04, 2008 at 08:57:02AM +0900, Paul Mundt wrote: > On Mon, Aug 04, 2008 at 08:52:47AM +0900, Paul Mundt wrote: > > On Mon, Jul 21, 2008 at 11:07:44AM +0200, Manuel Lauss wrote: > > > Here is a very simple driver for the HSPI block on many SuperH processors. > > > I could only subject it to limited testings, as my sole SPI device here is > > > a write-only 8bit digital poti. It seems to do the right thing as far as > > > I could see on an oscilloscope. > > > > > > The driver doesn't do DMA and pushes/pops bytes one-at-a-time from/to fifos > > > (I'm going to fix that at a later time). > > > > > > Please test and comment! > > > > > > Thanks, > > > Manuel Lauss > > > > > > --- > > > > > > A simple driver for the HSPI block found on many SuperH processors. > > > > > > Signed-off-by: Manuel Lauss > > > > I have no outstanding issues with this, though I did just break it with > > the header reorg. If David is fine with it and wants to Ack it, I can > > take it through my tree. > > Taking a quick look at it again, I think you should be able to reuse > arch/sh/include/asm/spi.h as-is, and just drop the header you have now. This should do it. You could also use priv->pd->bus_num directly instead of referencing pdev->id, but I suppose it doesn't really matter. --- --- a/drivers/spi/spi_hspi.c 2008-08-04 14:46:01.000000000 +0900 +++ b/drivers/spi/spi_hspi.c 2008-08-04 14:45:51.000000000 +0900 @@ -22,7 +22,7 @@ #include #include -#include +#include #define SPCR 0x00 /* control */ #define SPSR 0x04 /* status */ @@ -89,13 +89,13 @@ struct device *dev; struct resource *ioarea; struct spi_master *master; - struct hspi_platdata *pd; + struct sh_spi_info *pd; }; static inline void hspi_platcs(struct hspi_priv *priv, int cs, int pol) { - if (priv->pd && priv->pd->set_cs) - priv->pd->set_cs(priv->pd, cs, pol); + if (priv->pd && priv->pd->chip_select) + priv->pd->chip_select(priv->pd, cs, pol); } static inline struct hspi_priv *to_priv(struct spi_device *sdev) @@ -353,7 +353,7 @@ goto out3; } - master->num_chipselect = priv->pd ? priv->pd->num_cs : 1; + master->num_chipselect = priv->pd ? priv->pd->num_chipselect : 1; master->bus_num = pdev->id; master->setup = hspi_setup;