* [PATCH v5 1/2] OMAP HSMMC: Adding a Flag to determine the type of Card detect
@ 2010-06-17 15:26 kishore kadiyala
2010-06-17 20:19 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: kishore kadiyala @ 2010-06-17 15:26 UTC (permalink / raw)
To: linux-mmc, linux-omap; +Cc: tony, madhu.cr, akpm
Adding a flag to determine the card detect type which can be
either GPIO or NON-GPIO. MMC1 Controller of OMAP4 have NON-GPIO
interrupt line from twl6030 for card detect.
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
---
arch/arm/mach-omap2/board-3430sdp.c | 3 +++
arch/arm/mach-omap2/board-cm-t35.c | 2 ++
arch/arm/mach-omap2/board-devkit8000.c | 2 ++
arch/arm/mach-omap2/board-igep0020.c | 2 ++
arch/arm/mach-omap2/board-omap3beagle.c | 2 ++
arch/arm/mach-omap2/board-omap3pandora.c | 3 +++
arch/arm/mach-omap2/board-omap3touchbook.c | 2 ++
arch/arm/mach-omap2/board-rx51-peripherals.c | 2 ++
arch/arm/mach-omap2/board-zoom-peripherals.c | 2 ++
arch/arm/mach-omap2/hsmmc.h | 1 +
arch/arm/plat-omap/include/plat/mmc.h | 4 ++++
11 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index f474a80..bd6f81d 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -40,6 +40,7 @@
#include <plat/control.h>
#include <plat/gpmc-smc91x.h>
+#include <plat/mmc.h>
#include <mach/board-sdp.h>
@@ -354,11 +355,13 @@ static struct omap2_hsmmc_info mmc[] = {
* so the SIM card isn't used; else 4 bits.
*/
.wires = 8,
+ .cd_type = GPIO,
.gpio_wp = 4,
},
{
.mmc = 2,
.wires = 8,
+ .cd_type = GPIO,
.gpio_wp = 7,
},
{} /* Terminator */
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index e679a2c..ddf6968 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -46,6 +46,7 @@
#include <plat/usb.h>
#include <plat/display.h>
#include <plat/mcspi.h>
+#include <plat/mmc.h>
#include <mach/hardware.h>
@@ -599,6 +600,7 @@ static struct omap2_hsmmc_info mmc[] = {
.mmc = 1,
.wires = 4,
.gpio_cd = -EINVAL,
+ .cd_type = GPIO,
.gpio_wp = -EINVAL,
},
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 77022b5..114820f 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -45,6 +45,7 @@
#include <plat/usb.h>
#include <plat/timer-gp.h>
#include <plat/display.h>
+#include <plat/mmc.h>
#include <plat/mcspi.h>
#include <linux/input/matrix_keypad.h>
@@ -122,6 +123,7 @@ static struct omap2_hsmmc_info mmc[] = {
{
.mmc = 1,
.wires = 8,
+ .cd_type = GPIO,
.gpio_wp = 29,
},
{} /* Terminator */
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index d55c57b..bc1957f 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -30,6 +30,7 @@
#include <plat/usb.h>
#include <plat/display.h>
#include <plat/onenand.h>
+#include <plat/mmc.h>
#include "mux.h"
#include "hsmmc.h"
@@ -250,6 +251,7 @@ static struct omap2_hsmmc_info mmc[] = {
.mmc = 1,
.wires = 4,
.gpio_cd = -EINVAL,
+ .cd_type = GPIO,
.gpio_wp = -EINVAL,
},
{
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 69b154c..62d7fcb 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -44,6 +44,7 @@
#include <plat/nand.h>
#include <plat/usb.h>
#include <plat/timer-gp.h>
+#include <plat/mmc.h>
#include "mux.h"
#include "hsmmc.h"
@@ -184,6 +185,7 @@ static struct omap2_hsmmc_info mmc[] = {
{
.mmc = 1,
.wires = 8,
+ .cd_type = GPIO,
.gpio_wp = 29,
},
{} /* Terminator */
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index db06dc9..76752bf 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -41,6 +41,7 @@
#include <plat/mcspi.h>
#include <plat/usb.h>
#include <plat/display.h>
+#include <plat/mmc.h>
#include "mux.h"
#include "sdram-micron-mt46h32m32lf-6.h"
@@ -232,6 +233,7 @@ static struct omap2_hsmmc_info omap3pandora_mmc[] = {
.mmc = 1,
.wires = 4,
.gpio_cd = -EINVAL,
+ .cd_type = GPIO,
.gpio_wp = 126,
.ext_clock = 0,
},
@@ -239,6 +241,7 @@ static struct omap2_hsmmc_info omap3pandora_mmc[] = {
.mmc = 2,
.wires = 4,
.gpio_cd = -EINVAL,
+ .cd_type = GPIO,
.gpio_wp = 127,
.ext_clock = 1,
.transceiver = true,
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 2f5f823..83ccdcc 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -48,6 +48,7 @@
#include <plat/nand.h>
#include <plat/usb.h>
#include <plat/timer-gp.h>
+#include <plat/mmc.h>
#include "mux.h"
#include "hsmmc.h"
@@ -126,6 +127,7 @@ static struct omap2_hsmmc_info mmc[] = {
{
.mmc = 1,
.wires = 8,
+ .cd_type = GPIO,
.gpio_wp = 29,
},
{} /* Terminator */
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c
b/arch/arm/mach-omap2/board-rx51-peripherals.c
index abdf321..130f745 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -32,6 +32,7 @@
#include <plat/gpmc.h>
#include <plat/onenand.h>
#include <plat/gpmc-smc91x.h>
+#include <plat/mmc.h>
#include "mux.h"
#include "hsmmc.h"
@@ -284,6 +285,7 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
.wires = 4,
.cover_only = true,
.gpio_cd = 160,
+ .cd_type = GPIO,
.gpio_wp = -EINVAL,
.power_saving = true,
},
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c
b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 6b39849..f9c96e1 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -23,6 +23,7 @@
#include <plat/common.h>
#include <plat/usb.h>
+#include <plat/mmc.h>
#include "mux.h"
#include "hsmmc.h"
@@ -156,6 +157,7 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
.name = "external",
.mmc = 1,
.wires = 4,
+ .cd_type = GPIO,
.gpio_wp = -EINVAL,
.power_saving = true,
},
diff --git a/arch/arm/mach-omap2/hsmmc.h b/arch/arm/mach-omap2/hsmmc.h
index 36f0ba8..10690b9 100644
--- a/arch/arm/mach-omap2/hsmmc.h
+++ b/arch/arm/mach-omap2/hsmmc.h
@@ -17,6 +17,7 @@ struct omap2_hsmmc_info {
bool no_off; /* power_saving and power is not to go off */
bool vcc_aux_disable_is_sleep; /* Regulator off remapped to sleep */
int gpio_cd; /* or -EINVAL */
+ bool cd_type; /* GPIO or NON_GPIO */
int gpio_wp; /* or -EINVAL */
char *name; /* or NULL for default */
struct device *dev; /* returned: pointer to mmc adapter */
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
index c835f1e..ed60c0f 100644
--- a/arch/arm/plat-omap/include/plat/mmc.h
+++ b/arch/arm/plat-omap/include/plat/mmc.h
@@ -43,6 +43,9 @@
#define OMAP_MMC_MAX_SLOTS 2
+#define NON_GPIO 0
+#define GPIO 1
+
struct omap_mmc_platform_data {
/* back-link to device */
struct device *dev;
@@ -107,6 +110,7 @@ struct omap_mmc_platform_data {
unsigned features;
int switch_pin; /* gpio (card detect) */
+ unsigned cd_type:1; /* GPIO or NON_GPIO */
int gpio_wp; /* gpio (write protect) */
int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v5 1/2] OMAP HSMMC: Adding a Flag to determine the type of Card detect
2010-06-17 15:26 [PATCH v5 1/2] OMAP HSMMC: Adding a Flag to determine the type of Card detect kishore kadiyala
@ 2010-06-17 20:19 ` Andrew Morton
2010-06-21 6:55 ` kishore kadiyala
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2010-06-17 20:19 UTC (permalink / raw)
To: kishore kadiyala; +Cc: linux-mmc, linux-omap, tony, madhu.cr
On Thu, 17 Jun 2010 20:56:58 +0530 (IST)
"kishore kadiyala" <kishore.kadiyala@ti.com> wrote:
> --- a/arch/arm/plat-omap/include/plat/mmc.h
> +++ b/arch/arm/plat-omap/include/plat/mmc.h
> @@ -43,6 +43,9 @@
>
> #define OMAP_MMC_MAX_SLOTS 2
>
> +#define NON_GPIO 0
> +#define GPIO 1
I'm counting about seven different definitions of "GPIO" in the kernel
already.
drivers/hwmon/it87.c:
#define GPIO 0x07
drivers/media/dvb/dvb-usb/ec168.h:
GPIO = 0x04,
drivers/net/hamachi.c:
GPIO=0x6E
drivers/staging/rtl8187se/r8180_hw.h:
#define GPIO 0x91
etcetera. It's a crazy identifier to use in a header file, and
the chances of a miscompile-causing collision are increasing.
enum cd_type {
CD_TYPE_NON_GPIO = 0,
CD_TYPE_GPIO = 1,
};
perhaps?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v5 1/2] OMAP HSMMC: Adding a Flag to determine the type of Card detect
2010-06-17 20:19 ` Andrew Morton
@ 2010-06-21 6:55 ` kishore kadiyala
2010-07-01 12:32 ` Tony Lindgren
0 siblings, 1 reply; 4+ messages in thread
From: kishore kadiyala @ 2010-06-21 6:55 UTC (permalink / raw)
To: Andrew Morton; +Cc: kishore kadiyala, linux-mmc, linux-omap, tony, madhu.cr
On Fri, Jun 18, 2010 at 1:49 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Thu, 17 Jun 2010 20:56:58 +0530 (IST)
> "kishore kadiyala" <kishore.kadiyala@ti.com> wrote:
>
>> --- a/arch/arm/plat-omap/include/plat/mmc.h
>> +++ b/arch/arm/plat-omap/include/plat/mmc.h
>> @@ -43,6 +43,9 @@
>>
>> #define OMAP_MMC_MAX_SLOTS 2
>>
>> +#define NON_GPIO 0
>> +#define GPIO 1
>
> I'm counting about seven different definitions of "GPIO" in the kernel
> already.
>
> drivers/hwmon/it87.c:
> #define GPIO 0x07
>
> drivers/media/dvb/dvb-usb/ec168.h:
> GPIO = 0x04,
>
> drivers/net/hamachi.c:
> GPIO=0x6E
>
> drivers/staging/rtl8187se/r8180_hw.h:
> #define GPIO 0x91
>
> etcetera. It's a crazy identifier to use in a header file, and
> the chances of a miscompile-causing collision are increasing.
>
>
> enum cd_type {
> CD_TYPE_NON_GPIO = 0,
> CD_TYPE_GPIO = 1,
> };
OK , Will repost with above changes
Regards,
Kishore
>
> perhaps?
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v5 1/2] OMAP HSMMC: Adding a Flag to determine the type of Card detect
2010-06-21 6:55 ` kishore kadiyala
@ 2010-07-01 12:32 ` Tony Lindgren
0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2010-07-01 12:32 UTC (permalink / raw)
To: kishore kadiyala
Cc: Andrew Morton, kishore kadiyala, linux-mmc, linux-omap, madhu.cr
* kishore kadiyala <kishorek.kadiyala@gmail.com> [100621 09:49]:
> On Fri, Jun 18, 2010 at 1:49 AM, Andrew Morton
> <akpm@linux-foundation.org> wrote:
> > On Thu, 17 Jun 2010 20:56:58 +0530 (IST)
> > "kishore kadiyala" <kishore.kadiyala@ti.com> wrote:
> >
> >> --- a/arch/arm/plat-omap/include/plat/mmc.h
> >> +++ b/arch/arm/plat-omap/include/plat/mmc.h
> >> @@ -43,6 +43,9 @@
> >>
> >> #define OMAP_MMC_MAX_SLOTS 2
> >>
> >> +#define NON_GPIO 0
> >> +#define GPIO 1
> >
> > I'm counting about seven different definitions of "GPIO" in the kernel
> > already.
> >
> > drivers/hwmon/it87.c:
> > #define GPIO 0x07
> >
> > drivers/media/dvb/dvb-usb/ec168.h:
> > GPIO = 0x04,
> >
> > drivers/net/hamachi.c:
> > GPIO=0x6E
> >
> > drivers/staging/rtl8187se/r8180_hw.h:
> > #define GPIO 0x91
> >
> > etcetera. It's a crazy identifier to use in a header file, and
> > the chances of a miscompile-causing collision are increasing.
> >
> >
> > enum cd_type {
> > CD_TYPE_NON_GPIO = 0,
> > CD_TYPE_GPIO = 1,
> > };
>
> OK , Will repost with above changes
Please also do it the other way around where you pass CD_TYPE_NON_GPIO
in the flags in the platform data. Then there's no need to patch
all the existing boards.
Tony
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-07-01 12:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-17 15:26 [PATCH v5 1/2] OMAP HSMMC: Adding a Flag to determine the type of Card detect kishore kadiyala
2010-06-17 20:19 ` Andrew Morton
2010-06-21 6:55 ` kishore kadiyala
2010-07-01 12:32 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).