+ spi-earlier-initialization-of-spi_devicemode.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     spi: earlier initialization of spi_device.mode

has been added to the -mm tree.  Its filename is

     spi-earlier-initialization-of-spi_devicemode.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: spi: earlier initialization of spi_device.mode
From: David Brownell <david-b@xxxxxxxxxxx>

Add earlier initialization of spi_device.mode, as needed on boards using
nondefault chipselect polarity.  An example would be ones using the RS5C348
RTC without an external signal inverter between the RTC chipselect and the
SPI controller.

Without this mechanism, the first setup() call for that chip would wrongly
enable chips, corrupting transfers to/from other chips sharing that SPI
bus.

Signed-off-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>
Cc: Atsushi Nemoto <anemo@xxxxxxxxxxxxx>
Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/spi/spi.c       |    1 +
 include/linux/spi/spi.h |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff -puN drivers/spi/spi.c~spi-earlier-initialization-of-spi_devicemode drivers/spi/spi.c
--- a/drivers/spi/spi.c~spi-earlier-initialization-of-spi_devicemode
+++ a/drivers/spi/spi.c
@@ -210,6 +210,7 @@ spi_new_device(struct spi_master *master
 	proxy->master = master;
 	proxy->chip_select = chip->chip_select;
 	proxy->max_speed_hz = chip->max_speed_hz;
+	proxy->mode = chip->mode;
 	proxy->irq = chip->irq;
 	proxy->modalias = chip->modalias;
 
diff -puN include/linux/spi/spi.h~spi-earlier-initialization-of-spi_devicemode include/linux/spi/spi.h
--- a/include/linux/spi/spi.h~spi-earlier-initialization-of-spi_devicemode
+++ a/include/linux/spi/spi.h
@@ -642,10 +642,14 @@ struct spi_board_info {
 	u16		bus_num;
 	u16		chip_select;
 
+	/* mode becomes spi_device.mode, and is essential for chips
+	 * where the default of SPI_CS_HIGH = 0 is wrong.
+	 */
+	u8		mode;
+
 	/* ... may need additional spi_device chip config data here.
 	 * avoid stuff protocol drivers can set; but include stuff
 	 * needed to behave without being bound to a driver:
-	 *  - chipselect polarity
 	 *  - quirks like clock rate mattering when not selected
 	 */
 };
_

Patches currently in -mm which might be from david-b@xxxxxxxxxxx are

origin.patch
rtc-add-rtc-rs5c348-driver.patch
git-pcmcia.patch
ehci-fix-bogus-alteration-of-a-local-variable.patch
fix-broken-dubious-driver-suspend-methods.patch
pm-define-pm_event_prethaw.patch
pm-pci-and-ide-handle-pm_event_prethaw.patch
pm-video-drivers-and-pm_event_prethaw.patch
pm-usb-hcds-use-pm_event_prethaw.patch
pm-issue-pm_event_prethaw.patch
spi-earlier-initialization-of-spi_devicemode.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux