aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2008-02-08 12:54:09 -0500
committerBryan Wu <bryan.wu@analog.com>2008-02-08 12:54:09 -0500
commit6e668936db12550ab5a6a758f236140101e5a644 (patch)
tree8ec66d17e3816e7007873671c5105a77bdb4a0c4
parent8b01eaff4fdf39d23d53288fd1a3e74fef136145 (diff)
[Blackfin] arch: Encourage users to use the spidev character driver: Provide platform support
- Enable kernel generic spidev driver for blackfin SPI ADC - spi_adc driver, document and test sample not synced Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c17
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c16
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c16
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c16
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c16
-rw-r--r--arch/blackfin/mach-bf561/boards/ezkit.c16
-rw-r--r--include/asm-blackfin/bfin5xx_spi.h44
7 files changed, 103 insertions, 38 deletions
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
index 1795aab79064..b0c17afd4b76 100644
--- a/arch/blackfin/mach-bf527/boards/ezkit.c
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -517,6 +517,14 @@ static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
517 .bits_per_word = 16, 517 .bits_per_word = 16,
518}; 518};
519#endif 519#endif
520
521#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
522static struct bfin5xx_spi_chip spidev_chip_info = {
523 .enable_dma = 0,
524 .bits_per_word = 8,
525};
526#endif
527
520static struct spi_board_info bfin_spi_board_info[] __initdata = { 528static struct spi_board_info bfin_spi_board_info[] __initdata = {
521#if defined(CONFIG_MTD_M25P80) \ 529#if defined(CONFIG_MTD_M25P80) \
522 || defined(CONFIG_MTD_M25P80_MODULE) 530 || defined(CONFIG_MTD_M25P80_MODULE)
@@ -634,6 +642,15 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
634 .mode = SPI_MODE_0, 642 .mode = SPI_MODE_0,
635 }, 643 },
636#endif 644#endif
645#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
646 {
647 .modalias = "spidev",
648 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
649 .bus_num = 0,
650 .chip_select = 1,
651 .controller_data = &spidev_chip_info,
652 },
653#endif
637}; 654};
638 655
639/* SPI controller data */ 656/* SPI controller data */
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c
index 4026c2f3ab4e..4a42d624e558 100644
--- a/arch/blackfin/mach-bf533/boards/ezkit.c
+++ b/arch/blackfin/mach-bf533/boards/ezkit.c
@@ -134,6 +134,13 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
134}; 134};
135#endif 135#endif
136 136
137#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
138static struct bfin5xx_spi_chip spidev_chip_info = {
139 .enable_dma = 0,
140 .bits_per_word = 8,
141};
142#endif
143
137static struct spi_board_info bfin_spi_board_info[] __initdata = { 144static struct spi_board_info bfin_spi_board_info[] __initdata = {
138#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 145#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
139 { 146 {
@@ -168,6 +175,15 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
168 .controller_data = &ad1836_spi_chip_info, 175 .controller_data = &ad1836_spi_chip_info,
169 }, 176 },
170#endif 177#endif
178#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
179 {
180 .modalias = "spidev",
181 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
182 .bus_num = 0,
183 .chip_select = 1,
184 .controller_data = &spidev_chip_info,
185 },
186#endif
171}; 187};
172 188
173/* SPI (0) */ 189/* SPI (0) */
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index 41ec72f8a08c..a645f6fd091b 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -226,6 +226,13 @@ static struct bfin5xx_spi_chip spi_mmc_chip_info = {
226}; 226};
227#endif 227#endif
228 228
229#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
230static struct bfin5xx_spi_chip spidev_chip_info = {
231 .enable_dma = 0,
232 .bits_per_word = 8,
233};
234#endif
235
229static struct spi_board_info bfin_spi_board_info[] __initdata = { 236static struct spi_board_info bfin_spi_board_info[] __initdata = {
230#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 237#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
231 { 238 {
@@ -312,6 +319,15 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
312 .mode = SPI_MODE_2, 319 .mode = SPI_MODE_2,
313 }, 320 },
314#endif 321#endif
322#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
323 {
324 .modalias = "spidev",
325 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
326 .bus_num = 0,
327 .chip_select = 1,
328 .controller_data = &spidev_chip_info,
329 },
330#endif
315}; 331};
316 332
317/* SPI (0) */ 333/* SPI (0) */
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index 119e6ea83384..9e2277e0d25c 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -487,6 +487,13 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
487}; 487};
488#endif 488#endif
489 489
490#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
491static struct bfin5xx_spi_chip spidev_chip_info = {
492 .enable_dma = 0,
493 .bits_per_word = 8,
494};
495#endif
496
490static struct spi_board_info bfin_spi_board_info[] __initdata = { 497static struct spi_board_info bfin_spi_board_info[] __initdata = {
491#if defined(CONFIG_MTD_M25P80) \ 498#if defined(CONFIG_MTD_M25P80) \
492 || defined(CONFIG_MTD_M25P80_MODULE) 499 || defined(CONFIG_MTD_M25P80_MODULE)
@@ -593,6 +600,15 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
593 .controller_data = &spi_ad7877_chip_info, 600 .controller_data = &spi_ad7877_chip_info,
594 }, 601 },
595#endif 602#endif
603#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
604 {
605 .modalias = "spidev",
606 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
607 .bus_num = 0,
608 .chip_select = 1,
609 .controller_data = &spidev_chip_info,
610 },
611#endif
596}; 612};
597 613
598/* SPI controller data */ 614/* SPI controller data */
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 638da39a2f34..d5330d4f79d3 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -420,6 +420,13 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
420}; 420};
421#endif 421#endif
422 422
423#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
424static struct bfin5xx_spi_chip spidev_chip_info = {
425 .enable_dma = 0,
426 .bits_per_word = 8,
427};
428#endif
429
423static struct spi_board_info bf54x_spi_board_info[] __initdata = { 430static struct spi_board_info bf54x_spi_board_info[] __initdata = {
424#if defined(CONFIG_MTD_M25P80) \ 431#if defined(CONFIG_MTD_M25P80) \
425 || defined(CONFIG_MTD_M25P80_MODULE) 432 || defined(CONFIG_MTD_M25P80_MODULE)
@@ -445,6 +452,15 @@ static struct spi_board_info bf54x_spi_board_info[] __initdata = {
445 .controller_data = &spi_ad7877_chip_info, 452 .controller_data = &spi_ad7877_chip_info,
446}, 453},
447#endif 454#endif
455#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
456 {
457 .modalias = "spidev",
458 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
459 .bus_num = 0,
460 .chip_select = 1,
461 .controller_data = &spidev_chip_info,
462 },
463#endif
448}; 464};
449 465
450/* SPI (0) */ 466/* SPI (0) */
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c
index 63259d0828af..43c1b0982819 100644
--- a/arch/blackfin/mach-bf561/boards/ezkit.c
+++ b/arch/blackfin/mach-bf561/boards/ezkit.c
@@ -266,6 +266,13 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
266 .bits_per_word = 16, 266 .bits_per_word = 16,
267}; 267};
268#endif 268#endif
269
270#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
271static struct bfin5xx_spi_chip spidev_chip_info = {
272 .enable_dma = 0,
273 .bits_per_word = 8,
274};
275#endif
269#endif 276#endif
270 277
271/* SPI (0) */ 278/* SPI (0) */
@@ -310,6 +317,15 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
310 .controller_data = &ad1836_spi_chip_info, 317 .controller_data = &ad1836_spi_chip_info,
311 }, 318 },
312#endif 319#endif
320#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
321 {
322 .modalias = "spidev",
323 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
324 .bus_num = 0,
325 .chip_select = 1,
326 .controller_data = &spidev_chip_info,
327 },
328#endif
313}; 329};
314 330
315#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 331#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
diff --git a/include/asm-blackfin/bfin5xx_spi.h b/include/asm-blackfin/bfin5xx_spi.h
index 1a0b57f6a3d4..9fa19158e38d 100644
--- a/include/asm-blackfin/bfin5xx_spi.h
+++ b/include/asm-blackfin/bfin5xx_spi.h
@@ -1,6 +1,6 @@
1/************************************************************ 1/************************************************************
2* 2
3* Copyright (C) 2004, Analog Devices. All Rights Reserved 3* Copyright (C) 2006-2008, Analog Devices. All Rights Reserved
4* 4*
5* FILE bfin5xx_spi.h 5* FILE bfin5xx_spi.h
6* PROGRAMMER(S): Luke Yang (Analog Devices Inc.) 6* PROGRAMMER(S): Luke Yang (Analog Devices Inc.)
@@ -32,42 +32,6 @@
32#define SPI_BAUD_OFF 0x14 32#define SPI_BAUD_OFF 0x14
33#define SPI_SHAW_OFF 0x18 33#define SPI_SHAW_OFF 0x18
34 34
35#define CMD_SPI_OUT_ENABLE 1
36#define CMD_SPI_SET_BAUDRATE 2
37#define CMD_SPI_SET_POLAR 3
38#define CMD_SPI_SET_PHASE 4
39#define CMD_SPI_SET_MASTER 5
40#define CMD_SPI_SET_SENDOPT 6
41#define CMD_SPI_SET_RECVOPT 7
42#define CMD_SPI_SET_ORDER 8
43#define CMD_SPI_SET_LENGTH16 9
44#define CMD_SPI_GET_STAT 11
45#define CMD_SPI_GET_CFG 12
46#define CMD_SPI_SET_CSAVAIL 13
47#define CMD_SPI_SET_CSHIGH 14 /* CS unavail */
48#define CMD_SPI_SET_CSLOW 15 /* CS avail */
49#define CMD_SPI_MISO_ENABLE 16
50#define CMD_SPI_SET_CSENABLE 17
51#define CMD_SPI_SET_CSDISABLE 18
52
53#define CMD_SPI_SET_TRIGGER_MODE 19
54#define CMD_SPI_SET_TRIGGER_SENSE 20
55#define CMD_SPI_SET_TRIGGER_EDGE 21
56#define CMD_SPI_SET_TRIGGER_LEVEL 22
57
58#define CMD_SPI_SET_TIME_SPS 23
59#define CMD_SPI_SET_TIME_SAMPLES 24
60#define CMD_SPI_GET_SYSTEMCLOCK 25
61
62#define CMD_SPI_SET_WRITECONTINUOUS 26
63#define CMD_SPI_SET_SKFS 27
64
65#define CMD_SPI_GET_ALLCONFIG 32 /* For debug */
66
67#define SPI_DEFAULT_BARD 0x0100
68
69#define SPI0_IRQ_NUM IRQ_SPI
70#define SPI_ERR_TRIG -1
71 35
72#define BIT_CTL_ENABLE 0x4000 36#define BIT_CTL_ENABLE 0x4000
73#define BIT_CTL_OPENDRAIN 0x2000 37#define BIT_CTL_OPENDRAIN 0x2000
@@ -148,6 +112,10 @@
148#define CFG_SPI_CS6VALUE 6 112#define CFG_SPI_CS6VALUE 6
149#define CFG_SPI_CS7VALUE 7 113#define CFG_SPI_CS7VALUE 7
150 114
115#define CMD_SPI_SET_BAUDRATE 2
116#define CMD_SPI_GET_SYSTEMCLOCK 25
117#define CMD_SPI_SET_WRITECONTINUOUS 26
118
151/* device.platform_data for SSP controller devices */ 119/* device.platform_data for SSP controller devices */
152struct bfin5xx_spi_master { 120struct bfin5xx_spi_master {
153 u16 num_chipselect; 121 u16 num_chipselect;