[coldfire]: switch to 2.6.38
[openwrt.git] / target / linux / coldfire / patches / 051-Update-SD-MMC-over-SPI-driver-for-MCF54451-and-MCF54.patch
1 From 44d4e083f1527e0acc6d25eadd5258565c3b8a3a Mon Sep 17 00:00:00 2001
2 From: Alison Wang <b18965@freescale.com>
3 Date: Thu, 4 Aug 2011 09:59:55 +0800
4 Subject: [PATCH 51/52] Update SD/MMC over SPI driver for MCF54451 and MCF54418
5
6 This patch fixed the errors in initialization and module mode.
7
8 Signed-off-by: Alison Wang <b18965@freescale.com>
9 ---
10  arch/m68k/coldfire/m5445x/devices.c |    6 +++---
11  drivers/mmc/host/Kconfig            |    8 ++++----
12  drivers/spi/spi.c                   |    4 ++++
13  3 files changed, 11 insertions(+), 7 deletions(-)
14
15 --- a/arch/m68k/coldfire/m5445x/devices.c
16 +++ b/arch/m68k/coldfire/m5445x/devices.c
17 @@ -20,7 +20,7 @@
18  
19  #include <linux/interrupt.h>
20  #include <linux/init.h>
21 -#ifdef CONFIG_MMC_SPI
22 +#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
23  #include <linux/mmc/host.h>
24  #include <linux/spi/mmc_spi.h>
25  #endif
26 @@ -107,7 +107,7 @@ static struct coldfire_dspi_chip codec_s
27  };
28  #endif
29  
30 -#if defined(CONFIG_MMC_SPI)
31 +#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
32  int mmc_spi_init(struct device *mmc_spi_device,
33                 irqreturn_t mmc_spi_irq_handler(int irq, void *private),
34                 void *irq_privatedata)
35 @@ -234,7 +234,7 @@ static struct spi_board_info spi_board_i
36         },
37  #endif
38  
39 -#if defined(CONFIG_MMC_SPI)
40 +#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
41         {
42                 .modalias = "mmc_spi",
43                 .max_speed_hz = 25000000,
44 --- a/drivers/mmc/host/Kconfig
45 +++ b/drivers/mmc/host/Kconfig
46 @@ -369,7 +369,7 @@ config MMC_SPI
47           If unsure, or if your system has no SPI master driver, say N.
48  
49  config M54451_SD_HW_DETECT
50 -       tristate "use extern IRQ7 to detect SD/MMC card"
51 +       bool "use extern IRQ7 to detect SD/MMC card"
52         depends on MMC_SPI && M54451
53         default y
54         help
55 @@ -377,7 +377,7 @@ config M54451_SD_HW_DETECT
56           use irq7 to dectect the card inserting/removing.
57  
58  config M5441X_SD_HW_DETECT
59 -       tristate "use extern IRQ to detect SD/MMC card"
60 +       bool "use extern IRQ to detect SD/MMC card"
61         depends on MMC_SPI && M5441X
62         help
63           MMC/SD interface on 54418evb was over SPI. Enable this option will
64 @@ -388,14 +388,14 @@ choice
65         depends on M5441X_SD_HW_DETECT
66  
67  config DETECT_USE_EXTERN_IRQ7
68 -       tristate "based extern IRQ7"
69 +       bool "based extern IRQ7"
70         depends on M5441X_SD_HW_DETECT
71         help
72           MMC/SD cards using spi controller,
73           we use the extern irq7 to detect card.
74  
75  config DETECT_USE_EXTERN_IRQ1
76 -       tristate "based extern IRQ1"
77 +       bool "based extern IRQ1"
78         depends on M5441X_SD_HW_DETECT
79         help
80           MMC/SD cards using spi controller,
81 --- a/drivers/spi/spi.c
82 +++ b/drivers/spi/spi.c
83 @@ -725,18 +725,22 @@ EXPORT_SYMBOL_GPL(spi_busnum_to_master);
84   */
85  int spi_setup(struct spi_device *spi)
86  {
87 +#ifndef CONFIG_COLDFIRE
88         unsigned        bad_bits;
89 +#endif
90         int             status;
91  
92         /* help drivers fail *cleanly* when they need options
93          * that aren't supported with their current master
94          */
95 +#ifndef CONFIG_COLDFIRE
96         bad_bits = spi->mode & ~spi->master->mode_bits;
97         if (bad_bits) {
98                 dev_err(&spi->dev, "setup: unsupported mode bits %x\n",
99                         bad_bits);
100                 return -EINVAL;
101         }
102 +#endif
103  
104         if (!spi->bits_per_word)
105                 spi->bits_per_word = 8;