Re: Is changing serial from /dev/ttySx to /dev/ttyOx a good idea?

2010-12-19 Thread Abraham Arce
Hi,

On Sun, Dec 19, 2010 at 9:04 PM, Ming Lei  wrote:
> Hi,
>
> 2010/12/20 Charles Manning :
>> Hi All
>>
>> With the change to the new omap-serial stuff, the device names have changed
>> from /dev/ttySn to /dev/ttyOn.
>>
>> Using the "fit/form/function" argument, this would seem to be a bad idea.
>>
>> The kernel does not exist in a vacuum. It is surrounded by u-boot scripts,
>> command line options, init scripts etc etc. Flipping back and forth between
>> 2.6.36 and 2.6.37 kernels for testing purposes needs these to be changed.
>> Annoying and anti-productive.
>>
>> Isn't it just better to just replace the ttyOn name with ttyS. That would 
>> make
>> a far smoother transition.
>>
>> Thoughts?
>
> In fact, the transition is not friendly indeed for a user. I don't know why
> the transition is introduced, for what purpose? Who can give a explanation?
>

Patch itself has one explanation, kernel commit is
b612633b5928077441b979471869753bfa93d41a

http://www.spinics.net/lists/linux-serial/msg02788.html

Best Regards
Abraham
--
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 v6 7/8] OMAP4: Keyboard board support

2010-10-01 Thread Abraham Arce

Hi Kevin, Tony, Charu,

Tony Lindgren wrote:

* Kevin Hilman  [101001 15:57]:

Dmitry,

Can you please drop patch 8 (the pm runtime one.)  As pointed out by
Charu,  with the proposed platform changes, this cannot work
correctly with runtime PM.

Tony, I also propose we don't merge the platform code yet either until
Abraham can respond to the platform-specific issues and runtime PM
issues.

I'm fine with Dmitry merging the rest of the driver changes though.


OK, I'll drop 1, 6 & 7.

Merging the rest of the driver changes sounds good to me too,
that way there's no longer a build dependecy on the plat/omap4-keypad.h ;)

Tony


I'll take care of the changes in 2 days, out due to a high priority 
activity.


Best Regards
Abraham
--
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: Compilation: omap-for-linus omap2plus error

2010-09-30 Thread Abraham Arce
Thanks Santosh,

On Thu, Sep 30, 2010 at 2:55 AM, Shilimkar, Santosh
 wrote:
>> >  CC      arch/arm/mach-omap2/pm_bus.o
>> > arch/arm/mach-omap2/pm_bus.c: In function 'omap_pm_runtime_init':
>> > arch/arm/mach-omap2/pm_bus.c:64: error: implicit declaration of function
>> > 'platform_bus_get_pm_ops'
>> > arch/arm/mach-omap2/pm_bus.c:64: warning: assignment makes pointer from
>> > integer without a cast
>> > arch/arm/mach-omap2/pm_bus.c:81: error: implicit declaration of function
>> > 'platform_bus_set_pm_ops'
>>
>> I am trying using following commit as latest
>>
>> Kevin Hilman
>> 7ad0e386d46e9edff64705ab25337ad9130baf63
>> OMAP2+: defconfig: disable CPUfreq
>>
> Looks like Kevin's platform.c patch is missing
> in omap-for-linus branch. Patch attached.
>

Compilation error fixed... no more issues

Best Regards
Abraham
--
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


[RESEND][PATCH v6 7/8] OMAP4: Keyboard board support

2010-09-30 Thread Abraham Arce
From: Syed Rafiuddin 

Keyboard support for SDP OMAP4430

Signed-off-by: Syed Rafiuddin 
Signed-off-by: Abraham Arce 
---
 arch/arm/mach-omap2/board-4430sdp.c |   90 +++
 1 files changed, 90 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 1bed1e6..3f2c1e6 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -44,6 +45,91 @@
 #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO   184
 #define OMAP4_SFH7741_ENABLE_GPIO  188
 
+static const int sdp4430_keymap[] = {
+   KEY(0, 0, KEY_E),
+   KEY(0, 1, KEY_R),
+   KEY(0, 2, KEY_T),
+   KEY(0, 3, KEY_HOME),
+   KEY(0, 4, KEY_F5),
+   KEY(0, 5, KEY_UNKNOWN),
+   KEY(0, 6, KEY_I),
+   KEY(0, 7, KEY_LEFTSHIFT),
+
+   KEY(1, 0, KEY_D),
+   KEY(1, 1, KEY_F),
+   KEY(1, 2, KEY_G),
+   KEY(1, 3, KEY_SEND),
+   KEY(1, 4, KEY_F6),
+   KEY(1, 5, KEY_UNKNOWN),
+   KEY(1, 6, KEY_K),
+   KEY(1, 7, KEY_ENTER),
+
+   KEY(2, 0, KEY_X),
+   KEY(2, 1, KEY_C),
+   KEY(2, 2, KEY_V),
+   KEY(2, 3, KEY_END),
+   KEY(2, 4, KEY_F7),
+   KEY(2, 5, KEY_UNKNOWN),
+   KEY(2, 6, KEY_DOT),
+   KEY(2, 7, KEY_CAPSLOCK),
+
+   KEY(3, 0, KEY_Z),
+   KEY(3, 1, KEY_KPPLUS),
+   KEY(3, 2, KEY_B),
+   KEY(3, 3, KEY_F1),
+   KEY(3, 4, KEY_F8),
+   KEY(3, 5, KEY_UNKNOWN),
+   KEY(3, 6, KEY_O),
+   KEY(3, 7, KEY_SPACE),
+
+   KEY(4, 0, KEY_W),
+   KEY(4, 1, KEY_Y),
+   KEY(4, 2, KEY_U),
+   KEY(4, 3, KEY_F2),
+   KEY(4, 4, KEY_VOLUMEUP),
+   KEY(4, 5, KEY_UNKNOWN),
+   KEY(4, 6, KEY_L),
+   KEY(4, 7, KEY_LEFT),
+
+   KEY(5, 0, KEY_S),
+   KEY(5, 1, KEY_H),
+   KEY(5, 2, KEY_J),
+   KEY(5, 3, KEY_F3),
+   KEY(5, 4, KEY_F9),
+   KEY(5, 5, KEY_VOLUMEDOWN),
+   KEY(5, 6, KEY_M),
+   KEY(5, 7, KEY_RIGHT),
+
+   KEY(6, 0, KEY_Q),
+   KEY(6, 1, KEY_A),
+   KEY(6, 2, KEY_N),
+   KEY(6, 3, KEY_BACK),
+   KEY(6, 4, KEY_BACKSPACE),
+   KEY(6, 5, KEY_UNKNOWN),
+   KEY(6, 6, KEY_P),
+   KEY(6, 7, KEY_UP),
+
+   KEY(7, 0, KEY_PROG1),
+   KEY(7, 1, KEY_PROG2),
+   KEY(7, 2, KEY_PROG3),
+   KEY(7, 3, KEY_PROG4),
+   KEY(7, 4, KEY_F4),
+   KEY(7, 5, KEY_UNKNOWN),
+   KEY(7, 6, KEY_OK),
+   KEY(7, 7, KEY_DOWN),
+};
+
+static struct matrix_keymap_data sdp4430_keymap_data = {
+   .keymap = sdp4430_keymap,
+   .keymap_size= ARRAY_SIZE(sdp4430_keymap),
+};
+
+static struct omap4_keypad_platform_data sdp4430_keypad_data = {
+   .keymap_data= &sdp4430_keymap_data,
+   .rows   = 8,
+   .cols   = 8,
+};
+
 static struct gpio_led sdp4430_gpio_leds[] = {
{
.name   = "omap4:green:debug0",
@@ -507,6 +593,10 @@ static void __init omap_4430sdp_init(void)
if (!cpu_is_omap44xx())
usb_musb_init(&musb_board_data);
 
+   status = omap4_keyboard_init(&sdp4430_keypad_data);
+   if (status)
+   pr_err("Keypad initialization failed: %d\n", status);
+
status = omap_ethernet_init();
if (status) {
pr_err("Ethernet initialization failed: %d\n", status);
-- 
1.6.3.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


Re: [PATCH v6 7/8] OMAP4: Keyboard board support

2010-09-30 Thread Abraham Arce

Hi Dmitry,

Dmitry Torokhov wrote:

HI Abraham,

On Thu, Sep 30, 2010 at 12:36:13AM -0500, Abraham Arce wrote:

From: Syed Rafiuddin 

Keyboard support for SDP OMAP4430



I think this would benefit from "const" sprinkled on it.


You mean?

-static int sdp4430_keymap[] = {
+static const int sdp4430_keymap[] = {



BTW, I picked up patches 2, 3, 4, 5, 8 (all touching drivers/input).


Thanks!

Best Regards
Abraham
--
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 v6 8/8] Input: omap4 - pm runtime

2010-09-29 Thread Abraham Arce
Enable pm runtime in driver

Reviewed-by: Basak, Partha 
Signed-off-by: Abraham Arce 
---
 drivers/input/keyboard/omap4-keypad.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/input/keyboard/omap4-keypad.c 
b/drivers/input/keyboard/omap4-keypad.c
index 45bd097..ed47e9a 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -239,6 +240,9 @@ static int __devinit omap4_keypad_probe(struct 
platform_device *pdev)
matrix_keypad_build_keymap(pdata->keymap_data, row_shift,
input_dev->keycode, input_dev->keybit);
 
+   pm_runtime_enable(&pdev->dev);
+   pm_runtime_get_sync(&pdev->dev);
+
omap4_keypad_config(keypad_data);
 
error = request_irq(keypad_data->irq, omap4_keypad_interrupt,
@@ -277,6 +281,9 @@ static int __devexit omap4_keypad_remove(struct 
platform_device *pdev)
struct omap4_keypad *keypad_data = platform_get_drvdata(pdev);
struct resource *res;
 
+   pm_runtime_put_sync(&pdev->dev);
+   pm_runtime_disable(&pdev->dev);
+
free_irq(keypad_data->irq, keypad_data);
input_unregister_device(keypad_data->input);
 
-- 
1.6.3.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 v6 7/8] OMAP4: Keyboard board support

2010-09-29 Thread Abraham Arce
From: Syed Rafiuddin 

Keyboard support for SDP OMAP4430

Signed-off-by: Syed Rafiuddin 
Signed-off-by: Abraham Arce 
---
 arch/arm/mach-omap2/board-4430sdp.c |   90 +++
 1 files changed, 90 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 1bed1e6..2991e56 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -44,6 +45,91 @@
 #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO   184
 #define OMAP4_SFH7741_ENABLE_GPIO  188
 
+static int sdp4430_keymap[] = {
+   KEY(0, 0, KEY_E),
+   KEY(0, 1, KEY_R),
+   KEY(0, 2, KEY_T),
+   KEY(0, 3, KEY_HOME),
+   KEY(0, 4, KEY_F5),
+   KEY(0, 5, KEY_UNKNOWN),
+   KEY(0, 6, KEY_I),
+   KEY(0, 7, KEY_LEFTSHIFT),
+
+   KEY(1, 0, KEY_D),
+   KEY(1, 1, KEY_F),
+   KEY(1, 2, KEY_G),
+   KEY(1, 3, KEY_SEND),
+   KEY(1, 4, KEY_F6),
+   KEY(1, 5, KEY_UNKNOWN),
+   KEY(1, 6, KEY_K),
+   KEY(1, 7, KEY_ENTER),
+
+   KEY(2, 0, KEY_X),
+   KEY(2, 1, KEY_C),
+   KEY(2, 2, KEY_V),
+   KEY(2, 3, KEY_END),
+   KEY(2, 4, KEY_F7),
+   KEY(2, 5, KEY_UNKNOWN),
+   KEY(2, 6, KEY_DOT),
+   KEY(2, 7, KEY_CAPSLOCK),
+
+   KEY(3, 0, KEY_Z),
+   KEY(3, 1, KEY_KPPLUS),
+   KEY(3, 2, KEY_B),
+   KEY(3, 3, KEY_F1),
+   KEY(3, 4, KEY_F8),
+   KEY(3, 5, KEY_UNKNOWN),
+   KEY(3, 6, KEY_O),
+   KEY(3, 7, KEY_SPACE),
+
+   KEY(4, 0, KEY_W),
+   KEY(4, 1, KEY_Y),
+   KEY(4, 2, KEY_U),
+   KEY(4, 3, KEY_F2),
+   KEY(4, 4, KEY_VOLUMEUP),
+   KEY(4, 5, KEY_UNKNOWN),
+   KEY(4, 6, KEY_L),
+   KEY(4, 7, KEY_LEFT),
+
+   KEY(5, 0, KEY_S),
+   KEY(5, 1, KEY_H),
+   KEY(5, 2, KEY_J),
+   KEY(5, 3, KEY_F3),
+   KEY(5, 4, KEY_F9),
+   KEY(5, 5, KEY_VOLUMEDOWN),
+   KEY(5, 6, KEY_M),
+   KEY(5, 7, KEY_RIGHT),
+
+   KEY(6, 0, KEY_Q),
+   KEY(6, 1, KEY_A),
+   KEY(6, 2, KEY_N),
+   KEY(6, 3, KEY_BACK),
+   KEY(6, 4, KEY_BACKSPACE),
+   KEY(6, 5, KEY_UNKNOWN),
+   KEY(6, 6, KEY_P),
+   KEY(6, 7, KEY_UP),
+
+   KEY(7, 0, KEY_PROG1),
+   KEY(7, 1, KEY_PROG2),
+   KEY(7, 2, KEY_PROG3),
+   KEY(7, 3, KEY_PROG4),
+   KEY(7, 4, KEY_F4),
+   KEY(7, 5, KEY_UNKNOWN),
+   KEY(7, 6, KEY_OK),
+   KEY(7, 7, KEY_DOWN),
+};
+
+static struct matrix_keymap_data sdp4430_keymap_data = {
+   .keymap = sdp4430_keymap,
+   .keymap_size= ARRAY_SIZE(sdp4430_keymap),
+};
+
+static struct omap4_keypad_platform_data sdp4430_keypad_data = {
+   .keymap_data= &sdp4430_keymap_data,
+   .rows   = 8,
+   .cols   = 8,
+};
+
 static struct gpio_led sdp4430_gpio_leds[] = {
{
.name   = "omap4:green:debug0",
@@ -507,6 +593,10 @@ static void __init omap_4430sdp_init(void)
if (!cpu_is_omap44xx())
usb_musb_init(&musb_board_data);
 
+   status = omap4_keyboard_init(&sdp4430_keypad_data);
+   if (status)
+   pr_err("Keypad initialization failed: %d\n", status);
+
status = omap_ethernet_init();
if (status) {
pr_err("Ethernet initialization failed: %d\n", status);
-- 
1.6.3.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 v6 5/8] Input: omap4 - Wake-up on events & long presses

2010-09-29 Thread Abraham Arce
From: Mike Turquette 

Programs keyboard controller to generate a wake-up request on events and
on long key presses.  Does not generate wake-up requests on timeouts
since driver code does not handle them.

This allows keyboard to wake-up OMAP from suspend.

Signed-off-by: Mike Turquette 
Signed-off-by: Abraham Arce 
---
 drivers/input/keyboard/omap4-keypad.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/input/keyboard/omap4-keypad.c 
b/drivers/input/keyboard/omap4-keypad.c
index 07e792e..45bd097 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -54,6 +54,8 @@
 #define OMAP4_DEF_IRQENABLE_EVENTEN(1 << 0)
 #define OMAP4_DEF_IRQENABLE_LONGKEY(1 << 1)
 #define OMAP4_DEF_IRQENABLE_TIMEOUTEN  (1 << 2)
+#define OMAP4_DEF_WUP_EVENT_ENA(1 << 0)
+#define OMAP4_DEF_WUP_LONG_KEY_ENA (1 << 1)
 #define OMAP4_DEF_CTRL_NOSOFTMODE  (1 << 1)
 #define OMAP4_DEF_CTRLPTVVALUE (1 << 2)
 #define OMAP4_DEF_CTRLPTV  (1 << 1)
@@ -88,6 +90,8 @@ static void __devinit omap4_keypad_config(struct omap4_keypad 
*keypad_data)
keypad_data->base + OMAP4_KBD_IRQSTATUS);
__raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
keypad_data->base + OMAP4_KBD_IRQENABLE);
+   __raw_writel(OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA,
+   keypad_data->base + OMAP4_KBD_WAKEUPENABLE);
 }
 
 /* Interrupt handler */
-- 
1.6.3.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 v6 6/8] OMAP4: Keyboard device registration

2010-09-29 Thread Abraham Arce
Register keyboard device with hwmod framework

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

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 9e5d51b..226cc7a 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -28,6 +28,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include "mux.h"
 
@@ -138,6 +141,42 @@ static inline void omap_init_camera(void)
 }
 #endif
 
+struct omap_device_pm_latency omap4_keyboard_latency[] = {
+   {
+   .deactivate_func = omap_device_idle_hwmods,
+   .activate_func   = omap_device_enable_hwmods,
+   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+   },
+};
+
+int omap4_keyboard_init(struct omap4_keypad_platform_data
+   *keypad_data)
+{
+   struct omap_device *od;
+   struct omap_hwmod *oh;
+   const char *oh_name = "kbd";
+   const char *name = "omap4-keypad";
+
+   if (!cpu_is_omap44xx())
+   return -ENODEV;
+
+   oh = omap_hwmod_lookup(oh_name);
+   if (!oh) {
+   pr_err("Could not look up %s\n", oh_name);
+   return -ENODEV;
+   }
+
+   od = omap_device_build(name, -1, oh, keypad_data,
+   sizeof(*keypad_data),
+   omap4_keyboard_latency,
+   ARRAY_SIZE(omap4_keyboard_latency), 0);
+   if (WARN(IS_ERR(od), "Could not build omap_device for %s %s\n",
+   name, oh->name))
+   return -ENODEV;
+
+   return 0;
+}
+
 #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
 
 #define MBOX_REG_SIZE   0x120
-- 
1.6.3.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 v6 4/8] Input: omap4 - Interrupt line configuration

2010-09-29 Thread Abraham Arce
Select correct interrupt line behaviour

Signed-off-by: Abraham Arce 
---
 drivers/input/keyboard/omap4-keypad.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/input/keyboard/omap4-keypad.c 
b/drivers/input/keyboard/omap4-keypad.c
index 2b61f5f..07e792e 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -238,7 +238,7 @@ static int __devinit omap4_keypad_probe(struct 
platform_device *pdev)
omap4_keypad_config(keypad_data);
 
error = request_irq(keypad_data->irq, omap4_keypad_interrupt,
-IRQF_TRIGGER_FALLING,
+IRQF_TRIGGER_RISING,
 "omap4-keypad", keypad_data);
if (error) {
dev_err(&pdev->dev, "failed to register interrupt\n");
-- 
1.6.3.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 v6 1/8] OMAP4: hwmod data: add keyboard controller

2010-09-29 Thread Abraham Arce
From: Benoit Cousson 

Add hwmod data for OMAP4 keyboard controller
taking the following patch as base:

 OMAP4: hwmod: Add partial hwmod support for OMAP4430 ES1.0

Signed-off-by: Benoit Cousson 
Signed-off-by: Abraham Arce 
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   69 
 1 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index e20b0ee..c04a04d 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -413,6 +413,72 @@ static struct omap_hwmod omap44xx_mpu_private_hwmod = {
 };
 
 /*
+ * 'kbd' class
+ * keyboard controller
+ */
+
+static struct omap_hwmod_class_sysconfig omap44xx_kbd_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
+  SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
+  SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap44xx_kbd_hwmod_class = {
+   .name = "kbd",
+   .sysc = &omap44xx_kbd_sysc,
+};
+
+/* kbd */
+static struct omap_hwmod omap44xx_kbd_hwmod;
+static struct omap_hwmod_irq_info omap44xx_kbd_irqs[] = {
+   { .irq = 120 + OMAP44XX_IRQ_GIC_START },
+};
+
+static struct omap_hwmod_addr_space omap44xx_kbd_addrs[] = {
+   {
+   .pa_start   = 0x4a31c000,
+   .pa_end = 0x4a31c07f,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_wkup -> kbd */
+static struct omap_hwmod_ocp_if omap44xx_l4_wkup__kbd = {
+   .master = &omap44xx_l4_wkup_hwmod,
+   .slave  = &omap44xx_kbd_hwmod,
+   .clk= "l4_wkup_clk_mux_ck",
+   .addr   = omap44xx_kbd_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap44xx_kbd_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* kbd slave ports */
+static struct omap_hwmod_ocp_if *omap44xx_kbd_slaves[] = {
+   &omap44xx_l4_wkup__kbd,
+};
+
+static struct omap_hwmod omap44xx_kbd_hwmod = {
+   .name   = "kbd",
+   .class  = &omap44xx_kbd_hwmod_class,
+   .mpu_irqs   = omap44xx_kbd_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap44xx_kbd_irqs),
+   .main_clk   = "kbd_fck",
+   .prcm = {
+   .omap4 = {
+   .clkctrl_reg = OMAP4430_CM_WKUP_KEYBOARD_CLKCTRL,
+   },
+   },
+   .slaves = omap44xx_kbd_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap44xx_kbd_slaves),
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+/*
  * 'mpu' class
  * mpu sub-system
  */
@@ -470,6 +536,9 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
/* mpu_bus class */
&omap44xx_mpu_private_hwmod,
 
+   /* kbd class */
+   &omap44xx_kbd_hwmod,
+
/* mpu class */
&omap44xx_mpu_hwmod,
NULL,
-- 
1.6.3.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 v6 2/8] Input: omap4 - use platform device helpers

2010-09-29 Thread Abraham Arce
Get mem and irq resources using platform helpers

 - platform_get_base
 - platform_get_irq

Signed-off-by: Abraham Arce 
---
 arch/arm/plat-omap/include/plat/omap4-keypad.h |4 +--
 drivers/input/keyboard/omap4-keypad.c  |   40 +---
 2 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/omap4-keypad.h 
b/arch/arm/plat-omap/include/plat/omap4-keypad.h
index 522a8ab..2b1d9bc 100644
--- a/arch/arm/plat-omap/include/plat/omap4-keypad.h
+++ b/arch/arm/plat-omap/include/plat/omap4-keypad.h
@@ -8,9 +8,7 @@ struct omap4_keypad_platform_data {
 
u8 rows;
u8 cols;
-
-   u16 irq;
-   void __iomem *base;
 };
 
+extern int omap4_keyboard_init(struct omap4_keypad_platform_data *);
 #endif
diff --git a/drivers/input/keyboard/omap4-keypad.c 
b/drivers/input/keyboard/omap4-keypad.c
index 975f8bb..788169d 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -148,7 +148,10 @@ static int __devinit omap4_keypad_probe(struct 
platform_device *pdev)
const struct omap4_keypad_platform_data *pdata;
struct omap4_keypad *keypad_data;
struct input_dev *input_dev;
+   struct resource *res;
+   resource_size_t size;
unsigned int row_shift, max_keys;
+   int irq;
int error;
 
/* platform data */
@@ -158,12 +161,14 @@ static int __devinit omap4_keypad_probe(struct 
platform_device *pdev)
return -EINVAL;
}
 
-   if (!pdata->base) {
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (!res) {
dev_err(&pdev->dev, "no base address specified\n");
return -EINVAL;
}
 
-   if (!pdata->irq) {
+   irq = platform_get_irq(pdev, 0);
+   if (!irq) {
dev_err(&pdev->dev, "no keyboard irq assigned\n");
return -EINVAL;
}
@@ -184,9 +189,23 @@ static int __devinit omap4_keypad_probe(struct 
platform_device *pdev)
return -ENOMEM;
}
 
-   keypad_data->base = pdata->base;
-   keypad_data->irq = pdata->irq;
+   size = resource_size(res);
+
+   res = request_mem_region(res->start, size, pdev->name);
+   if (!res) {
+   dev_err(&pdev->dev, "can't request mem region\n");
+   error = -EBUSY;
+   goto err_free_keypad;
+   }
 
+   keypad_data->base = ioremap(res->start, resource_size(res));
+   if (!keypad_data->base) {
+   dev_err(&pdev->dev, "can't ioremap mem resource\n");
+   error = -ENOMEM;
+   goto err_release_mem;
+   }
+
+   keypad_data->irq = irq;
keypad_data->row_shift = row_shift;
keypad_data->rows = pdata->rows;
keypad_data->cols = pdata->cols;
@@ -195,7 +214,7 @@ static int __devinit omap4_keypad_probe(struct 
platform_device *pdev)
keypad_data->input = input_dev = input_allocate_device();
if (!input_dev) {
error = -ENOMEM;
-   goto err_free_keypad;
+   goto err_unmap;
}
 
input_dev->name = pdev->name;
@@ -243,6 +262,10 @@ err_free_irq:
free_irq(keypad_data->irq, keypad_data);
 err_free_input:
input_free_device(input_dev);
+err_unmap:
+   iounmap(keypad_data->base);
+err_release_mem:
+   release_mem_region(res->start, size);
 err_free_keypad:
kfree(keypad_data);
return error;
@@ -251,9 +274,16 @@ err_free_keypad:
 static int __devexit omap4_keypad_remove(struct platform_device *pdev)
 {
struct omap4_keypad *keypad_data = platform_get_drvdata(pdev);
+   struct resource *res;
 
free_irq(keypad_data->irq, keypad_data);
input_unregister_device(keypad_data->input);
+
+   iounmap(keypad_data->base);
+
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   release_mem_region(res->start, resource_size(res));
+
kfree(keypad_data);
platform_set_drvdata(pdev, NULL);
 
-- 
1.6.3.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 v6 3/8] Input: omap4 - SYSCONFIG register configuration

2010-09-29 Thread Abraham Arce
Remove SYSCONFIG register configuration, omap hwmod framework will
use internal API to modify as required

Other minor updates:

- Change a variable name from DEF to VAL, this represents a value
- Break line width to 80 characters

Signed-off-by: Abraham Arce 
---
 drivers/input/keyboard/omap4-keypad.c |   13 +
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/input/keyboard/omap4-keypad.c 
b/drivers/input/keyboard/omap4-keypad.c
index 788169d..2b61f5f 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -51,17 +51,15 @@
 #define OMAP4_KBD_FULLCODE63_320x48
 
 /* OMAP4 bit definitions */
-#define OMAP4_DEF_SYSCONFIG_SOFTRST(1 << 1)
-#define OMAP4_DEF_SYSCONFIG_ENAWKUP(1 << 2)
 #define OMAP4_DEF_IRQENABLE_EVENTEN(1 << 0)
 #define OMAP4_DEF_IRQENABLE_LONGKEY(1 << 1)
 #define OMAP4_DEF_IRQENABLE_TIMEOUTEN  (1 << 2)
 #define OMAP4_DEF_CTRL_NOSOFTMODE  (1 << 1)
 #define OMAP4_DEF_CTRLPTVVALUE (1 << 2)
 #define OMAP4_DEF_CTRLPTV  (1 << 1)
-#define OMAP4_DEF_IRQDISABLE   0x00
 
 /* OMAP4 values */
+#define OMAP4_VAL_IRQDISABLE   0x00
 #define OMAP4_VAL_DEBOUNCINGTIME   0x07
 #define OMAP4_VAL_FUNCTIONALCFG0x1E
 
@@ -82,13 +80,11 @@ struct omap4_keypad {
 
 static void __devinit omap4_keypad_config(struct omap4_keypad *keypad_data)
 {
-   __raw_writel(OMAP4_DEF_SYSCONFIG_SOFTRST | OMAP4_DEF_SYSCONFIG_ENAWKUP,
-   keypad_data->base + OMAP4_KBD_SYSCONFIG);
__raw_writel(OMAP4_VAL_FUNCTIONALCFG,
keypad_data->base + OMAP4_KBD_CTRL);
__raw_writel(OMAP4_VAL_DEBOUNCINGTIME,
keypad_data->base + OMAP4_KBD_DEBOUNCINGTIME);
-   __raw_writel(OMAP4_DEF_IRQDISABLE,
+   __raw_writel(OMAP4_VAL_IRQDISABLE,
keypad_data->base + OMAP4_KBD_IRQSTATUS);
__raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
keypad_data->base + OMAP4_KBD_IRQENABLE);
@@ -104,11 +100,12 @@ static irqreturn_t omap4_keypad_interrupt(int irq, void 
*dev_id)
u32 *new_state = (u32 *) key_state;
 
/* Disable interrupts */
-   __raw_writel(OMAP4_DEF_IRQDISABLE,
+   __raw_writel(OMAP4_VAL_IRQDISABLE,
 keypad_data->base + OMAP4_KBD_IRQENABLE);
 
*new_state = __raw_readl(keypad_data->base + OMAP4_KBD_FULLCODE31_0);
-   *(new_state + 1) = __raw_readl(keypad_data->base + 
OMAP4_KBD_FULLCODE63_32);
+   *(new_state + 1) = __raw_readl(keypad_data->base
+   + OMAP4_KBD_FULLCODE63_32);
 
for (row = 0; row < keypad_data->rows; row++) {
changed = key_state[row] ^ keypad_data->key_state[row];
-- 
1.6.3.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 v6 0/8] OMAP4 Keyboard Controller Support

2010-09-29 Thread Abraham Arce
Keyboard controller for OMAP4 includes

 - built-in scanning algorithm
 - debouncing feature

This patch series is based in already accepted OMAP4 keyboard controller:

 Linux Input Tree
 Commit a17f79553f052f04d47689a842118f775f81b7e3
 Input: add support for OMAP4 keyboard controller

Dependency on hwmod changes for OMAP4:
 http://www.mail-archive.com/linux-omap@vger.kernel.org/msg28188.html

---

v1
 http://www.mail-archive.com/linux-omap@vger.kernel.org/msg26502.html
 Initial Version

v2
 http://www.mail-archive.com/linux-omap@vger.kernel.org/msg28334.html

 Vimal.Singh.01 | Signed-off-by missing in patch
 Vimal.Singh.02 | row/column interpretation in board file
 Vimal.Singh.03 | 0 element removal in board file

 Trilok.Soni.01 | hwmod framework in mainline
 Trilok.Soni.02 | extra brackets in Kconfig
 Trilok.Soni.03 | default y/n option in Kconfig
 Trilok.Soni.04 | path/filename in the header of driver
 Trilok.Soni.05 | static? omap_device_pm_latency in driver
 Trilok.Soni.06 | input_sync added in driver
 Trilok.Soni.07 | check error return in all driver
 Trilok.Soni.08 | keypad_data->input=NULL

 Felipe.Balbi.01 | platform_driver to know about hwmod and omap_device?
 Felipe.Balbi.02 | blank line
 Felipe.Balbi.03 | saving struct device *
 Felipe.Balbi.04 | platform_data should not be saved
 Felipe.Balbi.05 | dev_dbg() usage
 Felipe.Balbi.06 | missing input_sync()
 Felipe.Balbi.07 | snprintf() usage
 Felipe.Balbi.08 | omap_hwmod and omap_device location
 Felipe.Balbi.09 | matrix_keypad_platform_data allocation from platform code
 Felipe.Balbi.10 | omap_device_build from platform code
 Felipe.Balbi.11 | registering/configuring call location

 Kevin.Hillman.01 | Driver Testing
 Kevin.Hillman.02 | omap_hwmod and omap_device location

 Dmitry.Torokhov.01 | reason to make omap_keypad_threaded threaded?
 Dmitry.Torokhov.02 | MATRIX_SCAN_CODE and incorrect values
 Dmitry.Torokhov.03 | matrix_keypad_platform_data allocation
 Dmitry.Torokhov.04 | overriding pdata pointer
 Dmitry.Torokhov.05 | keypad_codes separate allocation
 Dmitry.Torokhov.06 | keypad_data->base check location
 Dmitry.Torokhov.07 | keypad_data->irq check location
 Dmitry.Torokhov.08 | input_dev->keycodemax needed
 Dmitry.Torokhov.09 | KEY_OK set bit
 Dmitry.Torokhov.10 | MSC_SCAN report missing
 Dmitry.Torokhov.11 | input_dev = NULL;
 Dmitry.Torokhov.12 | free_irq call location in remove function

v3
 http://www.mail-archive.com/linux-omap@vger.kernel.org/msg29297.html

 Dmitry.Torokhov | Rework in driver code


v4
 http://www.mail-archive.com/linux-omap@vger.kernel.org/msg30759.html

 Felipe.Balbi.01| rows, cols, base and irq definitions
 Felipe.Balbi.02| device_* calls
 Felipe.Balbi.03| input device registration before irq enabling
 Felipe.Balbi.04| kzalloc allocation never to be freed

 Tony.Lindgren.01   | test in omap2 and omap3
 Tony.Lindgren.02   | add cpu_is_omap44xx()

 Kevin.Hillman.01   | drop device_* calls
 Kevin.Hillman.01   | use runtime PM API

 Tomas.Petazzoni.01 | oh_name declaration

v5
 Basak.Partha.01 | Enable Wakeup patch dependency by Rajendra
 Basak.Partha.02 | dev_pm_ops dummy functions, avoid .runtime functions
 Basak.Partha.03 | Remove omap_hwmod_for_each_by_class 
 Basak.Partha.04 | Remove request_mem_region
 Basak.Partha.04 | Overall PM runtime implementation

 Benoit.Cousson.01 | Detailed history required

 Anand.Gadiyar.01 | s/initialization/init for omap4_keypad_initialization
It will be renamed to omap4_keyboard_init
 Anand.Gadiyar.02 | 2 unnecessary line additions
 Anand.Gadiyar.03 | 1 unnecessary line removal
 Anand.Gadiyar.04 | Correct interrupt line behaviour in a separate patch
 Anand.Gadiyar.05 | cpu_is_omap44xx() extra check

 Sergio.Aguirre.01 | Change sdp4430_keypad_data naming, use keypad_data instead
 Sergio.Aguirre.02 | Remove unnecessary keypad_data variable
 Sergio.Aguirre.03 | 2 changes for name/oh_name definition, to be const
 Sergio.Aguirre.04 | Use sdp4430_keypad_data variable directly
 Sergio.Aguirre.05 | Add check for return value for WARN(IS_ERR(od)...

 Manjunatha.GK.01 | Use different subject: OMAP3: hwmod data: add system DMA
 Manjunatha.GK.02 | change unsigned used for negative number
 Manjunatha.GK.03 | cpu_is_omap44xx() under CONFIG_ARCH_OMAP4

---

Abraham Arce (5):
  Input: omap4 - use platform device helpers
  Input: omap4 - SYSCONFIG register configuration
  Input: omap4 - Interrupt line configuration
  OMAP4: Keyboard device registration
  Input: omap4 - pm runtime

Benoit Cousson (1):
  OMAP4: hwmod data: add keyboard controller

Mike Turquette (1):
  Input: omap4 - Wake-up on events & long presses

Syed Rafiuddin (1):
  OMAP4: Keyboard board support

 arch/arm/mach-omap2/board-4430sdp.c|   90 
 arch/arm/mach-omap2/devices.c  |   39 ++
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   69 ++
 arch/arm/plat-omap/include/plat/omap4-keypad.h |4 +

Re: Compilation: omap-for-linus omap2plus error

2010-09-29 Thread Abraham Arce
Adding more info to previous email, email account changed

On Wed, Sep 29, 2010 at 10:54 PM, Abraham Arce  wrote:
> Hi,
>
> Is there any patch missing in omap-for-linus branch?
>
>  CC      arch/arm/mach-omap2/pm_bus.o
> arch/arm/mach-omap2/pm_bus.c: In function 'omap_pm_runtime_init':
> arch/arm/mach-omap2/pm_bus.c:64: error: implicit declaration of function
> 'platform_bus_get_pm_ops'
> arch/arm/mach-omap2/pm_bus.c:64: warning: assignment makes pointer from
> integer without a cast
> arch/arm/mach-omap2/pm_bus.c:81: error: implicit declaration of function
> 'platform_bus_set_pm_ops'
> make[1]: *** [arch/arm/mach-omap2/pm_bus.o] Error 1
> make: *** [arch/arm/mach-omap2] Error 2
>

I am trying using following commit as latest

Kevin Hilman
7ad0e386d46e9edff64705ab25337ad9130baf63
OMAP2+: defconfig: disable CPUfreq

Best Regards
Abraham
--
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


Compilation: omap-for-linus omap2plus error

2010-09-29 Thread Abraham Arce

Hi,

Is there any patch missing in omap-for-linus branch?

  CC  arch/arm/mach-omap2/pm_bus.o
arch/arm/mach-omap2/pm_bus.c: In function 'omap_pm_runtime_init':
arch/arm/mach-omap2/pm_bus.c:64: error: implicit declaration of function 
'platform_bus_get_pm_ops'
arch/arm/mach-omap2/pm_bus.c:64: warning: assignment makes pointer from 
integer without a cast
arch/arm/mach-omap2/pm_bus.c:81: error: implicit declaration of function 
'platform_bus_set_pm_ops'

make[1]: *** [arch/arm/mach-omap2/pm_bus.o] Error 1
make: *** [arch/arm/mach-omap2] Error 2

Best Regards
Abraham
--
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 v4 2/4] OMAP4: Keyboard device registration

2010-06-22 Thread Abraham Arce
Charu, Kevin,

On Thu, Jun 17, 2010 at 4:08 PM, Kevin Hilman
 wrote:
> "Varadarajan, Charulatha"  writes:

[...]

>>> +
>>> +    oh = omap_hwmod_lookup(oh_name);
>>
>> Use omap_hwmod_for_each_by_class() instead of lookup by name.
>
> Yes.

how about handling all keypad data in devices.c and add
omap_init_keypad() under omap2_init_devices()?

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c

+#ifdef CONFIG_ARCH_OMAP4
+static int sdp4430_keymap[] = {
+   KEY(0, 0, KEY_E),
+   KEY(0, 1, KEY_R),

[...]

+   KEY(7, 6, KEY_OK),
+   KEY(7, 7, KEY_DOWN),
+};
+
+static struct matrix_keymap_data sdp4430_keymap_data = {
+   .keymap = sdp4430_keymap,
+   .keymap_size= ARRAY_SIZE(sdp4430_keymap),
+};
+
+static struct omap4_keypad_platform_data sdp4430_keypad_data = {
+   .keymap_data= &sdp4430_keymap_data,
+   .rows   = 8,
+   .cols   = 8,
+};
+
+struct omap_device_pm_latency omap_keyboard_latency[] = {
+   {
+   .deactivate_func = omap_device_idle_hwmods,
+   .activate_func   = omap_device_enable_hwmods,
+   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+   },
+};
+
+static int omap4_init_keypad(struct omap_hwmod *oh, void *user)
+{
+   struct omap_device *od;
+   unsigned int id = -1;
+   char *name = "omap4-keypad";
+
+   if (!oh)
+   pr_err("Could not look up omap4 kbd\n");
+
+   od = omap_device_build(name, id, oh, &sdp4430_keypad_data,
+   sizeof(struct omap4_keypad_platform_data),
+   omap_keyboard_latency,
+   ARRAY_SIZE(omap_keyboard_latency), 0);
+   WARN(IS_ERR(od), "Could not build omap_device for %s %s\n",
+   name, oh->name);
+
+   return 0;
+}
+
+static int omap_init_keypad(void)
+{
+   if (!cpu_is_omap44xx())
+   return -ENODEV;
+
+   return omap_hwmod_for_each_by_class("kbd", omap4_init_keypad, NULL);
+}
+#endif /* KEYBOARD CONFIG_ARCH_OMAP4 */
+
 #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)

 #define MBOX_REG_SIZE   0x120
@@ -807,6 +931,7 @@ static int __init omap2_init_devices(void)
 */
omap_hsmmc_reset();
omap_init_camera();
+   omap_init_keypad();
omap_init_mbox();
omap_init_mcspi();
omap_hdq_init();

>>> +    pdata->base = oh->_rt_va;
>>> +    pdata->irq = oh->mpu_irqs[0].irq;
>>
>> Use platform_get_() APIs to get base addr & irq instead of passing
>> it as pdata
>
> Yes.
>
> Thanks Charu!
>
> For all those working on OMAP hwmod conversions, please take some time
> to read the reviews of the other hwmod conversions that have already
> been posted and reviewed (some of them multiple times) so we don't
> keep duplicating the same mistakes and wasting review time.
>

These will be the changes

diff --git a/drivers/input/keyboard/omap4-keypad.c
b/drivers/input/keyboard/omap4-keypad.c
index 975f8bb..c606e36 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c

@@ -158,12 +213,14 @@ static int __devinit omap4_keypad_probe(struct
platform_device *pdev)
return -EINVAL;
}

-   if (!pdata->base) {
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (!res) {
dev_err(&pdev->dev, "no base address specified\n");
return -EINVAL;
}

-   if (!pdata->irq) {
+   irq = platform_get_irq(pdev, 0);
+   if (!irq) {
dev_err(&pdev->dev, "no keyboard irq assigned\n");
return -EINVAL;
}

@@ -184,9 +240,22 @@ static int __devinit omap4_keypad_probe(struct
platform_device *pdev)
return -ENOMEM;
}

-   keypad_data->base = pdata->base;
-   keypad_data->irq = pdata->irq;
+   mem = request_mem_region(res->start,
+   resource_size(res), pdev->name);
+   if (!mem) {
+   dev_err(&pdev->dev, "no mem region available\n");
+   return -ENOMEM;
+   goto err_free_keypad;
+   }
+
+   keypad_data->base = ioremap(res->start, resource_size(res));
+   if (!keypad_data->base) {
+   dev_err(&pdev->dev, "can't ioremap mem resource.\n");
+   error = -ENOMEM;
+   goto err_free_memreg;
+   }

+   keypad_data->irq = irq;

Best Regards
Abraham
--
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 v4 0/4] OMAP4 Keyboard Controller Support

2010-06-22 Thread Abraham Arce
Kevin,

On Thu, Jun 17, 2010 at 4:06 PM, Kevin Hilman
 wrote:

>>  Kevin.Hillman.01   | drop device_* calls
>>  Kevin.Hillman.01   | use runtime PM API
>
> I don't see the runtime PM API used anywere in this series.
>

I have not implemented runtime pm yet... will do on top of latest
version to be sent this week...

Best Regards
Abraham
--
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 4/4] OMAP4: Keyboard kernel configuration

2010-06-16 Thread Abraham Arce
From: Syed Rafiuddin 

Update OMAP4430 configuration to enable OMAP4 keyboard driver

Signed-off-by: Abraham Arce 
---
 arch/arm/configs/omap_4430sdp_defconfig |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/omap_4430sdp_defconfig 
b/arch/arm/configs/omap_4430sdp_defconfig
index 1fb0456..54c924f 100644
--- a/arch/arm/configs/omap_4430sdp_defconfig
+++ b/arch/arm/configs/omap_4430sdp_defconfig
@@ -578,7 +578,8 @@ CONFIG_INPUT_EVDEV=y
 #
 # Input Device Drivers
 #
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_OMAP4=y
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
-- 
1.6.3.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 v4 3/4] OMAP4: Keyboard board support

2010-06-16 Thread Abraham Arce
Keyboard support for SDP OMAP4430

Signed-off-by: Abraham Arce 
---
 arch/arm/mach-omap2/board-4430sdp.c |   99 +++
 1 files changed, 99 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index e4a5d66..db30f15 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -34,12 +34,106 @@
 #include 
 #include 
 #include 
+#include 
 #include "hsmmc.h"
 
 #define ETH_KS8851_IRQ 34
 #define ETH_KS8851_POWER_ON48
 #define ETH_KS8851_QUART   138
 
+static int sdp4430_keymap[] = {
+   KEY(0, 0, KEY_E),
+   KEY(0, 1, KEY_R),
+   KEY(0, 2, KEY_T),
+   KEY(0, 3, KEY_HOME),
+   KEY(0, 4, KEY_F5),
+   KEY(0, 5, KEY_UNKNOWN),
+   KEY(0, 6, KEY_I),
+   KEY(0, 7, KEY_LEFTSHIFT),
+
+   KEY(1, 0, KEY_D),
+   KEY(1, 1, KEY_F),
+   KEY(1, 2, KEY_G),
+   KEY(1, 3, KEY_SEND),
+   KEY(1, 4, KEY_F6),
+   KEY(1, 5, KEY_UNKNOWN),
+   KEY(1, 6, KEY_K),
+   KEY(1, 7, KEY_ENTER),
+
+   KEY(2, 0, KEY_X),
+   KEY(2, 1, KEY_C),
+   KEY(2, 2, KEY_V),
+   KEY(2, 3, KEY_END),
+   KEY(2, 4, KEY_F7),
+   KEY(2, 5, KEY_UNKNOWN),
+   KEY(2, 6, KEY_DOT),
+   KEY(2, 7, KEY_CAPSLOCK),
+
+   KEY(3, 0, KEY_Z),
+   KEY(3, 1, KEY_KPPLUS),
+   KEY(3, 2, KEY_B),
+   KEY(3, 3, KEY_F1),
+   KEY(3, 4, KEY_F8),
+   KEY(3, 5, KEY_UNKNOWN),
+   KEY(3, 6, KEY_O),
+   KEY(3, 7, KEY_SPACE),
+
+   KEY(4, 0, KEY_W),
+   KEY(4, 1, KEY_Y),
+   KEY(4, 2, KEY_U),
+   KEY(4, 3, KEY_F2),
+   KEY(4, 4, KEY_VOLUMEUP),
+   KEY(4, 5, KEY_UNKNOWN),
+   KEY(4, 6, KEY_L),
+   KEY(4, 7, KEY_LEFT),
+
+   KEY(5, 0, KEY_S),
+   KEY(5, 1, KEY_H),
+   KEY(5, 2, KEY_J),
+   KEY(5, 3, KEY_F3),
+   KEY(5, 4, KEY_F9),
+   KEY(5, 5, KEY_VOLUMEDOWN),
+   KEY(5, 6, KEY_M),
+   KEY(5, 7, KEY_RIGHT),
+
+   KEY(6, 0, KEY_Q),
+   KEY(6, 1, KEY_A),
+   KEY(6, 2, KEY_N),
+   KEY(6, 3, KEY_BACK),
+   KEY(6, 4, KEY_BACKSPACE),
+   KEY(6, 5, KEY_UNKNOWN),
+   KEY(6, 6, KEY_P),
+   KEY(6, 7, KEY_UP),
+
+   KEY(7, 0, KEY_PROG1),
+   KEY(7, 1, KEY_PROG2),
+   KEY(7, 2, KEY_PROG3),
+   KEY(7, 3, KEY_PROG4),
+   KEY(7, 4, KEY_F4),
+   KEY(7, 5, KEY_UNKNOWN),
+   KEY(7, 6, KEY_OK),
+   KEY(7, 7, KEY_DOWN),
+};
+
+static struct matrix_keymap_data sdp4430_keymap_data = {
+   .keymap = sdp4430_keymap,
+   .keymap_size= ARRAY_SIZE(sdp4430_keymap),
+};
+
+static struct omap4_keypad_platform_data sdp4430_keypad_data = {
+   .keymap_data= &sdp4430_keymap_data,
+   .rows   = 8,
+   .cols   = 8,
+};
+
+static struct platform_device sdp4430_keypad_device = {
+   .name   = "omap4-keypad",
+   .id = -1,
+   .dev= {
+   .platform_data = &sdp4430_keypad_data,
+   },
+};
+
 static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
{
.modalias   = "ks8851",
@@ -112,6 +206,7 @@ static struct platform_device sdp4430_lcd_device = {
 
 static struct platform_device *sdp4430_devices[] __initdata = {
&sdp4430_lcd_device,
+   &sdp4430_keypad_device,
 };
 
 static struct omap_lcd_config sdp4430_lcd_config __initdata = {
@@ -380,6 +475,10 @@ static void __init omap_4430sdp_init(void)
if (!cpu_is_omap44xx())
usb_musb_init(&musb_board_data);
 
+   status = omap4_init_kp(&sdp4430_keypad_data);
+   if (status)
+   pr_err("Keypad initialization failed: %d\n", status);
+
status = omap_ethernet_init();
if (status) {
pr_err("Ethernet initialization failed: %d\n", status);
-- 
1.6.3.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 v4 2/4] OMAP4: Keyboard device registration

2010-06-16 Thread Abraham Arce
Register keyboard device with hwmod framework

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

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 03e6c9e..d229901 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -29,6 +30,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include "mux.h"
 
@@ -139,6 +143,52 @@ static inline void omap_init_camera(void)
 }
 #endif
 
+#ifdef CONFIG_ARCH_OMAP4
+
+struct omap_device_pm_latency omap_keyboard_latency[] = {
+   {
+   .deactivate_func = omap_device_idle_hwmods,
+   .activate_func   = omap_device_enable_hwmods,
+   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+   },
+};
+
+int omap4_init_kp(struct omap4_keypad_platform_data *kp)
+{
+   struct omap_hwmod *oh;
+   struct omap_device *od;
+   struct omap4_keypad_platform_data *pdata;
+
+   unsigned int id = 0;
+   char *name = "omap4-keypad";
+   char *oh_name = "kbd";
+
+   if (!cpu_is_omap44xx())
+   return -ENODEV;
+
+   oh = omap_hwmod_lookup(oh_name);
+   if (!oh) {
+   pr_err("Could not look up %s\n", oh_name);
+   return -EIO;
+   }
+
+   pdata = kp;
+
+   pdata->base = oh->_rt_va;
+   pdata->irq = oh->mpu_irqs[0].irq;
+
+   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);
+
+   return 0;
+}
+
+#endif
+
 #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
 
 #define MBOX_REG_SIZE   0x120
-- 
1.6.3.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 v4 1/4] OMAP4: Keyboard controller support

2010-06-16 Thread Abraham Arce
OMAP4 keyboard controller includes:
  - built-in scanning algorithm
  - debouncing feature

Driver implementation is based on matrix_keypac.c

Signed-off-by: Syed Rafiuddin 
Signed-off-by: Abraham Arce 
Signed-off-by: Dmitry Torokhov 
---
 arch/arm/plat-omap/include/plat/omap4-keypad.h |   19 ++
 drivers/input/keyboard/Kconfig |   10 +
 drivers/input/keyboard/Makefile|1 +
 drivers/input/keyboard/omap4-keypad.c  |  288 
 4 files changed, 318 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/omap4-keypad.h
 create mode 100644 drivers/input/keyboard/omap4-keypad.c

diff --git a/arch/arm/plat-omap/include/plat/omap4-keypad.h 
b/arch/arm/plat-omap/include/plat/omap4-keypad.h
new file mode 100644
index 000..d11c3ab
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap4-keypad.h
@@ -0,0 +1,19 @@
+#ifndef ARCH_ARM_PLAT_OMAP4_KEYPAD_H
+#define ARCH_ARM_PLAT_OMAP4_KEYPAD_H
+
+#include 
+
+struct omap4_keypad_platform_data {
+   const struct matrix_keymap_data *keymap_data;
+
+   u8 rows;
+   u8 cols;
+
+   u16 irq;
+   void __iomem *base;
+};
+
+extern int omap4_init_kp(struct omap4_keypad_platform_data *kpd);
+
+#endif
+
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index d8fa5d7..af5ef6e 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -393,6 +393,16 @@ config KEYBOARD_OMAP
  To compile this driver as a module, choose M here: the
  module will be called omap-keypad.
 
+config KEYBOARD_OMAP4
+   tristate "TI OMAP4 keypad support"
+   depends on ARCH_OMAP4
+   default n
+   help
+ Say Y here if you want to use the OMAP4 keypad.
+
+ To compile this driver as a module, choose M here: the
+ module will be called omap4-keypad.
+
 config KEYBOARD_TWL4030
tristate "TI TWL4030/TWL5030/TPS659x0 keypad support"
depends on TWL4030_CORE
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 4596d0c..fe48826 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_KEYBOARD_MATRIX) += matrix_keypad.o
 obj-$(CONFIG_KEYBOARD_MAX7359) += max7359_keypad.o
 obj-$(CONFIG_KEYBOARD_NEWTON)  += newtonkbd.o
 obj-$(CONFIG_KEYBOARD_OMAP)+= omap-keypad.o
+obj-$(CONFIG_KEYBOARD_OMAP4)   += omap4-keypad.o
 obj-$(CONFIG_KEYBOARD_OPENCORES)   += opencores-kbd.o
 obj-$(CONFIG_KEYBOARD_PXA27x)  += pxa27x_keypad.o
 obj-$(CONFIG_KEYBOARD_PXA930_ROTARY)   += pxa930_rotary.o
diff --git a/drivers/input/keyboard/omap4-keypad.c 
b/drivers/input/keyboard/omap4-keypad.c
new file mode 100644
index 000..5e224f2
--- /dev/null
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -0,0 +1,288 @@
+/*
+ * OMAP4 Keypad Driver
+ *
+ * Copyright (C) 2010 Texas Instruments
+ *
+ * Author: Abraham Arce 
+ * Initial Code: Syed Rafiuddin 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/* OMAP4 registers */
+#define OMAP4_KBD_REVISION 0x00
+#define OMAP4_KBD_SYSCONFIG0x10
+#define OMAP4_KBD_SYSSTATUS0x14
+#define OMAP4_KBD_IRQSTATUS0x18
+#define OMAP4_KBD_IRQENABLE0x1C
+#define OMAP4_KBD_WAKEUPENABLE 0x20
+#define OMAP4_KBD_PENDING  0x24
+#define OMAP4_KBD_CTRL 0x28
+#define OMAP4_KBD_DEBOUNCINGTIME   0x2C
+#define OMAP4_KBD_LONGKEYTIME  0x30
+#define OMAP4_KBD_TIMEOUT  0x34
+#define OMAP4_KBD_STATEMACHINE 0x38
+#define OMAP4_KBD_ROWINPUTS0x3C
+#define OMAP4_KBD_COLUMNOUTPUTS0x40
+#define OMAP4_KBD_FULLCODE31_0 0x44
+#define OMAP4_KBD_FULLCODE63_320x48
+
+/* OMAP4 bit definitions */
+#define OMAP4_DEF_SYSCONFIG_SOFTRST(1 << 1)
+#define OMAP4_DEF_SYSCONFIG_ENAWKUP(1 << 2)
+#define OMAP4_DEF_IRQENABLE_EVENTEN(1 << 0)
+#define OMAP4_DEF_IRQENABLE_LONGKEY(1 << 1)
+#define OMAP4_DEF_IRQENABLE_TIMEOUTEN  (1 << 2)
+#define OMAP4_DEF_CTRL_NOSOFTMODE  (1 <

[PATCH v4 0/4] OMAP4 Keyboard Controller Support

2010-06-16 Thread Abraham Arce
Keyboard controller for OMAP4 includes

 - built-in scanning algorithm
 - debouncing feature
 - handling mechanism up to 9 x 9 keys
 - wake-up event generation

Tested using SDP4430 board in Kevin Hillman's tree,
pm-wip/hwmods-omap4 branch

---

v1
 http://www.mail-archive.com/linux-omap@vger.kernel.org/msg26502.html

v2
 http://www.mail-archive.com/linux-omap@vger.kernel.org/msg28334.html

v3
 Dmitry.Torokhov | Rework in driver code
 http://www.mail-archive.com/linux-omap@vger.kernel.org/msg29297.html

v4
 Felipe.Balbi.01| rows, cols, base and irq definitions
 Felipe.Balbi.02| device_* calls
 Felipe.Balbi.03| input device registration before irq enabling
 Felipe.Balbi.04| kzalloc allocation never to be freed

 Tony.Lindgren.01   | test in omap2 and omap3
 Tony.Lindgren.02   | add cpu_is_omap44xx()

 Kevin.Hillman.01   | drop device_* calls
 Kevin.Hillman.01   | use runtime PM API

 Tomas.Petazzoni.01 | oh_name declaration

---

Abraham Arce (3):
  OMAP4: Keyboard controller support
  OMAP4: Keyboard device registration
  OMAP4: Keyboard board support

Syed Rafiuddin (1):
  OMAP4: Keyboard kernel configuration

 arch/arm/configs/omap_4430sdp_defconfig|3 +-
 arch/arm/mach-omap2/board-4430sdp.c|   99 
 arch/arm/mach-omap2/devices.c  |   50 
 arch/arm/plat-omap/include/plat/omap4-keypad.h |   19 ++
 drivers/input/keyboard/Kconfig |   10 +
 drivers/input/keyboard/Makefile|1 +
 drivers/input/keyboard/omap4-keypad.c  |  288 
 7 files changed, 469 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/omap4-keypad.h
 create mode 100644 drivers/input/keyboard/omap4-keypad.c

--
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 1/3] TCA6416 keypad : Implement keypad driver for keys interfaced to TCA6416

2010-04-04 Thread Abraham Arce
Sriramakrishnan,

Find minor changes proposals...

> +
> +         Say Y here if your device has keys connected to
> +         TCA6416 IO expander. Your board-specific setup logic
> +         must also provide pin-mask details(of which TCA6416 pins
> +         are used for keypad).

space in " details ( "



> +       if (chip->use_polling)
> +               schedule_delayed_work(&chip->dwork, msecs_to_jiffies(100));
> +       else
> +               enable_irq(chip->irqnum);
> +
> +}
> +
> +

remove one blank line

> +
> +       /* initialize cached registers from their original values.
> +        * we can't share this chip with another i2c master.
> +        */

should we start our comment section as below?

/*
 * initialize...



> +
> +       ret = tca6416_read_reg(chip, TCA6416_INPUT, &chip->reg_input);
> +       if (ret)
> +               goto fail1;
> +
> +       i2c_set_clientdata(client, chip);
> +
> +

remove one blank line



> +
> +       if (!chip->use_polling) {
> +               if (pdata->irq_is_gpio)
> +                       chip->irqnum = gpio_to_irq(client->irq);
> +               else
> +                       chip->irqnum = client->irq;
> +
> +               ret = request_irq(chip->irqnum, tca6416_keys_isr,
> +                               IRQF_SHARED | IRQF_TRIGGER_FALLING ,
> +                               "tca6416-keypad", chip);
> +               if (ret) {
> +                       dev_dbg(&client->dev,
> +                               "Unable to claim irq %d; error %d\n",
> +                               chip->irqnum, ret);
> +                       goto fail3;
> +               }
> +               disable_irq(chip->irqnum);

why not using threaded irq?

Best Regards
Abraham
--
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


[linux-omap-pm] some test results

2009-05-25 Thread Abraham Arce
Hi,

Find some some results after applying some level of testing to
linux-omap-pm tree. Please let me know any question you may have.

-> Board
 OMAP ES3.1, TRITON2 ES3.1

-> Kernel Tree
 git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git
Commit
 417a059f1bac2781ce10ad614d31b5a17513d469
 OMAP3: PM: remove save/restore of exception handler state

-> Default K Configuration
 omap_3430sdp_pm_defconfig

The following configurations have been tested so far

 Default K Configuration + [*] No PM layer
 Default K Configuration + [*] No-op/debug PM layer
 Default K Configuration + [*] PM layer implemented using SRF
 Default K Configuration + [ ] Power Management support + [*] No PM layer
 Default K Configuration + [ ] Power Management support + [*]
No-op/debug PM layer

-> U-Boot Tree
 git://git.omapzoom.org/repo/u-boot.git
Commit
 80441279e3aecd8b8ca020faf65990d52978843b
 Uboot Use tag of head in the local version.

-> Toolchain
 Sourcery G++ Lite 2008q3-72

-> Filesystem
 8 MB, Ramdisk

-> Messages at boot up time, taking Default K Configuration
 .
 Reprogramming SDRC
 dpll3_m2_clk rate change failed: -22
 .
 clock: dpll5_ck failed transition to 'locked'
 .
 SR1: VDD autocomp is not active
 .

-> The following issues apply for the following configurations
 - Taking Default K Configuration + [*] No PM layer
 - Taking Default K Configuration + [*] No-op/debug PM layer
 - Taking Default K Configuration + [*] PM layer implemented using SRF

* All the issues were confirmed after booting the board with no
previous activity
* Using both wake up modes, manual and GPT

{1}
Error messages when enabling /sys/power/sleep_while_idle
 # echo 1 > /sys/power/sleep_while_idle
 omapfb omapfb: irq error status 00e2
 omapfb omapfb: irq error status 00c2
 omapfb omapfb: irq error status 0060
 __ratelimit: 1750 callbacks suppressed
 Spurious irq 95: 0xffdf, please flush posted write for irq 25

{2}
omapfb message when resuming
 # echo 1 > /sys/power/sleep_while_idle
 # echo mem > /sys/power/state
 PM: Syncing filesystems ... done.
 ..
 omapfb omapfb: timeout waiting for FRAME DONE

{3}
SYS_OFF_MODE Led won't light up red the first time
 # echo 1 > /sys/power/sleep_while_idle
 # echo 1 > /sys/power/enable_off_mode
 # echo 1 > /sys/power/voltage_off_while_idle
 # echo 1 > /sys/devices/platform/serial8250.0/sleep_timeout
 # echo mem > /sys/power/state
 SYS_OFF_MODE Led | Green Light
 VCORE_EN Led | Green Light
 # echo mem > /sys/power/state
 SYS_OFF_MODE Led | Red Light
 VCORE_EN Led | Green Light

* VCORE_EN Led will not go out if /sys/power/enable_off_mode is enabled
* SYS_OFF_MODE can light up red the first time following the above
steps but if no activity is present in console for more than 30
seconds before suspending, as

 # echo 1 > /sys/power/sleep_while_idle
 # echo 1 > /sys/power/enable_off_mode
 # echo 1 > /sys/power/voltage_off_while_idle
 # echo 1 > /sys/devices/platform/serial8250.0/sleep_timeout
 
 # echo mem > /sys/power/state

{4}
System is rebooting when suspending several times, the steps to reproduce are
as follows but not 100% reproducible, "x seconds" can vary
 # echo 1 > /sys/power/sleep_while_idle
 # echo 1 > /sys/power/enable_off_mode
 # echo 1 > /sys/power/voltage_off_while_idle
  
 # echo mem > /sys/power/state
 PM: Syncing filesystems ... done.
 Freezing user space processes ... (elapsed 0.00 seconds) done.
 Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
 Suspending console(s) (use no_console_suspend to debug)
  
 omapfb omapfb: timeout waiting for FRAME DONE
 Successfully put all powerdomains to target state
 Restarting tasks ... done.
 # echo mem > /sys/power/state
 PM: Syncing filesystems ... done.
 Freezing user space processes ... (elapsed 0.00 seconds) done.
 Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
 Suspending console(s) (use no_console_suspend to debug)


 U-Boot 1.1.4-g80441279 (May 14 2009 - 23:46:51)


-> Power Management Tester > https://garage.maemo.org/projects/pm-test/
This is considered to be tested, I'll give details when it is done...

Best Regards
Abraham
--
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: Issues with PM Branch

2009-04-28 Thread Abraham Arce
> The non-USB related hang looks like the problem when using smartreflex
> without SRF.  If you disable smartreflex, or use smartreflex with SRF
> you should boot past that hang.
>
> For MUSB, it has not yet been validated on the PM branch.

Thanks Kevin... I have disabled SmartReflex, it is booting now but
after some time of interaction, console will become unresponsive,
commands won't be executed

 # ps -aux
 ^C

Is there any setting I should set up before in menuconfig? sysfs?

Abraham
--
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


Issues with PM Branch

2009-04-28 Thread Abraham Arce
Hi,

I am having some hangs using origin/pm branch. SDPs used to test, same
behaviour:

 SDP3430 PROCESSOR BD, ES2.0
 SDP3430 PROCESSOR BD III, OMAP3430 ES3.0 EMU(MT), TWL5030 ES1.0

The commit taken is latest:

 commit 9d76f46e79302058464b569dbad9af8c594dbe53
 author Roger Quadros 
 PM: OMAP: Fix build with CONFIG_OMAP_PM_NONE set

If default configuration is used (omap_3430sdp_defconfig) then a
kernel panic will occur:

 <7>Switched to high resolution mode on CPU 0
 <6>musb_hdrc: version 6.0, musb-dma, otg (peripheral+host), debug=0
 <1>Unhandled fault: external abort on non-linefetch (0x1028) at 0xd80ab404
 Internal error: : 1028 [#1]
 Modules linked in:
 CPU: 0Not tainted  (2.6.29-omap1-05686-g9d76f46 #1)
 PC is at musb_platform_init+0x5c/0xf8
 LR is at omap2_clk_enable+0x114/0x184
 pc : []lr : []psr: 4013
 sp : c7817d50  ip : 0001  fp : c7817d64
 r10:   r9 : c78281f0  r8 : c03ad128
 r7 : c7831240  r6 : c78280d8  r5 :   r4 : c78280d8
 r3 : d80ab000  r2 : 0200  r1 :   r0 : 
 Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
 Control: 10c5387d  Table: 80004019  DAC: 0017
 Process swapper (pid: 1, stack limit = 0xc78162e0)
 Stack: (0xc7817d50 to 0xc7818000)
 ...
 [] (musb_platform_init+0x0/0xf8) from []
(musb_probe+0x244/0xbe8) r5: r4:c0394db8
 [] (musb_probe+0x0/0xbe8) from []
(platform_drv_probe+0x20/0x24)
 [] (platform_drv_probe+0x0/0x24) from []
(driver_probe_device+0xd4/0x180)

If USB is disabled then a hang now will be present in Power Management
for TI OMAP3

 <6>RPC: Registered udp transport module.
 RPC: Registered udp transport module.
 <6>RPC: Registered tcp transport module.
 RPC: Registered tcp transport module.
 <3>Power Management for TI OMAP3.
 Power Management for TI OMAP3.
 <ö

To avoid this last hang going back to the previous commit is needed,
after this, the boot is Ok

 commit 90c3bdfb394ff2ddd87a72defb49c2f2456dd621
 Author: Rajendra Nayak 
 OMAP3 clock: Update cpufreq driver

If minimal defconfig (omap_3430sdp_min_defconfig) is used, boot will be ok.

Has anyone faced same issue?

Best Regards
Abraham
--
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 1/1] SDP2430 Fix dependency in include file

2008-09-01 Thread Abraham Arce
On Mon, Sep 1, 2008 at 3:07 AM, Felipe Balbi <[EMAIL PROTECTED]> wrote:

>>  #include 
>>  #include 
>>  #include 
>> +#include 
>
> and what's wrong with:

Nothing is bad... I didn't see the patch

>
> http://marc.info/?l=linux-omap&m=122011272912755&w=2
>
> --
> balbi
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/1] SDP2430 Fix dependency in include file

2008-08-31 Thread Abraham Arce
TWL4030_MODIRQ_KEYPAD was undeclared, adding the required file.

Signed-off-by: Abraham Arce <[EMAIL PROTECTED]>
---
 arch/arm/mach-omap2/board-2430sdp.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-2430sdp.c
b/arch/arm/mach-omap2/board-2430sdp.c
index 64e76e8..195d53c 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 

 #include 
--
1.5.6.4
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: omap ldp board(3430) failed to read/write NAND flash device after booting from nfs

2008-08-05 Thread Abraham Arce
Tao,

> I have booted the omap ldp board with nfs. I want to bootup from flash.
> so I want to test if linux kernel could read/write flash device.

before booting, execute a  'nand unlock' in u-boot

>> > / # dd if=/dev/mtblock4 of=test2  count=1

# dd if=/dev/mtdblock4 of=test2  count=1
1+0 records in
1+0 records out

>> > / # / # dd if=ext2.img of=/dev/mtdblock5 count=4

# dd if=rd-ext2.bin of=/dev/mtdblock5 count=4
4+0 records in
4+0 records out
# cat /proc/mtd
dev:size   erasesize  name
mtd0: 0008 0002 "X-Loader-NAND"
mtd1: 0008 0002 "U-Boot-NAND"
mtd2: 0004 0002 "Boot Env-NAND"
mtd3: 0040 0002 "Kernel-NAND"
mtd4: 0fac 0002 "File System - NAND"
# dd if=rd-ext2.bin of=/dev/mtdblock4 count=4
4+0 records in
4+0 records out

Best Regards
Abraham
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: omap 0sk and mistral touchscreen..

2008-05-26 Thread Abraham Arce
Shareef,

Any feature that turns off the display some time after boot up?

If you execute Xfbdev, are you able to see the X cursor?

If you execute Xfbdev in background and then start ts_calibrate, what
do you get in display and serial port?

Best Regards
Abraham


On Tue, May 27, 2008 at 12:32 AM, mohammed shareef <[EMAIL PROTECTED]> wrote:
> Hi,
>
> i tried the following environment variables:
>
> # export TSLIB_TSDEVICE=/dev/input/event1
> # export TSLIB_CONFFILE=/etc/ts.conf
> # export TSLIB_FBDEVICE=/dev/fb0
> # export TSLIB_PLUGINDIR=/usr/lib/ts
> # export TSLIB_CALIBFILE=/etc/pointercal
> # export TSLIB_CONSOLEDEVICE=none
> # /usr/X11/bin/ts_calibrate
>
> also int the "ts.conf"  file "module_raw input" is uncommented .
>
> but again nothing comes up on the LCD screen.
>
> thanx and regards,
> Shareef
>
> On Tue, May 27, 2008 at 10:33 AM, S.Rajeev <[EMAIL PROTECTED]> wrote:
>> Hi ,
>>
>>
>> Make the following change :
>>
>> 1) In the "ts.conf"  file make sure "module_raw input" is uncommented .
>> 2) export TSLIB_CONSOLEDEVICE=none
>>
>>
>> Thanks and Regards
>> rajeev
>>
>> - Original Message - From: "mohammed shareef" <[EMAIL PROTECTED]>
>> To: "Abraham Arce" <[EMAIL PROTECTED]>
>> Cc: "omap" 
>> Sent: Tuesday, May 27, 2008 9:56 AM
>> Subject: Re: omap 0sk and mistral touchscreen..
>>
>>
>>> Dear Abraham,
>>>
>>> I am not receiving any error nor any messages on the LCD.. i have
>>> added the following environment variables:
>>>
>>> export TSLIB_TSDEVICE=/dev/input/event1
>>> export TSLIB_CONFFILE=/etc/ts.conf
>>> export TSLIB_CONSOLEDEVICE=/dev/ttyS0
>>> export TSLIB_FBDEVICE=/dev/fb0
>>> export TSLIB_PLUGINDIR=/usr/lib/ts
>>> export TSLIB_CALIBFILE=/etc/pointercal
>>>
>>> everything seems fine.. except that i dont get any calibration
>>> messages on the lcd.
>>>
>>> regards,
>>> Shareef
>>>
>>> On Mon, May 26, 2008 at 9:12 PM, Abraham Arce
>>> <[EMAIL PROTECTED]> wrote:
>>>>
>>>> On 5/26/08, mohammed shareef <[EMAIL PROTECTED]> wrote:
>>>>>
>>>>> Dear All,
>>>>>
>>>>> i cross-compiled the tslib for my filesystem as mentioned in:
>>>>>
>>>>> http://linux.omap.com/pipermail/linux-omap-open-source/2005-March/003174.html
>>>>>
>>>>> and i have put the executables in the filesystem.
>>>>> when i do
>>>>> /usr/X11/bin/ts_calibrate
>>>>>
>>>>> i dont get any "calibration request" on the LCD.
>>>>
>>>> when you run ts_calibrate what are the messages you are getting?
>>>>
>>>> are you receiving the following?
>>>>  Couldnt load module input
>>>> if so, add a third exported variable:
>>>>  export TSLIB_PLUGINDIR=/lib/ts
>>>>
>>>>> But when i do:
>>>>>
>>>>> cat /dev/input/event1
>>>>>
>>>>> i could see that i get stuff on my host computer when i touch the
>>>>> screen. which means that my toucscreen is associated with event1. i
>>>>> have even set up the proper environment variables.
>>>>>
>>>>> doing:
>>>>> cat /proc/interrupts
>>>>> also shows that spi interrupts incrementing on touching the screen.
>>>>>
>>>>> cat /proc/bus/input/devices
>>>>> I: Bus= Vendor= Product= Version=
>>>>> N: Name="ADS784x Touchscreen"
>>>>> P: Phys=spi2.0/input0
>>>>> S: Sysfs=/class/input/input1
>>>>> H: Handlers=mouse0 event1 ts0
>>>>> B: EV=b
>>>>> B: KEY=400 0 0 0 0 0 0 0 0 0 0
>>>>> B: ABS=103
>>>>>
>>>>> but running
>>>>> ts_calibrate doesnt show any cross-hairs on the LCD.
>>>>>
>>>>> could you tell me if am missing something?
>>>>>
>>>>> thank you,
>>>>> warm regards,
>>>>> Shareef
>>>>> --
>>>>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>>>>> the body of a message to [EMAIL PROTECTED]
>>>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>>>

Re: omap 0sk and mistral touchscreen..

2008-05-26 Thread Abraham Arce
On 5/26/08, mohammed shareef <[EMAIL PROTECTED]> wrote:
> Dear All,
>
> i cross-compiled the tslib for my filesystem as mentioned in:
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-March/003174.html
>
> and i have put the executables in the filesystem.
> when i do
> /usr/X11/bin/ts_calibrate
>
> i dont get any "calibration request" on the LCD.

when you run ts_calibrate what are the messages you are getting?

are you receiving the following?
  Couldnt load module input
if so, add a third exported variable:
  export TSLIB_PLUGINDIR=/lib/ts

> But when i do:
>
> cat /dev/input/event1
>
> i could see that i get stuff on my host computer when i touch the
> screen. which means that my toucscreen is associated with event1. i
> have even set up the proper environment variables.
>
> doing:
> cat /proc/interrupts
> also shows that spi interrupts incrementing on touching the screen.
>
> cat /proc/bus/input/devices
> I: Bus= Vendor= Product= Version=
> N: Name="ADS784x Touchscreen"
> P: Phys=spi2.0/input0
> S: Sysfs=/class/input/input1
> H: Handlers=mouse0 event1 ts0
> B: EV=b
> B: KEY=400 0 0 0 0 0 0 0 0 0 0
> B: ABS=103
>
> but running
> ts_calibrate doesnt show any cross-hairs on the LCD.
>
> could you tell me if am missing something?
>
> thank you,
> warm regards,
> Shareef
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to [EMAIL PROTECTED]
> 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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html