diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-07 05:15:40 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-07 05:15:40 -0400 |
commit | 5e34437840d33554f69380584311743b39e8fbeb (patch) | |
tree | e081135619ee146af5efb9ee883afca950df5757 /include/linux/spi | |
parent | 77d05632baee21b1cef8730d7c06aa69601e4dca (diff) | |
parent | d508afb437daee7cf07da085b635c44a4ebf9b38 (diff) |
Merge branch 'linus' into core/softlockup
Conflicts:
kernel/sysctl.c
Diffstat (limited to 'include/linux/spi')
-rw-r--r-- | include/linux/spi/eeprom.h | 6 | ||||
-rw-r--r-- | include/linux/spi/libertas_spi.h | 32 | ||||
-rw-r--r-- | include/linux/spi/spi_bitbang.h | 7 | ||||
-rw-r--r-- | include/linux/spi/spi_gpio.h | 6 |
4 files changed, 51 insertions, 0 deletions
diff --git a/include/linux/spi/eeprom.h b/include/linux/spi/eeprom.h index 1085212c446e..306e7b1c69ed 100644 --- a/include/linux/spi/eeprom.h +++ b/include/linux/spi/eeprom.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __LINUX_SPI_EEPROM_H | 1 | #ifndef __LINUX_SPI_EEPROM_H |
2 | #define __LINUX_SPI_EEPROM_H | 2 | #define __LINUX_SPI_EEPROM_H |
3 | 3 | ||
4 | #include <linux/memory.h> | ||
5 | |||
4 | /* | 6 | /* |
5 | * Put one of these structures in platform_data for SPI EEPROMS handled | 7 | * Put one of these structures in platform_data for SPI EEPROMS handled |
6 | * by the "at25" driver. On SPI, most EEPROMS understand the same core | 8 | * by the "at25" driver. On SPI, most EEPROMS understand the same core |
@@ -17,6 +19,10 @@ struct spi_eeprom { | |||
17 | #define EE_ADDR2 0x0002 /* 16 bit addrs */ | 19 | #define EE_ADDR2 0x0002 /* 16 bit addrs */ |
18 | #define EE_ADDR3 0x0004 /* 24 bit addrs */ | 20 | #define EE_ADDR3 0x0004 /* 24 bit addrs */ |
19 | #define EE_READONLY 0x0008 /* disallow writes */ | 21 | #define EE_READONLY 0x0008 /* disallow writes */ |
22 | |||
23 | /* for exporting this chip's data to other kernel code */ | ||
24 | void (*setup)(struct memory_accessor *mem, void *context); | ||
25 | void *context; | ||
20 | }; | 26 | }; |
21 | 27 | ||
22 | #endif /* __LINUX_SPI_EEPROM_H */ | 28 | #endif /* __LINUX_SPI_EEPROM_H */ |
diff --git a/include/linux/spi/libertas_spi.h b/include/linux/spi/libertas_spi.h new file mode 100644 index 000000000000..79506f5f9e67 --- /dev/null +++ b/include/linux/spi/libertas_spi.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * board-specific data for the libertas_spi driver. | ||
3 | * | ||
4 | * Copyright 2008 Analog Devices Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or (at | ||
9 | * your option) any later version. | ||
10 | */ | ||
11 | #ifndef _LIBERTAS_SPI_H_ | ||
12 | #define _LIBERTAS_SPI_H_ | ||
13 | |||
14 | struct spi_device; | ||
15 | |||
16 | struct libertas_spi_platform_data { | ||
17 | /* There are two ways to read data from the WLAN module's SPI | ||
18 | * interface. Setting 0 or 1 here controls which one is used. | ||
19 | * | ||
20 | * Usually you want to set use_dummy_writes = 1. | ||
21 | * However, if that doesn't work or if you are using a slow SPI clock | ||
22 | * speed, you may want to use 0 here. */ | ||
23 | u16 use_dummy_writes; | ||
24 | |||
25 | /* GPIO number to use as chip select */ | ||
26 | u16 gpio_cs; | ||
27 | |||
28 | /* Board specific setup/teardown */ | ||
29 | int (*setup)(struct spi_device *spi); | ||
30 | int (*teardown)(struct spi_device *spi); | ||
31 | }; | ||
32 | #endif | ||
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index bf8de281b4ed..eed4254bd503 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h | |||
@@ -83,6 +83,13 @@ extern int spi_bitbang_stop(struct spi_bitbang *spi); | |||
83 | * int getmiso(struct spi_device *); | 83 | * int getmiso(struct spi_device *); |
84 | * void spidelay(unsigned); | 84 | * void spidelay(unsigned); |
85 | * | 85 | * |
86 | * setsck()'s is_on parameter is a zero/nonzero boolean. | ||
87 | * | ||
88 | * setmosi()'s is_on parameter is a zero/nonzero boolean. | ||
89 | * | ||
90 | * getmiso() is required to return 0 or 1 only. Any other value is invalid | ||
91 | * and will result in improper operation. | ||
92 | * | ||
86 | * A non-inlined routine would call bitbang_txrx_*() routines. The | 93 | * A non-inlined routine would call bitbang_txrx_*() routines. The |
87 | * main loop could easily compile down to a handful of instructions, | 94 | * main loop could easily compile down to a handful of instructions, |
88 | * especially if the delay is a NOP (to run at peak speed). | 95 | * especially if the delay is a NOP (to run at peak speed). |
diff --git a/include/linux/spi/spi_gpio.h b/include/linux/spi/spi_gpio.h index 0f01a0f1f40c..ca6782ee4b9f 100644 --- a/include/linux/spi/spi_gpio.h +++ b/include/linux/spi/spi_gpio.h | |||
@@ -25,10 +25,16 @@ | |||
25 | * ... | 25 | * ... |
26 | * }; | 26 | * }; |
27 | * | 27 | * |
28 | * If chipselect is not used (there's only one device on the bus), assign | ||
29 | * SPI_GPIO_NO_CHIPSELECT to the controller_data: | ||
30 | * .controller_data = (void *) SPI_GPIO_NO_CHIPSELECT; | ||
31 | * | ||
28 | * If the bitbanged bus is later switched to a "native" controller, | 32 | * If the bitbanged bus is later switched to a "native" controller, |
29 | * that platform_device and controller_data should be removed. | 33 | * that platform_device and controller_data should be removed. |
30 | */ | 34 | */ |
31 | 35 | ||
36 | #define SPI_GPIO_NO_CHIPSELECT ((unsigned long)-1l) | ||
37 | |||
32 | /** | 38 | /** |
33 | * struct spi_gpio_platform_data - parameter for bitbanged SPI master | 39 | * struct spi_gpio_platform_data - parameter for bitbanged SPI master |
34 | * @sck: number of the GPIO used for clock output | 40 | * @sck: number of the GPIO used for clock output |