How can we know Musb in the suspend mode when working as usb Host?

2010-04-14 Thread jung songtan
Hi Ajay and all the experts,

How can we know the Musb host enter in the suspend mode?
>From the datasheet, it will not have interrupt when enter suspend mode.

Thanks,
-- 
K T Jung
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 5/5(7)] OMAP1: Amstrad Delta: modify defconfig for external keyboard support

2010-04-14 Thread Janusz Krzysztofik
The patch adds a CONFIG directive required for supporting the Amstrad Delta
connected external keyboard by default.

Created and tested against linux-2.6.34-rc2.
Works on top of PATCH 4/5(7), "input: serio: add support for Amstrad Delta 
serial keyboard port".

Signed-off-by: Janusz Krzysztofik 
---
v2 changes:
- no functional changes,
- refreshed against linux-2.6.34-rc2.
v3 changes:
- since CONFIG_KEYBOARD_ATKBD and CONFIG_AMS_DELTA_FIQ are now selected 
  automatically, limit defconfig changes to CONFIG_SERIO_AMS_DELTA selection

 arch/arm/configs/ams_delta_defconfig |1 +
 1 file changed, 1 insertion(+)

--- git.orig/arch/arm/configs/ams_delta_defconfig   2010-04-14 
03:11:50.0 +0200
+++ git/arch/arm/configs/ams_delta_defconfig2010-04-15 03:29:05.0 
+0200
@@ -699,6 +699,7 @@ CONFIG_SERIO=y
 CONFIG_SERIO_SERPORT=y
 CONFIG_SERIO_LIBPS2=y
 # CONFIG_SERIO_RAW is not set
+CONFIG_SERIO_AMS_DELTA=y
 # CONFIG_GAMEPORT is not set
 
 #
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 4/5(7)] input: serio: add support for Amstrad Delta serial keyboard port

2010-04-14 Thread Janusz Krzysztofik
The patch introduces a serio driver that supports a keyboard serial port found
on the Amstrad Delta videophone board.

After initializing the hardware, the driver reads its input data from a buffer
filled in by the board FIQ (Fast Interrupt Request) handler.

Standard AT keyboard driver (atkbd) will be used on top of the serio layer for 
handling the E3 keyboard (called mailboard) connected to the port. Since the 
device generated scancodes differ from what the atkbd expects, a custom key 
code to scan code table must be loaded from userspace for the keyboard to be 
useable.

Compiles and works on top of PATCH v3 3/5(7), "OMAP1: Amstrad Delta: use FIQ 
for processing GPIO interrupts".

Created and tested against linux-2.6.34-rc4.

Signed-off-by: Janusz Krzysztofik 
---
v2 changes:
- use correct variable name for return value in ams_delta_kbd_init(),
- remove scan code to key code mapping,
- refreshed against linux-2.6.34-rc2.
v3 changes:
- cleanups suggested by Dmitry,
- force using of handle_simple_irq() to avoid GPIO register manipulation, 
  already handled at FIQ level,
- modify Kconfig for automatic AT keyboard and FIQ handler selection,
- misc cleanups.

 drivers/input/serio/Kconfig   |   17 +++
 drivers/input/serio/Makefile  |1
 drivers/input/serio/ams_delta_serio.c |  177 ++
 3 files changed, 195 insertions(+)

diff -uprN git.orig/drivers/input/serio/Kconfig git/drivers/input/serio/Kconfig
--- git.orig/drivers/input/serio/Kconfig2010-04-14 03:07:47.0 
+0200
+++ git/drivers/input/serio/Kconfig 2010-04-15 02:34:33.0 +0200
@@ -210,3 +210,20 @@ config SERIO_ALTERA_PS2
  module will be called altera_ps2.
 
 endif
+
+config SERIO_AMS_DELTA
+   tristate "Amstrad Delta (E3) mailboard support"
+   depends on MACH_AMS_DELTA
+   default y
+   select AMS_DELTA_FIQ
+   select KEYBOARD_ATKBD
+   ---help---
+ Say Y here if you have an E3 and want to use its mailboard,
+ or any standard AT keyboard connected to the mailboard port.
+
+ When used for the E3 mailboard, a non-standard key table
+ must be loaded from userspace, possibly using udev extras
+ provided keymap helper utility.
+
+ To compile this driver as a module, choose M here;
+ the module will be called ams_delta_serio
diff -uprN git.orig/drivers/input/serio/Makefile 
git/drivers/input/serio/Makefile
--- git.orig/drivers/input/serio/Makefile   2010-04-14 03:07:47.0 
+0200
+++ git/drivers/input/serio/Makefile2010-04-15 02:34:33.0 +0200
@@ -21,5 +21,6 @@ obj-$(CONFIG_SERIO_PCIPS2)+= pcips2.o
 obj-$(CONFIG_SERIO_MACEPS2)+= maceps2.o
 obj-$(CONFIG_SERIO_LIBPS2) += libps2.o
 obj-$(CONFIG_SERIO_RAW)+= serio_raw.o
+obj-$(CONFIG_SERIO_AMS_DELTA)  += ams_delta_serio.o
 obj-$(CONFIG_SERIO_XILINX_XPS_PS2) += xilinx_ps2.o
 obj-$(CONFIG_SERIO_ALTERA_PS2) += altera_ps2.o
diff -uprN git.orig/drivers/input/serio/ams_delta_serio.c 
git/drivers/input/serio/ams_delta_serio.c
--- git.orig/drivers/input/serio/ams_delta_serio.c  1970-01-01 
01:00:00.0 +0100
+++ git/drivers/input/serio/ams_delta_serio.c   2010-04-15 02:34:33.0 
+0200
@@ -0,0 +1,177 @@
+/*
+ *  Amstrad E3 (Delta) keyboard port driver
+ *
+ *  Copyright (c) 2006 Matt Callow
+ *  Copyright (c) 2010 Janusz Krzysztofik
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * Thanks to Cliff Lawson for his help
+ *
+ * The Amstrad Delta keyboard (aka mailboard) uses normal PC-AT style serial
+ * transmission.  The keyboard port is formed of two GPIO lines, for clock
+ * and data.  Due to strict timing requirements of the interface,
+ * the serial data stream is read and processed by a FIQ handler.
+ * The resulting words are fetched by this driver from a circular buffer.
+ *
+ * Standard AT keyboard driver (atkbd) is used for handling the keyboard data.
+ * However, when used with the E3 mailboard that producecs non-standard
+ * scancodes, a custom key table must be prepared and loaded from userspace.
+ */
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+MODULE_AUTHOR("Matt Callow");
+MODULE_DESCRIPTION("AMS Delta (E3) keyboard port driver");
+MODULE_LICENSE("GPL");
+
+static struct serio *ams_delta_serio;
+
+static int check_data(int data)
+{
+   int i, parity = 0;
+
+   /* check valid stop bit */
+   if (!(data & 0x400)) {
+   dev_warn(&ams_delta_serio->dev,
+   "invalid stop bit, data=0x%X\n",
+   data);
+   return SERIO_FRAME;
+   }
+   /* calculate the parity */
+   for (i = 1; i < 10; i++) {
+   if (data & (1 << i))
+   parity++;
+   }
+   /* it should

[PATCH v3 3/5(7)] OMAP1: Amstrad Delta: use FIQ for processing GPIO interrupts

2010-04-14 Thread Janusz Krzysztofik
The patch adds initialization of FIQ related handlers to the Amstrad Delta
videophone board code. FIQ will be used instead of a traditional IRQ for
processing all GPIO generated interrupts, including a keyboard serial clock 
line.

Created and tested against linux-2.6.34-rc4.
Compiles and works on top of PATCH v3 2/5(7), "OMAP1: Amstrad Delta: add a 
handler for processing interrupts generated by the FIQ routine". Also requires 
PATCH v3 2.1/5(7), "OMAP1: Amstrad Delta: update board initialization code 
for complete modem IRQ GPIO line setup" for correct modem handling.

Signed-off-by: Janusz Krzysztofik 
---
v2 changes:
- no functional changes,
- refreshed against linux-2.6.34-rc2.
v3 changes:
- drop intermediate defconfig modification

 arch/arm/mach-omap1/board-ams-delta.c |6 ++
 1 file changed, 6 insertions(+)

--- git.orig/arch/arm/mach-omap1/board-ams-delta.c  2010-04-14 
22:18:25.0 +0200
+++ git/arch/arm/mach-omap1/board-ams-delta.c   2010-04-14 23:52:07.0 
+0200
@@ -33,6 +33,8 @@
 #include 
 #include 
 
+#include 
+
 static u8 ams_delta_latch1_reg;
 static u16 ams_delta_latch2_reg;
 
@@ -236,6 +238,10 @@ static void __init ams_delta_init(void)
omap_usb_init(&ams_delta_usb_config);
platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
 
+#ifdef CONFIG_AMS_DELTA_FIQ
+   ams_delta_init_fiq();
+#endif
+
omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1);
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 2.1/5(7)] OMAP1: Amstrad Delta: update board initialization code for complete modem IRQ GPIO line setup

2010-04-14 Thread Janusz Krzysztofik
In case of Amstrad Delta modem utilized GPIO line, interrupt is requested from 
standard serial8250 driver code without first requesting the GPIO pin itself. 
Even if it works with default OMAP GPIO interrupt handler, it appeared not 
compatible with recent, optimized version of the board WiP GPIO FIQ handler, 
required for fast processing of interrupts generated by other GPIO pin that a 
serial keyboard clock hangs off.

This patch fills the board specific modem initialization routine with common 
GPIO line reservation and direction setup.

Even if included in the Amstrad Delta FIQ patch set, can be applied alone in 
advance as well, possibly as a fix.

Created and tested against linux-2.6.34-rc4.

Signed-off-by: Janusz Krzysztofik 
---

 arch/arm/mach-omap1/board-ams-delta.c |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

--- git.orig/arch/arm/mach-omap1/board-ams-delta.c  2010-04-14 
03:07:13.0 +0200
+++ git/arch/arm/mach-omap1/board-ams-delta.c   2010-04-14 21:58:12.0 
+0200
@@ -263,8 +263,18 @@ static struct platform_device ams_delta_
 
 static int __init ams_delta_modem_init(void)
 {
+   int err;
+
omap_cfg_reg(M14_1510_GPIO2);
-   ams_delta_modem_ports[0].irq = gpio_to_irq(2);
+   ams_delta_modem_ports[0].irq =
+   gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
+
+   err = gpio_request(AMS_DELTA_GPIO_PIN_MODEM_IRQ, "modem");
+   if (err) {
+   pr_err("Couldn't request gpio pin for modem\n");
+   return err;
+   }
+   gpio_direction_input(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
 
ams_delta_latch2_write(
AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC,
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 2/5(7)] OMAP1: Amstrad Delta: add a handler for processing interrupts generated by the FIQ routine

2010-04-14 Thread Janusz Krzysztofik
This patch introduces an IRQ handler used for processing interrupts generated
by the FIQ handler when it decides there are data ready for processing.

The handler further invokes device specific interrupt routines based on an
interrupt source as passed from the FIQ handler.

It can be registered by the board as a handler for the otherwise unused 32k
timer interrupt.

Created and tested against linux-2.6.34-rc4.
Applies on top of PATCH v3 1/5(7), "OMAP1: Amstrad Delta: add FIQ handler for 
serial keyboard port interrupt processing".

Signed-off-by: Janusz Krzysztofik 
---
v2 changes:
- add fiq_buffer[] declaration missing from the header file,
- refresh against 2.6.34-rc2.
v3 changes:
- follow Dmitry's serio cleanup suggestions here as well,
- follow default OMAP GPIO interrupt processing path more closely,
- more optimizations and cleanups.

 arch/arm/mach-omap1/Makefile |2
 arch/arm/mach-omap1/ams-delta-fiq.c  |  155 +++
 arch/arm/mach-omap1/include/mach/ams-delta-fiq.h |7 +
 3 files changed, 163 insertions(+), 1 deletion(-)

diff -uprN git.orig/arch/arm/mach-omap1/Makefile 
git/arch/arm/mach-omap1/Makefile
--- git.orig/arch/arm/mach-omap1/Makefile   2010-04-14 22:35:22.0 
+0200
+++ git/arch/arm/mach-omap1/Makefile2010-04-14 23:18:10.0 +0200
@@ -37,7 +37,7 @@ obj-$(CONFIG_MACH_OMAP_PALMZ71)   += boar
 obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o
 obj-$(CONFIG_MACH_NOKIA770)+= board-nokia770.o
 obj-$(CONFIG_MACH_AMS_DELTA)   += board-ams-delta.o
-obj-$(CONFIG_AMS_DELTA_FIQ)+= ams-delta-fiq-handler.o
+obj-$(CONFIG_AMS_DELTA_FIQ)+= ams-delta-fiq.o 
ams-delta-fiq-handler.o
 obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o
 obj-$(CONFIG_MACH_HERALD)  += board-htcherald.o
 
diff -uprN git.orig/arch/arm/mach-omap1/ams-delta-fiq.c 
git/arch/arm/mach-omap1/ams-delta-fiq.c
--- git.orig/arch/arm/mach-omap1/ams-delta-fiq.c1970-01-01 
01:00:00.0 +0100
+++ git/arch/arm/mach-omap1/ams-delta-fiq.c 2010-04-14 23:18:10.0 
+0200
@@ -0,0 +1,155 @@
+/*
+ *  Amstrad E3 FIQ handling
+ *
+ *  Copyright (C) 2009 Janusz Krzysztofik
+ *  Copyright (c) 2006 Matt Callow
+ *  Copyright (c) 2004 Amstrad Plc
+ *  Copyright (C) 2001 RidgeRun, Inc.
+ *
+ * Parts of this code are taken from linux/arch/arm/mach-omap/irq.c
+ * in the MontaVista 2.4 kernel (and the Amstrad changes therein)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+static struct fiq_handler fh = {
+   .name   = "ams-delta-fiq"
+};
+
+/*
+ * This buffer is shared between FIQ and IRQ contexts.
+ * The FIQ and IRQ isrs can both read and write it.
+ * It is structured as a header section several 32bit slots,
+ * followed by the circular buffer where the FIQ isr stores
+ * keystrokes received from the qwerty keyboard.
+ * See ams-delta-fiq.h for details of offsets.
+ */
+unsigned int fiq_buffer[1024];
+EXPORT_SYMBOL(fiq_buffer);
+
+static unsigned int irq_counter[16];
+
+static irqreturn_t deferred_fiq(int irq, void *dev_id)
+{
+   struct irq_desc *irq_desc;
+   struct irq_chip *irq_chip = NULL;
+   int gpio, irq_num, fiq_count;
+
+   irq_desc = irq_to_desc(IH_GPIO_BASE);
+   if (irq_desc)
+   irq_chip = irq_desc->chip;
+
+   /*
+* For each handled GPIO interrupt, keep calling its interrupt handler
+* until the IRQ counter catches the FIQ incremented interrupt counter.
+*/
+   for (gpio = AMS_DELTA_GPIO_PIN_KEYBRD_CLK;
+   gpio <= AMS_DELTA_GPIO_PIN_HOOK_SWITCH; gpio++) {
+   irq_num = gpio_to_irq(gpio);
+   fiq_count = fiq_buffer[FIQ_CNT_INT_00 + gpio];
+
+   while (irq_counter[gpio] < fiq_count) {
+   if (gpio != AMS_DELTA_GPIO_PIN_KEYBRD_CLK) {
+   /*
+* It looks like handle_edge_irq() that
+* OMAP GPIO edge interrupts default to,
+* expects interrupt already unmasked.
+*/
+   if (irq_chip && irq_chip->unmask)
+   irq_chip->unmask(irq_num);
+   }
+   generic_handle_irq(irq_num);
+
+   irq_counter[gpio]++;
+   }
+   }
+   return IRQ_HANDLED;
+}
+
+void __init ams_delta_init_fiq(void)
+{
+   void *fiqhandler_start;
+   unsigned int fiqhandler_length;
+   struct pt_regs FIQ_regs;
+   unsigned long val, offset;
+   int i, retval;
+
+   fiqhandler_start = &qwerty_fiqin

[PATCH v3 1/5(7)] OMAP1: Amstrad Delta: add FIQ handler for serial keyboard port interrupt processing

2010-04-14 Thread Janusz Krzysztofik
This patch introduces a Fast Interrupt Request (FIQ) handler for Amstrad Delta
(E3) videophone. The handler's purpose is to process interrupts generated by a
GPIO line that a serial keyboard clock hangs off. It collects consecutive bits
into words, pushing them into a buffer, then requests a higher level interrupt
after one or more words are ready for further processing by a keyboard port 
driver.

The handler also processes interrupts generated by two other GPIO lines, used
by other on-board supported devices, by simply requesting a higher level
interrupt, that in turn should invoke those device's specific irq handlers.

IRQ12 line, not used by OMAP1510 hardware (described as reserved), has been 
choosen as a higher level interrupt source.

Created and tested against linux-2.6.34-rc4.
Compiles on top of PATCH v3 0.1/5(7), "OMAP: add missing FIQ_START definition 
required for arch/arm/plat-omap/fiq.c compilation".

Signed-off-by: Janusz Krzysztofik 
---
v2 changes:
- no functional changes,
- refresh against linux-2.6.34-rc2.
v3 changes:
- assembler code optimizations suggested by Ralph Corderoy,
- (re)use existing header file provided macros where applicable instead of 
  defining new (from scratch); remove a lot of unnecessary defines,
- follow default OMAP GPIO interrupt processing path more closely,
- prepare for choosing arbitrary IRQ for deferred_fiq handler; use IRQ12 
  (reserved on OMAP1510) instead of Timer 32K dedicated IRQ,
- more optimizations for smaller code.

 arch/arm/mach-omap1/Kconfig  |   10
 arch/arm/mach-omap1/Makefile |1
 arch/arm/mach-omap1/ams-delta-fiq-handler.S  |  281 +++
 arch/arm/mach-omap1/include/mach/ams-delta-fiq.h |   72 +
 4 files changed, 364 insertions(+)

diff -uprN git.orig/arch/arm/mach-omap1/Kconfig git/arch/arm/mach-omap1/Kconfig
--- git.orig/arch/arm/mach-omap1/Kconfig2010-04-14 03:07:13.0 
+0200
+++ git/arch/arm/mach-omap1/Kconfig 2010-04-14 22:19:37.0 +0200
@@ -152,6 +152,16 @@ config MACH_AMS_DELTA
  Support for the Amstrad E3 (codename Delta) videophone. Say Y here
  if you have such a device.
 
+config AMS_DELTA_FIQ
+   bool "Fast Interrupt Request (FIQ) support for the E3"
+   depends on MACH_AMS_DELTA
+   select FIQ
+   help
+ Provide a FIQ handler for the E3.
+ This allows for fast handling of interrupts generated
+ by the clock line of the E3 mailboard (or a PS/2 keyboard)
+ connected to the GPIO based external keyboard port.
+
 config MACH_OMAP_GENERIC
bool "Generic OMAP board"
depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX)
diff -uprN git.orig/arch/arm/mach-omap1/Makefile 
git/arch/arm/mach-omap1/Makefile
--- git.orig/arch/arm/mach-omap1/Makefile   2010-04-14 03:07:13.0 
+0200
+++ git/arch/arm/mach-omap1/Makefile2010-04-14 22:19:37.0 +0200
@@ -37,6 +37,7 @@ obj-$(CONFIG_MACH_OMAP_PALMZ71)   += boar
 obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o
 obj-$(CONFIG_MACH_NOKIA770)+= board-nokia770.o
 obj-$(CONFIG_MACH_AMS_DELTA)   += board-ams-delta.o
+obj-$(CONFIG_AMS_DELTA_FIQ)+= ams-delta-fiq-handler.o
 obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o
 obj-$(CONFIG_MACH_HERALD)  += board-htcherald.o
 
diff -uprN git.orig/arch/arm/mach-omap1/ams-delta-fiq-handler.S 
git/arch/arm/mach-omap1/ams-delta-fiq-handler.S
--- git.orig/arch/arm/mach-omap1/ams-delta-fiq-handler.S1970-01-01 
01:00:00.0 +0100
+++ git/arch/arm/mach-omap1/ams-delta-fiq-handler.S 2010-04-14 
22:19:37.0 +0200
@@ -0,0 +1,281 @@
+/*
+ *  linux/arch/arm/mach-omap1/ams-delta-fiq-handler.S
+ *
+ *  Based on  linux/arch/arm/lib/floppydma.S
+ *  Renamed and modified to work with 2.6 kernel by Matt Callow
+ *  Copyright (C) 1995, 1996 Russell King
+ *  Copyright (C) 2004 Pete Trapps
+ *  Copyright (C) 2006 Matt Callow
+ *  Copyright (C) 2010 Janusz Krzysztofik
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ */
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+/*
+ * GPIO related definitions, copied from arch/arm/plat-omap/gpio.c.
+ * Unfortunately, those were not placed in a separate header file.
+ */
+#define OMAP1510_GPIO_BASE 0xFFFCE000
+#define OMAP1510_GPIO_DATA_INPUT   0x00
+#define OMAP1510_GPIO_DATA_OUTPUT  0x04
+#define OMAP1510_GPIO_DIR_CONTROL  0x08
+#define OMAP1510_GPIO_INT_CONTROL  0x0c
+#define OMAP1510_GPIO_INT_MASK 0x10
+#define OMAP1510_GPIO_INT_STATUS   0x14
+#define OMAP1510_GPIO_PIN_CONTROL  0x18
+
+/* GPIO register bitmasks */
+#define KEYBRD_DATA_MASK   (0x1 << AMS_DELTA_GPIO_PIN_KEYBRD_DATA)
+#define KEYBRD_CLK_MASK(0x1 << 
AM

[PATCH v3 0.1/5(7)] OMAP: add missing FIQ_START definition required for arch/arm/plat-omap/fiq.c compilation

2010-04-14 Thread Janusz Krzysztofik
Several ARM platforms/machines that use FIQ define their value of FIQ_START. 
Since FIQ is not implemented for OMAP yet, this definition is missing from 
OMAP header files.

Put an arbitrary value for FIQ_START into plat/irqs.h for OMAP. Even if not 
used by the WiP FIQ handler for Amstrad Delta, this is required for 
successfull compilation of arch/arm/plat-omap/fiq.c that provides several 
usefull functions.

Even if prepended in front of the Amstrad Delta FIQ patch set, can be applied 
alone in advance as well, possibly as a fix.

Created and tested against linux-2.6.34-rc4.

Signed-off-by: Janusz Krzysztofik 
---

 arch/arm/plat-omap/include/plat/irqs.h |4 
 1 file changed, 4 insertions(+)

--- git.orig/arch/arm/plat-omap/include/plat/irqs.h 2010-04-14 
03:07:16.0 +0200
+++ git/arch/arm/plat-omap/include/plat/irqs.h  2010-04-14 22:28:05.0 
+0200
@@ -430,4 +430,8 @@ void omap3_intc_resume_idle(void);
 
 #include 
 
+#ifdef CONFIG_FIQ
+#define FIQ_START  1024
+#endif
+
 #endif
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 0/5(7)] OMAP1: Amstrad Delta: add FIQ based support for external keyboard

2010-04-14 Thread Janusz Krzysztofik
This series of patches adds support for an external keyboard (called 
mailboard) connected to the Amstrad Delta (E3) videophone.

The series is based on a patch by Matt Callow, created against
linux-omap-2.6.19[1], initially submitted to the e3-hacking mailing list in
April 2006[2].

Since the keyboard serial clock line is connected to a GPIO line, it generates
interrupts every single bit received. In order to handle this correctly, the
code makes use of a FIQ hardware feature. Since all GPIO generated interrupts 
would be converted to FIQ, the handler must include support for all supported 
GPIO connected devices: the keyboard, a modem and a hook switch.

My initial modifications to the original patch included:
- split into several patches,
- refresh against a recent linux version,
- a lot of cleanups, mainly to get rid of checkpatch reported issues,
- add support for handling interrupts generated by a GPIO line that the 
  meanwhile activated hook switch hangs off.
v2 changes:
- remove scan code to key code mapping from the serio driver, that doesn't 
  belong here and should be set up from userspace; thanks to Dmitry Torokhov 
  for advising this,
- no funtional changes in FIQ part (there were no comments in round 1).
v3 changes:
- cleanups suggested by Dmitry (applied not only to serio bits),
- assembly code optimizations suggested by Ralph Corderoy,
- (re)use existing header file provided macros where applicable instead of 
  defining new; remove a lot of unnecessary defines,
- extract missing FIQ_START definition fix into an extra patch numbered 
  0.1/5(7),
- modify both fiq and deferred_fiq handlers to follow default OMAP GPIO 
  interrupt processing path more closely,
- update board initialization code for complete modem IRQ GPIO line setup; 
  this appeared essential for correct interaction with optimized FIQ handler; 
  change is provided as a separate patch numbered 2.1/5(7),
- use IRQ12 (reserved on OMAP1510) for requesting deferred_fiq handler instead 
  of TIMER32k dedicated IRQ,
- more optimizations in both assembly and C code,
- modify serio Kconfig for automatic AT keyboard and FIQ handler selection,
- drop intermediate defconfig changes.

Created and tested against linux-2.6.34-rc4.

Janusz Krzysztofik(7)
OMAP: add missing FIQ_START definition, required by 
arch/arm/plat-omap/fiq.c
OMAP1: Amstrad Delta: add FIQ handler for serial keyboard port interrupt
processing
OMAP1: Amstrad Delta: add a handler for processing interrupts generated 
by
the FIQ routine
OMAP1: Amstrad Delta: update board initialization code for complete 
modem IRQ 
GPIO line setup
OMAP1: Amstrad Delta: use FIQ for processing GPIO interrupts
input: serio: add support for Amstrad Delta serial keyboard port
OMAP1: Amstrad Delta: modify defconfig for external keyboard support

 arch/arm/configs/ams_delta_defconfig |1
 arch/arm/mach-omap1/Kconfig  |   10
 arch/arm/mach-omap1/Makefile |3
 arch/arm/mach-omap1/ams-delta-fiq-handler.S  |  281 +++
 arch/arm/mach-omap1/ams-delta-fiq.c  |  155 
 arch/arm/mach-omap1/board-ams-delta.c|   18 +
 arch/arm/mach-omap1/include/mach/ams-delta-fiq.h |   79 ++
 arch/arm/plat-omap/include/plat/irqs.h   |4
 drivers/input/serio/Kconfig  |   17 +
 drivers/input/serio/Makefile |1
 drivers/input/serio/ams_delta_serio.c|  177 ++
 11 files changed, 744 insertions(+), 2 deletions(-)

Thanks,
Janusz

[1] http://the.earth.li/pub/e3/2.6.19/ams-delta-keyboard.patch
[2] http://www.earth.li/pipermail/e3-hacking/2006-April/000453.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] omap: pm34xx: Remove PER wakeup dependency on CORE.

2010-04-14 Thread Mike Chan
We can remove this wakeup dependency since now, when
GPIO2-6 are enabled for IO-pad wakeup, PER domain is gauranteed
to be awake or be woken up to service.

The previous dependency did not handle all corner cases. Since there
was no sleep dependency between CORE and PER domains, if PER enters
RET and CORE is ON, PER will not be active for GPIO handling.

Signed-off-by: Mike Chan 
---
 arch/arm/mach-omap2/pm34xx.c |8 
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 4ef322a..176870f 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -1086,14 +1086,6 @@ static int __init omap3_pm_init(void)
omap3_idle_init();
 
clkdm_add_wkdep(neon_clkdm, mpu_clkdm);
-   /*
-* REVISIT: This wkdep is only necessary when GPIO2-6 are enabled for
-* IO-pad wakeup.  Otherwise it will unnecessarily waste power
-* waking up PER with every CORE wakeup - see
-* http://marc.info/?l=linux-omap&m=121852150710062&w=2
-   */
-   clkdm_add_wkdep(per_clkdm, core_clkdm);
-
if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
omap3_secure_ram_storage =
kmalloc(0x803F, GFP_KERNEL);
-- 
1.7.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] omap: pm34xx: Enable IO / IO-CHAIN wakeups for PER

2010-04-14 Thread Mike Chan
IO events can also come from GPIO modules, which reside in the PER domain.
It is possible for the PER to enter RET while CORE is still in ON.
If GPIO 2-6 are enabled for IO-pad wakeups, the PER domain will not
wakeup in this case, unless we enable it.

Signed-off-by: Mike Chan 
---
 arch/arm/mach-omap2/pm34xx.c |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index eab..4ef322a 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -398,10 +398,15 @@ void omap_sram_idle(void)
omap3_core_save_context();
omap3_prcm_save_context();
}
-   /* Enable IO-PAD and IO-CHAIN wakeups */
+   }
+
+   /* Enable IO-PAD and IO-CHAIN wakeups */
+   if (per_next_state < PWRDM_POWER_ON ||
+   core_next_state < PWRDM_POWER_ON) {
prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
omap3_enable_io_chain();
}
+
omap3_intc_prepare_idle();
 
/*
@@ -463,7 +468,8 @@ void omap_sram_idle(void)
}
 
/* Disable IO-PAD and IO-CHAIN wakeup */
-   if (core_next_state < PWRDM_POWER_ON) {
+   if (per_next_state < PWRDM_POWER_ON ||
+   core_next_state < PWRDM_POWER_ON) {
prm_clear_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
omap3_disable_io_chain();
}
-- 
1.7.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 12/12] AM3517: Add mmc platform data for am3517evm

2010-04-14 Thread Hiremath, Vaibhav

> -Original Message-
> From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> ow...@vger.kernel.org] On Behalf Of Stanley.Miao
> Sent: Wednesday, April 14, 2010 2:03 PM
> To: linux-omap@vger.kernel.org
> Cc: t...@atomide.com; Chikkature Rajashekar, Madhusudhan
> Subject: [PATCH 12/12] AM3517: Add mmc platform data for am3517evm
> 
> Add mmc platform data. Besides, the mmc slot on UI board has a pin conflict
> with LCD, so add macros to resolve it.
[Hiremath, Vaibhav] Can you please describe it details, and mention which pins 
are getting conflicted.

> 
> Signed-off-by: Stanley.Miao 
> ---
>  arch/arm/mach-omap2/Makefile  |3 +-
>  arch/arm/mach-omap2/board-am3517evm.c |   45
> +
>  2 files changed, 47 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 4b9fc57..e94afdd 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -142,7 +142,8 @@ obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK)+= board-
> omap3touchbook.o \
>  hsmmc.o
>  obj-$(CONFIG_MACH_OMAP_4430SDP)  += board-4430sdp.o
> 
> -obj-$(CONFIG_MACH_OMAP3517EVM)   += board-am3517evm.o
> +obj-$(CONFIG_MACH_OMAP3517EVM)   += board-am3517evm.o \
> +hsmmc.o
> 
>  # Platform specific device init code
>  obj-y+= usb-musb.o
> diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-
> omap2/board-am3517evm.c
> index 6a82ac3..8054994 100644
> --- a/arch/arm/mach-omap2/board-am3517evm.c
> +++ b/arch/arm/mach-omap2/board-am3517evm.c
> @@ -26,6 +26,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
> 
>  #include 
>  #include 
> @@ -40,7 +41,9 @@
>  #include 
>  #include 
>  #include 
> +#include 
> 
> +#include "hsmmc.h"
>  #include "mux.h"
> 
>  #define LCD_PANEL_PWR176
> @@ -440,6 +443,8 @@ static int __init am3517_evm_i2c_init(void)
>  static int lcd_enabled;
>  static int dvi_enabled;
> 
> +#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
> + defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
[Hiremath, Vaibhav] I don't think this is right approach, we are completely 
blocking the display here which is wrong. 

The approach should be limited to LCD panel and not whole display.

So NAK from me.

>  static void __init am3517_evm_display_init(void)
>  {
>   int r;
> @@ -501,6 +506,20 @@ static void am3517_evm_panel_disable_lcd(struct
> omap_dss_device *dssdev)
>   gpio_set_value(LCD_PANEL_PWR, 0);
>   lcd_enabled = 0;
>  }
> +#else
> +static inline void __init am3517_evm_display_init(void)
> +{
> +}
> +
> +static inline int am3517_evm_panel_enable_lcd(struct omap_dss_device
> *dssdev)
> +{
> + return 0;
> +}
> +
> +static inline void am3517_evm_panel_disable_lcd(struct omap_dss_device
> *dssdev)
> +{
> +}
> +#endif
> 
>  static struct omap_dss_device am3517_evm_lcd_device = {
>   .type   = OMAP_DISPLAY_TYPE_DPI,
> @@ -613,6 +632,30 @@ static struct omap_board_mux board_mux[] __initdata = {
>  #define board_muxNULL
>  #endif
> 
> +static struct omap2_hsmmc_info mmc[] = {
> + {
> + .mmc= 1,
> + .wires  = 4,
> + .gpio_cd= 127,
> + .gpio_wp= 126,
> + .ocr_mask   = MMC_VDD_165_195 |
> + MMC_VDD_26_27 | MMC_VDD_27_28 |
> + MMC_VDD_29_30 |
> + MMC_VDD_30_31 | MMC_VDD_31_32,
> + },
> +#if !defined(CONFIG_PANEL_SHARP_LQ043T1DG01) && \
> + !defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
> + {
> + .mmc= 2,
> + .wires  = 4,
> + .gpio_cd= 175,
> + .gpio_wp= 176,
> + .ocr_mask   = MMC_VDD_165_195,
> + },
> +#endif
> + {}  /* Terminator */
> +};
[Hiremath, Vaibhav] Can you split this patch in 2, first submit only baseboard 
MMC (MMC1) slot support and then work on MMC2 slot on UI card.

Thanks,
Vaibhav

> +
>  static void __init am3517_evm_init(void)
>  {
>   omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> @@ -636,6 +679,8 @@ static void __init am3517_evm_init(void)
> 
>   i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
>   ARRAY_SIZE(am3517evm_i2c1_boardinfo));
> + /* MMC init function */
> + omap2_hsmmc_init(mmc);
>  }
> 
>  static void __init am3517_evm_map_io(void)
> --
> 1.5.4.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majord

Re: [PATCH v5] board-omap3-beagle: add DSS2 support

2010-04-14 Thread Koen Kooi

Op 14 apr 2010, om 15:56 heeft Hiremath, Vaibhav het volgende geschreven:
>> 
>> +static struct regulator_consumer_supply beagle_vdvi_supply =
>> +REGULATOR_SUPPLY("vdds_dsi", "omapdss")l
>> +
> [Hiremath, Vaibhav] Koen, sorry but I think in hurry you miss-types it to 'l' 
> instead of semi-colon.
> 
> Let's get another cup of coffee.

I'll wait till tomorrow and re-test it on the device :)


> 
> Thanks,
> Vaibhav
> 
> 
>> +static void __init beagle_display_init(void)
>> +{
>> +int r;
>> +
>> +r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
>> +if (r < 0) {
>> +printk(KERN_ERR "Unable to get DVI reset GPIO\n");
>> +return;
>> +}
>> +
>> +gpio_direction_output(beagle_dvi_device.reset_gpio, 0);
>> +}
>> +
>> #include "sdram-micron-mt46h32m32lf-6.h"
>> 
>> static struct omap2_hsmmc_info mmc[] = {
>> @@ -117,15 +189,6 @@ static struct omap2_hsmmc_info mmc[] = {
>>  {}  /* Terminator */
>> };
>> 
>> -static struct platform_device omap3_beagle_lcd_device = {
>> -.name   = "omap3beagle_lcd",
>> -.id = -1,
>> -};
>> -
>> -static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
>> -.ctrl_name  = "internal",
>> -};
>> -
>> static struct regulator_consumer_supply beagle_vmmc1_supply = {
>>  .supply = "vmmc",
>> };
>> @@ -181,16 +244,6 @@ static struct twl4030_gpio_platform_data
>> beagle_gpio_data = {
>>  .setup  = beagle_twl_gpio_setup,
>> };
>> 
>> -static struct regulator_consumer_supply beagle_vdac_supply = {
>> -.supply = "vdac",
>> -.dev= &omap3_beagle_lcd_device.dev,
>> -};
>> -
>> -static struct regulator_consumer_supply beagle_vdvi_supply = {
>> -.supply = "vdvi",
>> -.dev= &omap3_beagle_lcd_device.dev,
>> -};
>> -
>> /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220
>> mA) */
>> static struct regulator_init_data beagle_vmmc1 = {
>>  .constraints = {
>> @@ -349,14 +402,8 @@ static struct platform_device keys_gpio = {
>>  },
>> };
>> 
>> -static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
>> -{ OMAP_TAG_LCD, &omap3_beagle_lcd_config },
>> -};
>> -
>> static void __init omap3_beagle_init_irq(void)
>> {
>> -omap_board_config = omap3_beagle_config;
>> -omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
>>  omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
>>   mt46h32m32lf6_sdrc_params);
>>  omap_init_irq();
>> @@ -367,9 +414,9 @@ static void __init omap3_beagle_init_irq(void)
>> }
>> 
>> static struct platform_device *omap3_beagle_devices[] __initdata = {
>> -&omap3_beagle_lcd_device,
>>  &leds_gpio,
>>  &keys_gpio,
>> +&beagle_dss_device,
>> };
>> 
>> static void __init omap3beagle_flash_init(void)
>> @@ -456,8 +503,9 @@ static void __init omap3_beagle_init(void)
>>  /* Ensure SDRC pins are mux'd for self-refresh */
>>  omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
>>  omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
>> -}
>> 
>> +beagle_display_init();
>> +}
>> static void __init omap3_beagle_map_io(void)
>> {
>>  omap2_set_globals_343x();
>> --
>> 1.6.6.1
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v5] board-omap3-beagle: add DSS2 support

2010-04-14 Thread Hiremath, Vaibhav

> -Original Message-
> From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> ow...@vger.kernel.org] On Behalf Of Koen Kooi
> Sent: Wednesday, April 14, 2010 7:04 PM
> To: tomi.valkei...@nokia.com; t...@atomide.com
> Cc: linux-omap@vger.kernel.org; Koen Kooi
> Subject: [PATCH v5] board-omap3-beagle: add DSS2 support
> 
> This patch adds DSS2 support to the beagleboard boardfile. DVI and TV-out
> are supported.
> 
> Signed-off-by: Koen Kooi 
> ---
> 
> Changes since v1:
> * removed beagle_panel_enable_tv() and beagle_panel_disable_tv()
> Changes since v2:
> * changed to REGULATOR_SUPPLY(_name, _dev_name) for dss regulators
> Changes since v3:
> * really remove beagle_panel_enable_tv() and
> beagle_panel_disable_tv()
> * moved comments to this section
> Chages since v4:
> * remove trailing whitespace
> 
>  arch/arm/mach-omap2/board-omap3beagle.c |  102 ++--
> --
>  1 files changed, 75 insertions(+), 27 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-
> omap2/board-omap3beagle.c
> index 962d377..ff17d51 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -39,6 +39,7 @@
> 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -106,6 +107,77 @@ static struct platform_device omap3beagle_nand_device =
> {
>   .resource   = &omap3beagle_nand_resource,
>  };
> 
> +/* DSS */
> +
> +static int beagle_enable_dvi(struct omap_dss_device *dssdev)
> +{
> + if (dssdev->reset_gpio != -1)
> + gpio_set_value(dssdev->reset_gpio, 1);
> +
> + return 0;
> +}
> +
> +static void beagle_disable_dvi(struct omap_dss_device *dssdev)
> +{
> + if (dssdev->reset_gpio != -1)
> + gpio_set_value(dssdev->reset_gpio, 0);
> +}
> +
> +static struct omap_dss_device beagle_dvi_device = {
> + .type = OMAP_DISPLAY_TYPE_DPI,
> + .name = "dvi",
> + .driver_name = "generic_panel",
> + .phy.dpi.data_lines = 24,
> + .reset_gpio = 170,
> + .platform_enable = beagle_enable_dvi,
> + .platform_disable = beagle_disable_dvi,
> +};
> +
> +static struct omap_dss_device beagle_tv_device = {
> + .name = "tv",
> + .driver_name = "venc",
> + .type = OMAP_DISPLAY_TYPE_VENC,
> + .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
> +};
> +
> +static struct omap_dss_device *beagle_dss_devices[] = {
> + &beagle_dvi_device,
> + &beagle_tv_device,
> +};
> +
> +static struct omap_dss_board_info beagle_dss_data = {
> + .num_devices = ARRAY_SIZE(beagle_dss_devices),
> + .devices = beagle_dss_devices,
> + .default_device = &beagle_dvi_device,
> +};
> +
> +static struct platform_device beagle_dss_device = {
> + .name  = "omapdss",
> + .id= -1,
> + .dev= {
> + .platform_data = &beagle_dss_data,
> + },
> +};
> +
> +static struct regulator_consumer_supply beagle_vdac_supply =
> + REGULATOR_SUPPLY("vdda_dac", "omapdss");
> +
> +static struct regulator_consumer_supply beagle_vdvi_supply =
> + REGULATOR_SUPPLY("vdds_dsi", "omapdss")l
> +
[Hiremath, Vaibhav] Koen, sorry but I think in hurry you miss-types it to 'l' 
instead of semi-colon.

Let's get another cup of coffee.

Thanks,
Vaibhav


> +static void __init beagle_display_init(void)
> +{
> + int r;
> +
> + r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
> + if (r < 0) {
> + printk(KERN_ERR "Unable to get DVI reset GPIO\n");
> + return;
> + }
> +
> + gpio_direction_output(beagle_dvi_device.reset_gpio, 0);
> +}
> +
>  #include "sdram-micron-mt46h32m32lf-6.h"
> 
>  static struct omap2_hsmmc_info mmc[] = {
> @@ -117,15 +189,6 @@ static struct omap2_hsmmc_info mmc[] = {
>   {}  /* Terminator */
>  };
> 
> -static struct platform_device omap3_beagle_lcd_device = {
> - .name   = "omap3beagle_lcd",
> - .id = -1,
> -};
> -
> -static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
> - .ctrl_name  = "internal",
> -};
> -
>  static struct regulator_consumer_supply beagle_vmmc1_supply = {
>   .supply = "vmmc",
>  };
> @@ -181,16 +244,6 @@ static struct twl4030_gpio_platform_data
> beagle_gpio_data = {
>   .setup  = beagle_twl_gpio_setup,
>  };
> 
> -static struct regulator_consumer_supply beagle_vdac_supply = {
> - .supply = "vdac",
> - .dev= &omap3_beagle_lcd_device.dev,
> -};
> -
> -static struct regulator_consumer_supply beagle_vdvi_supply = {
> - .supply = "vdvi",
> - .dev= &omap3_beagle_lcd_device.dev,
> -};
> -
>  /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220
> mA) */
>  static struct regulator_init_data beagle_vmmc1 = {
>   .constraints = {
> @@ -349,14 +402,8 @@ static struct platform_device keys_gpio = {
>   },
>  };
> 
> -static struc

RE: [PATCH 09/12] AM3517: Update the config file of am3517evm

2010-04-14 Thread Hiremath, Vaibhav
> -Original Message-
> From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> ow...@vger.kernel.org] On Behalf Of Stanley.Miao
> Sent: Wednesday, April 14, 2010 2:00 PM
> To: linux-omap@vger.kernel.org
> Cc: t...@atomide.com
> Subject: [PATCH 09/12] AM3517: Update the config file of am3517evm
>
> Added MTD, NETDEVICES, WATCHDOG, GPIO_PCA953X, REGULATOR, FB, SOUND, MMC,
> RTC.
[Hiremath, Vaibhav] The patch for selection of FB in default config has already 
been submitted and merged by Tomi; please refer to the tread,

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

Thanks,
Vaibhav

>
> Signed-off-by: Stanley.Miao 
> ---
>  arch/arm/configs/am3517_evm_defconfig |  599 --
> ---
>  1 files changed, 513 insertions(+), 86 deletions(-)
>
> diff --git a/arch/arm/configs/am3517_evm_defconfig
> b/arch/arm/configs/am3517_evm_defconfig
> index 66a10b5..a995767 100644
> --- a/arch/arm/configs/am3517_evm_defconfig
> +++ b/arch/arm/configs/am3517_evm_defconfig
> @@ -1,13 +1,14 @@
>  #
>  # Automatically generated make config: don't edit
> -# Linux kernel version: 2.6.32-rc5
> -# Wed Oct 28 15:47:47 2009
> +# Linux kernel version: 2.6.34-rc3
> +# Wed Apr 14 16:07:52 2010
>  #
>  CONFIG_ARM=y
>  CONFIG_SYS_SUPPORTS_APM_EMULATION=y
>  CONFIG_GENERIC_GPIO=y
>  CONFIG_GENERIC_TIME=y
>  CONFIG_GENERIC_CLOCKEVENTS=y
> +CONFIG_HAVE_PROC_CPU=y
>  CONFIG_GENERIC_HARDIRQS=y
>  CONFIG_STACKTRACE_SUPPORT=y
>  CONFIG_HAVE_LATENCYTOP_SUPPORT=y
> @@ -19,7 +20,9 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
>  CONFIG_ARCH_HAS_CPUFREQ=y
>  CONFIG_GENERIC_HWEIGHT=y
>  CONFIG_GENERIC_CALIBRATE_DELAY=y
> +CONFIG_NEED_DMA_MAP_STATE=y
>  CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
> +CONFIG_ARM_L1_CACHE_SHIFT_6=y
>  CONFIG_VECTORS_BASE=0x
>  CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
>  CONFIG_CONSTRUCTORS=y
> @@ -32,6 +35,12 @@ CONFIG_BROKEN_ON_SMP=y
>  CONFIG_INIT_ENV_ARG_LIMIT=32
>  CONFIG_LOCALVERSION=""
>  CONFIG_LOCALVERSION_AUTO=y
> +CONFIG_HAVE_KERNEL_GZIP=y
> +CONFIG_HAVE_KERNEL_LZO=y
> +CONFIG_KERNEL_GZIP=y
> +# CONFIG_KERNEL_BZIP2 is not set
> +# CONFIG_KERNEL_LZMA is not set
> +# CONFIG_KERNEL_LZO is not set
>  CONFIG_SWAP=y
>  CONFIG_SYSVIPC=y
>  CONFIG_SYSVIPC_SYSCTL=y
> @@ -46,17 +55,13 @@ CONFIG_BSD_PROCESS_ACCT=y
>  #
>  CONFIG_TREE_RCU=y
>  # CONFIG_TREE_PREEMPT_RCU is not set
> +# CONFIG_TINY_RCU is not set
>  # CONFIG_RCU_TRACE is not set
>  CONFIG_RCU_FANOUT=32
>  # CONFIG_RCU_FANOUT_EXACT is not set
>  # CONFIG_TREE_RCU_TRACE is not set
>  # CONFIG_IKCONFIG is not set
>  CONFIG_LOG_BUF_SHIFT=14
> -CONFIG_GROUP_SCHED=y
> -CONFIG_FAIR_GROUP_SCHED=y
> -# CONFIG_RT_GROUP_SCHED is not set
> -CONFIG_USER_SCHED=y
> -# CONFIG_CGROUP_SCHED is not set
>  # CONFIG_CGROUPS is not set
>  CONFIG_SYSFS_DEPRECATED=y
>  CONFIG_SYSFS_DEPRECATED_V2=y
> @@ -67,6 +72,7 @@ CONFIG_INITRAMFS_SOURCE=""
>  CONFIG_RD_GZIP=y
>  # CONFIG_RD_BZIP2 is not set
>  # CONFIG_RD_LZMA is not set
> +# CONFIG_RD_LZO is not set
>  CONFIG_CC_OPTIMIZE_FOR_SIZE=y
>  CONFIG_SYSCTL=y
>  CONFIG_ANON_INODES=y
> @@ -88,10 +94,14 @@ CONFIG_TIMERFD=y
>  CONFIG_EVENTFD=y
>  CONFIG_SHMEM=y
>  CONFIG_AIO=y
> +CONFIG_HAVE_PERF_EVENTS=y
> +CONFIG_PERF_USE_VMALLOC=y
>
>  #
>  # Kernel Performance Events And Counters
>  #
> +# CONFIG_PERF_EVENTS is not set
> +# CONFIG_PERF_COUNTERS is not set
>  CONFIG_VM_EVENT_COUNTERS=y
>  CONFIG_COMPAT_BRK=y
>  CONFIG_SLAB=y
> @@ -127,14 +137,41 @@ CONFIG_LBDAF=y
>  # IO Schedulers
>  #
>  CONFIG_IOSCHED_NOOP=y
> -CONFIG_IOSCHED_AS=y
>  CONFIG_IOSCHED_DEADLINE=y
>  CONFIG_IOSCHED_CFQ=y
> -CONFIG_DEFAULT_AS=y
>  # CONFIG_DEFAULT_DEADLINE is not set
> -# CONFIG_DEFAULT_CFQ is not set
> +CONFIG_DEFAULT_CFQ=y
>  # CONFIG_DEFAULT_NOOP is not set
> -CONFIG_DEFAULT_IOSCHED="anticipatory"
> +CONFIG_DEFAULT_IOSCHED="cfq"
> +# CONFIG_INLINE_SPIN_TRYLOCK is not set
> +# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
> +# CONFIG_INLINE_SPIN_LOCK is not set
> +# CONFIG_INLINE_SPIN_LOCK_BH is not set
> +# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
> +# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
> +CONFIG_INLINE_SPIN_UNLOCK=y
> +# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
> +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
> +# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
> +# CONFIG_INLINE_READ_TRYLOCK is not set
> +# CONFIG_INLINE_READ_LOCK is not set
> +# CONFIG_INLINE_READ_LOCK_BH is not set
> +# CONFIG_INLINE_READ_LOCK_IRQ is not set
> +# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
> +CONFIG_INLINE_READ_UNLOCK=y
> +# CONFIG_INLINE_READ_UNLOCK_BH is not set
> +CONFIG_INLINE_READ_UNLOCK_IRQ=y
> +# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
> +# CONFIG_INLINE_WRITE_TRYLOCK is not set
> +# CONFIG_INLINE_WRITE_LOCK is not set
> +# CONFIG_INLINE_WRITE_LOCK_BH is not set
> +# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
> +# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
> +CONFIG_INLINE_WRITE_UNLOCK=y
> +# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
> +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
> +# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not s

[PATCH v5] board-omap3-beagle: add DSS2 support

2010-04-14 Thread Koen Kooi
This patch adds DSS2 support to the beagleboard boardfile. DVI and TV-out are 
supported.

Signed-off-by: Koen Kooi 
---

Changes since v1:
* removed beagle_panel_enable_tv() and beagle_panel_disable_tv()
Changes since v2:
* changed to REGULATOR_SUPPLY(_name, _dev_name) for dss regulators
Changes since v3:
* really remove beagle_panel_enable_tv() and beagle_panel_disable_tv()
* moved comments to this section
Chages since v4:
* remove trailing whitespace

 arch/arm/mach-omap2/board-omap3beagle.c |  102 ++
 1 files changed, 75 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 962d377..ff17d51 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -39,6 +39,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -106,6 +107,77 @@ static struct platform_device omap3beagle_nand_device = {
.resource   = &omap3beagle_nand_resource,
 };
 
+/* DSS */
+
+static int beagle_enable_dvi(struct omap_dss_device *dssdev)
+{
+   if (dssdev->reset_gpio != -1)
+   gpio_set_value(dssdev->reset_gpio, 1);
+
+   return 0;
+}
+
+static void beagle_disable_dvi(struct omap_dss_device *dssdev)
+{
+   if (dssdev->reset_gpio != -1)
+   gpio_set_value(dssdev->reset_gpio, 0);
+}
+
+static struct omap_dss_device beagle_dvi_device = {
+   .type = OMAP_DISPLAY_TYPE_DPI,
+   .name = "dvi",
+   .driver_name = "generic_panel",
+   .phy.dpi.data_lines = 24,
+   .reset_gpio = 170,
+   .platform_enable = beagle_enable_dvi,
+   .platform_disable = beagle_disable_dvi,
+};
+
+static struct omap_dss_device beagle_tv_device = {
+   .name = "tv",
+   .driver_name = "venc",
+   .type = OMAP_DISPLAY_TYPE_VENC,
+   .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+};
+
+static struct omap_dss_device *beagle_dss_devices[] = {
+   &beagle_dvi_device,
+   &beagle_tv_device,
+};
+
+static struct omap_dss_board_info beagle_dss_data = {
+   .num_devices = ARRAY_SIZE(beagle_dss_devices),
+   .devices = beagle_dss_devices,
+   .default_device = &beagle_dvi_device,
+};
+
+static struct platform_device beagle_dss_device = {
+   .name  = "omapdss",
+   .id= -1,
+   .dev= {
+   .platform_data = &beagle_dss_data,
+   },
+};
+
+static struct regulator_consumer_supply beagle_vdac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omapdss");
+
+static struct regulator_consumer_supply beagle_vdvi_supply =
+   REGULATOR_SUPPLY("vdds_dsi", "omapdss")l
+
+static void __init beagle_display_init(void)
+{
+   int r;
+
+   r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
+   if (r < 0) {
+   printk(KERN_ERR "Unable to get DVI reset GPIO\n");
+   return;
+   }
+
+   gpio_direction_output(beagle_dvi_device.reset_gpio, 0);
+}
+
 #include "sdram-micron-mt46h32m32lf-6.h"
 
 static struct omap2_hsmmc_info mmc[] = {
@@ -117,15 +189,6 @@ static struct omap2_hsmmc_info mmc[] = {
{}  /* Terminator */
 };
 
-static struct platform_device omap3_beagle_lcd_device = {
-   .name   = "omap3beagle_lcd",
-   .id = -1,
-};
-
-static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
-   .ctrl_name  = "internal",
-};
-
 static struct regulator_consumer_supply beagle_vmmc1_supply = {
.supply = "vmmc",
 };
@@ -181,16 +244,6 @@ static struct twl4030_gpio_platform_data beagle_gpio_data 
= {
.setup  = beagle_twl_gpio_setup,
 };
 
-static struct regulator_consumer_supply beagle_vdac_supply = {
-   .supply = "vdac",
-   .dev= &omap3_beagle_lcd_device.dev,
-};
-
-static struct regulator_consumer_supply beagle_vdvi_supply = {
-   .supply = "vdvi",
-   .dev= &omap3_beagle_lcd_device.dev,
-};
-
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data beagle_vmmc1 = {
.constraints = {
@@ -349,14 +402,8 @@ static struct platform_device keys_gpio = {
},
 };
 
-static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
-   { OMAP_TAG_LCD, &omap3_beagle_lcd_config },
-};
-
 static void __init omap3_beagle_init_irq(void)
 {
-   omap_board_config = omap3_beagle_config;
-   omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 mt46h32m32lf6_sdrc_params);
omap_init_irq();
@@ -367,9 +414,9 @@ static void __init omap3_beagle_init_irq(void)
 }
 
 static struct platform_device *omap3_beagle_devices[] __initdata = {
-   &omap3_beagle_lcd_device,
&leds_gpio,
&keys_gpio,
+   &beagle_dss_device,
 };
 
 static vo

Re: [PATCH v4] board-omap3-beagle: add DSS2 support

2010-04-14 Thread Thomas Weber
On 04/14/10 12:33, Koen Kooi wrote:
> This patch adds DSS2 support to the beagleboard boardfile. DVI and TV-out are 
> supported.
> 
> Signed-off-by: Koen Kooi 
> ---
> 
> Changes since v1:
> * removed beagle_panel_enable_tv() and beagle_panel_disable_tv()
> Changes since v2:
> * changed to REGULATOR_SUPPLY(_name, _dev_name) for dss regulators
> Changes since v3:
> * really remove beagle_panel_enable_tv() and beagle_panel_disable_tv()
> * moved comments to this section
> 
>  arch/arm/mach-omap2/board-omap3beagle.c |  102 ++
>  1 files changed, 75 insertions(+), 27 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
> b/arch/arm/mach-omap2/board-omap3beagle.c
> index 962d377..96999a3 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -39,6 +39,7 @@
>  
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -106,6 +107,77 @@ static struct platform_device omap3beagle_nand_device = {
>   .resource   = &omap3beagle_nand_resource,
>  };
>  
> +/* DSS */
> +
> +static int beagle_enable_dvi(struct omap_dss_device *dssdev)
> +{
> + if (dssdev->reset_gpio != -1)
> + gpio_set_value(dssdev->reset_gpio, 1);
> +
> + return 0;
> +}
> +
> +static void beagle_disable_dvi(struct omap_dss_device *dssdev)
> +{
> + if (dssdev->reset_gpio != -1)
> + gpio_set_value(dssdev->reset_gpio, 0);
> +}
> +
> +static struct omap_dss_device beagle_dvi_device = {
> + .type = OMAP_DISPLAY_TYPE_DPI,
> + .name = "dvi",
> + .driver_name = "generic_panel",
> + .phy.dpi.data_lines = 24,
> + .reset_gpio = 170,
> + .platform_enable = beagle_enable_dvi,
> + .platform_disable = beagle_disable_dvi,
> +};
> +
> +static struct omap_dss_device beagle_tv_device = {
> + .name = "tv",
> + .driver_name = "venc",
> + .type = OMAP_DISPLAY_TYPE_VENC,
> + .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
> +};
> +
> +static struct omap_dss_device *beagle_dss_devices[] = {
> + &beagle_dvi_device,
> + &beagle_tv_device,
> +};
> +
> +static struct omap_dss_board_info beagle_dss_data = {
> + .num_devices = ARRAY_SIZE(beagle_dss_devices),
> + .devices = beagle_dss_devices,
> + .default_device = &beagle_dvi_device,
> +};
> +
> +static struct platform_device beagle_dss_device = {
> + .name  = "omapdss",
> + .id= -1,
> + .dev= {
> + .platform_data = &beagle_dss_data,
> + },
> +};
> +
> +static struct regulator_consumer_supply beagle_vdac_supply = 
Trailing whitespace
> + REGULATOR_SUPPLY("vdda_dac", "omapdss");
> +
> +static struct regulator_consumer_supply beagle_vdvi_supply = 
Here too.

Thomas
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 06/12] AM3517: Add nand platform data for am3517evm

2010-04-14 Thread Govindarajan, Sriramakrishnan
> -Original Message-
> From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> ow...@vger.kernel.org] On Behalf Of Stanley.Miao
> Sent: Wednesday, April 14, 2010 2:00 PM
> To: linux-omap@vger.kernel.org
> Cc: t...@atomide.com
> Subject: [PATCH 06/12] AM3517: Add nand platform data for am3517evm
> 
> Add nand flash init code for am3517evm.
> 
> Signed-off-by: Stanley.Miao 
> ---
>  arch/arm/mach-omap2/board-am3517evm.c |   84
> +
>  1 files changed, 84 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-
> omap2/board-am3517evm.c
> index 879c13f..a76ff11 100644
> --- a/arch/arm/mach-omap2/board-am3517evm.c
> +++ b/arch/arm/mach-omap2/board-am3517evm.c
> @@ -23,6 +23,9 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
> +#include 
> 
>  #include 
>  #include 
> @@ -35,6 +38,8 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
> 
>  #include "mux.h"
> 
> @@ -42,6 +47,84 @@
>  #define LCD_PANEL_BKLIGHT_PWR182
>  #define LCD_PANEL_PWM181
> 
> +#define GPMC_CS0_BASE  0x60
> +#define GPMC_CS_SIZE   0x30
> +
> +#define NAND_BLOCK_SIZESZ_128K
> +
> +static struct mtd_partition am3517evm_nand_partitions[] = {
> + /* All the partition sizes are listed in terms of NAND block size */
> + {
> + .name   = "xloader",
> + .offset = 0,
> + .size   = 4 * (SZ_128K),
> + .mask_flags = MTD_WRITEABLE
> + },
> + {
> + .name   = "uboot",
> + .offset = MTDPART_OFS_APPEND,
> + .size   = 14 * (SZ_128K),
> + .mask_flags = MTD_WRITEABLE
> + },
> + {
> + .name   = "uboot-params",
> + .offset = MTDPART_OFS_APPEND,
> + .size   = 2 * (SZ_128K)
> + },
> + {
> + .name   = "linux-kernel",
> + .offset = MTDPART_OFS_APPEND,
> + .size   = 40 * (SZ_128K)
> + },
> + {
> + .name   = "rootfs",
> + .size   = MTDPART_SIZ_FULL,
> + .offset = MTDPART_OFS_APPEND,
> + },
> +};
--- snip ---
[Sriram] Similar patch was posted earlier - pending re-work (see Tony's 
comments)
https://patchwork.kernel.org/patch/56485/

If you deriving your work from existing implementation, attribute the original 
author in your submissions 

Regards
Sriram
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 02/12] AM3517: Add platform init code for EMAC driver

2010-04-14 Thread Govindarajan, Sriramakrishnan
> -Original Message-
> From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> ow...@vger.kernel.org] On Behalf Of Stanley.Miao
> Sent: Wednesday, April 14, 2010 2:00 PM
> To: linux-omap@vger.kernel.org
> Cc: t...@atomide.com
> Subject: [PATCH 02/12] AM3517: Add platform init code for EMAC driver
> 
> Add platform init code for EMAC driver.
> 
> Signed-off-by: Stanley.Miao 
> ---
>  arch/arm/mach-omap2/board-am3517evm.c |  114
> +
>  arch/arm/mach-omap2/include/mach/am35xx.h |9 ++
>  2 files changed, 123 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-
> omap2/board-am3517evm.c
> index 6ae8805..db542b2 100644
> --- a/arch/arm/mach-omap2/board-am3517evm.c
> +++ b/arch/arm/mach-omap2/board-am3517evm.c
> @@ -20,6 +20,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
> 
>  #include 
> @@ -30,6 +31,7 @@
> 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 

-- snip --

This patch has been posted earlier. Refer,
https://patchwork.kernel.org/patch/84921/
https://patchwork.kernel.org/patch/84919/

Tony,
Any updates on these

Regards
Sriram


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4] board-omap3-beagle: add DSS2 support

2010-04-14 Thread Koen Kooi
This patch adds DSS2 support to the beagleboard boardfile. DVI and TV-out are 
supported.

Signed-off-by: Koen Kooi 
---

Changes since v1:
* removed beagle_panel_enable_tv() and beagle_panel_disable_tv()
Changes since v2:
* changed to REGULATOR_SUPPLY(_name, _dev_name) for dss regulators
Changes since v3:
* really remove beagle_panel_enable_tv() and beagle_panel_disable_tv()
* moved comments to this section

 arch/arm/mach-omap2/board-omap3beagle.c |  102 ++
 1 files changed, 75 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 962d377..96999a3 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -39,6 +39,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -106,6 +107,77 @@ static struct platform_device omap3beagle_nand_device = {
.resource   = &omap3beagle_nand_resource,
 };
 
+/* DSS */
+
+static int beagle_enable_dvi(struct omap_dss_device *dssdev)
+{
+   if (dssdev->reset_gpio != -1)
+   gpio_set_value(dssdev->reset_gpio, 1);
+
+   return 0;
+}
+
+static void beagle_disable_dvi(struct omap_dss_device *dssdev)
+{
+   if (dssdev->reset_gpio != -1)
+   gpio_set_value(dssdev->reset_gpio, 0);
+}
+
+static struct omap_dss_device beagle_dvi_device = {
+   .type = OMAP_DISPLAY_TYPE_DPI,
+   .name = "dvi",
+   .driver_name = "generic_panel",
+   .phy.dpi.data_lines = 24,
+   .reset_gpio = 170,
+   .platform_enable = beagle_enable_dvi,
+   .platform_disable = beagle_disable_dvi,
+};
+
+static struct omap_dss_device beagle_tv_device = {
+   .name = "tv",
+   .driver_name = "venc",
+   .type = OMAP_DISPLAY_TYPE_VENC,
+   .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+};
+
+static struct omap_dss_device *beagle_dss_devices[] = {
+   &beagle_dvi_device,
+   &beagle_tv_device,
+};
+
+static struct omap_dss_board_info beagle_dss_data = {
+   .num_devices = ARRAY_SIZE(beagle_dss_devices),
+   .devices = beagle_dss_devices,
+   .default_device = &beagle_dvi_device,
+};
+
+static struct platform_device beagle_dss_device = {
+   .name  = "omapdss",
+   .id= -1,
+   .dev= {
+   .platform_data = &beagle_dss_data,
+   },
+};
+
+static struct regulator_consumer_supply beagle_vdac_supply = 
+   REGULATOR_SUPPLY("vdda_dac", "omapdss");
+
+static struct regulator_consumer_supply beagle_vdvi_supply = 
+   REGULATOR_SUPPLY("vdds_dsi", "omapdss")l
+
+static void __init beagle_display_init(void)
+{
+   int r;
+
+   r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
+   if (r < 0) {
+   printk(KERN_ERR "Unable to get DVI reset GPIO\n");
+   return;
+   }
+
+   gpio_direction_output(beagle_dvi_device.reset_gpio, 0);
+}
+
 #include "sdram-micron-mt46h32m32lf-6.h"
 
 static struct omap2_hsmmc_info mmc[] = {
@@ -117,15 +189,6 @@ static struct omap2_hsmmc_info mmc[] = {
{}  /* Terminator */
 };
 
-static struct platform_device omap3_beagle_lcd_device = {
-   .name   = "omap3beagle_lcd",
-   .id = -1,
-};
-
-static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
-   .ctrl_name  = "internal",
-};
-
 static struct regulator_consumer_supply beagle_vmmc1_supply = {
.supply = "vmmc",
 };
@@ -181,16 +244,6 @@ static struct twl4030_gpio_platform_data beagle_gpio_data 
= {
.setup  = beagle_twl_gpio_setup,
 };
 
-static struct regulator_consumer_supply beagle_vdac_supply = {
-   .supply = "vdac",
-   .dev= &omap3_beagle_lcd_device.dev,
-};
-
-static struct regulator_consumer_supply beagle_vdvi_supply = {
-   .supply = "vdvi",
-   .dev= &omap3_beagle_lcd_device.dev,
-};
-
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data beagle_vmmc1 = {
.constraints = {
@@ -349,14 +402,8 @@ static struct platform_device keys_gpio = {
},
 };
 
-static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
-   { OMAP_TAG_LCD, &omap3_beagle_lcd_config },
-};
-
 static void __init omap3_beagle_init_irq(void)
 {
-   omap_board_config = omap3_beagle_config;
-   omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 mt46h32m32lf6_sdrc_params);
omap_init_irq();
@@ -367,9 +414,9 @@ static void __init omap3_beagle_init_irq(void)
 }
 
 static struct platform_device *omap3_beagle_devices[] __initdata = {
-   &omap3_beagle_lcd_device,
&leds_gpio,
&keys_gpio,
+   &beagle_dss_device,
 };
 
 static void __init omap3beagle_flash_init(void)
@@ -456,8 +50

Re: [PATCH v3] board-omap3-beagle: add DSS2 support

2010-04-14 Thread Koen Kooi

Op 14 apr 2010, om 14:01 heeft Grazvydas Ignotas het volgende geschreven:

> On Wed, Apr 14, 2010 at 2:37 PM, Koen Kooi  wrote:
>> This patch adds DSS2 support to the beagleboard boardfile. DVI and TV-out 
>> are supported.
>> 
>> Changes since v1:
>>* removed beagle_panel_enable_tv() and beagle_panel_disable_tv()
> 
> oh no you didn't, they're still there :)
> And changelog should not go into patch description

Gah! Let me get some coffee before sending v4 :)

> 
>> Changes since v2:
>>* changed to REGULATOR_SUPPLY(_name, _dev_name) for dss regulators
>> 
>> Signed-off-by: Koen Kooi 
>> ---
> 
> comments and changelog goes here
> 
>>  arch/arm/mach-omap2/board-omap3beagle.c |  126 
>> ---
>>  1 files changed, 99 insertions(+), 27 deletions(-)
>> 
>> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
>> b/arch/arm/mach-omap2/board-omap3beagle.c
>> index 962d377..4b595b0 100644
>> --- a/arch/arm/mach-omap2/board-omap3beagle.c
>> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> 
> 
> 
>> +static int beagle_panel_enable_tv(struct omap_dss_device *dssdev)
>> +{
>> +#define ENABLE_VDAC_DEDICATED   0x03
>> +#define ENABLE_VDAC_DEV_GRP 0x20
>> +
>> +   twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
>> +   ENABLE_VDAC_DEDICATED,
>> +   TWL4030_VDAC_DEDICATED);
>> +   twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
>> +   ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
>> +
>> +   return 0;
>> +}
>> +
>> +static void beagle_panel_disable_tv(struct omap_dss_device *dssdev)
>> +{
>> +   twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
>> +   TWL4030_VDAC_DEDICATED);
>> +   twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
>> +   TWL4030_VDAC_DEV_GRP);
>> +}
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3] board-omap3-beagle: add DSS2 support

2010-04-14 Thread Grazvydas Ignotas
On Wed, Apr 14, 2010 at 2:37 PM, Koen Kooi  wrote:
> This patch adds DSS2 support to the beagleboard boardfile. DVI and TV-out are 
> supported.
>
> Changes since v1:
>        * removed beagle_panel_enable_tv() and beagle_panel_disable_tv()

oh no you didn't, they're still there :)
And changelog should not go into patch description

> Changes since v2:
>        * changed to REGULATOR_SUPPLY(_name, _dev_name) for dss regulators
>
> Signed-off-by: Koen Kooi 
> ---

comments and changelog goes here

>  arch/arm/mach-omap2/board-omap3beagle.c |  126 
> ---
>  1 files changed, 99 insertions(+), 27 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
> b/arch/arm/mach-omap2/board-omap3beagle.c
> index 962d377..4b595b0 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c



> +static int beagle_panel_enable_tv(struct omap_dss_device *dssdev)
> +{
> +#define ENABLE_VDAC_DEDICATED           0x03
> +#define ENABLE_VDAC_DEV_GRP             0x20
> +
> +       twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
> +                       ENABLE_VDAC_DEDICATED,
> +                       TWL4030_VDAC_DEDICATED);
> +       twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
> +                       ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
> +
> +       return 0;
> +}
> +
> +static void beagle_panel_disable_tv(struct omap_dss_device *dssdev)
> +{
> +       twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
> +                       TWL4030_VDAC_DEDICATED);
> +       twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
> +                       TWL4030_VDAC_DEV_GRP);
> +}


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3] board-omap3-beagle: add DSS2 support

2010-04-14 Thread Koen Kooi
This patch adds DSS2 support to the beagleboard boardfile. DVI and TV-out are 
supported.

Changes since v1:
* removed beagle_panel_enable_tv() and beagle_panel_disable_tv()
Changes since v2:
* changed to REGULATOR_SUPPLY(_name, _dev_name) for dss regulators

Signed-off-by: Koen Kooi 
---
 arch/arm/mach-omap2/board-omap3beagle.c |  126 ---
 1 files changed, 99 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 962d377..4b595b0 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -39,6 +39,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -106,6 +107,101 @@ static struct platform_device omap3beagle_nand_device = {
.resource   = &omap3beagle_nand_resource,
 };
 
+/* DSS */
+
+static int beagle_enable_dvi(struct omap_dss_device *dssdev)
+{
+   if (dssdev->reset_gpio != -1)
+   gpio_set_value(dssdev->reset_gpio, 1);
+
+   return 0;
+}
+
+static void beagle_disable_dvi(struct omap_dss_device *dssdev)
+{
+   if (dssdev->reset_gpio != -1)
+   gpio_set_value(dssdev->reset_gpio, 0);
+}
+
+static struct omap_dss_device beagle_dvi_device = {
+   .type = OMAP_DISPLAY_TYPE_DPI,
+   .name = "dvi",
+   .driver_name = "generic_panel",
+   .phy.dpi.data_lines = 24,
+   .reset_gpio = 170,
+   .platform_enable = beagle_enable_dvi,
+   .platform_disable = beagle_disable_dvi,
+};
+
+static int beagle_panel_enable_tv(struct omap_dss_device *dssdev)
+{
+#define ENABLE_VDAC_DEDICATED   0x03
+#define ENABLE_VDAC_DEV_GRP 0x20
+
+   twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+   ENABLE_VDAC_DEDICATED,
+   TWL4030_VDAC_DEDICATED);
+   twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+   ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
+
+   return 0;
+}
+
+static void beagle_panel_disable_tv(struct omap_dss_device *dssdev)
+{
+   twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+   TWL4030_VDAC_DEDICATED);
+   twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+   TWL4030_VDAC_DEV_GRP);
+}
+
+static struct omap_dss_device beagle_tv_device = {
+   .name = "tv",
+   .driver_name = "venc",
+   .type = OMAP_DISPLAY_TYPE_VENC,
+   .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+   .platform_enable = beagle_panel_enable_tv,
+   .platform_disable = beagle_panel_disable_tv,
+};
+
+static struct omap_dss_device *beagle_dss_devices[] = {
+   &beagle_dvi_device,
+   &beagle_tv_device,
+};
+
+static struct omap_dss_board_info beagle_dss_data = {
+   .num_devices = ARRAY_SIZE(beagle_dss_devices),
+   .devices = beagle_dss_devices,
+   .default_device = &beagle_dvi_device,
+};
+
+static struct platform_device beagle_dss_device = {
+   .name  = "omapdss",
+   .id= -1,
+   .dev= {
+   .platform_data = &beagle_dss_data,
+   },
+};
+
+static struct regulator_consumer_supply beagle_vdac_supply = 
+   REGULATOR_SUPPLY("vdda_dac", "omapdss");
+
+static struct regulator_consumer_supply beagle_vdvi_supply = 
+   REGULATOR_SUPPLY("vdds_dsi", "omapdss")l
+
+static void __init beagle_display_init(void)
+{
+   int r;
+
+   r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
+   if (r < 0) {
+   printk(KERN_ERR "Unable to get DVI reset GPIO\n");
+   return;
+   }
+
+   gpio_direction_output(beagle_dvi_device.reset_gpio, 0);
+}
+
 #include "sdram-micron-mt46h32m32lf-6.h"
 
 static struct omap2_hsmmc_info mmc[] = {
@@ -117,15 +213,6 @@ static struct omap2_hsmmc_info mmc[] = {
{}  /* Terminator */
 };
 
-static struct platform_device omap3_beagle_lcd_device = {
-   .name   = "omap3beagle_lcd",
-   .id = -1,
-};
-
-static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
-   .ctrl_name  = "internal",
-};
-
 static struct regulator_consumer_supply beagle_vmmc1_supply = {
.supply = "vmmc",
 };
@@ -181,16 +268,6 @@ static struct twl4030_gpio_platform_data beagle_gpio_data 
= {
.setup  = beagle_twl_gpio_setup,
 };
 
-static struct regulator_consumer_supply beagle_vdac_supply = {
-   .supply = "vdac",
-   .dev= &omap3_beagle_lcd_device.dev,
-};
-
-static struct regulator_consumer_supply beagle_vdvi_supply = {
-   .supply = "vdvi",
-   .dev= &omap3_beagle_lcd_device.dev,
-};
-
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data beagle_vmmc1 = {
.constraints = {
@@ -349,14 +426,8 @@ static struct platform_device keys_gpio = {
},
 };
 
-static struct omap_board_config_kernel om

Re: [PATCH] board-omap3-beagle: add DSS2 support

2010-04-14 Thread Tomi Valkeinen
On Wed, 2010-04-14 at 12:55 +0200, ext Koen Kooi wrote:
> Op 14 apr 2010, om 12:43 heeft Tomi Valkeinen het volgende geschreven:
> 
> > On Tue, 2010-04-13 at 17:24 +0200, ext Koen Kooi wrote:
> >> Op 12 apr 2010, om 13:15 heeft Grazvydas Ignotas het volgende geschreven:
> >> 
> >>> On Mon, Apr 12, 2010 at 1:37 PM, Tomi Valkeinen
> >>>  wrote:
>  
>  On Mon, 2010-04-12 at 11:19 +0200, ext Koen Kooi wrote:
> > This patch adds DSS2 support to the beagleboard boardfile. DVI and 
> > TV-out are supported.
> > 
> > Signed-off-by: Koen Kooi 
>  
>  Fiddling with TWL directly in tv enable/disable functions is a bit ugly,
>  but I'm not sure if there's a better way for that. Otherwise:
> >>> 
> >>> It's only toggling VDAC supply, don't we already do that in DSS2 core?
> >>> I think beagle_panel_enable_tv and beagle_panel_disable_tv can be
> >>> simply removed.
> >> 
> >> I can send an updated patch with those bits removed if needed. Tomi?
> > 
> > Yes, all the comments from Grazvydas were valid.
> 
> OK, sent.

There were other comments also, about the regulators at least. Those
should be looked at too.

 Tomi


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] board-omap3-beagle: add DSS2 support

2010-04-14 Thread Thomas Weber
On 04/14/10 10:55, Koen Kooi wrote:
> This patch adds DSS2 support to the beagleboard boardfile. DVI and TV-out are 
> supported.
> 
> Changes since v1:
>   * removed beagle_panel_enable_tv() and beagle_panel_disable_tv()
> 
> Signed-off-by: Koen Kooi 
> ---
>  arch/arm/mach-omap2/board-omap3beagle.c |  130 
> ---
>  1 files changed, 103 insertions(+), 27 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
> b/arch/arm/mach-omap2/board-omap3beagle.c
> index 962d377..534316c 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -39,6 +39,7 @@
>  

> +
> +static struct platform_device beagle_dss_device = {
> + .name  = "omapdss",
> + .id= -1,
> + .dev= {
> + .platform_data = &beagle_dss_data,
> + },
> +};
> +
> +static struct regulator_consumer_supply beagle_vdac_supply = {
> + .supply = "vdda_dac",
> + .dev= &beagle_dss_device.dev,
> +};
Shouldn't we use the REGULATOR_SUPPLY macro?
see commit ed6543243a1c557dbe2005a86f6d
> +
> +static struct regulator_consumer_supply beagle_vdvi_supply = {
> + .supply = "vdds_dsi",
> + .dev= &beagle_dss_device.dev,
> +};
Here too.

Thomas
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] board-omap3-beagle: add DSS2 support

2010-04-14 Thread Koen Kooi

Op 14 apr 2010, om 12:43 heeft Tomi Valkeinen het volgende geschreven:

> On Tue, 2010-04-13 at 17:24 +0200, ext Koen Kooi wrote:
>> Op 12 apr 2010, om 13:15 heeft Grazvydas Ignotas het volgende geschreven:
>> 
>>> On Mon, Apr 12, 2010 at 1:37 PM, Tomi Valkeinen
>>>  wrote:
 
 On Mon, 2010-04-12 at 11:19 +0200, ext Koen Kooi wrote:
> This patch adds DSS2 support to the beagleboard boardfile. DVI and TV-out 
> are supported.
> 
> Signed-off-by: Koen Kooi 
 
 Fiddling with TWL directly in tv enable/disable functions is a bit ugly,
 but I'm not sure if there's a better way for that. Otherwise:
>>> 
>>> It's only toggling VDAC supply, don't we already do that in DSS2 core?
>>> I think beagle_panel_enable_tv and beagle_panel_disable_tv can be
>>> simply removed.
>> 
>> I can send an updated patch with those bits removed if needed. Tomi?
> 
> Yes, all the comments from Grazvydas were valid.

OK, sent.

regards,

Koen--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] board-omap3-beagle: add DSS2 support

2010-04-14 Thread Koen Kooi
This patch adds DSS2 support to the beagleboard boardfile. DVI and TV-out are 
supported.

Changes since v1:
* removed beagle_panel_enable_tv() and beagle_panel_disable_tv()

Signed-off-by: Koen Kooi 
---
 arch/arm/mach-omap2/board-omap3beagle.c |  130 ---
 1 files changed, 103 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 962d377..534316c 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -39,6 +39,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -106,6 +107,105 @@ static struct platform_device omap3beagle_nand_device = {
.resource   = &omap3beagle_nand_resource,
 };
 
+/* DSS */
+
+static int beagle_enable_dvi(struct omap_dss_device *dssdev)
+{
+   if (dssdev->reset_gpio != -1)
+   gpio_set_value(dssdev->reset_gpio, 1);
+
+   return 0;
+}
+
+static void beagle_disable_dvi(struct omap_dss_device *dssdev)
+{
+   if (dssdev->reset_gpio != -1)
+   gpio_set_value(dssdev->reset_gpio, 0);
+}
+
+static struct omap_dss_device beagle_dvi_device = {
+   .type = OMAP_DISPLAY_TYPE_DPI,
+   .name = "dvi",
+   .driver_name = "generic_panel",
+   .phy.dpi.data_lines = 24,
+   .reset_gpio = 170,
+   .platform_enable = beagle_enable_dvi,
+   .platform_disable = beagle_disable_dvi,
+};
+
+static int beagle_panel_enable_tv(struct omap_dss_device *dssdev)
+{
+#define ENABLE_VDAC_DEDICATED   0x03
+#define ENABLE_VDAC_DEV_GRP 0x20
+
+   twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+   ENABLE_VDAC_DEDICATED,
+   TWL4030_VDAC_DEDICATED);
+   twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+   ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
+
+   return 0;
+}
+
+static void beagle_panel_disable_tv(struct omap_dss_device *dssdev)
+{
+   twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+   TWL4030_VDAC_DEDICATED);
+   twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+   TWL4030_VDAC_DEV_GRP);
+}
+
+static struct omap_dss_device beagle_tv_device = {
+   .name = "tv",
+   .driver_name = "venc",
+   .type = OMAP_DISPLAY_TYPE_VENC,
+   .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+   .platform_enable = beagle_panel_enable_tv,
+   .platform_disable = beagle_panel_disable_tv,
+};
+
+static struct omap_dss_device *beagle_dss_devices[] = {
+   &beagle_dvi_device,
+   &beagle_tv_device,
+};
+
+static struct omap_dss_board_info beagle_dss_data = {
+   .num_devices = ARRAY_SIZE(beagle_dss_devices),
+   .devices = beagle_dss_devices,
+   .default_device = &beagle_dvi_device,
+};
+
+static struct platform_device beagle_dss_device = {
+   .name  = "omapdss",
+   .id= -1,
+   .dev= {
+   .platform_data = &beagle_dss_data,
+   },
+};
+
+static struct regulator_consumer_supply beagle_vdac_supply = {
+   .supply = "vdda_dac",
+   .dev= &beagle_dss_device.dev,
+};
+
+static struct regulator_consumer_supply beagle_vdvi_supply = {
+   .supply = "vdds_dsi",
+   .dev= &beagle_dss_device.dev,
+};
+
+static void __init beagle_display_init(void)
+{
+   int r;
+
+   r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
+   if (r < 0) {
+   printk(KERN_ERR "Unable to get DVI reset GPIO\n");
+   return;
+   }
+
+   gpio_direction_output(beagle_dvi_device.reset_gpio, 0);
+}
+
 #include "sdram-micron-mt46h32m32lf-6.h"
 
 static struct omap2_hsmmc_info mmc[] = {
@@ -117,15 +217,6 @@ static struct omap2_hsmmc_info mmc[] = {
{}  /* Terminator */
 };
 
-static struct platform_device omap3_beagle_lcd_device = {
-   .name   = "omap3beagle_lcd",
-   .id = -1,
-};
-
-static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
-   .ctrl_name  = "internal",
-};
-
 static struct regulator_consumer_supply beagle_vmmc1_supply = {
.supply = "vmmc",
 };
@@ -181,16 +272,6 @@ static struct twl4030_gpio_platform_data beagle_gpio_data 
= {
.setup  = beagle_twl_gpio_setup,
 };
 
-static struct regulator_consumer_supply beagle_vdac_supply = {
-   .supply = "vdac",
-   .dev= &omap3_beagle_lcd_device.dev,
-};
-
-static struct regulator_consumer_supply beagle_vdvi_supply = {
-   .supply = "vdvi",
-   .dev= &omap3_beagle_lcd_device.dev,
-};
-
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data beagle_vmmc1 = {
.constraints = {
@@ -349,14 +430,8 @@ static struct platform_device keys_gpio = {
},
 };
 
-static struct omap_board_config_kernel omap3_

Re: [PATCH] board-omap3-beagle: add DSS2 support

2010-04-14 Thread Tomi Valkeinen
On Tue, 2010-04-13 at 17:24 +0200, ext Koen Kooi wrote:
> Op 12 apr 2010, om 13:15 heeft Grazvydas Ignotas het volgende geschreven:
> 
> > On Mon, Apr 12, 2010 at 1:37 PM, Tomi Valkeinen
> >  wrote:
> >> 
> >> On Mon, 2010-04-12 at 11:19 +0200, ext Koen Kooi wrote:
> >>> This patch adds DSS2 support to the beagleboard boardfile. DVI and TV-out 
> >>> are supported.
> >>> 
> >>> Signed-off-by: Koen Kooi 
> >> 
> >> Fiddling with TWL directly in tv enable/disable functions is a bit ugly,
> >> but I'm not sure if there's a better way for that. Otherwise:
> > 
> > It's only toggling VDAC supply, don't we already do that in DSS2 core?
> > I think beagle_panel_enable_tv and beagle_panel_disable_tv can be
> > simply removed.
> 
> I can send an updated patch with those bits removed if needed. Tomi?

Yes, all the comments from Grazvydas were valid.

 Tomi


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHV3] OMAP3: SDRC : Errata 1.176 Fix - Accesses to DDR stall in SDRC after a Warm-reset

2010-04-14 Thread Grazvydas Ignotas
On Tue, Apr 13, 2010 at 3:37 PM, Vishwanath BS  wrote:
> From: Teerth Reddy 
>
> This patch has the workaround for errata 1.176.
> In some cases, user is not able to access DDR memory after
> warm-reset.This situation occurs while the warm-reset
> happens during a read access to DDR memory. In that
> particular conditions, DDR memory does not respond to a
> corrupted read command due to the warm reset occurence but
> SDRC is waiting for read completion.SDRC is not sensitive to
> the warm reset, but the interconect is reset on the fly,
> thus causing a misalignment between SDRC logic, interconect
> logic and DDR memory state.
>
> Root cause description: A corrupted read transaction is
> issued to a closed row: (address0, bank0) instead of the
> expected read access, violating protocol.
>
> Failure signature: Once the failure occurs and system has
> restarted, memory content is not accessible.SDRC registers
> can be accessed successfully, until 1st access to memory
> location is performed. After 1st access to memory is done,
> SDRC is stuck.
>
> WORKAROUND
> Steps to perform before a SW reset is trigged, if user needs
> to generate a SW reset and keep DDR memory content:
> 1. Enable self-refresh on idle request
> 2. Put SDRC in idle
> 3. Wait until SDRC goes to idle
> 4. Generate SW reset
>
> Steps to perform after warm reset occurs:
> If HW warm reset is the source, apply below steps before
> any accesses to SDRAM:
> 1. Reset SMS and SDRC
> 2. Re-initialize SMS, SDRC and memory
>
> This would need the u-boot/x-loader workaround changes
> as well for the reboot to work correctly.
>
> Signed-off-by: Teerth Reddy 
> Signed-off-by: Vishwanath BS 
> ---



> diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S
> index de99ba2..1a1be4d
> --- a/arch/arm/mach-omap2/sram34xx.S
> +++ b/arch/arm/mach-omap2/sram34xx.S
> @@ -33,6 +33,8 @@
>
>  #include "sdrc.h"
>  #include "cm.h"
> +#include "prcm-common.h"
> +#include "prm.h"
>
>        .text
>
> @@ -68,6 +70,9 @@
>  /* CM_CLKSEL1_PLL bit settings */
>  #define CORE_DPLL_CLKOUT_DIV_SHIFT     0x1b
>
> +/* PRM_RSTCTRL bit setting */
> +#define EN_DPLL3_RESET                  0x4
> +
>  /*
>  * omap3_sram_configure_core_dpll - change DPLL3 M2 divider
>  *
> @@ -313,3 +318,49 @@ core_m2_mask_val:
>  ENTRY(omap3_sram_configure_core_dpll_sz)
>        .word   . - omap3_sram_configure_core_dpll
>
> +
> +/*
> +* omap3_sram_configure_core_dpll_warmreset
> +* Enable SDRC self refresh on idle request, put SDRC in idle,
> +* wait until SDRC goes to idle
> +* Enable DPLL3 reset bit in RM_RSTCTRL
> +*/
> +
> +ENTRY(omap3_sram_configure_core_dpll_warmreset)

don't you need to stack some registers here? r9, r11 and lr are callee-saved.

> +
> +       bl      sdram_in_selfrefresh1
> +       ldr     r11, omap3_reset_cntrl
> +       ldr     r12, [r11]
> +       orr     r12, r12, #EN_DPLL3_RESET       @ Enable DPLL3 reset bit
> +       str     r12, [r11]
> +
> +sdram_in_selfrefresh1:
> +       ldr     r11, omap3_sdrc_power1  @ read the SDRC_POWER register
> +       ldr     r12, [r11]              @ read the contents of SDRC_POWER
> +       mov     r9, r12                 @ keep a copy of SDRC_POWER bits

where is this used?

> +       orr     r12, r12, #SRFRONIDLEREQ_MASK   @ enable self refresh on idle
> +       str     r12, [r11]              @ write back to SDRC_POWER register
> +       ldr     r12, [r11]              @ posted-write barrier for SDRC
> +       ldr     r11, omap3_cm_iclken1_core1     @ read the CM_ICLKEN1_CORE reg
> +       ldr     r12, [r11]
> +       bic     r12, r12, #EN_SDRC_MASK         @ disable iclk bit for SDRC
> +       str     r12, [r11]
> +wait_sdrc_idle2:
> +       ldr     r11, omap3_cm_idlest1_core1
> +       ldr     r12, [r11]
> +       and     r12, r12, #ST_SDRC_MASK         @ check for SDRC idle
> +       cmp     r12, #ST_SDRC_MASK
> +       bne     wait_sdrc_idle2
> +       bx      lr

Are you positive this code actually works? To me it looks like it
could deadlock.

> +
> +omap3_reset_cntrl:
> +       .word OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, OMAP2_RM_RSTCTRL)
> +omap3_sdrc_power1:
> +       .word OMAP34XX_SDRC_REGADDR(SDRC_POWER)
> +omap3_cm_idlest1_core1:
> +       .word OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST)
> +omap3_cm_iclken1_core1:
> +       .word OMAP34XX_CM_REGADDR(CORE_MOD, CM_ICLKEN1)
> +
> +ENTRY(omap3_sram_configure_core_dpll_warmreset_sz)
> +       .word   . - omap3_sram_configure_core_dpll_warmreset


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 12/12] AM3517: Add mmc platform data for am3517evm

2010-04-14 Thread Stanley.Miao
Add mmc platform data. Besides, the mmc slot on UI board has a pin conflict
with LCD, so add macros to resolve it.

Signed-off-by: Stanley.Miao 
---
 arch/arm/mach-omap2/Makefile  |3 +-
 arch/arm/mach-omap2/board-am3517evm.c |   45 +
 2 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 4b9fc57..e94afdd 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -142,7 +142,8 @@ obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK)  += 
board-omap3touchbook.o \
   hsmmc.o
 obj-$(CONFIG_MACH_OMAP_4430SDP)+= board-4430sdp.o
 
-obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o
+obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o \
+  hsmmc.o
 
 # Platform specific device init code
 obj-y  += usb-musb.o
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 6a82ac3..8054994 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -40,7 +41,9 @@
 #include 
 #include 
 #include 
+#include 
 
+#include "hsmmc.h"
 #include "mux.h"
 
 #define LCD_PANEL_PWR  176
@@ -440,6 +443,8 @@ static int __init am3517_evm_i2c_init(void)
 static int lcd_enabled;
 static int dvi_enabled;
 
+#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
+   defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
 static void __init am3517_evm_display_init(void)
 {
int r;
@@ -501,6 +506,20 @@ static void am3517_evm_panel_disable_lcd(struct 
omap_dss_device *dssdev)
gpio_set_value(LCD_PANEL_PWR, 0);
lcd_enabled = 0;
 }
+#else
+static inline void __init am3517_evm_display_init(void)
+{
+}
+
+static inline int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+   return 0;
+}
+
+static inline void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+}
+#endif
 
 static struct omap_dss_device am3517_evm_lcd_device = {
.type   = OMAP_DISPLAY_TYPE_DPI,
@@ -613,6 +632,30 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux  NULL
 #endif
 
+static struct omap2_hsmmc_info mmc[] = {
+   {
+   .mmc= 1,
+   .wires  = 4,
+   .gpio_cd= 127,
+   .gpio_wp= 126,
+   .ocr_mask   = MMC_VDD_165_195 |
+   MMC_VDD_26_27 | MMC_VDD_27_28 |
+   MMC_VDD_29_30 |
+   MMC_VDD_30_31 | MMC_VDD_31_32,
+   },
+#if !defined(CONFIG_PANEL_SHARP_LQ043T1DG01) && \
+   !defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
+   {
+   .mmc= 2,
+   .wires  = 4,
+   .gpio_cd= 175,
+   .gpio_wp= 176,
+   .ocr_mask   = MMC_VDD_165_195,
+   },
+#endif
+   {}  /* Terminator */
+};
+
 static void __init am3517_evm_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -636,6 +679,8 @@ static void __init am3517_evm_init(void)
 
i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
ARRAY_SIZE(am3517evm_i2c1_boardinfo));
+   /* MMC init function */
+   omap2_hsmmc_init(mmc);
 }
 
 static void __init am3517_evm_map_io(void)
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/12] omap hsmmc: fix the hsmmc driver for am3517.

2010-04-14 Thread Stanley.Miao
AM3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the regulators
like "vmmc", so we set a noop "set_power" function for it.

Signed-off-by: Stanley.Miao 
---
 arch/arm/mach-omap2/hsmmc.c |   32 
 1 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 9ad2295..11258ad 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -139,6 +139,12 @@ static void hsmmc23_before_set_reg(struct device *dev, int 
slot,
}
 }
 
+static int am3517_mmc_set_power(struct device *dev, int slot, int power_on,
+   int vdd)
+{
+   return 0;
+}
+
 static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata;
 
 void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
@@ -150,7 +156,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
if (cpu_is_omap2430()) {
control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
-   } else {
+   } else if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
}
@@ -216,12 +222,25 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
 */
mmc->slots[0].ocr_mask = c->ocr_mask;
 
+   if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
+   switch (c->mmc) {
+   case 1:
+   /* on-chip level shifting via PBIAS0/PBIAS1 */
+   mmc->slots[0].before_set_reg = 
hsmmc1_before_set_reg;
+   mmc->slots[0].after_set_reg = 
hsmmc1_after_set_reg;
+   break;
+   case 2:
+   case 3:
+   /* off-chip level shifting, or none */
+   mmc->slots[0].before_set_reg = 
hsmmc23_before_set_reg;
+   mmc->slots[0].after_set_reg = NULL;
+   break;
+   }
+   } else /* cpu_is_omap3517() || cpu_is_omap3505() */
+   mmc->slots[0].set_power = am3517_mmc_set_power;
+
switch (c->mmc) {
case 1:
-   /* on-chip level shifting via PBIAS0/PBIAS1 */
-   mmc->slots[0].before_set_reg = hsmmc1_before_set_reg;
-   mmc->slots[0].after_set_reg = hsmmc1_after_set_reg;
-
/* Omap3630 HSMMC1 supports only 4-bit */
if (cpu_is_omap3630() && c->wires > 4) {
c->wires = 4;
@@ -235,9 +254,6 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
c->wires = 4;
/* FALLTHROUGH */
case 3:
-   /* off-chip level shifting, or none */
-   mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
-   mmc->slots[0].after_set_reg = NULL;
break;
default:
pr_err("MMC%d configuration not supported!\n", c->mmc);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/12] omap: init the gpio pinmux for mmc

2010-04-14 Thread Stanley.Miao
There is two gpio for mmc use, one is for card detecting, another is
used for checking write protect. Intialize its pinmux in case the bootloader
doesn't set it.

Signed-off-by: Stanley.Miao 
---
 arch/arm/mach-omap2/devices.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 23e4d77..df9c62a 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -591,6 +591,13 @@ static inline void omap_hsmmc_reset(void) {}
 static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
int controller_nr)
 {
+   if (mmc_controller->slots[0].switch_pin > 0)
+   omap_mux_init_gpio(mmc_controller->slots[0].switch_pin,
+   OMAP_PIN_INPUT_PULLUP);
+   if (mmc_controller->slots[0].gpio_wp > 0)
+   omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
+   OMAP_PIN_INPUT_PULLUP);
+
if (cpu_is_omap2420() && controller_nr == 0) {
omap_cfg_reg(H18_24XX_MMC_CMD);
omap_cfg_reg(H15_24XX_MMC_CLKI);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 09/12] AM3517: Update the config file of am3517evm

2010-04-14 Thread Stanley.Miao
Added MTD, NETDEVICES, WATCHDOG, GPIO_PCA953X, REGULATOR, FB, SOUND, MMC, RTC.

Signed-off-by: Stanley.Miao 
---
 arch/arm/configs/am3517_evm_defconfig |  599 -
 1 files changed, 513 insertions(+), 86 deletions(-)

diff --git a/arch/arm/configs/am3517_evm_defconfig 
b/arch/arm/configs/am3517_evm_defconfig
index 66a10b5..a995767 100644
--- a/arch/arm/configs/am3517_evm_defconfig
+++ b/arch/arm/configs/am3517_evm_defconfig
@@ -1,13 +1,14 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.32-rc5
-# Wed Oct 28 15:47:47 2009
+# Linux kernel version: 2.6.34-rc3
+# Wed Apr 14 16:07:52 2010
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_HAVE_PROC_CPU=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -19,7 +20,9 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_ARCH_HAS_CPUFREQ=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
 CONFIG_VECTORS_BASE=0x
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 CONFIG_CONSTRUCTORS=y
@@ -32,6 +35,12 @@ CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_BZIP2 is not set
+# CONFIG_KERNEL_LZMA is not set
+# CONFIG_KERNEL_LZO is not set
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_SYSVIPC_SYSCTL=y
@@ -46,17 +55,13 @@ CONFIG_BSD_PROCESS_ACCT=y
 #
 CONFIG_TREE_RCU=y
 # CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_TINY_RCU is not set
 # CONFIG_RCU_TRACE is not set
 CONFIG_RCU_FANOUT=32
 # CONFIG_RCU_FANOUT_EXACT is not set
 # CONFIG_TREE_RCU_TRACE is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_GROUP_SCHED=y
-CONFIG_FAIR_GROUP_SCHED=y
-# CONFIG_RT_GROUP_SCHED is not set
-CONFIG_USER_SCHED=y
-# CONFIG_CGROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
@@ -67,6 +72,7 @@ CONFIG_INITRAMFS_SOURCE=""
 CONFIG_RD_GZIP=y
 # CONFIG_RD_BZIP2 is not set
 # CONFIG_RD_LZMA is not set
+# CONFIG_RD_LZO is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 CONFIG_ANON_INODES=y
@@ -88,10 +94,14 @@ CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_AIO=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
 
 #
 # Kernel Performance Events And Counters
 #
+# CONFIG_PERF_EVENTS is not set
+# CONFIG_PERF_COUNTERS is not set
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_COMPAT_BRK=y
 CONFIG_SLAB=y
@@ -127,14 +137,41 @@ CONFIG_LBDAF=y
 # IO Schedulers
 #
 CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
 CONFIG_IOSCHED_CFQ=y
-CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_DEADLINE is not set
-# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_CFQ=y
 # CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_DEFAULT_IOSCHED="cfq"
+# CONFIG_INLINE_SPIN_TRYLOCK is not set
+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK is not set
+# CONFIG_INLINE_SPIN_LOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
+CONFIG_INLINE_SPIN_UNLOCK=y
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_READ_TRYLOCK is not set
+# CONFIG_INLINE_READ_LOCK is not set
+# CONFIG_INLINE_READ_LOCK_BH is not set
+# CONFIG_INLINE_READ_LOCK_IRQ is not set
+# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
+CONFIG_INLINE_READ_UNLOCK=y
+# CONFIG_INLINE_READ_UNLOCK_BH is not set
+CONFIG_INLINE_READ_UNLOCK_IRQ=y
+# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_WRITE_TRYLOCK is not set
+# CONFIG_INLINE_WRITE_LOCK is not set
+# CONFIG_INLINE_WRITE_LOCK_BH is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
+CONFIG_INLINE_WRITE_UNLOCK=y
+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
+# CONFIG_MUTEX_SPIN_ON_OWNER is not set
 # CONFIG_FREEZER is not set
 
 #
@@ -146,6 +183,7 @@ CONFIG_MMU=y
 # CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_VERSATILE is not set
 # CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_BCMRING is not set
 # CONFIG_ARCH_CLPS711X is not set
 # CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_EBSA110 is not set
@@ -155,7 +193,6 @@ CONFIG_MMU=y
 # CONFIG_ARCH_STMP3XXX is not set
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_NOMADIK is not set
 # CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
@@ -163,6 +200,7 @@ CONFIG_MMU=y
 # CONFIG_ARCH_IXP2000 is not set
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_DOVE is not set
 # CONFIG_ARCH_KIRKW

[PATCH 08/12] OMAP: fix a gpmc nand problem

2010-04-14 Thread Stanley.Miao
If gpmc_t isn't given, we don't need to set timing for gpmc, or it will cause
a Oops.

Signed-off-by: Stanley.Miao 
---
 arch/arm/mach-omap2/gpmc-nand.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 64d74f0..e57fb29 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -39,6 +39,9 @@ static int omap2_nand_gpmc_retime(void)
struct gpmc_timings t;
int err;
 
+   if (!gpmc_nand_data->gpmc_t)
+   return 0;
+
memset(&t, 0, sizeof(t));
t.sync_clk = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->sync_clk);
t.cs_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_on);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 07/12] AM3517: initialize i2c subsystem after mux subsystem

2010-04-14 Thread Stanley.Miao
The initialize of i2c subsystem will set pinmux, so it should be done
after the initialize of mux subsystem initialization.

Signed-off-by: Stanley.Miao 
---
 arch/arm/mach-omap2/board-am3517evm.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index a76ff11..6a82ac3 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -615,9 +615,9 @@ static struct omap_board_mux board_mux[] __initdata = {
 
 static void __init am3517_evm_init(void)
 {
-   am3517_evm_i2c_init();
-
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+
+   am3517_evm_i2c_init();
platform_add_devices(am3517_evm_devices,
ARRAY_SIZE(am3517_evm_devices));
 
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 06/12] AM3517: Add nand platform data for am3517evm

2010-04-14 Thread Stanley.Miao
Add nand flash init code for am3517evm.

Signed-off-by: Stanley.Miao 
---
 arch/arm/mach-omap2/board-am3517evm.c |   84 +
 1 files changed, 84 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 879c13f..a76ff11 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -23,6 +23,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -35,6 +38,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "mux.h"
 
@@ -42,6 +47,84 @@
 #define LCD_PANEL_BKLIGHT_PWR  182
 #define LCD_PANEL_PWM  181
 
+#define GPMC_CS0_BASE  0x60
+#define GPMC_CS_SIZE   0x30
+
+#define NAND_BLOCK_SIZESZ_128K
+
+static struct mtd_partition am3517evm_nand_partitions[] = {
+   /* All the partition sizes are listed in terms of NAND block size */
+   {
+   .name   = "xloader",
+   .offset = 0,
+   .size   = 4 * (SZ_128K),
+   .mask_flags = MTD_WRITEABLE
+   },
+   {
+   .name   = "uboot",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 14 * (SZ_128K),
+   .mask_flags = MTD_WRITEABLE
+   },
+   {
+   .name   = "uboot-params",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 2 * (SZ_128K)
+   },
+   {
+   .name   = "linux-kernel",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 40 * (SZ_128K)
+   },
+   {
+   .name   = "rootfs",
+   .size   = MTDPART_SIZ_FULL,
+   .offset = MTDPART_OFS_APPEND,
+   },
+};
+
+static struct omap_nand_platform_data am3517evm_nand_data = {
+   .parts  = am3517evm_nand_partitions,
+   .nr_parts   = ARRAY_SIZE(am3517evm_nand_partitions),
+   .nand_setup = NULL,
+   .dma_channel= -1,   /* disable DMA in OMAP NAND driver */
+   .devsize= 1,
+   .dev_ready  = NULL,
+};
+
+void __init am3517evm_flash_init(void)
+{
+   u8 cs = 0;
+   u8 nandcs = GPMC_CS_NUM + 1;
+   u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
+
+   while (cs < GPMC_CS_NUM) {
+   u32 ret = 0;
+   ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+
+   if ((ret & 0xC00) == 0x800) {
+   /* Found it!! */
+   if (nandcs > GPMC_CS_NUM)
+   nandcs = cs;
+   }
+   cs++;
+   }
+   if (nandcs > GPMC_CS_NUM) {
+   printk(KERN_INFO "NAND: Unable to find configuration "
+   " in GPMC\n ");
+   return;
+   }
+
+   if (nandcs < GPMC_CS_NUM) {
+   am3517evm_nand_data.cs   = nandcs;
+   am3517evm_nand_data.gpmc_cs_baseaddr = (void *)(gpmc_base_add +
+   GPMC_CS0_BASE + nandcs*GPMC_CS_SIZE);
+   am3517evm_nand_data.gpmc_baseaddr   = (void *) (gpmc_base_add);
+   gpmc_nand_init(&am3517evm_nand_data);
+   }
+}
+
+
 #define AM35XX_EVM_PHY_MASK  (0xF)
 #define AM35XX_EVM_MDIO_FREQUENCY(100) /*PHY bus frequency */
 
@@ -539,6 +622,7 @@ static void __init am3517_evm_init(void)
ARRAY_SIZE(am3517_evm_devices));
 
omap_serial_init();
+   am3517evm_flash_init();
 
/* Configure GPIO for EHCI port */
omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 05/12] AM3517: Add audio codec platform data

2010-04-14 Thread Stanley.Miao
Codec tlv320aic23 is on the second i2c bus. Add the tlv320aic23 info in
i2c2 board_info.

Signed-off-by: Stanley.Miao 
---
 arch/arm/mach-omap2/board-am3517evm.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 2d7fd08..879c13f 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -312,6 +312,9 @@ static struct pca953x_platform_data 
am3517evm_gpio_expander_info_0 = {
 };
 static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
{
+   I2C_BOARD_INFO("tlv320aic23", 0x1A),
+   },
+   {
I2C_BOARD_INFO("tca6416", 0x21),
.platform_data = &am3517evm_gpio_expander_info_0,
},
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/12] AM3517: Add platform init code for regulator driver

2010-04-14 Thread Stanley.Miao
Add platform init code for regulator driver.

Signed-off-by: Stanley.Miao 
---
 arch/arm/mach-omap2/board-am3517evm.c |  122 +
 1 files changed, 122 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 5abf333..2d7fd08 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -159,6 +160,122 @@ static struct i2c_board_info __initdata 
am3517evm_i2c1_boardinfo[] = {
},
 };
 
+/* TPS65023 specific initialization */
+/* VDCDC1 -> VDD_CORE */
+static struct regulator_consumer_supply am3517_evm_vdcdc1_supplies[] = {
+   {
+   .supply = "vdd_core",
+   },
+};
+
+/* VDCDC2 -> VDDSHV */
+static struct regulator_consumer_supply am3517_evm_vdcdc2_supplies[] = {
+   {
+   .supply = "vddshv",
+   },
+};
+
+/* VDCDC2 |-> VDDS
+  |-> VDDS_SRAM_CORE_BG
+  |-> VDDS_SRAM_MPU */
+static struct regulator_consumer_supply am3517_evm_vdcdc3_supplies[] = {
+   {
+   .supply = "vdds",
+   },
+   {
+   .supply = "vdds_sram_core_bg",
+   },
+   {
+   .supply = "vdds_sram_mpu",
+   },
+};
+
+/* LDO1 |-> VDDA1P8V_USBPHY
+|-> VDDA_DAC */
+static struct regulator_consumer_supply am3517_evm_ldo1_supplies[] = {
+   {
+   .supply = "vdda1p8v_usbphy",
+   },
+   {
+   .supply = "vdda_dac",
+   },
+};
+
+/* LDO2 -> VDDA3P3V_USBPHY */
+static struct regulator_consumer_supply am3517_evm_ldo2_supplies[] = {
+   {
+   .supply = "vdda3p3v_usbphy",
+   },
+};
+
+static struct regulator_init_data am3517_evm_regulator_data[] = {
+   /* DCDC1 */
+   {
+   .constraints = {
+   .min_uV = 120,
+   .max_uV = 120,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = true,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc1_supplies),
+   .consumer_supplies = am3517_evm_vdcdc1_supplies,
+   },
+   /* DCDC2 */
+   {
+   .constraints = {
+   .min_uV = 330,
+   .max_uV = 330,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = true,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc2_supplies),
+   .consumer_supplies = am3517_evm_vdcdc2_supplies,
+   },
+   /* DCDC3 */
+   {
+   .constraints = {
+   .min_uV = 180,
+   .max_uV = 180,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = true,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc3_supplies),
+   .consumer_supplies = am3517_evm_vdcdc3_supplies,
+   },
+   /* LDO1 */
+   {
+   .constraints = {
+   .min_uV = 180,
+   .max_uV = 180,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = false,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_ldo1_supplies),
+   .consumer_supplies = am3517_evm_ldo1_supplies,
+   },
+   /* LDO2 */
+   {
+   .constraints = {
+   .min_uV = 330,
+   .max_uV = 330,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = false,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_ldo2_supplies),
+   .consumer_supplies = am3517_evm_ldo2_supplies,
+   },
+};
+
 /*
  * RTC - S35390A
  */
@@ -216,6 +333,11 @@ static struct i2c_board_info __initdata 
am3517evm_i2c3_boardinfo[] = {
I2C_BOARD_INFO("tca6416", 0x21),
.platform_data = &am3517evm_ui_gpio_expander_info_2,
},
+   {
+   I2C_BOARD_INFO("tps65023", 0x48),
+   .flags = I2C_CLIENT_WAKE,
+   .platform_data = &am3517_evm_regulator_data[0],
+   },
 };
 
 static 

[PATCH 03/12] AM3517: rename the i2c boardinfo to make it more readable

2010-04-14 Thread Stanley.Miao
There are three i2c buses on am3517, now rename these three boardinfo
structure name to am3517evm_i2c1_boardinfo, am3517evm_i2c2_boardinfo,
and am3517evm_i2c3_boardinfo, to make it more readable.

Signed-off-by: Stanley.Miao 
---
 arch/arm/mach-omap2/board-am3517evm.c |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index db542b2..5abf333 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -152,7 +152,7 @@ void am3517_evm_ethernet_init(struct emac_platform_data 
*pdata)
return ;
  }
 
-static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = {
+static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = {
{
I2C_BOARD_INFO("s35390a", 0x30),
.type   = "s35390a",
@@ -182,7 +182,7 @@ static void __init am3517_evm_rtc_init(void)
gpio_free(GPIO_RTCS35390A_IRQ);
return;
}
-   am3517evm_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
+   am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
 }
 
 /*
@@ -193,7 +193,7 @@ static void __init am3517_evm_rtc_init(void)
 static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
.gpio_base  = OMAP_MAX_GPIO_LINES,
 };
-static struct i2c_board_info __initdata am3517evm_tca6416_info_0[] = {
+static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
{
I2C_BOARD_INFO("tca6416", 0x21),
.platform_data = &am3517evm_gpio_expander_info_0,
@@ -207,7 +207,7 @@ static struct pca953x_platform_data 
am3517evm_ui_gpio_expander_info_1 = {
 static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
.gpio_base  = OMAP_MAX_GPIO_LINES + 32,
 };
-static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
+static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = {
{
I2C_BOARD_INFO("tca6416", 0x20),
.platform_data = &am3517evm_ui_gpio_expander_info_1,
@@ -221,10 +221,10 @@ static struct i2c_board_info __initdata 
am3517evm_ui_tca6416_info[] = {
 static int __init am3517_evm_i2c_init(void)
 {
omap_register_i2c_bus(1, 400, NULL, 0);
-   omap_register_i2c_bus(2, 400, am3517evm_tca6416_info_0,
-   ARRAY_SIZE(am3517evm_tca6416_info_0));
-   omap_register_i2c_bus(3, 400, am3517evm_ui_tca6416_info,
-   ARRAY_SIZE(am3517evm_ui_tca6416_info));
+   omap_register_i2c_bus(2, 400, am3517evm_i2c2_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c2_boardinfo));
+   omap_register_i2c_bus(3, 400, am3517evm_i2c3_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c3_boardinfo));
 
return 0;
 }
@@ -425,8 +425,8 @@ static void __init am3517_evm_init(void)
/* RTC - S35390A */
am3517_evm_rtc_init();
 
-   i2c_register_board_info(1, am3517evm_i2c_boardinfo,
-   ARRAY_SIZE(am3517evm_i2c_boardinfo));
+   i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c1_boardinfo));
 }
 
 static void __init am3517_evm_map_io(void)
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/12] AM3517: Add platform init code for EMAC driver

2010-04-14 Thread Stanley.Miao
Add platform init code for EMAC driver.

Signed-off-by: Stanley.Miao 
---
 arch/arm/mach-omap2/board-am3517evm.c |  114 +
 arch/arm/mach-omap2/include/mach/am35xx.h |9 ++
 2 files changed, 123 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 6ae8805..db542b2 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -30,6 +31,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -39,6 +41,117 @@
 #define LCD_PANEL_BKLIGHT_PWR  182
 #define LCD_PANEL_PWM  181
 
+#define AM35XX_EVM_PHY_MASK  (0xF)
+#define AM35XX_EVM_MDIO_FREQUENCY(100) /*PHY bus frequency */
+
+static struct emac_platform_data am3517_evm_emac_pdata = {
+   .phy_mask   = AM35XX_EVM_PHY_MASK,
+   .mdio_max_freq  = AM35XX_EVM_MDIO_FREQUENCY,
+   .rmii_en= 1,
+};
+
+static int __init eth_addr_setup(char *str)
+{
+   int i;
+   long res;
+
+   if (str == NULL)
+   return 0;
+   for (i = 0; i <  ETH_ALEN; i++) {
+   if (!strict_strtol(&str[i * 3], 16, &res))
+   am3517_evm_emac_pdata.mac_addr[i] = res;
+   else
+   return -EINVAL;
+   }
+   return 1;
+}
+
+/* Get MAC address from kernel boot parameter eth=AA:BB:CC:DD:EE:FF */
+__setup("eth=", eth_addr_setup);
+
+static struct resource am3517_emac_resources[] = {
+   {
+   .start  = AM35XX_IPSS_EMAC_BASE,
+   .end= AM35XX_IPSS_EMAC_BASE + 0x3,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_RXTHRESH_IRQ,
+   .end= INT_35XX_EMAC_C0_RXTHRESH_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_RX_PULSE_IRQ,
+   .end= INT_35XX_EMAC_C0_RX_PULSE_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_TX_PULSE_IRQ,
+   .end= INT_35XX_EMAC_C0_TX_PULSE_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_MISC_PULSE_IRQ,
+   .end= INT_35XX_EMAC_C0_MISC_PULSE_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct platform_device am3517_emac_device = {
+   .name   = "davinci_emac",
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(am3517_emac_resources),
+   .resource   = am3517_emac_resources,
+};
+
+static void am3517_enable_ethernet_int(void)
+{
+   u32 regval;
+
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
+   AM35XX_CPGMAC_C0_TX_PULSE_CLR |
+   AM35XX_CPGMAC_C0_MISC_PULSE_CLR |
+   AM35XX_CPGMAC_C0_RX_THRESH_CLR);
+   omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+static void am3517_disable_ethernet_int(void)
+{
+   u32 regval;
+
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
+   AM35XX_CPGMAC_C0_TX_PULSE_CLR);
+   omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+void am3517_evm_ethernet_init(struct emac_platform_data *pdata)
+{
+   u32 regval;
+
+   pdata->ctrl_reg_offset  = AM35XX_EMAC_CNTRL_OFFSET;
+   pdata->ctrl_mod_reg_offset  = AM35XX_EMAC_CNTRL_MOD_OFFSET;
+   pdata->ctrl_ram_offset  = AM35XX_EMAC_CNTRL_RAM_OFFSET;
+   pdata->mdio_reg_offset  = AM35XX_EMAC_MDIO_OFFSET;
+   pdata->ctrl_ram_size= AM35XX_EMAC_CNTRL_RAM_SIZE;
+   pdata->version  = EMAC_VERSION_2;
+   pdata->hw_ram_addr  = AM35XX_EMAC_HW_RAM_ADDR;
+   pdata->interrupt_enable = am3517_enable_ethernet_int;
+   pdata->interrupt_disable= am3517_disable_ethernet_int;
+   am3517_emac_device.dev.platform_data = pdata;
+   platform_device_register(&am3517_emac_device);
+
+   regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
+   regval = regval & (~(AM35XX_CPGMACSS_SW_RST));
+   omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
+   regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
+
+   return ;
+ }
+
 static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("s35390a", 0x30),
@@ -308,6 +421,7 @@ static void __init am3517_evm_init(void)
/* DSS */
am3517_evm_display_init();
 
+   am3517_evm_ethernet_init(&am3517_evm_emac_pdata

[PATCH 01/12] omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL

2010-04-14 Thread Stanley.Miao
INT_34XX_BENCH_MPU_EMUL was defined twice, another is at Line 312.

Signed-off-by: Stanley.Miao 
---
 arch/arm/plat-omap/include/plat/irqs.h |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/irqs.h 
b/arch/arm/plat-omap/include/plat/irqs.h
index b65088a..4017019 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -345,8 +345,6 @@
 #define INT_34XX_MMC3_IRQ  94
 #define INT_34XX_GPT12_IRQ 95
 
-#defineINT_34XX_BENCH_MPU_EMUL 3
-
 #define INT_35XX_HECC0_IRQ 24
 #define INT_35XX_HECC1_IRQ 28
 #define INT_35XX_EMAC_C0_RXTHRESH_IRQ  67
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/11] Some am3517 related patches [V2]

2010-04-14 Thread Stanley.Miao
Changes from V1:
1, modify the mmc set_power part according to Adrian.Hunter.
2, Updated the config file.

Some am3517 related patches. The detaild changelog is below:


The following changes since commit eba014745cc806d625b6a553d1af6efd14e16321:
  Tony Lindgren (1):
Linux-omap rebuilt: Updated to -rc3

are available in the git repository at:

  . devel

Stanley.Miao (12):
  omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL
  AM3517: Add platform init code for EMAC driver
  AM3517: rename the i2c boardinfo to make it more readable
  AM3517: Add platform init code for regulator driver
  AM3517: Add audio codec platform data
  AM3517: Add nand platform data for am3517evm
  AM3517: initialize i2c subsystem after mux subsystem
  OMAP: fix a gpmc nand problem
  AM3517: Update the config file of am3517evm
  omap: init the gpio pinmux for mmc
  omap hsmmc: fix the hsmmc driver for am3517.
  AM3517: Add mmc platform data for am3517evm

 arch/arm/configs/am3517_evm_defconfig |  599 
 arch/arm/mach-omap2/Makefile  |3 +-
 arch/arm/mach-omap2/board-am3517evm.c |  392 ++-
 arch/arm/mach-omap2/devices.c |7 +
 arch/arm/mach-omap2/gpmc-nand.c   |3 +
 arch/arm/mach-omap2/hsmmc.c   |   32 ++-
 arch/arm/mach-omap2/include/mach/am35xx.h |9 +
 arch/arm/plat-omap/include/plat/irqs.h|2 -
 8 files changed, 938 insertions(+), 109 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[INFO] Serial "no clocks available" warning for 3630 SDP

2010-04-14 Thread Venkatraman S
On the master branch -rc3 version eba0147, I get this warning when
booting it up on 3630 SDP.
I don't have a fix for this, just curious if someone else has noticed..
[ cut here ]
WARNING: at arch/arm/mach-omap2/serial.c:727 omap_serial_init_port+0x5c/0x2e8()
(null): can't init uart3, no clocks available
Modules linked in:
[] (unwind_backtrace+0x0/0xec) from []
(warn_slowpath_common+0x48/0x60)
[] (warn_slowpath_common+0x48/0x60) from []
(warn_slowpath_fmt+0x24/0x30)
[] (warn_slowpath_fmt+0x24/0x30) from []
(omap_serial_init_port+0x5c/0x2e8)
[] (omap_serial_init_port+0x5c/0x2e8) from []
(omap_serial_init+0x28/0x34)
[] (omap_serial_init+0x28/0x34) from []
(omap_sdp_init+0x14/0x54)
[] (omap_sdp_init+0x14/0x54) from []
(customize_machine+0x18/0x24)
[] (customize_machine+0x18/0x24) from []
(do_one_initcall+0x5c/0x1b4)
[] (do_one_initcall+0x5c/0x1b4) from []
(kernel_init+0x90/0x144)
[] (kernel_init+0x90/0x144) from []
(kernel_thread_exit+0x0/0x8)
---[ end trace 1b75b31a2719ed1c ]---
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC] [PATCH 1/3] OMAP4: Keyboard Controller Support

2010-04-14 Thread Trilok Soni
Hi Abraham,

On Wed, Apr 14, 2010 at 6:40 AM, Arce, Abraham  wrote:
> Keyboard controller for OMAP4 with built-in scanning algorithm.
> The following implementations are used:
>
>  - matrix_keypac.c logic
>  - hwmod framework

Do we have hwmod framework mainlined in the kernel?

>
> +config KEYBOARD_OMAP4
> +        tristate "TI OMAP4 keypad support"
> +        depends on (ARCH_OMAP4)

No need of brackets.

Could you please provide "default y/n" option too?

> + * linux/drivers/input/keyboard/omap4-keypad.c

Better not to include file paths.

> +
> +struct omap_device_pm_latency omap_keyboard_latency[] = {

static?

> +       {
> +               .deactivate_func = omap_device_idle_hwmods,
> +               .activate_func   = omap_device_enable_hwmods,
> +               .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
> +       },
> +};
> +static irqreturn_t omap_keypad_threaded(int irq, void *dev_id)
> +{
> +       struct omap_keypad *keypad_data = dev_id;
> +       struct input_dev *input = keypad_data->input;
> +       unsigned char key_state[8];
> +       int col, row, code;
> +       u32 *new_state = (u32 *) key_state;
> +
> +       *new_state       = __raw_readl(keypad_data->base +
> +                       OMAP4_KBD_FULLCODE31_0);
> +       *(new_state + 1) = __raw_readl(keypad_data->base +
> +                       OMAP4_KBD_FULLCODE63_32);
> +
> +       for (col = 0; col < keypad_data->cols; col++) {
> +               for (row = 0; row < keypad_data->rows; row++) {
> +                       code = MATRIX_SCAN_CODE(row, col,
> +                                       keypad_data->row_shift);
> +                       if (code < 0) {
> +                               printk(KERN_INFO "Spurious key %d-%d\n",
> +                                               col, row);
> +                               continue;
> +                       }
> +                       input_report_key(input, keypad_data->keycodes[code],
> +                                       key_state[col] & (1 << row));
> +               }
> +       }

where is input_sync(..)?

> +
> +       pdata = kzalloc(sizeof(struct matrix_keypad_platform_data),
> +                               GFP_KERNEL);

Please check error return here, because kzalloc can fail.

> +
> +       od = omap_device_build(name, id, oh, pdata,
> +                               sizeof(struct matrix_keypad_platform_data),
> +                               omap_keyboard_latency,
> +                               ARRAY_SIZE(omap_keyboard_latency), 1);
> +       WARN(IS_ERR(od), "Could not build omap_device for %s %s\n",
> +               name, oh_name);
> +
> +       /* platform data */
> +       pdata = pdev->dev.platform_data;
> +       if (!pdata) {
> +               dev_err(&pdev->dev, "no platform data defined\n");
> +               kfree(pdata);
> +               return -EINVAL;
> +       }
> +
> +       /* keymap data */
> +       keymap_data = pdata->keymap_data;
> +       if (!keymap_data) {
> +               dev_err(&pdev->dev, "no keymap data defined\n");
> +               kfree(keymap_data);

not freeing kfree(pdata)? Please check error return path again in this driver.

> +
> +       __set_bit(EV_REP, input_dev->evbit);
> +       __set_bit(KEY_OK, input_dev->keybit);
> +       __set_bit(EV_KEY, input_dev->evbit);

> +
> +       input_set_capability(input_dev, EV_MSC, MSC_SCAN);
> +       input_set_drvdata(input_dev, keypad_data);
> +
> +       status = input_register_device(keypad_data->input);
> +       if (status < 0) {
> +               dev_err(&pdev->dev, "failed to register input device\n");
> +               goto failed_free_device;
> +       }
> +
> +       omap_keypad_config(keypad_data);
> +
> +       platform_set_drvdata(pdev, keypad_data);
> +
> +       return 0;
> +
> +failed_free_device:
> +       input_unregister_device(keypad_data->input);

add keypad_data->input = NULL.


-- 
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC] Initial attempt to make ARM use LMB

2010-04-14 Thread Benjamin Herrenschmidt
On Fri, 2010-04-09 at 12:11 +0100, Russell King - ARM Linux wrote:
> On Thu, Apr 08, 2010 at 07:27:15PM +0100, Russell King - ARM Linux wrote:
> > On Thu, Apr 08, 2010 at 09:02:56PM +0530, Rabin Vincent wrote:
> > > On Thu, Mar 25, 2010 at 11:32:48PM +, Russell King - ARM Linux wrote:
> > > > The patch below is the combined patch; individual patches can be found
> > > > in the arm:lmb patches on the website or the lmb branch of my git tree;
> > > > this should be considered unstable.
> > > 
> > > Something like the following is needed to make initrds work after this
> > > patch:
> > 
> > This to me looks like a very large patch for what is a small problem -
> > that is the assignment of initrd_start/initrd_size got lost along the
> > way.
> > 
> > I'd much rather have the smaller patch; keep the initrd parameters in
> > the physical address space for as long as possible, and only convert
> > them to the virtual address space once we've finished mm initialisation.
> 
> Here's a revised version which should resolve the initrd problem.

BTW. I'm doing some cleanup of lmb, you can take a peek at my WIP in
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git branch
"lmb".

It shouldn't break your stuff, though you will probably need to add a
call to lmb_set_current_limit() in the right place instead of setting
LMB_REAL_LIMIT to lowmem_end_addr.

Anyway, it's still WIP, but feel free to comment, and if there's
something else you want me to do, cleanup or change in the core LMB, let
me know.

Cheers,
Ben.


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 11/11] AM3517: Add mmc platform data for am3517evm

2010-04-14 Thread stanley.miao

Adrian Hunter wrote:

Stanley.Miao wrote:
Add mmc platform data. Besides, the mmc slot on UI board has a pin 
conflict

with LCD, so add macros to resolve it.


 
+static struct omap2_hsmmc_info mmc[] = {

+{
+.mmc= 1,
+.wires  = 4,
+.gpio_cd= 127,
+.gpio_wp= 126,
+.ocr_mask   = MMC_VDD_165_195 |
+MMC_VDD_26_27 | MMC_VDD_27_28 |
+MMC_VDD_29_30 |
+MMC_VDD_30_31 | MMC_VDD_31_32,


How can you support 1.8V and 3V cards without controlling power
to the card?


Just modify the MMCHS_HCTL register.
I don't have a 1.8V card, so I didn't test the 1.8V mode. I just wrote 
it according to TRM.


Stanley.


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html