Re: [PATCH 03/03] omap hsmmc: adaptation of sdma descriptor autoloading feature

2010-03-12 Thread Venkatraman S
Tony Lindgren wrote:
 * Venkatraman S svenk...@ti.com [100311 07:04]:
 Tony Lindgren wrote:
 
  Does the driver still work in PIO mode?
 
  We need to have the drivers capable to fail over to PIO mode
  as the DMA channels can run out.
 

    The driver doesn't have an automatic fallback to PIO,
 even without my patch. A error return from omap_request_dma is
 propogated all the way back to the transfer request.
   The decision to use_dma (the variable) is unaltered.

 OK, that might explain some nasty surprises then..

 With these patches, does the driver still work in PIO mode though?

No. The workhorse code to actually push the data byte by byte
is not present in the hsmmc driver.
--
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: [PATCHv2 0/5] FIFO caused playback delay (latency) handling in soc/omap

2010-03-12 Thread Jarkko Nikula
On Fri, 12 Mar 2010 08:18:30 +0200
Peter Ujfalusi peter.ujfal...@nokia.com wrote:

 On Friday 12 March 2010 00:43:41 ext Mark Brown wrote:
 
  I can do, though there was some debate about how useful the
  information the hardware returns actually is - could folks confirm
  what the consensus there was, please?
 
 Yeah, that thread went silent without final go or no go...
 
...
 All in all, I think the usage of the BUFFSTAT register is a good compromise 
 for 
 all cases, and it is needed for the cases, where the codec also have buffer 
 of 
 it's own.
 
And one point is that the BUFFSTAT use doesn't make things worse than
currently.  Now the application doesn't have any information about the
HW buffer caused audio latencies so reporting them makes the things
better than currently.


-- 
Jarkko
--
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/3] usb: Fix compile error for omaps for musb_hdrc

2010-03-12 Thread Felipe Balbi

On Thu, Mar 11, 2010 at 07:03:22PM +0100, ext Tony Lindgren wrote:

CONFIG_ARCH_OMAP34XX is now CONFIG_ARCH_OMAP3.

But since drivers/usb/musb/omap2430.c use CONFIG_PM for these
registers and functions, do the same for the header.

Otherwise we get the following for most omap3 defconfigs:

drivers/usb/musb/omap2430.c:261: error: expected identifier or '(' before 'do'
drivers/usb/musb/omap2430.c:261: error: expected identifier or '(' before 
'while'
drivers/usb/musb/omap2430.c:268: error: expected identifier or '(' before 'do'
drivers/usb/musb/omap2430.c:268: error: expected identifier or '(' before 
'while'

Signed-off-by: Tony Lindgren t...@atomide.com


I sent a version for that yesterday. Sorry :-(

--
balbi
--
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/3] usb: Fix compile error for omaps for musb_hdrc

2010-03-12 Thread Felipe Balbi

On Fri, Mar 12, 2010 at 09:30:12AM +0100, Balbi Felipe (Nokia-D/Helsinki) wrote:

Signed-off-by: Tony Lindgren t...@atomide.com


I sent a version for that yesterday. Sorry :-(


turns out I used your version because I didn't know the OMAP3 config was 
changed.


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


[PATCHv2 2/3] AM3517: Board hookup for TCA6416 keypad driver.

2010-03-12 Thread Sriramakrishnan
Add board specific hookup for TCA6416 keypad driver.

Signed-off-by: Sriramakrishnan s...@ti.com
---
 arch/arm/mach-omap2/board-am3517evm.c |   47 +---
 1 files changed, 42 insertions(+), 5 deletions(-)
 mode change 100644 = 100755 arch/arm/mach-omap2/board-am3517evm.c

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
old mode 100644
new mode 100755
index 6ae8805..d50e505
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -20,7 +20,10 @@
 #include linux/init.h
 #include linux/platform_device.h
 #include linux/gpio.h
+#include linux/i2c.h
 #include linux/i2c/pca953x.h
+#include linux/input.h
+#include linux/tca6416_keypad.h
 
 #include mach/hardware.h
 #include mach/am35xx.h
@@ -88,16 +91,50 @@ static struct i2c_board_info __initdata 
am3517evm_tca6416_info_0[] = {
 };
 
 /* Mounted on UI Card */
-static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_1 = {
+/* IO expander at address 0x20 on UI card will be managed by Keypad driver */
+
+static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
.gpio_base  = OMAP_MAX_GPIO_LINES + 16,
 };
-static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
-   .gpio_base  = OMAP_MAX_GPIO_LINES + 32,
+
+/*Keypad Initialization */
+#define KEYPAD_PIN_MASK0xFFC0
+
+#define KEYPAD_BUTTON(ev_type, ev_code, act_low) \
+{  \
+   .type   = ev_type,  \
+   .code   = ev_code,  \
+   .active_low = act_low,  \
+}
+
+#define KEYPAD_BUTTON_LOW(event_code)  \
+   KEYPAD_BUTTON(EV_KEY, event_code, 1)
+
+static struct tca6416_button am3517_gpio_keys[] = {
+   KEYPAD_BUTTON_LOW(KEY_DOWN),
+   KEYPAD_BUTTON_LOW(KEY_UP),
+   KEYPAD_BUTTON_LOW(KEY_MENU),
+   KEYPAD_BUTTON_LOW(KEY_MODE),
+   KEYPAD_BUTTON_LOW(KEY_LEFTSHIFT),
+   KEYPAD_BUTTON_LOW(KEY_REWIND),
+   KEYPAD_BUTTON_LOW(KEY_FORWARD),
+   KEYPAD_BUTTON_LOW(KEY_STOP),
+   KEYPAD_BUTTON_LOW(KEY_PLAY),
+   KEYPAD_BUTTON_LOW(KEY_RECORD),
 };
+
+static struct tca6416_keys_platform_data am3517evm_tca6416_keys_info = {
+   .buttons= am3517_gpio_keys,
+   .nbuttons   = ARRAY_SIZE(am3517_gpio_keys),
+   .rep= 1,
+   .use_polling= 1,
+   .pinmask= KEYPAD_PIN_MASK,
+};
+
 static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
{
-   I2C_BOARD_INFO(tca6416, 0x20),
-   .platform_data = am3517evm_ui_gpio_expander_info_1,
+   I2C_BOARD_INFO(tca6416-keys, 0x20),
+   .platform_data = am3517evm_tca6416_keys_info,
},
{
I2C_BOARD_INFO(tca6416, 0x21),
-- 
1.6.2.4

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


[PATCHv2 3/3] AM3517 EVM : Enable TCA6416 keypad.

2010-03-12 Thread Sriramakrishnan
Update kernel configuration for AM3517EVM to include
support for TCA6416 keypad.

Signed-off-by: Sriramakrishnan s...@ti.com
---
 arch/arm/configs/am3517_evm_defconfig |   16 +++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/am3517_evm_defconfig 
b/arch/arm/configs/am3517_evm_defconfig
index 66a10b5..93d5fdf 100644
--- a/arch/arm/configs/am3517_evm_defconfig
+++ b/arch/arm/configs/am3517_evm_defconfig
@@ -527,6 +527,7 @@ CONFIG_SCSI_LOWLEVEL=y
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
 # CONFIG_INPUT_POLLDEV is not set
+# CONFIG_INPUT_SPARSEKMAP is not set
 
 #
 # Userland interfaces
@@ -539,7 +540,20 @@ CONFIG_INPUT_EVDEV=y
 #
 # Input Device Drivers
 #
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_KEYBOARD_TCA6416=y
+# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
-- 
1.6.2.4

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


[PATCHv2 1/3] TCA6416 keypad : Implement keypad driver for keys interfaced to TCA6416

2010-03-12 Thread Sriramakrishnan
This patch implements a simple Keypad driver that functions
as an I2C client. It handles key press events for keys
connected to TCA6416 I2C based IO expander.

Signed-off-by: Sriramakrishnan s...@ti.com
---
 drivers/input/keyboard/Kconfig  |   16 ++
 drivers/input/keyboard/Makefile |1 +
 drivers/input/keyboard/tca6416-keypad.c |  354 +++
 include/linux/tca6416_keypad.h  |   34 +++
 4 files changed, 405 insertions(+), 0 deletions(-)
 create mode 100755 drivers/input/keyboard/tca6416-keypad.c
 create mode 100755 include/linux/tca6416_keypad.h

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 64c1023..cf7fca9 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -192,6 +192,22 @@ config KEYBOARD_GPIO
  To compile this driver as a module, choose M here: the
  module will be called gpio_keys.
 
+config KEYBOARD_TCA6416
+   tristate TCA6416 Keypad Support
+   depends on I2C
+   help
+ This driver implements basic keypad functionality
+ for keys connected through TCA6416 IO expander
+
+ 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).
+
+ If enabled the complete TCA6416 device will be managed through
+ this driver.
+
+
 config KEYBOARD_MATRIX
tristate GPIO driven matrix keypad support
depends on GENERIC_GPIO
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 706c6b5..47e267c 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_KEYBOARD_CORGI)  += corgikbd.o
 obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
 obj-$(CONFIG_KEYBOARD_EP93XX)  += ep93xx_keypad.o
 obj-$(CONFIG_KEYBOARD_GPIO)+= gpio_keys.o
+obj-$(CONFIG_KEYBOARD_TCA6416) += tca6416-keypad.o
 obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
 obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
 obj-$(CONFIG_KEYBOARD_IMX) += imx_keypad.o
diff --git a/drivers/input/keyboard/tca6416-keypad.c 
b/drivers/input/keyboard/tca6416-keypad.c
new file mode 100755
index 000..17df832
--- /dev/null
+++ b/drivers/input/keyboard/tca6416-keypad.c
@@ -0,0 +1,354 @@
+/*
+ * Driver for keys on TCA6416 I2C IO expander
+ *
+ * Copyright (C) 2010 Texas Instruments
+ *
+ * Author : Sriramakrishnan.A.G. s...@ti.com
+ *
+ * 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 linux/module.h
+#include linux/init.h
+#include linux/gpio.h
+#include linux/i2c.h
+#include linux/input.h
+#include linux/tca6416_keypad.h
+#include linux/workqueue.h
+#include linux/types.h
+#include linux/interrupt.h
+#include linux/delay.h
+
+#define TCA6416_INPUT  0
+#define TCA6416_OUTPUT 1
+#define TCA6416_INVERT 2
+#define TCA6416_DIRECTION  3
+
+static const struct i2c_device_id tca6416_id[] = {
+   { tca6416-keys, 16, },
+   { }
+};
+MODULE_DEVICE_TABLE(i2c, tca6416_id);
+
+struct tca6416_drv_data {
+   struct input_dev *input;
+   struct tca6416_button data[0];
+};
+
+struct tca6416_keypad_chip {
+   uint16_t reg_output;
+   uint16_t reg_direction;
+   uint16_t reg_input;
+
+   struct i2c_client *client;
+   struct tca6416_drv_data  *drv_data;
+   struct delayed_work dwork;
+   uint16_t pinmask;
+   int irqnum;
+   int use_polling;
+};
+
+static int tca6416_write_reg(struct tca6416_keypad_chip *chip, int reg,
+   uint16_t val)
+{
+   int ret;
+
+   ret = i2c_smbus_write_word_data(chip-client, reg  1, val);
+
+   if (ret  0) {
+   dev_err(chip-client-dev, failed writing register\n);
+   return ret;
+   }
+
+   return 0;
+}
+
+static int tca6416_read_reg(struct tca6416_keypad_chip *chip, int reg,
+   uint16_t *val)
+{
+   int ret;
+
+   ret = i2c_smbus_read_word_data(chip-client, reg  1);
+
+   if (ret  0) {
+   dev_err(chip-client-dev, failed reading register\n);
+   return ret;
+   }
+
+   *val = (uint16_t)ret;
+   return 0;
+}
+
+static irqreturn_t tca6416_keys_isr(int irq, void *dev_id)
+{
+   struct tca6416_keypad_chip *chip =
+   (struct tca6416_keypad_chip *) dev_id;
+
+   disable_irq(irq);
+   schedule_delayed_work(chip-dwork, 0);
+   return IRQ_HANDLED;
+
+}
+
+static void tca6416_keys_work_func(struct work_struct *workstruct)
+{
+   struct delayed_work *delay_work =
+   container_of(workstruct, struct delayed_work, work);
+   struct tca6416_keypad_chip *chip 

[PATCHv2 0/3] Add support for TCA6416 based Keypad driver.

2010-03-12 Thread Sriramakrishnan
AM3517 EVM with APPS board includes keys interfaced to TCA6416 IO expander
User keys are connected as GPIO lines to TCA6416 IO expander. Unlike the
case with generic gpio-keypad driver individual keys do not generate an
interrupt event. Hence we implement a simple keypad driver, that
registers as direct I2C client.

The implementation has been tested on AM3517 EVM with the driver tested
in polling mode.

Version2 of the patch series addresses review comments from the earlier
posting - specifically redesigned to eliminate overhead of using gpio_keys
data structures.

Sriramakrishnan (3):
  TCA6416 keypad : Implement keypad driver for keys interfaced to
TCA6416
  AM3517: Board hookup for TCA6416 keypad driver.
  AM3517 EVM : Enable TCA6416 keypad.

 arch/arm/configs/am3517_evm_defconfig   |   16 ++-
 arch/arm/mach-omap2/board-am3517evm.c   |   47 -
 drivers/input/keyboard/Kconfig  |   16 ++
 drivers/input/keyboard/Makefile |1 +
 drivers/input/keyboard/tca6416-keypad.c |  354 +++
 include/linux/tca6416_keypad.h  |   34 +++
 6 files changed, 462 insertions(+), 6 deletions(-)
 mode change 100644 = 100755 arch/arm/mach-omap2/board-am3517evm.c
 create mode 100755 drivers/input/keyboard/tca6416-keypad.c
 create mode 100755 include/linux/tca6416_keypad.h

--
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 03/16] OMAP3: PM: Convert smartreflex driver into a platform driver using hwmods and omap-device layer

2010-03-12 Thread Gopinath, Thara


-Original Message-
From: Kevin Hilman [mailto:khil...@deeprootsystems.com]
Sent: Tuesday, March 02, 2010 11:58 PM
To: Gopinath, Thara
Cc: linux-omap@vger.kernel.org; p...@pwsan.com; Menon, Nishanth; Cousson, 
Benoit; Sripathy,
Vishwanath; Sawant, Anand
Subject: Re: [PATCH 03/16] OMAP3: PM: Convert smartreflex driver into a 
platform driver using hwmods
and omap-device layer

Thara Gopinath th...@ti.com writes:

 This patch converts the exisitng smartreflex library into a
 platform driver with device , driver registrations using hardware mods.
 As part of this Ntarget values are passed as platform data.

 Signed-off-by: Thara Gopinath th...@ti.com

Nice work Thara.  This is good.  Some minor comments below, but some
general comments first.

As discussed, eventually (longer term) we'll want to move the driver
parts of this to a regulator driver.  To ease that transition, I think
it would be nice to start now by separating the driver portions of
this file from the device portions.

You've already done a good job of keeping them separate in this file
(most of the device stuff is at the end) but I think having a separate
file is probably even better.  Maybe move driver stuff to sr_driver.c
and leave device stuff in smartreflex.c?  I don't care much about the
names at this point.
Hi Kevin,

Quick question.. If we are going to separate out smartreflex device portions 
from this file , can't we keep them in devices.c instead of going for a 
separate file?

Regards
Thara

--
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/19] omap: Fix gpio_resume_after_retention

2010-03-12 Thread Gadiyar, Anand
 I normally send my patches with this alias:
 
 alias gsend='git send-email --smtp-server /usr/bin/msmtp 
 --from Sergio Aguirre saagui...@ti.com 
 --envelope-sender=Sergio Aguirre saagui...@ti.com'
 
 and then just do:
 
 gsend --to='linux-omap@vger.kernel.org' 
 patches/forLO_20100311/0001-mypatch.patch
 
 But somehow the patch ends up (I'm guessing through TI LDAP 
 server) changing that to Aguirre, Sergio...
 
 and also Patchworks seems to continue display my old 
 fullname: Aguirre Rodriguez, Sergio Alberto... I guess it's 
 in a static data cache somewhere, maybe?
 
 Does anyone know how to overcome this kind of scenario, and 
 force what --from param says?

I send patches with an explicit From: Anand Gadiyar gadi...@ti.com
line in the content. This seems to work okay.

Can you check if this works for you?

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


Compiler warning in arch/arm/include/asm/elf.h

2010-03-12 Thread Andrew Clayton
Is this a real problem? linux-omap-2.6 tree as of 49f7ae9f16

  CC  kernel/elfcore.o
In file included from include/linux/elf.h:7,
 from kernel/elfcore.c:1:
/home/andrew/src/omap/linux-omap-2.6/arch/arm/include/asm/elf.h:101: warning: 
‘struct task_struct’ declared inside parameter list
/home/andrew/src/omap/linux-omap-2.6/arch/arm/include/asm/elf.h:101: warning: 
its scope is only this definition or declaration, which is probably not what 
you want


Cheers,
Andrew
--
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: kernel panic with latest DSS

2010-03-12 Thread Tomi Valkeinen
Can you try this patch?

I haven't run into this earlier as I always have DSI compiled in. It
possibly doesn't behave correctly in that case either, but doesn't
crash.

 Tomi


From c065bb82e1358105d57d80974ce71d3e5aeabf35 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen tomi.valkei...@nokia.com
Date: Fri, 12 Mar 2010 12:46:05 +0200
Subject: [PATCH] OMAP: DSS2: initialize dss clk sources properly

Clk sources were not initialized, leading to kernel crash, or possibly to
strange behaviour if DSI was compiled in.

Signed-off-by: Tomi Valkeinen tomi.valkei...@nokia.com
---
 drivers/video/omap2/dss/dss.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 8254a42..5434418 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -590,6 +590,9 @@ int dss_init(bool skip_init)
}
}
 
+   dss.dsi_clk_source = DSS_SRC_DSS1_ALWON_FCLK;
+   dss.dispc_clk_source = DSS_SRC_DSS1_ALWON_FCLK;
+
dss_save_context();
 
rev = dss_read_reg(DSS_REVISION);
-- 
1.6.5






On Wed, 2010-03-10 at 20:48 +0100, ext Steve Sakoman wrote:
 On Wed, Mar 10, 2010 at 10:58 AM,  tomi.valkei...@nokia.com wrote:
 
  I haven't had time to look at this, but I don't think your analysis is 
  correct.
 
 You are correct of course.  My sleepy eyes neglected to notice that
 double = and that makes a big difference :-)
 
  What first comes to my mind is that dss.dispc_clk_source is, for some 
  reason, uninitialized. Could you put prints to dss_select_dispc_clk_source 
  to see if it's called, and if so, what is assigned to dss.dispc_clk_source?
 
 I did a build with that change and it does seem that
 dss_select_dispc_clk_source is never called.
 
 Steve
 
   Tomi
 
  
  From: ext Steve Sakoman [sako...@gmail.com]
  Sent: Wednesday, March 10, 2010 20:42
  To: linux-omap@vger.kernel.org; Valkeinen Tomi (Nokia-D/Helsinki)
  Subject: Re: kernel panic with latest DSS
 
  On Wed, Mar 10, 2010 at 10:16 AM, Steve Sakoman sako...@gmail.com wrote:
 
  The issue occurs in the following section of code in
  drivers/video/omap2/dss/dispc.c:
 
  unsigned long dispc_fclk_rate(void)
  {
 unsigned long r = 0;
 
 if (dss_get_dispc_clk_source() == DSS_SRC_DSS1_ALWON_FCLK)
 r = dss_clk_get_rate(DSS_CLK_FCK1);
 else
  #ifdef CONFIG_OMAP2_DSS_DSI
 r = dsi_get_dsi1_pll_rate();
  #else
 BUG();
  #endif
 return r;
  }
 
  Since my machines don't have DSI displays CONFIG_OMAP2_DSS_DSI is not
  defined and the BUG() call is triggered.
 
  The issue seems to be the test for DSS_SRC_DSS1_ALWON_FCLK.
 
  Looking at  drivers/video/omap2/dss/dispc.c I see that
  DSS_SRC_DSS1_ALWON_FCLK will never be returned since clk_src is always
  set to 0 or 1 based on a test of DSS_SRC_DSS1_ALWON_FCLK :
 
  void dss_select_dispc_clk_source(enum dss_clk_source clk_src)
  {
 int b;
 
 BUG_ON(clk_src != DSS_SRC_DSI1_PLL_FCLK 
 clk_src != DSS_SRC_DSS1_ALWON_FCLK);
 
 b = clk_src == DSS_SRC_DSS1_ALWON_FCLK ? 0 : 1;
 
 REG_FLD_MOD(DSS_CONTROL, b, 0, 0);  /* DISPC_CLK_SWITCH */
 
 dss.dispc_clk_source = clk_src;
  }
 
  It seems to me that the test should return to the way it was in the
  previous DSS version, i.e. a test for 0:
 
  diff --git a/drivers/video/omap2/dss/dispc.c 
  b/drivers/video/omap2/dss/dispc.c
  index e777e35..be9b3de 100644
  --- a/drivers/video/omap2/dss/dispc.c
  +++ b/drivers/video/omap2/dss/dispc.c
  @@ -2218,7 +2218,7 @@ unsigned long dispc_fclk_rate(void)
   {
 unsigned long r = 0;
 
  -   if (dss_get_dispc_clk_source() == DSS_SRC_DSS1_ALWON_FCLK)
  +   if (dss_get_dispc_clk_source() == 0)
 r = dss_clk_get_rate(DSS_CLK_FCK1);
 else
   #ifdef CONFIG_OMAP2_DSS_DSI
 
  A test build confirms that this change restores my ability to play
  DVD's and display webcam streams.  My understanding of this code is
  superficial, so hopefully Tomi can comment on whether this is a good
  fix or not.
 
  Steve


--
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: [PATCHv2 0/3] Add support for TCA6416 based Keypad driver.

2010-03-12 Thread Grazvydas Ignotas
On Fri, Mar 12, 2010 at 11:18 AM, Sriramakrishnan s...@ti.com wrote:
 AM3517 EVM with APPS board includes keys interfaced to TCA6416 IO expander
 User keys are connected as GPIO lines to TCA6416 IO expander. Unlike the
 case with generic gpio-keypad driver individual keys do not generate an
 interrupt event. Hence we implement a simple keypad driver, that
 registers as direct I2C client.

 The implementation has been tested on AM3517 EVM with the driver tested
 in polling mode.

 Version2 of the patch series addresses review comments from the earlier
 posting - specifically redesigned to eliminate overhead of using gpio_keys
 data structures.

 Sriramakrishnan (3):
  TCA6416 keypad : Implement keypad driver for keys interfaced to
    TCA6416
  AM3517: Board hookup for TCA6416 keypad driver.
  AM3517 EVM : Enable TCA6416 keypad.

  arch/arm/configs/am3517_evm_defconfig   |   16 ++-
  arch/arm/mach-omap2/board-am3517evm.c   |   47 -
  drivers/input/keyboard/Kconfig          |   16 ++
  drivers/input/keyboard/Makefile         |    1 +
  drivers/input/keyboard/tca6416-keypad.c |  354 
 +++
  include/linux/tca6416_keypad.h          |   34 +++
  6 files changed, 462 insertions(+), 6 deletions(-)
  mode change 100644 = 100755 arch/arm/mach-omap2/board-am3517evm.c
  create mode 100755 drivers/input/keyboard/tca6416-keypad.c
  create mode 100755 include/linux/tca6416_keypad.h

Please fix mode - remove +x flags.
--
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] OMAP: PM: Fix Zoom3 defconfig build

2010-03-12 Thread Manjunatha GK
The zoom3 defconfig build is broken with pm branch.

This patch fixes the build by enabling CPU_FREQ options in defconfig.

Build and boot tested on Zoom3 board.

Build error log:
arch/arm/mach-omap2/clock3xxx_data.c: In function 'omap3xxx_clk_init':
arch/arm/mach-omap2/clock3xxx_data.c:3563: error: 'struct clk_functions' has no 
member named 'clk_init_cpufreq_table'
arch/arm/mach-omap2/clock3xxx_data.c:3564: error: 
'omap3_clk_init_cpufreq_table' undeclared (first use in this function)
arch/arm/mach-omap2/clock3xxx_data.c:3564: error: (Each undeclared identifier 
is reported only once
arch/arm/mach-omap2/clock3xxx_data.c:3564: error: for each function it appears 
in.)
make[1]: *** [arch/arm/mach-omap2/clock3xxx_data.o] Error 1


Signed-off-by: Manjunatha GK manj...@ti.com
---
 arch/arm/configs/omap_zoom3_defconfig |   20 ++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/arm/configs/omap_zoom3_defconfig 
b/arch/arm/configs/omap_zoom3_defconfig
index ff8ac3d..f615e3a 100644
--- a/arch/arm/configs/omap_zoom3_defconfig
+++ b/arch/arm/configs/omap_zoom3_defconfig
@@ -323,8 +323,24 @@ CONFIG_CMDLINE=root=/dev/nfs 
nfsroot=192.168.0.1:/home/user/buildroot ip=192.16
 #
 # CPU Power Management
 #
-# CONFIG_CPU_FREQ is not set
-# CONFIG_CPU_IDLE is not set
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+# CONFIG_CPU_FREQ_DEBUG is not set
+CONFIG_CPU_FREQ_STAT=y
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
 
 #
 # Floating point emulation
-- 
1.6.0.4

--
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: [PATCHv2 0/3] Add support for TCA6416 based Keypad driver.

2010-03-12 Thread Govindarajan, Sriramakrishnan


 -Original Message-
 From: Grazvydas Ignotas [mailto:nota...@gmail.com]
 Sent: Friday, March 12, 2010 4:54 PM
 To: Govindarajan, Sriramakrishnan
 Cc: linux-omap@vger.kernel.org; linux-in...@vger.kernel.org
 Subject: Re: [PATCHv2 0/3] Add support for TCA6416 based Keypad driver.
 
 On Fri, Mar 12, 2010 at 11:18 AM, Sriramakrishnan s...@ti.com wrote:
  AM3517 EVM with APPS board includes keys interfaced to TCA6416 IO
 expander
  User keys are connected as GPIO lines to TCA6416 IO expander. Unlike the
  case with generic gpio-keypad driver individual keys do not generate an
  interrupt event. Hence we implement a simple keypad driver, that
  registers as direct I2C client.
 
  The implementation has been tested on AM3517 EVM with the driver tested
  in polling mode.
 
  Version2 of the patch series addresses review comments from the earlier
  posting - specifically redesigned to eliminate overhead of using
 gpio_keys
  data structures.
 
  Sriramakrishnan (3):
   TCA6416 keypad : Implement keypad driver for keys interfaced to
     TCA6416
   AM3517: Board hookup for TCA6416 keypad driver.
   AM3517 EVM : Enable TCA6416 keypad.
 
   arch/arm/configs/am3517_evm_defconfig   |   16 ++-
   arch/arm/mach-omap2/board-am3517evm.c   |   47 -
   drivers/input/keyboard/Kconfig          |   16 ++
   drivers/input/keyboard/Makefile         |    1 +
   drivers/input/keyboard/tca6416-keypad.c |  354
 +++
   include/linux/tca6416_keypad.h          |   34 +++
   6 files changed, 462 insertions(+), 6 deletions(-)
   mode change 100644 = 100755 arch/arm/mach-omap2/board-am3517evm.c
   create mode 100755 drivers/input/keyboard/tca6416-keypad.c
   create mode 100755 include/linux/tca6416_keypad.h
 
 Please fix mode - remove +x flags.
[Sriram] Thanks for pointing out. I will await further review comments
And post the updated version thereafter
--
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/19] omap: Fix gpio_resume_after_retention

2010-03-12 Thread Felipe Balbi

On Fri, Mar 12, 2010 at 11:37:50AM +0100, ext Gadiyar, Anand wrote:

I send patches with an explicit From: Anand Gadiyar gadi...@ti.com
line in the content. This seems to work okay.

Can you check if this works for you?


$ git config --global sendemail.from Sergio Aguirre saagui...@ti.com
$ git send-email --to linux-omap@vger.kernel.org --from saagui...@ti.com 
0001-mypatch.patch

This will forge git to add the From: Sergio Aguirre saagui...@ti.com 
when sending the patches


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


[PATCHv7 1/7] OMAP3: PM: Added support functions for omap3 pwrdm handling

2010-03-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

Added omap3_pwrdm_set_next_pwrst and omap3_pwrdm_read_next_pwrst. These
functions add support for INACTIVE and ON states to the standard OMAP
powerdomain functions, and add caching logic for the next state. HW
directly supports the reading of INACTIVE / ON from the previous state
register, but programming INACTIVE / ON can't be done directly.

These functions are used in subsequent patches to simplify the logic of
the idle loop.

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/pm.h |2 +
 arch/arm/mach-omap2/pm34xx.c |   65 +-
 2 files changed, 66 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index b761be5..5f35911 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -67,6 +67,8 @@ static inline void omap3_pm_init_vc(struct prm_setup_vc 
*setup_vc)
 
 extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
 extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);
+extern int omap3_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst);
+extern int omap3_pwrdm_read_next_pwrst(struct powerdomain *pwrdm);
 
 extern u32 wakeup_timer_seconds;
 extern struct omap_dm_timer *gptimer_wakeup;
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index a30941a..da4e684 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -576,6 +576,68 @@ int omap3_can_sleep(void)
return 1;
 }
 
+struct powerdomain_data {
+   u8 next_state;
+};
+
+static struct powerdomain_data mpu_pwrdm_data;
+static struct powerdomain_data core_pwrdm_data;
+static struct powerdomain_data neon_pwrdm_data;
+
+static struct powerdomain_data *get_pwrdm_data(struct powerdomain *pwrdm)
+{
+   if (pwrdm == mpu_pwrdm)
+   return mpu_pwrdm_data;
+   else if (pwrdm == core_pwrdm)
+   return core_pwrdm_data;
+   else if (pwrdm == neon_pwrdm)
+   return neon_pwrdm_data;
+   return NULL;
+}
+
+static void omap3_pwrdm_init_pwrst_cache(struct powerdomain *pwrdm)
+{
+   struct powerdomain_data *data = get_pwrdm_data(pwrdm);
+   if (data)
+   data-next_state = pwrdm_read_next_pwrst(pwrdm);
+}
+
+int omap3_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
+{
+   struct powerdomain_data *data = get_pwrdm_data(pwrdm);
+   u8 prg_pwrst;
+
+   if (!data)
+   return pwrdm_set_next_pwrst(pwrdm, pwrst);
+
+   if (data-next_state == pwrst)
+   return 0;
+
+   if (pwrst == PWRDM_POWER_INACTIVE)
+   prg_pwrst = PWRDM_POWER_ON;
+   else
+   prg_pwrst = pwrst;
+
+   pwrdm_set_next_pwrst(pwrdm, prg_pwrst);
+
+   if (pwrst == PWRDM_POWER_ON)
+   omap2_clkdm_deny_idle(pwrdm-pwrdm_clkdms[0]);
+   else
+   omap2_clkdm_allow_idle(pwrdm-pwrdm_clkdms[0]);
+
+   data-next_state = pwrst;
+   return 0;
+}
+
+int omap3_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
+{
+   struct powerdomain_data *data = get_pwrdm_data(pwrdm);
+
+   if (!data)
+   return pwrdm_read_next_pwrst(pwrdm);
+   return data-next_state;
+}
+
 /* This sets pwrdm state (other than mpu  core. Currently only ON 
  * RET are supported. Function is assuming that clkdm doesn't have
  * hw_sup mode enabled. */
@@ -604,7 +666,7 @@ int set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
pwrdm_wait_transition(pwrdm);
}
 
-   ret = pwrdm_set_next_pwrst(pwrdm, state);
+   ret = omap3_pwrdm_set_next_pwrst(pwrdm, state);
if (ret) {
printk(KERN_ERR Unable to set state of powerdomain: %s\n,
   pwrdm-name);
@@ -1103,6 +1165,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, 
void *unused)
if (!pwrdm-pwrsts)
return 0;
 
+   omap3_pwrdm_init_pwrst_cache(pwrdm);
pwrst = kmalloc(sizeof(struct power_state), GFP_ATOMIC);
if (!pwrst)
return -ENOMEM;
-- 
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


[PATCHv7 6/7] OMAP3: PM: Moved pwrdm state control logic from omap_sram_idle to cpuidle

2010-03-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

This simplifies the design and allows cpuidle to keep better track of which
power states system will actually enter.

Following checks are made (and their reasoning):

- If CAM domain is active, prevent idle completely (moved from omap_sram_idle)
  * CAM pwrdm does not have HW wakeup capability
- If PER is likely to remain on, prevent PER off
  * Saves on unnecessary context save/restore
- If CORE domain is active, prevent PER off-mode (moved from omap_sram_idle)
  * PER off in this case would prevent wakeups from PER completely
- Only allow CORE off, if all peripheral domains are off
  * CORE off will cause a chipwide reset

Also, enabled CHECK_BM flag for C2, as this is needed for the camera case.

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/cpuidle34xx.c |  102 ++--
 arch/arm/mach-omap2/pm34xx.c  |   19 +--
 2 files changed, 98 insertions(+), 23 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c 
b/arch/arm/mach-omap2/cpuidle34xx.c
index 9445e1e..c3f2e03 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -60,7 +60,8 @@ struct omap3_processor_cx {
 
 struct omap3_processor_cx omap3_power_states[OMAP3_MAX_STATES];
 struct omap3_processor_cx current_cx_state;
-struct powerdomain *mpu_pd, *core_pd;
+static struct powerdomain *mpu_pd, *core_pd, *per_pd, *iva2_pd;
+static struct powerdomain *sgx_pd, *usb_pd, *cam_pd, *dss_pd;
 
 /*
  * The latencies/thresholds for various C states have
@@ -209,14 +210,96 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
   struct cpuidle_state *state)
 {
struct cpuidle_state *new_state = next_valid_state(dev, state);
+   u32 per_state = 0, saved_per_state = 0, cam_state, usb_state;
+   u32 iva2_state, sgx_state, dss_state, new_core_state;
+   struct omap3_processor_cx *cx;
+   int ret;
+
+   if (state-flags  CPUIDLE_FLAG_CHECK_BM) {
+   if (omap3_idle_bm_check()) {
+   BUG_ON(!dev-safe_state);
+   new_state = dev-safe_state;
+   goto select_state;
+   }
+   cx = cpuidle_get_statedata(state);
+   new_core_state = cx-core_state;
+
+   /* Check if CORE is active, if yes, fallback to inactive */
+   if (!pwrdm_can_idle(core_pd))
+   new_core_state = PWRDM_POWER_INACTIVE;
+
+   /*
+* Prevent idle completely if CAM is active.
+* CAM does not have wakeup capability in OMAP3.
+*/
+   cam_state = pwrdm_read_pwrst(cam_pd);
+   if (cam_state == PWRDM_POWER_ON) {
+   new_state = dev-safe_state;
+   goto select_state;
+   }
+
+   /*
+* Check if PER can idle or not. If we are not likely
+* to idle, deny PER off. This prevents unnecessary
+* context save/restore.
+*/
+   saved_per_state = omap3_pwrdm_read_next_pwrst(per_pd);
+   if (pwrdm_can_idle(per_pd)) {
+   per_state = saved_per_state;
+   /*
+* Prevent PER off if CORE is active as this
+* would disable PER wakeups completely
+*/
+   if (per_state == PWRDM_POWER_OFF 
+   new_core_state  PWRDM_POWER_RET)
+   per_state = PWRDM_POWER_RET;
+
+   } else if (saved_per_state == PWRDM_POWER_OFF)
+   per_state = PWRDM_POWER_RET;
+   else
+   per_state = saved_per_state;
+
+   /*
+* If we are attempting CORE off, check if any other
+* powerdomains are at retention or higher. CORE off causes
+* chipwide reset which would reset these domains also.
+*/
+   if (new_core_state == PWRDM_POWER_OFF) {
+   dss_state = pwrdm_read_pwrst(dss_pd);
+   iva2_state = pwrdm_read_pwrst(iva2_pd);
+   sgx_state = pwrdm_read_pwrst(sgx_pd);
+   usb_state = pwrdm_read_pwrst(usb_pd);
+
+   if (cam_state  PWRDM_POWER_OFF ||
+   dss_state  PWRDM_POWER_OFF ||
+   iva2_state  PWRDM_POWER_OFF ||
+   per_state  PWRDM_POWER_OFF ||
+   sgx_state  PWRDM_POWER_OFF ||
+   usb_state  PWRDM_POWER_OFF)
+   new_core_state = PWRDM_POWER_RET;
+   }
 
-   if ((state-flags  CPUIDLE_FLAG_CHECK_BM)  omap3_idle_bm_check()) {
-   BUG_ON(!dev-safe_state);
-   new_state = 

[PATCHv7 2/7] OMAP3: PM: Added support for INACTIVE and ON states in omap_sram_idle

2010-03-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

Previously omap_sram_idle() did not know about the difference between ON and
INACTIVE states, which complicated the state handling in these cases. Now,
the following changes are done in the idle logic:

- Check for IO-chain arming is changed to reflect desired state (RET)
- UART clocks will be disabled if we attempt to enter INACTIVE (this allows
  the state change to actually happen)

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/pm34xx.c |   23 ---
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index da4e684..f1f1932 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -383,9 +383,10 @@ void omap_sram_idle(void)
pwrdm_clear_all_prev_pwrst(core_pwrdm);
pwrdm_clear_all_prev_pwrst(per_pwrdm);
 
-   mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
+   mpu_next_state = omap3_pwrdm_read_next_pwrst(mpu_pwrdm);
switch (mpu_next_state) {
case PWRDM_POWER_ON:
+   case PWRDM_POWER_INACTIVE:
case PWRDM_POWER_RET:
/* No need to save context */
save_state = 0;
@@ -403,11 +404,11 @@ void omap_sram_idle(void)
 
/* NEON control */
if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON)
-   pwrdm_set_next_pwrst(neon_pwrdm, mpu_next_state);
+   omap3_pwrdm_set_next_pwrst(neon_pwrdm, mpu_next_state);
 
/* PER */
-   per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
-   core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
+   per_next_state = omap3_pwrdm_read_next_pwrst(per_pwrdm);
+   core_next_state = omap3_pwrdm_read_next_pwrst(core_pwrdm);
if (per_next_state  PWRDM_POWER_ON) {
omap2_gpio_prepare_for_idle(per_next_state);
if (per_next_state == PWRDM_POWER_OFF) {
@@ -452,9 +453,11 @@ void omap_sram_idle(void)
OMAP3430_GR_MOD,
OMAP3_PRM_VOLTCTRL_OFFSET);
}
-   /* Enable IO-PAD and IO-CHAIN wakeups */
-   prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
-   omap3_enable_io_chain();
+   if (core_next_state = PWRDM_POWER_RET) {
+   /* Enable IO-PAD and IO-CHAIN wakeups */
+   prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
+   omap3_enable_io_chain();
+   }
}
omap3_intc_prepare_idle();
 
@@ -556,15 +559,13 @@ void omap_sram_idle(void)
}
 
/* Disable IO-PAD and IO-CHAIN wakeup */
-   if (core_next_state  PWRDM_POWER_ON) {
+   if (core_next_state = PWRDM_POWER_RET) {
prm_clear_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
omap3_disable_io_chain();
}
 
 
pwrdm_post_transition();
-
-   omap2_clkdm_allow_idle(mpu_pwrdm-pwrdm_clkdms[0]);
 }
 
 int omap3_can_sleep(void)
@@ -734,7 +735,7 @@ static int omap3_pm_suspend(void)
 
/* Read current next_pwrsts */
list_for_each_entry(pwrst, pwrst_list, node)
-   pwrst-saved_state = pwrdm_read_next_pwrst(pwrst-pwrdm);
+   pwrst-saved_state = omap3_pwrdm_read_next_pwrst(pwrst-pwrdm);
/* Set ones wanted by suspend */
list_for_each_entry(pwrst, pwrst_list, node) {
if (set_pwrdm_state(pwrst-pwrdm, pwrst-next_state))
-- 
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


[PATCHv7 3/7] OMAP3: CPUidle: Fixed support for ON / INACTIVE states

2010-03-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

New powerdomain support code for INACTIVE state removes the need to control
clockdomains directly from cpuidle. Also, cpuidle state definitions can now
directly support ON / INACTIVE simplifying the implementation.

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/cpuidle34xx.c |   36 ++--
 1 files changed, 6 insertions(+), 30 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c 
b/arch/arm/mach-omap2/cpuidle34xx.c
index 3d3d035..9445e1e 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -93,20 +93,6 @@ static int omap3_idle_bm_check(void)
return 0;
 }
 
-static int _cpuidle_allow_idle(struct powerdomain *pwrdm,
-   struct clockdomain *clkdm)
-{
-   omap2_clkdm_allow_idle(clkdm);
-   return 0;
-}
-
-static int _cpuidle_deny_idle(struct powerdomain *pwrdm,
-   struct clockdomain *clkdm)
-{
-   omap2_clkdm_deny_idle(clkdm);
-   return 0;
-}
-
 /**
  * omap3_enter_idle - Programs OMAP3 to enter the specified state
  * @dev: cpuidle device
@@ -130,25 +116,15 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
local_irq_disable();
local_fiq_disable();
 
-   pwrdm_set_next_pwrst(mpu_pd, mpu_state);
-   pwrdm_set_next_pwrst(core_pd, core_state);
+   omap3_pwrdm_set_next_pwrst(mpu_pd, mpu_state);
+   omap3_pwrdm_set_next_pwrst(core_pd, core_state);
 
if (omap_irq_pending() || need_resched())
goto return_sleep_time;
 
-   if (cx-type == OMAP3_STATE_C1) {
-   pwrdm_for_each_clkdm(mpu_pd, _cpuidle_deny_idle);
-   pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle);
-   }
-
/* Execute ARM wfi */
omap_sram_idle();
 
-   if (cx-type == OMAP3_STATE_C1) {
-   pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle);
-   pwrdm_for_each_clkdm(core_pd, _cpuidle_allow_idle);
-   }
-
 return_sleep_time:
getnstimeofday(ts_postidle);
ts_idle = timespec_sub(ts_postidle, ts_preidle);
@@ -326,8 +302,8 @@ void omap_init_power_states(void)
cpuidle_params_table[OMAP3_STATE_C2].wake_latency;
omap3_power_states[OMAP3_STATE_C2].threshold =
cpuidle_params_table[OMAP3_STATE_C2].threshold;
-   omap3_power_states[OMAP3_STATE_C2].mpu_state = PWRDM_POWER_ON;
-   omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_ON;
+   omap3_power_states[OMAP3_STATE_C2].mpu_state = PWRDM_POWER_INACTIVE;
+   omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_INACTIVE;
omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID;
 
/* C3 . MPU CSWR + Core inactive */
@@ -341,7 +317,7 @@ void omap_init_power_states(void)
omap3_power_states[OMAP3_STATE_C3].threshold =
cpuidle_params_table[OMAP3_STATE_C3].threshold;
omap3_power_states[OMAP3_STATE_C3].mpu_state = PWRDM_POWER_RET;
-   omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_ON;
+   omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_INACTIVE;
omap3_power_states[OMAP3_STATE_C3].flags = CPUIDLE_FLAG_TIME_VALID |
CPUIDLE_FLAG_CHECK_BM;
 
@@ -356,7 +332,7 @@ void omap_init_power_states(void)
omap3_power_states[OMAP3_STATE_C4].threshold =
cpuidle_params_table[OMAP3_STATE_C4].threshold;
omap3_power_states[OMAP3_STATE_C4].mpu_state = PWRDM_POWER_OFF;
-   omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_ON;
+   omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_INACTIVE;
omap3_power_states[OMAP3_STATE_C4].flags = CPUIDLE_FLAG_TIME_VALID |
CPUIDLE_FLAG_CHECK_BM;
 
-- 
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


[PATCHv7 5/7] OMAP: Powerdomains: Add support for checking if pwrdm/clkdm can idle

2010-03-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

pwrdm_can_idle(pwrdm) will check if the specified powerdomain can enter
idle. This is done by checking all clockdomains under the powerdomain
if they can idle also.

omap2_clkdm_can_idle(clkdm) will check if the specified clockdomain can
enter idle. This checks the functional clocks and idle status bits of the
domain according to following rules:
1) functional clock check
  * get FCLK register content
  * ignore all clocks defined in idle_def.fclk_ignore
  * if any active functional clocks remain, domain can't idle
2) idle status check
  * get IDLEST register content
  * inverse it (any non-idle blocks are now as 1)
  * mask against idle_def.idlest_mask
  * if any bits remain high, domain can't idle

These calls can be used e.g. inside cpuidle to decide which power states
core and mpu should enter during idle, as there are certain dependencies
between wakeup capabilities and reset logic.

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/clockdomain.c |   32 
 arch/arm/mach-omap2/clockdomains.h|  106 +
 arch/arm/mach-omap2/powerdomain.c |   20 +
 arch/arm/plat-omap/include/plat/clockdomain.h |   17 
 arch/arm/plat-omap/include/plat/powerdomain.h |1 +
 5 files changed, 176 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clockdomain.c 
b/arch/arm/mach-omap2/clockdomain.c
index a38a615..9ebff51 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -867,6 +867,38 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
return 0;
 }
 
+
+/**
+ * omap2_clkdm_can_idle - check if clockdomain has any active clocks or not
+ * @clkdm: struct clockdomain *
+ *
+ * Checks if the clockdomain has any active clock or not, i.e. whether it
+ * can enter idle. Returns -EINVAL if clkdm is NULL; 0 if unable to idle;
+ * 1 if can idle.
+ */
+int omap2_clkdm_can_idle(struct clockdomain *clkdm)
+{
+   int i;
+
+   if (!clkdm)
+   return -EINVAL;
+
+   for (i = 0; i  clkdm-clk_reg_num; i++) {
+   u32 idlest, fclk;
+
+   fclk = cm_read_mod_reg(clkdm-pwrdm.ptr-prcm_offs,
+   CM_FCLKEN + 4 * i);
+   if (fclk  ~clkdm-idle_def[i].fclk_ignore)
+   return 0;
+
+   idlest = cm_read_mod_reg(clkdm-pwrdm.ptr-prcm_offs,
+   CM_IDLEST + 4 * i);
+   if (~idlest  clkdm-idle_def[i].idlest_mask)
+   return 0;
+   }
+   return 1;
+}
+
 /**
  * omap2_clkdm_allow_idle - enable hwsup idle transitions for clkdm
  * @clkdm: struct clockdomain *
diff --git a/arch/arm/mach-omap2/clockdomains.h 
b/arch/arm/mach-omap2/clockdomains.h
index 8fc19ff..5e29de8 100644
--- a/arch/arm/mach-omap2/clockdomains.h
+++ b/arch/arm/mach-omap2/clockdomains.h
@@ -663,6 +663,12 @@ static struct clockdomain iva2_clkdm = {
.wkdep_srcs = iva2_wkdeps,
.clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+   .clk_reg_num= 1,
+   .idle_def   = {
+   [0] = {
+   .idlest_mask = OMAP3430_ST_IVA2,
+   },
+   },
 };
 
 static struct clockdomain gfx_3430es1_clkdm = {
@@ -686,6 +692,12 @@ static struct clockdomain sgx_clkdm = {
.sleepdep_srcs  = gfx_sgx_sleepdeps,
.clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK,
.omap_chip  = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
+   .clk_reg_num= 1,
+   .idle_def   = {
+   [0] = {
+   .idlest_mask = OMAP3430ES2_ST_SGX_SHIFT,
+   },
+   },
 };
 
 /*
@@ -717,6 +729,57 @@ static struct clockdomain core_l3_3xxx_clkdm = {
.dep_bit= OMAP3430_EN_CORE_SHIFT,
.clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK,
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+   .clk_reg_num= 3,
+   .idle_def   = {
+   [0] = {
+   /* UARTs are controlled by idle loop so ignore */
+   .fclk_ignore = OMAP3430_EN_UART2 |
+   OMAP3430_EN_UART1,
+   /*
+* Reason for IDLEST ignores:
+* - SDRC and OMAPCTRL controlled by HW
+* - HSOTGUSB_IDLE bit is autoidled by HW
+* - MAILBOX is controlled by HW
+*/
+   .idlest_mask =
+   OMAP3430ES2_ST_MMC3_MASK |
+   OMAP3430_ST_ICR_MASK |
+   OMAP3430_ST_AES2_MASK |
+   OMAP3430_ST_SHA12_MASK |
+   OMAP3430_ST_DES2_MASK |
+   OMAP3430_ST_MMC2_MASK |
+   

[PATCHv7 4/7] OMAP3: Clock: Added IDLEST definitions for SGX

2010-03-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

Added definitions for OMAP3430ES2_ST_SGX_SHIFT and OMAP3430ES2_ST_SGX_MASK
as these were missing.

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/cm-regbits-34xx.h |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h 
b/arch/arm/mach-omap2/cm-regbits-34xx.h
index 6923deb..60f9b16 100644
--- a/arch/arm/mach-omap2/cm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-34xx.h
@@ -379,6 +379,10 @@
 #define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT 1
 #define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_MASK  (1  1)
 
+/* CM_IDLEST_SGX */
+#define OMAP3430ES2_ST_SGX_SHIFT   1
+#define OMAP3430ES2_ST_SGX_MASK(1  1)
+
 /* CM_ICLKEN_SGX */
 #define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_SHIFT 0
 #define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_MASK  (1  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


[PATCHv7] OMAP3: Serial: Improved sleep logic

2010-03-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

This patch contains following improvements:
- Only RX interrupt will now kick the sleep prevent timer
- TX fifo status is checked before disabling clocks, this will prevent
  on-going transmission to be cut
- Smartidle is now enabled/disabled only while switching clocks, as having
  smartidle enabled while RX/TX prevents any wakeups from being received
  from UART module
- Added workqueue for wakeup checks, as jiffy timer access within the
  idle loop results into skewed timers as jiffy timers are stopped
- Added garbage_timer for ignoring the first character received during
  the first tick after clock enable, this prevents garbage characters to be
  received in low sleep states
- omap_uart_enable_irqs() changed to use enable_irq / disable_irq instead
  of request / free. Using request/free changes the behavior after first
  suspend due to reversed interrupt handler ordering

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/serial.c |   70 --
 1 files changed, 60 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 5f3035e..d9785d2 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -23,6 +23,7 @@
 #include linux/serial_reg.h
 #include linux/clk.h
 #include linux/io.h
+#include linux/workqueue.h
 
 #include plat/common.h
 #include plat/board.h
@@ -48,7 +49,10 @@ struct omap_uart_state {
int num;
int can_sleep;
struct timer_list timer;
+   struct timer_list garbage_timer;
+   struct work_struct wakeup_work;
u32 timeout;
+   u8 garbage_ignore;
 
void __iomem *wk_st;
void __iomem *wk_en;
@@ -243,6 +247,11 @@ static inline void omap_uart_save_context(struct 
omap_uart_state *uart) {}
 static inline void omap_uart_restore_context(struct omap_uart_state *uart) {}
 #endif /* CONFIG_PM  CONFIG_ARCH_OMAP3 */
 
+#ifdef CONFIG_PM
+static void omap_uart_smart_idle_enable(struct omap_uart_state *uart,
+   int enable);
+#endif
+
 static inline void omap_uart_enable_clocks(struct omap_uart_state *uart)
 {
if (uart-clocked)
@@ -252,6 +261,9 @@ static inline void omap_uart_enable_clocks(struct 
omap_uart_state *uart)
clk_enable(uart-fck);
uart-clocked = 1;
omap_uart_restore_context(uart);
+#ifdef CONFIG_PM
+   omap_uart_smart_idle_enable(uart, 0);
+#endif
 }
 
 #ifdef CONFIG_PM
@@ -263,8 +275,13 @@ static inline void omap_uart_disable_clocks(struct 
omap_uart_state *uart)
 
omap_uart_save_context(uart);
uart-clocked = 0;
+   omap_uart_smart_idle_enable(uart, 1);
clk_disable(uart-ick);
clk_disable(uart-fck);
+   if (uart-garbage_ignore) {
+   del_timer(uart-garbage_timer);
+   uart-garbage_ignore = 0;
+   }
 }
 
 static void omap_uart_enable_wakeup(struct omap_uart_state *uart)
@@ -320,7 +337,6 @@ static void omap_uart_block_sleep(struct omap_uart_state 
*uart)
 {
omap_uart_enable_clocks(uart);
 
-   omap_uart_smart_idle_enable(uart, 0);
uart-can_sleep = 0;
if (uart-timeout)
mod_timer(uart-timer, jiffies + uart-timeout);
@@ -338,7 +354,6 @@ static void omap_uart_allow_sleep(struct omap_uart_state 
*uart)
if (!uart-clocked)
return;
 
-   omap_uart_smart_idle_enable(uart, 1);
uart-can_sleep = 1;
del_timer(uart-timer);
 }
@@ -350,18 +365,45 @@ static void omap_uart_idle_timer(unsigned long data)
omap_uart_allow_sleep(uart);
 }
 
+static void omap_uart_garbage_timer(unsigned long data)
+{
+   struct omap_uart_state *uart = (struct omap_uart_state *)data;
+
+   uart-garbage_ignore = 0;
+}
+
+static void omap_uart_wakeup_work(struct work_struct *work)
+{
+   struct omap_uart_state *uart =
+   container_of(work, struct omap_uart_state, wakeup_work);
+
+   omap_uart_block_sleep(uart);
+
+   /* Set up garbage timer to ignore RX during first jiffy */
+   if (uart-timeout)
+   mod_timer(uart-garbage_timer, jiffies + 1);
+}
+
 void omap_uart_prepare_idle(int num)
 {
struct omap_uart_state *uart;
 
list_for_each_entry(uart, uart_list, node) {
if (num == uart-num  uart-can_sleep) {
-   omap_uart_disable_clocks(uart);
+   if (serial_read_reg(uart-p, UART_LSR) 
+   UART_LSR_TEMT)
+   omap_uart_disable_clocks(uart);
return;
}
}
 }
 
+static void serial_wakeup(struct omap_uart_state *uart)
+{
+   uart-garbage_ignore = 1;
+   schedule_work(uart-wakeup_work);
+}
+
 void omap_uart_resume_idle(int num)
 {
struct omap_uart_state *uart;
@@ -375,12 +417,12 @@ void omap_uart_resume_idle(int num)
u16 p = 

Re: [PATCH 1/2] musb: add musb support for AM35x

2010-03-12 Thread Sergei Shtylyov

Hello.

Ajay Kumar Gupta wrote:


AM35x has musb interface and uses CPPI4.1 DMA engine.
Current patch supports only PIO mode and there are on-going
discussions on location of CPPI4.1 DMA.

Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com
---
 drivers/usb/musb/Kconfig |4 +-
 drivers/usb/musb/Makefile|4 +
 drivers/usb/musb/am3517.c|  536 ++
 drivers/usb/musb/musb_core.c |3 +-
 4 files changed, 544 insertions(+), 3 deletions(-)
 create mode 100644 drivers/usb/musb/am3517.c

diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index b4c783c..a29cf84 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -10,7 +10,7 @@ comment Enable Host or Gadget support to see Inventra 
options
 config USB_MUSB_HDRC
depends on (USB || USB_GADGET)
depends on (ARM || (BF54x  !BF544) || (BF52x  !BF522  !BF523))
-   select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN)
+   select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN || 
MACH_OMAP3517EVM)
select TWL4030_USB if MACH_OMAP_3430SDP
select USB_OTG_UTILS
tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
@@ -140,7 +140,7 @@ config USB_MUSB_HDRC_HCD
 config MUSB_PIO_ONLY
bool 'Disable DMA (always use PIO)'
depends on USB_MUSB_HDRC
-   default y if USB_TUSB6010
+   default USB_TUSB6010 || MACH_OMAP3517EVM
help
  All data is copied between memory and FIFO by the CPU.
  DMA controllers are ignored.
diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
index 85710cc..9263033 100644
--- a/drivers/usb/musb/Makefile
+++ b/drivers/usb/musb/Makefile
@@ -19,7 +19,11 @@ ifeq ($(CONFIG_ARCH_OMAP2430),y)
 endif
 
 ifeq ($(CONFIG_ARCH_OMAP3430),y)

+   ifeq ($(CONFIG_MACH_OMAP3517EVM),y)
+   musb_hdrc-objs  += am3517.o
  


  Isn't there some ARCH-level option for AM3517 SoC? Depending on the 
board type doesn't really scale well...



+   else
musb_hdrc-objs  += omap2430.o
+   endif
 endif
 
 ifeq ($(CONFIG_BF54x),y)

diff --git a/drivers/usb/musb/am3517.c b/drivers/usb/musb/am3517.c
new file mode 100644
index 000..913a294
--- /dev/null
+++ b/drivers/usb/musb/am3517.c
@@ -0,0 +1,536 @@
  

[...]

+/*
+ * AM3517 specific definitions
+ */
+
+/* CPPI 4.1 queue manager registers */
+#define QMGR_PEND0_REG 0x4090
+#define QMGR_PEND1_REG 0x4094
+#define QMGR_PEND2_REG 0x4098
  


  Those are not used (yet)...


+static inline void phy_on(void)
+{
+   u32 devconf2;
+
+   /*
+* Start the on-chip PHY and its PLL.
+*/
+   devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
+
+   devconf2 = ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN |
+   CONF2_OTGMODE | CONF2_REFFREQ | CONF2_PHY_GPIOMODE);
  


  Shouldn't you manipulate CONF2_OTGMODE in the board code instead? I 
suspect value of 0 doesn't fit the host-only configuration (without 
cable connected, MUSB will think it's a B-device, and the driver will 
fail to initialize IIRC).



+   devconf2 |= CONF2_SESENDEN | CONF2_VBDTCTEN | CONF2_PHY_PLLON |
+   CONF2_REFFREQ_13MHZ | CONF2_DATPOL;
  


  Reference clock of 13 MHz, not 12? Hmm... Again, shouldn't the board 
code select the reference frequency (clock might be external, IIUC)?



+static inline void phy_off(void)
+{
+   u32 devconf2;
+
+   /*
+* Power down the on-chip PHY.
+*/
+   devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
+
+   devconf2 = ~CONF2_PHY_PLLON;
+   devconf2 |=  CONF2_PHYPWRDN | CONF2_OTGPWRDN;
+   omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
+}
+
+/**
+ * musb_platform_enable - enable interrupts
+ */
+void musb_platform_enable(struct musb *musb)
+{
+   void __iomem *reg_base = musb-ctrl_base;
+   u32 epmask, coremask;
+
+   /* Workaround: setup IRQs through both register sets. */
+   epmask = ((musb-epmask  AM3517_TX_EP_MASK)  USB_INTR_TX_SHIFT) |
+  ((musb-epmask  AM3517_RX_EP_MASK)  USB_INTR_RX_SHIFT);
+   coremask = (0x01ff  USB_INTR_USB_SHIFT);
+
+   musb_writel(reg_base, EP_INTR_MASK_SET_REG, epmask);
+   musb_writel(reg_base, CORE_INTR_MASK_SET_REG, coremask);
  


  Hm, and I thought all CPPI 4.1 based controllers have the same 
register layout... alas, I was wrong.



+static int vbus_state = -1;
  

[...]

+static void am3517_source_power(struct musb *musb, int is_on, int immediate)
+{
+   if (is_on)
+   is_on = 1;
+
+   if (vbus_state == is_on)
+   return;
+   vbus_state = is_on;
+}
+
  


  Without the real GPIOs to manipulate, I don't understand the purpose 
of this function...



+static struct timer_list otg_workaround;
+
+static void otg_timer(unsigned long _musb)
+{
+   struct musb *musb = (void *)_musb;
+   void __iomem*mregs = musb-mregs;
+   

Re: [PATCH 1/2] musb: add musb support for AM35x

2010-03-12 Thread Sergei Shtylyov

Ajay Kumar Gupta wrote:


AM35x has musb interface and uses CPPI4.1 DMA engine.
Current patch supports only PIO mode and there are on-going
discussions on location of CPPI4.1 DMA.

Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com


  Overlooked one thing...

[...]


+int musb_platform_exit(struct musb *musb)
+{
  

[...]

+   phy_off();
+
+   usb_nop_xceiv_unregister();
+
+   return 0;
  


  You forgot the calls to clk_disable() for both your clocks...


+}
+
  

WBR, Sergei

--
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] omap3: pm: Update TRITON power scripts and making it generic.

2010-03-12 Thread Lesly A M
This series of patch implements a updated TRITON power scripts.
Also moving the sleep, wakeup  warm_reset sequence to a generic script file,
which can be used by different OMAP3 board with the power companion chip 
TWL4030.

This patch series is based off Kevin's tree origin/pm branch.

This changes are tested on OMAP3430 SDP board with:
enable_off_mode
voltage_off_while_idle
sleep_while_idle (VDD1/VDD2 voltage scaling to 0v)
enabled in cpuidle and suspned path.

Also tested for reboot and dvfs.

Lesly A M (5):
  omap3: pm: fix for twl4030 script load
  omap3: pm: Using separate clk/volt setup_time for RET and OFF states
  omap3: pm: Generic TRITON power scripts for OMAP3 based boards
  omap3: pm: Use generic TRITON power scripts for 3430SDP board
  omap3: pm: Use generic TRITON power scripts for ZOOM[2,3], 3630SDP
board

 arch/arm/mach-omap2/Makefile  |   12 ++-
 arch/arm/mach-omap2/board-3430sdp.c   |  139 
 arch/arm/mach-omap2/board-3630sdp.c   |   25 -
 arch/arm/mach-omap2/board-zoom-peripherals.c  |   44 -
 arch/arm/mach-omap2/board-zoom2.c |   25 -
 arch/arm/mach-omap2/board-zoom3.c |   25 -
 arch/arm/mach-omap2/include/mach/board-zoom.h |2 +-
 arch/arm/mach-omap2/pm.h  |   21 +++--
 arch/arm/mach-omap2/pm34xx.c  |   14 ++-
 arch/arm/mach-omap2/twl4030-script.c  |  143 +
 arch/arm/mach-omap2/twl4030-script.h  |   15 +++
 arch/arm/mach-omap2/voltage.c |   94 -
 arch/arm/mach-omap2/voltage.h |1 +
 drivers/mfd/twl4030-power.c   |6 -
 include/linux/i2c/twl.h   |4 +
 15 files changed, 424 insertions(+), 146 deletions(-)
 create mode 100644 arch/arm/mach-omap2/twl4030-script.c
 create mode 100644 arch/arm/mach-omap2/twl4030-script.h

Signed-off-by: Lesly A M x0080...@ti.com
Cc: Nishanth Menon n...@ti.com
Cc: David Derrick dderr...@ti.com
Cc: Samuel Ortiz sa...@linux.intel.com
--
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 1/5] omap3: pm: fix for twl4030 script load

2010-03-12 Thread Lesly A M
Keeping the twl4030_config_sleep_sequence() call under the flag checking will 
fix
the over writting of other sequences with the sleep sequences when loading the 
scripts.

Removed the warning print with checking order of scripts, since the order
is not important. Only the values configured in the register, which is pointing 
to
the starting address of each sequence should be correct.

Signed-off-by: Lesly A M x0080...@ti.com
Cc: Nishanth Menon n...@ti.com
Cc: David Derrick dderr...@ti.com
Cc: Samuel Ortiz sa...@linux.intel.com
---
 drivers/mfd/twl4030-power.c |6 --
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index 7efa878..bd98733 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -423,7 +423,6 @@ static int __init load_twl4030_script(struct twl4030_script 
*tscript,
   u8 address)
 {
int err;
-   static int order;
 
/* Make sure the script isn't going beyond last valid address (0x3f) */
if ((address + tscript-size)  END_OF_SCRIPT) {
@@ -444,7 +443,6 @@ static int __init load_twl4030_script(struct twl4030_script 
*tscript,
err = twl4030_config_wakeup12_sequence(address);
if (err)
goto out;
-   order = 1;
}
if (tscript-flags  TWL4030_WAKEUP3_SCRIPT) {
err = twl4030_config_wakeup3_sequence(address);
@@ -452,10 +450,6 @@ static int __init load_twl4030_script(struct 
twl4030_script *tscript,
goto out;
}
if (tscript-flags  TWL4030_SLEEP_SCRIPT)
-   if (order)
-   pr_warning(TWL4030: Bad order of scripts (sleep \
-   script before wakeup) Leads to boot\
-   failure on some boards\n);
err = twl4030_config_sleep_sequence(address);
 out:
return err;
-- 
1.6.0.4

--
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] omap3: pm: Using separate clk/volt setup_time for RET and OFF states

2010-03-12 Thread Lesly A M
Copied the setuptime in each board file, since OMAP3430  OMAP3630
has different voltage levels for the same states.
Changed vdd0_/vdd1_ to vdd1_/vdd2_ in prcm vc setuptime structure.

Made the changes to program the setup time according to
the target state of CORE power domain.
The voltsetup2 is used only when the device exits sys_off mode
(with PRM_VOLTCTRL[3]SEL_OFF set to 1).

Signed-off-by: Lesly A M x0080...@ti.com
Cc: Nishanth Menon n...@ti.com
Cc: David Derrick dderr...@ti.com
Cc: Samuel Ortiz sa...@linux.intel.com
---
 arch/arm/mach-omap2/board-3430sdp.c   |   27 ---
 arch/arm/mach-omap2/board-3630sdp.c   |   25 ++-
 arch/arm/mach-omap2/board-zoom-peripherals.c  |8 ++-
 arch/arm/mach-omap2/board-zoom2.c |   25 ++-
 arch/arm/mach-omap2/board-zoom3.c |   25 ++-
 arch/arm/mach-omap2/include/mach/board-zoom.h |2 +-
 arch/arm/mach-omap2/pm.h  |   21 --
 arch/arm/mach-omap2/pm34xx.c  |   14 +++-
 arch/arm/mach-omap2/voltage.c |   94 ++---
 arch/arm/mach-omap2/voltage.h |1 +
 10 files changed, 189 insertions(+), 53 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 6ee9f20..23403f0 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -77,21 +77,26 @@ static struct cpuidle_params omap3_cpuidle_params_table[] = 
{
{1, 1, 3, 30},
 };
 
-/* FIXME: These are not the optimal setup values to be used on 3430sdp*/
 static struct prm_setup_vc omap3_setuptime_table = {
-   .clksetup = 0xff,
-   .voltsetup_time1 = 0xfff,
-   .voltsetup_time2 = 0xfff,
-   .voltoffset = 0xff,
-   .voltsetup2 = 0xff,
-   .vdd0_on = 0x30,
-   .vdd0_onlp = 0x20,
-   .vdd0_ret = 0x1e,
-   .vdd0_off = 0x00,
-   .vdd1_on = 0x2c,
+   /* CLK SETUPTIME for RET  OFF */
+   .clksetup_ret = 0x1,
+   .clksetup_off = 0x14A,
+   /* VOLT SETUPTIME for RET  OFF */
+   .voltsetup_time1_ret = 0x005B,
+   .voltsetup_time2_ret = 0x0055,
+   .voltsetup_time1_off = 0x00B3,
+   .voltsetup_time2_off = 0x00A0,
+   .voltoffset = 0x118,
+   .voltsetup2 = 0x32,
+   /* VC COMMAND VALUES for VDD1/VDD2 */
+   .vdd1_on = 0x30,
.vdd1_onlp = 0x20,
.vdd1_ret = 0x1e,
.vdd1_off = 0x00,
+   .vdd2_on = 0x2c,
+   .vdd2_onlp = 0x20,
+   .vdd2_ret = 0x1e,
+   .vdd2_off = 0x00,
 };
 
 static int board_keymap[] = {
diff --git a/arch/arm/mach-omap2/board-3630sdp.c 
b/arch/arm/mach-omap2/board-3630sdp.c
index 3937a47..2f41c51 100755
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -25,6 +25,29 @@
 
 #include mux.h
 #include sdram-hynix-h8mbx00u0mer-0em.h
+#include pm.h
+
+static struct prm_setup_vc omap3_setuptime_table = {
+   /* CLK SETUPTIME for RET  OFF */
+   .clksetup_ret = 0x1,
+   .clksetup_off = 0x14A,
+   /* VOLT SETUPTIME for RET  OFF */
+   .voltsetup_time1_ret = 0x005B,
+   .voltsetup_time2_ret = 0x0055,
+   .voltsetup_time1_off = 0x00B3,
+   .voltsetup_time2_off = 0x00A0,
+   .voltoffset = 0x118,
+   .voltsetup2 = 0x32,
+   /* VC COMMAND VALUES for VDD1/VDD2 */
+   .vdd1_on = 0x28,/* 1.1v */
+   .vdd1_onlp = 0x20,  /* 1.0v */
+   .vdd1_ret = 0x13,   /* 0.83v */
+   .vdd1_off = 0x00,   /* 0.6v */
+   .vdd2_on = 0x2B,/* 1.1375v */
+   .vdd2_onlp = 0x20,  /* 1.0v */
+   .vdd2_ret = 0x14,   /* 0.85v */
+   .vdd2_off = 0x00,   /* 0.6v */
+};
 
 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
 
@@ -97,7 +120,7 @@ static struct omap_board_mux board_mux[] __initdata = {
 static void __init omap_sdp_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
-   zoom_peripherals_init();
+   zoom_peripherals_init(omap3_setuptime_table);
board_smc91x_init();
enable_board_wakeup_source();
usb_ehci_init(ehci_pdata);
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c 
b/arch/arm/mach-omap2/board-zoom-peripherals.c
index ca95d8d..66f9fd0 100755
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -26,6 +26,8 @@
 
 #include mux.h
 #include hsmmc.h
+#include pm.h
+#include voltage.h
 
 /* Zoom2 has Qwerty keyboard*/
 static int board_keymap[] = {
@@ -277,8 +279,12 @@ static void enable_board_wakeup_source(void)
OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
-void __init zoom_peripherals_init(void)
+void __init zoom_peripherals_init(void *peripheral_data)
 {
+   struct prm_setup_vc *omap3_setuptime =
+   (struct prm_setup_vc *)peripheral_data;
+
+   omap_voltage_init_vc(omap3_setuptime);
omap_i2c_init();
omap_serial_init();

[PATCH v3 4/5] omap3: pm: Use generic TRITON power scripts for 3430SDP board

2010-03-12 Thread Lesly A M
Removed the sleep/wakeup/warm_rest sequence from the board file.
Modified the resource config structure in the board file.
Updating the sleep/wakeup/warm_rest sequence  voltsetup_time
in the board file from generic script file.

Signed-off-by: Lesly A M x0080...@ti.com
Cc: Nishanth Menon n...@ti.com
Cc: David Derrick dderr...@ti.com
Cc: Samuel Ortiz sa...@linux.intel.com
---
 arch/arm/mach-omap2/Makefile|3 +-
 arch/arm/mach-omap2/board-3430sdp.c |  112 +--
 include/linux/i2c/twl.h |4 +
 3 files changed, 35 insertions(+), 84 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index a58a1a7..94d862a 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -117,7 +117,8 @@ obj-$(CONFIG_MACH_OMAP3_PANDORA)+= board-omap3pandora.o 
\
   hsmmc.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)+= board-3430sdp.o \
   hsmmc.o \
-  board-sdp-flash.o
+  board-sdp-flash.o \
+  twl4030-script.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)  += board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RX51)  += board-rx51.o \
   board-rx51-sdram.o \
diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 23403f0..4f94b6f 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -49,6 +49,7 @@
 #include sdram-qimonda-hyb18m512160af-6.h
 #include hsmmc.h
 #include voltage.h
+#include twl4030-script.h
 #include omap3-opp.h
 
 #define SDP3430_TS_GPIO_IRQ_SDPV1  3
@@ -350,7 +351,6 @@ static void __init omap_3430sdp_init_irq(void)
omap_board_config = sdp3430_config;
omap_board_config_size = ARRAY_SIZE(sdp3430_config);
omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
-   omap_voltage_init_vc(omap3_setuptime_table);
omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL, 
omap3_mpu_rate_table,
 omap3_dsp_rate_table, omap3_l3_rate_table);
omap_init_irq();
@@ -447,93 +447,35 @@ static struct twl4030_madc_platform_data 
sdp3430_madc_data = {
.irq_line   = 1,
 };
 
-
-static struct twl4030_ins __initdata sleep_on_seq[] = {
-   /* Turn off HFCLKOUT */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_OFF), 2},
-   /* Turn OFF VDD1 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_OFF), 2},
-   /* Turn OFF VDD2 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_OFF), 2},
-   /* Turn OFF VPLL1 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_OFF), 2},
-};
-
-static struct twl4030_script sleep_on_script __initdata = {
-   .script = sleep_on_seq,
-   .size   = ARRAY_SIZE(sleep_on_seq),
-   .flags  = TWL4030_SLEEP_SCRIPT,
-};
-
-static struct twl4030_ins wakeup_p12_seq[] __initdata = {
-   /* Turn on HFCLKOUT */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
-   /* Turn ON VDD1 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 2},
-   /* Turn ON VDD2 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 2},
-   /* Turn ON VPLL1 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_ACTIVE), 2},
-};
-
-static struct twl4030_script wakeup_p12_script __initdata = {
-   .script = wakeup_p12_seq,
-   .size   = ARRAY_SIZE(wakeup_p12_seq),
-   .flags  = TWL4030_WAKEUP12_SCRIPT,
-};
-
-static struct twl4030_ins wakeup_p3_seq[] __initdata = {
-   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
-};
-
-static struct twl4030_script wakeup_p3_script __initdata = {
-   .script = wakeup_p3_seq,
-   .size   = ARRAY_SIZE(wakeup_p3_seq),
-   .flags  = TWL4030_WAKEUP3_SCRIPT,
-};
-
-static struct twl4030_ins wrst_seq[] __initdata = {
-/*
- * Reset twl4030.
- * Reset VDD1 regulator.
- * Reset VDD2 regulator.
- * Reset VPLL1 regulator.
- * Enable sysclk output.
- * Reenable twl4030.
- */
-   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
-   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
-   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
-   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
-   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
-   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
-};
-static struct twl4030_script wrst_script __initdata = {
-   .script = wrst_seq,
-   .size   = ARRAY_SIZE(wrst_seq),
-   .flags  = TWL4030_WRST_SCRIPT,
-};
-
-static struct twl4030_script *twl4030_scripts[] __initdata = {
-   sleep_on_script,
-   wakeup_p12_script,
-   wakeup_p3_script,
-   wrst_script,
-};
-
 static struct twl4030_resconfig twl4030_rconfig[] = {
-   { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = -1,
-   .type2 = -1 

[PATCH 1/6 Revised] SPI omap2_mcspi.c: Check params before dereference or use

2010-03-12 Thread Scott Ellis
This was previously submitted directly to the linux-kernel list.
It was incomplete the first time because it failed to also check
the chip_select value.

Check spi-controller_state before dereference.
Check spi-chip_select for range before use.

Neither are necessarily valid after spi_alloc_device() and 
then spi_add_device() fails. Calling spi_put_device() will 
trigger the error.

Signed-off-by: Scott Ellis sc...@jumpnowtek.com

 drivers/spi/omap2_mcspi.c |   30 +-
 1 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index 715c518..fe1b56d 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -748,22 +748,26 @@ static void omap2_mcspi_cleanup(struct spi_device *spi)
struct omap2_mcspi_dma  *mcspi_dma;
struct omap2_mcspi_cs   *cs;
 
-   mcspi = spi_master_get_devdata(spi-master);
-   mcspi_dma = mcspi-dma_channels[spi-chip_select];
+   if (spi-controller_state) {
+   /* Unlink controller state from context save list */
+   cs = spi-controller_state;
+   list_del(cs-node);
 
-   /* Unlink controller state from context save list */
-   cs = spi-controller_state;
-   list_del(cs-node);
+   kfree(spi-controller_state);
+   }
 
-   kfree(spi-controller_state);
+   if (spi-chip_select  spi-master-num_chipselect) {
+   mcspi = spi_master_get_devdata(spi-master);
+   mcspi_dma = mcspi-dma_channels[spi-chip_select];
 
-   if (mcspi_dma-dma_rx_channel != -1) {
-   omap_free_dma(mcspi_dma-dma_rx_channel);
-   mcspi_dma-dma_rx_channel = -1;
-   }
-   if (mcspi_dma-dma_tx_channel != -1) {
-   omap_free_dma(mcspi_dma-dma_tx_channel);
-   mcspi_dma-dma_tx_channel = -1;
+   if (mcspi_dma-dma_rx_channel != -1) {
+   omap_free_dma(mcspi_dma-dma_rx_channel);
+   mcspi_dma-dma_rx_channel = -1;
+   }
+   if (mcspi_dma-dma_tx_channel != -1) {
+   omap_free_dma(mcspi_dma-dma_tx_channel);
+   mcspi_dma-dma_tx_channel = -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 v3 5/5] omap3: pm: Use generic TRITON power scripts for ZOOM[2,3], 3630SDP board

2010-03-12 Thread Lesly A M
Adding the power script data for zoom board to TWL4030 platform data.
Updating the sleep/wakeup/warm_rest sequence  voltsetup_time
in the board file from generic script file.

Signed-off-by: Lesly A M x0080...@ti.com
Cc: Nishanth Menon n...@ti.com
Cc: David Derrick dderr...@ti.com
Cc: Samuel Ortiz sa...@linux.intel.com
---
 arch/arm/mach-omap2/Makefile |9 --
 arch/arm/mach-omap2/board-zoom-peripherals.c |   36 ++
 2 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 94d862a..f9e9b11 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -127,14 +127,17 @@ obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o 
\
 obj-$(CONFIG_MACH_OMAP_ZOOM2)  += board-zoom2.o \
   board-zoom-peripherals.o \
   hsmmc.o \
-  board-zoom-debugboard.o
+  board-zoom-debugboard.o \
+  twl4030-script.o
 obj-$(CONFIG_MACH_OMAP_ZOOM3)  += board-zoom3.o \
   board-zoom-peripherals.o \
   hsmmc.o \
-  board-zoom-debugboard.o
+  board-zoom-debugboard.o \
+  twl4030-script.o
 obj-$(CONFIG_MACH_OMAP_3630SDP)+= board-3630sdp.o \
   board-zoom-peripherals.o \
-  hsmmc.o
+  hsmmc.o \
+  twl4030-script.o
 obj-$(CONFIG_MACH_CM_T35)  += board-cm-t35.o \
   hsmmc.o
 obj-$(CONFIG_MACH_IGEP0020)+= board-igep0020.o \
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c 
b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 66f9fd0..462d7ee 100755
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -28,6 +28,7 @@
 #include hsmmc.h
 #include pm.h
 #include voltage.h
+#include twl4030-script.h
 
 /* Zoom2 has Qwerty keyboard*/
 static int board_keymap[] = {
@@ -96,6 +97,38 @@ static struct twl4030_keypad_data zoom_kp_twl4030_data = {
.rep= 1,
 };
 
+static struct twl4030_resconfig twl4030_rconfig[] = {
+   { .resource = RES_VPLL1, .devgroup = DEV_GRP_P1, .type = 3,
+   .type2 = 1, .remap_sleep = RES_STATE_OFF },
+   { .resource = RES_VINTANA1, .devgroup = DEV_GRP_ALL, .type = 1,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_VINTANA2, .devgroup = DEV_GRP_ALL, .type = 0,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_VINTDIG, .devgroup = DEV_GRP_ALL, .type = 1,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_VIO, .devgroup = DEV_GRP_ALL, .type = 2,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_VDD1, .devgroup = DEV_GRP_P1,
+   .type = 4, .type2 = 1, .remap_sleep = RES_STATE_OFF },
+   { .resource = RES_VDD2, .devgroup = DEV_GRP_P1,
+   .type = 3, .type2 = 1, .remap_sleep = RES_STATE_OFF },
+   { .resource = RES_REGEN, .devgroup = DEV_GRP_ALL, .type = 2,
+   .type2 = 1, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_NRES_PWRON, .devgroup = DEV_GRP_ALL, .type = 0,
+   .type2 = 1, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_CLKEN, .devgroup = DEV_GRP_ALL, .type = 3,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_SYSEN, .devgroup = DEV_GRP_ALL, .type = 6,
+   .type2 = 1, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3,
+   .type = 0, .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { 0, 0},
+};
+
+static struct twl4030_power_data zoom_t2scripts_data __initdata = {
+   .resource_config = twl4030_rconfig,
+};
+
 static struct regulator_consumer_supply zoom_vmmc1_supply = {
.supply = vmmc,
 };
@@ -241,6 +274,7 @@ static struct twl4030_platform_data zoom_twldata = {
.usb= zoom_usb_data,
.gpio   = zoom_gpio_data,
.keypad = zoom_kp_twl4030_data,
+   .power  = zoom_t2scripts_data,
.codec  = zoom_codec_data,
.vmmc1  = zoom_vmmc1,
.vmmc2  = zoom_vmmc2,
@@ -284,6 +318,8 @@ void __init zoom_peripherals_init(void *peripheral_data)
struct prm_setup_vc *omap3_setuptime =
(struct prm_setup_vc *)peripheral_data;
 
+   

[PATCH 2/6] SPI omap2_mcspi: Add max_clk_div field to mcspi platform config

2010-03-12 Thread Scott Ellis
The McSPI_CHxCONF.CLKD register field has different limits for the
OMAP3 then the OMAP24xx. As per recommendation from the linux-omap
list, added a field for max_clk_div to the platform data for use in 
omap2_mcspi.c.

Used in a subsequent patch. 

Signed-off-by: Scott Ellis sc...@jumpnowtek.com

 arch/arm/mach-omap2/devices.c   |   16 
 arch/arm/plat-omap/include/plat/mcspi.h |1 +
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 23e4d77..d4ad126 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -302,6 +302,11 @@ static inline void omap_init_sti(void) {}
 
 static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
.num_cs = 4,
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
+   .max_clk_div= 0x0c,
+#else
+   .max_clk_div= 0x0f,
+#endif
 };
 
 static struct resource omap2_mcspi1_resources[] = {
@@ -324,6 +329,11 @@ static struct platform_device omap2_mcspi1 = {
 
 static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
.num_cs = 2,
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
+   .max_clk_div= 0x0c,
+#else
+   .max_clk_div= 0x0f,
+#endif
 };
 
 static struct resource omap2_mcspi2_resources[] = {
@@ -348,6 +358,11 @@ static struct platform_device omap2_mcspi2 = {
defined(CONFIG_ARCH_OMAP4)
 static struct omap2_mcspi_platform_config omap2_mcspi3_config = {
.num_cs = 2,
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
+   .max_clk_div= 0x0c,
+#else
+   .max_clk_div= 0x0f,
+#endif
 };
 
 static struct resource omap2_mcspi3_resources[] = {
@@ -372,6 +387,7 @@ static struct platform_device omap2_mcspi3 = {
 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 static struct omap2_mcspi_platform_config omap2_mcspi4_config = {
.num_cs = 1,
+   .max_clk_div= 0x0c,
 };
 
 static struct resource omap2_mcspi4_resources[] = {
diff --git a/arch/arm/plat-omap/include/plat/mcspi.h 
b/arch/arm/plat-omap/include/plat/mcspi.h
index 1254e49..9fa 100644
--- a/arch/arm/plat-omap/include/plat/mcspi.h
+++ b/arch/arm/plat-omap/include/plat/mcspi.h
@@ -3,6 +3,7 @@
 
 struct omap2_mcspi_platform_config {
unsigned short  num_cs;
+   unsigned short  max_clk_div;
 };
 
 struct omap2_mcspi_device_config {






--
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 3/6] SPI omap2_mcspi.c: Use appropriate clock divider value

2010-03-12 Thread Scott Ellis
The MCSPI_CHxCONF.CLKD register field has different limits 
for the OMAP3 then the OMAP24xx. 

Use the new max_clk_div value from 
omap2_mcspi_platform_config.

Signed-off-by: Scott Ellis sc...@jumpnowtek.com

 drivers/spi/omap2_mcspi.c |   27 ++-
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index fe1b56d..37e6d73 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -37,6 +37,7 @@
 
 #include plat/dma.h
 #include plat/clock.h
+#include plat/mcspi.h
 

 #define OMAP2_MCSPI_MAX_FREQ   4800
@@ -128,6 +129,7 @@ struct omap2_mcspi {
unsigned long   phys;
/* SPI1 has 4 channels, while SPI2 has 2 */
struct omap2_mcspi_dma  *dma_channels;
+   int max_clk_div;
 };
 
 struct omap2_mcspi_cs {
@@ -588,11 +590,12 @@ static int omap2_mcspi_setup_transfer(struct spi_device 
*spi,
cs-word_len = word_len;
 
if (spi-max_speed_hz) {
-   while (div = 15  (OMAP2_MCSPI_MAX_FREQ / (1  div))
-spi-max_speed_hz)
+   while (div = mcspi-max_clk_div 
+   (OMAP2_MCSPI_MAX_FREQ/(1  div))  spi-max_speed_hz)
div++;
-   } else
-   div = 15;
+   } else {
+   div = mcspi-max_clk_div;
+   }
 
l = mcspi_cached_chconf0(spi);
 
@@ -893,6 +896,8 @@ static int omap2_mcspi_transfer(struct spi_device *spi, 
struct spi_message *m)
unsigned long   flags;
struct spi_transfer *t;
 
+   mcspi = spi_master_get_devdata(spi-master);
+
m-actual_length = 0;
m-status = 0;
 
@@ -917,10 +922,13 @@ static int omap2_mcspi_transfer(struct spi_device *spi, 
struct spi_message *m)
t-bits_per_word);
return -EINVAL;
}
-   if (t-speed_hz  t-speed_hz  OMAP2_MCSPI_MAX_FREQ/(116)) {
+   if (t-speed_hz 
+   t-speed_hz  OMAP2_MCSPI_MAX_FREQ
+   /(1  mcspi-max_clk_div)) {
dev_dbg(spi-dev, %d Hz max exceeds %d\n,
-   t-speed_hz,
-   OMAP2_MCSPI_MAX_FREQ/(116));
+   t-speed_hz,
+   OMAP2_MCSPI_MAX_FREQ
+   /(1  mcspi-max_clk_div));
return -EINVAL;
}
 
@@ -955,8 +963,6 @@ static int omap2_mcspi_transfer(struct spi_device *spi, 
struct spi_message *m)
}
}
 
-   mcspi = spi_master_get_devdata(spi-master);
-
spin_lock_irqsave(mcspi-lock, flags);
list_add_tail(m-queue, mcspi-msg_queue);
queue_work(omap2_mcspi_wq, mcspi-work);
@@ -1049,6 +1055,7 @@ static int __init omap2_mcspi_probe(struct 
platform_device *pdev)
int status = 0, i;
const u8*rxdma_id, *txdma_id;
unsignednum_chipselect;
+   struct omap2_mcspi_platform_config *pdata;
 
switch (pdev-id) {
case 1:
@@ -1101,6 +1108,8 @@ static int __init omap2_mcspi_probe(struct 
platform_device *pdev)
 
mcspi = spi_master_get_devdata(master);
mcspi-master = master;
+   pdata = (struct omap2_mcspi_platform_config *)pdev-dev.platform_data;
+   mcspi-max_clk_div = pdata-max_clk_div;
 
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (r == NULL) {






--
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 4/6] SPI omap2_mcspi.c: Use the transfer speed_hz value if provided

2010-03-12 Thread Scott Ellis
omap2_mcspi_setup_transfer() gets called if a transfer has a non-zero
speed_hz value but it is never used in the function to override the
speed. 

This patch enables its use.

Signed-off-by: Scott Ellis sc...@jumpnowtek.com

 drivers/spi/omap2_mcspi.c |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index 37e6d73..2a93a73 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -580,18 +580,24 @@ static int omap2_mcspi_setup_transfer(struct spi_device 
*spi,
struct spi_master *spi_cntrl;
u32 l = 0, div = 0;
u8 word_len = spi-bits_per_word;
+   u32 speed_hz = spi-max_speed_hz;
 
mcspi = spi_master_get_devdata(spi-master);
spi_cntrl = mcspi-master;
 
-   if (t != NULL  t-bits_per_word)
-   word_len = t-bits_per_word;
+   if (t != NULL) {
+   if (t-bits_per_word)
+   word_len = t-bits_per_word;
+
+   if (t-speed_hz)
+   speed_hz = t-speed_hz;
+   }
 
cs-word_len = word_len;
 
-   if (spi-max_speed_hz) {
+   if (speed_hz) {
while (div = mcspi-max_clk_div 
-   (OMAP2_MCSPI_MAX_FREQ/(1  div))  spi-max_speed_hz)
+   (OMAP2_MCSPI_MAX_FREQ/(1  div))  speed_hz)
div++;
} else {
div = mcspi-max_clk_div;





--
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 5/6] SPI omap2_mcspi.c: Use num chipselects from platform data

2010-03-12 Thread Scott Ellis
The platform data already has the number of chip select lines 
for each McSPI module. No need to figure it out again in 
probe().

Signed-off-by: Scott Ellis sc...@jumpnowtek.com

 drivers/spi/omap2_mcspi.c |9 ++---
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index cce23c5..cd9fdc2 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -1058,33 +1058,28 @@ static int __init omap2_mcspi_probe(struct 
platform_device *pdev)
struct resource *r;
int status = 0, i;
const u8*rxdma_id, *txdma_id;
-   unsignednum_chipselect;
struct omap2_mcspi_platform_config *pdata;
 
switch (pdev-id) {
case 1:
rxdma_id = spi1_rxdma_id;
txdma_id = spi1_txdma_id;
-   num_chipselect = 4;
break;
case 2:
rxdma_id = spi2_rxdma_id;
txdma_id = spi2_txdma_id;
-   num_chipselect = 2;
break;
 #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) \
|| defined(CONFIG_ARCH_OMAP4)
case 3:
rxdma_id = spi3_rxdma_id;
txdma_id = spi3_txdma_id;
-   num_chipselect = 2;
break;
 #endif
 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
case 4:
rxdma_id = spi4_rxdma_id;
txdma_id = spi4_txdma_id;
-   num_chipselect = 1;
break;
 #endif
default:
@@ -1106,7 +1101,6 @@ static int __init omap2_mcspi_probe(struct 
platform_device *pdev)
master-setup = omap2_mcspi_setup;
master-transfer = omap2_mcspi_transfer;
master-cleanup = omap2_mcspi_cleanup;
-   master-num_chipselect = num_chipselect;
 
dev_set_drvdata(pdev-dev, master);
 
@@ -1114,6 +1108,7 @@ static int __init omap2_mcspi_probe(struct 
platform_device *pdev)
mcspi-master = master;
pdata = (struct omap2_mcspi_platform_config *)pdev-dev.platform_data;
mcspi-max_clk_div = pdata-max_clk_div;
+   master-num_chipselect = pdata-num_cs;
 
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (r == NULL) {
@@ -1160,7 +1155,7 @@ static int __init omap2_mcspi_probe(struct 
platform_device *pdev)
if (mcspi-dma_channels == NULL)
goto err3;
 
-   for (i = 0; i  num_chipselect; i++) {
+   for (i = 0; i  master-num_chipselect; i++) {
mcspi-dma_channels[i].dma_rx_channel = -1;
mcspi-dma_channels[i].dma_rx_sync_dev = rxdma_id[i];
mcspi-dma_channels[i].dma_tx_channel = -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 6/6] SPI omap2_mcspi.c: Limit debug messages from setup_transfer

2010-03-12 Thread Scott Ellis
Limit the debug messages put out in omap2_mcspi_setup_transfer().
If you are overriding the speed on transfers, the volume is 
excessive. 

Wrap it with VERBOSE.

Signed-off-by: Scott Ellis sc...@jumpnowtek.com

 drivers/spi/omap2_mcspi.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index adc6fd3..b2dbbc0 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -637,11 +637,12 @@ static int omap2_mcspi_setup_transfer(struct spi_device 
*spi,
 
mcspi_write_chconf0(spi, l);
 
+#ifdef VERBOSE
dev_dbg(spi-dev, setup: speed %d, sample %s edge, clk %s\n,
OMAP2_MCSPI_MAX_FREQ / (1  div),
(spi-mode  SPI_CPHA) ? trailing : leading,
(spi-mode  SPI_CPOL) ? inverted : normal);
-
+#endif
return 0;
 }
 





--
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 0/5] omap3: pm: Update TRITON power scripts and making it generic.

2010-03-12 Thread Lesly Arackal Manuel
This patch has dependency on SmartReflex patch send by Thara Gopinath.

---
[PATCH 2/6] OMAP3: PM: Splitting voltage and smartreflex class specific code
from smartreflex driver.

1. Create voltage.c and voltage.h files and move all voltage
processor and voltage controller specific code from smartreflex.c
to these two files.
---

These patches are created on top of voltage changes done by Thara in
SmartReflex patch series.

Thanks  Regards,
Lesly A M


-Original Message-
From: Lesly A M [mailto:lesl...@ti.com] 
Sent: Friday, March 12, 2010 9:01 PM
To: linux-omap@vger.kernel.org
Cc: Lesly A M; Nishanth Menon; David Derrick; Samuel Ortiz
Subject: [PATCH v3 0/5] omap3: pm: Update TRITON power scripts and making it
generic. 

This series of patch implements a updated TRITON power scripts.
Also moving the sleep, wakeup  warm_reset sequence to a generic script
file,
which can be used by different OMAP3 board with the power companion chip
TWL4030.

This patch series is based off Kevin's tree origin/pm branch.

This changes are tested on OMAP3430 SDP board with:
enable_off_mode
voltage_off_while_idle
sleep_while_idle (VDD1/VDD2 voltage scaling to 0v)
enabled in cpuidle and suspned path.

Also tested for reboot and dvfs.

Lesly A M (5):
  omap3: pm: fix for twl4030 script load
  omap3: pm: Using separate clk/volt setup_time for RET and OFF states
  omap3: pm: Generic TRITON power scripts for OMAP3 based boards
  omap3: pm: Use generic TRITON power scripts for 3430SDP board
  omap3: pm: Use generic TRITON power scripts for ZOOM[2,3], 3630SDP
board

 arch/arm/mach-omap2/Makefile  |   12 ++-
 arch/arm/mach-omap2/board-3430sdp.c   |  139

 arch/arm/mach-omap2/board-3630sdp.c   |   25 -
 arch/arm/mach-omap2/board-zoom-peripherals.c  |   44 -
 arch/arm/mach-omap2/board-zoom2.c |   25 -
 arch/arm/mach-omap2/board-zoom3.c |   25 -
 arch/arm/mach-omap2/include/mach/board-zoom.h |2 +-
 arch/arm/mach-omap2/pm.h  |   21 +++--
 arch/arm/mach-omap2/pm34xx.c  |   14 ++-
 arch/arm/mach-omap2/twl4030-script.c  |  143
+
 arch/arm/mach-omap2/twl4030-script.h  |   15 +++
 arch/arm/mach-omap2/voltage.c |   94 -
 arch/arm/mach-omap2/voltage.h |1 +
 drivers/mfd/twl4030-power.c   |6 -
 include/linux/i2c/twl.h   |4 +
 15 files changed, 424 insertions(+), 146 deletions(-)
 create mode 100644 arch/arm/mach-omap2/twl4030-script.c
 create mode 100644 arch/arm/mach-omap2/twl4030-script.h

Signed-off-by: Lesly A M x0080...@ti.com
Cc: Nishanth Menon n...@ti.com
Cc: David Derrick dderr...@ti.com
Cc: Samuel Ortiz sa...@linux.intel.com

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


[RFC][PATCH 1/3] OMAP: DSS2: Do regulator stuff in dpi_init_display()

2010-03-12 Thread Roger Quadros
From: Roger Quadros roger.quad...@nokia.com

We don't want dpi_init() to fail in any case as it will prevent us
from using DSS2 if we don't have DSI in the system. This is because
dpi_init() is done unconditionally by the DSS2 core.

We will only need to do regulator initialization when DPI is actually
present in the system. So we do regulator init stuff in dpi_init_display()

Signed-off-by: Roger Quadros roger.quad...@nokia.com
---
 drivers/video/omap2/dss/dpi.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 960e977..bcedafd 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -299,11 +299,6 @@ int dpi_init_display(struct omap_dss_device *dssdev)
 {
DSSDBG(init_display\n);
 
-   return 0;
-}
-
-int dpi_init(struct platform_device *pdev)
-{
if (cpu_is_omap34xx()) {
dpi.vdds_dsi_reg = dss_get_vdds_dsi();
if (IS_ERR(dpi.vdds_dsi_reg)) {
@@ -315,6 +310,11 @@ int dpi_init(struct platform_device *pdev)
return 0;
 }
 
+int dpi_init(struct platform_device *pdev)
+{
+   return 0;
+}
+
 void dpi_exit(void)
 {
 }
-- 
1.6.0.4

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


[RFC][PATCH 2/3] OMAP: DSS2: Prevent recursive Panel Enable/Disable calls from SDI

2010-03-12 Thread Roger Quadros
From: Roger Quadros roger.quad...@nokia.com

Panel enable/disable is now done inside display manager,
so don't need to do it again.

Signed-off-by: Roger Quadros roger.quad...@nokia.com
---
 drivers/video/omap2/dss/sdi.c |9 -
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index 12eb404..45aab89 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -115,12 +115,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device 
*dssdev)
 
dssdev-manager-enable(dssdev-manager);
 
-   if (dssdev-driver-enable) {
-   r = dssdev-driver-enable(dssdev);
-   if (r)
-   goto err3;
-   }
-
sdi.skip_init = 0;
 
return 0;
@@ -137,9 +131,6 @@ EXPORT_SYMBOL(omapdss_sdi_display_enable);
 
 void omapdss_sdi_display_disable(struct omap_dss_device *dssdev)
 {
-   if (dssdev-driver-disable)
-   dssdev-driver-disable(dssdev);
-
dssdev-manager-disable(dssdev-manager);
 
dss_sdi_disable();
-- 
1.6.0.4

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


[RFC][PATCH 0/3] OMAP: DSS2: Allow us to use SDI

2010-03-12 Thread Roger Quadros
I want to get DSS2 working on N900. N900 requires SDI.

Technically we should be able to use SDI without having DSI
regulators enabled.
Thes patches also add the vdds_sdi supply support to SDI.

NOTE: I cannot yet confirm that SDI was working or will work with this.

---
Roger Quadros (3):
  OMAP: DSS2: Do regulator stuff in dpi_init_display()
  OMAP: DSS2: Prevent recursive Panel Enable/Disable calls from SDI
  OMAP: DSS2: Use vdds_sdi regulator supply in SDI

 drivers/video/omap2/dss/dpi.c |   10 +-
 drivers/video/omap2/dss/sdi.c |   32 +---
 2 files changed, 26 insertions(+), 16 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


[RFC][PATCH 3/3] OMAP: DSS2: Use vdds_sdi regulator supply in SDI

2010-03-12 Thread Roger Quadros
From: Roger Quadros roger.quad...@nokia.com

This patch enables the use of vdds_sdi regulator in SDI subsystem.
We can disable the vdds_sdi voltage when not in use to save
power.

Signed-off-by: Roger Quadros roger.quad...@nokia.com
---
 drivers/video/omap2/dss/sdi.c |   23 +--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index 45aab89..e816e80 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -23,13 +23,16 @@
 #include linux/clk.h
 #include linux/delay.h
 #include linux/err.h
+#include linux/regulator/consumer.h
 
 #include plat/display.h
+#include plat/cpu.h
 #include dss.h
 
 static struct {
bool skip_init;
bool update_enabled;
+   struct regulator *vdds_sdi_reg;
 } sdi;
 
 static void sdi_basic_init(void)
@@ -57,6 +60,12 @@ int omapdss_sdi_display_enable(struct omap_dss_device 
*dssdev)
goto err0;
}
 
+   if (cpu_is_omap34xx()) {
+   r = regulator_enable(sdi.vdds_sdi_reg);
+   if (r)
+   goto err1;
+   }
+
/* In case of skip_init sdi_init has already enabled the clocks */
if (!sdi.skip_init)
dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
@@ -118,10 +127,10 @@ int omapdss_sdi_display_enable(struct omap_dss_device 
*dssdev)
sdi.skip_init = 0;
 
return 0;
-err3:
-   dssdev-manager-disable(dssdev-manager);
 err2:
dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+   if (cpu_is_omap34xx())
+   regulator_enable(sdi.vdds_sdi_reg);
 err1:
omap_dss_stop_device(dssdev);
 err0:
@@ -137,6 +146,9 @@ void omapdss_sdi_display_disable(struct omap_dss_device 
*dssdev)
 
dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
 
+   if (cpu_is_omap34xx())
+   regulator_enable(sdi.vdds_sdi_reg);
+
omap_dss_stop_device(dssdev);
 }
 EXPORT_SYMBOL(omapdss_sdi_display_disable);
@@ -144,6 +156,13 @@ EXPORT_SYMBOL(omapdss_sdi_display_disable);
 int sdi_init_display(struct omap_dss_device *dssdev)
 {
DSSDBG(SDI init\n);
+   if (cpu_is_omap34xx()) {
+   sdi.vdds_sdi_reg = dss_get_vdds_sdi();
+   if (IS_ERR(sdi.vdds_sdi_reg)) {
+   DSSERR(can't get VDDS_SDI regulator\n);
+   return PTR_ERR(sdi.vdds_sdi_reg);
+   }
+   }
 
return 0;
 }
-- 
1.6.0.4

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


[no subject]

2010-03-12 Thread Lesly A M
Subject: [PATCH] MFD: TWL4030: changes for TRITON glitch fix.

Fix for TWL5030 Silicon Errata 27  28:
27 - VDD1, VDD2, may have glitches when their output value is updated.
28 - VDD1 and / or VDD2 DCDC clock may stop working when internal clock
is switched from internal to external.

Workaround requires the TWL DCDCs to use HFCLK instead of internal oscillator.
Also enable TWL watchdog before switching the osc to recover
if the VDD1/VDD2 stop working.

Fix is required for TWL5030 Silicon version less than or equal to ES1.1
Changes are done under the macro CONFIG_TWL5030_GLITCH_FIX,
since the IDCODE register on TWL5030 Si is not updated correctly.

Updated the TWL resource settings and volt, clock setuptime.

Changes taken from Nishanth Menons gaia glitch fix patch.

Signed-off-by: Lesly A M lesl...@ti.com
Cc: Nishanth Menon n...@ti.com
Cc: David Derrick dderr...@ti.com
Cc: Samuel Ortiz sa...@linux.intel.com
---

This patch has dependency on:
SmartReflex patch series from Thara.
Update TRITON power scripts from Lesly.

This patch series is based off Kevin's tree origin/pm branch.

This changes are tested on OMAP3430 SDP board with:
enable_off_mode
voltage_off_while_idle
sleep_while_idle (VDD1/VDD2 voltage scaling to 0v) enabled in cpuidle 
and suspned path.

Also tested for reboot and dvfs.

 arch/arm/mach-omap2/board-3430sdp.c   |   40 +
 arch/arm/mach-omap2/board-zoom-peripherals.c  |   40 +
 arch/arm/mach-omap2/include/mach/board-sdp.h  |4 +
 arch/arm/mach-omap2/include/mach/board-zoom.h |4 +
 arch/arm/mach-omap2/twl4030-script.c  |   84 +++
 arch/arm/mach-omap2/twl4030-script.h  |9 ++
 arch/arm/mach-omap2/voltage.c |   10 +++
 arch/arm/mach-omap2/voltage.h |4 +
 arch/arm/plat-omap/Kconfig|7 ++
 drivers/mfd/twl4030-power.c   |  106 +
 10 files changed, 308 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 4f94b6f..d174d21 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -475,6 +475,36 @@ static struct twl4030_resconfig twl4030_rconfig[] = {
{ 0, 0},
 };
 
+#ifdef CONFIG_TWL5030_GLITCH_FIX
+static struct twl4030_resconfig twl4030_rconfig_glitchfix[] = {
+   { .resource = RES_VPLL1, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
+   .type = 3, .type2 = 1, .remap_sleep = RES_STATE_OFF },
+   { .resource = RES_VINTANA1, .devgroup = DEV_GRP_ALL, .type = 1,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_VINTANA2, .devgroup = DEV_GRP_ALL, .type = 0,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_VINTDIG, .devgroup = DEV_GRP_ALL, .type = 1,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_VIO, .devgroup = DEV_GRP_ALL, .type = 2,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_VDD1, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
+   .type = 4, .type2 = 1, .remap_sleep = RES_STATE_OFF },
+   { .resource = RES_VDD2, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
+   .type = 3, .type2 = 1, .remap_sleep = RES_STATE_OFF },
+   { .resource = RES_REGEN, .devgroup = DEV_GRP_ALL, .type = 2,
+   .type2 = 1, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_NRES_PWRON, .devgroup = DEV_GRP_ALL, .type = 0,
+   .type2 = 1, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_CLKEN, .devgroup = DEV_GRP_ALL, .type = 3,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_SYSEN, .devgroup = DEV_GRP_ALL, .type = 6,
+   .type2 = 1, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
+   .type = 0, .type2 = 1, .remap_sleep = RES_STATE_SLEEP },
+   { 0, 0},
+};
+#endif
+
 static struct twl4030_power_data sdp3430_t2scripts_data __initdata = {
.resource_config = twl4030_rconfig,
 };
@@ -840,6 +870,16 @@ static struct omap_musb_board_data musb_board_data = {
.power  = 100,
 };
 
+#ifdef CONFIG_TWL5030_GLITCH_FIX
+void twl5030_glitchfix_changes_3430sdp(void)
+{
+   sdp3430_t2scripts_data.resource_config = twl4030_rconfig_glitchfix;
+   use_twl4030_script_glitchfix(sdp3430_t2scripts_data);
+   omap_voltage_twl5030_glitchfix();
+}
+EXPORT_SYMBOL(twl5030_glitchfix_changes_3430sdp);
+#endif
+
 static void __init omap_3430sdp_init(void)
 {
twl4030_get_scripts(sdp3430_t2scripts_data);
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c 
b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 462d7ee..76f28d1 100755
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ 

[PATCH] MFD: TWL4030: changes for TRITON glitch fix

2010-03-12 Thread Lesly A M
Fix for TWL5030 Silicon Errata 27  28:
27 - VDD1, VDD2, may have glitches when their output value is updated.
28 - VDD1 and / or VDD2 DCDC clock may stop working when internal clock
is switched from internal to external.

Workaround requires the TWL DCDCs to use HFCLK instead of internal oscillator.
Also enable TWL watchdog before switching the osc to recover
if the VDD1/VDD2 stop working.

Fix is required for TWL5030 Silicon version less than or equal to ES1.1
Changes are done under the macro CONFIG_TWL5030_GLITCH_FIX,
since the IDCODE register on TWL5030 Si is not updated correctly.

Updated the TWL resource settings and volt, clock setuptime.

Changes taken from Nishanth Menons gaia glitch fix patch.

Signed-off-by: Lesly A M lesl...@ti.com
Cc: Nishanth Menon n...@ti.com
Cc: David Derrick dderr...@ti.com
Cc: Samuel Ortiz sa...@linux.intel.com
---

This patch has dependency on:
SmartReflex patch series from Thara.
Update TRITON power scripts from Lesly.

This patch series is based off Kevin's tree origin/pm branch.

This changes are tested on OMAP3430 SDP board with:
enable_off_mode
voltage_off_while_idle
sleep_while_idle (VDD1/VDD2 voltage scaling to 0v) enabled in cpuidle 
and suspned path.

Also tested for reboot and dvfs.

 arch/arm/mach-omap2/board-3430sdp.c   |   40 +
 arch/arm/mach-omap2/board-zoom-peripherals.c  |   40 +
 arch/arm/mach-omap2/include/mach/board-sdp.h  |4 +
 arch/arm/mach-omap2/include/mach/board-zoom.h |4 +
 arch/arm/mach-omap2/twl4030-script.c  |   84 +++
 arch/arm/mach-omap2/twl4030-script.h  |9 ++
 arch/arm/mach-omap2/voltage.c |   10 +++
 arch/arm/mach-omap2/voltage.h |4 +
 arch/arm/plat-omap/Kconfig|7 ++
 drivers/mfd/twl4030-power.c   |  106 +
 10 files changed, 308 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 4f94b6f..d174d21 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -475,6 +475,36 @@ static struct twl4030_resconfig twl4030_rconfig[] = {
{ 0, 0},
 };
 
+#ifdef CONFIG_TWL5030_GLITCH_FIX
+static struct twl4030_resconfig twl4030_rconfig_glitchfix[] = {
+   { .resource = RES_VPLL1, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
+   .type = 3, .type2 = 1, .remap_sleep = RES_STATE_OFF },
+   { .resource = RES_VINTANA1, .devgroup = DEV_GRP_ALL, .type = 1,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_VINTANA2, .devgroup = DEV_GRP_ALL, .type = 0,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_VINTDIG, .devgroup = DEV_GRP_ALL, .type = 1,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_VIO, .devgroup = DEV_GRP_ALL, .type = 2,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_VDD1, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
+   .type = 4, .type2 = 1, .remap_sleep = RES_STATE_OFF },
+   { .resource = RES_VDD2, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
+   .type = 3, .type2 = 1, .remap_sleep = RES_STATE_OFF },
+   { .resource = RES_REGEN, .devgroup = DEV_GRP_ALL, .type = 2,
+   .type2 = 1, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_NRES_PWRON, .devgroup = DEV_GRP_ALL, .type = 0,
+   .type2 = 1, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_CLKEN, .devgroup = DEV_GRP_ALL, .type = 3,
+   .type2 = 2, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_SYSEN, .devgroup = DEV_GRP_ALL, .type = 6,
+   .type2 = 1, .remap_sleep = RES_STATE_SLEEP },
+   { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
+   .type = 0, .type2 = 1, .remap_sleep = RES_STATE_SLEEP },
+   { 0, 0},
+};
+#endif
+
 static struct twl4030_power_data sdp3430_t2scripts_data __initdata = {
.resource_config = twl4030_rconfig,
 };
@@ -840,6 +870,16 @@ static struct omap_musb_board_data musb_board_data = {
.power  = 100,
 };
 
+#ifdef CONFIG_TWL5030_GLITCH_FIX
+void twl5030_glitchfix_changes_3430sdp(void)
+{
+   sdp3430_t2scripts_data.resource_config = twl4030_rconfig_glitchfix;
+   use_twl4030_script_glitchfix(sdp3430_t2scripts_data);
+   omap_voltage_twl5030_glitchfix();
+}
+EXPORT_SYMBOL(twl5030_glitchfix_changes_3430sdp);
+#endif
+
 static void __init omap_3430sdp_init(void)
 {
twl4030_get_scripts(sdp3430_t2scripts_data);
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c 
b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 462d7ee..76f28d1 100755
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -125,6 +125,36 @@ static struct twl4030_resconfig twl4030_rconfig[] 

[PATCH v3 2/2] omap: rx-51: enable tsc2005

2010-03-12 Thread Aaro Koskinen
Enable TSC2005 touchscreen driver on the RX-51 board.

Signed-off-by: Aaro Koskinen aaro.koski...@nokia.com
---
 arch/arm/configs/rx51_defconfig  |1 +
 arch/arm/mach-omap2/board-rx51-peripherals.c |   57 ++
 2 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/arch/arm/configs/rx51_defconfig b/arch/arm/configs/rx51_defconfig
index b6eeebb..95b76ec 100644
--- a/arch/arm/configs/rx51_defconfig
+++ b/arch/arm/configs/rx51_defconfig
@@ -801,6 +801,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
 # CONFIG_TOUCHSCREEN_TOUCHWIN is not set
 # CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
 # CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
+CONFIG_TOUCHSCREEN_TSC2005=m
 # CONFIG_TOUCHSCREEN_TSC2007 is not set
 CONFIG_INPUT_MISC=y
 # CONFIG_INPUT_ATI_REMOTE is not set
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c 
b/arch/arm/mach-omap2/board-rx51-peripherals.c
index acafdbc..bdd7398 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -14,6 +14,7 @@
 #include linux/input.h
 #include linux/input/matrix_keypad.h
 #include linux/spi/spi.h
+#include linux/spi/tsc2005.h
 #include linux/spi/wl12xx.h
 #include linux/i2c.h
 #include linux/i2c/twl.h
@@ -42,18 +43,28 @@
 #define RX51_WL1251_POWER_GPIO 87
 #define RX51_WL1251_IRQ_GPIO   42
 
+#define RX51_TSC2005_RESET_GPIO104
+#define RX51_TSC2005_IRQ_GPIO  100
+
 /* list all spi devices here */
 enum {
RX51_SPI_WL1251,
+   RX51_SPI_TSC2005,
 };
 
 static struct wl12xx_platform_data wl1251_pdata;
+static struct tsc2005_platform_data tsc2005_pdata;
 
 static struct omap2_mcspi_device_config wl1251_mcspi_config = {
.turbo_mode = 0,
.single_channel = 1,
 };
 
+static struct omap2_mcspi_device_config tsc2005_mcspi_config = {
+   .turbo_mode = 0,
+   .single_channel = 1,
+};
+
 static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
[RX51_SPI_WL1251] = {
.modalias   = wl1251,
@@ -64,6 +75,15 @@ static struct spi_board_info 
rx51_peripherals_spi_board_info[] __initdata = {
.controller_data= wl1251_mcspi_config,
.platform_data  = wl1251_pdata,
},
+   [RX51_SPI_TSC2005] = {
+   .modalias   = tsc2005,
+   .bus_num= 1,
+   .chip_select= 0,
+   .irq= OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),
+   .max_speed_hz   = 600,
+   .controller_data= tsc2005_mcspi_config,
+   .platform_data  = tsc2005_pdata,
+   },
 };
 
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
@@ -665,6 +685,42 @@ static inline void board_onenand_init(void)
 
 #endif
 
+static struct tsc2005_platform_data tsc2005_pdata = {
+   .ts_pressure_max   = 2048,
+   .ts_pressure_fudge = 2,
+   .ts_x_max  = 4096,
+   .ts_x_fudge= 4,
+   .ts_y_max  = 4096,
+   .ts_y_fudge= 7,
+   .ts_x_plate_ohm= 280,
+   .esd_timeout_ms= 8000,
+};
+
+static void rx51_tsc2005_set_reset(bool enable)
+{
+   gpio_set_value(RX51_TSC2005_RESET_GPIO, enable);
+}
+
+static void __init rx51_init_tsc2005(void)
+{
+   int r;
+
+   r = gpio_request(RX51_TSC2005_IRQ_GPIO, tsc2005 IRQ);
+   if (r = 0)
+   gpio_direction_input(RX51_TSC2005_IRQ_GPIO);
+   else
+   printk(KERN_ERR unable to get %s GPIO\n, tsc2005 IRQ);
+
+   r = gpio_request(RX51_TSC2005_RESET_GPIO, tsc2005 reset);
+   if (r = 0) {
+   gpio_direction_output(RX51_TSC2005_RESET_GPIO, 1);
+   tsc2005_pdata.set_reset = rx51_tsc2005_set_reset;
+   } else {
+   printk(KERN_ERR unable to get %s GPIO\n, tsc2005 reset);
+   tsc2005_pdata.esd_timeout_ms = 0;
+   }
+}
+
 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
 
 static struct omap_smc91x_platform_data board_smc91x_data = {
@@ -749,6 +805,7 @@ void __init rx51_peripherals_init(void)
board_smc91x_init();
rx51_add_gpio_keys();
rx51_init_wl1251();
+   rx51_init_tsc2005();
spi_register_board_info(rx51_peripherals_spi_board_info,
ARRAY_SIZE(rx51_peripherals_spi_board_info));
 }
-- 
1.6.0.4

--
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 1/2] input: touchscreen: introduce tsc2005 driver

2010-03-12 Thread Aaro Koskinen
From: Lauri Leukkunen lauri.leukku...@nokia.com

Introduce a driver for the Texas Instruments TSC2005 touchscreen
controller (http://focus.ti.com/docs/prod/folders/print/tsc2005.html).

The patch is based on a driver by Lauri Leukkunen, with modifications
by David Brownell, Phil Carmody, Imre Deak, Hiroshi DOYU, Ari Kauppi,
Tony Lindgren, Jarkko Nikula, Eero Nurkkala and Roman Tereshonkov.

Signed-off-by: Lauri Leukkunen lauri.leukku...@nokia.com
[aaro.koski...@nokia.com: patch description, rebasing  cleanup]
Signed-off-by: Aaro Koskinen aaro.koski...@nokia.com
Cc: David Brownell dbrown...@users.sourceforge.net
Cc: Phil Carmody ext-phil.2.carm...@nokia.com
Cc: Imre Deak imre.d...@nokia.com
Cc: Hiroshi DOYU hiroshi.d...@nokia.com
Cc: Ari Kauppi ext-ari.kau...@nokia.com
Cc: Tony Lindgren t...@atomide.com
Cc: Jarkko Nikula jhnik...@gmail.com
Cc: Eero Nurkkala ext-eero.nurkk...@nokia.com
Cc: Roman Tereshonkov roman.tereshon...@nokia.com
---

The v3 has some major modifications. I have tried to clean up and simplify
the driver. All action takes place in thread context, SPI transfers are
synchronous, the spinlock is removed, and there are no long sections
with interrupts disabled. The driver should be now SMP safe.

Also the following review comments are addressed:
- Use del_timer_sync() instead of del_timer().
- Use mod_timer() always instead of add_timer().
- Use attribute_group.
- Delete filtering and averaging which belong to upper layers.
- Delete pen_down sysfs file.

The patch is against 2.6.33.

The previous version and comments can be seen here:
http://marc.info/?t=12573411564r=1w=2

 drivers/input/touchscreen/Kconfig   |   11 +
 drivers/input/touchscreen/Makefile  |1 +
 drivers/input/touchscreen/tsc2005.c |  678 +++
 include/linux/spi/tsc2005.h |   41 +++
 4 files changed, 731 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/tsc2005.c
 create mode 100644 include/linux/spi/tsc2005.h

diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index dfafc76..72c1797 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -548,6 +548,17 @@ config TOUCHSCREEN_TOUCHIT213
  To compile this driver as a module, choose M here: the
  module will be called touchit213.
 
+config TOUCHSCREEN_TSC2005
+tristate TSC2005 based touchscreens
+depends on SPI_MASTER
+help
+  Say Y here if you have a TSC2005 based touchscreen.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called tsc2005.
+
 config TOUCHSCREEN_TSC2007
tristate TSC2007 based touchscreens
depends on I2C
diff --git a/drivers/input/touchscreen/Makefile 
b/drivers/input/touchscreen/Makefile
index d61a3b4..61fa8b5 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -33,6 +33,7 @@ obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o
 obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213)   += touchit213.o
 obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT)   += touchright.o
 obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o
+obj-$(CONFIG_TOUCHSCREEN_TSC2005)  += tsc2005.o
 obj-$(CONFIG_TOUCHSCREEN_TSC2007)  += tsc2007.o
 obj-$(CONFIG_TOUCHSCREEN_UCB1400)  += ucb1400_ts.o
 obj-$(CONFIG_TOUCHSCREEN_WACOM_W8001)  += wacom_w8001.o
diff --git a/drivers/input/touchscreen/tsc2005.c 
b/drivers/input/touchscreen/tsc2005.c
new file mode 100644
index 000..27ee361
--- /dev/null
+++ b/drivers/input/touchscreen/tsc2005.c
@@ -0,0 +1,678 @@
+/*
+ * TSC2005 touchscreen driver
+ *
+ * Copyright (C) 2006-2010 Nokia Corporation
+ *
+ * Author: Lauri Leukkunen lauri.leukku...@nokia.com
+ * based on TSC2301 driver by Klaus K. Pedersen klaus.k.peder...@nokia.com
+ *
+ * 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 linux/kernel.h
+#include linux/module.h
+#include linux/input.h
+#include linux/interrupt.h
+#include linux/delay.h
+#include linux/spi/spi.h
+#include linux/spi/tsc2005.h
+
+/*
+ * The touchscreen interface operates as follows:
+ *
+ * 1) Pen is pressed against the touchscreen.
+ * 2) TSC2005 performs AD conversion.
+ * 3) After the conversion is done TSC2005 

Re: [PATCH 17/19] omap: Add DSI regulator supply to OMAP3EVM board file

2010-03-12 Thread Tony Lindgren
* Hiremath, Vaibhav hvaib...@ti.com [100311 20:45]:
 [Hiremath, Vaibhav] Tony,
 Please use the patch below, I have fixed Mark's comments to use devname 
 instead of dev.

Sorry, looks like I missed Mark's comments while reading the
thread at:

http://patchwork.kernel.org/patch/84823/

I can't get either of your patches to apply. Please just repost your
whole patch against the 2.6.34-rc1 with the Acked-by from Tomi.

Also, please read the mailing list instructions we have at:

http://www.elinux.org/Netiquette

Basically one patch per mail. In format that can be applied as it is.
Patches inlined, not quoted-printable. I don't want to manually re-edit
the patches, it's a complete waste of time.
 
 diff --git a/drivers/mtd/maps/omap_nor.c b/drivers/mtd/maps/omap_nor.c
 deleted file mode 100644
 index e69de29..000

And this part we don't want to apply, it's not related to this patch.

Regards,

Tony
--
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 17/19] omap: Add DSI regulator supply to OMAP3EVM board file

2010-03-12 Thread Tony Lindgren
* Tony Lindgren t...@atomide.com [100312 09:08]:
 * Hiremath, Vaibhav hvaib...@ti.com [100311 20:45]:
  [Hiremath, Vaibhav] Tony,
  Please use the patch below, I have fixed Mark's comments to use devname 
  instead of dev.
 
 Sorry, looks like I missed Mark's comments while reading the
 thread at:
 
 http://patchwork.kernel.org/patch/84823/
 
 I can't get either of your patches to apply. Please just repost your
 whole patch against the 2.6.34-rc1 with the Acked-by from Tomi.
 
 Also, please read the mailing list instructions we have at:
 
 http://www.elinux.org/Netiquette
 
 Basically one patch per mail. In format that can be applied as it is.
 Patches inlined, not quoted-printable. I don't want to manually re-edit
 the patches, it's a complete waste of time.
  
  diff --git a/drivers/mtd/maps/omap_nor.c b/drivers/mtd/maps/omap_nor.c
  deleted file mode 100644
  index e69de29..000
 
 And this part we don't want to apply, it's not related to this patch.

Also, since this is not urgent to get things compiling again, I'll
drop this for now. We can merge it with the next set of fixes.

Regards,

Tony
--
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 2/6] SPI omap2_mcspi: Add max_clk_div field to mcspi platform config

2010-03-12 Thread Tony Lindgren
* Scott Ellis sc...@jumpnowtek.com [100312 07:20]:
 The McSPI_CHxCONF.CLKD register field has different limits for the
 OMAP3 then the OMAP24xx. As per recommendation from the linux-omap
 list, added a field for max_clk_div to the platform data for use in 
 omap2_mcspi.c.
 
 Used in a subsequent patch. 
 
 Signed-off-by: Scott Ellis sc...@jumpnowtek.com
 
  arch/arm/mach-omap2/devices.c   |   16 
  arch/arm/plat-omap/include/plat/mcspi.h |1 +
  2 files changed, 17 insertions(+), 0 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
 index 23e4d77..d4ad126 100644
 --- a/arch/arm/mach-omap2/devices.c
 +++ b/arch/arm/mach-omap2/devices.c
 @@ -302,6 +302,11 @@ static inline void omap_init_sti(void) {}
  
  static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
   .num_cs = 4,
 +#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 + .max_clk_div= 0x0c,
 +#else
 + .max_clk_div= 0x0f,
 +#endif
  };
  

Can't do ifdef else like this. It will break multi-omap booting on
omap2 + 3 + 4. In the platform init just set the values once with
cpu_is_omap() instead.

Regards,

Tony
--
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 part1/2 merge v4][PATCH 00/11] omap2/3/4: uart4 fixes + zoom2/3 changes

2010-03-12 Thread Aguirre, Sergio
From: Aguirre, Sergio
Sent: Wednesday, March 10, 2010 6:14 PM
 Hi,
 
 This is v4 of my serial work series merge found here: [1].
 
 And it's meant to be applied on top of Thomas's patch: [2]
 
 Changelog compared to previous version:
  - Changed printk to dev_* macros (Thanks Felipe)
 
 Please let me know your comments and thoughts.
 
 Thanks to:
  - Vikram Pandita
  - Paul Walmsley
  - Kevin Hilman
  - Manjunath Kondaiah
  - Felipe Balbi
 
 For the feedback recieved so far. I really appreciate it.
 
 Regards,
 Sergio

Tony,

Should I take out the new code, and just send you the fixes necessary to boot 
the zoom3, without adding uart4 support?

Or what do you recommend about this patchseries?

Regards,
Sergio

snip

 [1] http://marc.info/?l=linux-omapm=126815136710361w=2
 [2] http://marc.info/?l=linux-kernelm=126709078514087w=2
--
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: [PATCHv2 0/3] Add support for TCA6416 based Keypad driver.

2010-03-12 Thread Tony Lindgren
* Govindarajan, Sriramakrishnan s...@ti.com [100312 03:39]:
 
  Please fix mode - remove +x flags.

 [Sriram] Thanks for pointing out. I will await further review comments
 And post the updated version thereafter

Please fix mode change issue at TI in general.

We're getting these executable mode change patches from TI on regular basis.

Regards,

Tony
--
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 part1/2 merge v4][PATCH 00/11] omap2/3/4: uart4 fixes + zoom2/3 changes

2010-03-12 Thread Tony Lindgren
* Aguirre, Sergio saagui...@ti.com [100312 09:18]:
 From: Aguirre, Sergio
 Sent: Wednesday, March 10, 2010 6:14 PM
  Hi,
  
  This is v4 of my serial work series merge found here: [1].
  
  And it's meant to be applied on top of Thomas's patch: [2]

snip
 
 
 Tony,
 
 Should I take out the new code, and just send you the fixes necessary to boot 
 the zoom3, without adding uart4 support?

Yes please. The series looks good to me, but is also a bit intrusive
for the -rc series :) So please split it into fixes for 2.6.34 -rc,
and new code for 2.6.35 merge window. I got the [2] below already
queued.

Regards,

Tony

 snip
 
  [1] http://marc.info/?l=linux-omapm=126815136710361w=2
  [2] http://marc.info/?l=linux-kernelm=126709078514087w=2
--
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 part1/2 merge v4][PATCH 00/11] omap2/3/4: uart4 fixes + zoom2/3 changes

2010-03-12 Thread Aguirre, Sergio


 -Original Message-
 From: Tony Lindgren [mailto:t...@atomide.com]
 Sent: Friday, March 12, 2010 11:34 AM
 To: Aguirre, Sergio
 Cc: Kevin Hilman; Pandita, Vikram; Paul Walmsley; Felipe Balbi; linux-
 o...@vger.kernel.org
 Subject: Re: [RFC part1/2 merge v4][PATCH 00/11] omap2/3/4: uart4 fixes +
 zoom2/3 changes
 
 * Aguirre, Sergio saagui...@ti.com [100312 09:18]:
  From: Aguirre, Sergio
  Sent: Wednesday, March 10, 2010 6:14 PM
   Hi,
  
   This is v4 of my serial work series merge found here: [1].
  
   And it's meant to be applied on top of Thomas's patch: [2]
 
 snip
 
 
  Tony,
 
  Should I take out the new code, and just send you the fixes necessary to
 boot the zoom3, without adding uart4 support?
 
 Yes please. The series looks good to me, but is also a bit intrusive
 for the -rc series :) So please split it into fixes for 2.6.34 -rc,
 and new code for 2.6.35 merge window. I got the [2] below already
 queued.

Ok, so, I'll just drop patches 4, 5, 6, 7 then test and resend.

Regards,
Sergio

 
 Regards,
 
 Tony
 
  snip
 
   [1] http://marc.info/?l=linux-omapm=126815136710361w=2
   [2] http://marc.info/?l=linux-kernelm=126709078514087w=2
--
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] arm: Fix .gitignore for boot/compressed folder

2010-03-12 Thread Aguirre, Sergio
From: Aguirre, Sergio
Sent: Thursday, February 25, 2010 9:56 AM
 This should complements changes done in:
 
   commit e7db7b4270ed2a606b8c0b5f944a5f92ade0e84c
   Author: Albin Tonnerre albin.tonne...@free-electrons.com
   Date:   Fri Jan 8 14:42:43 2010 -0800
 
   arm: add support for LZO-compressed kernels
 
 It missed to do the respective changes in '.gitignore' file.

Hi,

I did not receive any reply about this patch so far.

- Is it acceptable?
- Should I resend it somewhere else?

Regards,
Sergio

 
 Signed-off-by: Sergio Aguirre saagui...@ti.com
 ---
  arch/arm/boot/compressed/.gitignore |4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)
 
 diff --git a/arch/arm/boot/compressed/.gitignore
 b/arch/arm/boot/compressed/.gitignore
 index ab204db..bb984af 100644
 --- a/arch/arm/boot/compressed/.gitignore
 +++ b/arch/arm/boot/compressed/.gitignore
 @@ -1,3 +1,5 @@
  font.c
 -piggy.gz
 +piggy.gzip
 +piggy.lzo
 +lib1funcs.S
  vmlinux.lds
 --
 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 0/7] omap3: serial code for 3630 and zoom2/3 fixes

2010-03-12 Thread Sergio Aguirre
Hi,

This series contains fixes for omap2/3/4 serial code, and are
fixing:
 - Avoid doing ioremapp of a zero-based physical address.
   (causing a kernel panic during early init on 3630boards)
 - Unproper omap_revision check during uart globals setup.
   (omap_revision is not yet filled at that point)
 - Don't try to enable all uarts generically for zoom2/3
   and 3630sdp.
 - Make zoom2/3 just register one serial port (ttyS0).

This is a subset of the original series found here: [1]

Thanks to:
 - Vikram Pandita
 - Paul Walmsley
 - Kevin Hilman
 - Manjunath Kondaiah
 - Felipe Balbi
 - Tony Lindgreen

For all the feedback recieved so far.

Regards,
Sergio

Sergio Aguirre (7):
  OMAP3: serial: Check for zero-based physical addr
  OMAP3: serial: Use dev_* macros instead of printk
  omap2/3/4: serial: Remove condition for getting uart4_phys
  omap3: zoom2/3 / 3630sdp: Don't init always all uarts
  omap3: 3630sdp: Explicitly enable all UARTs
  omap3: zoom 2/3: Change debugboard serial port id
  omap3: zoom2/3: Register only 1 8250 port

 arch/arm/configs/omap_zoom2_defconfig|2 +-
 arch/arm/configs/omap_zoom3_defconfig|2 +-
 arch/arm/mach-omap2/board-3630sdp.c  |1 +
 arch/arm/mach-omap2/board-zoom-debugboard.c  |2 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |1 -
 arch/arm/mach-omap2/serial.c |   35 +
 6 files changed, 22 insertions(+), 21 deletions(-)

[1] http://marc.info/?l=linux-omapm=126826639903105w=2

--
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 3/7] omap2/3/4: serial: Remove condition for getting uart4_phys

2010-03-12 Thread Sergio Aguirre
This check is invalid, since we haven't filled the
omap_revision var at this point.

Signed-off-by: Sergio Aguirre saagui...@ti.com
---
 arch/arm/mach-omap2/serial.c |   14 +-
 1 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index a55e6ae..3771254 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -115,7 +115,6 @@ static struct plat_serial8250_port serial_platform_data2[] 
= {
}
 };
 
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 static struct plat_serial8250_port serial_platform_data3[] = {
{
.irq= 70,
@@ -128,23 +127,12 @@ static struct plat_serial8250_port 
serial_platform_data3[] = {
}
 };
 
-static inline void omap2_set_globals_uart4(struct omap_globals *omap2_globals)
-{
-   serial_platform_data3[0].mapbase = omap2_globals-uart4_phys;
-}
-#else
-static inline void omap2_set_globals_uart4(struct omap_globals *omap2_globals)
-{
-}
-#endif
-
 void __init omap2_set_globals_uart(struct omap_globals *omap2_globals)
 {
serial_platform_data0[0].mapbase = omap2_globals-uart1_phys;
serial_platform_data1[0].mapbase = omap2_globals-uart2_phys;
serial_platform_data2[0].mapbase = omap2_globals-uart3_phys;
-   if (cpu_is_omap3630() || cpu_is_omap44xx())
-   omap2_set_globals_uart4(omap2_globals);
+   serial_platform_data3[0].mapbase = omap2_globals-uart4_phys;
 }
 
 static inline unsigned int __serial_read_reg(struct uart_port *up,
-- 
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 2/7] OMAP3: serial: Use dev_* macros instead of printk

2010-03-12 Thread Sergio Aguirre
As we have a struct device populated at the time we are
printing the errors, using dev_* macros makes more sense,
as could give a better idea where the error/warning came from.

Signed-off-by: Sergio Aguirre saagui...@ti.com
---
 arch/arm/mach-omap2/serial.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index ef91fc0..a55e6ae 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -550,7 +550,7 @@ static ssize_t sleep_timeout_store(struct device *dev,
unsigned int value;
 
if (sscanf(buf, %u, value) != 1) {
-   printk(KERN_ERR sleep_timeout_store: Invalid value\n);
+   dev_err(dev, sleep_timeout_store: Invalid value\n);
return -EINVAL;
}
 
@@ -666,8 +666,8 @@ void __init omap_serial_early_init(void)
 
/* Don't map zero-based physical address */
if (p-mapbase == 0) {
-   printk(KERN_WARNING omap serial: No physical address
-   for uart#%d, so skipping early_init...\n, i);
+   dev_warn(dev, no physical address for uart#%d,
+ so skipping early_init...\n, i);
continue;
}
/*
@@ -676,21 +676,21 @@ void __init omap_serial_early_init(void)
 */
p-membase = ioremap(p-mapbase, SZ_8K);
if (!p-membase) {
-   printk(KERN_ERR ioremap failed for uart%i\n, i + 1);
+   dev_err(dev, ioremap failed for uart%i\n, i + 1);
continue;
}
 
sprintf(name, uart%d_ick, i + 1);
uart-ick = clk_get(NULL, name);
if (IS_ERR(uart-ick)) {
-   printk(KERN_ERR Could not get uart%d_ick\n, i + 1);
+   dev_err(dev, Could not get uart%d_ick\n, i + 1);
uart-ick = NULL;
}
 
sprintf(name, uart%d_fck, i+1);
uart-fck = clk_get(NULL, name);
if (IS_ERR(uart-fck)) {
-   printk(KERN_ERR Could not get uart%d_fck\n, i + 1);
+   dev_err(dev, Could not get uart%d_fck\n, i + 1);
uart-fck = 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 1/7] OMAP3: serial: Check for zero-based physical addr

2010-03-12 Thread Sergio Aguirre
This is for protecting a wrong mapping attempt of a zero-based
physical address.

The result is that, no serial port will be attempted to be mapped.

Also add an additional protection for NULL clocks before attempting
to enable them (if above condition applies)

Signed-off-by: Sergio Aguirre saagui...@ti.com
---
 arch/arm/mach-omap2/serial.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index da77930..ef91fc0 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -664,6 +664,12 @@ void __init omap_serial_early_init(void)
struct device *dev = pdev-dev;
struct plat_serial8250_port *p = dev-platform_data;
 
+   /* Don't map zero-based physical address */
+   if (p-mapbase == 0) {
+   printk(KERN_WARNING omap serial: No physical address
+   for uart#%d, so skipping early_init...\n, i);
+   continue;
+   }
/*
 * Module 4KB + L4 interconnect 4KB
 * Static mapping, never released
@@ -727,6 +733,13 @@ void __init omap_serial_init_port(int port)
pdev = uart-pdev;
dev = pdev-dev;
 
+   /* Don't proceed if there's no clocks available */
+   if (unlikely(!uart-ick || !uart-fck)) {
+   WARN(1, %s: can't init uart%d, no clocks available\n,
+kobject_name(dev-kobj), port);
+   return;
+   }
+
omap_uart_enable_clocks(uart);
 
omap_uart_reset(uart);
-- 
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 5/7] omap3: 3630sdp: Explicitly enable all UARTs

2010-03-12 Thread Sergio Aguirre
All UARTs seem physically reachable, so, enable them all.

Signed-off-by: Sergio Aguirre saagui...@ti.com
---
 arch/arm/mach-omap2/board-3630sdp.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3630sdp.c 
b/arch/arm/mach-omap2/board-3630sdp.c
index a0a2a11..504d2bd 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -96,6 +96,7 @@ static struct omap_board_mux board_mux[] __initdata = {
 static void __init omap_sdp_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
+   omap_serial_init();
zoom_peripherals_init();
board_smc91x_init();
enable_board_wakeup_source();
-- 
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 4/7] omap3: zoom2/3 / 3630sdp: Don't init always all uarts

2010-03-12 Thread Sergio Aguirre
This is useless, since in Zoom2/3 boards, the ports aren't even
physically accessible.

They must be explicitly initted in the board-zoom2.c, board-zoom3.c
and board-3630sdp.c files instead.

Signed-off-by: Sergio Aguirre saagui...@ti.com
---
 arch/arm/mach-omap2/board-zoom-peripherals.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c 
b/arch/arm/mach-omap2/board-zoom-peripherals.c
index ca95d8d..6b39849 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -280,7 +280,6 @@ static void enable_board_wakeup_source(void)
 void __init zoom_peripherals_init(void)
 {
omap_i2c_init();
-   omap_serial_init();
usb_musb_init(musb_board_data);
enable_board_wakeup_source();
 }
-- 
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 6/7] omap3: zoom 2/3: Change debugboard serial port id

2010-03-12 Thread Sergio Aguirre
This is now changed to PLAT8250_DEV_PLATFORM (= 0), because
it's the only port that's going to be initialized in
Zoom 2/3 boards.

So, it doesn't make sense to keep the hardcoded 3 value anymore.

Signed-off-by: Sergio Aguirre saagui...@ti.com
---
 arch/arm/mach-omap2/board-zoom-debugboard.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c 
b/arch/arm/mach-omap2/board-zoom-debugboard.c
index bb4018b..e15d2e8 100644
--- a/arch/arm/mach-omap2/board-zoom-debugboard.c
+++ b/arch/arm/mach-omap2/board-zoom-debugboard.c
@@ -96,7 +96,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 
 static struct platform_device zoom_debugboard_serial_device = {
.name   = serial8250,
-   .id = 3,
+   .id = PLAT8250_DEV_PLATFORM,
.dev= {
.platform_data  = serial_platform_data,
},
-- 
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 7/7] omap3: zoom2/3: Register only 1 8250 port

2010-03-12 Thread Sergio Aguirre
There's no more serial ports available, so, doesn't make sense
to create 4 device nodes.

Signed-off-by: Sergio Aguirre saagui...@ti.com
---
 arch/arm/configs/omap_zoom2_defconfig |2 +-
 arch/arm/configs/omap_zoom3_defconfig |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/configs/omap_zoom2_defconfig 
b/arch/arm/configs/omap_zoom2_defconfig
index f5c6e11..881faea 100644
--- a/arch/arm/configs/omap_zoom2_defconfig
+++ b/arch/arm/configs/omap_zoom2_defconfig
@@ -661,7 +661,7 @@ CONFIG_DEVKMEM=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=32
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_MANY_PORTS=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
diff --git a/arch/arm/configs/omap_zoom3_defconfig 
b/arch/arm/configs/omap_zoom3_defconfig
index ea9a501..5e55b55 100644
--- a/arch/arm/configs/omap_zoom3_defconfig
+++ b/arch/arm/configs/omap_zoom3_defconfig
@@ -680,7 +680,7 @@ CONFIG_DEVKMEM=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=32
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_MANY_PORTS=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
-- 
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: [PATCHv2 0/3] Add support for TCA6416 based Keypad driver.

2010-03-12 Thread Trilok Soni
Hi,

On Fri, Mar 12, 2010 at 10:59 PM, Tony Lindgren t...@atomide.com wrote:
 * Govindarajan, Sriramakrishnan s...@ti.com [100312 03:39]:

  Please fix mode - remove +x flags.

 [Sriram] Thanks for pointing out. I will await further review comments
 And post the updated version thereafter

 Please fix mode change issue at TI in general.

 We're getting these executable mode change patches from TI on regular basis.


Better way to add checking +x attribute support internally in
checkpatch.pl and let everybody scan through checkpatch.pl before
submitting a patch to ML. It works !!!



-- 
---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: [PATCH 3/4] OMAP3 : clock data: Update name string for EMAC clocks.

2010-03-12 Thread Kevin Hilman
Sriramakrishnan s...@ti.com writes:

 The emac driver uses generic name for the module and phy
 clocks. Updated the omap3xxx_clks table to match the names
 used by the Davinci emac driver.

 Signed-off-by: Sriramakrishnan s...@ti.com
 ---
  arch/arm/mach-omap2/clock3xxx_data.c |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

 diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
 b/arch/arm/mach-omap2/clock3xxx_data.c
 index d5153b6..989da2e 100644
 --- a/arch/arm/mach-omap2/clock3xxx_data.c
 +++ b/arch/arm/mach-omap2/clock3xxx_data.c
 @@ -3472,8 +3472,8 @@ static struct omap_clk omap3xxx_clks[] = {
   CLK(NULL,   ipss_ick, ipss_ick,  CK_AM35XX),
   CLK(NULL,   rmii_ck,  rmii_ck,   CK_AM35XX),
   CLK(NULL,   pclk_ck,  pclk_ck,   CK_AM35XX),
 - CLK(davinci_emac, ick,  emac_ick,  CK_AM35XX),
 - CLK(davinci_emac, fck,  emac_fck,  CK_AM35XX),
 + CLK(davinci_emac, emac_clk, emac_ick,  CK_AM35XX),
 + CLK(davinci_emac, phy_clk,  emac_fck,  CK_AM35XX),

As I mentioned in the review of the equivalent davinci changes,
I'm not crazy abou the _clk suffixes on the con_id.  I think
these should be called main (or emac) and phy.

Kevin
--
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] [I2C-OMAP] Add support for 16-bit registers

2010-03-12 Thread Kevin Hilman
Tony Lindgren t...@atomide.com writes:

 * Kevin Hilman khil...@deeprootsystems.com [100311 08:36]:
 Tony Lindgren t...@atomide.com writes:
 
  Anyways, for the future, considering how critical this driver is
  for all omaps.. And considering how badly this driver needs some
  updates done..
 
  How about we pile up the i2c-omap patches for testing into linux-omap
  branch first, then ask Ben to pull it around -rc6 after we've all
  acked and tested the changes?
 
  Ben does that sound OK to you?
 
 Here's another one to add to omap-testing then.
 
 This one has been submitted to linux-i2c a couple times and been in
 the OMAP PM branch for a while.

 OK, let's add that to omap-testing after we're done with the initial
 fixes. This does not currently apply on top of omap-testing, BTW.

The patch is against v2.6.34-rc1.

Kevin
--
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 03/16] OMAP3: PM: Convert smartreflex driver into a platform driver using hwmods and omap-device layer

2010-03-12 Thread Kevin Hilman
Gopinath, Thara th...@ti.com writes:

-Original Message-
From: Kevin Hilman [mailto:khil...@deeprootsystems.com]
Sent: Tuesday, March 02, 2010 11:58 PM
To: Gopinath, Thara
Cc: linux-omap@vger.kernel.org; p...@pwsan.com; Menon, Nishanth; Cousson, 
Benoit; Sripathy,
Vishwanath; Sawant, Anand
Subject: Re: [PATCH 03/16] OMAP3: PM: Convert smartreflex driver into a 
platform driver using hwmods
and omap-device layer

Thara Gopinath th...@ti.com writes:

 This patch converts the exisitng smartreflex library into a
 platform driver with device , driver registrations using hardware mods.
 As part of this Ntarget values are passed as platform data.

 Signed-off-by: Thara Gopinath th...@ti.com

Nice work Thara.  This is good.  Some minor comments below, but some
general comments first.

As discussed, eventually (longer term) we'll want to move the driver
parts of this to a regulator driver.  To ease that transition, I think
it would be nice to start now by separating the driver portions of
this file from the device portions.

You've already done a good job of keeping them separate in this file
(most of the device stuff is at the end) but I think having a separate
file is probably even better.  Maybe move driver stuff to sr_driver.c
and leave device stuff in smartreflex.c?  I don't care much about the
names at this point.

 Quick question.. If we are going to separate out smartreflex device
 portions from this file , can't we keep them in devices.c instead of
 going for a separate file?

Ultimately, that's Tony's call, but I would prefer to see a separate
specific file for SR device init.

Kevin



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


[PATCHv5 0/2] TWL6040 audio codec initial support

2010-03-12 Thread Olaya, Margarita
Following patch series add initial support for TWL6040 codec driver.
The patch set is based on the series sent from Misael Lopez in October 2009.

Changes from v4:
- Rename twl6030_codec as twl6040_codec
- Rebase the 6 codec patches into a single patch
- Rename twl6040_read as twl6040_read_reg_volatile
- Use msleep instead of large mdelays
- Add more trigger sources
- Restructure set_bias_level function to avoid transitions like PREPARE-ON

Regards,
Margarita
---

Misael Lopez Cruz (1):
  ASoC: TWL6040: Add twl6040 codec driver

Margarita Olaya Cabrera (1):
  OMAP4: PMIC: Rename twl6030_codec as twl6040_codec

 drivers/mfd/twl-core.c |4 +-
 include/linux/i2c/twl.h|6 +-
 sound/soc/codecs/Kconfig   |4 +
 sound/soc/codecs/Makefile  |2 +
 sound/soc/codecs/twl6040.c | 1223 
 sound/soc/codecs/twl6040.h |  141 +
 6 files changed, 1375 insertions(+), 5 deletions(-)
 create mode 100644 sound/soc/codecs/twl6040.c
 create mode 100644 sound/soc/codecs/twl6040.h--
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] OMAP4: PMIC: Rename twl6030_codec as twl6040_codec

2010-03-12 Thread Olaya, Margarita
Signed-off-by: Margarita Olaya Cabrera magi.ol...@ti.com
---
 drivers/mfd/twl-core.c  |4 ++--
 include/linux/i2c/twl.h |6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 562cd49..720e099 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -109,7 +109,7 @@
 #endif
 
 #if defined(CONFIG_TWL4030_CODEC) || defined(CONFIG_TWL4030_CODEC_MODULE) ||\
-   defined(CONFIG_SND_SOC_TWL6030) || 
defined(CONFIG_SND_SOC_TWL6030_MODULE)
+   defined(CONFIG_SND_SOC_TWL6040) || 
defined(CONFIG_SND_SOC_TWL6040_MODULE)
 #define twl_has_codec()true
 #else
 #define twl_has_codec()false
@@ -708,7 +708,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned 
long features)
/* Phoenix*/
if (twl_has_codec()  pdata-codec  twl_class_is_6030()) {
sub_chip_id = twl_map[TWL_MODULE_AUDIO_VOICE].sid;
-   child = add_child(sub_chip_id, twl6030_codec,
+   child = add_child(sub_chip_id, twl6040_codec,
pdata-codec, sizeof(*pdata-codec),
false, 0, 0);
if (IS_ERR(child))
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index fb6784e..ebd90ce 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -569,9 +569,9 @@ struct twl4030_codec_data {
struct twl4030_codec_audio_data *audio;
struct twl4030_codec_vibra_data *vibra;
 
-   /* twl6030 */
-   int audpwron_gpio;  /* audio power-on gpio */
-   int naudint_irq;/* audio interrupt */
+   /* twl6040 */
+   int audpwron_gpio;  /* audio power-on gpio */
+   int naudint_irq;/* audio interrupt */
 };
 
 struct twl4030_platform_data {
-- 
1.6.1.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


[PATCHv5 2/2] ASoC: TWL6040: Add twl6040 codec driver

2010-03-12 Thread Olaya, Margarita
From: Misael Lopez Cruz x0052...@ti.com

Initial version of TWL6040 codec driver.

The TWL6040 codec uses a proprietary PDM-based digital audio interface.
Audio paths supported are:

- Input: Main Mic, Sub Mic, Headset Mic, Auxiliary-FM Left/Right
- Output: Headset Left/Right, Handsfree Left/Right

TWL6040 codec supports power-up/down manual and automatic sequence.
Manual sequence is done through a specific register writes sequence.
Automatic sequence is done when the codec is powered-up through the
external AUDPWRON line. The completion of the sequence is signaled
through the audio interrupt.

TWL6040 codec sysclk can be provided by: low-power or high
performance PLL:

- The low-power PLL takes a low-frequency input at 32,768 Hz and
generates an approximate of 17.64 or 19.2 MHz (for 44.1 KHz and 48 KHz
respectively)

- The high-performance PLL generates an exact 19.2 MHz clock signal
from high-frequency input at 12/19.2/26/38.4 MHz.

Low-power playback mode is a special scenario where only headset path
(headset DAC and driver) is active.

For the particular case of headset path, PLL being used defines the
headset power mode: low-power, high-performance.

Signed-off-by: Misael Lopez Cruz x0052...@ti.com
Signed-off-by: Jorge Eduardo Candelaria jorge.candela...@ti.com
Signed-off-by: Margarita Olaya Cabrera magi.ol...@ti.com
---
 sound/soc/codecs/Kconfig   |4 +
 sound/soc/codecs/Makefile  |2 +
 sound/soc/codecs/twl6040.c | 1223 
 sound/soc/codecs/twl6040.h |  141 +
 4 files changed, 1370 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/codecs/twl6040.c
 create mode 100644 sound/soc/codecs/twl6040.h

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 16c47ed..398cbb0 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -35,6 +35,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_TPA6130A2 if I2C
select SND_SOC_TLV320DAC33 if I2C
select SND_SOC_TWL4030 if TWL4030_CORE
+   select SND_SOC_TWL6040 if TWL4030_CORE
select SND_SOC_UDA134X
select SND_SOC_UDA1380 if I2C
select SND_SOC_WM2000 if I2C
@@ -168,6 +169,9 @@ config SND_SOC_TWL4030
select TWL4030_CODEC
tristate

+config SND_SOC_TWL6040
+   tristate
+
 config SND_SOC_UDA134X
tristate

diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index 6981777..98bd10c 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -22,6 +22,7 @@ snd-soc-tlv320aic26-objs := tlv320aic26.o
 snd-soc-tlv320aic3x-objs := tlv320aic3x.o
 snd-soc-tlv320dac33-objs := tlv320dac33.o
 snd-soc-twl4030-objs := twl4030.o
+snd-soc-twl6040-objs := twl6040.o
 snd-soc-uda134x-objs := uda134x.o
 snd-soc-uda1380-objs := uda1380.o
 snd-soc-wm8350-objs := wm8350.o
@@ -85,6 +86,7 @@ obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o
 obj-$(CONFIG_SND_SOC_TLV320AIC3X)  += snd-soc-tlv320aic3x.o
 obj-$(CONFIG_SND_SOC_TLV320DAC33)  += snd-soc-tlv320dac33.o
 obj-$(CONFIG_SND_SOC_TWL4030)  += snd-soc-twl4030.o
+obj-$(CONFIG_SND_SOC_TWL6040)  += snd-soc-twl6040.o
 obj-$(CONFIG_SND_SOC_UDA134X)  += snd-soc-uda134x.o
 obj-$(CONFIG_SND_SOC_UDA1380)  += snd-soc-uda1380.o
 obj-$(CONFIG_SND_SOC_WM8350)   += snd-soc-wm8350.o
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
new file mode 100644
index 000..54835cc
--- /dev/null
+++ b/sound/soc/codecs/twl6040.c
@@ -0,0 +1,1223 @@
+/*
+ * ALSA SoC TWL6040 codec driver
+ *
+ * Author:  Misael Lopez Cruz x0052...@ti.com
+ *
+ * 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.
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include linux/module.h
+#include linux/moduleparam.h
+#include linux/init.h
+#include linux/delay.h
+#include linux/pm.h
+#include linux/i2c.h
+#include linux/gpio.h
+#include linux/platform_device.h
+#include linux/i2c/twl.h
+
+#include sound/core.h
+#include sound/pcm.h
+#include sound/pcm_params.h
+#include sound/soc.h
+#include sound/soc-dapm.h
+#include sound/initval.h
+#include sound/tlv.h
+
+#include twl6040.h
+
+#define TWL6040_RATES   (SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
+#define TWL6040_FORMATS (SNDRV_PCM_FMTBIT_S32_LE)
+
+/* codec private data */
+struct twl6040_data {
+   struct snd_soc_codec codec;
+   int audpwron;
+   int naudint;
+   int codec_powered;
+   int pll;
+   int