linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] pandora updates for .36
@ 2010-07-01 19:58 Grazvydas Ignotas
  2010-07-01 19:58 ` [PATCH 1/2] omap3: pandora: update gpio-keys data Grazvydas Ignotas
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Grazvydas Ignotas @ 2010-07-01 19:58 UTC (permalink / raw)
  To: linux-omap; +Cc: Tony Lindgren, Grazvydas Ignotas

Hi Tony,

here are some updates for Pandora, which we have now around 700 units
shipped (finally!) after years of developemt hell. More are being
made at the moment.

Patch 2/2 has incorporated my last patch that missed the last merge
window, and depends on "pass wl1251 information to SDIO core" [1],
will rebase if that one does not get through. The NAND portion
assumes Sukumar's NAND/GMPC cleanup patches are incorporated as it
doesn't set up those gpmc*_baseaddr variables.

1: http://marc.info/?l=linux-omap&m=127781938327423&w=2

Grazvydas Ignotas (2):
  omap3: pandora: update gpio-keys data
  omap3: pandora: add NAND and wifi support

 arch/arm/mach-omap2/board-omap3pandora.c |  149 ++++++++++++++++++++++++++----
 1 files changed, 130 insertions(+), 19 deletions(-)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] omap3: pandora: update gpio-keys data
  2010-07-01 19:58 [PATCH 0/2] pandora updates for .36 Grazvydas Ignotas
@ 2010-07-01 19:58 ` Grazvydas Ignotas
  2010-07-05  9:58   ` [APPLIED] " Tony Lindgren
  2010-07-01 19:58 ` [PATCH 2/2] omap3: pandora: add NAND and wifi support Grazvydas Ignotas
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Grazvydas Ignotas @ 2010-07-01 19:58 UTC (permalink / raw)
  To: linux-omap; +Cc: Tony Lindgren, Grazvydas Ignotas

Update gpio-keys setup so it matches what is on default firmware.
Also make use of debounce feature in gpio-keys instead of setting it
explicitly, as gpio-keys is now capable of using hardware debounce on
OMAPs thanks to recent gpiolib changes.
Also fix a sparce warning along the way.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
 arch/arm/mach-omap2/board-omap3pandora.c |   30 ++++++++++--------------------
 1 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index ebbfb49..6131d98 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -49,9 +49,6 @@
 
 #define OMAP3_PANDORA_TS_GPIO		94
 
-/* hardware debounce: (value + 1) * 31us */
-#define GPIO_DEBOUNCE_TIME		127
-
 static struct gpio_led pandora_gpio_leds[] = {
 	{
 		.name			= "pandora::sd1",
@@ -89,6 +86,7 @@ static struct platform_device pandora_leds_gpio = {
 	.type		= ev_type,				\
 	.code		= ev_code,				\
 	.active_low	= act_low,				\
+	.debounce_interval = 4,					\
 	.desc		= "btn " descr,				\
 }
 
@@ -100,14 +98,14 @@ static struct gpio_keys_button pandora_gpio_keys[] = {
 	GPIO_BUTTON_LOW(103,	KEY_DOWN,	"down"),
 	GPIO_BUTTON_LOW(96,	KEY_LEFT,	"left"),
 	GPIO_BUTTON_LOW(98,	KEY_RIGHT,	"right"),
-	GPIO_BUTTON_LOW(109,	KEY_KP1,	"game 1"),
-	GPIO_BUTTON_LOW(111,	KEY_KP2,	"game 2"),
-	GPIO_BUTTON_LOW(106,	KEY_KP3,	"game 3"),
-	GPIO_BUTTON_LOW(101,	KEY_KP4,	"game 4"),
-	GPIO_BUTTON_LOW(102,	BTN_TL,		"l"),
-	GPIO_BUTTON_LOW(97,	BTN_TL2,	"l2"),
-	GPIO_BUTTON_LOW(105,	BTN_TR,		"r"),
-	GPIO_BUTTON_LOW(107,	BTN_TR2,	"r2"),
+	GPIO_BUTTON_LOW(109,	KEY_PAGEUP,	"game 1"),
+	GPIO_BUTTON_LOW(111,	KEY_END,	"game 2"),
+	GPIO_BUTTON_LOW(106,	KEY_PAGEDOWN,	"game 3"),
+	GPIO_BUTTON_LOW(101,	KEY_HOME,	"game 4"),
+	GPIO_BUTTON_LOW(102,	KEY_RIGHTSHIFT,	"l"),
+	GPIO_BUTTON_LOW(97,	KEY_KPPLUS,	"l2"),
+	GPIO_BUTTON_LOW(105,	KEY_RIGHTCTRL,	"r"),
+	GPIO_BUTTON_LOW(107,	KEY_KPMINUS,	"r2"),
 	GPIO_BUTTON_LOW(104,	KEY_LEFTCTRL,	"ctrl"),
 	GPIO_BUTTON_LOW(99,	KEY_MENU,	"menu"),
 	GPIO_BUTTON_LOW(176,	KEY_COFFEE,	"hold"),
@@ -128,14 +126,7 @@ static struct platform_device pandora_keys_gpio = {
 	},
 };
 
-static void __init pandora_keys_gpio_init(void)
-{
-	/* set debounce time for GPIO banks 4 and 6 */
-	gpio_set_debounce(32 * 3, GPIO_DEBOUNCE_TIME);
-	gpio_set_debounce(32 * 5, GPIO_DEBOUNCE_TIME);
-}
-
-static int board_keymap[] = {
+static const uint32_t board_keymap[] = {
 	/* row, col, code */
 	KEY(0, 0, KEY_9),
 	KEY(0, 1, KEY_8),
@@ -598,7 +589,6 @@ static void __init omap3pandora_init(void)
 			ARRAY_SIZE(omap3pandora_spi_board_info));
 	omap3pandora_ads7846_init();
 	usb_ehci_init(&ehci_pdata);
-	pandora_keys_gpio_init();
 	usb_musb_init(&musb_board_data);
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] omap3: pandora: add NAND and wifi support
  2010-07-01 19:58 [PATCH 0/2] pandora updates for .36 Grazvydas Ignotas
  2010-07-01 19:58 ` [PATCH 1/2] omap3: pandora: update gpio-keys data Grazvydas Ignotas
@ 2010-07-01 19:58 ` Grazvydas Ignotas
  2010-07-05 10:05   ` Tony Lindgren
  2010-07-01 20:24 ` [PATCH 0/2] pandora updates for .36 Paul Walmsley
  2010-07-01 20:29 ` Gadiyar, Anand
  3 siblings, 1 reply; 9+ messages in thread
From: Grazvydas Ignotas @ 2010-07-01 19:58 UTC (permalink / raw)
  To: linux-omap; +Cc: Tony Lindgren, Grazvydas Ignotas

Add platform data for NAND and wifi, also setup all GPIOs
needed to use the wifi chip.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
 arch/arm/mach-omap2/board-omap3pandora.c |  121 ++++++++++++++++++++++++++++++
 1 files changed, 121 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 6131d98..690e0a7 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -29,7 +29,10 @@
 #include <linux/input.h>
 #include <linux/input/matrix_keypad.h>
 #include <linux/gpio_keys.h>
+#include <linux/spi/wl12xx.h>
 #include <linux/mmc/card.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/nand.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -42,13 +45,50 @@
 #include <plat/mcspi.h>
 #include <plat/usb.h>
 #include <plat/display.h>
+#include <plat/nand.h>
 
 #include "mux.h"
 #include "sdram-micron-mt46h32m32lf-6.h"
 #include "hsmmc.h"
 
+#define PANDORA_WIFI_IRQ_GPIO		21
+#define PANDORA_WIFI_NRESET_GPIO	23
 #define OMAP3_PANDORA_TS_GPIO		94
 
+#define NAND_BLOCK_SIZE			SZ_128K
+
+static struct mtd_partition omap3pandora_nand_partitions[] = {
+	{
+		.name           = "xloader",
+		.offset         = 0,
+		.size           = 4 * NAND_BLOCK_SIZE,
+		.mask_flags     = MTD_WRITEABLE
+	}, {
+		.name           = "uboot",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = 15 * NAND_BLOCK_SIZE,
+	}, {
+		.name           = "uboot-env",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = 1 * NAND_BLOCK_SIZE,
+	}, {
+		.name           = "boot",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = 80 * NAND_BLOCK_SIZE,
+	}, {
+		.name           = "rootfs",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = MTDPART_SIZ_FULL,
+	},
+};
+
+static struct omap_nand_platform_data pandora_nand_data = {
+	.cs		= 0,
+	.devsize	= 1,	/* '0' for 8-bit, '1' for 16-bit device */
+	.parts		= omap3pandora_nand_partitions,
+	.nr_parts	= ARRAY_SIZE(omap3pandora_nand_partitions),
+};
+
 static struct gpio_led pandora_gpio_leds[] = {
 	{
 		.name			= "pandora::sd1",
@@ -254,6 +294,7 @@ static struct omap2_hsmmc_info omap3pandora_mmc[] = {
 		.wires		= 4,
 		.gpio_cd	= -EINVAL,
 		.gpio_wp	= -EINVAL,
+		.ocr_mask	= 0x80,	/* MMC_VDD_165_195 */
 		.init_card	= pandora_wl1251_init_card,
 	},
 	{}	/* Terminator */
@@ -262,12 +303,33 @@ static struct omap2_hsmmc_info omap3pandora_mmc[] = {
 static int omap3pandora_twl_gpio_setup(struct device *dev,
 		unsigned gpio, unsigned ngpio)
 {
+	int ret, gpio_32khz;
+
 	/* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */
 	omap3pandora_mmc[0].gpio_cd = gpio + 0;
 	omap3pandora_mmc[1].gpio_cd = gpio + 1;
 	omap2_hsmmc_init(omap3pandora_mmc);
 
+	/* gpio + 13 drives 32kHz buffer for wifi module */
+	gpio_32khz = gpio + 13;
+	ret = gpio_request(gpio_32khz, "wifi 32kHz");
+	if (ret < 0) {
+		pr_err("Cannot get GPIO line %d, ret=%d\n", gpio_32khz, ret);
+		goto fail;
+	}
+
+	ret = gpio_direction_output(gpio_32khz, 1);
+	if (ret < 0) {
+		pr_err("Cannot set GPIO line %d, ret=%d\n", gpio_32khz, ret);
+		goto fail_direction;
+	}
+
 	return 0;
+
+fail_direction:
+	gpio_free(gpio_32khz);
+fail:
+	return -ENODEV;
 }
 
 static struct twl4030_gpio_platform_data omap3pandora_gpio_data = {
@@ -546,10 +608,67 @@ static void __init omap3pandora_init_irq(void)
 	omap_gpio_init();
 }
 
+static void pandora_wl1251_set_power(bool enable)
+{
+	/*
+	 * Keep power always on until wl1251_sdio driver learns to re-init
+	 * the chip after powering it down and back up.
+	 */
+}
+
+static struct wl12xx_platform_data pandora_wl1251_pdata = {
+	.set_power	= pandora_wl1251_set_power,
+	.use_eeprom	= true,
+};
+
+static struct platform_device pandora_wl1251_data = {
+	.name           = "wl1251_data",
+	.id             = -1,
+	.dev		= {
+		.platform_data	= &pandora_wl1251_pdata,
+	},
+};
+
+static void pandora_wl1251_init(void)
+{
+	int ret;
+
+	ret = gpio_request(PANDORA_WIFI_IRQ_GPIO, "wl1251 irq");
+	if (ret < 0)
+		goto fail;
+
+	ret = gpio_direction_input(PANDORA_WIFI_IRQ_GPIO);
+	if (ret < 0)
+		goto fail_irq;
+
+	pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
+	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:
+	printk(KERN_ERR "wl1251 board initialisation failed\n");
+}
+
 static struct platform_device *omap3pandora_devices[] __initdata = {
 	&pandora_leds_gpio,
 	&pandora_keys_gpio,
 	&pandora_dss_device,
+	&pandora_wl1251_data,
 };
 
 static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
@@ -582,6 +701,7 @@ static void __init omap3pandora_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	omap3pandora_i2c_init();
+	pandora_wl1251_init();
 	platform_add_devices(omap3pandora_devices,
 			ARRAY_SIZE(omap3pandora_devices));
 	omap_serial_init();
@@ -590,6 +710,7 @@ static void __init omap3pandora_init(void)
 	omap3pandora_ads7846_init();
 	usb_ehci_init(&ehci_pdata);
 	usb_musb_init(&musb_board_data);
+	gpmc_nand_init(&pandora_nand_data);
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
 	omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] pandora updates for .36
  2010-07-01 19:58 [PATCH 0/2] pandora updates for .36 Grazvydas Ignotas
  2010-07-01 19:58 ` [PATCH 1/2] omap3: pandora: update gpio-keys data Grazvydas Ignotas
  2010-07-01 19:58 ` [PATCH 2/2] omap3: pandora: add NAND and wifi support Grazvydas Ignotas
@ 2010-07-01 20:24 ` Paul Walmsley
  2010-07-01 20:29 ` Gadiyar, Anand
  3 siblings, 0 replies; 9+ messages in thread
From: Paul Walmsley @ 2010-07-01 20:24 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: linux-omap, Tony Lindgren

On Thu, 1 Jul 2010, Grazvydas Ignotas wrote:

> here are some updates for Pandora, which we have now around 700 units
> shipped (finally!) after years of developemt hell. More are being
> made at the moment.

Woohoo!  Congratulations to you and the rest of the team :-)


- Paul

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 0/2] pandora updates for .36
  2010-07-01 19:58 [PATCH 0/2] pandora updates for .36 Grazvydas Ignotas
                   ` (2 preceding siblings ...)
  2010-07-01 20:24 ` [PATCH 0/2] pandora updates for .36 Paul Walmsley
@ 2010-07-01 20:29 ` Gadiyar, Anand
  2010-07-02  6:52   ` Tony Lindgren
  3 siblings, 1 reply; 9+ messages in thread
From: Gadiyar, Anand @ 2010-07-01 20:29 UTC (permalink / raw)
  To: Grazvydas Ignotas, linux-omap@vger.kernel.org; +Cc: Tony Lindgren

Grazvydas Ignotas wrote:
> 
> Hi Tony,
> 
> here are some updates for Pandora, which we have now around 700 units
> shipped (finally!) after years of developemt hell. More are being
> made at the moment.
> 

Neat! Hope you sell a zillion. I'll try and buy one someday.

- Anand

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] pandora updates for .36
  2010-07-01 20:29 ` Gadiyar, Anand
@ 2010-07-02  6:52   ` Tony Lindgren
  0 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2010-07-02  6:52 UTC (permalink / raw)
  To: Gadiyar, Anand; +Cc: Grazvydas Ignotas, linux-omap@vger.kernel.org

* Gadiyar, Anand <gadiyar@ti.com> [100701 23:25]:
> Grazvydas Ignotas wrote:
> > 
> > Hi Tony,
> > 
> > here are some updates for Pandora, which we have now around 700 units
> > shipped (finally!) after years of developemt hell. More are being
> > made at the moment.
> > 
> 
> Neat! Hope you sell a zillion. I'll try and buy one someday.

Yeah congrats! I'll be buying one too at some point :)

Looking at all the patches for the merge window now, will queue
up the pandora changes too.

Tony

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [APPLIED] [PATCH 1/2] omap3: pandora: update gpio-keys data
  2010-07-01 19:58 ` [PATCH 1/2] omap3: pandora: update gpio-keys data Grazvydas Ignotas
@ 2010-07-05  9:58   ` Tony Lindgren
  0 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2010-07-05  9:58 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: devel-boards

Initial commit ID (Likely to change): 80572cd4a255c3241195a1762c5d947c7b602dff

PatchWorks
http://patchwork.kernel.org/patch/109372/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=80572cd4a255c3241195a1762c5d947c7b602dff



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] omap3: pandora: add NAND and wifi support
  2010-07-01 19:58 ` [PATCH 2/2] omap3: pandora: add NAND and wifi support Grazvydas Ignotas
@ 2010-07-05 10:05   ` Tony Lindgren
  2010-07-05 11:54     ` Grazvydas Ignotas
  0 siblings, 1 reply; 9+ messages in thread
From: Tony Lindgren @ 2010-07-05 10:05 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: linux-omap

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]

* Grazvydas Ignotas <notasas@gmail.com> [100701 22:52]:
> Add platform data for NAND and wifi, also setup all GPIOs
> needed to use the wifi chip.

I've applied this after tweaking it a bit to apply as the
SDIO series is getting merged via Andrew. Updated patch
below.

Regards,

Tony

[-- Attachment #2: pandora-wifi-nand.patch --]
[-- Type: text/x-diff, Size: 5332 bytes --]

>From ebc8d2747c38e35d3baf7967ac722b5e828d5800 Mon Sep 17 00:00:00 2001
From: Grazvydas Ignotas <notasas@gmail.com>
Date: Thu, 1 Jul 2010 19:58:21 +0000
Subject: [PATCH] Add platform data for NAND and wifi, also setup all GPIOs
 needed to use the wifi chip.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 7a12729..7cee651 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -29,6 +29,9 @@
 #include <linux/input.h>
 #include <linux/input/matrix_keypad.h>
 #include <linux/gpio_keys.h>
+#include <linux/spi/wl12xx.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/nand.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -41,13 +44,50 @@
 #include <plat/mcspi.h>
 #include <plat/usb.h>
 #include <plat/display.h>
+#include <plat/nand.h>
 
 #include "mux.h"
 #include "sdram-micron-mt46h32m32lf-6.h"
 #include "hsmmc.h"
 
+#define PANDORA_WIFI_IRQ_GPIO		21
+#define PANDORA_WIFI_NRESET_GPIO	23
 #define OMAP3_PANDORA_TS_GPIO		94
 
+#define NAND_BLOCK_SIZE			SZ_128K
+
+static struct mtd_partition omap3pandora_nand_partitions[] = {
+	{
+		.name           = "xloader",
+		.offset         = 0,
+		.size           = 4 * NAND_BLOCK_SIZE,
+		.mask_flags     = MTD_WRITEABLE
+	}, {
+		.name           = "uboot",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = 15 * NAND_BLOCK_SIZE,
+	}, {
+		.name           = "uboot-env",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = 1 * NAND_BLOCK_SIZE,
+	}, {
+		.name           = "boot",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = 80 * NAND_BLOCK_SIZE,
+	}, {
+		.name           = "rootfs",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = MTDPART_SIZ_FULL,
+	},
+};
+
+static struct omap_nand_platform_data pandora_nand_data = {
+	.cs		= 0,
+	.devsize	= 1,	/* '0' for 8-bit, '1' for 16-bit device */
+	.parts		= omap3pandora_nand_partitions,
+	.nr_parts	= ARRAY_SIZE(omap3pandora_nand_partitions),
+};
+
 static struct gpio_led pandora_gpio_leds[] = {
 	{
 		.name			= "pandora::sd1",
@@ -246,12 +286,33 @@ static struct omap2_hsmmc_info omap3pandora_mmc[] = {
 static int omap3pandora_twl_gpio_setup(struct device *dev,
 		unsigned gpio, unsigned ngpio)
 {
+	int ret, gpio_32khz;
+
 	/* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */
 	omap3pandora_mmc[0].gpio_cd = gpio + 0;
 	omap3pandora_mmc[1].gpio_cd = gpio + 1;
 	omap2_hsmmc_init(omap3pandora_mmc);
 
+	/* gpio + 13 drives 32kHz buffer for wifi module */
+	gpio_32khz = gpio + 13;
+	ret = gpio_request(gpio_32khz, "wifi 32kHz");
+	if (ret < 0) {
+		pr_err("Cannot get GPIO line %d, ret=%d\n", gpio_32khz, ret);
+		goto fail;
+	}
+
+	ret = gpio_direction_output(gpio_32khz, 1);
+	if (ret < 0) {
+		pr_err("Cannot set GPIO line %d, ret=%d\n", gpio_32khz, ret);
+		goto fail_direction;
+	}
+
 	return 0;
+
+fail_direction:
+	gpio_free(gpio_32khz);
+fail:
+	return -ENODEV;
 }
 
 static struct twl4030_gpio_platform_data omap3pandora_gpio_data = {
@@ -530,10 +591,67 @@ static void __init omap3pandora_init_irq(void)
 	omap_gpio_init();
 }
 
+static void pandora_wl1251_set_power(bool enable)
+{
+	/*
+	 * Keep power always on until wl1251_sdio driver learns to re-init
+	 * the chip after powering it down and back up.
+	 */
+}
+
+static struct wl12xx_platform_data pandora_wl1251_pdata = {
+	.set_power	= pandora_wl1251_set_power,
+	.use_eeprom	= true,
+};
+
+static struct platform_device pandora_wl1251_data = {
+	.name           = "wl1251_data",
+	.id             = -1,
+	.dev		= {
+		.platform_data	= &pandora_wl1251_pdata,
+	},
+};
+
+static void pandora_wl1251_init(void)
+{
+	int ret;
+
+	ret = gpio_request(PANDORA_WIFI_IRQ_GPIO, "wl1251 irq");
+	if (ret < 0)
+		goto fail;
+
+	ret = gpio_direction_input(PANDORA_WIFI_IRQ_GPIO);
+	if (ret < 0)
+		goto fail_irq;
+
+	pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
+	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:
+	printk(KERN_ERR "wl1251 board initialisation failed\n");
+}
+
 static struct platform_device *omap3pandora_devices[] __initdata = {
 	&pandora_leds_gpio,
 	&pandora_keys_gpio,
 	&pandora_dss_device,
+	&pandora_wl1251_data,
 };
 
 static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
@@ -566,6 +684,7 @@ static void __init omap3pandora_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	omap3pandora_i2c_init();
+	pandora_wl1251_init();
 	platform_add_devices(omap3pandora_devices,
 			ARRAY_SIZE(omap3pandora_devices));
 	omap_serial_init();
@@ -574,6 +693,7 @@ static void __init omap3pandora_init(void)
 	omap3pandora_ads7846_init();
 	usb_ehci_init(&ehci_pdata);
 	usb_musb_init(&musb_board_data);
+	gpmc_nand_init(&pandora_nand_data);
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
 	omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] omap3: pandora: add NAND and wifi support
  2010-07-05 10:05   ` Tony Lindgren
@ 2010-07-05 11:54     ` Grazvydas Ignotas
  0 siblings, 0 replies; 9+ messages in thread
From: Grazvydas Ignotas @ 2010-07-05 11:54 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap

On Mon, Jul 5, 2010 at 1:05 PM, Tony Lindgren <tony@atomide.com> wrote:
> * Grazvydas Ignotas <notasas@gmail.com> [100701 22:52]:
>> Add platform data for NAND and wifi, also setup all GPIOs
>> needed to use the wifi chip.
>
> I've applied this after tweaking it a bit to apply as the
> SDIO series is getting merged via Andrew. Updated patch
> below.

Thanks, but the card will not probe without the .ocr_mask part. We could either:
- take mmc patches 2 and 3 through linux-omap (they don't really
depend on patch 1) and ask Andrew to drop them
- I could send one-liner fix after the merge window for -rc or next
merge window in the worst case

both are ok with me.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-07-05 11:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-01 19:58 [PATCH 0/2] pandora updates for .36 Grazvydas Ignotas
2010-07-01 19:58 ` [PATCH 1/2] omap3: pandora: update gpio-keys data Grazvydas Ignotas
2010-07-05  9:58   ` [APPLIED] " Tony Lindgren
2010-07-01 19:58 ` [PATCH 2/2] omap3: pandora: add NAND and wifi support Grazvydas Ignotas
2010-07-05 10:05   ` Tony Lindgren
2010-07-05 11:54     ` Grazvydas Ignotas
2010-07-01 20:24 ` [PATCH 0/2] pandora updates for .36 Paul Walmsley
2010-07-01 20:29 ` Gadiyar, Anand
2010-07-02  6:52   ` 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).