public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: david-b@pacbell.net
Subject: [PATCH] spi: misc fixes
Date: Fri, 13 Jan 2006 16:46:33 -0800	[thread overview]
Message-ID: <11371995933018@kroah.com> (raw)
In-Reply-To: <11371995933258@kroah.com>

[PATCH] spi: misc fixes

This collects some small SPI patches that seem to be missing from the MM tree:

  - spi_butterfly kbuild hooks got dropped somehow; this restores them
  - quick fix for a (theoretical?) m25p80_write() oops noted by Andrew
  - quick fix for a potential config-specific oops for mtd_dataflash()
  - minor doc tweaks

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 7111763d391b0c5a949a4f2575aa88cd585f0ff6
tree 376eef5003b71c6445c02bbe87950b2e365e0758
parent 8275c642ccdce09a2146d0a9eb022e3698ee927e
author David Brownell <david-b@pacbell.net> Sun, 08 Jan 2006 13:34:29 -0800
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 13 Jan 2006 16:29:56 -0800

 Documentation/spi/spi-summary       |   13 +++++++++++++
 drivers/mtd/devices/m25p80.c        |    4 +++-
 drivers/mtd/devices/mtd_dataflash.c |    2 +-
 drivers/spi/Kconfig                 |   10 ++++++++++
 drivers/spi/Makefile                |    1 +
 5 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary
index 761debf..a5ffba3 100644
--- a/Documentation/spi/spi-summary
+++ b/Documentation/spi/spi-summary
@@ -115,6 +115,9 @@ shows up in sysfs in several locations:
    /sys/devices/.../CTLR/spiB.C ... spi_device for on bus "B",
 	chipselect C, accessed through CTLR.
 
+   /sys/devices/.../CTLR/spiB.C/modalias ... identifies the driver
+	that should be used with this device (for hotplug/coldplug)
+
    /sys/bus/spi/devices/spiB.C ... symlink to the physical
    	spiB-C device
 
@@ -247,6 +250,12 @@ driver is registered:
 
 Like with other static board-specific setup, you won't unregister those.
 
+The widely used "card" style computers bundle memory, cpu, and little else
+onto a card that's maybe just thirty square centimeters.  On such systems,
+your arch/.../mach-.../board-*.c file would primarily provide information
+about the devices on the mainboard into which such a card is plugged.  That
+certainly includes SPI devices hooked up through the card connectors!
+
 
 NON-STATIC CONFIGURATIONS
 
@@ -258,6 +267,10 @@ up the spi bus master, and will likely n
 board info based on the board that was hotplugged.  Of course, you'd later
 call at least spi_unregister_device() when that board is removed.
 
+When Linux includes support for MMC/SD/SDIO/DataFlash cards through SPI, those
+configurations will also be dynamic.  Fortunately, those devices all support
+basic device identification probes, so that support should hotplug normally.
+
 
 How do I write an "SPI Protocol Driver"?
 ----------------------------------------
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 45108ed..d5f2408 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -378,7 +378,9 @@ static int m25p80_write(struct mtd_info 
 
 			spi_sync(flash->spi, &m);
 
-			*retlen += m.actual_length - sizeof(flash->command);
+			if (retlen)
+				*retlen += m.actual_length
+					- sizeof(flash->command);
 	        }
  	}
 
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 99d3a03..155737e 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -508,7 +508,7 @@ add_dataflash(struct spi_device *spi, ch
 			priv->partitioned = 1;
 			return add_mtd_partitions(device, parts, nr_parts);
 		}
-	} else if (pdata->nr_parts)
+	} else if (pdata && pdata->nr_parts)
 		dev_warn(&spi->dev, "ignoring %d default partitions on %s\n",
 				pdata->nr_parts, device->name);
 
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 9b21c5d..7a75fae 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -65,6 +65,16 @@ config SPI_BITBANG
 	  need it.  You only need to select this explicitly to support driver
 	  modules that aren't part of this kernel tree.
 
+config SPI_BUTTERFLY
+	tristate "Parallel port adapter for AVR Butterfly (DEVELOPMENT)"
+	depends on SPI_MASTER && PARPORT && EXPERIMENTAL
+	select SPI_BITBANG
+	help
+	  This uses a custom parallel port cable to connect to an AVR
+	  Butterfly <http://www.atmel.com/products/avr/butterfly>, an
+	  inexpensive battery powered microcontroller evaluation board.
+	  This same cable can be used to flash new firmware.
+
 #
 # Add new SPI master controllers in alphabetical order above this line
 #
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index 5da6a4d..c2c87e8 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_SPI_MASTER)		+= spi.o
 
 # SPI master controller drivers (bus)
 obj-$(CONFIG_SPI_BITBANG)		+= spi_bitbang.o
+obj-$(CONFIG_SPI_BUTTERFLY)		+= spi_butterfly.o
 # 	... add above this line ...
 
 # SPI protocol drivers (device/link on bus)


  reply	other threads:[~2006-01-14 21:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-14  0:44 [GIT PATCH] SPI patches for 2.6.15 Greg KH
2006-01-14  0:46 ` [PATCH] spi: mtd dataflash driver Greg KH
2006-01-14  0:46   ` [PATCH] spi: simple SPI framework Greg KH
2006-01-14  0:46     ` [PATCH] spi: add spi_driver to " Greg KH
2006-01-14  0:46       ` [PATCH] spi: ads7846 driver Greg KH
2006-01-14  0:46         ` [PATCH] SPI core tweaks, bugfix Greg KH
2006-01-14  0:46           ` [PATCH] spi: ads7836 uses spi_driver Greg KH
2006-01-14  0:46             ` [PATCH] spi: M25 series SPI flash Greg KH
2006-01-14  0:46               ` [PATCH] spi: add spi_bitbang driver Greg KH
2006-01-14  0:46                 ` [PATCH] SPI: add spi_butterfly driver Greg KH
2006-01-14  0:46                   ` [PATCH] spi: remove fastcall crap Greg KH
2006-01-14  0:46                     ` Greg KH [this message]
2006-01-14  0:46                       ` [PATCH] spi: use linked lists rather than an array Greg KH
2006-01-14  4:48 ` [GIT PATCH] SPI patches for 2.6.15 Kalin KOZHUHAROV
2006-01-14 11:20   ` Kay Sievers
2006-01-14 23:56     ` Kalin KOZHUHAROV
     [not found]     ` <fa.fl6o99l.132m0gn@ifi.uio.no>
2006-01-15 14:27       ` Kai Henningsen
2006-01-16  2:30         ` Kalin KOZHUHAROV

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=11371995933018@kroah.com \
    --to=gregkh@suse.de \
    --cc=david-b@pacbell.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@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