linux/ar71xx: add preliminary 2.6.36 kernel support (refresh patches)
[openwrt.git] / target / linux / ar71xx / patches-2.6.36 / 201-ap83_spi_controller.patch
1 --- a/drivers/spi/Makefile
2 +++ b/drivers/spi/Makefile
3 @@ -11,6 +11,7 @@ endif
4  obj-$(CONFIG_SPI_MASTER)               += spi.o
5  
6  # SPI master controller drivers (bus)
7 +obj-$(CONFIG_SPI_AP83)                 += ap83_spi.o
8  obj-$(CONFIG_SPI_AR71XX)               += ar71xx_spi.o
9  obj-$(CONFIG_SPI_ATMEL)                        += atmel_spi.o
10  obj-$(CONFIG_SPI_BFIN)                 += spi_bfin5xx.o
11 --- a/drivers/spi/Kconfig
12 +++ b/drivers/spi/Kconfig
13 @@ -53,6 +53,14 @@ if SPI_MASTER
14  
15  comment "SPI Master Controller Drivers"
16  
17 +config SPI_AP83
18 +       tristate "Atheros AP83 specific SPI Controller"
19 +       depends on SPI_MASTER && AR71XX_MACH_AP83
20 +       select SPI_BITBANG
21 +       help
22 +         This is a specific SPI controller driver for the Atheros AP83
23 +         reference board.
24 +
25  config SPI_AR71XX
26         tristate "Atheros AR71xx SPI Controller"
27         depends on SPI_MASTER && ATHEROS_AR71XX
28 --- a/drivers/spi/ap83_spi.c
29 +++ b/drivers/spi/ap83_spi.c
30 @@ -132,28 +132,28 @@ static u32 ap83_spi_txrx_mode0(struct sp
31                                unsigned nsecs, u32 word, u8 bits)
32  {
33         dev_dbg(&spi->dev, "TXRX0 word=%08x, bits=%u\n", word, bits);
34 -       return bitbang_txrx_be_cpha0(spi, nsecs, 0, word, bits);
35 +       return bitbang_txrx_be_cpha0(spi, nsecs, 0, 0, word, bits);
36  }
37  
38  static u32 ap83_spi_txrx_mode1(struct spi_device *spi,
39                                unsigned nsecs, u32 word, u8 bits)
40  {
41         dev_dbg(&spi->dev, "TXRX1 word=%08x, bits=%u\n", word, bits);
42 -       return bitbang_txrx_be_cpha1(spi, nsecs, 0, word, bits);
43 +       return bitbang_txrx_be_cpha1(spi, nsecs, 0, 0, word, bits);
44  }
45  
46  static u32 ap83_spi_txrx_mode2(struct spi_device *spi,
47                                unsigned nsecs, u32 word, u8 bits)
48  {
49         dev_dbg(&spi->dev, "TXRX2 word=%08x, bits=%u\n", word, bits);
50 -       return bitbang_txrx_be_cpha0(spi, nsecs, 1, word, bits);
51 +       return bitbang_txrx_be_cpha0(spi, nsecs, 1, 0, word, bits);
52  }
53  
54  static u32 ap83_spi_txrx_mode3(struct spi_device *spi,
55                                unsigned nsecs, u32 word, u8 bits)
56  {
57         dev_dbg(&spi->dev, "TXRX3 word=%08x, bits=%u\n", word, bits);
58 -       return bitbang_txrx_be_cpha1(spi, nsecs, 1, word, bits);
59 +       return bitbang_txrx_be_cpha1(spi, nsecs, 1, 0, word, bits);
60  }
61  
62  static int ap83_spi_probe(struct platform_device *pdev)