[Armadeus-commitlog] armadeus branch, master, updated. release-3.2-84-g944119a
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2010-01-05 14:55:01
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 944119a37c8adcdfc0a86a485d9b8ee587dacc2e (commit)
from 91167baad88cca9bfac6dd53d3ada69a24dcdcdc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 944119a37c8adcdfc0a86a485d9b8ee587dacc2e
Author: Fabien Marteau <fab...@ar...>
Date: Tue Jan 5 15:54:03 2010 +0100
[LINUX] Backport spi driver from 2.6.32.2 to use half duplex capabilities
-----------------------------------------------------------------------
Summary of changes:
.../349-armadeus-spi-backport_2.6.32.2.patch | 639 ++++++++++++++++++++
1 files changed, 639 insertions(+), 0 deletions(-)
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/349-armadeus-spi-backport_2.6.32.2.patch
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/349-armadeus-spi-backport_2.6.32.2.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/349-armadeus-spi-backport_2.6.32.2.patch
new file mode 100644
index 0000000..0d9bf0c
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/349-armadeus-spi-backport_2.6.32.2.patch
@@ -0,0 +1,639 @@
+Backport spi driver from 2.6.32.2 to use half duplex capabilities.
+
+Signed-off-by: Fabien Marteau <fab...@ar...>
+---
+
+Index: linux-2.6.29.6/drivers/spi/spi_bitbang.c
+===================================================================
+--- linux-2.6.29.6.orig/drivers/spi/spi_bitbang.c 2010-01-05 15:43:18.000000000 +0100
++++ linux-2.6.29.6/drivers/spi/spi_bitbang.c 2010-01-05 15:43:45.000000000 +0100
+@@ -188,12 +188,6 @@
+
+ bitbang = spi_master_get_devdata(spi->master);
+
+- /* Bitbangers can support SPI_CS_HIGH, SPI_3WIRE, and so on;
+- * add those to master->flags, and provide the other support.
+- */
+- if ((spi->mode & ~(SPI_CPOL|SPI_CPHA|bitbang->flags)) != 0)
+- return -EINVAL;
+-
+ if (!cs) {
+ cs = kzalloc(sizeof *cs, GFP_KERNEL);
+ if (!cs)
+@@ -201,9 +195,6 @@
+ spi->controller_state = cs;
+ }
+
+- if (!spi->bits_per_word)
+- spi->bits_per_word = 8;
+-
+ /* per-word shift register access, in hardware or bitbanging */
+ cs->txrx_word = bitbang->txrx_word[spi->mode & (SPI_CPOL|SPI_CPHA)];
+ if (!cs->txrx_word)
+@@ -213,9 +204,7 @@
+ if (retval < 0)
+ return retval;
+
+- dev_dbg(&spi->dev, "%s, mode %d, %u bits/w, %u nsec/bit\n",
+- __func__, spi->mode & (SPI_CPOL | SPI_CPHA),
+- spi->bits_per_word, 2 * cs->nsecs);
++ dev_dbg(&spi->dev, "%s, %u nsec/bit\n", __func__, 2 * cs->nsecs);
+
+ /* NOTE we _need_ to call chipselect() early, ideally with adapter
+ * setup, unless the hardware defaults cooperate to avoid confusion
+@@ -269,6 +258,11 @@
+ struct spi_bitbang *bitbang =
+ container_of(work, struct spi_bitbang, work);
+ unsigned long flags;
++ int do_setup = -1;
++ int (*setup_transfer)(struct spi_device *,
++ struct spi_transfer *);
++
++ setup_transfer = bitbang->setup_transfer;
+
+ spin_lock_irqsave(&bitbang->lock, flags);
+ bitbang->busy = 1;
+@@ -280,8 +274,6 @@
+ unsigned tmp;
+ unsigned cs_change;
+ int status;
+- int (*setup_transfer)(struct spi_device *,
+- struct spi_transfer *);
+
+ m = container_of(bitbang->queue.next, struct spi_message,
+ queue);
+@@ -298,19 +290,19 @@
+ tmp = 0;
+ cs_change = 1;
+ status = 0;
+- setup_transfer = NULL;
+
+ list_for_each_entry (t, &m->transfers, transfer_list) {
+
+- /* override or restore speed and wordsize */
+- if (t->speed_hz || t->bits_per_word) {
+- setup_transfer = bitbang->setup_transfer;
++ /* override speed or wordsize? */
++ if (t->speed_hz || t->bits_per_word)
++ do_setup = 1;
++
++ /* init (-1) or override (1) transfer params */
++ if (do_setup != 0) {
+ if (!setup_transfer) {
+ status = -ENOPROTOOPT;
+ break;
+ }
+- }
+- if (setup_transfer) {
+ status = setup_transfer(spi, t);
+ if (status < 0)
+ break;
+@@ -374,9 +366,10 @@
+ m->status = status;
+ m->complete(m->context);
+
+- /* restore speed and wordsize */
+- if (setup_transfer)
++ /* restore speed and wordsize if it was overridden */
++ if (do_setup == 1)
+ setup_transfer(spi, NULL);
++ do_setup = 0;
+
+ /* normally deactivate chipselect ... unless no error and
+ * cs_change has hinted that the next message will probably
+@@ -457,6 +450,9 @@
+ spin_lock_init(&bitbang->lock);
+ INIT_LIST_HEAD(&bitbang->queue);
+
++ if (!bitbang->master->mode_bits)
++ bitbang->master->mode_bits = SPI_CPOL | SPI_CPHA | bitbang->flags;
++
+ if (!bitbang->master->transfer)
+ bitbang->master->transfer = spi_bitbang_transfer;
+ if (!bitbang->txrx_bufs) {
+Index: linux-2.6.29.6/drivers/spi/spi.c
+===================================================================
+--- linux-2.6.29.6.orig/drivers/spi/spi.c 2010-01-05 15:44:08.000000000 +0100
++++ linux-2.6.29.6/drivers/spi/spi.c 2010-01-05 15:44:43.000000000 +0100
+@@ -23,6 +23,7 @@
+ #include <linux/init.h>
+ #include <linux/cache.h>
+ #include <linux/mutex.h>
++#include <linux/mod_devicetable.h>
+ #include <linux/spi/spi.h>
+
+
+@@ -59,9 +60,32 @@
+ * and the sysfs version makes coldplug work too.
+ */
+
++static const struct spi_device_id *spi_match_id(const struct spi_device_id *id,
++ const struct spi_device *sdev)
++{
++ while (id->name[0]) {
++ if (!strcmp(sdev->modalias, id->name))
++ return id;
++ id++;
++ }
++ return NULL;
++}
++
++const struct spi_device_id *spi_get_device_id(const struct spi_device *sdev)
++{
++ const struct spi_driver *sdrv = to_spi_driver(sdev->dev.driver);
++
++ return spi_match_id(sdrv->id_table, sdev);
++}
++EXPORT_SYMBOL_GPL(spi_get_device_id);
++
+ static int spi_match_device(struct device *dev, struct device_driver *drv)
+ {
+ const struct spi_device *spi = to_spi_device(dev);
++ const struct spi_driver *sdrv = to_spi_driver(drv);
++
++ if (sdrv->id_table)
++ return !!spi_match_id(sdrv->id_table, spi);
+
+ return strcmp(spi->modalias, drv->name) == 0;
+ }
+@@ -70,7 +94,7 @@
+ {
+ const struct spi_device *spi = to_spi_device(dev);
+
+- add_uevent_var(env, "MODALIAS=%s", spi->modalias);
++ add_uevent_var(env, "MODALIAS=%s%s", SPI_MODULE_PREFIX, spi->modalias);
+ return 0;
+ }
+
+@@ -265,7 +289,7 @@
+ * normally rely on the device being setup. Devices
+ * using SPI_CS_HIGH can't coexist well otherwise...
+ */
+- status = spi->master->setup(spi);
++ status = spi_setup(spi);
+ if (status < 0) {
+ dev_err(dev, "can't %s %s, status %d\n",
+ "setup", dev_name(&spi->dev), status);
+@@ -583,6 +607,129 @@
+
+ /*-------------------------------------------------------------------------*/
+
++/* Core methods for SPI master protocol drivers. Some of the
++ * other core methods are currently defined as inline functions.
++ */
++
++/**
++ * spi_setup - setup SPI mode and clock rate
++ * @spi: the device whose settings are being modified
++ * Context: can sleep, and no requests are queued to the device
++ *
++ * SPI protocol drivers may need to update the transfer mode if the
++ * device doesn't work with its default. They may likewise need
++ * to update clock rates or word sizes from initial values. This function
++ * changes those settings, and must be called from a context that can sleep.
++ * Except for SPI_CS_HIGH, which takes effect immediately, the changes take
++ * effect the next time the device is selected and data is transferred to
++ * or from it. When this function returns, the spi device is deselected.
++ *
++ * Note that this call will fail if the protocol driver specifies an option
++ * that the underlying controller or its driver does not support. For
++ * example, not all hardware supports wire transfers using nine bit words,
++ * LSB-first wire encoding, or active-high chipselects.
++ */
++int spi_setup(struct spi_device *spi)
++{
++ unsigned bad_bits;
++ int status;
++
++ /* help drivers fail *cleanly* when they need options
++ * that aren't supported with their current master
++ */
++ bad_bits = spi->mode & ~spi->master->mode_bits;
++ if (bad_bits) {
++ dev_dbg(&spi->dev, "setup: unsupported mode bits %x\n",
++ bad_bits);
++ return -EINVAL;
++ }
++
++ if (!spi->bits_per_word)
++ spi->bits_per_word = 8;
++
++ status = spi->master->setup(spi);
++
++ dev_dbg(&spi->dev, "setup mode %d, %s%s%s%s"
++ "%u bits/w, %u Hz max --> %d\n",
++ (int) (spi->mode & (SPI_CPOL | SPI_CPHA)),
++ (spi->mode & SPI_CS_HIGH) ? "cs_high, " : "",
++ (spi->mode & SPI_LSB_FIRST) ? "lsb, " : "",
++ (spi->mode & SPI_3WIRE) ? "3wire, " : "",
++ (spi->mode & SPI_LOOP) ? "loopback, " : "",
++ spi->bits_per_word, spi->max_speed_hz,
++ status);
++
++ return status;
++}
++EXPORT_SYMBOL_GPL(spi_setup);
++
++/**
++ * spi_async - asynchronous SPI transfer
++ * @spi: device with which data will be exchanged
++ * @message: describes the data transfers, including completion callback
++ * Context: any (irqs may be blocked, etc)
++ *
++ * This call may be used in_irq and other contexts which can't sleep,
++ * as well as from task contexts which can sleep.
++ *
++ * The completion callback is invoked in a context which can't sleep.
++ * Before that invocation, the value of message->status is undefined.
++ * When the callback is issued, message->status holds either zero (to
++ * indicate complete success) or a negative error code. After that
++ * callback returns, the driver which issued the transfer request may
++ * deallocate the associated memory; it's no longer in use by any SPI
++ * core or controller driver code.
++ *
++ * Note that although all messages to a spi_device are handled in
++ * FIFO order, messages may go to different devices in other orders.
++ * Some device might be higher priority, or have various "hard" access
++ * time requirements, for example.
++ *
++ * On detection of any fault during the transfer, processing of
++ * the entire message is aborted, and the device is deselected.
++ * Until returning from the associated message completion callback,
++ * no other spi_message queued to that device will be processed.
++ * (This rule applies equally to all the synchronous transfer calls,
++ * which are wrappers around this core asynchronous primitive.)
++ */
++int spi_async(struct spi_device *spi, struct spi_message *message)
++{
++ struct spi_master *master = spi->master;
++
++ /* Half-duplex links include original MicroWire, and ones with
++ * only one data pin like SPI_3WIRE (switches direction) or where
++ * either MOSI or MISO is missing. They can also be caused by
++ * software limitations.
++ */
++ if ((master->flags & SPI_MASTER_HALF_DUPLEX)
++ || (spi->mode & SPI_3WIRE)) {
++ struct spi_transfer *xfer;
++ unsigned flags = master->flags;
++
++ list_for_each_entry(xfer, &message->transfers, transfer_list) {
++ if (xfer->rx_buf && xfer->tx_buf)
++ return -EINVAL;
++ if ((flags & SPI_MASTER_NO_TX) && xfer->tx_buf)
++ return -EINVAL;
++ if ((flags & SPI_MASTER_NO_RX) && xfer->rx_buf)
++ return -EINVAL;
++ }
++ }
++
++ message->spi = spi;
++ message->status = -EINPROGRESS;
++ return master->transfer(spi, message);
++}
++EXPORT_SYMBOL_GPL(spi_async);
++
++
++/*-------------------------------------------------------------------------*/
++
++/* Utility methods for SPI master protocol drivers, layered on
++ * top of the core. Some other utility methods are defined as
++ * inline functions.
++ */
++
+ static void spi_complete(void *arg)
+ {
+ complete(arg);
+@@ -636,8 +783,8 @@
+ * @spi: device with which data will be exchanged
+ * @txbuf: data to be written (need not be dma-safe)
+ * @n_tx: size of txbuf, in bytes
+- * @rxbuf: buffer into which data will be read
+- * @n_rx: size of rxbuf, in bytes (need not be dma-safe)
++ * @rxbuf: buffer into which data will be read (need not be dma-safe)
++ * @n_rx: size of rxbuf, in bytes
+ * Context: can sleep
+ *
+ * This performs a half duplex MicroWire style transaction with the
+@@ -658,7 +805,7 @@
+
+ int status;
+ struct spi_message message;
+- struct spi_transfer x;
++ struct spi_transfer x[2];
+ u8 *local_buf;
+
+ /* Use preallocated DMA-safe buffer. We can't avoid copying here,
+@@ -669,9 +816,15 @@
+ return -EINVAL;
+
+ spi_message_init(&message);
+- memset(&x, 0, sizeof x);
+- x.len = n_tx + n_rx;
+- spi_message_add_tail(&x, &message);
++ memset(x, 0, sizeof x);
++ if (n_tx) {
++ x[0].len = n_tx;
++ spi_message_add_tail(&x[0], &message);
++ }
++ if (n_rx) {
++ x[1].len = n_rx;
++ spi_message_add_tail(&x[1], &message);
++ }
+
+ /* ... unless someone else is using the pre-allocated buffer */
+ if (!mutex_trylock(&lock)) {
+@@ -682,15 +835,15 @@
+ local_buf = buf;
+
+ memcpy(local_buf, txbuf, n_tx);
+- x.tx_buf = local_buf;
+- x.rx_buf = local_buf;
++ x[0].tx_buf = local_buf;
++ x[1].rx_buf = local_buf + n_tx;
+
+ /* do the i/o */
+ status = spi_sync(spi, &message);
+ if (status == 0)
+- memcpy(rxbuf, x.rx_buf + n_tx, n_rx);
++ memcpy(rxbuf, x[1].rx_buf, n_rx);
+
+- if (x.tx_buf == buf)
++ if (x[0].tx_buf == buf)
+ mutex_unlock(&lock);
+ else
+ kfree(local_buf);
+Index: linux-2.6.29.6/drivers/spi/spi_gpio.c
+===================================================================
+--- linux-2.6.29.6.orig/drivers/spi/spi_gpio.c 2010-01-05 15:45:06.000000000 +0100
++++ linux-2.6.29.6/drivers/spi/spi_gpio.c 2010-01-05 15:45:25.000000000 +0100
+@@ -178,8 +178,10 @@
+ if (is_active)
+ setsck(spi, spi->mode & SPI_CPOL);
+
+- /* SPI is normally active-low */
+- gpio_set_value(cs, (spi->mode & SPI_CS_HIGH) ? is_active : !is_active);
++ if (cs != SPI_GPIO_NO_CHIPSELECT) {
++ /* SPI is normally active-low */
++ gpio_set_value(cs, (spi->mode & SPI_CS_HIGH) ? is_active : !is_active);
++ }
+ }
+
+ static int spi_gpio_setup(struct spi_device *spi)
+@@ -191,15 +193,17 @@
+ return -EINVAL;
+
+ if (!spi->controller_state) {
+- status = gpio_request(cs, spi->dev.bus_id);
+- if (status)
+- return status;
+- status = gpio_direction_output(cs, spi->mode & SPI_CS_HIGH);
++ if (cs != SPI_GPIO_NO_CHIPSELECT) {
++ status = gpio_request(cs, dev_name(&spi->dev));
++ if (status)
++ return status;
++ status = gpio_direction_output(cs, spi->mode & SPI_CS_HIGH);
++ }
+ }
+ if (!status)
+ status = spi_bitbang_setup(spi);
+ if (status) {
+- if (!spi->controller_state)
++ if (!spi->controller_state && cs != SPI_GPIO_NO_CHIPSELECT)
+ gpio_free(cs);
+ }
+ return status;
+@@ -209,7 +213,8 @@
+ {
+ unsigned long cs = (unsigned long) spi->controller_data;
+
+- gpio_free(cs);
++ if (cs != SPI_GPIO_NO_CHIPSELECT)
++ gpio_free(cs);
+ spi_bitbang_cleanup(spi);
+ }
+
+Index: linux-2.6.29.6/include/linux/mod_devicetable.h
+===================================================================
+--- linux-2.6.29.6.orig/include/linux/mod_devicetable.h 2010-01-05 15:42:08.000000000 +0100
++++ linux-2.6.29.6/include/linux/mod_devicetable.h 2010-01-05 15:42:46.000000000 +0100
+@@ -399,6 +399,17 @@
+ __attribute__((aligned(sizeof(kernel_ulong_t))));
+ };
+
++/* spi */
++
++#define SPI_NAME_SIZE 32
++#define SPI_MODULE_PREFIX "spi:"
++
++struct spi_device_id {
++ char name[SPI_NAME_SIZE];
++ kernel_ulong_t driver_data /* Data private to the driver */
++ __attribute__((aligned(sizeof(kernel_ulong_t))));
++};
++
+ /* dmi */
+ enum dmi_field {
+ DMI_NONE,
+@@ -454,4 +465,13 @@
+
+ #define DMI_MATCH(a, b) { a, b }
+
++#define PLATFORM_NAME_SIZE 20
++#define PLATFORM_MODULE_PREFIX "platform:"
++
++struct platform_device_id {
++ char name[PLATFORM_NAME_SIZE];
++ kernel_ulong_t driver_data
++ __attribute__((aligned(sizeof(kernel_ulong_t))));
++};
++
+ #endif /* LINUX_MOD_DEVICETABLE_H */
+Index: linux-2.6.29.6/include/linux/spi/spi_gpio.h
+===================================================================
+--- linux-2.6.29.6.orig/include/linux/spi/spi_gpio.h 2010-01-05 15:45:43.000000000 +0100
++++ linux-2.6.29.6/include/linux/spi/spi_gpio.h 2010-01-05 15:46:25.000000000 +0100
+@@ -25,10 +25,16 @@
+ * ...
+ * };
+ *
++ * If chipselect is not used (there's only one device on the bus), assign
++ * SPI_GPIO_NO_CHIPSELECT to the controller_data:
++ * .controller_data = (void *) SPI_GPIO_NO_CHIPSELECT;
++ *
+ * If the bitbanged bus is later switched to a "native" controller,
+ * that platform_device and controller_data should be removed.
+ */
+
++#define SPI_GPIO_NO_CHIPSELECT ((unsigned long)-1l)
++
+ /**
+ * struct spi_gpio_platform_data - parameter for bitbanged SPI master
+ * @sck: number of the GPIO used for clock output
+Index: linux-2.6.29.6/include/linux/spi/spi.h
+===================================================================
+--- linux-2.6.29.6.orig/include/linux/spi/spi.h 2010-01-05 15:47:07.000000000 +0100
++++ linux-2.6.29.6/include/linux/spi/spi.h 2010-01-05 15:47:34.000000000 +0100
+@@ -20,6 +20,7 @@
+ #define __LINUX_SPI_H
+
+ #include <linux/device.h>
++#include <linux/mod_devicetable.h>
+
+ /*
+ * INTERFACES between SPI master-side drivers and SPI infrastructure.
+@@ -80,11 +81,13 @@
+ #define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */
+ #define SPI_3WIRE 0x10 /* SI/SO signals shared */
+ #define SPI_LOOP 0x20 /* loopback mode */
++#define SPI_NO_CS 0x40 /* 1 dev/bus, no chipselect */
++#define SPI_READY 0x80 /* slave pulls low to pause */
+ u8 bits_per_word;
+ int irq;
+ void *controller_state;
+ void *controller_data;
+- char modalias[32];
++ char modalias[SPI_NAME_SIZE];
+
+ /*
+ * likely need more hooks for more protocol options affecting how
+@@ -143,6 +146,7 @@
+
+ /**
+ * struct spi_driver - Host side "protocol" driver
++ * @id_table: List of SPI devices supported by this driver
+ * @probe: Binds this driver to the spi device. Drivers can verify
+ * that the device is actually present, and may need to configure
+ * characteristics (such as bits_per_word) which weren't needed for
+@@ -168,6 +172,7 @@
+ * MMC, RTC, filesystem character device nodes, and hardware monitoring.
+ */
+ struct spi_driver {
++ const struct spi_device_id *id_table;
+ int (*probe)(struct spi_device *spi);
+ int (*remove)(struct spi_device *spi);
+ void (*shutdown)(struct spi_device *spi);
+@@ -204,6 +209,9 @@
+ * SPI slaves, and are numbered from zero to num_chipselects.
+ * each slave has a chipselect signal, but it's common that not
+ * every chipselect is connected to a slave.
++ * @dma_alignment: SPI controller constraint on DMA buffers alignment.
++ * @mode_bits: flags understood by this controller driver
++ * @flags: other constraints relevant to this driver
+ * @setup: updates the device mode and clocking records used by a
+ * device's SPI controller; protocol code may call this. This
+ * must fail if an unrecognized or unsupported mode is requested.
+@@ -239,7 +247,26 @@
+ */
+ u16 num_chipselect;
+
+- /* setup mode and clock, etc (spi driver may call many times) */
++ /* some SPI controllers pose alignment requirements on DMAable
++ * buffers; let protocol drivers know about these requirements.
++ */
++ u16 dma_alignment;
++
++ /* spi_device.mode flags understood by this controller driver */
++ u16 mode_bits;
++
++ /* other constraints relevant to this driver */
++ u16 flags;
++#define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */
++#define SPI_MASTER_NO_RX BIT(1) /* can't do buffer read */
++#define SPI_MASTER_NO_TX BIT(2) /* can't do buffer write */
++
++ /* Setup mode and clock, etc (spi driver may call many times).
++ *
++ * IMPORTANT: this may be called when transfers to another
++ * device are active. DO NOT UPDATE SHARED REGISTERS in ways
++ * which could break those transfers.
++ */
+ int (*setup)(struct spi_device *spi);
+
+ /* bidirectional bulk transfers
+@@ -512,66 +539,8 @@
+ kfree(m);
+ }
+
+-/**
+- * spi_setup - setup SPI mode and clock rate
+- * @spi: the device whose settings are being modified
+- * Context: can sleep, and no requests are queued to the device
+- *
+- * SPI protocol drivers may need to update the transfer mode if the
+- * device doesn't work with its default. They may likewise need
+- * to update clock rates or word sizes from initial values. This function
+- * changes those settings, and must be called from a context that can sleep.
+- * Except for SPI_CS_HIGH, which takes effect immediately, the changes take
+- * effect the next time the device is selected and data is transferred to
+- * or from it. When this function returns, the spi device is deselected.
+- *
+- * Note that this call will fail if the protocol driver specifies an option
+- * that the underlying controller or its driver does not support. For
+- * example, not all hardware supports wire transfers using nine bit words,
+- * LSB-first wire encoding, or active-high chipselects.
+- */
+-static inline int
+-spi_setup(struct spi_device *spi)
+-{
+- return spi->master->setup(spi);
+-}
+-
+-
+-/**
+- * spi_async - asynchronous SPI transfer
+- * @spi: device with which data will be exchanged
+- * @message: describes the data transfers, including completion callback
+- * Context: any (irqs may be blocked, etc)
+- *
+- * This call may be used in_irq and other contexts which can't sleep,
+- * as well as from task contexts which can sleep.
+- *
+- * The completion callback is invoked in a context which can't sleep.
+- * Before that invocation, the value of message->status is undefined.
+- * When the callback is issued, message->status holds either zero (to
+- * indicate complete success) or a negative error code. After that
+- * callback returns, the driver which issued the transfer request may
+- * deallocate the associated memory; it's no longer in use by any SPI
+- * core or controller driver code.
+- *
+- * Note that although all messages to a spi_device are handled in
+- * FIFO order, messages may go to different devices in other orders.
+- * Some device might be higher priority, or have various "hard" access
+- * time requirements, for example.
+- *
+- * On detection of any fault during the transfer, processing of
+- * the entire message is aborted, and the device is deselected.
+- * Until returning from the associated message completion callback,
+- * no other spi_message queued to that device will be processed.
+- * (This rule applies equally to all the synchronous transfer calls,
+- * which are wrappers around this core asynchronous primitive.)
+- */
+-static inline int
+-spi_async(struct spi_device *spi, struct spi_message *message)
+-{
+- message->spi = spi;
+- return spi->master->transfer(spi, message);
+-}
++extern int spi_setup(struct spi_device *spi);
++extern int spi_async(struct spi_device *spi, struct spi_message *message);
+
+ /*---------------------------------------------------------------------------*/
+
+@@ -735,7 +704,7 @@
+ * controller_data goes to spi_device.controller_data,
+ * irq is copied too
+ */
+- char modalias[32];
++ char modalias[SPI_NAME_SIZE];
+ const void *platform_data;
+ void *controller_data;
+ int irq;
+@@ -803,4 +772,7 @@
+ device_unregister(&spi->dev);
+ }
+
++extern const struct spi_device_id *
++spi_get_device_id(const struct spi_device *sdev);
++
+ #endif /* __LINUX_SPI_H */
hooks/post-receive
--
armadeus
|