* [PATCH] HSMMC: Fix boot crash on boards without gpio_cd set
@ 2008-11-14 19:45 Grazvydas Ignotas
2008-11-14 19:45 ` [PATCH] HSMMC: Add MMC configuration for pandora Grazvydas Ignotas
0 siblings, 1 reply; 7+ messages in thread
From: Grazvydas Ignotas @ 2008-11-14 19:45 UTC (permalink / raw)
To: linux-omap; +Cc: Grazvydas Ignotas
If .gpio_cd is -EINVAL, twl_mmc_late_init() is not called and
hsmmc[x].mmc is not set, so don't use it in twl_mmc*_set_power().
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
arch/arm/mach-omap2/mmc-twl4030.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 0ea6ba6..626d668 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -239,6 +239,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
u32 reg;
int ret = 0;
struct twl_mmc_controller *c = &hsmmc[0];
+ struct omap_mmc_platform_data *mmc = dev->platform_data;
if (power_on) {
if (cpu_is_omap2430()) {
@@ -250,7 +251,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
omap_ctrl_writel(reg, OMAP243X_CONTROL_DEVCONF1);
}
- if (c->mmc->slots[0].internal_clock) {
+ if (mmc->slots[0].internal_clock) {
reg = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
reg |= OMAP2_MMCSDIO1ADPCLKISEL;
omap_ctrl_writel(reg, OMAP2_CONTROL_DEVCONF0);
@@ -293,11 +294,11 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vdd)
{
int ret;
-
struct twl_mmc_controller *c = &hsmmc[1];
+ struct omap_mmc_platform_data *mmc = dev->platform_data;
if (power_on) {
- if (c->mmc->slots[0].internal_clock) {
+ if (mmc->slots[0].internal_clock) {
u32 reg;
reg = omap_ctrl_readl(control_devconf1_offset);
--
1.5.4.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] HSMMC: Add MMC configuration for pandora
2008-11-14 19:45 [PATCH] HSMMC: Fix boot crash on boards without gpio_cd set Grazvydas Ignotas
@ 2008-11-14 19:45 ` Grazvydas Ignotas
2008-11-14 20:11 ` David Brownell
0 siblings, 1 reply; 7+ messages in thread
From: Grazvydas Ignotas @ 2008-11-14 19:45 UTC (permalink / raw)
To: linux-omap; +Cc: Grazvydas Ignotas
This patch enables both SD slots with support of card detect and
write protect switch on OMAP3 Pandora.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
arch/arm/mach-omap2/board-omap3pandora.c | 41 ++++++++++++++++++++++--------
1 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 48f7d26..69517a5 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -144,14 +144,44 @@ static void __init omap3pandora_flash_init(void)
}
}
+static struct twl4030_hsmmc_info omap3pandora_mmc[] = {
+ {
+ .mmc = 1,
+ .wires = 4,
+ .gpio_cd = -EINVAL,
+ .gpio_wp = 126,
+ .ext_clock = 0,
+ },
+ {
+ .mmc = 2,
+ .wires = 4,
+ .gpio_cd = -EINVAL,
+ .gpio_wp = 127,
+ .ext_clock = 1,
+ },
+ {} /* Terminator */
+};
+
static struct omap_uart_config omap3pandora_uart_config __initdata = {
.enabled_uarts = (1 << 2), /* UART3 */
};
+static int omap3pandora_twl_gpio_setup(struct device *dev,
+ unsigned gpio, unsigned ngpio)
+{
+ /* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */
+ omap3pandora_mmc[0].gpio_cd = gpio + 0;
+ omap3pandora_mmc[1].gpio_cd = gpio + 1;
+ hsmmc_init(omap3pandora_mmc);
+
+ return 0;
+}
+
static struct twl4030_gpio_platform_data omap3pandora_gpio_data = {
.gpio_base = OMAP_MAX_GPIO_LINES,
.irq_base = TWL4030_GPIO_IRQ_BASE,
.irq_end = TWL4030_GPIO_IRQ_END,
+ .setup = omap3pandora_twl_gpio_setup,
};
static struct twl4030_usb_data omap3pandora_usb_data = {
@@ -257,16 +287,6 @@ static struct platform_device *omap3pandora_devices[] __initdata = {
&omap3pandora_lcd_device,
};
-static struct twl4030_hsmmc_info mmc[] __initdata = {
- {
- .mmc = 1,
- .wires = 4,
- .gpio_cd = -EINVAL,
- .gpio_wp = -EINVAL,
- },
- {} /* Terminator */
-};
-
static void __init omap3pandora_init(void)
{
omap3pandora_i2c_init();
@@ -277,7 +297,6 @@ static void __init omap3pandora_init(void)
omap_serial_init();
spi_register_board_info(omap3pandora_spi_board_info,
ARRAY_SIZE(omap3pandora_spi_board_info));
- hsmmc_init(mmc);
usb_musb_init();
usb_ehci_init();
omap3pandora_flash_init();
--
1.5.4.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] HSMMC: Add MMC configuration for pandora
2008-11-14 19:45 ` [PATCH] HSMMC: Add MMC configuration for pandora Grazvydas Ignotas
@ 2008-11-14 20:11 ` David Brownell
2008-11-14 20:57 ` Grazvydas Ignotas
0 siblings, 1 reply; 7+ messages in thread
From: David Brownell @ 2008-11-14 20:11 UTC (permalink / raw)
To: Grazvydas Ignotas; +Cc: linux-omap
On Friday 14 November 2008, Grazvydas Ignotas wrote:
> This patch enables both SD slots with support of card detect and
> write protect switch on OMAP3 Pandora.
Nice milestone for a Friday. :)
Weren't you working on getting the SDIO WLAN adapter on the third
slot to behave too?
- Dave
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] HSMMC: Add MMC configuration for pandora
2008-11-14 20:11 ` David Brownell
@ 2008-11-14 20:57 ` Grazvydas Ignotas
2008-11-14 21:40 ` Steve Sakoman
2008-11-14 21:44 ` Tony Lindgren
0 siblings, 2 replies; 7+ messages in thread
From: Grazvydas Ignotas @ 2008-11-14 20:57 UTC (permalink / raw)
To: David Brownell; +Cc: linux-omap
On Fri, Nov 14, 2008 at 10:11 PM, David Brownell <david-b@pacbell.net> wrote:
> On Friday 14 November 2008, Grazvydas Ignotas wrote:
>> This patch enables both SD slots with support of card detect and
>> write protect switch on OMAP3 Pandora.
>
> Nice milestone for a Friday. :)
May be, but it still needs some nasty hack in the host driver to work.
The driver relies on voltage setting in the host controller register,
but that is fixed to 1.8V for MMC2 and doesn't represent real voltage
used for the card.
> Weren't you working on getting the SDIO WLAN adapter on the third
> slot to behave too?
yeah, not much progress with that yet, though..
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] HSMMC: Add MMC configuration for pandora
2008-11-14 20:57 ` Grazvydas Ignotas
@ 2008-11-14 21:40 ` Steve Sakoman
2008-11-14 22:35 ` David Brownell
2008-11-14 21:44 ` Tony Lindgren
1 sibling, 1 reply; 7+ messages in thread
From: Steve Sakoman @ 2008-11-14 21:40 UTC (permalink / raw)
To: Grazvydas Ignotas, linux-omap@vger.kernel.org
On Fri, Nov 14, 2008 at 12:57 PM, Grazvydas Ignotas <notasas@gmail.com> wrote:
> On Fri, Nov 14, 2008 at 10:11 PM, David Brownell <david-b@pacbell.net> wrote:
>> On Friday 14 November 2008, Grazvydas Ignotas wrote:
>>> This patch enables both SD slots with support of card detect and
>>> write protect switch on OMAP3 Pandora.
>>
>> Nice milestone for a Friday. :)
> May be, but it still needs some nasty hack in the host driver to work.
> The driver relies on voltage setting in the host controller register,
> but that is fixed to 1.8V for MMC2 and doesn't represent real voltage
> used for the card.
>
>> Weren't you working on getting the SDIO WLAN adapter on the third
>> slot to behave too?
> yeah, not much progress with that yet, though..
Which adapter are you using? I've got the libertas_sdio driver working on mmc2.
Steve
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] HSMMC: Add MMC configuration for pandora
2008-11-14 20:57 ` Grazvydas Ignotas
2008-11-14 21:40 ` Steve Sakoman
@ 2008-11-14 21:44 ` Tony Lindgren
1 sibling, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2008-11-14 21:44 UTC (permalink / raw)
To: Grazvydas Ignotas; +Cc: David Brownell, linux-omap
* Grazvydas Ignotas <notasas@gmail.com> [081114 12:58]:
> On Fri, Nov 14, 2008 at 10:11 PM, David Brownell <david-b@pacbell.net> wrote:
> > On Friday 14 November 2008, Grazvydas Ignotas wrote:
> >> This patch enables both SD slots with support of card detect and
> >> write protect switch on OMAP3 Pandora.
> >
> > Nice milestone for a Friday. :)
> May be, but it still needs some nasty hack in the host driver to work.
> The driver relies on voltage setting in the host controller register,
> but that is fixed to 1.8V for MMC2 and doesn't represent real voltage
> used for the card.
>
> > Weren't you working on getting the SDIO WLAN adapter on the third
> > slot to behave too?
> yeah, not much progress with that yet, though..
Pushed both.
Tony
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] HSMMC: Add MMC configuration for pandora
2008-11-14 21:40 ` Steve Sakoman
@ 2008-11-14 22:35 ` David Brownell
0 siblings, 0 replies; 7+ messages in thread
From: David Brownell @ 2008-11-14 22:35 UTC (permalink / raw)
To: Steve Sakoman; +Cc: Grazvydas Ignotas, linux-omap@vger.kernel.org
On Friday 14 November 2008, Steve Sakoman wrote:
> >> Weren't you working on getting the SDIO WLAN adapter on the third
> >> slot to behave too?
> >
> > yeah, not much progress with that yet, though..
>
> Which adapter are you using? I've got the libertas_sdio driver working on mmc2.
The issue I referred to was the way mmc3 isn't yet
supported at all in that code ...
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" 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] 7+ messages in thread
end of thread, other threads:[~2008-11-14 22:35 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-14 19:45 [PATCH] HSMMC: Fix boot crash on boards without gpio_cd set Grazvydas Ignotas
2008-11-14 19:45 ` [PATCH] HSMMC: Add MMC configuration for pandora Grazvydas Ignotas
2008-11-14 20:11 ` David Brownell
2008-11-14 20:57 ` Grazvydas Ignotas
2008-11-14 21:40 ` Steve Sakoman
2008-11-14 22:35 ` David Brownell
2008-11-14 21:44 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox