Re: beagleboardxm 2.6.39rc4 mcbsp problems.

2011-05-16 Thread Jarkko Nikula
Hi

On Mon, 16 May 2011 11:07:40 -0700
Steve Calfee  wrote:

> On 05/16/11 01:54, Peter Ujfalusi wrote:
> > On Saturday 14 May 2011 05:47:33 Steve Calfee wrote:
> >> I put in a few debug statements. It appears that my DMA never gets
> >> started. I know it can work with a different machine and codec driver,
> >> but not mine. I don't see any explicit DMA init, but that must be the
> >> problem.  Any more ideas?
> > 
> > You mean neither omap_pcm_hw_params nor omap_pcm_trigger got called?
> > Could you post the output of dmesg related to ASoC? Does the connection 
> > between the CPU and codec DAI correct?
> > Does McBSP part got initialized (for example does omap_mcbsp_dai_hw_params, 
> > omap_mcbsp_dai_trigger got called)?
> > 
> No, they get called. I just don't get the clock on the bclk pin.
> 
> I think I have the mcbsp1 set up correctly - I explictly set the MUX:
> 
> static struct omap_board_mux board_mux[] __initdata = {
> #if 1
>   /* McBSP 1 */
>   OMAP3_MUX(MCBSP1_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
>   OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
>   OMAP3_MUX(MCBSP1_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
>   OMAP3_MUX(MCBSP1_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> #endif
>   { .reg_offset = OMAP_MUX_TERMINATOR },
> };
> 
Did you try to run OMAP as an I2S master like what omap3pandora.c is
doing?

Missing clock in codec master configuration suggests that reason
is in codec side and reversed roles during development makes easier to
hunt it further as then OMAP can play data out independently of is the
codec correctly configured or not.

You could run OMAP as a master by specifying SND_SOC_DAIFMT_CBS_CFS
as a DAI format for both codec and OMAP and by setting McBSP to use
internal 96 MHz clock as a master clock. Something like below might work
for testing purposes:

snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLKS_FCLK,
   9600, SND_SOC_CLOCK_IN);

snd_soc_dai_set_clkdiv(cpu_dai, OMAP_MCBSP_CLKGDV,
   62); /* 96M / 48k*32 */

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


[PATCH 2/2] OMAP4: Add device for HDMI OMAP4 audio for ASoC machine driver

2011-05-16 Thread Ricardo Neri
This device is used by the OMAP4 HDMI audio machine driver to register the
HDMI sound card.

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

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 56e2e98..6add0d2 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -300,6 +300,14 @@ static struct platform_device omap_pcm = {
 };
 
 /*
+ * Device for the ASoC OMAP4 HDMI machine driver
+ */
+static struct platform_device omap4_hdmi_audio = {
+   .name   = "omap4-hdmi-audio",
+   .id = -1,
+};
+
+/*
  * OMAP2420 has 2 McBSP ports
  * OMAP2430 has 5 McBSP ports
  * OMAP3 has 5 McBSP ports
@@ -327,6 +335,8 @@ static void omap_init_audio(void)
NULL, 0, false);
WARN(IS_ERR(od_hdmi), "%s: could not build omap_device for 
%s\n",
__func__, dev_hdmi_name);
+
+   platform_device_register(&omap4_hdmi_audio);
}
 
platform_device_register(&omap_mcbsp1);
-- 
1.7.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 1/2] OMAP4: HDMI: Add OMAP device for HDMI audio CPU DAI

2011-05-16 Thread Ricardo Neri
Add device for HDMI audio. This device uses hwmod data from
dss_hdmi. This device is to be used by the ASoC HDMI CPU DAI to
obtain base memory address and DMA request number.

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

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 7b85585..56e2e98 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -313,6 +313,22 @@ OMAP_MCBSP_PLATFORM_DEVICE(5);
 
 static void omap_init_audio(void)
 {
+   struct omap_hwmod *oh_hdmi;
+   struct omap_device *od_hdmi;
+   char *oh_hdmi_name = "dss_hdmi";
+   char *dev_hdmi_name = "hdmi-audio-dai";
+
+   if (cpu_is_omap44xx()) {
+   oh_hdmi = omap_hwmod_lookup(oh_hdmi_name);
+   WARN(!oh_hdmi, "%s: could not find omap_hwmod for %s\n",
+   __func__, oh_hdmi_name);
+
+   od_hdmi = omap_device_build(dev_hdmi_name, -1, oh_hdmi, NULL, 0,
+   NULL, 0, false);
+   WARN(IS_ERR(od_hdmi), "%s: could not build omap_device for 
%s\n",
+   __func__, dev_hdmi_name);
+   }
+
platform_device_register(&omap_mcbsp1);
platform_device_register(&omap_mcbsp2);
if (cpu_is_omap243x() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
-- 
1.7.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 0/2] OMAP4: Add devices for HDMI audio

2011-05-16 Thread Ricardo Neri
The addition of two new audio devices is proposed. These two devices are
needed for the ASoC CPU and machine drivers for HDMI audio on
OMAP4.

Implementation of ASoC HDMI audio drivers can be found here:
 http://mailman.alsa-project.org/pipermail/alsa-devel/2011-May/039758.html

Implementation of DSS patches to support HDMI audio can be found here:
 http://www.mail-archive.com/linux-omap@vger.kernel.org/msg49011.html

This implementation is based on on:
* OMAP4: DSS2: Add dss_dss_clk opt clock for OMAP4, by Sumit Semwal
 
(http://gitorious.org/linux-omap-dss2/linux/commit/0da5637569bb9bf93e6930cd1c3b452eede50ba2)
* Kernel 2.6.39-rc7
 (git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 
v2.6.39-rc7)
 
The complete implementation, with devices, DSS and ASoC parts, is available at:
 git://gitorious.org/omap-audio/linux-audio.git ricardon/topic/hdmi-audio-v2
 
Validation was performed on HDMI TV. Penguins were present on the display
and audio playback was performed with aplay at 32, 44.1 and 48kHz with S16_LE
and S24_LE sample formats. Validation was performed on SDP4430 ES2.1 and ES2.2
and Panda ES2.1 and ES2.0.

Ricardo Neri (2):
  OMAP4: HDMI: Add OMAP device for HDMI audio CPU DAI
  OMAP4: Add device for HDMI OMAP4 audio for ASoC machine driver

 arch/arm/mach-omap2/devices.c |   26 ++
 1 files changed, 26 insertions(+), 0 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


[RESEND/PATCH 2/2] arm: Kconfig: allow OMAP to use sparse IRQ numbering

2011-05-16 Thread Felipe Balbi
Select HAVE_SPARSE_IRQ to allow OMAP to use
sparse IRQ numbering scheme. The main difference
is that irq_descs will be added to a radix tree
instead of a static array.

Signed-off-by: Felipe Balbi 
---
 arch/arm/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 416b02f..d5e2571 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -861,6 +861,7 @@ config ARCH_DAVINCI
 config ARCH_OMAP
bool "TI OMAP"
select HAVE_CLK
+   select HAVE_SPARSE_IRQ
select ARCH_REQUIRE_GPIOLIB
select ARCH_HAS_CPUFREQ
select GENERIC_CLOCKEVENTS
-- 
1.7.4.1.343.ga91df

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


[RESEND/PATCH 1/2] arm: Kconfig: select correct HAVE_SPARSE_IRQ symbol

2011-05-16 Thread Felipe Balbi
commit e2a93ecc7fc469dab52323c11a2d8ceaa62aac7b
(ARM: Use genirq definitions from kernel/irq/Kconfig)
made ARM Kconfig use the generic Kconfig symbols from
kernel/irq/Kconfig but did not fix the boards which
were using the older symbols, fix them.

Signed-off-by: Felipe Balbi 
---
 arch/arm/Kconfig |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 377a7a5..416b02f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -541,7 +541,7 @@ config ARCH_MMP
select HAVE_SCHED_CLOCK
select TICK_ONESHOT
select PLAT_PXA
-   select SPARSE_IRQ
+   select HAVE_SPARSE_IRQ
help
  Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
 
@@ -622,7 +622,7 @@ config ARCH_PXA
select HAVE_SCHED_CLOCK
select TICK_ONESHOT
select PLAT_PXA
-   select SPARSE_IRQ
+   select HAVE_SPARSE_IRQ
help
  Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
 
-- 
1.7.4.1.343.ga91df

--
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: beagleboardxm 2.6.39rc4 mcbsp problems.

2011-05-16 Thread Steve Calfee
On 05/16/11 01:54, Peter Ujfalusi wrote:
> On Saturday 14 May 2011 05:47:33 Steve Calfee wrote:
>> I put in a few debug statements. It appears that my DMA never gets
>> started. I know it can work with a different machine and codec driver,
>> but not mine. I don't see any explicit DMA init, but that must be the
>> problem.  Any more ideas?
> 
> You mean neither omap_pcm_hw_params nor omap_pcm_trigger got called?
> Could you post the output of dmesg related to ASoC? Does the connection 
> between the CPU and codec DAI correct?
> Does McBSP part got initialized (for example does omap_mcbsp_dai_hw_params, 
> omap_mcbsp_dai_trigger got called)?
> 
No, they get called. I just don't get the clock on the bclk pin.

I think I have the mcbsp1 set up correctly - I explictly set the MUX:

static struct omap_board_mux board_mux[] __initdata = {
#if 1
/* McBSP 1 */
OMAP3_MUX(MCBSP1_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
OMAP3_MUX(MCBSP1_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
OMAP3_MUX(MCBSP1_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
#endif
{ .reg_offset = OMAP_MUX_TERMINATOR },
};

And elsewhere I set the mcbsp to use a 4 pin interface:
/* configure mcbsp1 to just use 4 pins */
ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_CLKR_SRC_CLKX, 0,
SND_SOC_CLOCK_IN);
if (ret < 0) {
printk(KERN_ERR "can't set CPU system clock 
OMAP_MCBSP_CLKR_SRC_CLKX\n");
//return ret;
}

ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_FSR_SRC_FSX, 0,
SND_SOC_CLOCK_IN);
if (ret < 0) {
printk(KERN_ERR "can't set CPU system clock 
OMAP_MCBSP_FSR_SRC_FSX\n");
//return ret;
}


Here is some hopefully relevant console output. Note that where I added
debug printk's I also printed the __func__.

# cat /proc/asound/cards
 0 [bbxm   ]:  - bbxm
  bbxm
# lsmod
Module  Size  Used byNot tainted
snd_soc_max98095   26314  1
snd_soc_omap3beaglexm 4818  0
snd_soc_omap_mcbsp  7148  1
gpio_i2cmux 1699  0
i2c_mux 1408  1 gpio_i2cmux
# aplay /newmail2.wav
[  262.129882] omap_mcbsp_dai_startup: omap-mcbsp-dai.0 bus_id=0 active 0
[  262.137847] omap-mcbsp omap-mcbsp.1: omap_mcbsp_request:
tx_irq_completion t=59 r=60
[  262.146972] omap_mcbsp_dai_startup: rules omap-mcbsp-dai.0 bus_id=0
active 0
[  262.155090] omap_pcm_open: ret 1
[  262.158752] asoc: HiFi <-> omap-mcbsp-dai.0 info:
[  262.163757] asoc: rate mask 0x7fe
[  262.167327] asoc: min ch 1 max ch 2
[  262.170989] asoc: min rate 8000 max rate 96000
Playing WAVE '/newmail2.wav' : Signed 16 bit Little Endian, Rate 8000
Hz, Stereo
[  262.188537] bbxm_hw_params: codec_dai=dfbb9ac0 clk 12288000
[  262.194519] bbxm_hw_params 2: codec_dai=dfbb9ac0 clk 12288000
[  262.200683] omap_mcbsp_dai_set_dai_fmt: configured 0
[  262.205932] bbxm_hw_params 3: codec_dai=dfbb9ac0 clk 12288000
[  262.212036] omap_mcbsp_dai_set_dai_sysclk: mcbsp_data=bf00d5f8 in_freq 0
[  262.219116] omap_mcbsp_dai_set_dai_sysclk: mcbsp_data=bf00d5f8 in_freq 0
[  262.227752] max98095 4-0010: read 2a => 90
[  262.234832] max98095 4-0010: read 27 => 1
[  262.240875] max98095 4-0010: read 2a => 90
[  262.245300] max98095 4-0010: write 28 = 7
[  262.252044] max98095 4-0010: write 29 = 8f
[  262.261779] max98095 4-0010: read 2e => 0
[  262.266265] omap_mcbsp_dai_hw_params: format 1
[  262.270996] omap_mcbsp_dai_hw_params: stream Audio Playback
[  262.276977] omap-mcbsp omap-mcbsp.1: Configuring McBSP1  phys_base:
0x48074000
[  262.284606] omap_pcm_hw_params: ret 0
[  262.290008] omap_pcm_prepare: dma_data bf00d4e0
[  262.298980] max98095 4-0010: read 91 => 0
[  262.303558] max98095 4-0010: write 91 = 3
[  262.311798] max98095 4-0010: read 91 => 3
[  262.316345] max98095 4-0010: write 91 = c3
[  262.326690] snd_pcm_lib_write1: state 2 size 1000
[  262.332031] snd_pcm_lib_write1: offset 0
[  262.336181] snd_pcm_update_state: stream=0 avail=3000
buffer_size=4000 twake=0 tsleep=1
[  262.345825] snd_pcm_lib_write1: state 2 size 1000
[  262.351165] snd_pcm_lib_write1: offset 0
[  262.355346] snd_pcm_update_state: stream=0 avail=2000
buffer_size=4000 twake=0 tsleep=1
[  262.364929] snd_pcm_lib_write1: state 2 size 1000
[  262.370269] snd_pcm_lib_write1: offset 0
[  262.374420] snd_pcm_update_state: stream=0 avail=1000
buffer_size=4000 twake=0 tsleep=1
[  262.383972] snd_pcm_lib_write1: state 2 size 1000
[  262.389312] snd_pcm_lib_write1: offset 0
[  262.393463] snd_pcm_pre_start: state 3
[  262.397399] snd_pcm_do_start: state 3
[  262.401245] omap_pcm_trigger: cmd 1
[  262.404907] omap_start_dma: lch 0
[  262.408843] omap-mcbsp omap-mcbsp.1:  McBSP1 regs 
[  262.414581] omap-mcbsp omap-mcbsp.1: DRR2:  0x
[  262.419616] omap-mcbsp omap-mcbsp.1: DRR1:  0x
[  262.424652] omap-m

[PATCH 13/19] clocksource: convert OMAP1 to 32-bit down counting clocksource

2011-05-16 Thread Russell King - ARM Linux
Convert the OMAP1 32-bit down counting clocksource to the generic
clocksource infrastructure.

Tested-by: Tony Lindgren 
Cc: linux-omap@vger.kernel.org
Signed-off-by: Russell King 
---
 arch/arm/mach-omap1/time.c |   23 ++-
 arch/arm/plat-omap/Kconfig |1 +
 2 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index e7ab616..03e1e10 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -190,24 +190,11 @@ static __init void omap_init_mpu_timer(unsigned long rate)
  * ---
  */
 
-static cycle_t mpu_read(struct clocksource *cs)
-{
-   return ~omap_mpu_timer_read(1);
-}
-
-static struct clocksource clocksource_mpu = {
-   .name   = "mpu_timer2",
-   .rating = 300,
-   .read   = mpu_read,
-   .mask   = CLOCKSOURCE_MASK(32),
-   .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
 static DEFINE_CLOCK_DATA(cd);
 
 static inline unsigned long long notrace _omap_mpu_sched_clock(void)
 {
-   u32 cyc = mpu_read(&clocksource_mpu);
+   u32 cyc = ~omap_mpu_timer_read(1);
return cyc_to_sched_clock(&cd, cyc, (u32)~0);
 }
 
@@ -225,20 +212,22 @@ static unsigned long long notrace 
omap_mpu_sched_clock(void)
 
 static void notrace mpu_update_sched_clock(void)
 {
-   u32 cyc = mpu_read(&clocksource_mpu);
+   u32 cyc = ~omap_mpu_timer_read(1);
update_sched_clock(&cd, cyc, (u32)~0);
 }
 
 static void __init omap_init_clocksource(unsigned long rate)
 {
+   omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(1);
static char err[] __initdata = KERN_ERR
"%s: can't register clocksource!\n";
 
omap_mpu_timer_start(1, ~0, 1);
init_sched_clock(&cd, mpu_update_sched_clock, 32, rate);
 
-   if (clocksource_register_hz(&clocksource_mpu, rate))
-   printk(err, clocksource_mpu.name);
+   if (clocksource_mmio_init(&timer->read_tim, "mpu_timer2", rate,
+   300, 32, clocksource_mmio_readl_down))
+   printk(err, "mpu_timer2");
 }
 
 static void __init omap_mpu_timer_init(void)
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index cd5f993..e9c0efc 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -12,6 +12,7 @@ choice
 config ARCH_OMAP1
bool "TI OMAP1"
select CLKDEV_LOOKUP
+   select CLKSRC_MMIO
help
  "Systems based on omap7xx, omap15xx or omap16xx"
 
-- 
1.7.4.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 06/19] clocksource: add common mmio clocksource

2011-05-16 Thread Russell King - ARM Linux
Add a generic mmio clocksource, covering both 32-bit and 16-bit register
access sizes, for up or down counters.  This can be used to easily
create clocksources for simple counter-based implementations.

Cc: Alessandro Rubini 
Cc: Colin Cross 
Cc: Eric Miao 
Cc: Erik Gilling 
Acked-by: "Hans J. Koch" 
Cc: Imre Kaloz 
Cc: Krzysztof Halasa 
Cc: Kukjin Kim 
Cc: Lennert Buytenhek 
Cc: Linus Walleij 
Cc: linux-omap@vger.kernel.org
Acked-by: Nicolas Pitre 
Cc: Olof Johansson 
Tested-by: Sascha Hauer 
Reviewed-by: Thomas Gleixner 
Tested-by: Tony Lindgren 
Reviewed-by: Viresh Kumar 
Cc: Wan ZongShun 
Signed-off-by: Russell King 
---
 drivers/Kconfig  |3 ++
 drivers/clocksource/Kconfig  |2 +
 drivers/clocksource/Makefile |1 +
 drivers/clocksource/mmio.c   |   73 ++
 include/linux/clocksource.h  |8 
 5 files changed, 87 insertions(+), 0 deletions(-)
 create mode 100644 drivers/clocksource/Kconfig
 create mode 100644 drivers/clocksource/mmio.c

diff --git a/drivers/Kconfig b/drivers/Kconfig
index 177c7d1..557a469 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -119,4 +119,7 @@ source "drivers/platform/Kconfig"
 source "drivers/clk/Kconfig"
 
 source "drivers/hwspinlock/Kconfig"
+
+source "drivers/clocksource/Kconfig"
+
 endmenu
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
new file mode 100644
index 000..47f37b1
--- /dev/null
+++ b/drivers/clocksource/Kconfig
@@ -0,0 +1,2 @@
+config CLKSRC_MMIO
+   bool
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index be61ece..9b2ba29 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -6,3 +6,4 @@ obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC)+= cs5535-clockevt.o
 obj-$(CONFIG_SH_TIMER_CMT) += sh_cmt.o
 obj-$(CONFIG_SH_TIMER_MTU2)+= sh_mtu2.o
 obj-$(CONFIG_SH_TIMER_TMU) += sh_tmu.o
+obj-$(CONFIG_CLKSRC_MMIO)  += mmio.o
diff --git a/drivers/clocksource/mmio.c b/drivers/clocksource/mmio.c
new file mode 100644
index 000..c0e2512
--- /dev/null
+++ b/drivers/clocksource/mmio.c
@@ -0,0 +1,73 @@
+/*
+ * Generic MMIO clocksource support
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include 
+#include 
+#include 
+#include 
+
+struct clocksource_mmio {
+   void __iomem *reg;
+   struct clocksource clksrc;
+};
+
+static inline struct clocksource_mmio *to_mmio_clksrc(struct clocksource *c)
+{
+   return container_of(c, struct clocksource_mmio, clksrc);
+}
+
+cycle_t clocksource_mmio_readl_up(struct clocksource *c)
+{
+   return readl_relaxed(to_mmio_clksrc(c)->reg);
+}
+
+cycle_t clocksource_mmio_readl_down(struct clocksource *c)
+{
+   return ~readl_relaxed(to_mmio_clksrc(c)->reg);
+}
+
+cycle_t clocksource_mmio_readw_up(struct clocksource *c)
+{
+   return readw_relaxed(to_mmio_clksrc(c)->reg);
+}
+
+cycle_t clocksource_mmio_readw_down(struct clocksource *c)
+{
+   return ~(unsigned)readw_relaxed(to_mmio_clksrc(c)->reg);
+}
+
+/**
+ * clocksource_mmio_init - Initialize a simple mmio based clocksource
+ * @base:  Virtual address of the clock readout register
+ * @name:  Name of the clocksource
+ * @hz:Frequency of the clocksource in Hz
+ * @rating:Rating of the clocksource
+ * @bits:  Number of valid bits
+ * @read:  One of clocksource_mmio_read*() above
+ */
+int __init clocksource_mmio_init(void __iomem *base, const char *name,
+   unsigned long hz, int rating, unsigned bits,
+   cycle_t (*read)(struct clocksource *))
+{
+   struct clocksource_mmio *cs;
+
+   if (bits > 32 || bits < 16)
+   return -EINVAL;
+
+   cs = kzalloc(sizeof(struct clocksource_mmio), GFP_KERNEL);
+   if (!cs)
+   return -ENOMEM;
+
+   cs->reg = base;
+   cs->clksrc.name = name;
+   cs->clksrc.rating = rating;
+   cs->clksrc.read = read;
+   cs->clksrc.mask = CLOCKSOURCE_MASK(bits);
+   cs->clksrc.flags = CLOCK_SOURCE_IS_CONTINUOUS;
+
+   return clocksource_register_hz(&cs->clksrc, hz);
+}
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 94c1f38..a3558fd 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -341,4 +341,12 @@ static inline void update_vsyscall_tz(void)
 
 extern void timekeeping_notify(struct clocksource *clock);
 
+extern cycle_t clocksource_mmio_readl_up(struct clocksource *);
+extern cycle_t clocksource_mmio_readl_down(struct clocksource *);
+extern cycle_t clocksource_mmio_readw_up(struct clocksource *);
+extern cycle_t clocksource_mmio_readw_down(struct clocksource *);
+
+extern int clocksource_mmio_init(void __iomem *, const char *,
+   unsigned long, int, unsigned, cycle_t (*)(struct clocksource *));
+
 #endif /* _LINUX_CLOCKSOURCE_H */
-- 
1.7.4.4

--
To unsubscribe from

[PATCH 04/19] ARM: omap1: convert to using readl/writel instead of volatile struct

2011-05-16 Thread Russell King - ARM Linux
Tested-by: Tony Lindgren 
Cc: linux-omap@vger.kernel.org
Signed-off-by: Russell King 
---
 arch/arm/mach-omap1/time.c |   31 ---
 1 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index e2c29b4..e7ab616 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -68,49 +68,50 @@ typedef struct {
 } omap_mpu_timer_regs_t;
 
 #define omap_mpu_timer_base(n) 
\
-((volatile omap_mpu_timer_regs_t*)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE +   
\
+((omap_mpu_timer_regs_t __iomem *)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE +   
\
 (n)*OMAP_MPU_TIMER_OFFSET))
 
 static inline unsigned long notrace omap_mpu_timer_read(int nr)
 {
-   volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
-   return timer->read_tim;
+   omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr);
+   return readl(&timer->read_tim);
 }
 
 static inline void omap_mpu_set_autoreset(int nr)
 {
-   volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
+   omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr);
 
-   timer->cntl = timer->cntl | MPU_TIMER_AR;
+   writel(readl(&timer->cntl) | MPU_TIMER_AR, &timer->cntl);
 }
 
 static inline void omap_mpu_remove_autoreset(int nr)
 {
-   volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
+   omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr);
 
-   timer->cntl = timer->cntl & ~MPU_TIMER_AR;
+   writel(readl(&timer->cntl) & ~MPU_TIMER_AR, &timer->cntl);
 }
 
 static inline void omap_mpu_timer_start(int nr, unsigned long load_val,
int autoreset)
 {
-   volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
-   unsigned int timerflags = (MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_ST);
+   omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr);
+   unsigned int timerflags = MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_ST;
 
-   if (autoreset) timerflags |= MPU_TIMER_AR;
+   if (autoreset)
+   timerflags |= MPU_TIMER_AR;
 
-   timer->cntl = MPU_TIMER_CLOCK_ENABLE;
+   writel(MPU_TIMER_CLOCK_ENABLE, &timer->cntl);
udelay(1);
-   timer->load_tim = load_val;
+   writel(load_val, &timer->load_tim);
 udelay(1);
-   timer->cntl = timerflags;
+   writel(timerflags, &timer->cntl);
 }
 
 static inline void omap_mpu_timer_stop(int nr)
 {
-   volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
+   omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr);
 
-   timer->cntl &= ~MPU_TIMER_ST;
+   writel(readl(&timer->cntl) & ~MPU_TIMER_ST, &timer->cntl);
 }
 
 /*
-- 
1.7.4.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 03/19] ARM: omap1: delete useless interrupt handler

2011-05-16 Thread Russell King - ARM Linux
The OMAP1 clocksource interrupt handler just increments a variable
which otherwise isn't used, so this seems to be unnecessary.  Tony
Lindgren confirms, so lets remove it.

Acked-by: Kevin Hilman 
Acked-by: Tony Lindgren 
Cc: linux-omap@vger.kernel.org
Signed-off-by: Russell King 
---
 arch/arm/mach-omap1/time.c |   15 ---
 1 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 6885d2f..e2c29b4 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -189,20 +189,6 @@ static __init void omap_init_mpu_timer(unsigned long rate)
  * ---
  */
 
-static unsigned long omap_mpu_timer2_overflows;
-
-static irqreturn_t omap_mpu_timer2_interrupt(int irq, void *dev_id)
-{
-   omap_mpu_timer2_overflows++;
-   return IRQ_HANDLED;
-}
-
-static struct irqaction omap_mpu_timer2_irq = {
-   .name   = "mpu_timer2",
-   .flags  = IRQF_DISABLED,
-   .handler= omap_mpu_timer2_interrupt,
-};
-
 static cycle_t mpu_read(struct clocksource *cs)
 {
return ~omap_mpu_timer_read(1);
@@ -247,7 +233,6 @@ static void __init omap_init_clocksource(unsigned long rate)
static char err[] __initdata = KERN_ERR
"%s: can't register clocksource!\n";
 
-   setup_irq(INT_TIMER2, &omap_mpu_timer2_irq);
omap_mpu_timer_start(1, ~0, 1);
init_sched_clock(&cd, mpu_update_sched_clock, 32, rate);
 
-- 
1.7.4.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 01/19] Make clocksource name const

2011-05-16 Thread Russell King - ARM Linux
As nothing should be writing to the clocksource name string, make the
clocksource name pointer const.  Build-tested on ARM Versatile Express.

Cc: Alessandro Rubini 
Cc: Colin Cross 
Cc: Eric Miao 
Cc: Erik Gilling 
Cc: "Hans J. Koch" 
Cc: Imre Kaloz 
Cc: Krzysztof Halasa 
Cc: Kukjin Kim 
Cc: Lennert Buytenhek 
Cc: Linus Walleij 
Cc: linux-omap@vger.kernel.org
Cc: Nicolas Pitre 
Cc: Olof Johansson 
Cc: Sascha Hauer 
Cc: Tony Lindgren 
Cc: Viresh Kumar 
Cc: Wan ZongShun 
Signed-off-by: Russell King 
---
 include/linux/clocksource.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index c37b21a..94c1f38 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -161,7 +161,7 @@ struct clocksource {
/*
 * First part of structure is read mostly
 */
-   char *name;
+   const char *name;
struct list_head list;
int rating;
cycle_t (*read)(struct clocksource *cs);
-- 
1.7.4.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 v2 00/19] Consolidate simple ARM MMIO clock sources

2011-05-16 Thread Russell King - ARM Linux
This is a re-posting of the clocksource patches, which includes some
other updates.  This includes bcmring in the update.

In a similar light to the i8253 series, this consolidates 17 ARM
MMIO counter clocksources into a single common implementation.  This
common implementation caters for 32-bit and 16-bit register access
sizes, up and down counters, and various bit sizes of those counters.

Patch 1 is already in John Stultz tree, but is included for
completeness and to get rid of a build warning.

 arch/arm/Kconfig |   15 ++
 arch/arm/common/timer-sp.c   |   80 +++
 arch/arm/include/asm/hardware/timer-sp.h |4 +-
 arch/arm/mach-bcmring/core.c |  220 +++---
 arch/arm/mach-integrator/Kconfig |1 +
 arch/arm/mach-integrator/integrator_ap.c |   21 +---
 arch/arm/mach-integrator/integrator_cp.c |   11 ++-
 arch/arm/mach-ixp4xx/common.c|   16 +--
 arch/arm/mach-lpc32xx/timer.c|   17 +--
 arch/arm/mach-mxs/timer.c|   20 +--
 arch/arm/mach-netx/time.c|   16 +--
 arch/arm/mach-omap1/time.c   |   69 +++---
 arch/arm/mach-pxa/time.c |   17 +--
 arch/arm/mach-realview/core.c|   13 ++-
 arch/arm/mach-sa1100/time.c  |   24 +---
 arch/arm/mach-tcc8k/time.c   |   16 +--
 arch/arm/mach-tegra/timer.c  |   16 +--
 arch/arm/mach-u300/timer.c   |   18 +--
 arch/arm/mach-versatile/core.c   |   13 ++-
 arch/arm/mach-vexpress/ct-ca9x4.c|   17 ++-
 arch/arm/mach-vexpress/v2m.c |   17 ++-
 arch/arm/mach-w90x900/time.c |   17 +--
 arch/arm/plat-mxc/epit.c |   18 +--
 arch/arm/plat-mxc/time.c |   38 +
 arch/arm/plat-nomadik/Kconfig|1 +
 arch/arm/plat-nomadik/timer.c|   31 +
 arch/arm/plat-omap/Kconfig   |1 +
 arch/arm/plat-orion/time.c   |   21 +---
 arch/arm/plat-s5p/s5p-time.c |   58 +++--
 arch/arm/plat-spear/time.c   |   16 +--
 drivers/Kconfig  |3 +
 drivers/clocksource/Kconfig  |2 +
 drivers/clocksource/Makefile |1 +
 drivers/clocksource/mmio.c   |   73 ++
 include/linux/clocksource.h  |   10 ++-
 35 files changed, 354 insertions(+), 577 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


Re: [PATCH v2] ARM: omap4: i2c reset regs postidle

2011-05-16 Thread Cousson, Benoit

Hi Jan,

On 5/16/2011 11:18 AM, Jan Weitzel wrote:

Without OMAP_I2C_FLAG_RESET_REGS_POSTIDLE I got i2c controller
timeouts on each accsess after an NACK message.
Taking this flag fix it.

This patch is on top of the i2c feature implementation flags
patches


Could you please give us more information and potentially provide a link 
to the patches you are referring to?

It will help us assessing the need for such flag in the hwmod data.

Please note that the changelog will stay forever in the GIT tree, so you 
should avoid using "the patch" or making reference to something that is 
not an existing commit id or email archive.

You should fix as well the typo.

Thanks,
Benoit

--
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/2] [RFC] Shrink clock data utilizing preprocessor

2011-05-16 Thread Vladimir Zapolskiy
Hi Sascha,

On Mon, May 16, 2011 at 10:56 AM, Sascha Hauer  wrote:
> Hi Vladimir,
>
> On Mon, May 16, 2011 at 12:45:56AM +0300, Vladimir Zapolskiy wrote:
>> This change shows a possibility to utilize C preprocessor to remove
>> redundant data from clock definitions for OMAP4 architecture.
>>
>> If the change is evaluated as a positive one, the same approach could
>> be applied in reducing LOCs from other files, which contain monotonous
>> data enumeration.
>>
>> Vladimir Zapolskiy (2):
>>   OMAP4: clock data: shrink clock data utilizing preprocessor.
>>   OMAP4: clock data: shrink more clock data.
>>
>>  arch/arm/mach-omap2/clock44xx_data.c | 3313 
>> +-
>>  1 files changed, 848 insertions(+), 2465 deletions(-)
>
> While the diffstat shows a huge saving in loc I suggest to delay this
> until we have common clock code merged so that we don't have to
> completely rework these files again in the near future.
>
> This has been said before, I just wanted to add my +1 on this opinion.

no objections from my side, the proposed change is deliberately marked
as RFC, and I've decided to resend the patches just to show them publicly
and to gather more comments.

Best wishes,
Vladimir
--
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] omap: Remove support for omap2evm (Re: Updated mach-types update)

2011-05-16 Thread Liam Girdwood
On 13/05/11 15:40, Tony Lindgren wrote:
> * Jarkko Nikula  [110513 05:15]:
>> On Fri, 13 May 2011 04:54:07 -0700
>> Tony Lindgren  wrote:
>>
>>> * Tony Lindgren  [110324 10:57]:
 * Russell King - ARM Linux  [110320 04:39]:
> On Sun, Mar 20, 2011 at 11:03:22AM +, Russell King - ARM Linux wrote:
>
> Note that OMAP references machine_is_omap2evm() yet this has never been
> merged.
>
> arch/arm/plat-omap/include/plat/uncompress.h:
>
> DEBUG_LL_OMAP2(1, omap2evm);
>
> so this entry needs to be removed.

 Hmm looks like we have LCD support and ASoC support for it, but no
 board :)

 Anybody working with this board?

 If so, please send patches for the related board-*.c support ASAP.
 Otherwise let's plan on deleting the related support.
>>>
>>> No patches, so let's remove it. Here's the patch to do that,
>>> I'm planning to add this to my devel-cleanup branch.
>>>
>> Remove also from sound/soc/omap/Kconfig as well. You could put my
>> ack for sound/soc/omap part but remember cc also Mark and Liam.
> 
> Thanks, here's the updated patch.
> 
> Regards,
> 
> Tony
> 
> 
> From: Tony Lindgren 
> Date: Fri, 13 May 2011 04:41:32 -0700
> Subject: [PATCH] omap: Remove support for omap2evm
> 
> The board support has never been merged for it as noticed
> by Russell King . So let's remove the
> related dead code.
> 
> Cc: linux-fb...@vger.kernel.org
> Cc: alsa-de...@alsa-project.org
> Cc: Mark Brown 
> Cc: Liam Girdwood 
> Cc: Paul Mundt 
> Cc: Tomi Valkeinen 
> Acked-by: Jarkko Nikula 
> Signed-off-by: Tony Lindgren 
> 

Acked-by: Liam Girdwood 
--
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: USB-ehci enumeration issue

2011-05-16 Thread Felipe Balbi
Hi,

On Sun, May 15, 2011 at 06:21:31PM +0530, ABRAHAM, KISHON VIJAY wrote:
> > > Does anyone else observe this issue?
> >
> > could be the regulators problem. Can you try with my hci branch ?
> >
> > git://gitorious.org/usb/usb.git hci
> >
> 
>saw the issue even in this tree/branch.

Keshava ? Do you have any patch fixing this ?

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] arm: omap3: cm-t3517: fix section mismatch warning

2011-05-16 Thread Igor Grinberg
ping x3


It has been 3 weeks already...


On 05/11/11 10:37, Igor Grinberg wrote:

> ping x2
>
>
> Can this one get into .39?
>
>
> On 05/03/11 18:30, Igor Grinberg wrote:
>
>> ping!
>>
>> Just to make sure you haven't missed this one liner ;)
>>
>>
>> On 04/26/11 23:41, Igor Grinberg wrote:
>>> WARNING: arch/arm/mach-omap2/built-in.o(.text+0x11014): Section mismatch
>>> in reference from the function cm_t3517_init_usbh() to the (unknown
>>> reference) .init.data:(unknown)
>>> The function cm_t3517_init_usbh() references
>>> the (unknown reference) __initdata (unknown).
>>> This is often because cm_t3517_init_usbh lacks a __initdata
>>> annotation or the annotation of (unknown) is wrong.
>>>
>>> Signed-off-by: Igor Grinberg 
>>> ---
>>>  arch/arm/mach-omap2/board-cm-t3517.c |2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-omap2/board-cm-t3517.c 
>>> b/arch/arm/mach-omap2/board-cm-t3517.c
>>> index a27e3ee..802cb60 100644
>>> --- a/arch/arm/mach-omap2/board-cm-t3517.c
>>> +++ b/arch/arm/mach-omap2/board-cm-t3517.c
>>> @@ -178,7 +178,7 @@ static struct usbhs_omap_board_data cm_t3517_ehci_pdata 
>>> __initdata = {
>>> .reset_gpio_port[2]  = -EINVAL,
>>>  };
>>>  
>>> -static int cm_t3517_init_usbh(void)
>>> +static int __init cm_t3517_init_usbh(void)
>>>  {
>>> int err;
>>>  

-- 
Regards,
Igor.

--
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: [RESEND][PATCH 0/5] arm: omap: usb: Runtime PM support for EHCI and OHCI drivers

2011-05-16 Thread Munegowda, Keshava
On Mon, May 16, 2011 at 3:03 PM, Keshava Munegowda
 wrote:
> From: Keshava Munegowda 
>
> The Hwmod structures and Runtime PM features are implemented
> For EHCI and OHCI drivers of OMAP3 and OMAP4.
> The global suspend/resume of EHCI and OHCI
> is validated on OMAP3430 sdp board with these patches.
>
> Keshava Munegowda (5):
>  arm: omap: usb: ehci and ohci hwmod structures for omap3 and omap4
>  arm: omap: usb: register hwmods of usbhs
>  arm: omap: usb: device name change for the clk names of usbhs
>  arm: omap: usb: Runtime PM support
>  arm: omap: usb: global Suspend and resume support of ehci and ohci
>
>  arch/arm/mach-omap2/clock3xxx_data.c       |   28 ++--
>  arch/arm/mach-omap2/clock44xx_data.c       |   10 +-
>  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  184 ++
>  arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  153 ++
>  arch/arm/mach-omap2/usb-host.c             |   99 
>  drivers/mfd/omap-usb-host.c                |  236 
> +---
>  6 files changed, 504 insertions(+), 206 deletions(-)
>

balbi

need your decision (ACK / review comments) on this series too.


Regards
Keshava
--
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 v1] mfd: Fix omap_usbhs_alloc_children error handling

2011-05-16 Thread Felipe Balbi
On Mon, May 16, 2011 at 05:54:07PM +0530, Keshava Munegowda wrote:
> From: Axel Lin 
> 
> rebased on top of hwmod and runtime pm patch series of usbhs
> 
> Signed-off-by: Axel Lin 
> Tested-by: Keshava Munegowda 

Acked-by: Felipe Balbi 

> ---
>  drivers/mfd/omap-usb-host.c |4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
> index e1bc3b5..32d19e2 100644
> --- a/drivers/mfd/omap-usb-host.c
> +++ b/drivers/mfd/omap-usb-host.c
> @@ -282,6 +282,7 @@ static int omap_usbhs_alloc_children(struct 
> platform_device *pdev)
>  
>   if (!ehci) {
>   dev_err(dev, "omap_usbhs_alloc_child failed\n");
> + ret = -ENOMEM;
>   goto err_end;
>   }
>  
> @@ -305,13 +306,14 @@ static int omap_usbhs_alloc_children(struct 
> platform_device *pdev)
>   sizeof(*ohci_data), dev);
>   if (!ohci) {
>   dev_err(dev, "omap_usbhs_alloc_child failed\n");
> + ret = -ENOMEM;
>   goto err_ehci;
>   }
>  
>   return 0;
>  
>  err_ehci:
> - platform_device_put(ehci);
> + platform_device_unregister(ehci);
>  
>  err_end:
>   return ret;
> -- 
> 1.6.0.4
> 

-- 
balbi


signature.asc
Description: Digital signature


[PATCH v1] mfd: Fix omap_usbhs_alloc_children error handling

2011-05-16 Thread Keshava Munegowda
From: Axel Lin 

rebased on top of hwmod and runtime pm patch series of usbhs

Signed-off-by: Axel Lin 
Tested-by: Keshava Munegowda 
---
 drivers/mfd/omap-usb-host.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index e1bc3b5..32d19e2 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -282,6 +282,7 @@ static int omap_usbhs_alloc_children(struct platform_device 
*pdev)
 
if (!ehci) {
dev_err(dev, "omap_usbhs_alloc_child failed\n");
+   ret = -ENOMEM;
goto err_end;
}
 
@@ -305,13 +306,14 @@ static int omap_usbhs_alloc_children(struct 
platform_device *pdev)
sizeof(*ohci_data), dev);
if (!ohci) {
dev_err(dev, "omap_usbhs_alloc_child failed\n");
+   ret = -ENOMEM;
goto err_ehci;
}
 
return 0;
 
 err_ehci:
-   platform_device_put(ehci);
+   platform_device_unregister(ehci);
 
 err_end:
return ret;
-- 
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: [RFC PATCHv4 0/7] HSI framework and drivers

2011-05-16 Thread Linus Walleij
On Thu, May 12, 2011 at 2:17 PM, Govindraj  wrote:
> On Tue, Mar 22, 2011 at 3:20 PM, Carlos Chinea  
> wrote:
>> Hi,
>>
>> On Mon, 2011-03-21 at 09:16 +0100, ext Linus Walleij wrote:
>>> 2010/12/14 Carlos Chinea :
>>>
>>> > Here you have the fourth round of the HSI framework patches.
>>>
>>> I'd like to notify that this out-of-tree framework is also in use for
>>> the ST-Ericsson
>>> Ux500s, and we've had great success with it. You can add my:
>>>
>>> Acked-by: Linus Walleij 
>>>
>>
>
> Hi Carlos,
>
> Will you posting a next version of HSI framework.
>
> I am planning to adapt omap-hsi driver to this framework.

I was sort of asking the same thing.

I expected this to be queued up for 2.6.40 so we don't proliferate
out-of-tree drivers :-(

If Nokia will not pursue this patch set then tell me and Govindraj
and we can surely take it over.

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


[GIT PULL] Two omap fixes for v2.6.39-rc7

2011-05-16 Thread Tony Lindgren
Hi Linus,

Please pull two omap fixes from:

git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git 
omap-fixes-for-linus

This contains one iommu regression fix and one clock fix.

Regards,

Tony


The following changes since commit 693d92a1bbc9e42681c42ed190bd42b636ca876f:
  Linus Torvalds (1):
Linux 2.6.39-rc7

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git 
omap-fixes-for-linus

Avinash H.M (1):
  OMAP3: set the core dpll clk rate in its set_rate function

Laurent Pinchart (1):
  omap: iommu: Return IRQ_HANDLED in fault handler when no fault occured

 arch/arm/mach-omap2/clkt34xx_dpll3m2.c |1 +
 arch/arm/plat-omap/iommu.c |2 ++
 2 files changed, 3 insertions(+), 0 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 06/10] OMAP: GPIO: Use USHRT_MAX for rev offset instead of -1

2011-05-16 Thread Tarun Kanti DebBarma
From: Charulatha V 

Use USHRT_MAX for revision offset instead of -1 if revision register
is not available for a given SoC since rev offset is a u16 value.

Signed-off-by: Charulatha V 
Cc: Santosh Shilimkar 
Cc: Kevin Hilman 
Cc: Tony Lindgren 
---
 arch/arm/mach-omap1/gpio15xx.c |2 +-
 arch/arm/mach-omap1/gpio16xx.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap1/gpio15xx.c b/arch/arm/mach-omap1/gpio15xx.c
index 7a15f69..f18a4a9 100644
--- a/arch/arm/mach-omap1/gpio15xx.c
+++ b/arch/arm/mach-omap1/gpio15xx.c
@@ -77,7 +77,7 @@ static struct __initdata resource omap15xx_gpio_resources[] = 
{
 };
 
 static struct omap_gpio_reg_offs omap15xx_gpio_regs = {
-   .revision   = -1,
+   .revision   = USHRT_MAX,
.direction  = OMAP1510_GPIO_DIR_CONTROL,
.datain = OMAP1510_GPIO_DATA_INPUT,
.dataout= OMAP1510_GPIO_DATA_OUTPUT,
diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
index 43718ec..d886b88 100644
--- a/arch/arm/mach-omap1/gpio16xx.c
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -38,7 +38,7 @@ static struct __initdata resource 
omap16xx_mpu_gpio_resources[] = {
 };
 
 static struct omap_gpio_reg_offs omap16xx_mpuio_regs = {
-   .revision   = -1,
+   .revision   = USHRT_MAX,
.direction  = OMAP_MPUIO_IO_CNTL,
.datain = OMAP_MPUIO_INPUT_LATCH,
.dataout= OMAP_MPUIO_OUTPUT,
-- 
1.7.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


[RFC PATCH 01/10] OMAP: GPIO: Avoid cpu_is checks during module ena/disable

2011-05-16 Thread Tarun Kanti DebBarma
From: Charulatha V 

Remove cpu-is checks while enabling/disabling OMAP GPIO module
during a gpio request/free.

Signed-off-by: Charulatha V 
Cc: Santosh Shilimkar 
Cc: Kevin Hilman 
Cc: Tony Lindgren 
---
 arch/arm/mach-omap1/gpio15xx.c |2 +
 arch/arm/mach-omap1/gpio16xx.c |2 +
 arch/arm/mach-omap1/gpio7xx.c  |2 +
 arch/arm/mach-omap2/gpio.c |2 +
 arch/arm/plat-omap/gpio.c  |   53 ++--
 arch/arm/plat-omap/include/plat/gpio.h |1 +
 6 files changed, 32 insertions(+), 30 deletions(-)

diff --git a/arch/arm/mach-omap1/gpio15xx.c b/arch/arm/mach-omap1/gpio15xx.c
index 96a24bf..c3caf25 100644
--- a/arch/arm/mach-omap1/gpio15xx.c
+++ b/arch/arm/mach-omap1/gpio15xx.c
@@ -42,6 +42,7 @@ static struct omap_gpio_reg_offs omap15xx_mpuio_regs = {
.irqstatus  = OMAP_MPUIO_GPIO_INT,
.irqenable  = OMAP_MPUIO_GPIO_MASKIT,
.irqenable_inv  = true,
+   .ctrl   = USHRT_MAX,
 };
 
 static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = {
@@ -83,6 +84,7 @@ static struct omap_gpio_reg_offs omap15xx_gpio_regs = {
.irqstatus  = OMAP1510_GPIO_INT_STATUS,
.irqenable  = OMAP1510_GPIO_INT_MASK,
.irqenable_inv  = true,
+   .ctrl   = USHRT_MAX,
 };
 
 static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = {
diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
index 6cbfc70..f62eaf3 100644
--- a/arch/arm/mach-omap1/gpio16xx.c
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -45,6 +45,7 @@ static struct omap_gpio_reg_offs omap16xx_mpuio_regs = {
.irqstatus  = OMAP_MPUIO_GPIO_INT,
.irqenable  = OMAP_MPUIO_GPIO_MASKIT,
.irqenable_inv  = true,
+   .ctrl   = USHRT_MAX,
 };
 
 static struct __initdata omap_gpio_platform_data omap16xx_mpu_gpio_config = {
@@ -89,6 +90,7 @@ static struct omap_gpio_reg_offs omap16xx_gpio_regs = {
.irqenable  = OMAP1610_GPIO_IRQENABLE1,
.set_irqenable  = OMAP1610_GPIO_SET_IRQENABLE1,
.clr_irqenable  = OMAP1610_GPIO_CLEAR_IRQENABLE1,
+   .ctrl   = USHRT_MAX,
 };
 
 static struct __initdata omap_gpio_platform_data omap16xx_gpio1_config = {
diff --git a/arch/arm/mach-omap1/gpio7xx.c b/arch/arm/mach-omap1/gpio7xx.c
index d7f2ad3..0fc2557 100644
--- a/arch/arm/mach-omap1/gpio7xx.c
+++ b/arch/arm/mach-omap1/gpio7xx.c
@@ -47,6 +47,7 @@ static struct omap_gpio_reg_offs omap7xx_mpuio_regs = {
.irqstatus  = OMAP_MPUIO_GPIO_INT / 2,
.irqenable  = OMAP_MPUIO_GPIO_MASKIT / 2,
.irqenable_inv  = true,
+   .ctrl   = USHRT_MAX,
 };
 
 static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = {
@@ -88,6 +89,7 @@ static struct omap_gpio_reg_offs omap7xx_gpio_regs = {
.irqstatus  = OMAP7XX_GPIO_INT_STATUS,
.irqenable  = OMAP7XX_GPIO_INT_MASK,
.irqenable_inv  = true,
+   .ctrl   = USHRT_MAX,
 };
 
 static struct __initdata omap_gpio_platform_data omap7xx_gpio1_config = {
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 9a46d77..0446bd1 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -84,6 +84,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
pdata->regs->clr_irqenable = OMAP24XX_GPIO_CLEARIRQENABLE1;
pdata->regs->debounce = OMAP24XX_GPIO_DEBOUNCE_VAL;
pdata->regs->debounce_en = OMAP24XX_GPIO_DEBOUNCE_EN;
+   pdata->regs->ctrl = OMAP24XX_GPIO_CTRL;
break;
case 2:
pdata->bank_type = METHOD_GPIO_44XX;
@@ -100,6 +101,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
pdata->regs->clr_irqenable = OMAP4_GPIO_IRQSTATUSCLR0;
pdata->regs->debounce = OMAP4_GPIO_DEBOUNCINGTIME;
pdata->regs->debounce_en = OMAP4_GPIO_DEBOUNCENABLE;
+   pdata->regs->ctrl = OMAP4_GPIO_CTRL;
break;
default:
WARN(1, "Invalid gpio bank_type\n");
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 16980bb..65f9cbc 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -91,6 +91,7 @@ int gpio_bank_count;
 
 #define GPIO_INDEX(bank, gpio) (gpio % bank->width)
 #define GPIO_BIT(bank, gpio) (1 << GPIO_INDEX(bank, gpio))
+#define GPIO_MOD_CTRL_BIT  BIT(0)
 
 static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
 {
@@ -588,22 +589,18 @@ static int omap_gpio_request(struct gpio_chip *chip, 
unsigned offset)
__raw_writel(__raw_readl(reg) | (1 << offset), reg);
}
 #endif
-   if (!cpu_class_is_omap1()) {
-   if (!bank->mod_usage) {
-   void __iomem *reg = bank->base;
-   u32 ctrl;
-
-   if (cpu_is_omap

[RFC PATCH 10/10] OMAP: GPIO: remove harcoded offsets in context save and restore

2011-05-16 Thread Tarun Kanti DebBarma
We don't have to use hard-coded offsets any more in context save and
restore functions and instead use the generic offsets whcih have been
correctly initialized during device registration.

Signed-off-by: Tarun Kanti DebBarma 
Cc: Charulatha V 
Cc: Santosh Shilimkar 
Cc: Kevin Hilman 
Cc: Tony Lindgren 
---
 arch/arm/mach-omap2/gpio.c |2 +
 arch/arm/plat-omap/gpio.c  |   40 
 arch/arm/plat-omap/include/plat/gpio.h |1 +
 3 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 0f8782f..5c888dd 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -106,6 +106,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
pdata->regs->irqstatus = OMAP24XX_GPIO_IRQSTATUS1;
pdata->regs->irqstatus2 = OMAP24XX_GPIO_IRQSTATUS2;
pdata->regs->irqenable = OMAP24XX_GPIO_IRQENABLE1;
+   pdata->regs->irqenable2 = OMAP24XX_GPIO_IRQENABLE2;
pdata->regs->set_irqenable = OMAP24XX_GPIO_SETIRQENABLE1;
pdata->regs->clr_irqenable = OMAP24XX_GPIO_CLEARIRQENABLE1;
pdata->regs->debounce = OMAP24XX_GPIO_DEBOUNCE_VAL;
@@ -130,6 +131,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
pdata->regs->irqstatus = OMAP4_GPIO_IRQSTATUS0;
pdata->regs->irqstatus2 = OMAP4_GPIO_IRQSTATUS1;
pdata->regs->irqenable = OMAP4_GPIO_IRQSTATUSSET0;
+   pdata->regs->irqenable2 = OMAP4_GPIO_IRQSTATUSSET1;
pdata->regs->set_irqenable = OMAP4_GPIO_IRQSTATUSSET0;
pdata->regs->clr_irqenable = OMAP4_GPIO_IRQSTATUSCLR0;
pdata->regs->debounce = OMAP4_GPIO_DEBOUNCINGTIME;
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 3d34461..171a1ce 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1400,25 +1400,25 @@ void omap_gpio_save_context(void)
continue;
 
gpio_context[i].irqenable1 =
-   __raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE1);
+   __raw_readl(bank->base + bank->regs->irqenable);
gpio_context[i].irqenable2 =
-   __raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE2);
+   __raw_readl(bank->base + bank->regs->irqenable2);
gpio_context[i].wake_en =
-   __raw_readl(bank->base + OMAP24XX_GPIO_WAKE_EN);
+   __raw_readl(bank->base + bank->regs->wkupstatus);
gpio_context[i].ctrl =
-   __raw_readl(bank->base + OMAP24XX_GPIO_CTRL);
+   __raw_readl(bank->base + bank->regs->ctrl);
gpio_context[i].oe =
-   __raw_readl(bank->base + OMAP24XX_GPIO_OE);
+   __raw_readl(bank->base + bank->regs->direction);
gpio_context[i].leveldetect0 =
-   __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0);
+   __raw_readl(bank->base + bank->regs->leveldetect0);
gpio_context[i].leveldetect1 =
-   __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1);
+   __raw_readl(bank->base + bank->regs->leveldetect1);
gpio_context[i].risingdetect =
-   __raw_readl(bank->base + OMAP24XX_GPIO_RISINGDETECT);
+   __raw_readl(bank->base + bank->regs->risingdetect);
gpio_context[i].fallingdetect =
-   __raw_readl(bank->base + OMAP24XX_GPIO_FALLINGDETECT);
+   __raw_readl(bank->base + bank->regs->fallingdetect);
gpio_context[i].dataout =
-   __raw_readl(bank->base + OMAP24XX_GPIO_DATAOUT);
+   __raw_readl(bank->base + bank->regs->dataout);
}
 }
 
@@ -1435,25 +1435,25 @@ void omap_gpio_restore_context(void)
continue;
 
__raw_writel(gpio_context[i].irqenable1,
-   bank->base + OMAP24XX_GPIO_IRQENABLE1);
+   bank->base + bank->regs->irqenable);
__raw_writel(gpio_context[i].irqenable2,
-   bank->base + OMAP24XX_GPIO_IRQENABLE2);
+   bank->base + bank->regs->irqenable2);
__raw_writel(gpio_context[i].wake_en,
-   bank->base + OMAP24XX_GPIO_WAKE_EN);
+   bank->base + bank->regs->wkupstatus);
__raw_writel(gpio_context[i].ctrl,
-   bank->base + OMAP24XX_GPIO_CTRL);
+   bank->base + bank->regs->ctrl);
__raw_writel(gpio_context[i].oe,
-   bank->base

[RFC PATCH 05/10] OMAP2PLUS: GPIO: Use flag to identify wkup dmn GPIO

2011-05-16 Thread Tarun Kanti DebBarma
From: Charulatha V 

In omap3, save/restore context is implemented for GPIO
banks 2-6 as GPIO bank1 is in wakeup domain. Instead
of identifying bank's power domain by bank id, make use
of a flag "loses_context" which is filled by
pwrdm_can_ever_lose_context() during dev_init.

For getting the powerdomain pointer, omap_hwmod_get_pwrdm()
is used. omap_device_get_pwrdm() could not be used as the
pwrdm information needs to be filled in pdata, whereas
omap_device_get_pwrdm() could be used only after
omap_device_build() call.

Signed-off-by: Charulatha V 
Cc: Santosh Shilimkar 
Cc: Kevin Hilman 
Cc: Tony Lindgren 
---
 arch/arm/mach-omap2/gpio.c |7 +++
 arch/arm/plat-omap/gpio.c  |   12 ++--
 arch/arm/plat-omap/include/plat/gpio.h |1 +
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 487b49a..0782e06 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -24,6 +24,8 @@
 #include 
 #include 
 
+#include "powerdomain.h"
+
 static struct omap_device_pm_latency omap_gpio_latency[] = {
[0] = {
.deactivate_func = omap_device_idle_hwmods,
@@ -39,6 +41,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
struct omap_gpio_dev_attr *dev_attr;
char *name = "omap_gpio";
int id;
+   struct powerdomain *pwrdm;
 
/*
 * extract the device id from name field available in the
@@ -131,6 +134,10 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
kfree(pdata);
return -EINVAL;
}
+
+   pwrdm = omap_hwmod_get_pwrdm(oh);
+   pdata->loses_context = pwrdm_can_ever_lose_context(pwrdm);
+
od = omap_device_build(name, id - 1, oh, pdata,
sizeof(*pdata), omap_gpio_latency,
ARRAY_SIZE(omap_gpio_latency),
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 0b76475..0ebeaaa 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -58,6 +58,7 @@ struct gpio_bank {
u32 dbck_enable_mask;
struct device *dev;
bool dbck_flag;
+   bool loses_context;
int stride;
u32 width;
u16 id;
@@ -1166,6 +1167,7 @@ static int __devinit omap_gpio_probe(struct 
platform_device *pdev)
bank->stride = pdata->bank_stride;
bank->width = pdata->bank_width;
bank->non_wakeup_gpios = pdata->non_wakeup_gpios;
+   bank->loses_context = pdata->loses_context;
 
bank->regs = pdata->regs;
 
@@ -1331,8 +1333,7 @@ void omap2_gpio_prepare_for_idle(int off_mode)
u32 l1 = 0, l2 = 0;
int j;
 
-   /* TODO: Do not use cpu_is_omap34xx */
-   if ((cpu_is_omap34xx()) && (bank->id == 0))
+   if (!bank->loses_context)
continue;
 
for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
@@ -1399,8 +1400,7 @@ void omap2_gpio_resume_after_idle(void)
u32 l = 0, gen, gen0, gen1;
int j;
 
-   /* TODO: Do not use cpu_is_omap34xx */
-   if ((cpu_is_omap34xx()) && (bank->id == 0))
+   if (!bank->loses_context)
continue;
 
for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
@@ -1501,7 +1501,7 @@ void omap_gpio_save_context(void)
list_for_each_entry(bank, &omap_gpio_list, node) {
i++;
 
-   if (bank->id == 0)
+   if (!bank->loses_context)
continue;
 
gpio_context[i].irqenable1 =
@@ -1536,7 +1536,7 @@ void omap_gpio_restore_context(void)
list_for_each_entry(bank, &omap_gpio_list, node) {
i++;
 
-   if (bank->id == 0)
+   if (!bank->loses_context)
continue;
 
__raw_writel(gpio_context[i].irqenable1,
diff --git a/arch/arm/plat-omap/include/plat/gpio.h 
b/arch/arm/plat-omap/include/plat/gpio.h
index ad9e668..64b1ee7 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -199,6 +199,7 @@ struct omap_gpio_platform_data {
int bank_width; /* GPIO bank width */
int bank_stride;/* Only needed for omap1 MPUIO */
bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
+   bool loses_context; /* whether the bank would ever lose context */
u32 non_wakeup_gpios;
 
struct omap_gpio_reg_offs *regs;
-- 
1.7.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


[RFC PATCH 09/10] OMAP: GPIO: cleanup omap_gpio_free and triggering functions

2011-05-16 Thread Tarun Kanti DebBarma
We can get rid of ifdef / if checks of OMAP revision in 
set_24xx_gpio_triggering()
and omap_gpio_free().

Signed-off-by: Tarun Kanti DebBarma 
Cc: Charulatha V 
Cc: Santosh Shilimkar 
Cc: Kevin Hilman 
Cc: Tony Lindgren 
---
 arch/arm/plat-omap/gpio.c |   38 --
 1 files changed, 8 insertions(+), 30 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 714626a..bc07559 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -269,15 +269,9 @@ static inline void set_24xx_gpio_triggering(struct 
gpio_bank *bank, int gpio,
bank->enabled_non_wakeup_gpios &= ~gpio_bit;
}
 
-   if (cpu_is_omap44xx()) {
-   bank->level_mask =
-   __raw_readl(bank->base + OMAP4_GPIO_LEVELDETECT0) |
-   __raw_readl(bank->base + OMAP4_GPIO_LEVELDETECT1);
-   } else {
-   bank->level_mask =
-   __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0) |
-   __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1);
-   }
+   bank->level_mask =
+   __raw_readl(bank->base + bank->regs->leveldetect0) |
+   __raw_readl(bank->base + bank->regs->leveldetect1);
 }
 #endif
 
@@ -609,29 +603,13 @@ static void omap_gpio_free(struct gpio_chip *chip, 
unsigned offset)
 {
struct gpio_bank *bank = container_of(chip, struct gpio_bank, chip);
unsigned long flags;
+   void __iomem *reg;
 
spin_lock_irqsave(&bank->lock, flags);
-#ifdef CONFIG_ARCH_OMAP16XX
-   if (bank->method == METHOD_GPIO_1610) {
-   /* Disable wake-up during idle for dynamic tick */
-   void __iomem *reg = bank->base + OMAP1610_GPIO_CLEAR_WAKEUPENA;
-   __raw_writel(1 << offset, reg);
-   }
-#endif
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-   if (bank->method == METHOD_GPIO_24XX) {
-   /* Disable wake-up during idle for dynamic tick */
-   void __iomem *reg = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
-   __raw_writel(1 << offset, reg);
-   }
-#endif
-#ifdef CONFIG_ARCH_OMAP4
-   if (bank->method == METHOD_GPIO_44XX) {
-   /* Disable wake-up during idle for dynamic tick */
-   void __iomem *reg = bank->base + OMAP4_GPIO_IRQWAKEN0;
-   __raw_writel(1 << offset, reg);
-   }
-#endif
+   /* Disable wake-up during idle for dynamic tick */
+   reg = bank->base + bank->regs->wkupclear;
+
+   __raw_writel(1 << offset, reg);
bank->mod_usage &= ~(1 << offset);
 
if ((bank->regs->ctrl != USHRT_MAX) && (!bank->mod_usage)) {
-- 
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 07/10] OMAP: GPIO: cleanup suspend and resume functions

2011-05-16 Thread Tarun Kanti DebBarma
Since wake_status, wake_clear, wake_set is common for all banks on a given
OMAP version it is enough to get their values once during probe().
Also, register offsets are already initialzed according to OMAP versions
during device registration. We no longer need these explicit checks.

Signed-off-by: Tarun Kanti DebBarma 
Cc: Charulatha V 
Cc: Santosh Shilimkar 
Cc: Kevin Hilman 
Cc: Tony Lindgren 
---
 arch/arm/mach-omap1/gpio16xx.c |3 +
 arch/arm/mach-omap2/gpio.c |6 +++
 arch/arm/plat-omap/gpio.c  |   78 +++
 arch/arm/plat-omap/include/plat/gpio.h |3 +
 4 files changed, 30 insertions(+), 60 deletions(-)

diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
index d886b88..bc4cc8f 100644
--- a/arch/arm/mach-omap1/gpio16xx.c
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -46,6 +46,9 @@ static struct omap_gpio_reg_offs omap16xx_mpuio_regs = {
.irqenable  = OMAP_MPUIO_GPIO_MASKIT,
.irqenable_inv  = true,
.ctrl   = USHRT_MAX,
+   .wkupstatus = OMAP1610_GPIO_WAKEUPENABLE,
+   .wkupclear  = OMAP1610_GPIO_CLEAR_WAKEUPENA,
+   .wkupset= OMAP1610_GPIO_SET_WAKEUPENA,
 };
 
 static struct __initdata omap_gpio_platform_data omap16xx_mpu_gpio_config = {
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 0782e06..7e7 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -111,6 +111,9 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
pdata->regs->debounce = OMAP24XX_GPIO_DEBOUNCE_VAL;
pdata->regs->debounce_en = OMAP24XX_GPIO_DEBOUNCE_EN;
pdata->regs->ctrl = OMAP24XX_GPIO_CTRL;
+   pdata->regs->wkupstatus = OMAP24XX_GPIO_WAKE_EN;
+   pdata->regs->wkupclear = OMAP24XX_GPIO_CLEARWKUENA;
+   pdata->regs->wkupset = OMAP24XX_GPIO_SETWKUENA;
break;
case 3:
pdata->bank_type = METHOD_GPIO_44XX;
@@ -128,6 +131,9 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
pdata->regs->debounce = OMAP4_GPIO_DEBOUNCINGTIME;
pdata->regs->debounce_en = OMAP4_GPIO_DEBOUNCENABLE;
pdata->regs->ctrl = OMAP4_GPIO_CTRL;
+   pdata->regs->wkupstatus = OMAP4_GPIO_IRQWAKEN0;
+   pdata->regs->wkupclear = OMAP4_GPIO_IRQWAKEN0;
+   pdata->regs->wkupset = OMAP4_GPIO_IRQWAKEN0;
break;
default:
WARN(1, "Invalid gpio bank_type\n");
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 0ebeaaa..b04688d 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -62,6 +62,9 @@ struct gpio_bank {
int stride;
u32 width;
u16 id;
+   void __iomem *wake_status;
+   void __iomem *wake_clear;
+   void __iomem *wake_set;
 
void (*set_dataout)(struct gpio_bank *bank, int gpio, int enable);
 
@@ -1195,6 +1198,15 @@ static int __devinit omap_gpio_probe(struct 
platform_device *pdev)
goto err_free;
}
 
+   /*
+* Storing these addresses avoids redundant computation of these
+* values every time in suspend/resume functions and for all the
+* gpio banks.
+*/
+   bank->wake_status = bank->base + bank->regs->wkupstatus;
+   bank->wake_clear = bank->base + bank->regs->wkupclear;
+   bank->wake_set = bank->base + bank->regs->wkupset;
+
pm_runtime_enable(bank->dev);
pm_runtime_get_sync(bank->dev);
 
@@ -1214,7 +1226,7 @@ err_exit:
 }
 
 #if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
-static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)
+static int omap_gpio_suspend(struct sys_device *dev, pm_message_t unused)
 {
struct gpio_bank *bank;
 
@@ -1222,41 +1234,12 @@ static int omap_gpio_suspend(struct sys_device *dev, 
pm_message_t mesg)
return 0;
 
list_for_each_entry(bank, &omap_gpio_list, node) {
-   void __iomem *wake_status;
-   void __iomem *wake_clear;
-   void __iomem *wake_set;
unsigned long flags;
 
-   switch (bank->method) {
-#ifdef CONFIG_ARCH_OMAP16XX
-   case METHOD_GPIO_1610:
-   wake_status = bank->base + OMAP1610_GPIO_WAKEUPENABLE;
-   wake_clear = bank->base + OMAP1610_GPIO_CLEAR_WAKEUPENA;
-   wake_set = bank->base + OMAP1610_GPIO_SET_WAKEUPENA;
-   break;
-#endif
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-   case METHOD_GPIO_24XX:
-   wake_status = bank->base + OMAP24XX_GPIO_WAKE_EN;
-   wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
-   wake_set = bank->base + OMAP24XX_GPIO_SETWKUENA;
-   

[RFC PATCH 08/10] OMAP: GPIO: cleanup prepare-for and resume-after idle functions

2011-05-16 Thread Tarun Kanti DebBarma
By adding level and edge detection register offsets and then initializing them
correctly according to OMAP versions during device registrations we can now 
remove
lot of revision checks in these functions.

Signed-off-by: Tarun Kanti DebBarma 
Cc: Charulatha V 
Cc: Santosh Shilimkar 
Cc: Kevin Hilman 
Cc: Tony Lindgren 
---
 arch/arm/mach-omap2/gpio.c |8 +++
 arch/arm/plat-omap/gpio.c  |   91 
 arch/arm/plat-omap/include/plat/gpio.h |4 ++
 3 files changed, 35 insertions(+), 68 deletions(-)

diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 7e7..0f8782f 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -111,6 +111,10 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
pdata->regs->debounce = OMAP24XX_GPIO_DEBOUNCE_VAL;
pdata->regs->debounce_en = OMAP24XX_GPIO_DEBOUNCE_EN;
pdata->regs->ctrl = OMAP24XX_GPIO_CTRL;
+   pdata->regs->leveldetect0 = OMAP24XX_GPIO_LEVELDETECT0;
+   pdata->regs->leveldetect1 = OMAP24XX_GPIO_LEVELDETECT1;
+   pdata->regs->risingdetect = OMAP24XX_GPIO_RISINGDETECT;
+   pdata->regs->fallingdetect = OMAP24XX_GPIO_FALLINGDETECT;
pdata->regs->wkupstatus = OMAP24XX_GPIO_WAKE_EN;
pdata->regs->wkupclear = OMAP24XX_GPIO_CLEARWKUENA;
pdata->regs->wkupset = OMAP24XX_GPIO_SETWKUENA;
@@ -131,6 +135,10 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
pdata->regs->debounce = OMAP4_GPIO_DEBOUNCINGTIME;
pdata->regs->debounce_en = OMAP4_GPIO_DEBOUNCENABLE;
pdata->regs->ctrl = OMAP4_GPIO_CTRL;
+   pdata->regs->leveldetect0 = OMAP4_GPIO_LEVELDETECT0;
+   pdata->regs->leveldetect1 = OMAP4_GPIO_LEVELDETECT1;
+   pdata->regs->risingdetect = OMAP4_GPIO_RISINGDETECT;
+   pdata->regs->fallingdetect = OMAP4_GPIO_FALLINGDETECT;
pdata->regs->wkupstatus = OMAP4_GPIO_IRQWAKEN0;
pdata->regs->wkupclear = OMAP4_GPIO_IRQWAKEN0;
pdata->regs->wkupset = OMAP4_GPIO_IRQWAKEN0;
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 1a6789d..da72856 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1291,6 +1291,7 @@ void omap2_gpio_prepare_for_idle(int off_mode)
list_for_each_entry(bank, &omap_gpio_list, node) {
u32 l1 = 0, l2 = 0;
int j;
+   struct omap_gpio_reg_offs *offset = bank->regs;
 
if (!bank->loses_context)
continue;
@@ -1307,40 +1308,17 @@ void omap2_gpio_prepare_for_idle(int off_mode)
if (!(bank->enabled_non_wakeup_gpios))
continue;
 
-   if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
-   bank->saved_datain = __raw_readl(bank->base +
-   OMAP24XX_GPIO_DATAIN);
-   l1 = __raw_readl(bank->base +
-   OMAP24XX_GPIO_FALLINGDETECT);
-   l2 = __raw_readl(bank->base +
-   OMAP24XX_GPIO_RISINGDETECT);
-   }
-
-   if (cpu_is_omap44xx()) {
-   bank->saved_datain = __raw_readl(bank->base +
-   OMAP4_GPIO_DATAIN);
-   l1 = __raw_readl(bank->base +
-   OMAP4_GPIO_FALLINGDETECT);
-   l2 = __raw_readl(bank->base +
-   OMAP4_GPIO_RISINGDETECT);
-   }
+   bank->saved_datain = __raw_readl(bank->base + offset->datain);
+   l1 = __raw_readl(bank->base + offset->fallingdetect);
+   l2 = __raw_readl(bank->base + offset->risingdetect);
 
bank->saved_fallingdetect = l1;
bank->saved_risingdetect = l2;
l1 &= ~bank->enabled_non_wakeup_gpios;
l2 &= ~bank->enabled_non_wakeup_gpios;
 
-   if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
-   __raw_writel(l1, bank->base +
-   OMAP24XX_GPIO_FALLINGDETECT);
-   __raw_writel(l2, bank->base +
-   OMAP24XX_GPIO_RISINGDETECT);
-   }
-
-   if (cpu_is_omap44xx()) {
-   __raw_writel(l1, bank->base + OMAP4_GPIO_FALLINGDETECT);
-   __raw_writel(l2, bank->base + OMAP4_GPIO_RISINGDETECT);
-   }
+   __raw_writel(l1, bank->base + offset->fallingdetect);
+   __raw_writel(l2, bank->base + offset->risingdetect);
 
c++;
}
@@ -1358,6 +1336,7 @@ void omap2_gpio_resu

[RFC PATCH 03/10] OMAP2PLUS: GPIO: Fix non-wakeup GPIO and rev_ids

2011-05-16 Thread Tarun Kanti DebBarma
From: Charulatha V 

Non-wakeup GPIOs are available only in OMAP2420 and OMAP3430. But
the GPIO driver initializes the non-wakeup GPIO bits for OMAP24xx
(bothe OMAP 2420 and 2430) & not for OMAP3 which is incorrect.

Fix the above by providing non-wakeup GPIO information through pdata
specific to the SoC.

The GPIO rev id provided in the hwmod database is the same for OMAP2420
and OMAP2430. Change the GPIO rev ids in hwmod database as given below
so that it can be used to identify OMAP2420 and OMAP2430.
OMAP2420 - 0
OMAP2430 - 1
OMAP3- 2
OMAP4- 3

Signed-off-by: Charulatha V 
Cc: Santosh Shilimkar 
Cc: Kevin Hilman 
Cc: Tony Lindgren 
---
 arch/arm/mach-omap2/gpio.c |   26 --
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |2 +-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |2 +-
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |2 +-
 arch/arm/plat-omap/gpio.c  |   11 +++
 arch/arm/plat-omap/include/plat/gpio.h |1 +
 6 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 0446bd1..6cd26b4 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -56,6 +56,28 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
return -ENOMEM;
}
 
+   switch (oh->class->rev) {
+   case 0:
+   if (id == 1)
+   /* non-wakeup GPIO pins for OMAP2420 Bank1 */
+   pdata->non_wakeup_gpios = 0xe203ffc0;
+   else if (id == 2)
+   /* non-wakeup GPIO pins for OMAP2420 Bank2 */
+   pdata->non_wakeup_gpios = 0x08700040;
+   break;
+   case 2:
+   if (id == 2)
+   /* non-wakeup GPIO pins for OMAP3 Bank2 */
+   pdata->non_wakeup_gpios = 0x0001;
+   else if (id == 6)
+   /* non-wakeup GPIO pins for OMAP3 Bank6 */
+   pdata->non_wakeup_gpios = 0x0800;
+   break;
+   default:
+   /* No non-wakeup GPIO pins for other SoCs */
+   break;
+   }
+
dev_attr = (struct omap_gpio_dev_attr *)oh->dev_attr;
pdata->bank_width = dev_attr->bank_width;
pdata->dbck_flag = dev_attr->dbck_flag;
@@ -70,6 +92,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
switch (oh->class->rev) {
case 0:
case 1:
+   case 2:
pdata->bank_type = METHOD_GPIO_24XX;
pdata->regs->revision = OMAP24XX_GPIO_REVISION;
pdata->regs->direction = OMAP24XX_GPIO_OE;
@@ -86,7 +109,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
pdata->regs->debounce_en = OMAP24XX_GPIO_DEBOUNCE_EN;
pdata->regs->ctrl = OMAP24XX_GPIO_CTRL;
break;
-   case 2:
+   case 3:
pdata->bank_type = METHOD_GPIO_44XX;
pdata->regs->revision = OMAP4_GPIO_REVISION;
pdata->regs->direction = OMAP4_GPIO_OE;
@@ -108,7 +131,6 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
kfree(pdata);
return -EINVAL;
}
-
od = omap_device_build(name, id - 1, oh, pdata,
sizeof(*pdata), omap_gpio_latency,
ARRAY_SIZE(omap_gpio_latency),
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index e6e3810..dc819aa 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -1728,7 +1728,7 @@ static struct omap_hwmod_class_sysconfig 
omap243x_gpio_sysc = {
 static struct omap_hwmod_class omap243x_gpio_hwmod_class = {
.name = "gpio",
.sysc = &omap243x_gpio_sysc,
-   .rev = 0,
+   .rev = 1,
 };
 
 /* gpio1 */
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index b98e2df..010e3c4 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -2117,7 +2117,7 @@ static struct omap_hwmod_class_sysconfig 
omap3xxx_gpio_sysc = {
 static struct omap_hwmod_class omap3xxx_gpio_hwmod_class = {
.name = "gpio",
.sysc = &omap3xxx_gpio_sysc,
-   .rev = 1,
+   .rev = 2,
 };
 
 /* gpio_dev_attr*/
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 3e88dd3..df8e629 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -1703,7 +1703,7 @@ static struct omap_hwmod_class_sysconfig 
omap44xx_gpio_sysc = {
 static struct omap_hwmod_class omap44xx_gpio_hwmod_class = {
.name   = "gpio",
.sysc   = &omap44xx_gpio_sysc,
-   .rev= 2,
+   .r

[RFC PATCH 04/10] OMAP: GPIO: Remove dependency on gpio_bank_count

2011-05-16 Thread Tarun Kanti DebBarma
From: Charulatha V 

gpio_bank_count is the count of number of GPIO devices
in a SoC. Remove this dependency from the driver. Also remove
the dependency on array of pointers to gpio_bank struct of
all GPIO devices.

The cpu_is*() checks used in omap2_gpio_prepare_for_idle() and
omap2_gpio_resume_after_idle() would be removed in one of the
patches in this series

Signed-off-by: Charulatha V 
Cc: Santosh Shilimkar 
Cc: Kevin Hilman 
Cc: Tony Lindgren 
---
 arch/arm/mach-omap1/gpio15xx.c |1 -
 arch/arm/mach-omap1/gpio16xx.c |2 -
 arch/arm/mach-omap1/gpio7xx.c  |2 -
 arch/arm/mach-omap2/gpio.c |1 -
 arch/arm/plat-omap/gpio.c  |  157 ---
 arch/arm/plat-omap/include/plat/gpio.h |3 -
 6 files changed, 81 insertions(+), 85 deletions(-)

diff --git a/arch/arm/mach-omap1/gpio15xx.c b/arch/arm/mach-omap1/gpio15xx.c
index c3caf25..7a15f69 100644
--- a/arch/arm/mach-omap1/gpio15xx.c
+++ b/arch/arm/mach-omap1/gpio15xx.c
@@ -117,7 +117,6 @@ static int __init omap15xx_gpio_init(void)
platform_device_register(&omap15xx_mpu_gpio);
platform_device_register(&omap15xx_gpio);
 
-   gpio_bank_count = 2;
return 0;
 }
 postcore_initcall(omap15xx_gpio_init);
diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
index f62eaf3..43718ec 100644
--- a/arch/arm/mach-omap1/gpio16xx.c
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -223,8 +223,6 @@ static int __init omap16xx_gpio_init(void)
for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++)
platform_device_register(omap16xx_gpio_dev[i]);
 
-   gpio_bank_count = ARRAY_SIZE(omap16xx_gpio_dev);
-
return 0;
 }
 postcore_initcall(omap16xx_gpio_init);
diff --git a/arch/arm/mach-omap1/gpio7xx.c b/arch/arm/mach-omap1/gpio7xx.c
index 0fc2557..c7684ce 100644
--- a/arch/arm/mach-omap1/gpio7xx.c
+++ b/arch/arm/mach-omap1/gpio7xx.c
@@ -284,8 +284,6 @@ static int __init omap7xx_gpio_init(void)
for (i = 0; i < ARRAY_SIZE(omap7xx_gpio_dev); i++)
platform_device_register(omap7xx_gpio_dev[i]);
 
-   gpio_bank_count = ARRAY_SIZE(omap7xx_gpio_dev);
-
return 0;
 }
 postcore_initcall(omap7xx_gpio_init);
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 6cd26b4..487b49a 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -143,7 +143,6 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void 
*unused)
return PTR_ERR(od);
}
 
-   gpio_bank_count++;
return 0;
 }
 
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 12deb1c..0b76475 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -30,7 +30,10 @@
 #include 
 #include 
 
+static LIST_HEAD(omap_gpio_list);
+
 struct gpio_bank {
+   struct list_head node;
unsigned long pbase;
void __iomem *base;
u16 irq;
@@ -57,6 +60,7 @@ struct gpio_bank {
bool dbck_flag;
int stride;
u32 width;
+   u16 id;
 
void (*set_dataout)(struct gpio_bank *bank, int gpio, int enable);
 
@@ -80,15 +84,6 @@ struct omap3_gpio_regs {
 static struct omap3_gpio_regs gpio_context[OMAP34XX_NR_GPIOS];
 #endif
 
-/*
- * TODO: Cleanup gpio_bank usage as it is having information
- * related to all instances of the device
- */
-static struct gpio_bank *gpio_bank;
-
-/* TODO: Analyze removing gpio_bank_count usage from driver code */
-int gpio_bank_count;
-
 #define GPIO_INDEX(bank, gpio) (gpio % bank->width)
 #define GPIO_BIT(bank, gpio) (1 << GPIO_INDEX(bank, gpio))
 #define GPIO_MOD_CTRL_BIT  BIT(0)
@@ -859,23 +854,29 @@ static struct platform_device omap_mpuio_device = {
/* could list the /proc/iomem resources */
 };
 
-static inline void mpuio_init(void)
+static inline void mpuio_init(struct gpio_bank *bank)
 {
-   struct gpio_bank *bank = &gpio_bank[0];
+   static int mpuio_init_done;
+
+   if (mpuio_init_done || (bank->method != METHOD_MPUIO))
+   return;
+
platform_set_drvdata(&omap_mpuio_device, bank);
 
if (platform_driver_register(&omap_mpuio_driver) == 0)
(void) platform_device_register(&omap_mpuio_device);
+
+   mpuio_init_done = 1;
 }
 
 #else
-static inline void mpuio_init(void) {}
+static inline void mpuio_init(struct gpio_bank *bank) {}
 #endif /* 16xx */
 
 #else
 
 #define bank_is_mpuio(bank)0
-static inline void mpuio_init(void) {}
+static inline void mpuio_init(struct gpio_bank *bank) {}
 
 #endif
 
@@ -997,18 +998,6 @@ static void __init omap_gpio_show_rev(struct gpio_bank 
*bank)
  */
 static struct lock_class_key gpio_lock_class;
 
-static inline int init_gpio_info(struct platform_device *pdev)
-{
-   /* TODO: Analyze removing gpio_bank_count usage from driver code */
-   gpio_bank = kzalloc(gpio_bank_count * sizeof(struct gpio_bank),
-   GFP_KERNEL);
-   if (!gpio_ba

[RFC PATCH 02/10] ZOOM: QUART: Request reset GPIO

2011-05-16 Thread Tarun Kanti DebBarma
From: Charulatha V 

Reset GPIO (OMAP_GPIO_152) for QUART in zoom2/zoom3 debug-board is
not requested at all. This would lead to problems if this GPIO is
wrongly requested. Hence request OMAP GPIO 152 for QUART RESET but
do not apply a reset pulse as it would reset QUART and
disturb the QUART settings.

Signed-off-by: Charulatha V 
Cc: Santosh Shilimkar 
Cc: Kevin Hilman 
Cc: Tony Lindgren 
---
 arch/arm/mach-omap2/board-zoom-debugboard.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c 
b/arch/arm/mach-omap2/board-zoom-debugboard.c
index 007ebdc..a5f62f8 100644
--- a/arch/arm/mach-omap2/board-zoom-debugboard.c
+++ b/arch/arm/mach-omap2/board-zoom-debugboard.c
@@ -22,6 +22,7 @@
 #define ZOOM_SMSC911X_GPIO 158
 #define ZOOM_QUADUART_CS   3
 #define ZOOM_QUADUART_GPIO 102
+#define ZOOM_QUADUART_RST_GPIO 152
 #define QUART_CLK  1843200
 #define DEBUG_BASE 0x0800
 #define ZOOM_ETHR_STARTDEBUG_BASE
@@ -110,6 +111,14 @@ static inline void __init zoom_init_quaduart(void)
unsigned long cs_mem_base;
int quart_gpio = 0;
 
+   if (gpio_request_one(ZOOM_QUADUART_RST_GPIO,
+   GPIOF_OUT_INIT_LOW,
+   "TL16CP754C GPIO") < 0) {
+   pr_err("Failed to request GPIO%d for TL16CP754C\n",
+   ZOOM_QUADUART_RST_GPIO);
+   return;
+   }
+
quart_cs = ZOOM_QUADUART_CS;
 
if (gpmc_cs_request(quart_cs, SZ_1M, &cs_mem_base) < 0) {
-- 
1.7.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


[RFC PATCH 00/10] OMAP: GPIO: cleanup GPIO driver

2011-05-16 Thread Tarun Kanti DebBarma
From: Charulatha V 

Do some more cleanup of OMAP GPIO driver and avoid usage of gpio_bank_count
and gpio_bank pointer array by means of maintaining a list.

Patch series is on following commit of linux-omap-pm (branch: wip/gpio-cleanup):
73ec20e00b9c02d5588dc83babb567527ed4394d
OMAP: GPIO: cleanup show revision, remove cpu_is checks, display only once

Compile tested for:
 - omap1_defconfig
 - omap2plus_defconfig

Boot test (success on the following boards):
 - OMAP1710-H3
 - OMAP2420-H4
 - OMAP3430-SDP
 - OMAP3430-Zoom2
 - OMAP3630-Zoom3
 - OMAP4430-SDP
 - OMAP4430-Blaze

GPIO module functionality testing (success on the following boards):
 - OMAP2420-H4
 - OMAP3430-SDP
 - OMAP3430-Zoom2
 - OMAP3630-Zoom3
 - OMAP4430-SDP
 - OMAP4430-Blaze

PM Testing (success as given below):
OMAP3430-SDP: retention, off_mode, system_wide suspend, gpio wakeup
OMAP3630-Zoom3: retention, system_wide suspend
using the following:
 echo 5 > /sys/devices/platform/omap/omap_uart.0/sleep_timeout
 echo 5 > /sys/devices/platform/omap/omap_uart.1/sleep_timeout
 echo 5 > /sys/devices/platform/omap/omap_uart.2/sleep_timeout
 echo 5 > /sys/devices/platform/omap/omap_uart.3/sleep_timeout
 echo '5' > /debug/pm_debug/wakeup_timer_seconds
 echo 1 > /debug/pm_debug/sleep_while_idle

Charulatha V (6):
  OMAP: GPIO: Avoid cpu_is checks during module ena/disable
  ZOOM: QUART: Request reset GPIO
  OMAP2PLUS: GPIO: Fix non-wakeup GPIO and rev_ids
  OMAP: GPIO: Remove dependency on gpio_bank_count
  OMAP2PLUS: GPIO: Use flag to identify wkup dmn GPIO
  OMAP: GPIO: Use USHRT_MAX for rev offset instead of -1

Tarun Kanti DebBarma (4):
  OMAP: GPIO: cleanup suspend and resume functions
  OMAP: GPIO: cleanup prepare-for and resume-after idle functions
  OMAP: GPIO: cleanup omap_gpio_free and triggering functions
  OMAP: GPIO: remove harcoded offsets in context save and restore

 arch/arm/mach-omap1/gpio15xx.c  |5 +-
 arch/arm/mach-omap1/gpio16xx.c  |9 +-
 arch/arm/mach-omap1/gpio7xx.c   |4 +-
 arch/arm/mach-omap2/board-zoom-debugboard.c |9 +
 arch/arm/mach-omap2/gpio.c  |   50 +++-
 arch/arm/mach-omap2/omap_hwmod_2430_data.c  |2 +-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c  |2 +-
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c  |2 +-
 arch/arm/plat-omap/gpio.c   |  467 ++-
 arch/arm/plat-omap/include/plat/gpio.h  |   14 +-
 10 files changed, 257 insertions(+), 307 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


RE: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2

2011-05-16 Thread Janorkar, Mayuresh


> -Original Message-
> From: Valkeinen, Tomi
> Sent: Monday, May 16, 2011 2:23 PM
> To: Igor Grinberg
> Cc: Janorkar, Mayuresh; t...@atomide.com; linux-omap@vger.kernel.org;
> Stanley Miao
> Subject: Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
> 
> On Thu, 2011-05-12 at 09:40 +0300, Igor Grinberg wrote:
> >
> > On 05/11/11 09:32, Tomi Valkeinen wrote:
> >
> > > On Wed, 2011-05-11 at 10:28 +0530, Janorkar, Mayuresh wrote:
> > >
> > >>> +static void __init ldp_display_init(void)
> > >>> +{
> > >>> +   int r;
> > >>> +
> > >>> +   struct gpio gpios[] = {
> > >>> +   {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD
> RESET"},
> > >>> +   {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> > >>> +   {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD
> ENABLE"},
> > >>> +   {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD
> > >>> BACKLIGHT"},
> > >>> +   };
> > >>> +
> > >>> +   r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> > >>> +   if (r) {
> > >>> +   pr_err("Cannot request LCD GPIOs, error %d\n", r);
> > >>> +   return;
> > >>> +   }
> > >> If I test with this patch, this request is returning error.
> > > Hmm. Well, the GPIOs are the same as in the old driver. However, the
> old
> > > driver doesn't even seem to check if it manages to request the GPIOs,
> so
> > > it may well be that it was failing also.
> > >
> > > Can you check from /sys/class/gpio/ if some of the GPIOs are already
> > > allocated: 207, 199, 55, 56?
> > >
> > > The definition of two of those GPIOs look kinda funny to me: (15 +
> > > OMAP_MAX_GPIO_LINES). I don't know what OMAP_MAX_GPIO_LINES means, but
> > > it sure doesn't sound ok to have a GPIO number that is 15 over the
> > > maximum =).
> > >
> >
> > This means that some kind of gpio expander is used.
> > I bet those are twl gpios (or may be some other discrete chip).
> > If those are twl gpios then you need to provide the .setup callback
> > in struct twl4030_gpio_platform_data which will request and setup those
> gpios.
> 
> Here's an updated patch with the twl gpio code.
> 
> All the old omapfb porting patches, including new drivers for DSS2, can
> be found from
> 
> git://gitorious.org/linux-omap-dss2/linux.git old-omapfb-port
> 
>  Tomi
> 
> diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-
> ldp.c
> index e2ba779..ed78b9a 100644
> --- a/arch/arm/mach-omap2/board-ldp.c
> +++ b/arch/arm/mach-omap2/board-ldp.c
> @@ -44,6 +44,9 @@
>  #include 
>  #include 
> 
> +#include 
> +#include 
> +
>  #include "board-flash.h"
>  #include "mux.h"
>  #include "hsmmc.h"
> @@ -275,19 +278,70 @@ static inline void __init ldp_init_smsc911x(void)
>   gpio_direction_input(eth_gpio);
>  }
> 
> -static struct platform_device ldp_lcd_device = {
> - .name   = "ldp_lcd",
> - .id = -1,
> +/* LCD */
> +
> +static int ldp_backlight_gpio;
> +static int ldp_lcd_enable_gpio;
> +
> +#define LCD_PANEL_RESET_GPIO 55
> +#define LCD_PANEL_QVGA_GPIO  56
> +
> +static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(ldp_lcd_enable_gpio, 1);
> + gpio_direction_output(ldp_backlight_gpio, 1);
> +
> + return 0;
> +}
> +
> +static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(ldp_lcd_enable_gpio, 0);
> + gpio_direction_output(ldp_backlight_gpio, 0);
> +}
> +
> +static struct panel_generic_dpi_data ldp_panel_data = {
> + .name   = "2430sdp",
> + .platform_enable= ldp_panel_enable_lcd,
> + .platform_disable   = ldp_panel_disable_lcd,
> +};
> +
> +static struct omap_dss_device ldp_lcd_device = {
> + .name   = "lcd",
> + .driver_name= "generic_dpi_panel",
> + .type   = OMAP_DISPLAY_TYPE_DPI,
> + .phy.dpi.data_lines = 16,

>From a working DSS code at:
http://lxr.linux.no/#linux+v2.6.38/drivers/video/omap/lcd_ldp.c
.data_lines should be 18

> + .data   = &ldp_panel_data,
>  };
> 
> -static struct omap_lcd_config ldp_lcd_config __initdata = {
> - .ctrl_name  = "internal",
> +static struct omap_dss_device *ldp_dss_devices[] = {
> + &ldp_lcd_device,
>  };
> 
> -static struct omap_board_config_kernel ldp_config[] __initdata = {
> - { OMAP_TAG_LCD, &ldp_lcd_config },
> +static struct omap_dss_board_info ldp_dss_data = {
> + .num_devices= ARRAY_SIZE(ldp_dss_devices),
> + .devices= ldp_dss_devices,
> + .default_device = &ldp_lcd_device,
>  };
> 
> +static void __init ldp_display_init(void)
> +{
> + int r;
> +
> + static struct gpio gpios[] __initdata = {
> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> + };
> +
> + r = gpio_request_array(gpios, AR

Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2

2011-05-16 Thread Igor Grinberg
On 05/16/11 11:53, Tomi Valkeinen wrote:

> Here's an updated patch with the twl gpio code.

Looks good, though one minor issue below

> All the old omapfb porting patches, including new drivers for DSS2, can
> be found from 
>
> git://gitorious.org/linux-omap-dss2/linux.git old-omapfb-port
>
>  Tomi
>
> diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
> index e2ba779..ed78b9a 100644
> --- a/arch/arm/mach-omap2/board-ldp.c
> +++ b/arch/arm/mach-omap2/board-ldp.c
> @@ -44,6 +44,9 @@
>  #include 
>  #include 
>  
> +#include 
> +#include 
> +
>  #include "board-flash.h"
>  #include "mux.h"
>  #include "hsmmc.h"
> @@ -275,19 +278,70 @@ static inline void __init ldp_init_smsc911x(void)
>   gpio_direction_input(eth_gpio);
>  }
>  
> -static struct platform_device ldp_lcd_device = {
> - .name   = "ldp_lcd",
> - .id = -1,
> +/* LCD */
> +
> +static int ldp_backlight_gpio;
> +static int ldp_lcd_enable_gpio;
> +
> +#define LCD_PANEL_RESET_GPIO 55
> +#define LCD_PANEL_QVGA_GPIO  56
> +
> +static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(ldp_lcd_enable_gpio, 1);
> + gpio_direction_output(ldp_backlight_gpio, 1);
> +
> + return 0;
> +}
> +
> +static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(ldp_lcd_enable_gpio, 0);
> + gpio_direction_output(ldp_backlight_gpio, 0);
> +}
> +
> +static struct panel_generic_dpi_data ldp_panel_data = {
> + .name   = "2430sdp",
> + .platform_enable= ldp_panel_enable_lcd,
> + .platform_disable   = ldp_panel_disable_lcd,
> +};
> +
> +static struct omap_dss_device ldp_lcd_device = {
> + .name   = "lcd",
> + .driver_name= "generic_dpi_panel",
> + .type   = OMAP_DISPLAY_TYPE_DPI,
> + .phy.dpi.data_lines = 16,
> + .data   = &ldp_panel_data,
>  };
>  
> -static struct omap_lcd_config ldp_lcd_config __initdata = {
> - .ctrl_name  = "internal",
> +static struct omap_dss_device *ldp_dss_devices[] = {
> + &ldp_lcd_device,
>  };
>  
> -static struct omap_board_config_kernel ldp_config[] __initdata = {
> - { OMAP_TAG_LCD, &ldp_lcd_config },
> +static struct omap_dss_board_info ldp_dss_data = {
> + .num_devices= ARRAY_SIZE(ldp_dss_devices),
> + .devices= ldp_dss_devices,
> + .default_device = &ldp_lcd_device,
>  };
>  
> +static void __init ldp_display_init(void)
> +{
> + int r;
> +
> + static struct gpio gpios[] __initdata = {
> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> + };
> +
> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> + if (r) {
> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> + return;
> + }
> +
> + omap_display_init(&ldp_dss_data);
> +}
> +
>  static void __init omap_ldp_init_early(void)
>  {
>   omap2_init_common_infrastructure();
> @@ -298,10 +352,30 @@ static struct twl4030_usb_data ldp_usb_data = {
>   .usb_mode   = T2_USB_MODE_ULPI,
>  };
>  
> +static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned 
> ngpio)
> +{
> + int r;
> +
> + struct gpio gpios[] = {
> + {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
> + {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
> + };
> +
> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> + if (r)
> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> +
> + ldp_backlight_gpio = gpio + 15;
> + ldp_lcd_enable_gpio = gpio + 7;

If the gpio_request_array() fails (though it shouldn't),
won't it be right to set both variables to -EINVAL?

Other then that, you can have my
Signed-off-by: Igor Grinberg 

Thanks for bringing this all together.


-- 
Regards,
Igor.

--
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: your mail

2011-05-16 Thread Munegowda, Keshava
On Mon, May 16, 2011 at 3:14 PM, Felipe Balbi  wrote:
> Hi,
>
> On Mon, May 16, 2011 at 03:04:20PM +0530, Keshava Munegowda wrote:
>> Following 2 hwmod strcuture are added:
>> UHH hwmod of usbhs with uhh base address and
>> EHCI , OHCI irq and base addresses.
>> TLL hwmod of usbhs with the TLL base address and irq.
>>
>> Signed-off-by: Keshava Munegowda 
>
> missing subject line.

Ya, I have already correct it and resend this patch [RESEND] [PATCH 1/5]...

Regards
keshava
--
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] perf: export power_start and power_end tracepoints

2011-05-16 Thread Pihet-XID, Jean
On Mon, May 16, 2011 at 11:23 AM, Ingo Molnar  wrote:
>
> * Jean Pihet  wrote:
>
>> Adding l-o and linux-pm MLs. The original post is at
>> http://www.spinics.net/lists/kernel/msg1186554.html
>>
>> On Fri, May 13, 2011 at 4:48 PM, Ingo Molnar  wrote:
>> >
>> > * jean.pi...@newoldbits.com  wrote:
>> >
>> >> From: Jean Pihet 
>> >>
>> >> If used in a module both tracepoints need to be exported by the
>> >> kernel.
>> >
>> > but it's not used by any module in the kernel AFAICS, so why is this 
>> > needed?
>> Not currently, that is why the error went unnoticed. I think it is
>> better to fix it now than later.
>>
>> I am working on a plan to clean-up and isolate the OMAP PM code from
>> the core code and to provide the PM functionality as a module. This
>> effort is part of the 'remove the crazy ARM churn' from the kernel.
>
> Feel free to keep this patch with those modifications/cleanups:
>
> Acked-by: Ingo Molnar 
>
> but please make sure you push it together, i.e. never export something
> (knowingly) without having in-tree use for it.
Ok will push the changes together when they are ready.

>
> Thanks,
>
>        Ingo
>

Thanks,
Jean
--
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: your mail

2011-05-16 Thread Felipe Balbi
Hi,

On Mon, May 16, 2011 at 03:04:20PM +0530, Keshava Munegowda wrote:
> Following 2 hwmod strcuture are added:
> UHH hwmod of usbhs with uhh base address and
> EHCI , OHCI irq and base addresses.
> TLL hwmod of usbhs with the TLL base address and irq.
> 
> Signed-off-by: Keshava Munegowda 

missing subject line.

-- 
balbi


signature.asc
Description: Digital signature


[RESEND][PATCH 5/5] arm: omap: usb: global Suspend and resume support of ehci and ohci

2011-05-16 Thread Keshava Munegowda
From: Keshava Munegowda 

The global suspend and resume functions for usbhs core driver
are implemented.These routine are called when the global suspend
and resume occurs. Before calling these functions, the
bus suspend and resume of ehci and ohci drivers are called
from runtime pm.

Signed-off-by: Keshava Munegowda 
---
 drivers/mfd/omap-usb-host.c |  103 +++
 1 files changed, 103 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index bd63429..e1bc3b5 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -146,6 +146,10 @@
 #define is_ehci_hsic_mode(x)   (x == OMAP_EHCI_PORT_MODE_HSIC)
 
 
+/* USBHS state bits */
+#define OMAP_USBHS_INIT0
+#define OMAP_USBHS_SUSPEND 4
+
 struct usbhs_hcd_omap {
struct clk  *xclk60mhsp1_ck;
struct clk  *xclk60mhsp2_ck;
@@ -165,6 +169,7 @@ struct usbhs_hcd_omap {
u32 usbhs_rev;
spinlock_t  lock;
int count;
+   unsigned long   state;
 };
 /*-*/
 
@@ -807,6 +812,8 @@ static int usbhs_enable(struct device *dev)
(pdata->ehci_data->reset_gpio_port[1], 1);
}
 
+   set_bit(OMAP_USBHS_INIT, &omap->state);
+
 end_count:
omap->count++;
spin_unlock_irqrestore(&omap->lock, flags);
@@ -895,6 +902,7 @@ static void usbhs_disable(struct device *dev)
}
 
pm_runtime_put_sync(dev);
+   clear_bit(OMAP_USBHS_INIT, &omap->state);
 
/* The gpio_free migh sleep; so unlock the spinlock */
spin_unlock_irqrestore(&omap->lock, flags);
@@ -924,10 +932,105 @@ void omap_usbhs_disable(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(omap_usbhs_disable);
 
+#ifdef CONFIG_PM
+
+static int usbhs_resume(struct device *dev)
+{
+   struct usbhs_hcd_omap   *omap = dev_get_drvdata(dev);
+   struct usbhs_omap_platform_data *pdata = &omap->platdata;
+   unsigned long   flags = 0;
+
+   dev_dbg(dev, "Resuming TI HSUSB Controller\n");
+
+   if (!pdata) {
+   dev_dbg(dev, "missing platform_data\n");
+   return  -ENODEV;
+   }
+
+   spin_lock_irqsave(&omap->lock, flags);
+
+   if (!test_bit(OMAP_USBHS_INIT, &omap->state) ||
+   !test_bit(OMAP_USBHS_SUSPEND, &omap->state))
+   goto end_resume;
+
+   pm_runtime_get_sync(dev);
+
+   if (is_omap_usbhs_rev2(omap)) {
+   if (is_ehci_tll_mode(pdata->port_mode[0])) {
+   clk_enable(omap->usbhost_p1_fck);
+   clk_enable(omap->usbtll_p1_fck);
+   }
+   if (is_ehci_tll_mode(pdata->port_mode[1])) {
+   clk_enable(omap->usbhost_p2_fck);
+   clk_enable(omap->usbtll_p2_fck);
+   }
+   clk_enable(omap->utmi_p1_fck);
+   clk_enable(omap->utmi_p2_fck);
+   }
+   clear_bit(OMAP_USBHS_SUSPEND, &omap->state);
+
+end_resume:
+   spin_unlock_irqrestore(&omap->lock, flags);
+   return 0;
+}
+
+
+static int usbhs_suspend(struct device *dev)
+{
+   struct usbhs_hcd_omap   *omap = dev_get_drvdata(dev);
+   struct usbhs_omap_platform_data *pdata = &omap->platdata;
+   unsigned long   flags = 0;
+
+   dev_dbg(dev, "Suspending TI HSUSB Controller\n");
+
+   if (!pdata) {
+   dev_dbg(dev, "missing platform_data\n");
+   return  -ENODEV;
+   }
+
+   spin_lock_irqsave(&omap->lock, flags);
+
+   if (!test_bit(OMAP_USBHS_INIT, &omap->state) ||
+   test_bit(OMAP_USBHS_SUSPEND, &omap->state))
+   goto end_suspend;
+
+   if (is_omap_usbhs_rev2(omap)) {
+   if (is_ehci_tll_mode(pdata->port_mode[0])) {
+   clk_disable(omap->usbhost_p1_fck);
+   clk_disable(omap->usbtll_p1_fck);
+   }
+   if (is_ehci_tll_mode(pdata->port_mode[1])) {
+   clk_disable(omap->usbhost_p2_fck);
+   clk_disable(omap->usbtll_p2_fck);
+   }
+   clk_disable(omap->utmi_p2_fck);
+   clk_disable(omap->utmi_p1_fck);
+   }
+
+   set_bit(OMAP_USBHS_SUSPEND, &omap->state);
+   pm_runtime_put_sync(dev);
+
+end_suspend:
+   spin_unlock_irqrestore(&omap->lock, flags);
+   return 0;
+}
+
+
+static const struct dev_pm_ops usbhsomap_dev_pm_ops = {
+   .suspend= usbhs_suspend,
+   .resume = usbhs_resume,
+};
+
+#define USBHS_OMAP_DEV_PM_OPS (&usbhsomap_dev_pm_ops)
+#else
+#defineUSBHS_OMAP_DEV_PM_OPS   NULL
+#endif
+
 static struct platform_driver usbhs_omap_driver = {
.driver = {
 

[RESEND][PATCH 4/5] arm: omap: usb: Runtime PM support

2011-05-16 Thread Keshava Munegowda
From: Keshava Munegowda 

The usbhs core driver does not enable/disable the intefrace and
fucntional clocks; These clocks are handled by hwmod and runtime pm,
hence insted of the clock enable/disable, the runtime pm APIS are
used. however,the port clocks and tll clocks are handled
by the usbhs core.

Signed-off-by: Keshava Munegowda 
---
 drivers/mfd/omap-usb-host.c |  131 +++
 1 files changed, 9 insertions(+), 122 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 48ada2d..bd63429 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define USBHS_DRIVER_NAME  "usbhs_omap"
 #define OMAP_EHCI_DEVICE   "ehci-omap"
@@ -146,9 +147,6 @@
 
 
 struct usbhs_hcd_omap {
-   struct clk  *usbhost_ick;
-   struct clk  *usbhost_hs_fck;
-   struct clk  *usbhost_fs_fck;
struct clk  *xclk60mhsp1_ck;
struct clk  *xclk60mhsp2_ck;
struct clk  *utmi_p1_fck;
@@ -158,8 +156,6 @@ struct usbhs_hcd_omap {
struct clk  *usbhost_p2_fck;
struct clk  *usbtll_p2_fck;
struct clk  *init_60m_fclk;
-   struct clk  *usbtll_fck;
-   struct clk  *usbtll_ick;
 
void __iomem*uhh_base;
void __iomem*tll_base;
@@ -351,46 +347,13 @@ static int __devinit usbhs_omap_probe(struct 
platform_device *pdev)
omap->platdata.ehci_data = pdata->ehci_data;
omap->platdata.ohci_data = pdata->ohci_data;
 
-   omap->usbhost_ick = clk_get(dev, "usbhost_ick");
-   if (IS_ERR(omap->usbhost_ick)) {
-   ret =  PTR_ERR(omap->usbhost_ick);
-   dev_err(dev, "usbhost_ick failed error:%d\n", ret);
-   goto err_end;
-   }
-
-   omap->usbhost_hs_fck = clk_get(dev, "hs_fck");
-   if (IS_ERR(omap->usbhost_hs_fck)) {
-   ret = PTR_ERR(omap->usbhost_hs_fck);
-   dev_err(dev, "usbhost_hs_fck failed error:%d\n", ret);
-   goto err_usbhost_ick;
-   }
-
-   omap->usbhost_fs_fck = clk_get(dev, "fs_fck");
-   if (IS_ERR(omap->usbhost_fs_fck)) {
-   ret = PTR_ERR(omap->usbhost_fs_fck);
-   dev_err(dev, "usbhost_fs_fck failed error:%d\n", ret);
-   goto err_usbhost_hs_fck;
-   }
-
-   omap->usbtll_fck = clk_get(dev, "usbtll_fck");
-   if (IS_ERR(omap->usbtll_fck)) {
-   ret = PTR_ERR(omap->usbtll_fck);
-   dev_err(dev, "usbtll_fck failed error:%d\n", ret);
-   goto err_usbhost_fs_fck;
-   }
-
-   omap->usbtll_ick = clk_get(dev, "usbtll_ick");
-   if (IS_ERR(omap->usbtll_ick)) {
-   ret = PTR_ERR(omap->usbtll_ick);
-   dev_err(dev, "usbtll_ick failed error:%d\n", ret);
-   goto err_usbtll_fck;
-   }
+   pm_runtime_enable(&pdev->dev);
 
omap->utmi_p1_fck = clk_get(dev, "utmi_p1_gfclk");
if (IS_ERR(omap->utmi_p1_fck)) {
ret = PTR_ERR(omap->utmi_p1_fck);
dev_err(dev, "utmi_p1_gfclk failed error:%d\n", ret);
-   goto err_usbtll_ick;
+   goto err_end;
}
 
omap->xclk60mhsp1_ck = clk_get(dev, "xclk60mhsp1_ck");
@@ -520,22 +483,8 @@ err_xclk60mhsp1_ck:
 err_utmi_p1_fck:
clk_put(omap->utmi_p1_fck);
 
-err_usbtll_ick:
-   clk_put(omap->usbtll_ick);
-
-err_usbtll_fck:
-   clk_put(omap->usbtll_fck);
-
-err_usbhost_fs_fck:
-   clk_put(omap->usbhost_fs_fck);
-
-err_usbhost_hs_fck:
-   clk_put(omap->usbhost_hs_fck);
-
-err_usbhost_ick:
-   clk_put(omap->usbhost_ick);
-
 err_end:
+   pm_runtime_disable(&pdev->dev);
kfree(omap);
 
 end_probe:
@@ -569,11 +518,7 @@ static int __devexit usbhs_omap_remove(struct 
platform_device *pdev)
clk_put(omap->utmi_p2_fck);
clk_put(omap->xclk60mhsp1_ck);
clk_put(omap->utmi_p1_fck);
-   clk_put(omap->usbtll_ick);
-   clk_put(omap->usbtll_fck);
-   clk_put(omap->usbhost_fs_fck);
-   clk_put(omap->usbhost_hs_fck);
-   clk_put(omap->usbhost_ick);
+   pm_runtime_disable(&pdev->dev);
kfree(omap);
 
return 0;
@@ -693,7 +638,6 @@ static int usbhs_enable(struct device *dev)
struct usbhs_omap_platform_data *pdata = &omap->platdata;
unsigned long   flags = 0;
int ret = 0;
-   unsigned long   timeout;
unsignedreg;
 
dev_dbg(dev, "starting TI HSUSB Controller\n");
@@ -706,11 +650,7 @@ static int usbhs_enable(struct device *dev)
if (omap->count > 0)
goto end_count;
 
-   clk_enabl

[PATCH 4/4] OMAP: DSS2: DSI: Get line buffer size from DSI_GNQ register

2011-05-16 Thread Archit Taneja
The line buffer sizes vary across DSI modules, create a function
dsi_get_line_buf_size() using DSI_GNQ register to get the size of
line buffer used for the DISPC video port data.

Signed-off-by: Archit Taneja 
---
 drivers/video/omap2/dss/dsi.c |   36 
 1 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 784677d..345757c 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -2036,6 +2036,37 @@ static inline int dsi_get_num_data_lanes_dssdev(struct 
omap_dss_device *dssdev)
return num_data_lanes;
 }
 
+static unsigned dsi_get_line_buf_size(struct platform_device *dsidev)
+{
+   int val;
+
+   /* line buffer on OMAP3 is 1024 x 24bits */
+   /* XXX: for some reason using full buffer size causes
+* considerable TX slowdown with update sizes that fill the
+* whole buffer */
+   if (!dss_has_feature(FEAT_DSI_GNQ))
+   return 1023 * 3;
+
+   val = REG_GET(dsidev, DSI_GNQ, 14, 12); /* VP1_LINE_BUFFER_SIZE */
+
+   switch (val) {
+   case 1:
+   return 512 * 3; /* 512x24 bits */
+   case 2:
+   return 682 * 3; /* 682x24 bits */
+   case 3:
+   return 853 * 3; /* 853x24 bits */
+   case 4:
+   return 1024 * 3;/* 1024x24 bits */
+   case 5:
+   return 1194 * 3;/* 1194x24 bits */
+   case 6:
+   return 1365 * 3;/* 1365x24 bits */
+   default:
+   BUG();
+   }
+}
+
 static void dsi_set_lane_config(struct omap_dss_device *dssdev)
 {
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
@@ -3771,10 +3802,7 @@ static void dsi_update_screen_dispc(struct 
omap_dss_device *dssdev,
u32 l;
int r;
const unsigned channel = dsi->update_channel;
-   /* line buffer is 1024 x 24bits */
-   /* XXX: for some reason using full buffer size causes considerable TX
-* slowdown with update sizes that fill the whole buffer */
-   const unsigned line_buf_size = 1023 * 3;
+   const unsigned line_buf_size = dsi_get_line_buf_size(dsidev);
 
DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n",
x, y, w, h);
-- 
1.7.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 3/4] OMAP: DSS2: DSI: Get number of DSI data lanes using DSI_GNQ register

2011-05-16 Thread Archit Taneja
On OMAP3, the DSI module has 2 data lanes. On OMAP4, DSI1 has 4 data lanes
and DSI2 has 2 data lanes. Introduce function dsi_get_num_data_lanes() which
returns the number of data lanes on the dsi interface, introduce function
dsi_get_num_data_lanes_dssdev() which returns the number of data lanes used by
the omap_dss_device connected to the lanes.

Use the DSI_GNQ register on OMAP4 to get the number of data lanes, modify
dsi.c to use the number of lanes and the extra data lanes on DSI1.

Signed-off-by: Archit Taneja 
---
 drivers/video/omap2/dss/dsi.c  |   97 +---
 drivers/video/omap2/dss/dss_features.c |3 +-
 drivers/video/omap2/dss/dss_features.h |1 +
 include/video/omapdss.h|4 +
 4 files changed, 95 insertions(+), 10 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index f04244b..784677d 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -59,6 +59,7 @@ struct dsi_reg { u16 idx; };
 #define DSI_IRQSTATUS  DSI_REG(0x0018)
 #define DSI_IRQENABLE  DSI_REG(0x001C)
 #define DSI_CTRL   DSI_REG(0x0040)
+#define DSI_GNQDSI_REG(0x0044)
 #define DSI_COMPLEXIO_CFG1 DSI_REG(0x0048)
 #define DSI_COMPLEXIO_IRQ_STATUS   DSI_REG(0x004C)
 #define DSI_COMPLEXIO_IRQ_ENABLE   DSI_REG(0x0050)
@@ -238,6 +239,10 @@ enum dsi_lane {
DSI_DATA1_N = 1 << 3,
DSI_DATA2_P = 1 << 4,
DSI_DATA2_N = 1 << 5,
+   DSI_DATA3_P = 1 << 6,
+   DSI_DATA3_N = 1 << 7,
+   DSI_DATA4_P = 1 << 8,
+   DSI_DATA4_N = 1 << 9,
 };
 
 struct dsi_update_region {
@@ -326,6 +331,8 @@ struct dsi_data {
unsigned long  fint_min, fint_max;
unsigned long lpdiv_max;
 
+   int num_data_lanes;
+
unsigned scp_clk_refcount;
 };
 
@@ -2001,10 +2008,39 @@ static int dsi_cio_power(struct platform_device *dsidev,
return 0;
 }
 
+/* Number of data lanes present on DSI interface */
+static inline int dsi_get_num_data_lanes(struct platform_device *dsidev)
+{
+   /* DSI on OMAP3 doesn't have register DSI_GNQ, set number
+* of data lanes as 2 by default */
+   if (dss_has_feature(FEAT_DSI_GNQ))
+   return REG_GET(dsidev, DSI_GNQ, 11, 9); /* NB_DATA_LANES */
+   else
+   return 2;
+}
+
+/* Number of data lanes used by the dss device */
+static inline int dsi_get_num_data_lanes_dssdev(struct omap_dss_device *dssdev)
+{
+   int num_data_lanes = 0;
+
+   if (dssdev->phy.dsi.data1_lane != 0)
+   num_data_lanes++;
+   if (dssdev->phy.dsi.data2_lane != 0)
+   num_data_lanes++;
+   if (dssdev->phy.dsi.data3_lane != 0)
+   num_data_lanes++;
+   if (dssdev->phy.dsi.data4_lane != 0)
+   num_data_lanes++;
+
+   return num_data_lanes;
+}
+
 static void dsi_set_lane_config(struct omap_dss_device *dssdev)
 {
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
u32 r;
+   int num_data_lanes_dssdev = dsi_get_num_data_lanes_dssdev(dssdev);
 
int clk_lane   = dssdev->phy.dsi.clk_lane;
int data1_lane = dssdev->phy.dsi.data1_lane;
@@ -2020,6 +2056,20 @@ static void dsi_set_lane_config(struct omap_dss_device 
*dssdev)
r = FLD_MOD(r, data1_pol, 7, 7);
r = FLD_MOD(r, data2_lane, 10, 8);
r = FLD_MOD(r, data2_pol, 11, 11);
+   if (num_data_lanes_dssdev > 2) {
+   int data3_lane  = dssdev->phy.dsi.data3_lane;
+   int data3_pol  = dssdev->phy.dsi.data3_pol;
+
+   r = FLD_MOD(r, data3_lane, 14, 12);
+   r = FLD_MOD(r, data3_pol, 15, 15);
+   }
+   if (num_data_lanes_dssdev > 3) {
+   int data4_lane  = dssdev->phy.dsi.data4_lane;
+   int data4_pol  = dssdev->phy.dsi.data4_pol;
+
+   r = FLD_MOD(r, data4_lane, 18, 16);
+   r = FLD_MOD(r, data4_pol, 19, 19);
+   }
dsi_write_reg(dsidev, DSI_COMPLEXIO_CFG1, r);
 
/* The configuration of the DSI complex I/O (number of data lanes,
@@ -2132,14 +2182,20 @@ static void dsi_cio_enable_lane_override(struct 
omap_dss_device *dssdev,
enum dsi_lane lanes)
 {
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
+   struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
int clk_lane   = dssdev->phy.dsi.clk_lane;
int data1_lane = dssdev->phy.dsi.data1_lane;
int data2_lane = dssdev->phy.dsi.data2_lane;
+   int data3_lane = dssdev->phy.dsi.data3_lane;
+   int data4_lane = dssdev->phy.dsi.data4_lane;
int clk_pol= dssdev->phy.dsi.clk_pol;
int data1_pol  = dssdev->phy.dsi.data1_pol;
int data2_pol  = dssdev->phy.dsi.data2_pol;
+   int data3_pol  = dssdev->phy.dsi.data3_pol;
+   int data4_pol  = dssdev->phy.dsi.data4_pol;
 
 

[PATCH 2/4] OMAP: DSS2: DSI: Use system workqueue for delayed work instead of a private workqueue

2011-05-16 Thread Archit Taneja
In the previous DSI driver design, a private workqueue was needed to prevent a
deadlock as explained in the commit : 0f16aa0ae6b84d7ae72fbe8999e6a94cb78edd4e
. In the current design, the workqueue is only used for queueing delayed work in
the case where we don't get a FRAMEDONE interrupt for 250 milliseconds. It is
safe to remove the private workqueue amd use the system workqueue instead to
schedule the delayed work with the new design where the deadlock can't occur.

Signed-off-by: Archit Taneja 
---
 drivers/video/omap2/dss/dsi.c |   25 +++--
 1 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 091b318..f04244b 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -294,8 +294,6 @@ struct dsi_data {
bool te_enabled;
bool ulps_enabled;
 
-   struct workqueue_struct *workqueue;
-
void (*framedone_callback)(int, void *);
void *framedone_data;
 
@@ -3753,8 +3751,8 @@ static void dsi_update_screen_dispc(struct 
omap_dss_device *dssdev,
 
dsi_perf_mark_start(dsidev);
 
-   r = queue_delayed_work(dsi->workqueue, &dsi->framedone_timeout_work,
-   msecs_to_jiffies(250));
+   r = schedule_delayed_work(&dsi->framedone_timeout_work,
+   msecs_to_jiffies(250));
BUG_ON(r == 0);
 
dss_start_update(dssdev);
@@ -4369,12 +4367,6 @@ static int dsi_init(struct platform_device *dsidev)
mutex_init(&dsi->lock);
sema_init(&dsi->bus_lock, 1);
 
-   dsi->workqueue = create_singlethread_workqueue(dev_name(&dsidev->dev));
-   if (dsi->workqueue == NULL) {
-   r = -ENOMEM;
-   goto err1;
-   }
-
INIT_DELAYED_WORK_DEFERRABLE(&dsi->framedone_timeout_work,
dsi_framedone_timeout_work_callback);
 
@@ -4387,26 +4379,26 @@ static int dsi_init(struct platform_device *dsidev)
if (!dsi_mem) {
DSSERR("can't get IORESOURCE_MEM DSI\n");
r = -EINVAL;
-   goto err2;
+   goto err1;
}
dsi->base = ioremap(dsi_mem->start, resource_size(dsi_mem));
if (!dsi->base) {
DSSERR("can't ioremap DSI\n");
r = -ENOMEM;
-   goto err2;
+   goto err1;
}
dsi->irq = platform_get_irq(dsi->pdev, 0);
if (dsi->irq < 0) {
DSSERR("platform_get_irq failed\n");
r = -ENODEV;
-   goto err3;
+   goto err2;
}
 
r = request_irq(dsi->irq, omap_dsi_irq_handler, IRQF_SHARED,
dev_name(&dsidev->dev), dsi->pdev);
if (r < 0) {
DSSERR("request_irq failed\n");
-   goto err3;
+   goto err2;
}
 
/* DSI VCs initialization */
@@ -4427,10 +4419,8 @@ static int dsi_init(struct platform_device *dsidev)
enable_clocks(0);
 
return 0;
-err3:
-   iounmap(dsi->base);
 err2:
-   destroy_workqueue(dsi->workqueue);
+   iounmap(dsi->base);
 err1:
kfree(dsi);
 err0:
@@ -4454,7 +,6 @@ static void dsi_exit(struct platform_device *dsidev)
free_irq(dsi->irq, dsi->pdev);
iounmap(dsi->base);
 
-   destroy_workqueue(dsi->workqueue);
kfree(dsi);
 
DSSDBG("omap_dsi_exit\n");
-- 
1.7.1

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


[PATCH 1/4] OMAP: DSS2: DSI: Remove DISPC pixel clock related info in dsi_dump_clocks()

2011-05-16 Thread Archit Taneja
dsi_dump_clocks() prints lck and pck rates for the DISPC channel which it is
connected to. Remove this since it is already printed by dispc_dump_clocks()
in debugfs.

Signed-off-by: Archit Taneja 
---
 drivers/video/omap2/dss/dsi.c |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 85ec3d6..091b318 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -1726,11 +1726,6 @@ static void dsi_dump_dsidev_clocks(struct 
platform_device *dsidev,
 
seq_printf(s,   "LP_CLK\t\t%lu\n", cinfo->lp_clk);
 
-   seq_printf(s,   "VP_CLK\t\t%lu\n"
-   "VP_PCLK\t\t%lu\n",
-   dispc_lclk_rate(OMAP_DSS_CHANNEL_LCD),
-   dispc_pclk_rate(OMAP_DSS_CHANNEL_LCD));
-
enable_clocks(0);
 }
 
-- 
1.7.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 0/4] OMAP: DSS2: Miscellaneous DSI cleanup and fixes

2011-05-16 Thread Archit Taneja
Some minor fixes/cleanup for DSI:
- Remove some debug prints in dsi_dump_clocks().
- Use system workqueue instead of creating a private one.
- Add num_data_lanes and line_buffer_size and get the from DSI_GNQ register.

Archit Taneja (4):
  OMAP: DSS2: DSI: Remove DISPC pixel clock related info in
dsi_dump_clocks()
  OMAP: DSS2: DSI: Use system workqueue for delayed work instead of a
private workqueue
  OMAP: DSS2: DSI: Get number of DSI data lanes using DSI_GNQ register
  OMAP: DSS2: DSI: Get line buffer size from DSI_GNQ register

 drivers/video/omap2/dss/dsi.c  |  163 +---
 drivers/video/omap2/dss/dss_features.c |3 +-
 drivers/video/omap2/dss/dss_features.h |1 +
 include/video/omapdss.h|4 +
 4 files changed, 134 insertions(+), 37 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


[RESEND][PATCH 3/5] arm: omap: usb: device name change for the clk names of usbhs

2011-05-16 Thread Keshava Munegowda
device name usbhs clocks are changed from
usbhs-omap.0 to usbhs_omap; this is because
in the hwmod registration the device name is set
as usbhs_omap

Signed-off-by: Keshava Munegowda 
---
 arch/arm/mach-omap2/clock3xxx_data.c |   28 ++--
 arch/arm/mach-omap2/clock44xx_data.c |   10 +-
 drivers/mfd/omap-usb-host.c  |2 +-
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 75b119b..fabe482 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3285,7 +3285,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL,   "cpefuse_fck",  &cpefuse_fck,   CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(NULL,   "ts_fck",   &ts_fck,CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(NULL,   "usbtll_fck",   &usbtll_fck,CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
-   CLK("usbhs-omap.0", "usbtll_fck",   &usbtll_fck,CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
+   CLK("usbhs_omap",   "usbtll_fck",   &usbtll_fck,CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck,  CK_3XXX),
CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck,  CK_3XXX),
CLK(NULL,   "core_96m_fck", &core_96m_fck,  CK_3XXX),
@@ -3321,7 +3321,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL,   "pka_ick",  &pka_ick,   CK_34XX | CK_36XX),
CLK(NULL,   "core_l4_ick",  &core_l4_ick,   CK_3XXX),
CLK(NULL,   "usbtll_ick",   &usbtll_ick,CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
-   CLK("usbhs-omap.0", "usbtll_ick",   &usbtll_ick,CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
+   CLK("usbhs_omap",   "usbtll_ick",   &usbtll_ick,CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
CLK("omap_hsmmc.2", "ick",  &mmchs3_ick,CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(NULL,   "icr_ick",  &icr_ick,   CK_34XX | CK_36XX),
CLK("omap-aes", "ick",  &aes2_ick,  CK_34XX | CK_36XX),
@@ -3367,20 +3367,20 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL,   "cam_ick",  &cam_ick,   CK_34XX | CK_36XX),
CLK(NULL,   "csi2_96m_fck", &csi2_96m_fck,  CK_34XX | CK_36XX),
CLK(NULL,   "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
-   CLK("usbhs-omap.0", "hs_fck", &usbhost_120m_fck, CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
+   CLK("usbhs_omap",   "hs_fck", &usbhost_120m_fck, CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(NULL,   "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
-   CLK("usbhs-omap.0", "fs_fck", &usbhost_48m_fck, CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
+   CLK("usbhs_omap",   "fs_fck", &usbhost_48m_fck, CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(NULL,   "usbhost_ick",  &usbhost_ick,   CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
-   CLK("usbhs-omap.0", "usbhost_ick",  &usbhost_ick,   CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
-   CLK("usbhs-omap.0", "utmi_p1_gfclk",&dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "utmi_p2_gfclk",&dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "xclk60mhsp1_ck",   &dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "xclk60mhsp2_ck",   &dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "usb_host_hs_utmi_p1_clk",  &dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "usb_host_hs_utmi_p2_clk",  &dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "usb_tll_hs_usb_ch0_clk",   &dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "usb_tll_hs_usb_ch1_clk",   &dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "init_60m_fclk",&dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "usbhost_ick",  &usbhost_ick,   CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
+   CLK("usbhs_omap",   "utmi_p1_gfclk",&dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "utmi_p2_gfclk",&dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "xclk60mhsp1_ck",   &dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "xclk60mhsp2_ck",   &dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "usb_host_hs_utmi_p1_clk",  &dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "usb_host_hs_utmi_p2_clk",  &dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "usb_tll_hs_usb_ch0_clk",   &dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "usb_tll_hs_usb_ch1_clk",   &dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "init_60m_fclk",&dummy_ck,  
CK_3XXX),
CLK(NULL,   "usim_fck", &usim_fck,  CK_3430ES2PLUS | 
CK_36XX),
CLK(NULL,   "gpt1_fck", &gpt1_fck,  CK_3XXX),
CLK

[RESEND][PATCH 2/5] arm: omap: usb: register hwmods of usbhs

2011-05-16 Thread Keshava Munegowda
The hwmod structure of uhh and tll are retrived
and registered with omap device

Signed-off-by: Keshava Munegowda 
---
 arch/arm/mach-omap2/usb-host.c |   99 ++--
 1 files changed, 35 insertions(+), 64 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index 89ae298..9d762c4 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -28,51 +28,28 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "mux.h"
 
 #ifdef CONFIG_MFD_OMAP_USB_HOST
 
-#define OMAP_USBHS_DEVICE  "usbhs-omap"
-
-static struct resource usbhs_resources[] = {
-   {
-   .name   = "uhh",
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .name   = "tll",
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .name   = "ehci",
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .name   = "ehci-irq",
-   .flags  = IORESOURCE_IRQ,
-   },
-   {
-   .name   = "ohci",
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .name   = "ohci-irq",
-   .flags  = IORESOURCE_IRQ,
-   }
-};
-
-static struct platform_device usbhs_device = {
-   .name   = OMAP_USBHS_DEVICE,
-   .id = 0,
-   .num_resources  = ARRAY_SIZE(usbhs_resources),
-   .resource   = usbhs_resources,
-};
+#define OMAP_USBHS_DEVICE  "usbhs_omap"
+#defineUSBHS_UHH_HWMODNAME "usbhs_uhh"
+#define USBHS_TLL_HWMODNAME"usbhs_tll"
 
 static struct usbhs_omap_platform_data usbhs_data;
 static struct ehci_hcd_omap_platform_data  ehci_data;
 static struct ohci_hcd_omap_platform_data  ohci_data;
 
+static struct omap_device_pm_latency omap_uhhtll_latency[] = {
+ {
+   .deactivate_func = omap_device_idle_hwmods,
+   .activate_func   = omap_device_enable_hwmods,
+   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+ },
+};
+
 /* MUX settings for EHCI pins */
 /*
  * setup_ehci_io_mux - initialize IO pad mux for USBHOST
@@ -508,7 +485,10 @@ static void setup_4430ohci_io_mux(const enum 
usbhs_omap_port_mode *port_mode)
 
 void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
 {
-   int i;
+   struct omap_hwmod   *oh[2];
+   struct omap_device  *od;
+   int bus_id = -1;
+   int i;
 
for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
usbhs_data.port_mode[i] = pdata->port_mode[i];
@@ -523,44 +503,35 @@ void __init usbhs_init(const struct usbhs_omap_board_data 
*pdata)
usbhs_data.ohci_data = &ohci_data;
 
if (cpu_is_omap34xx()) {
-   usbhs_resources[0].start = OMAP34XX_UHH_CONFIG_BASE;
-   usbhs_resources[0].end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1;
-   usbhs_resources[1].start = OMAP34XX_USBTLL_BASE;
-   usbhs_resources[1].end = OMAP34XX_USBTLL_BASE + SZ_4K - 1;
-   usbhs_resources[2].start= OMAP34XX_EHCI_BASE;
-   usbhs_resources[2].end  = OMAP34XX_EHCI_BASE + SZ_1K - 1;
-   usbhs_resources[3].start = INT_34XX_EHCI_IRQ;
-   usbhs_resources[4].start= OMAP34XX_OHCI_BASE;
-   usbhs_resources[4].end  = OMAP34XX_OHCI_BASE + SZ_1K - 1;
-   usbhs_resources[5].start = INT_34XX_OHCI_IRQ;
setup_ehci_io_mux(pdata->port_mode);
setup_ohci_io_mux(pdata->port_mode);
} else if (cpu_is_omap44xx()) {
-   usbhs_resources[0].start = OMAP44XX_UHH_CONFIG_BASE;
-   usbhs_resources[0].end = OMAP44XX_UHH_CONFIG_BASE + SZ_1K - 1;
-   usbhs_resources[1].start = OMAP44XX_USBTLL_BASE;
-   usbhs_resources[1].end = OMAP44XX_USBTLL_BASE + SZ_4K - 1;
-   usbhs_resources[2].start = OMAP44XX_HSUSB_EHCI_BASE;
-   usbhs_resources[2].end = OMAP44XX_HSUSB_EHCI_BASE + SZ_1K - 1;
-   usbhs_resources[3].start = OMAP44XX_IRQ_EHCI;
-   usbhs_resources[4].start = OMAP44XX_HSUSB_OHCI_BASE;
-   usbhs_resources[4].end = OMAP44XX_HSUSB_OHCI_BASE + SZ_1K - 1;
-   usbhs_resources[5].start = OMAP44XX_IRQ_OHCI;
setup_4430ehci_io_mux(pdata->port_mode);
setup_4430ohci_io_mux(pdata->port_mode);
}
 
-   if (platform_device_add_data(&usbhs_device,
-   &usbhs_data, sizeof(usbhs_data)) < 0) {
-   printk(KERN_ERR "USBHS platform_device_add_data failed\n");
-   goto init_end;
+   oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
+   if (!oh[0]) {
+   pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
+   return;
}
 
-   if (platform_device_register(&usbhs_device) < 0)
-   printk(KERN_ERR "USBHS platform_device_re

[RESEND][PATCH 1/5] arm: omap: usb: ehci and ohci hwmod structures for omap3 and omap4

2011-05-16 Thread Keshava Munegowda
Following 2 hwmod strcuture are added:
UHH hwmod of usbhs with uhh base address and
EHCI , OHCI irq and base addresses.
TLL hwmod of usbhs with the TLL base address and irq.

Signed-off-by: Keshava Munegowda 
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  184 
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  153 +++
 2 files changed, 337 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 909a84d..fe9a176 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -84,6 +84,8 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod;
 static struct omap_hwmod omap3xxx_mcbsp5_hwmod;
 static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod;
 static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod;
+static struct omap_hwmod omap34xx_usb_host_hs_hwmod;
+static struct omap_hwmod omap34xx_usb_tll_hs_hwmod;
 
 /* L3 -> L4_CORE interface */
 static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = {
@@ -3574,6 +3576,185 @@ static struct omap_hwmod omap3xxx_mmc3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 };
 
+/*
+ * 'usb_host_hs' class
+ * high-speed multi-port usb host controller
+ */
+static struct omap_hwmod_ocp_if omap34xx_usb_host_hs__l3_main_2 = {
+   .master = &omap34xx_usb_host_hs_hwmod,
+   .slave  = &omap3xxx_l3_main_hwmod,
+   .clk= "core_l3_ick",
+   .user   = OCP_USER_MPU,
+};
+
+static struct omap_hwmod_class_sysconfig omap34xx_usb_host_hs_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+  MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap34xx_usb_host_hs_hwmod_class = {
+   .name = "usbhs_uhh",
+   .sysc = &omap34xx_usb_host_hs_sysc,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_usb_host_hs_masters[] = {
+   &omap34xx_usb_host_hs__l3_main_2,
+};
+
+static struct omap_hwmod_irq_info omap34xx_usb_host_hs_irqs[] = {
+   { .name = "ohci-irq", .irq = 76 },
+   { .name = "ehci-irq", .irq = 77 },
+};
+
+static struct omap_hwmod_addr_space omap34xx_usb_host_hs_addrs[] = {
+   {
+   .name   = "uhh",
+   .pa_start   = 0x48064000,
+   .pa_end = 0x480643ff,
+   .flags  = ADDR_TYPE_RT
+   },
+   {
+   .name   = "ohci",
+   .pa_start   = 0x48064400,
+   .pa_end = 0x480647FF,
+   .flags  = ADDR_MAP_ON_INIT
+   },
+   {
+   .name   = "ehci",
+   .pa_start   = 0x48064800,
+   .pa_end = 0x48064CFF,
+   .flags  = ADDR_MAP_ON_INIT
+   }
+};
+
+static struct omap_hwmod_ocp_if omap34xx_l4_cfg__usb_host_hs = {
+   .master = &omap3xxx_l4_core_hwmod,
+   .slave  = &omap34xx_usb_host_hs_hwmod,
+   .clk= "l4_ick",
+   .addr   = omap34xx_usb_host_hs_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap34xx_usb_host_hs_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if omap34xx_f128m_cfg__usb_host_hs = {
+   .clk= "usbhost_120m_fck",
+   .user   = OCP_USER_MPU,
+   .flags  = OCPIF_SWSUP_IDLE,
+};
+
+static struct omap_hwmod_ocp_if omap34xx_f48m_cfg__usb_host_hs = {
+   .clk= "usbhost_48m_fck",
+   .user   = OCP_USER_MPU,
+   .flags  = OCPIF_SWSUP_IDLE,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_usb_host_hs_slaves[] = {
+   &omap34xx_l4_cfg__usb_host_hs,
+   &omap34xx_f128m_cfg__usb_host_hs,
+   &omap34xx_f48m_cfg__usb_host_hs,
+};
+
+static struct omap_hwmod omap34xx_usb_host_hs_hwmod = {
+   .name   = "usbhs_uhh",
+   .class  = &omap34xx_usb_host_hs_hwmod_class,
+   .mpu_irqs   = omap34xx_usb_host_hs_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap34xx_usb_host_hs_irqs),
+   .main_clk   = "usbhost_ick",
+   .prcm = {
+   .omap2 = {
+   .module_offs = OMAP3430ES2_USBHOST_MOD,
+   .prcm_reg_id = 1,
+   .module_bit = 0,
+   .idlest_reg_id = 1,
+   .idlest_idle_bit = 1,
+   .idlest_stdby_bit = 0,
+   },
+   },
+   .slaves = omap34xx_usb_host_hs_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap34xx_usb_host_hs_slaves),
+   .masters= omap34xx_usb_host_hs_masters,
+   .masters_cnt= ARRAY_SIZ

[no subject]

2011-05-16 Thread Keshava Munegowda
Following 2 hwmod strcuture are added:
UHH hwmod of usbhs with uhh base address and
EHCI , OHCI irq and base addresses.
TLL hwmod of usbhs with the TLL base address and irq.

Signed-off-by: Keshava Munegowda 
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  184 
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  153 +++
 2 files changed, 337 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 909a84d..fe9a176 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -84,6 +84,8 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod;
 static struct omap_hwmod omap3xxx_mcbsp5_hwmod;
 static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod;
 static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod;
+static struct omap_hwmod omap34xx_usb_host_hs_hwmod;
+static struct omap_hwmod omap34xx_usb_tll_hs_hwmod;
 
 /* L3 -> L4_CORE interface */
 static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = {
@@ -3574,6 +3576,185 @@ static struct omap_hwmod omap3xxx_mmc3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 };
 
+/*
+ * 'usb_host_hs' class
+ * high-speed multi-port usb host controller
+ */
+static struct omap_hwmod_ocp_if omap34xx_usb_host_hs__l3_main_2 = {
+   .master = &omap34xx_usb_host_hs_hwmod,
+   .slave  = &omap3xxx_l3_main_hwmod,
+   .clk= "core_l3_ick",
+   .user   = OCP_USER_MPU,
+};
+
+static struct omap_hwmod_class_sysconfig omap34xx_usb_host_hs_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+  MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap34xx_usb_host_hs_hwmod_class = {
+   .name = "usbhs_uhh",
+   .sysc = &omap34xx_usb_host_hs_sysc,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_usb_host_hs_masters[] = {
+   &omap34xx_usb_host_hs__l3_main_2,
+};
+
+static struct omap_hwmod_irq_info omap34xx_usb_host_hs_irqs[] = {
+   { .name = "ohci-irq", .irq = 76 },
+   { .name = "ehci-irq", .irq = 77 },
+};
+
+static struct omap_hwmod_addr_space omap34xx_usb_host_hs_addrs[] = {
+   {
+   .name   = "uhh",
+   .pa_start   = 0x48064000,
+   .pa_end = 0x480643ff,
+   .flags  = ADDR_TYPE_RT
+   },
+   {
+   .name   = "ohci",
+   .pa_start   = 0x48064400,
+   .pa_end = 0x480647FF,
+   .flags  = ADDR_MAP_ON_INIT
+   },
+   {
+   .name   = "ehci",
+   .pa_start   = 0x48064800,
+   .pa_end = 0x48064CFF,
+   .flags  = ADDR_MAP_ON_INIT
+   }
+};
+
+static struct omap_hwmod_ocp_if omap34xx_l4_cfg__usb_host_hs = {
+   .master = &omap3xxx_l4_core_hwmod,
+   .slave  = &omap34xx_usb_host_hs_hwmod,
+   .clk= "l4_ick",
+   .addr   = omap34xx_usb_host_hs_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap34xx_usb_host_hs_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if omap34xx_f128m_cfg__usb_host_hs = {
+   .clk= "usbhost_120m_fck",
+   .user   = OCP_USER_MPU,
+   .flags  = OCPIF_SWSUP_IDLE,
+};
+
+static struct omap_hwmod_ocp_if omap34xx_f48m_cfg__usb_host_hs = {
+   .clk= "usbhost_48m_fck",
+   .user   = OCP_USER_MPU,
+   .flags  = OCPIF_SWSUP_IDLE,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_usb_host_hs_slaves[] = {
+   &omap34xx_l4_cfg__usb_host_hs,
+   &omap34xx_f128m_cfg__usb_host_hs,
+   &omap34xx_f48m_cfg__usb_host_hs,
+};
+
+static struct omap_hwmod omap34xx_usb_host_hs_hwmod = {
+   .name   = "usbhs_uhh",
+   .class  = &omap34xx_usb_host_hs_hwmod_class,
+   .mpu_irqs   = omap34xx_usb_host_hs_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap34xx_usb_host_hs_irqs),
+   .main_clk   = "usbhost_ick",
+   .prcm = {
+   .omap2 = {
+   .module_offs = OMAP3430ES2_USBHOST_MOD,
+   .prcm_reg_id = 1,
+   .module_bit = 0,
+   .idlest_reg_id = 1,
+   .idlest_idle_bit = 1,
+   .idlest_stdby_bit = 0,
+   },
+   },
+   .slaves = omap34xx_usb_host_hs_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap34xx_usb_host_hs_slaves),
+   .masters= omap34xx_usb_host_hs_masters,
+   .masters_cnt= ARRAY_SIZ

[RESEND][PATCH 0/5] arm: omap: usb: Runtime PM support for EHCI and OHCI drivers

2011-05-16 Thread Keshava Munegowda
From: Keshava Munegowda 

The Hwmod structures and Runtime PM features are implemented 
For EHCI and OHCI drivers of OMAP3 and OMAP4.
The global suspend/resume of EHCI and OHCI 
is validated on OMAP3430 sdp board with these patches.

Keshava Munegowda (5):
  arm: omap: usb: ehci and ohci hwmod structures for omap3 and omap4
  arm: omap: usb: register hwmods of usbhs
  arm: omap: usb: device name change for the clk names of usbhs
  arm: omap: usb: Runtime PM support
  arm: omap: usb: global Suspend and resume support of ehci and ohci

 arch/arm/mach-omap2/clock3xxx_data.c   |   28 ++--
 arch/arm/mach-omap2/clock44xx_data.c   |   10 +-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  184 ++
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  153 ++
 arch/arm/mach-omap2/usb-host.c |   99 
 drivers/mfd/omap-usb-host.c|  236 +---
 6 files changed, 504 insertions(+), 206 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


Re: [PATCH] perf: export power_start and power_end tracepoints

2011-05-16 Thread Ingo Molnar

* Jean Pihet  wrote:

> Adding l-o and linux-pm MLs. The original post is at
> http://www.spinics.net/lists/kernel/msg1186554.html
> 
> On Fri, May 13, 2011 at 4:48 PM, Ingo Molnar  wrote:
> >
> > * jean.pi...@newoldbits.com  wrote:
> >
> >> From: Jean Pihet 
> >>
> >> If used in a module both tracepoints need to be exported by the
> >> kernel.
> >
> > but it's not used by any module in the kernel AFAICS, so why is this needed?
> Not currently, that is why the error went unnoticed. I think it is
> better to fix it now than later.
> 
> I am working on a plan to clean-up and isolate the OMAP PM code from
> the core code and to provide the PM functionality as a module. This
> effort is part of the 'remove the crazy ARM churn' from the kernel.

Feel free to keep this patch with those modifications/cleanups:

Acked-by: Ingo Molnar 

but please make sure you push it together, i.e. never export something 
(knowingly) without having in-tree use for it.

Thanks,

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


[PATCH v2] ARM: omap4: i2c reset regs postidle

2011-05-16 Thread Jan Weitzel
Without OMAP_I2C_FLAG_RESET_REGS_POSTIDLE I got i2c controller
timeouts on each accsess after an NACK message.
Taking this flag fix it.

This patch is on top of the i2c feature implementation flags
patches

Signed-off-by: Jan Weitzel 
Tested-by: Andy Green 
Acked-by: Andy Green 
---
v2: add Tested-by / Acked-by

 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 5f4a1b2..3d3b4f4 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -2130,7 +2130,8 @@ static struct omap_hwmod_class omap44xx_i2c_hwmod_class = 
{
 };
 
 static struct omap_i2c_dev_attr i2c_dev_attr = {
-   .flags  = OMAP_I2C_FLAG_BUS_SHIFT_NONE,
+   .flags  = OMAP_I2C_FLAG_BUS_SHIFT_NONE |
+ OMAP_I2C_FLAG_RESET_REGS_POSTIDLE,
 };
 
 /* i2c1 */
-- 
1.7.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: [RESEND][PATCH 0/5] arm: omap: usb: Runtime PM support for EHCI and OHCI drivers

2011-05-16 Thread Munegowda, Keshava
Sorry ! Tis patch was 1/5 has different subjct;

Some problem with my email setup , I will send the series.

On Mon, May 16, 2011 at 2:34 PM, Keshava Munegowda
 wrote:
> Following 2 hwmod strcuture are added:
> UHH hwmod of usbhs with uhh base address and
> EHCI , OHCI irq and base addresses.
> TLL hwmod of usbhs with the TLL base address and irq.
>
> Signed-off-by: Keshava Munegowda 
> ---
>  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  184 
> 
>  arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  153 +++
>  2 files changed, 337 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
> b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
> index 909a84d..fe9a176 100644
> --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
> @@ -84,6 +84,8 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod;
>  static struct omap_hwmod omap3xxx_mcbsp5_hwmod;
>  static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod;
>  static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod;
> +static struct omap_hwmod omap34xx_usb_host_hs_hwmod;
> +static struct omap_hwmod omap34xx_usb_tll_hs_hwmod;
>
>  /* L3 -> L4_CORE interface */
>  static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = {
> @@ -3574,6 +3576,185 @@ static struct omap_hwmod omap3xxx_mmc3_hwmod = {
>        .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
>  };
>
> +/*
> + * 'usb_host_hs' class
> + * high-speed multi-port usb host controller
> + */
> +static struct omap_hwmod_ocp_if omap34xx_usb_host_hs__l3_main_2 = {
> +       .master         = &omap34xx_usb_host_hs_hwmod,
> +       .slave          = &omap3xxx_l3_main_hwmod,
> +       .clk            = "core_l3_ick",
> +       .user           = OCP_USER_MPU,
> +};
> +
> +static struct omap_hwmod_class_sysconfig omap34xx_usb_host_hs_sysc = {
> +       .rev_offs       = 0x,
> +       .sysc_offs      = 0x0010,
> +       .syss_offs      = 0x0014,
> +       .sysc_flags     = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE),
> +       .idlemodes      = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
> +                          MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
> +       .sysc_fields    = &omap_hwmod_sysc_type1,
> +};
> +
> +static struct omap_hwmod_class omap34xx_usb_host_hs_hwmod_class = {
> +       .name = "usbhs_uhh",
> +       .sysc = &omap34xx_usb_host_hs_sysc,
> +};
> +
> +static struct omap_hwmod_ocp_if *omap34xx_usb_host_hs_masters[] = {
> +       &omap34xx_usb_host_hs__l3_main_2,
> +};
> +
> +static struct omap_hwmod_irq_info omap34xx_usb_host_hs_irqs[] = {
> +       { .name = "ohci-irq", .irq = 76 },
> +       { .name = "ehci-irq", .irq = 77 },
> +};
> +
> +static struct omap_hwmod_addr_space omap34xx_usb_host_hs_addrs[] = {
> +       {
> +               .name           = "uhh",
> +               .pa_start       = 0x48064000,
> +               .pa_end         = 0x480643ff,
> +               .flags          = ADDR_TYPE_RT
> +       },
> +       {
> +               .name           = "ohci",
> +               .pa_start       = 0x48064400,
> +               .pa_end         = 0x480647FF,
> +               .flags          = ADDR_MAP_ON_INIT
> +       },
> +       {
> +               .name           = "ehci",
> +               .pa_start       = 0x48064800,
> +               .pa_end         = 0x48064CFF,
> +               .flags          = ADDR_MAP_ON_INIT
> +       }
> +};
> +
> +static struct omap_hwmod_ocp_if omap34xx_l4_cfg__usb_host_hs = {
> +       .master         = &omap3xxx_l4_core_hwmod,
> +       .slave          = &omap34xx_usb_host_hs_hwmod,
> +       .clk            = "l4_ick",
> +       .addr           = omap34xx_usb_host_hs_addrs,
> +       .addr_cnt       = ARRAY_SIZE(omap34xx_usb_host_hs_addrs),
> +       .user           = OCP_USER_MPU | OCP_USER_SDMA,
> +};
> +
> +static struct omap_hwmod_ocp_if omap34xx_f128m_cfg__usb_host_hs = {
> +       .clk            = "usbhost_120m_fck",
> +       .user           = OCP_USER_MPU,
> +       .flags          = OCPIF_SWSUP_IDLE,
> +};
> +
> +static struct omap_hwmod_ocp_if omap34xx_f48m_cfg__usb_host_hs = {
> +       .clk            = "usbhost_48m_fck",
> +       .user           = OCP_USER_MPU,
> +       .flags          = OCPIF_SWSUP_IDLE,
> +};
> +
> +static struct omap_hwmod_ocp_if *omap34xx_usb_host_hs_slaves[] = {
> +       &omap34xx_l4_cfg__usb_host_hs,
> +       &omap34xx_f128m_cfg__usb_host_hs,
> +       &omap34xx_f48m_cfg__usb_host_hs,
> +};
> +
> +static struct omap_hwmod omap34xx_usb_host_hs_hwmod = {
> +       .name           = "usbhs_uhh",
> +       .class          = &omap34xx_usb_host_hs_hwmod_class,
> +       .mpu_irqs       = omap34xx_usb_host_hs_irqs,
> +       .mpu_irqs_cnt   = ARRAY_SIZE(omap34xx_usb_host_hs_irqs),
> +       .main_clk       = "usbhost_ick",
> +       .prcm = {
> +               .omap2 = {
> +                       .module_offs = OMAP3430ES2_USBHOST_MOD,
> +                       .prcm_reg_id = 1,
> +          

[RESEND][PATCH 3/5] arm: omap: usb: device name change for the clk names of usbhs

2011-05-16 Thread Keshava Munegowda
device name usbhs clocks are changed from
usbhs-omap.0 to usbhs_omap; this is because
in the hwmod registration the device name is set
as usbhs_omap

Signed-off-by: Keshava Munegowda 
---
 arch/arm/mach-omap2/clock3xxx_data.c |   28 ++--
 arch/arm/mach-omap2/clock44xx_data.c |   10 +-
 drivers/mfd/omap-usb-host.c  |2 +-
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 75b119b..fabe482 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3285,7 +3285,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL,   "cpefuse_fck",  &cpefuse_fck,   CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(NULL,   "ts_fck",   &ts_fck,CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(NULL,   "usbtll_fck",   &usbtll_fck,CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
-   CLK("usbhs-omap.0", "usbtll_fck",   &usbtll_fck,CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
+   CLK("usbhs_omap",   "usbtll_fck",   &usbtll_fck,CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck,  CK_3XXX),
CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck,  CK_3XXX),
CLK(NULL,   "core_96m_fck", &core_96m_fck,  CK_3XXX),
@@ -3321,7 +3321,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL,   "pka_ick",  &pka_ick,   CK_34XX | CK_36XX),
CLK(NULL,   "core_l4_ick",  &core_l4_ick,   CK_3XXX),
CLK(NULL,   "usbtll_ick",   &usbtll_ick,CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
-   CLK("usbhs-omap.0", "usbtll_ick",   &usbtll_ick,CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
+   CLK("usbhs_omap",   "usbtll_ick",   &usbtll_ick,CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
CLK("omap_hsmmc.2", "ick",  &mmchs3_ick,CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(NULL,   "icr_ick",  &icr_ick,   CK_34XX | CK_36XX),
CLK("omap-aes", "ick",  &aes2_ick,  CK_34XX | CK_36XX),
@@ -3367,20 +3367,20 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL,   "cam_ick",  &cam_ick,   CK_34XX | CK_36XX),
CLK(NULL,   "csi2_96m_fck", &csi2_96m_fck,  CK_34XX | CK_36XX),
CLK(NULL,   "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
-   CLK("usbhs-omap.0", "hs_fck", &usbhost_120m_fck, CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
+   CLK("usbhs_omap",   "hs_fck", &usbhost_120m_fck, CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(NULL,   "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
-   CLK("usbhs-omap.0", "fs_fck", &usbhost_48m_fck, CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
+   CLK("usbhs_omap",   "fs_fck", &usbhost_48m_fck, CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(NULL,   "usbhost_ick",  &usbhost_ick,   CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
-   CLK("usbhs-omap.0", "usbhost_ick",  &usbhost_ick,   CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
-   CLK("usbhs-omap.0", "utmi_p1_gfclk",&dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "utmi_p2_gfclk",&dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "xclk60mhsp1_ck",   &dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "xclk60mhsp2_ck",   &dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "usb_host_hs_utmi_p1_clk",  &dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "usb_host_hs_utmi_p2_clk",  &dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "usb_tll_hs_usb_ch0_clk",   &dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "usb_tll_hs_usb_ch1_clk",   &dummy_ck,  
CK_3XXX),
-   CLK("usbhs-omap.0", "init_60m_fclk",&dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "usbhost_ick",  &usbhost_ick,   CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
+   CLK("usbhs_omap",   "utmi_p1_gfclk",&dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "utmi_p2_gfclk",&dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "xclk60mhsp1_ck",   &dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "xclk60mhsp2_ck",   &dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "usb_host_hs_utmi_p1_clk",  &dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "usb_host_hs_utmi_p2_clk",  &dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "usb_tll_hs_usb_ch0_clk",   &dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "usb_tll_hs_usb_ch1_clk",   &dummy_ck,  
CK_3XXX),
+   CLK("usbhs_omap",   "init_60m_fclk",&dummy_ck,  
CK_3XXX),
CLK(NULL,   "usim_fck", &usim_fck,  CK_3430ES2PLUS | 
CK_36XX),
CLK(NULL,   "gpt1_fck", &gpt1_fck,  CK_3XXX),
CLK

[RESEND][PATCH 0/5] arm: omap: usb: Runtime PM support for EHCI and OHCI drivers

2011-05-16 Thread Keshava Munegowda
Following 2 hwmod strcuture are added:
UHH hwmod of usbhs with uhh base address and
EHCI , OHCI irq and base addresses.
TLL hwmod of usbhs with the TLL base address and irq.

Signed-off-by: Keshava Munegowda 
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  184 
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  153 +++
 2 files changed, 337 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 909a84d..fe9a176 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -84,6 +84,8 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod;
 static struct omap_hwmod omap3xxx_mcbsp5_hwmod;
 static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod;
 static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod;
+static struct omap_hwmod omap34xx_usb_host_hs_hwmod;
+static struct omap_hwmod omap34xx_usb_tll_hs_hwmod;
 
 /* L3 -> L4_CORE interface */
 static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = {
@@ -3574,6 +3576,185 @@ static struct omap_hwmod omap3xxx_mmc3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 };
 
+/*
+ * 'usb_host_hs' class
+ * high-speed multi-port usb host controller
+ */
+static struct omap_hwmod_ocp_if omap34xx_usb_host_hs__l3_main_2 = {
+   .master = &omap34xx_usb_host_hs_hwmod,
+   .slave  = &omap3xxx_l3_main_hwmod,
+   .clk= "core_l3_ick",
+   .user   = OCP_USER_MPU,
+};
+
+static struct omap_hwmod_class_sysconfig omap34xx_usb_host_hs_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+  MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap34xx_usb_host_hs_hwmod_class = {
+   .name = "usbhs_uhh",
+   .sysc = &omap34xx_usb_host_hs_sysc,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_usb_host_hs_masters[] = {
+   &omap34xx_usb_host_hs__l3_main_2,
+};
+
+static struct omap_hwmod_irq_info omap34xx_usb_host_hs_irqs[] = {
+   { .name = "ohci-irq", .irq = 76 },
+   { .name = "ehci-irq", .irq = 77 },
+};
+
+static struct omap_hwmod_addr_space omap34xx_usb_host_hs_addrs[] = {
+   {
+   .name   = "uhh",
+   .pa_start   = 0x48064000,
+   .pa_end = 0x480643ff,
+   .flags  = ADDR_TYPE_RT
+   },
+   {
+   .name   = "ohci",
+   .pa_start   = 0x48064400,
+   .pa_end = 0x480647FF,
+   .flags  = ADDR_MAP_ON_INIT
+   },
+   {
+   .name   = "ehci",
+   .pa_start   = 0x48064800,
+   .pa_end = 0x48064CFF,
+   .flags  = ADDR_MAP_ON_INIT
+   }
+};
+
+static struct omap_hwmod_ocp_if omap34xx_l4_cfg__usb_host_hs = {
+   .master = &omap3xxx_l4_core_hwmod,
+   .slave  = &omap34xx_usb_host_hs_hwmod,
+   .clk= "l4_ick",
+   .addr   = omap34xx_usb_host_hs_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap34xx_usb_host_hs_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if omap34xx_f128m_cfg__usb_host_hs = {
+   .clk= "usbhost_120m_fck",
+   .user   = OCP_USER_MPU,
+   .flags  = OCPIF_SWSUP_IDLE,
+};
+
+static struct omap_hwmod_ocp_if omap34xx_f48m_cfg__usb_host_hs = {
+   .clk= "usbhost_48m_fck",
+   .user   = OCP_USER_MPU,
+   .flags  = OCPIF_SWSUP_IDLE,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_usb_host_hs_slaves[] = {
+   &omap34xx_l4_cfg__usb_host_hs,
+   &omap34xx_f128m_cfg__usb_host_hs,
+   &omap34xx_f48m_cfg__usb_host_hs,
+};
+
+static struct omap_hwmod omap34xx_usb_host_hs_hwmod = {
+   .name   = "usbhs_uhh",
+   .class  = &omap34xx_usb_host_hs_hwmod_class,
+   .mpu_irqs   = omap34xx_usb_host_hs_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap34xx_usb_host_hs_irqs),
+   .main_clk   = "usbhost_ick",
+   .prcm = {
+   .omap2 = {
+   .module_offs = OMAP3430ES2_USBHOST_MOD,
+   .prcm_reg_id = 1,
+   .module_bit = 0,
+   .idlest_reg_id = 1,
+   .idlest_idle_bit = 1,
+   .idlest_stdby_bit = 0,
+   },
+   },
+   .slaves = omap34xx_usb_host_hs_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap34xx_usb_host_hs_slaves),
+   .masters= omap34xx_usb_host_hs_masters,
+   .masters_cnt= ARRAY_SIZ

[RESEND][PATCH 3/5] arm: omap: usb: device name change for the clk names of usbhs

2011-05-16 Thread Keshava Munegowda
From: Keshava Munegowda 

The usbhs core driver does not enable/disable the intefrace and
fucntional clocks; These clocks are handled by hwmod and runtime pm,
hence insted of the clock enable/disable, the runtime pm APIS are
used. however,the port clocks and tll clocks are handled
by the usbhs core.

Signed-off-by: Keshava Munegowda 
---
 drivers/mfd/omap-usb-host.c |  131 +++
 1 files changed, 9 insertions(+), 122 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 48ada2d..bd63429 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define USBHS_DRIVER_NAME  "usbhs_omap"
 #define OMAP_EHCI_DEVICE   "ehci-omap"
@@ -146,9 +147,6 @@
 
 
 struct usbhs_hcd_omap {
-   struct clk  *usbhost_ick;
-   struct clk  *usbhost_hs_fck;
-   struct clk  *usbhost_fs_fck;
struct clk  *xclk60mhsp1_ck;
struct clk  *xclk60mhsp2_ck;
struct clk  *utmi_p1_fck;
@@ -158,8 +156,6 @@ struct usbhs_hcd_omap {
struct clk  *usbhost_p2_fck;
struct clk  *usbtll_p2_fck;
struct clk  *init_60m_fclk;
-   struct clk  *usbtll_fck;
-   struct clk  *usbtll_ick;
 
void __iomem*uhh_base;
void __iomem*tll_base;
@@ -351,46 +347,13 @@ static int __devinit usbhs_omap_probe(struct 
platform_device *pdev)
omap->platdata.ehci_data = pdata->ehci_data;
omap->platdata.ohci_data = pdata->ohci_data;
 
-   omap->usbhost_ick = clk_get(dev, "usbhost_ick");
-   if (IS_ERR(omap->usbhost_ick)) {
-   ret =  PTR_ERR(omap->usbhost_ick);
-   dev_err(dev, "usbhost_ick failed error:%d\n", ret);
-   goto err_end;
-   }
-
-   omap->usbhost_hs_fck = clk_get(dev, "hs_fck");
-   if (IS_ERR(omap->usbhost_hs_fck)) {
-   ret = PTR_ERR(omap->usbhost_hs_fck);
-   dev_err(dev, "usbhost_hs_fck failed error:%d\n", ret);
-   goto err_usbhost_ick;
-   }
-
-   omap->usbhost_fs_fck = clk_get(dev, "fs_fck");
-   if (IS_ERR(omap->usbhost_fs_fck)) {
-   ret = PTR_ERR(omap->usbhost_fs_fck);
-   dev_err(dev, "usbhost_fs_fck failed error:%d\n", ret);
-   goto err_usbhost_hs_fck;
-   }
-
-   omap->usbtll_fck = clk_get(dev, "usbtll_fck");
-   if (IS_ERR(omap->usbtll_fck)) {
-   ret = PTR_ERR(omap->usbtll_fck);
-   dev_err(dev, "usbtll_fck failed error:%d\n", ret);
-   goto err_usbhost_fs_fck;
-   }
-
-   omap->usbtll_ick = clk_get(dev, "usbtll_ick");
-   if (IS_ERR(omap->usbtll_ick)) {
-   ret = PTR_ERR(omap->usbtll_ick);
-   dev_err(dev, "usbtll_ick failed error:%d\n", ret);
-   goto err_usbtll_fck;
-   }
+   pm_runtime_enable(&pdev->dev);
 
omap->utmi_p1_fck = clk_get(dev, "utmi_p1_gfclk");
if (IS_ERR(omap->utmi_p1_fck)) {
ret = PTR_ERR(omap->utmi_p1_fck);
dev_err(dev, "utmi_p1_gfclk failed error:%d\n", ret);
-   goto err_usbtll_ick;
+   goto err_end;
}
 
omap->xclk60mhsp1_ck = clk_get(dev, "xclk60mhsp1_ck");
@@ -520,22 +483,8 @@ err_xclk60mhsp1_ck:
 err_utmi_p1_fck:
clk_put(omap->utmi_p1_fck);
 
-err_usbtll_ick:
-   clk_put(omap->usbtll_ick);
-
-err_usbtll_fck:
-   clk_put(omap->usbtll_fck);
-
-err_usbhost_fs_fck:
-   clk_put(omap->usbhost_fs_fck);
-
-err_usbhost_hs_fck:
-   clk_put(omap->usbhost_hs_fck);
-
-err_usbhost_ick:
-   clk_put(omap->usbhost_ick);
-
 err_end:
+   pm_runtime_disable(&pdev->dev);
kfree(omap);
 
 end_probe:
@@ -569,11 +518,7 @@ static int __devexit usbhs_omap_remove(struct 
platform_device *pdev)
clk_put(omap->utmi_p2_fck);
clk_put(omap->xclk60mhsp1_ck);
clk_put(omap->utmi_p1_fck);
-   clk_put(omap->usbtll_ick);
-   clk_put(omap->usbtll_fck);
-   clk_put(omap->usbhost_fs_fck);
-   clk_put(omap->usbhost_hs_fck);
-   clk_put(omap->usbhost_ick);
+   pm_runtime_disable(&pdev->dev);
kfree(omap);
 
return 0;
@@ -693,7 +638,6 @@ static int usbhs_enable(struct device *dev)
struct usbhs_omap_platform_data *pdata = &omap->platdata;
unsigned long   flags = 0;
int ret = 0;
-   unsigned long   timeout;
unsignedreg;
 
dev_dbg(dev, "starting TI HSUSB Controller\n");
@@ -706,11 +650,7 @@ static int usbhs_enable(struct device *dev)
if (omap->count > 0)
goto end_count;
 
-   clk_enabl

[RESEND][PATCH 3/5] arm: omap: usb: device name change for the clk names of usbhs

2011-05-16 Thread Keshava Munegowda
From: Keshava Munegowda 

The global suspend and resume functions for usbhs core driver
are implemented.These routine are called when the global suspend
and resume occurs. Before calling these functions, the
bus suspend and resume of ehci and ohci drivers are called
from runtime pm.

Signed-off-by: Keshava Munegowda 
---
 drivers/mfd/omap-usb-host.c |  103 +++
 1 files changed, 103 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index bd63429..e1bc3b5 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -146,6 +146,10 @@
 #define is_ehci_hsic_mode(x)   (x == OMAP_EHCI_PORT_MODE_HSIC)
 
 
+/* USBHS state bits */
+#define OMAP_USBHS_INIT0
+#define OMAP_USBHS_SUSPEND 4
+
 struct usbhs_hcd_omap {
struct clk  *xclk60mhsp1_ck;
struct clk  *xclk60mhsp2_ck;
@@ -165,6 +169,7 @@ struct usbhs_hcd_omap {
u32 usbhs_rev;
spinlock_t  lock;
int count;
+   unsigned long   state;
 };
 /*-*/
 
@@ -807,6 +812,8 @@ static int usbhs_enable(struct device *dev)
(pdata->ehci_data->reset_gpio_port[1], 1);
}
 
+   set_bit(OMAP_USBHS_INIT, &omap->state);
+
 end_count:
omap->count++;
spin_unlock_irqrestore(&omap->lock, flags);
@@ -895,6 +902,7 @@ static void usbhs_disable(struct device *dev)
}
 
pm_runtime_put_sync(dev);
+   clear_bit(OMAP_USBHS_INIT, &omap->state);
 
/* The gpio_free migh sleep; so unlock the spinlock */
spin_unlock_irqrestore(&omap->lock, flags);
@@ -924,10 +932,105 @@ void omap_usbhs_disable(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(omap_usbhs_disable);
 
+#ifdef CONFIG_PM
+
+static int usbhs_resume(struct device *dev)
+{
+   struct usbhs_hcd_omap   *omap = dev_get_drvdata(dev);
+   struct usbhs_omap_platform_data *pdata = &omap->platdata;
+   unsigned long   flags = 0;
+
+   dev_dbg(dev, "Resuming TI HSUSB Controller\n");
+
+   if (!pdata) {
+   dev_dbg(dev, "missing platform_data\n");
+   return  -ENODEV;
+   }
+
+   spin_lock_irqsave(&omap->lock, flags);
+
+   if (!test_bit(OMAP_USBHS_INIT, &omap->state) ||
+   !test_bit(OMAP_USBHS_SUSPEND, &omap->state))
+   goto end_resume;
+
+   pm_runtime_get_sync(dev);
+
+   if (is_omap_usbhs_rev2(omap)) {
+   if (is_ehci_tll_mode(pdata->port_mode[0])) {
+   clk_enable(omap->usbhost_p1_fck);
+   clk_enable(omap->usbtll_p1_fck);
+   }
+   if (is_ehci_tll_mode(pdata->port_mode[1])) {
+   clk_enable(omap->usbhost_p2_fck);
+   clk_enable(omap->usbtll_p2_fck);
+   }
+   clk_enable(omap->utmi_p1_fck);
+   clk_enable(omap->utmi_p2_fck);
+   }
+   clear_bit(OMAP_USBHS_SUSPEND, &omap->state);
+
+end_resume:
+   spin_unlock_irqrestore(&omap->lock, flags);
+   return 0;
+}
+
+
+static int usbhs_suspend(struct device *dev)
+{
+   struct usbhs_hcd_omap   *omap = dev_get_drvdata(dev);
+   struct usbhs_omap_platform_data *pdata = &omap->platdata;
+   unsigned long   flags = 0;
+
+   dev_dbg(dev, "Suspending TI HSUSB Controller\n");
+
+   if (!pdata) {
+   dev_dbg(dev, "missing platform_data\n");
+   return  -ENODEV;
+   }
+
+   spin_lock_irqsave(&omap->lock, flags);
+
+   if (!test_bit(OMAP_USBHS_INIT, &omap->state) ||
+   test_bit(OMAP_USBHS_SUSPEND, &omap->state))
+   goto end_suspend;
+
+   if (is_omap_usbhs_rev2(omap)) {
+   if (is_ehci_tll_mode(pdata->port_mode[0])) {
+   clk_disable(omap->usbhost_p1_fck);
+   clk_disable(omap->usbtll_p1_fck);
+   }
+   if (is_ehci_tll_mode(pdata->port_mode[1])) {
+   clk_disable(omap->usbhost_p2_fck);
+   clk_disable(omap->usbtll_p2_fck);
+   }
+   clk_disable(omap->utmi_p2_fck);
+   clk_disable(omap->utmi_p1_fck);
+   }
+
+   set_bit(OMAP_USBHS_SUSPEND, &omap->state);
+   pm_runtime_put_sync(dev);
+
+end_suspend:
+   spin_unlock_irqrestore(&omap->lock, flags);
+   return 0;
+}
+
+
+static const struct dev_pm_ops usbhsomap_dev_pm_ops = {
+   .suspend= usbhs_suspend,
+   .resume = usbhs_resume,
+};
+
+#define USBHS_OMAP_DEV_PM_OPS (&usbhsomap_dev_pm_ops)
+#else
+#defineUSBHS_OMAP_DEV_PM_OPS   NULL
+#endif
+
 static struct platform_driver usbhs_omap_driver = {
.driver = {
 

[RESEND][PATCH 0/5] arm: omap: usb: Runtime PM support for EHCI and OHCI drivers

2011-05-16 Thread Keshava Munegowda
From: Keshava Munegowda 

The Hwmod structures and Runtime PM features are implemented 
For EHCI and OHCI drivers of OMAP3 and OMAP4.
The global suspend/resume of EHCI and OHCI 
is validated on OMAP3430 sdp board with these patches.

Keshava Munegowda (5):
  arm: omap: usb: ehci and ohci hwmod structures for omap3 and omap4
  arm: omap: usb: register hwmods of usbhs
  arm: omap: usb: device name change for the clk names of usbhs
  arm: omap: usb: Runtime PM support
  arm: omap: usb: global Suspend and resume support of ehci and ohci

 arch/arm/mach-omap2/clock3xxx_data.c   |   28 ++--
 arch/arm/mach-omap2/clock44xx_data.c   |   10 +-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  184 ++
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  153 ++
 arch/arm/mach-omap2/usb-host.c |   99 
 drivers/mfd/omap-usb-host.c|  236 +---
 6 files changed, 504 insertions(+), 206 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


[RESEND][PATCH 2/5] arm: omap: usb: register hwmods of usbhs

2011-05-16 Thread Keshava Munegowda
The hwmod structure of uhh and tll are retrived
and registered with omap device

Signed-off-by: Keshava Munegowda 
---
 arch/arm/mach-omap2/usb-host.c |   99 ++--
 1 files changed, 35 insertions(+), 64 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index 89ae298..9d762c4 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -28,51 +28,28 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "mux.h"
 
 #ifdef CONFIG_MFD_OMAP_USB_HOST
 
-#define OMAP_USBHS_DEVICE  "usbhs-omap"
-
-static struct resource usbhs_resources[] = {
-   {
-   .name   = "uhh",
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .name   = "tll",
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .name   = "ehci",
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .name   = "ehci-irq",
-   .flags  = IORESOURCE_IRQ,
-   },
-   {
-   .name   = "ohci",
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .name   = "ohci-irq",
-   .flags  = IORESOURCE_IRQ,
-   }
-};
-
-static struct platform_device usbhs_device = {
-   .name   = OMAP_USBHS_DEVICE,
-   .id = 0,
-   .num_resources  = ARRAY_SIZE(usbhs_resources),
-   .resource   = usbhs_resources,
-};
+#define OMAP_USBHS_DEVICE  "usbhs_omap"
+#defineUSBHS_UHH_HWMODNAME "usbhs_uhh"
+#define USBHS_TLL_HWMODNAME"usbhs_tll"
 
 static struct usbhs_omap_platform_data usbhs_data;
 static struct ehci_hcd_omap_platform_data  ehci_data;
 static struct ohci_hcd_omap_platform_data  ohci_data;
 
+static struct omap_device_pm_latency omap_uhhtll_latency[] = {
+ {
+   .deactivate_func = omap_device_idle_hwmods,
+   .activate_func   = omap_device_enable_hwmods,
+   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+ },
+};
+
 /* MUX settings for EHCI pins */
 /*
  * setup_ehci_io_mux - initialize IO pad mux for USBHOST
@@ -508,7 +485,10 @@ static void setup_4430ohci_io_mux(const enum 
usbhs_omap_port_mode *port_mode)
 
 void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
 {
-   int i;
+   struct omap_hwmod   *oh[2];
+   struct omap_device  *od;
+   int bus_id = -1;
+   int i;
 
for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
usbhs_data.port_mode[i] = pdata->port_mode[i];
@@ -523,44 +503,35 @@ void __init usbhs_init(const struct usbhs_omap_board_data 
*pdata)
usbhs_data.ohci_data = &ohci_data;
 
if (cpu_is_omap34xx()) {
-   usbhs_resources[0].start = OMAP34XX_UHH_CONFIG_BASE;
-   usbhs_resources[0].end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1;
-   usbhs_resources[1].start = OMAP34XX_USBTLL_BASE;
-   usbhs_resources[1].end = OMAP34XX_USBTLL_BASE + SZ_4K - 1;
-   usbhs_resources[2].start= OMAP34XX_EHCI_BASE;
-   usbhs_resources[2].end  = OMAP34XX_EHCI_BASE + SZ_1K - 1;
-   usbhs_resources[3].start = INT_34XX_EHCI_IRQ;
-   usbhs_resources[4].start= OMAP34XX_OHCI_BASE;
-   usbhs_resources[4].end  = OMAP34XX_OHCI_BASE + SZ_1K - 1;
-   usbhs_resources[5].start = INT_34XX_OHCI_IRQ;
setup_ehci_io_mux(pdata->port_mode);
setup_ohci_io_mux(pdata->port_mode);
} else if (cpu_is_omap44xx()) {
-   usbhs_resources[0].start = OMAP44XX_UHH_CONFIG_BASE;
-   usbhs_resources[0].end = OMAP44XX_UHH_CONFIG_BASE + SZ_1K - 1;
-   usbhs_resources[1].start = OMAP44XX_USBTLL_BASE;
-   usbhs_resources[1].end = OMAP44XX_USBTLL_BASE + SZ_4K - 1;
-   usbhs_resources[2].start = OMAP44XX_HSUSB_EHCI_BASE;
-   usbhs_resources[2].end = OMAP44XX_HSUSB_EHCI_BASE + SZ_1K - 1;
-   usbhs_resources[3].start = OMAP44XX_IRQ_EHCI;
-   usbhs_resources[4].start = OMAP44XX_HSUSB_OHCI_BASE;
-   usbhs_resources[4].end = OMAP44XX_HSUSB_OHCI_BASE + SZ_1K - 1;
-   usbhs_resources[5].start = OMAP44XX_IRQ_OHCI;
setup_4430ehci_io_mux(pdata->port_mode);
setup_4430ohci_io_mux(pdata->port_mode);
}
 
-   if (platform_device_add_data(&usbhs_device,
-   &usbhs_data, sizeof(usbhs_data)) < 0) {
-   printk(KERN_ERR "USBHS platform_device_add_data failed\n");
-   goto init_end;
+   oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
+   if (!oh[0]) {
+   pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
+   return;
}
 
-   if (platform_device_register(&usbhs_device) < 0)
-   printk(KERN_ERR "USBHS platform_device_re

Re: [PATCH v2 3/4] REGULATOR: TWL6025: add support to twl-regulator

2011-05-16 Thread T Krishnamoorthy, Balaji
On Thu, May 12, 2011 at 6:57 PM, Graeme Gregory  wrote:
> Adding support for the twl6025. Major difference in the twl6025 is the
> group functionality has been removed from the chip so this affects how
> regulators are enabled and disabled.
>
> The names of the regulators also changed.
>
> The DCDCs of the 6025 are software controllable as well.
>
> Since V1
>
> Use the features variable passed via platform data instead of calling
> global function.
>
> Change the very switch like if statements to be a more readable
> switch statement.
>
> Signed-off-by: Graeme Gregory 
> ---
>  drivers/regulator/twl-regulator.c |  414 +---
>  1 files changed, 379 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/regulator/twl-regulator.c 
> b/drivers/regulator/twl-regulator.c
> index 2a808c2..51f28cc 100644
> --- a/drivers/regulator/twl-regulator.c
> +++ b/drivers/regulator/twl-regulator.c
> @@ -51,8 +51,13 @@ struct twlreg_info {
>u16 min_mV;
>u16 max_mV;
>
> +   u8  flags;
> +
>/* used by regulator core */
>struct regulator_desc   desc;
> +
> +   /* chip specific features */
> +   unsigned long   features;
>  };
>
>
> @@ -70,6 +75,7 @@ struct twlreg_info {
>  #define VREG_TRANS 1
>  #define VREG_STATE 2
>  #define VREG_VOLTAGE   3
> +#define VREG_VOLTAGE_DCDC  4
>  /* TWL6030 Misc register offsets */
>  #define VREG_BC_ALL1
>  #define VREG_BC_REF2
> @@ -87,6 +93,17 @@ struct twlreg_info {
>  #define TWL6030_CFG_STATE_APP(v)   (((v) & TWL6030_CFG_STATE_APP_MASK) 
> >>\
>TWL6030_CFG_STATE_APP_SHIFT)
>
> +/* Flags for DCDC Voltage reading */
> +#define DCDC_OFFSET_EN BIT(0)
> +#define DCDC_EXTENDED_EN   BIT(1)
> +
> +/* twl6025 SMPS EPROM values */
> +#define TWL6030_SMPS_OFFSET0xB0
> +#define TWL6030_SMPS_MULT  0xB3
> +#define SMPS_MULTOFFSET_SMPS4  BIT(0)
> +#define SMPS_MULTOFFSET_VIOBIT(1)
> +#define SMPS_MULTOFFSET_SMPS3  BIT(6)
> +
>  static inline int
>  twlreg_read(struct twlreg_info *info, unsigned slave_subgp, unsigned offset)
>  {
> @@ -144,11 +161,15 @@ static int twl6030reg_is_enabled(struct regulator_dev 
> *rdev)
>struct twlreg_info  *info = rdev_get_drvdata(rdev);
>int grp, val;
>
> -   grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP);
> -   if (grp < 0)
> -   return grp;
> +   if (!(info->features & TWL6025_SUBCLASS)) {
> +   grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP);
> +   if (grp < 0)
> +   return grp;
>
> -   grp &= P1_GRP_6030;
> +   grp &= P1_GRP_6030;
> +   } else {
> +   grp = 1;
> +   }
>
>val = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_STATE);
>val = TWL6030_CFG_STATE_APP(val);
> @@ -159,19 +180,22 @@ static int twl6030reg_is_enabled(struct regulator_dev 
> *rdev)
>  static int twlreg_enable(struct regulator_dev *rdev)
>  {
>struct twlreg_info  *info = rdev_get_drvdata(rdev);
> -   int grp;
> -   int ret;
> +   int grp = 0;
> +   int ret = 0;
>
> -   grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP);
> -   if (grp < 0)
> -   return grp;
> +   if (!(twl_class_is_6030() && (info->features & TWL6025_SUBCLASS))) {
> +   grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP);
> +   if (grp < 0)
> +   return grp;
>
> -   if (twl_class_is_4030())
> -   grp |= P1_GRP_4030;
> -   else
> -   grp |= P1_GRP_6030;
> +   if (twl_class_is_4030())
> +   grp |= P1_GRP_4030;
> +   else
> +   grp |= P1_GRP_6030;
>
> -   ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_GRP, grp);
> +   ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER,
> +   VREG_GRP, grp);
> +   }
>
>if (!ret && twl_class_is_6030())
>ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_STATE,
> @@ -186,29 +210,34 @@ static int twlreg_enable(struct regulator_dev *rdev)
>  static int twlreg_disable(struct regulator_dev *rdev)
>  {
>struct twlreg_info  *info = rdev_get_drvdata(rdev);
> -   int grp;
> -   int ret;
> -
> -   grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP);
> -   if (grp < 0)
> -   return grp;
> -
> -   /* For 6030, set the off state for all grps enabled */
> -   if (twl_class_is_6030()) {
> -   ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_STATE,
> -   (grp & 

[PATCH v1] omap: usbhs: Fixed the crash during rmmod of ehci and ohci

2011-05-16 Thread Keshava Munegowda
From: Keshava Munegowda 

The disabling of clocks and freeing GPIO are changed
to fix the occurrence of the crash of rmmod of ehci and ohci
drivers. The GPIOs should be freed after the spin locks are
unlocked.

Signed-off-by: Keshava Munegowda 
---
 drivers/mfd/omap-usb-host.c |   27 +++
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 3ab9ffa..55c5d47 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -994,22 +994,33 @@ static void usbhs_disable(struct device *dev)
dev_dbg(dev, "operation timed out\n");
}
 
-   if (pdata->ehci_data->phy_reset) {
-   if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
-   gpio_free(pdata->ehci_data->reset_gpio_port[0]);
-
-   if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
-   gpio_free(pdata->ehci_data->reset_gpio_port[1]);
+   if (is_omap_usbhs_rev2(omap)) {
+   if (is_ehci_tll_mode(pdata->port_mode[0]))
+   clk_enable(omap->usbtll_p1_fck);
+   if (is_ehci_tll_mode(pdata->port_mode[1]))
+   clk_enable(omap->usbtll_p2_fck);
+   clk_disable(omap->utmi_p2_fck);
+   clk_disable(omap->utmi_p1_fck);
}
 
-   clk_disable(omap->utmi_p2_fck);
-   clk_disable(omap->utmi_p1_fck);
clk_disable(omap->usbtll_ick);
clk_disable(omap->usbtll_fck);
clk_disable(omap->usbhost_fs_fck);
clk_disable(omap->usbhost_hs_fck);
clk_disable(omap->usbhost_ick);
 
+   /* The gpio_free migh sleep; so unlock the spinlock */
+   spin_unlock_irqrestore(&omap->lock, flags);
+
+   if (pdata->ehci_data->phy_reset) {
+   if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
+   gpio_free(pdata->ehci_data->reset_gpio_port[0]);
+
+   if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
+   gpio_free(pdata->ehci_data->reset_gpio_port[1]);
+   }
+   return;
+
 end_disble:
spin_unlock_irqrestore(&omap->lock, flags);
 }
-- 
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] omap: usbhs: Fixed the crash during rmmod of ehci and ohci

2011-05-16 Thread Keshava Munegowda
From: Keshava Munegowda 

The disableing of clocks and freeing GPIO are changed
to fix the occurence of the crash of rmmod of ehci and ohci
drivers. The GPIOs should be freed after the spin locks are
unlocked.

Signed-off-by: Keshava Munegowda 
---
 drivers/mfd/omap-usb-host.c |   27 +++
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 3ab9ffa..55c5d47 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -994,22 +994,33 @@ static void usbhs_disable(struct device *dev)
dev_dbg(dev, "operation timed out\n");
}
 
-   if (pdata->ehci_data->phy_reset) {
-   if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
-   gpio_free(pdata->ehci_data->reset_gpio_port[0]);
-
-   if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
-   gpio_free(pdata->ehci_data->reset_gpio_port[1]);
+   if (is_omap_usbhs_rev2(omap)) {
+   if (is_ehci_tll_mode(pdata->port_mode[0]))
+   clk_enable(omap->usbtll_p1_fck);
+   if (is_ehci_tll_mode(pdata->port_mode[1]))
+   clk_enable(omap->usbtll_p2_fck);
+   clk_disable(omap->utmi_p2_fck);
+   clk_disable(omap->utmi_p1_fck);
}
 
-   clk_disable(omap->utmi_p2_fck);
-   clk_disable(omap->utmi_p1_fck);
clk_disable(omap->usbtll_ick);
clk_disable(omap->usbtll_fck);
clk_disable(omap->usbhost_fs_fck);
clk_disable(omap->usbhost_hs_fck);
clk_disable(omap->usbhost_ick);
 
+   /* The gpio_free migh sleep; so unlock the spinlock */
+   spin_unlock_irqrestore(&omap->lock, flags);
+
+   if (pdata->ehci_data->phy_reset) {
+   if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
+   gpio_free(pdata->ehci_data->reset_gpio_port[0]);
+
+   if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
+   gpio_free(pdata->ehci_data->reset_gpio_port[1]);
+   }
+   return;
+
 end_disble:
spin_unlock_irqrestore(&omap->lock, flags);
 }
-- 
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: beagleboardxm 2.6.39rc4 mcbsp problems.

2011-05-16 Thread Peter Ujfalusi
On Saturday 14 May 2011 05:47:33 Steve Calfee wrote:
> I put in a few debug statements. It appears that my DMA never gets
> started. I know it can work with a different machine and codec driver,
> but not mine. I don't see any explicit DMA init, but that must be the
> problem.  Any more ideas?

You mean neither omap_pcm_hw_params nor omap_pcm_trigger got called?
Could you post the output of dmesg related to ASoC? Does the connection 
between the CPU and codec DAI correct?
Does McBSP part got initialized (for example does omap_mcbsp_dai_hw_params, 
omap_mcbsp_dai_trigger got called)?

-- 
Péter
--
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 4/6] OMAP: LDP: Port the display driver to new DSS2

2011-05-16 Thread Tomi Valkeinen
On Thu, 2011-05-12 at 09:40 +0300, Igor Grinberg wrote:
> 
> On 05/11/11 09:32, Tomi Valkeinen wrote:
> 
> > On Wed, 2011-05-11 at 10:28 +0530, Janorkar, Mayuresh wrote:
> >
> >>> +static void __init ldp_display_init(void)
> >>> +{
> >>> + int r;
> >>> +
> >>> + struct gpio gpios[] = {
> >>> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
> >>> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> >>> + {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
> >>> + {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD
> >>> BACKLIGHT"},
> >>> + };
> >>> +
> >>> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> >>> + if (r) {
> >>> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> >>> + return;
> >>> + }
> >> If I test with this patch, this request is returning error.
> > Hmm. Well, the GPIOs are the same as in the old driver. However, the old
> > driver doesn't even seem to check if it manages to request the GPIOs, so
> > it may well be that it was failing also.
> >
> > Can you check from /sys/class/gpio/ if some of the GPIOs are already
> > allocated: 207, 199, 55, 56?
> >
> > The definition of two of those GPIOs look kinda funny to me: (15 +
> > OMAP_MAX_GPIO_LINES). I don't know what OMAP_MAX_GPIO_LINES means, but
> > it sure doesn't sound ok to have a GPIO number that is 15 over the
> > maximum =).
> >
> 
> This means that some kind of gpio expander is used.
> I bet those are twl gpios (or may be some other discrete chip).
> If those are twl gpios then you need to provide the .setup callback
> in struct twl4030_gpio_platform_data which will request and setup those gpios.

Here's an updated patch with the twl gpio code.

All the old omapfb porting patches, including new drivers for DSS2, can
be found from 

git://gitorious.org/linux-omap-dss2/linux.git old-omapfb-port

 Tomi

diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index e2ba779..ed78b9a 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -44,6 +44,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 #include "board-flash.h"
 #include "mux.h"
 #include "hsmmc.h"
@@ -275,19 +278,70 @@ static inline void __init ldp_init_smsc911x(void)
gpio_direction_input(eth_gpio);
 }
 
-static struct platform_device ldp_lcd_device = {
-   .name   = "ldp_lcd",
-   .id = -1,
+/* LCD */
+
+static int ldp_backlight_gpio;
+static int ldp_lcd_enable_gpio;
+
+#define LCD_PANEL_RESET_GPIO   55
+#define LCD_PANEL_QVGA_GPIO56
+
+static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+   gpio_direction_output(ldp_lcd_enable_gpio, 1);
+   gpio_direction_output(ldp_backlight_gpio, 1);
+
+   return 0;
+}
+
+static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+   gpio_direction_output(ldp_lcd_enable_gpio, 0);
+   gpio_direction_output(ldp_backlight_gpio, 0);
+}
+
+static struct panel_generic_dpi_data ldp_panel_data = {
+   .name   = "2430sdp",
+   .platform_enable= ldp_panel_enable_lcd,
+   .platform_disable   = ldp_panel_disable_lcd,
+};
+
+static struct omap_dss_device ldp_lcd_device = {
+   .name   = "lcd",
+   .driver_name= "generic_dpi_panel",
+   .type   = OMAP_DISPLAY_TYPE_DPI,
+   .phy.dpi.data_lines = 16,
+   .data   = &ldp_panel_data,
 };
 
-static struct omap_lcd_config ldp_lcd_config __initdata = {
-   .ctrl_name  = "internal",
+static struct omap_dss_device *ldp_dss_devices[] = {
+   &ldp_lcd_device,
 };
 
-static struct omap_board_config_kernel ldp_config[] __initdata = {
-   { OMAP_TAG_LCD, &ldp_lcd_config },
+static struct omap_dss_board_info ldp_dss_data = {
+   .num_devices= ARRAY_SIZE(ldp_dss_devices),
+   .devices= ldp_dss_devices,
+   .default_device = &ldp_lcd_device,
 };
 
+static void __init ldp_display_init(void)
+{
+   int r;
+
+   static struct gpio gpios[] __initdata = {
+   {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
+   {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
+   };
+
+   r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
+   if (r) {
+   pr_err("Cannot request LCD GPIOs, error %d\n", r);
+   return;
+   }
+
+   omap_display_init(&ldp_dss_data);
+}
+
 static void __init omap_ldp_init_early(void)
 {
omap2_init_common_infrastructure();
@@ -298,10 +352,30 @@ static struct twl4030_usb_data ldp_usb_data = {
.usb_mode   = T2_USB_MODE_ULPI,
 };
 
+static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned 
ngpio)
+{
+   int r;
+
+   struct gpio gpios[] = {
+   {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
+   {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
+   };
+
+

RE: [PATCH v4 4/4] OMAP: DSS: Add picodlp panel driver

2011-05-16 Thread Janorkar, Mayuresh


> -Original Message-
> From: Valkeinen, Tomi
> Sent: Monday, May 16, 2011 12:29 PM
> To: Janorkar, Mayuresh
> Cc: linux-omap@vger.kernel.org; K, Mythri P
> Subject: RE: [PATCH v4 4/4] OMAP: DSS: Add picodlp panel driver
> 
> On Mon, 2011-05-16 at 09:54 +0530, Janorkar, Mayuresh wrote:
> >
> > > -Original Message-
> > > From: Valkeinen, Tomi
> > > Sent: Thursday, May 12, 2011 8:40 PM
> > > To: Janorkar, Mayuresh
> > > Cc: linux-omap@vger.kernel.org; K, Mythri P
> > > Well, when is picodlp_i2c_remove() called? Isn't it called when the
> i2c
> > > client is being removed, i.e. when somebody has called
> > > i2c_unregister_device()?
> >
> > The matching API for i2c_add_device is i2c_del_device.
> 
> These are _driver_ functions not device.
> 
> > And i2c_unregister_device is a matching API for i2c_new_device.
> >
> > i2c_del_device (a call present in picodlp_exit) would call i2c_remove
> > and then i2c_remove has a call to i2c_unregister_device which would
> > unregister the i2c_device.
> >
> > So panel_remove should also have a call to i2c_unregister_device.
> > This would solve the problem.
> 
> I believe panel_remove should be the only place to have
> i2c_unregister_device. It is, as you said, counterpart of
> i2c_new_device, and that is called from panel_probe.

Looks fine.

> 
>  Tomi
> 

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


Re: [PATCH] ARM: omap4: i2c reset regs postidle

2011-05-16 Thread Andy Green

On 05/16/2011 09:56 AM, Somebody in the thread at some point said:

Am Donnerstag, den 21.04.2011, 13:13 +0100 schrieb Andy Green:

On 04/21/2011 12:47 PM, Somebody in the thread at some point said:

Without OMAP_I2C_FLAG_RESET_REGS_POSTIDLE I got i2c controller
timeouts on each accsess after an NACK message.
Taking this flag fix it.


Ahhh that will explain why if you accidentally configure LM75 system
monitor support, which isn't there on Panda, the I2C controllers die
slowly on boot.  Good catch!


Can I get an Acked-by ?


Sure, I had it on my tree for a while too.

Tested-by: Andy Green 
Acked-by: Andy Green 

-Andy

--
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/2] [RFC] Shrink clock data utilizing preprocessor

2011-05-16 Thread Sascha Hauer
Hi Vladimir,

On Mon, May 16, 2011 at 12:45:56AM +0300, Vladimir Zapolskiy wrote:
> This change shows a possibility to utilize C preprocessor to remove
> redundant data from clock definitions for OMAP4 architecture.
> 
> If the change is evaluated as a positive one, the same approach could
> be applied in reducing LOCs from other files, which contain monotonous
> data enumeration.
> 
> Vladimir Zapolskiy (2):
>   OMAP4: clock data: shrink clock data utilizing preprocessor.
>   OMAP4: clock data: shrink more clock data.
> 
>  arch/arm/mach-omap2/clock44xx_data.c | 3313 
> +-
>  1 files changed, 848 insertions(+), 2465 deletions(-)

While the diffstat shows a huge saving in loc I suggest to delay this
until we have common clock code merged so that we don't have to
completely rework these files again in the near future.

This has been said before, I just wanted to add my +1 on this opinion.

Sascha

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
--
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: omap4: i2c reset regs postidle

2011-05-16 Thread Jan Weitzel
Am Donnerstag, den 21.04.2011, 13:13 +0100 schrieb Andy Green:
> On 04/21/2011 12:47 PM, Somebody in the thread at some point said:
> > Without OMAP_I2C_FLAG_RESET_REGS_POSTIDLE I got i2c controller
> > timeouts on each accsess after an NACK message.
> > Taking this flag fix it.
> 
> Ahhh that will explain why if you accidentally configure LM75 system 
> monitor support, which isn't there on Panda, the I2C controllers die 
> slowly on boot.  Good catch!

Can I get an Acked-by ?

Jan


--
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: [RESEND PATCH 4/4] omap: drop board-igep0030.c

2011-05-16 Thread Enric Balletbò i Serra
2011/5/12 Mike Rapoport :
> since it is merged into board-igep0020.c
>
> Signed-off-by: Mike Rapoport 
> ---
>  arch/arm/mach-omap2/Kconfig          |    1 +
>  arch/arm/mach-omap2/Makefile         |    2 -
>  arch/arm/mach-omap2/board-igep0030.c |  438 
> --
>  3 files changed, 1 insertions(+), 440 deletions(-)
>  delete mode 100644 arch/arm/mach-omap2/board-igep0030.c
>
> diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
> index b997a35..19d5891 100644
> --- a/arch/arm/mach-omap2/Kconfig
> +++ b/arch/arm/mach-omap2/Kconfig
> @@ -288,6 +288,7 @@ config MACH_IGEP0030
>        depends on ARCH_OMAP3
>        default y
>        select OMAP_PACKAGE_CBB
> +       select MACH_IGEP0020
>
>  config MACH_SBC3530
>        bool "OMAP3 SBC STALKER board"
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index a0c2cae..186f482 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -229,8 +229,6 @@ obj-$(CONFIG_MACH_CM_T35)           += board-cm-t35.o \
>  obj-$(CONFIG_MACH_CM_T3517)            += board-cm-t3517.o
>  obj-$(CONFIG_MACH_IGEP0020)            += board-igep0020.o \
>                                           hsmmc.o
> -obj-$(CONFIG_MACH_IGEP0030)            += board-igep0030.o \
> -                                          hsmmc.o
>  obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK)     += board-omap3touchbook.o \
>                                           hsmmc.o
>  obj-$(CONFIG_MACH_OMAP_4430SDP)                += board-4430sdp.o \
> diff --git a/arch/arm/mach-omap2/board-igep0030.c 
> b/arch/arm/mach-omap2/board-igep0030.c
> deleted file mode 100644
> index 83f6be2..000
> --- a/arch/arm/mach-omap2/board-igep0030.c
> +++ /dev/null
> @@ -1,438 +0,0 @@
> -/*
> - * Copyright (C) 2010 - ISEE 2007 SL
> - *
> - * Modified from mach-omap2/board-generic.c
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2 as
> - * published by the Free Software Foundation.
> - */
> -
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -
> -#include 
> -#include 
> -#include 
> -#include 
> -
> -#include 
> -#include 
> -
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -
> -#include "mux.h"
> -#include "hsmmc.h"
> -#include "sdram-numonyx-m65kam.h"
> -#include "common-board-devices.h"
> -
> -#define IGEP3_GPIO_LED0_GREEN  54
> -#define IGEP3_GPIO_LED0_RED    53
> -#define IGEP3_GPIO_LED1_RED    16
> -
> -#define IGEP3_GPIO_WIFI_NPD    138
> -#define IGEP3_GPIO_WIFI_NRESET 139
> -#define IGEP3_GPIO_BT_NRESET   137
> -
> -#define IGEP3_GPIO_USBH_NRESET  183
> -
> -
> -#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
> -       defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
> -
> -#define ONENAND_MAP             0x2000
> -
> -/*
> - * x2 Flash built-in COMBO POP MEMORY
> - * Since the device is equipped with two DataRAMs, and two-plane NAND
> - * Flash memory array, these two component enables simultaneous program
> - * of 4KiB. Plane1 has only even blocks such as block0, block2, block4
> - * while Plane2 has only odd blocks such as block1, block3, block5.
> - * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
> - */
> -
> -static struct mtd_partition igep3_onenand_partitions[] = {
> -       {
> -               .name           = "X-Loader",
> -               .offset         = 0,
> -               .size           = 2 * (64*(2*2048))
> -       },
> -       {
> -               .name           = "U-Boot",
> -               .offset         = MTDPART_OFS_APPEND,
> -               .size           = 6 * (64*(2*2048)),
> -       },
> -       {
> -               .name           = "Environment",
> -               .offset         = MTDPART_OFS_APPEND,
> -               .size           = 2 * (64*(2*2048)),
> -       },
> -       {
> -               .name           = "Kernel",
> -               .offset         = MTDPART_OFS_APPEND,
> -               .size           = 12 * (64*(2*2048)),
> -       },
> -       {
> -               .name           = "File System",
> -               .offset         = MTDPART_OFS_APPEND,
> -               .size           = MTDPART_SIZ_FULL,
> -       },
> -};
> -
> -static struct omap_onenand_platform_data igep3_onenand_pdata = {
> -       .parts = igep3_onenand_partitions,
> -       .nr_parts = ARRAY_SIZE(igep3_onenand_partitions),
> -       .onenand_setup = NULL,
> -       .dma_channel    = -1,   /* disable DMA in OMAP OneNAND driver */
> -};
> -
> -static struct platform_device igep3_onenand_device = {
> -       .name           = "omap2-onenand",
> -       .id             = -1,
> -       .dev = {
> -               .platform_data = &igep3_onenand_pdata,
> -       },
> -};
> -
> -static void __init igep3_flash_init(void)
> -{
> -       u8 cs = 0;
> -       u8 onenandcs = GPMC_CS_NUM + 1;
> -
> -       for (cs = 0; cs < GPM

Re: [RESEND PATCH 2/4] omap: igep0020: minor refactoring

2011-05-16 Thread Enric Balletbò i Serra
2011/5/15 Arnd Bergmann :
> On Sunday 15 May 2011, m...@compulab.co.il wrote:
>> We can keep all the data structures that differ between IGEP2 and IGEP3.
>> However, this significantly reduces the benifit of the series.
>> There's already code in the IGEP2 that differentiates between HW
>> revisions, so anyway the board support will require some work for
>> devicetree transition. Eventually, when devicetree will be usable on
>> OMAPs, most of the code currently found in arch/arm/mach-omap2/board*
>> will require some work and I hardly believe that the transition can be
>> automated...
>
> True. Let's just use the version you posted then.
>
>        Arnd
>

Acked-by: Enric Balletbo i Serra 
--
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: [RESEND PATCH 3/4] omap: igep0020: add support for IGEP3

2011-05-16 Thread Enric Balletbò i Serra
2011/5/12 Mike Rapoport :
> Add IGEP3 machine support to board-igep0020
>
> Signed-off-by: Mike Rapoport 
> ---
>  arch/arm/mach-omap2/board-igep0020.c |  103 
> ++
>  1 files changed, 80 insertions(+), 23 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-igep0020.c 
> b/arch/arm/mach-omap2/board-igep0020.c
> index ea7cbc6..0d6d583 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -55,6 +55,11 @@
>  #define IGEP2_RC_GPIO_WIFI_NRESET  139
>  #define IGEP2_RC_GPIO_BT_NRESET    137
>
> +#define IGEP3_GPIO_LED0_GREEN  54
> +#define IGEP3_GPIO_LED0_RED    53
> +#define IGEP3_GPIO_LED1_RED    16
> +#define IGEP3_GPIO_USBH_NRESET  183
> +
>  /*
>  * IGEP2 Hardware Revision Table
>  *
> @@ -69,6 +74,7 @@
>
>  #define IGEP2_BOARD_HWREV_B    0
>  #define IGEP2_BOARD_HWREV_C    1
> +#define IGEP3_BOARD_HWREV      2
>
>  static u8 hwrev;
>
> @@ -76,6 +82,11 @@ static void __init igep2_get_revision(void)
>  {
>        u8 ret;
>
> +       if (machine_is_igep0030()) {
> +               hwrev = IGEP3_BOARD_HWREV;
> +               return;
> +       }
> +
>        omap_mux_init_gpio(IGEP2_GPIO_LED1_RED, OMAP_PIN_INPUT);
>
>        if (gpio_request_one(IGEP2_GPIO_LED1_RED, GPIOF_IN, "GPIO_HW0_REV")) {
> @@ -332,24 +343,40 @@ static struct platform_device igep_led_device = {
>
>  static void __init igep_leds_init(void)
>  {
> -       igep_gpio_leds[0].gpio = IGEP2_GPIO_LED0_RED;
> -       igep_gpio_leds[1].gpio = IGEP2_GPIO_LED0_GREEN;
> -       igep_gpio_leds[2].gpio = IGEP2_GPIO_LED1_RED;
> +       if (machine_is_igep0020()) {
> +               igep_gpio_leds[0].gpio = IGEP2_GPIO_LED0_RED;
> +               igep_gpio_leds[1].gpio = IGEP2_GPIO_LED0_GREEN;
> +               igep_gpio_leds[2].gpio = IGEP2_GPIO_LED1_RED;
> +       } else {
> +               igep_gpio_leds[0].gpio = IGEP3_GPIO_LED0_RED;
> +               igep_gpio_leds[1].gpio = IGEP3_GPIO_LED0_GREEN;
> +               igep_gpio_leds[2].gpio = IGEP3_GPIO_LED1_RED;
> +       }
>
>        platform_device_register(&igep_led_device);
>  }
>
>  #else
>  static struct gpio igep_gpio_leds[] __initdata = {
> -       { IGEP2_GPIO_LED0_RED,   GPIOF_OUT_INIT_LOW, "gpio-led:red:d0"   },
> -       { IGEP2_GPIO_LED0_GREEN, GPIOF_OUT_INIT_LOW, "gpio-led:green:d0" },
> -       { IGEP2_GPIO_LED1_RED,   GPIOF_OUT_INIT_LOW, "gpio-led:red:d1"   },
> +       { -EINVAL,      GPIOF_OUT_INIT_LOW, "gpio-led:red:d0"   },
> +       { -EINVAL,      GPIOF_OUT_INIT_LOW, "gpio-led:green:d0" },
> +       { -EINVAL,      GPIOF_OUT_INIT_LOW, "gpio-led:red:d1"   },
>  };
>
>  static inline void igep_leds_init(void)
>  {
>        int i;
>
> +       if (machine_is_igep0020()) {
> +               igep_gpio_leds[0].gpio = IGEP2_GPIO_LED0_RED;
> +               igep_gpio_leds[1].gpio = IGEP2_GPIO_LED0_GREEN;
> +               igep_gpio_leds[2].gpio = IGEP2_GPIO_LED1_RED;
> +       } else {
> +               igep_gpio_leds[0].gpio = IGEP3_GPIO_LED0_RED;
> +               igep_gpio_leds[1].gpio = IGEP3_GPIO_LED0_GREEN;
> +               igep_gpio_leds[2].gpio = IGEP3_GPIO_LED1_RED;
> +       }
> +
>        if (gpio_request_array(igep_gpio_leds, ARRAY_SIZE(igep_gpio_leds))) {
>                pr_warning("IGEP v2: Could not obtain leds gpios\n");
>                return;
> @@ -386,6 +413,9 @@ static int igep_twl_gpio_setup(struct device *dev,
>        igep_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1;
>  #endif
>
> +       if (machine_is_igep0030())
> +               return 0;
> +
>        /*
>         * REVISIT: need ehci-omap hooks for external VBUS
>         * power switch and overcurrent detect
> @@ -548,18 +578,20 @@ static void __init igep_i2c_init(void)
>  {
>        int ret;
>
> -       /*
> -        * Bus 3 is attached to the DVI port where devices like the pico DLP
> -        * projector don't work reliably with 400kHz
> -        */
> -       ret = omap_register_i2c_bus(3, 100, igep2_i2c3_boardinfo,
> -               ARRAY_SIZE(igep2_i2c3_boardinfo));
> -       if (ret)
> -               pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
> -
> -       igep_twldata.codec      = &igep2_codec_data;
> -       igep_twldata.keypad     = &igep2_keypad_pdata;
> -       igep_twldata.vpll2      = &igep2_vpll2;
> +       if (machine_is_igep0020()) {
> +               /*
> +                * Bus 3 is attached to the DVI port where devices like the
> +                * pico DLP projector don't work reliably with 400kHz
> +                */
> +               ret = omap_register_i2c_bus(3, 100, igep2_i2c3_boardinfo,
> +                                           ARRAY_SIZE(igep2_i2c3_boardinfo));
> +               if (ret)
> +                       pr_warning("IGEP2: Could not register I2C3 bus 
> (%d)\n", ret);
> +
> +               igep_twldata.codec      = &igep2_codec_data;
> +               igep_twldata.keypad     = &igep2_keypad_pdata;
> +               igep_twldata.vpll2      = &igep2_vpll2;
> +     

Re: [RESEND PATCH 1/4] omap: igep0020: name refactoring for future merge with IGEP3

2011-05-16 Thread Enric Balletbò i Serra
Hi Mike,

The only comment I wanted to do is maybe I prefer rename the
board-igep0020 to board-igep00x0 to be more generic. Apart from this
these patch series looks good for me and has my ack. Thanks.

2011/5/12 Mike Rapoport :
> IGEP2 and IGEP3 boards are very similar and can be merged into one file.
> Start refactoring with changing igep2 to igep where applicable.
>
> Signed-off-by: Mike Rapoport 
> ---
>  arch/arm/mach-omap2/board-igep0020.c |  158 
> +-
>  1 files changed, 79 insertions(+), 79 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-igep0020.c 
> b/arch/arm/mach-omap2/board-igep0020.c
> index c62c297e..ad20f7b 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -112,7 +112,7 @@ static void __init igep2_get_revision(void)
>  * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
>  */
>
> -static struct mtd_partition igep2_onenand_partitions[] = {
> +static struct mtd_partition igep_onenand_partitions[] = {
>        {
>                .name           = "X-Loader",
>                .offset         = 0,
> @@ -140,21 +140,21 @@ static struct mtd_partition igep2_onenand_partitions[] 
> = {
>        },
>  };
>
> -static struct omap_onenand_platform_data igep2_onenand_data = {
> -       .parts = igep2_onenand_partitions,
> -       .nr_parts = ARRAY_SIZE(igep2_onenand_partitions),
> +static struct omap_onenand_platform_data igep_onenand_data = {
> +       .parts = igep_onenand_partitions,
> +       .nr_parts = ARRAY_SIZE(igep_onenand_partitions),
>        .dma_channel    = -1,   /* disable DMA in OMAP OneNAND driver */
>  };
>
> -static struct platform_device igep2_onenand_device = {
> +static struct platform_device igep_onenand_device = {
>        .name           = "omap2-onenand",
>        .id             = -1,
>        .dev = {
> -               .platform_data = &igep2_onenand_data,
> +               .platform_data = &igep_onenand_data,
>        },
>  };
>
> -static void __init igep2_flash_init(void)
> +static void __init igep_flash_init(void)
>  {
>        u8 cs = 0;
>        u8 onenandcs = GPMC_CS_NUM + 1;
> @@ -166,7 +166,7 @@ static void __init igep2_flash_init(void)
>                /* Check if NAND/oneNAND is configured */
>                if ((ret & 0xC00) == 0x800)
>                        /* NAND found */
> -                       pr_err("IGEP2: Unsupported NAND found\n");
> +                       pr_err("IGEP: Unsupported NAND found\n");
>                else {
>                        ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7);
>                        if ((ret & 0x3F) == (ONENAND_MAP >> 24))
> @@ -176,18 +176,18 @@ static void __init igep2_flash_init(void)
>        }
>
>        if (onenandcs > GPMC_CS_NUM) {
> -               pr_err("IGEP2: Unable to find configuration in GPMC\n");
> +               pr_err("IGEP: Unable to find configuration in GPMC\n");
>                return;
>        }
>
> -       igep2_onenand_data.cs = onenandcs;
> +       igep_onenand_data.cs = onenandcs;
>
> -       if (platform_device_register(&igep2_onenand_device) < 0)
> -               pr_err("IGEP2: Unable to register OneNAND device\n");
> +       if (platform_device_register(&igep_onenand_device) < 0)
> +               pr_err("IGEP: Unable to register OneNAND device\n");
>  }
>
>  #else
> -static void __init igep2_flash_init(void) {}
> +static void __init igep_flash_init(void) {}
>  #endif
>
>  #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
> @@ -211,11 +211,11 @@ static inline void __init igep2_init_smsc911x(void)
>  static inline void __init igep2_init_smsc911x(void) { }
>  #endif
>
> -static struct regulator_consumer_supply igep2_vmmc1_supply =
> +static struct regulator_consumer_supply igep_vmmc1_supply =
>        REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
>
>  /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
> -static struct regulator_init_data igep2_vmmc1 = {
> +static struct regulator_init_data igep_vmmc1 = {
>        .constraints = {
>                .min_uV                 = 185,
>                .max_uV                 = 315,
> @@ -226,13 +226,13 @@ static struct regulator_init_data igep2_vmmc1 = {
>                                        | REGULATOR_CHANGE_STATUS,
>        },
>        .num_consumer_supplies  = 1,
> -       .consumer_supplies      = &igep2_vmmc1_supply,
> +       .consumer_supplies      = &igep_vmmc1_supply,
>  };
>
> -static struct regulator_consumer_supply igep2_vio_supply =
> +static struct regulator_consumer_supply igep_vio_supply =
>        REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1");
>
> -static struct regulator_init_data igep2_vio = {
> +static struct regulator_init_data igep_vio = {
>        .constraints = {
>                .min_uV                 = 180,
>                .max_uV                 = 180,
> @@ -244,34 +244,34 @@ static struct regulator_init_data igep2_vio = {
>                                        | REGULATOR_CHANGE_

Re: [PATCH] omap: iommu: fix pte attributes for super section

2011-05-16 Thread Hiroshi DOYU
From: "ext Anna, Suman" 
Subject: [PATCH] omap: iommu: fix pte attributes for super section
Date: Tue, 10 May 2011 10:25:17 -0700

> From 5796d8d8a0ea5aee342b78ca6ead229971cff6c5 Mon Sep 17 00:00:00 2001
> From: Suman Anna 
> Date: Wed, 4 May 2011 17:45:37 -0500
> Subject: [PATCH] omap: iommu: fix pte attributes for super section
> 
> The PTE programming causes a 16MB entry to be interpreted
> as a 4K entry because of the bitwise check, and therefore does
> not set the attributes properly in the first-level descriptor
> table. The bitwise check has been replaced appropriately.
> 
> Signed-off-by: Suman Anna 
Acked-by: Hiroshi DOYU 

Thanks, checked with OMAP2/3 TRM.
--
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