public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: [RFT PATCH] SuperH HSPI controller driver.
Date: Mon, 04 Aug 2008 05:49:03 +0000	[thread overview]
Message-ID: <20080804054903.GB11682@linux-sh.org> (raw)
In-Reply-To: <20080721090744.GA16714@roarinelk.homelinux.net>

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 <mano@roarinelk.homelinux.net>
> > 
> > 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 <linux/spi/spi_bitbang.h>
 
 #include <asm/clock.h>
-#include <asm/spi_hspi.h>
+#include <asm/spi.h>
 
 #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;
 

      parent reply	other threads:[~2008-08-04  5:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21  9:07 [RFT PATCH] SuperH HSPI controller driver Manuel Lauss
2008-07-21 12:39 ` Paul Mundt
2008-07-21 12:46 ` Manuel Lauss
     [not found] ` <20080721090744.GA16714-nEyxjcs6f3Vin2gBucwGBecsttgLyre6@public.gmane.org>
2008-08-03 23:52   ` Paul Mundt
2008-08-03 23:57 ` Paul Mundt
2008-08-04  5:49 ` Paul Mundt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080804054903.GB11682@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox