* [PATCH 0/8] omap2+ patches for v2.6.37 merge window
@ 2010-10-01 23:33 Tony Lindgren
2010-10-01 23:34 ` [PATCH 1/8] omap: Fix omap_mux_init_signal not to trash muxname Tony Lindgren
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: Tony Lindgren @ 2010-10-01 23:33 UTC (permalink / raw)
To: linux-arm-kernel
Hi all,
Here are some omap2/3/4 related patches I've picked up.
Regards,
Tony
---
Benoit Cousson (1):
omap4 hsmmc: Fix the init if CONFIG_MMC_OMAP_HS is not set
Grazvydas Ignotas (2):
omap: pandora: add fixed regulator for wlan
omap: pandora: enable twl4030 charger
Madhusudhan Chikkature (1):
OMAP4 ES2: HSMMC soft reset change
Sanjeev Premi (1):
omap2/3: Update revision identification
Tony Lindgren (1):
omap: Fix omap_mux_init_signal not to trash muxname
kishore kadiyala (2):
omap4 hsmmc: Register offset handling
omap4 hsmmc: Update ocr mask for MMC2 for regulator to use
arch/arm/mach-omap2/board-4430sdp.c | 9 +++-
arch/arm/mach-omap2/board-omap3pandora.c | 46 +++++++++++++++----
arch/arm/mach-omap2/devices.c | 8 +--
arch/arm/mach-omap2/hsmmc.c | 7 +++
arch/arm/mach-omap2/id.c | 72 ++++++++++++++++++++----------
arch/arm/mach-omap2/mux.c | 13 +++--
arch/arm/mach-omap2/mux.h | 2 -
arch/arm/plat-omap/include/plat/cpu.h | 36 ++++++++-------
arch/arm/plat-omap/include/plat/mmc.h | 4 ++
drivers/mmc/host/omap_hsmmc.c | 25 ++++++++++
10 files changed, 156 insertions(+), 66 deletions(-)
--
Signature
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/8] omap: Fix omap_mux_init_signal not to trash muxname
2010-10-01 23:33 [PATCH 0/8] omap2+ patches for v2.6.37 merge window Tony Lindgren
@ 2010-10-01 23:34 ` Tony Lindgren
2010-10-01 23:34 ` [PATCH 2/8] omap2/3: Update revision identification Tony Lindgren
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2010-10-01 23:34 UTC (permalink / raw)
To: linux-arm-kernel
Otherwise the muxname passed to the function will get truncated.
Based on an earlier patch by rockefeller.lin at innocomm.com.
Reported-by: rockefeller.lin at innocomm.com
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/mux.c | 13 +++++++------
arch/arm/mach-omap2/mux.h | 2 +-
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 6c2f8f0..e33740c 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -127,17 +127,16 @@ int __init omap_mux_init_gpio(int gpio, int val)
return 0;
}
-int __init omap_mux_init_signal(char *muxname, int val)
+int __init omap_mux_init_signal(const char *muxname, int val)
{
struct omap_mux_entry *e;
- char *m0_name = NULL, *mode_name = NULL;
- int found = 0;
+ const char *mode_name;
+ int found = 0, mode0_len = 0;
mode_name = strchr(muxname, '.');
if (mode_name) {
- *mode_name = '\0';
+ mode0_len = strlen(muxname) - strlen(mode_name);
mode_name++;
- m0_name = muxname;
} else {
mode_name = muxname;
}
@@ -147,9 +146,11 @@ int __init omap_mux_init_signal(char *muxname, int val)
char *m0_entry = m->muxnames[0];
int i;
- if (m0_name && strcmp(m0_name, m0_entry))
+ /* First check for full name in mode0.muxmode format */
+ if (mode0_len && strncmp(muxname, m0_entry, mode0_len))
continue;
+ /* Then check for muxmode only */
for (i = 0; i < OMAP_MUX_NR_MODES; i++) {
char *mode_cur = m->muxnames[i];
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index a8e040c..350c04f 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -120,7 +120,7 @@ int omap_mux_init_gpio(int gpio, int val);
* @muxname: Mux name in mode0_name.signal_name format
* @val: Options for the mux register value
*/
-int omap_mux_init_signal(char *muxname, int val);
+int omap_mux_init_signal(const char *muxname, int val);
#else
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/8] omap2/3: Update revision identification
2010-10-01 23:33 [PATCH 0/8] omap2+ patches for v2.6.37 merge window Tony Lindgren
2010-10-01 23:34 ` [PATCH 1/8] omap: Fix omap_mux_init_signal not to trash muxname Tony Lindgren
@ 2010-10-01 23:34 ` Tony Lindgren
2010-10-01 23:34 ` [PATCH 3/8] omap: pandora: add fixed regulator for wlan Tony Lindgren
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2010-10-01 23:34 UTC (permalink / raw)
To: linux-arm-kernel
From: Sanjeev Premi <premi@ti.com>
The existing definitions for cpu revision used
upper nibble in the bits[15:08]. With OMAP3630,
definitions use lower nibble.
This patch unifies the definitions to start
at lower nibble.
Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/id.c | 72 ++++++++++++++++++++++-----------
arch/arm/plat-omap/include/plat/cpu.h | 36 ++++++++---------
2 files changed, 66 insertions(+), 42 deletions(-)
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 0412233..04a2fa2 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -385,30 +385,54 @@ static void __init omap3_cpuinfo(void)
strcpy(cpu_name, "OMAP3503");
}
- switch (rev) {
- case OMAP_REVBITS_00:
- strcpy(cpu_rev, "1.0");
- break;
- case OMAP_REVBITS_01:
- strcpy(cpu_rev, "1.1");
- break;
- case OMAP_REVBITS_02:
- strcpy(cpu_rev, "1.2");
- break;
- case OMAP_REVBITS_10:
- strcpy(cpu_rev, "2.0");
- break;
- case OMAP_REVBITS_20:
- strcpy(cpu_rev, "2.1");
- break;
- case OMAP_REVBITS_30:
- strcpy(cpu_rev, "3.0");
- break;
- case OMAP_REVBITS_40:
- /* FALLTHROUGH */
- default:
- /* Use the latest known revision as default */
- strcpy(cpu_rev, "3.1");
+ if (cpu_is_omap3630()) {
+ switch (rev) {
+ case OMAP_REVBITS_00:
+ strcpy(cpu_rev, "1.0");
+ break;
+ case OMAP_REVBITS_01:
+ strcpy(cpu_rev, "1.1");
+ break;
+ case OMAP_REVBITS_02:
+ /* FALLTHROUGH */
+ default:
+ /* Use the latest known revision as default */
+ strcpy(cpu_rev, "1.2");
+ }
+ } else if (cpu_is_omap3505() || cpu_is_omap3517()) {
+ switch (rev) {
+ case OMAP_REVBITS_00:
+ strcpy(cpu_rev, "1.0");
+ break;
+ case OMAP_REVBITS_01:
+ /* FALLTHROUGH */
+ default:
+ /* Use the latest known revision as default */
+ strcpy(cpu_rev, "1.1");
+ }
+ } else {
+ switch (rev) {
+ case OMAP_REVBITS_00:
+ strcpy(cpu_rev, "1.0");
+ break;
+ case OMAP_REVBITS_01:
+ strcpy(cpu_rev, "2.0");
+ break;
+ case OMAP_REVBITS_02:
+ strcpy(cpu_rev, "2.1");
+ break;
+ case OMAP_REVBITS_03:
+ strcpy(cpu_rev, "3.0");
+ break;
+ case OMAP_REVBITS_04:
+ strcpy(cpu_rev, "3.1");
+ break;
+ case OMAP_REVBITS_05:
+ /* FALLTHROUGH */
+ default:
+ /* Use the latest known revision as default */
+ strcpy(cpu_rev, "3.1.2");
+ }
}
/* Print verbose information */
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index 9b38e4b..3fd8b40 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -68,10 +68,9 @@ unsigned int omap_rev(void);
#define OMAP_REVBITS_00 0x00
#define OMAP_REVBITS_01 0x01
#define OMAP_REVBITS_02 0x02
-#define OMAP_REVBITS_10 0x10
-#define OMAP_REVBITS_20 0x20
-#define OMAP_REVBITS_30 0x30
-#define OMAP_REVBITS_40 0x40
+#define OMAP_REVBITS_03 0x03
+#define OMAP_REVBITS_04 0x04
+#define OMAP_REVBITS_05 0x05
/*
* Get the CPU revision for OMAP devices
@@ -363,23 +362,24 @@ IS_OMAP_TYPE(3517, 0x3517)
/* Various silicon revisions for omap2 */
#define OMAP242X_CLASS 0x24200024
-#define OMAP2420_REV_ES1_0 0x24200024
-#define OMAP2420_REV_ES2_0 0x24201024
+#define OMAP2420_REV_ES1_0 OMAP242X_CLASS
+#define OMAP2420_REV_ES2_0 (OMAP242X_CLASS | (OMAP_REVBITS_01 << 8))
#define OMAP243X_CLASS 0x24300024
-#define OMAP2430_REV_ES1_0 0x24300024
+#define OMAP2430_REV_ES1_0 OMAP243X_CLASS
#define OMAP343X_CLASS 0x34300034
-#define OMAP3430_REV_ES1_0 0x34300034
-#define OMAP3430_REV_ES2_0 0x34301034
-#define OMAP3430_REV_ES2_1 0x34302034
-#define OMAP3430_REV_ES3_0 0x34303034
-#define OMAP3430_REV_ES3_1 0x34304034
-#define OMAP3430_REV_ES3_1_2 0x34305034
-
-#define OMAP3630_REV_ES1_0 0x36300034
-#define OMAP3630_REV_ES1_1 0x36300134
-#define OMAP3630_REV_ES1_2 0x36300234
+#define OMAP3430_REV_ES1_0 OMAP343X_CLASS
+#define OMAP3430_REV_ES2_0 (OMAP343X_CLASS | (OMAP_REVBITS_01 << 8))
+#define OMAP3430_REV_ES2_1 (OMAP343X_CLASS | (OMAP_REVBITS_02 << 8))
+#define OMAP3430_REV_ES3_0 (OMAP343X_CLASS | (OMAP_REVBITS_03 << 8))
+#define OMAP3430_REV_ES3_1 (OMAP343X_CLASS | (OMAP_REVBITS_04 << 8))
+#define OMAP3430_REV_ES3_1_2 (OMAP343X_CLASS | (OMAP_REVBITS_05 << 8))
+
+#define OMAP363X_CLASS 0x36300034
+#define OMAP3630_REV_ES1_0 OMAP363X_CLASS
+#define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (OMAP_REVBITS_01 << 8))
+#define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (OMAP_REVBITS_02 << 8))
#define OMAP35XX_CLASS 0x35000034
#define OMAP3503_REV(v) (OMAP35XX_CLASS | (0x3503 << 16) | (v << 8))
@@ -390,7 +390,7 @@ IS_OMAP_TYPE(3517, 0x3517)
#define OMAP3517_REV(v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << 8))
#define OMAP443X_CLASS 0x44300044
-#define OMAP4430_REV_ES1_0 0x44300044
+#define OMAP4430_REV_ES1_0 OMAP443X_CLASS
#define OMAP4430_REV_ES2_0 0x44301044
/*
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/8] omap: pandora: add fixed regulator for wlan
2010-10-01 23:33 [PATCH 0/8] omap2+ patches for v2.6.37 merge window Tony Lindgren
2010-10-01 23:34 ` [PATCH 1/8] omap: Fix omap_mux_init_signal not to trash muxname Tony Lindgren
2010-10-01 23:34 ` [PATCH 2/8] omap2/3: Update revision identification Tony Lindgren
@ 2010-10-01 23:34 ` Tony Lindgren
2010-10-01 23:34 ` [PATCH 4/8] omap: pandora: enable twl4030 charger Tony Lindgren
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2010-10-01 23:34 UTC (permalink / raw)
To: linux-arm-kernel
From: Grazvydas Ignotas <notasas@gmail.com>
Instead of enabling the wifi module explicitly using GPIO, add a fixed
regulator and hook it to MMC host card power control. This way it will
only be enabled when SDIO subsystem wants to talk to it, saving power
(as done by Zoom boards).
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/board-omap3pandora.c | 43 ++++++++++++++++++++++--------
1 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 2d2e6fc..7c222ba 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -34,6 +34,7 @@
#include <linux/gpio_keys.h>
#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
+#include <linux/regulator/fixed.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -345,6 +346,9 @@ static struct regulator_consumer_supply pandora_vmmc1_supply =
static struct regulator_consumer_supply pandora_vmmc2_supply =
REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1");
+static struct regulator_consumer_supply pandora_vmmc3_supply =
+ REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.2");
+
static struct regulator_consumer_supply pandora_vdda_dac_supply =
REGULATOR_SUPPLY("vdda_dac", "omapdss");
@@ -489,6 +493,33 @@ static struct regulator_init_data pandora_vsim = {
.consumer_supplies = &pandora_adac_supply,
};
+/* Fixed regulator internal to Wifi module */
+static struct regulator_init_data pandora_vmmc3 = {
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &pandora_vmmc3_supply,
+};
+
+static struct fixed_voltage_config pandora_vwlan = {
+ .supply_name = "vwlan",
+ .microvolts = 1800000, /* 1.8V */
+ .gpio = PANDORA_WIFI_NRESET_GPIO,
+ .startup_delay = 50000, /* 50ms */
+ .enable_high = 1,
+ .enabled_at_boot = 0,
+ .init_data = &pandora_vmmc3,
+};
+
+static struct platform_device pandora_vwlan_device = {
+ .name = "reg-fixed-voltage",
+ .id = 1,
+ .dev = {
+ .platform_data = &pandora_vwlan,
+ },
+};
+
static struct twl4030_usb_data omap3pandora_usb_data = {
.usb_mode = T2_USB_MODE_ULPI,
};
@@ -645,19 +676,8 @@ static void pandora_wl1251_init(void)
if (pandora_wl1251_pdata.irq < 0)
goto fail_irq;
- ret = gpio_request(PANDORA_WIFI_NRESET_GPIO, "wl1251 nreset");
- if (ret < 0)
- goto fail_irq;
-
- /* start powered so that it probes with MMC subsystem */
- ret = gpio_direction_output(PANDORA_WIFI_NRESET_GPIO, 1);
- if (ret < 0)
- goto fail_nreset;
-
return;
-fail_nreset:
- gpio_free(PANDORA_WIFI_NRESET_GPIO);
fail_irq:
gpio_free(PANDORA_WIFI_IRQ_GPIO);
fail:
@@ -669,6 +689,7 @@ static struct platform_device *omap3pandora_devices[] __initdata = {
&pandora_keys_gpio,
&pandora_dss_device,
&pandora_wl1251_data,
+ &pandora_vwlan_device,
};
static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/8] omap: pandora: enable twl4030 charger
2010-10-01 23:33 [PATCH 0/8] omap2+ patches for v2.6.37 merge window Tony Lindgren
` (2 preceding siblings ...)
2010-10-01 23:34 ` [PATCH 3/8] omap: pandora: add fixed regulator for wlan Tony Lindgren
@ 2010-10-01 23:34 ` Tony Lindgren
2010-10-01 23:34 ` [PATCH 5/8] OMAP4 ES2: HSMMC soft reset change Tony Lindgren
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2010-10-01 23:34 UTC (permalink / raw)
To: linux-arm-kernel
From: Grazvydas Ignotas <notasas@gmail.com>
Add platform data to make use of newly added charging driver.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/board-omap3pandora.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 7c222ba..7192635 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -533,6 +533,8 @@ static struct twl4030_codec_data omap3pandora_codec_data = {
.audio = &omap3pandora_audio_data,
};
+static struct twl4030_bci_platform_data pandora_bci_data;
+
static struct twl4030_platform_data omap3pandora_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
@@ -548,6 +550,7 @@ static struct twl4030_platform_data omap3pandora_twldata = {
.vaux4 = &pandora_vaux4,
.vsim = &pandora_vsim,
.keypad = &pandora_kp_data,
+ .bci = &pandora_bci_data,
};
static struct i2c_board_info __initdata omap3pandora_i2c_boardinfo[] = {
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 5/8] OMAP4 ES2: HSMMC soft reset change
2010-10-01 23:33 [PATCH 0/8] omap2+ patches for v2.6.37 merge window Tony Lindgren
` (3 preceding siblings ...)
2010-10-01 23:34 ` [PATCH 4/8] omap: pandora: enable twl4030 charger Tony Lindgren
@ 2010-10-01 23:34 ` Tony Lindgren
2010-10-01 23:34 ` [PATCH 6/8] omap4 hsmmc: Fix the init if CONFIG_MMC_OMAP_HS is not set Tony Lindgren
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2010-10-01 23:34 UTC (permalink / raw)
To: linux-arm-kernel
From: Madhusudhan Chikkature <madhu.cr@ti.com>
The omap4 es2 hsmmc has a updated soft reset logic.After the
reset is issued monitor a 0->1 transition first. The reset of
CMD or DATA lines is complete only after a 0->1->0 transition
of SRC or SRD bits.
Signed-off-by: Madhusudhan Chikkature <madhu.cr@ti.com>
Tested-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/hsmmc.c | 3 +++
arch/arm/plat-omap/include/plat/mmc.h | 1 +
drivers/mmc/host/omap_hsmmc.c | 11 +++++++++++
3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index eb92b81..df1311d 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -303,6 +303,9 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
else
mmc->slots[0].features |= HSMMC_HAS_PBIAS;
+ if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0))
+ mmc->slots[0].features |= HSMMC_HAS_UPDATED_RESET;
+
switch (c->mmc) {
case 1:
if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
index bc85010..0f0f113 100644
--- a/arch/arm/plat-omap/include/plat/mmc.h
+++ b/arch/arm/plat-omap/include/plat/mmc.h
@@ -110,6 +110,7 @@ struct omap_mmc_platform_data {
/* we can put the features above into this variable */
#define HSMMC_HAS_PBIAS (1 << 0)
+#define HSMMC_HAS_UPDATED_RESET (1 << 1)
unsigned features;
int switch_pin; /* gpio (card detect) */
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 53f8fa5..69858e7 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -982,6 +982,17 @@ static inline void omap_hsmmc_reset_controller_fsm(struct omap_hsmmc_host *host,
OMAP_HSMMC_WRITE(host->base, SYSCTL,
OMAP_HSMMC_READ(host->base, SYSCTL) | bit);
+ /*
+ * OMAP4 ES2 and greater has an updated reset logic.
+ * Monitor a 0->1 transition first
+ */
+ if (mmc_slot(host).features & HSMMC_HAS_UPDATED_RESET) {
+ while ((!(OMAP_HSMMC_READ(host, SYSCTL) & bit))
+ && (i++ < limit))
+ cpu_relax();
+ }
+ i = 0;
+
while ((OMAP_HSMMC_READ(host->base, SYSCTL) & bit) &&
(i++ < limit))
cpu_relax();
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 6/8] omap4 hsmmc: Fix the init if CONFIG_MMC_OMAP_HS is not set
2010-10-01 23:33 [PATCH 0/8] omap2+ patches for v2.6.37 merge window Tony Lindgren
` (4 preceding siblings ...)
2010-10-01 23:34 ` [PATCH 5/8] OMAP4 ES2: HSMMC soft reset change Tony Lindgren
@ 2010-10-01 23:34 ` Tony Lindgren
2010-10-01 23:34 ` [PATCH 7/8] omap4 hsmmc: Register offset handling Tony Lindgren
2010-10-01 23:34 ` [PATCH 8/8] omap4 hsmmc: Update ocr mask for MMC2 for regulator to use Tony Lindgren
7 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2010-10-01 23:34 UTC (permalink / raw)
To: linux-arm-kernel
From: Benoit Cousson <b-cousson@ti.com>
Avoid possible crash if CONFIG_MMC_OMAP_HS is not set
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/board-4430sdp.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 1bed1e6..cdb9373 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -275,8 +275,14 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev)
static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
{
- struct omap_mmc_platform_data *pdata = dev->platform_data;
+ struct omap_mmc_platform_data *pdata;
+ /* dev can be null if CONFIG_MMC_OMAP_HS is not set */
+ if (!dev) {
+ pr_err("Failed %s\n", __func__);
+ return;
+ }
+ pdata = dev->platform_data;
pdata->init = omap4_twl6030_hsmmc_late_init;
}
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 7/8] omap4 hsmmc: Register offset handling
2010-10-01 23:33 [PATCH 0/8] omap2+ patches for v2.6.37 merge window Tony Lindgren
` (5 preceding siblings ...)
2010-10-01 23:34 ` [PATCH 6/8] omap4 hsmmc: Fix the init if CONFIG_MMC_OMAP_HS is not set Tony Lindgren
@ 2010-10-01 23:34 ` Tony Lindgren
2010-10-01 23:34 ` [PATCH 8/8] omap4 hsmmc: Update ocr mask for MMC2 for regulator to use Tony Lindgren
7 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2010-10-01 23:34 UTC (permalink / raw)
To: linux-arm-kernel
From: kishore kadiyala <kishore.kadiyala@ti.com>
In OMAP4, as per new PM programming model, the legacy registers
which were there in OMAP3 are all shifted by 0x100 while new one's
are added from offset 0 to 0x10.
For OMAP4, the register offset appending of 0x100 done in devices.c
currently, is moved to driver file.This change fits in for current
implementation as well as once the driver undergoes hwmod adaptation.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Adrian Hunter <adrian.hunter@nokia.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/devices.c | 8 +++-----
arch/arm/mach-omap2/hsmmc.c | 4 ++++
arch/arm/plat-omap/include/plat/mmc.h | 3 +++
drivers/mmc/host/omap_hsmmc.c | 2 ++
4 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 9e5d51b..9bd4b34 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -817,13 +817,13 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
case 3:
if (!cpu_is_omap44xx())
return;
- base = OMAP4_MMC4_BASE + OMAP4_MMC_REG_OFFSET;
+ base = OMAP4_MMC4_BASE;
irq = OMAP44XX_IRQ_MMC4;
break;
case 4:
if (!cpu_is_omap44xx())
return;
- base = OMAP4_MMC5_BASE + OMAP4_MMC_REG_OFFSET;
+ base = OMAP4_MMC5_BASE;
irq = OMAP44XX_IRQ_MMC5;
break;
default:
@@ -834,10 +834,8 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
size = OMAP2420_MMC_SIZE;
name = "mmci-omap";
} else if (cpu_is_omap44xx()) {
- if (i < 3) {
- base += OMAP4_MMC_REG_OFFSET;
+ if (i < 3)
irq += OMAP44XX_IRQ_GIC_START;
- }
size = OMAP4_HSMMC_SIZE;
name = "mmci-omap-hs";
} else {
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index df1311d..ab78a5a 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -266,6 +266,10 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
mmc->slots[0].caps = c->caps;
mmc->slots[0].internal_clock = !c->ext_clock;
mmc->dma_mask = 0xffffffff;
+ if (cpu_is_omap44xx())
+ mmc->reg_offset = OMAP4_MMC_REG_OFFSET;
+ else
+ mmc->reg_offset = 0;
mmc->get_context_loss_count = hsmmc_get_context_loss;
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
index 0f0f113..3107892 100644
--- a/arch/arm/plat-omap/include/plat/mmc.h
+++ b/arch/arm/plat-omap/include/plat/mmc.h
@@ -71,6 +71,9 @@ struct omap_mmc_platform_data {
u64 dma_mask;
+ /* Register offset deviation */
+ u16 reg_offset;
+
struct omap_mmc_slot_data {
/*
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 69858e7..dc95756 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2014,6 +2014,8 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
if (res == NULL || irq < 0)
return -ENXIO;
+ res->start += pdata->reg_offset;
+ res->end += pdata->reg_offset;
res = request_mem_region(res->start, res->end - res->start + 1,
pdev->name);
if (res == NULL)
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 8/8] omap4 hsmmc: Update ocr mask for MMC2 for regulator to use
2010-10-01 23:33 [PATCH 0/8] omap2+ patches for v2.6.37 merge window Tony Lindgren
` (6 preceding siblings ...)
2010-10-01 23:34 ` [PATCH 7/8] omap4 hsmmc: Register offset handling Tony Lindgren
@ 2010-10-01 23:34 ` Tony Lindgren
7 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2010-10-01 23:34 UTC (permalink / raw)
To: linux-arm-kernel
From: kishore kadiyala <kishore.kadiyala@ti.com>
On OMAP4, MMC2 controller has eMMC which draws power from VAUX regulator
on TWL. Though the eMMC supports dual voltage[1.8v/3v] as per ocr register,
its VCC is fixed at 3V for operation. With this once the mmc core selects
the minimum voltage[1.8] supported based on the ocr value read from OCR register,
eMMC will not get detected. Thus the platform data for MMC2 is updated with ocr
mask and same will be communicated to core which will set the regulator to
always operate at 3V when ever turned ON.
Cc: Tony Lindgren <tony@atomide.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/board-4430sdp.c | 1 +
drivers/mmc/host/omap_hsmmc.c | 12 ++++++++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index cdb9373..9f75dc2 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -242,6 +242,7 @@ static struct omap2_hsmmc_info mmc[] = {
.gpio_cd = -EINVAL,
.gpio_wp = -EINVAL,
.nonremovable = true,
+ .ocr_mask = MMC_VDD_29_30,
},
{} /* Terminator */
};
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index dc95756..4693e62 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -364,6 +364,7 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
{
struct regulator *reg;
int ret = 0;
+ int ocr_value = 0;
switch (host->id) {
case OMAP_MMC1_DEVID:
@@ -396,6 +397,17 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
}
} else {
host->vcc = reg;
+ ocr_value = mmc_regulator_get_ocrmask(reg);
+ if (!mmc_slot(host).ocr_mask) {
+ mmc_slot(host).ocr_mask = ocr_value;
+ } else {
+ if (!(mmc_slot(host).ocr_mask & ocr_value)) {
+ pr_err("MMC%d ocrmask %x is not supported\n",
+ host->id, mmc_slot(host).ocr_mask);
+ mmc_slot(host).ocr_mask = 0;
+ return -EINVAL;
+ }
+ }
mmc_slot(host).ocr_mask = mmc_regulator_get_ocrmask(reg);
/* Allow an aux regulator */
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-10-01 23:34 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-01 23:33 [PATCH 0/8] omap2+ patches for v2.6.37 merge window Tony Lindgren
2010-10-01 23:34 ` [PATCH 1/8] omap: Fix omap_mux_init_signal not to trash muxname Tony Lindgren
2010-10-01 23:34 ` [PATCH 2/8] omap2/3: Update revision identification Tony Lindgren
2010-10-01 23:34 ` [PATCH 3/8] omap: pandora: add fixed regulator for wlan Tony Lindgren
2010-10-01 23:34 ` [PATCH 4/8] omap: pandora: enable twl4030 charger Tony Lindgren
2010-10-01 23:34 ` [PATCH 5/8] OMAP4 ES2: HSMMC soft reset change Tony Lindgren
2010-10-01 23:34 ` [PATCH 6/8] omap4 hsmmc: Fix the init if CONFIG_MMC_OMAP_HS is not set Tony Lindgren
2010-10-01 23:34 ` [PATCH 7/8] omap4 hsmmc: Register offset handling Tony Lindgren
2010-10-01 23:34 ` [PATCH 8/8] omap4 hsmmc: Update ocr mask for MMC2 for regulator to use 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).