Re: [PATCH v4 2/5] OMAP_VOUT: CLEANUP: Remove redundant code from omap_vout_isr

2011-09-29 Thread Semwal, Sumit
On Wed, Sep 28, 2011 at 8:19 PM, Archit Taneja arc...@ti.com wrote:
 Currently, there is a lot of redundant code is between DPI and VENC panels, 
 this
 can be made common by moving out field/interlace specific code to a separate
 function called omapvid_handle_interlace_display(). There is no functional
 change made.

 Signed-off-by: Archit Taneja arc...@ti.com
Reviewed-by: Sumit Semwal sumit.sem...@ti.com
snip
--
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] ARM: OMAP2+: dmtimer: Fix warning

2011-09-29 Thread Afzal Mohammed
Fix,

arch/arm/mach-omap2/timer.c: In function 'omap_timer_init':
arch/arm/mach-omap2/timer.c:482: warning: assignment from incompatible pointer 
type

Signed-off-by: Afzal Mohammed af...@ti.com
---

Fix on tony/master

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

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 1140e98..e49fc7b 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -434,7 +434,7 @@ static int __init omap_timer_init(struct omap_hwmod *oh, 
void *unused)
int ret = 0;
char *name = omap_timer;
struct dmtimer_platform_data *pdata;
-   struct omap_device *od;
+   struct platform_device *pdev;
struct omap_timer_capability_dev_attr *timer_dev_attr;
struct powerdomain *pwrdm;
 
@@ -476,12 +476,12 @@ static int __init omap_timer_init(struct omap_hwmod *oh, 
void *unused)
 #ifdef CONFIG_PM
pdata-get_context_loss_count = omap_pm_get_dev_context_loss_count;
 #endif
-   od = omap_device_build(name, id, oh, pdata, sizeof(*pdata),
+   pdev = omap_device_build(name, id, oh, pdata, sizeof(*pdata),
omap2_dmtimer_latency,
ARRAY_SIZE(omap2_dmtimer_latency),
0);
 
-   if (IS_ERR(od)) {
+   if (IS_ERR(pdev)) {
pr_err(%s: Can't build omap_device for %s: %s.\n,
__func__, name, oh-name);
ret = -EINVAL;
-- 
1.6.2.4

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


Re: [PATCH] usb: musb: OMAP4430: Remove a redundant omap4430_phy_init call in usb_musb_init

2011-09-29 Thread Felipe Balbi
On Tue, Sep 20, 2011 at 04:50:29PM +0800, Axel Lin wrote:
 Current code calls omap4430_phy_init() twice in usb_musb_init().
 Calling omap4430_phy_init() once is enough.
 This patch removes the first omap4430_phy_init() call, which using an
 uninitialized pointer as parameter.
 
 This patch elimates below build warning:
 arch/arm/mach-omap2/usb-musb.c: In function 'usb_musb_init':
 arch/arm/mach-omap2/usb-musb.c:141: warning: 'dev' may be used uninitialized 
 in this function
 
 Signed-off-by: Axel Lin axel@gmail.com

Acked-by: Felipe Balbi ba...@ti.com

 ---
  arch/arm/mach-omap2/usb-musb.c |3 ---
  1 files changed, 0 insertions(+), 3 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
 index a65145b..19e4dac 100644
 --- a/arch/arm/mach-omap2/usb-musb.c
 +++ b/arch/arm/mach-omap2/usb-musb.c
 @@ -137,9 +137,6 @@ void __init usb_musb_init(struct omap_musb_board_data 
 *musb_board_data)
   musb_plat.mode = board_data-mode;
   musb_plat.extvbus = board_data-extvbus;
  
 - if (cpu_is_omap44xx())
 - omap4430_phy_init(dev);
 -
   if (cpu_is_omap3517() || cpu_is_omap3505()) {
   oh_name = am35x_otg_hs;
   name = musb-am35x;
 -- 
 1.7.4.1
 
 
 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] leds-class: change back LEDS_CLASS to tristate instead of bool

2011-09-29 Thread Russell King - ARM Linux
On Thu, Sep 29, 2011 at 10:00:58AM +0800, Bryan Wu wrote:
 Hiya,
 
 Any comments and need I do anything to improve this patch?

No idea, I don't remember the original errors which this stuff spat out
and how they were caused.

The only thing I care about is that the conversion of the existing ARM
LEDs support to the NEW_LEDS stuff doesn't cause any breakage.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 00/15] OMAP2+: Serial: Runtime adaptation + cleanup

2011-09-29 Thread Govindraj
On Wed, Sep 21, 2011 at 5:41 PM, Govindraj.R govindraj.r...@ti.com wrote:
 Converting uart driver to adapt to pm runtime API's.
 Code re-org + cleanup.
 Moving some functionality from serial.c to omap-serial.c

 Changes involves:
 
 1.) Cleaning up certain uart calls from sram_idle func.
 2.) Removed all types of uart clock handling code from serial.c
 3.) Using hwmod_mux API enable wakeup capability for uart pad during
   hwmod_idle state i.e., when uart clocks are disabled we can enable
   io-pad wakeup capability for uart if mux_data is available for
   given uart. Also during during resume from idle call to uart we need
   to enable clocks back conditionally and this can be done only when io-pad
   wakeup event bit is set for uart_rx pad. So we need a hwmod API
   which can probe the uart pad and let us know whether a uart wakeup
   happened. So omap_hmwod_pad_wakeup_status API is added to meet this
   requirement.
 3.) Adapted omap-serial driver to use runtime API's.
 4.) Modify serial_init calls to accept uart parameters from board file.
    Like dma_usage, rx_timeout, dma_rx_pollrate, auto_suspend_timeout etc.
 5.) Use the omap_prm driver with irq_chaining to wake up uart after clocks are
    cut.

 Patch series is based on 3.1.0-rc4 + omap_device fixes.
 From Kevin's tree.
 git://gitorious.org/khilman/linux-omap-pm.git for_3.2/omap_device

 Also the patch series depends on Tero's Irq_chaining patches.
 Dependent irq_chaining patches are as below.

 3d5b543 omap3: pm: use prcm chain handler
 c00b340 OMAP2+: mux: add support for PAD wakeup interrupts
 db6397c power: omap-prm: added chain interrupt handler
 b3f8628 TEMP: OMAP4xxx: hwmod data: add PRM hwmod
 61ec0fc TEMP: OMAP3xxx: hwmod data: add PRM hwmod
 a1ecf8c power: add omap prm driver skeleton

 Same combination is hosted at:
 git://gitorious.org/runtime_3-0/runtime_3-0.git v5_uart_irqchn


Update:
---

This patch series was tested against Tero's Irq chaining v9 [1]
tmp patches where dropped from tero's series and applied
on top v5 uart_runtime patches.

same combination is hosted here [2]

--
Thanks,
Govindraj.R

[1]:

43c5073 omap3+: add omap prm driver initialization
dad7fc5 OMAP3: pm: do not enable PRCM MPU interrupts manually
c205290 omap3: pm: use prcm chain handler
453656e OMAP2+: mux: add support for PAD wakeup interrupts
563bed3 mfd: omap-prm: added suspend prepare and complete callbacks
ff8770a mfd: omap-prm: added chain interrupt handler
46386a9 mfd: omap-prm: add driver skeleton
bdc8ddf TEMP: OMAP4xxx: hwmod data: add PRM hwmod
8cc0382 TEMP: OMAP3xxx: hwmod data: add PRM hwmod

[2]: git://gitorious.org/runtime_3-0/runtime_3-0.git v5_uart_runtime


 Ensure CONFIG_OMAP_PRM is set while testing irq_chaining with uart.

 Changes from v4:
 ---

 1.) Fixing v4 comments from Kevin.
    Spilt into smaller logical patches.
 2.) Using Irq_chaining OMAP_PRM driver for waking up uart.

 Testing updates:
 
 3430SDP:
 retention, off_mode, system_wide suspend is tested.
 (earlyprintk  no_console_suspend checked)

 OMAP3630 - Zoom3:
 pm-retention checked with quart/omap-uart3
 [Also tested with uart3 as console uart and pm-ret checked]

 OMAP4430-SDP: Boot tested.
 OMAP2420/2430SDP: Boot tested.

 Deepak K (1):
  OMAP2+: UART: Allow UART parameters to be configured from board file.

 Govindraj.R (13):
  OMAP2+: hwmod: Add API to enable IO ring wakeup.
  OMAP2+: hwmod: Add API to check IO PAD wakeup status
  OMAP2+: UART: cleanup + remove uart pm specific API
  OMAP2+: UART: cleanup 8250 console driver support
  OMAP2+: UART: Cleanup part of clock gating mechanism for uart
  OMAP2+: UART: Remove certain feilds from omap_uart_state struct
  OMAP2+: UART: Add default mux for all uarts.
  OMAP2+: UART: Store certain reg values to port structure
  OMAP2+: UART: Add runtime pm support for omap-serial driver
  OMAP2+: UART: Move errata handling from serial.c to omap-serial
  OMAP2+: UART: Take console_lock in suspend path if not taken
  OMAP2+: UART: Enable back uart clocks with runtime API for early
    console
  OMAP2+: UART: Do not gate uart clocks if used for debug_prints

 Jon Hunter (1):
  OMAP2+: UART: Make the RX_TIMEOUT for DMA configurable for each UART

  arch/arm/mach-omap2/board-3430sdp.c           |  100 +---
  arch/arm/mach-omap2/board-4430sdp.c           |    8 +-
  arch/arm/mach-omap2/board-n8x0.c              |    6 +-
  arch/arm/mach-omap2/board-omap4panda.c        |    8 +-
  arch/arm/mach-omap2/mux.c                     |   30 +
  arch/arm/mach-omap2/mux.h                     |   13 +
  arch/arm/mach-omap2/omap_hwmod.c              |   66 ++
  arch/arm/mach-omap2/pm24xx.c                  |   19 -
  arch/arm/mach-omap2/pm34xx.c                  |   24 -
  arch/arm/mach-omap2/serial.c                  |  933 
 +++--
  arch/arm/plat-omap/include/plat/omap-serial.h |   30 +-
  arch/arm/plat-omap/include/plat/omap_hwmod.h  |    1 +
  

msub: error running host mode on 3.1.0rc4

2011-09-29 Thread Tasslehoff Kjappfot
We have a board similar to the beagleboard C3, but we have forced musb 
to host-mode and added an smsc95xx and an RJ45 connector instead. In 
2.6.39 I configured the musb driver to operate in host-mode, and that 
was all that was needed to make it work.


In 3.1.0rc4 that option has been removed from the Kconfig, and the 
default configuration of the musb driver is otg-mode. In my boardfile I 
changed the musb_board_data to:


static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
.mode   = MUSB_HOST,
.power  = 100,
}

That gives me the following output in dmesg:

[0.120544] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
[0.120697] omap_device: musb-omap2430.-1: new worst case activate 
latency 0: 30517
[0.120727] musb-hdrc musb-hdrc: musb_init_controller failed with 
status -19

[0.120758] (NULL device *): gadget not registered.

Reading drivers/usb/musb/omap2430.c, it seems the problem is that no 
transceiver is configured, but I'm not sure if its a configuration 
problem or a bug.


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


RE: [PATCH v4 2/5] OMAP_VOUT: CLEANUP: Remove redundant code from omap_vout_isr

2011-09-29 Thread Hiremath, Vaibhav

 -Original Message-
 From: Taneja, Archit
 Sent: Wednesday, September 28, 2011 8:19 PM
 To: Hiremath, Vaibhav
 Cc: Valkeinen, Tomi; linux-omap@vger.kernel.org; Semwal, Sumit; linux-
 me...@vger.kernel.org; Taneja, Archit
 Subject: [PATCH v4 2/5] OMAP_VOUT: CLEANUP: Remove redundant code from
 omap_vout_isr
 
 Currently, there is a lot of redundant code is between DPI and VENC panels,
 this
 can be made common by moving out field/interlace specific code to a
 separate
 function called omapvid_handle_interlace_display(). There is no functional
 change made.
 
 Signed-off-by: Archit Taneja arc...@ti.com
 ---
  drivers/media/video/omap/omap_vout.c |  172 -
 -
  1 files changed, 82 insertions(+), 90 deletions(-)
 
 diff --git a/drivers/media/video/omap/omap_vout.c
 b/drivers/media/video/omap/omap_vout.c
 index e64a83c..247ea31 100644
 --- a/drivers/media/video/omap/omap_vout.c
 +++ b/drivers/media/video/omap/omap_vout.c
 @@ -524,10 +524,50 @@ static int omapvid_apply_changes(struct
 omap_vout_device *vout)
   return 0;
  }
 
 +static int omapvid_handle_interlace_display(struct omap_vout_device *vout,
 + unsigned int irqstatus, struct timeval timevalue)
 +{
 + u32 fid;
 +
 + if (vout-first_int) {
 + vout-first_int = 0;
 + goto err;
 + }
 +
 + if (irqstatus  DISPC_IRQ_EVSYNC_ODD)
 + fid = 1;
 + else if (irqstatus  DISPC_IRQ_EVSYNC_EVEN)
 + fid = 0;
 + else
 + goto err;
 +
 + vout-field_id ^= 1;
 + if (fid != vout-field_id) {
 + if (fid == 0)
 + vout-field_id = fid;
 + } else if (0 == fid) {
 + if (vout-cur_frm == vout-next_frm)
 + goto err;
 +
 + vout-cur_frm-ts = timevalue;
 + vout-cur_frm-state = VIDEOBUF_DONE;
 + wake_up_interruptible(vout-cur_frm-done);
 + vout-cur_frm = vout-next_frm;
 + } else {
 + if (list_empty(vout-dma_queue) ||
 + (vout-cur_frm != vout-next_frm))
 + goto err;
 + }
 +
 + return vout-field_id;
 +err:
 + return 0;
 +}
 +
  static void omap_vout_isr(void *arg, unsigned int irqstatus)
  {
 - int ret;
 - u32 addr, fid;
 + int ret, fid;
 + u32 addr;
   struct omap_overlay *ovl;
   struct timeval timevalue;
   struct omapvideo_info *ovid;
 @@ -548,107 +588,59 @@ static void omap_vout_isr(void *arg, unsigned int
 irqstatus)
   spin_lock(vout-vbq_lock);
   do_gettimeofday(timevalue);
 
 - if (cur_display-type != OMAP_DISPLAY_TYPE_VENC) {
 - switch (cur_display-type) {
 - case OMAP_DISPLAY_TYPE_DPI:
 - if (!(irqstatus  (DISPC_IRQ_VSYNC | DISPC_IRQ_VSYNC2)))
 - goto vout_isr_err;
 - break;
 - case OMAP_DISPLAY_TYPE_HDMI:
 - if (!(irqstatus  DISPC_IRQ_EVSYNC_EVEN))
 - goto vout_isr_err;
 - break;
 - default:
 + switch (cur_display-type) {
 + case OMAP_DISPLAY_TYPE_DPI:
 + if (!(irqstatus  (DISPC_IRQ_VSYNC | DISPC_IRQ_VSYNC2)))
   goto vout_isr_err;
 - }
 - if (!vout-first_int  (vout-cur_frm != vout-next_frm)) {
 - vout-cur_frm-ts = timevalue;
 - vout-cur_frm-state = VIDEOBUF_DONE;
 - wake_up_interruptible(vout-cur_frm-done);
 - vout-cur_frm = vout-next_frm;
 - }
 - vout-first_int = 0;
 - if (list_empty(vout-dma_queue))
 + break;
 + case OMAP_DISPLAY_TYPE_VENC:
 + fid = omapvid_handle_interlace_display(vout, irqstatus,
 + timevalue);
 + if (!fid)
   goto vout_isr_err;
 + break;
 + case OMAP_DISPLAY_TYPE_HDMI:
 + if (!(irqstatus  DISPC_IRQ_EVSYNC_EVEN))
 + goto vout_isr_err;
 + break;
 + default:
 + goto vout_isr_err;
 + }
 
 - vout-next_frm = list_entry(vout-dma_queue.next,
 - struct videobuf_buffer, queue);
 - list_del(vout-next_frm-queue);
 -
 - vout-next_frm-state = VIDEOBUF_ACTIVE;
 -
 - addr = (unsigned long) vout-queued_buf_addr[vout-next_frm-
 i]
 - + vout-cropped_offset;
 + if (!vout-first_int  (vout-cur_frm != vout-next_frm)) {
 + vout-cur_frm-ts = timevalue;
 + vout-cur_frm-state = VIDEOBUF_DONE;
 + wake_up_interruptible(vout-cur_frm-done);
 + vout-cur_frm = vout-next_frm;
 + }
 
 - /* First save the configuration in ovelray structure */
 - ret = omapvid_init(vout, addr);
 - if (ret)
 - 

RE: [PATCH v4 3/5] OMAP_VOUT: Fix VSYNC IRQ handling in omap_vout_isr

2011-09-29 Thread Hiremath, Vaibhav

 -Original Message-
 From: Taneja, Archit
 Sent: Wednesday, September 28, 2011 8:19 PM
 To: Hiremath, Vaibhav
 Cc: Valkeinen, Tomi; linux-omap@vger.kernel.org; Semwal, Sumit; linux-
 me...@vger.kernel.org; Taneja, Archit
 Subject: [PATCH v4 3/5] OMAP_VOUT: Fix VSYNC IRQ handling in omap_vout_isr
 
 Currently, in omap_vout_isr(), if the panel type is DPI, and if we
 get either VSYNC or VSYNC2 interrupts, we proceed ahead to set the
 current buffers state to VIDEOBUF_DONE and prepare to display the
 next frame in the queue.
 
 On OMAP4, because we have 2 LCD managers, the panel type itself is not
 sufficient to tell if we have received the correct irq, i.e, we shouldn't
 proceed ahead if we get a VSYNC interrupt for LCD2 manager, or a VSYNC2
 interrupt for LCD manager.
 
 Fix this by correlating LCD manager to VSYNC interrupt and LCD2 manager
 to VSYNC2 interrupt.
 
 Signed-off-by: Archit Taneja arc...@ti.com
 ---
  drivers/media/video/omap/omap_vout.c |   14 +++---
  1 files changed, 11 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/media/video/omap/omap_vout.c
 b/drivers/media/video/omap/omap_vout.c
 index 247ea31..6bc2620 100644
 --- a/drivers/media/video/omap/omap_vout.c
 +++ b/drivers/media/video/omap/omap_vout.c
 @@ -566,8 +566,8 @@ err:
 
  static void omap_vout_isr(void *arg, unsigned int irqstatus)
  {
 - int ret, fid;
 - u32 addr;
 + int ret, fid, mgr_id;
 + u32 addr, irq;
   struct omap_overlay *ovl;
   struct timeval timevalue;
   struct omapvideo_info *ovid;
 @@ -583,6 +583,7 @@ static void omap_vout_isr(void *arg, unsigned int
 irqstatus)
   if (!ovl-manager || !ovl-manager-device)
   return;
 
 + mgr_id = ovl-manager-id;
   cur_display = ovl-manager-device;
 
   spin_lock(vout-vbq_lock);
 @@ -590,7 +591,14 @@ static void omap_vout_isr(void *arg, unsigned int
 irqstatus)
 
   switch (cur_display-type) {
   case OMAP_DISPLAY_TYPE_DPI:
 - if (!(irqstatus  (DISPC_IRQ_VSYNC | DISPC_IRQ_VSYNC2)))
 + if (mgr_id == OMAP_DSS_CHANNEL_LCD)
 + irq = DISPC_IRQ_VSYNC;
 + else if (mgr_id == OMAP_DSS_CHANNEL_LCD2)
 + irq = DISPC_IRQ_VSYNC2;
 + else
 + goto vout_isr_err;
 +
 + if (!(irqstatus  irq))
   goto vout_isr_err;
   break;
   case OMAP_DISPLAY_TYPE_VENC:

Acked-by: Vaibhav Hiremath hvaib...@ti.com

Thanks,
Vaibhav

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


RE: [PATCH v4 4/5] OMAP_VOUT: Add support for DSI panels

2011-09-29 Thread Hiremath, Vaibhav
 -Original Message-
 From: Taneja, Archit
 Sent: Wednesday, September 28, 2011 8:19 PM
 To: Hiremath, Vaibhav
 Cc: Valkeinen, Tomi; linux-omap@vger.kernel.org; Semwal, Sumit; linux-
 me...@vger.kernel.org; Taneja, Archit
 Subject: [PATCH v4 4/5] OMAP_VOUT: Add support for DSI panels
 
 Add support for DSI panels. DSI video mode panels will work directly. For
 command mode panels, we will need to trigger updates regularly. This isn't
 done
 by the omap_vout driver currently. It can still be supported if we connect
 a
 framebuffer device to the panel and configure it in auto update mode.
 
 Signed-off-by: Archit Taneja arc...@ti.com
 ---
  drivers/media/video/omap/omap_vout.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/media/video/omap/omap_vout.c
 b/drivers/media/video/omap/omap_vout.c
 index 6bc2620..65374b5 100644
 --- a/drivers/media/video/omap/omap_vout.c
 +++ b/drivers/media/video/omap/omap_vout.c
 @@ -590,6 +590,7 @@ static void omap_vout_isr(void *arg, unsigned int
 irqstatus)
   do_gettimeofday(timevalue);
 
   switch (cur_display-type) {
 + case OMAP_DISPLAY_TYPE_DSI:
   case OMAP_DISPLAY_TYPE_DPI:
   if (mgr_id == OMAP_DSS_CHANNEL_LCD)
   irq = DISPC_IRQ_VSYNC;

Acked-by: Vaibhav Hiremath hvaib...@ti.com

Thanks,
Vaibhav


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


RE: [PATCH v4 5/5] OMAP_VOUT: Increase MAX_DISPLAYS to a larger value

2011-09-29 Thread Hiremath, Vaibhav
 -Original Message-
 From: Taneja, Archit
 Sent: Wednesday, September 28, 2011 8:19 PM
 To: Hiremath, Vaibhav
 Cc: Valkeinen, Tomi; linux-omap@vger.kernel.org; Semwal, Sumit; linux-
 me...@vger.kernel.org; Taneja, Archit
 Subject: [PATCH v4 5/5] OMAP_VOUT: Increase MAX_DISPLAYS to a larger value
 
 There is no limit to the number of displays that can registered with DSS2.
 The
 current value of MAX_DISPLAYS is 3, set this to 10 so that the 'displays'
 member of omap2video_device struct can store more omap_dss_device pointers.
 
 This fixes a crash seen in omap_vout_probe when DSS2 registers for more
 than 3
 displays.
 
 Signed-off-by: Archit Taneja arc...@ti.com
 ---
  drivers/media/video/omap/omap_voutdef.h |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/drivers/media/video/omap/omap_voutdef.h
 b/drivers/media/video/omap/omap_voutdef.h
 index d793501..27a95d2 100644
 --- a/drivers/media/video/omap/omap_voutdef.h
 +++ b/drivers/media/video/omap/omap_voutdef.h
 @@ -25,7 +25,7 @@
  #define MAC_VRFB_CTXS4
  #define MAX_VOUT_DEV 2
  #define MAX_OVLS 3
 -#define MAX_DISPLAYS 3
 +#define MAX_DISPLAYS 10
  #define MAX_MANAGERS 3
 
  #define QQVGA_WIDTH  160

Acked-by: Vaibhav Hiremath hvaib...@ti.com

Thanks,
Vaibhav


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


Re: [PATCH V2 11/16] mmc: omap_hsmmc: ensure pbias configuration is always done

2011-09-29 Thread T Krishnamoorthy, Balaji
On Fri, May 6, 2011 at 2:44 PM, Adrian Hunter adrian.hun...@nokia.com wrote:
 Go through the driver's set_power() functions rather than
 calling regulator_enable/disable() directly because otherwise
 pbias configuration for MMC1 is not done.
Hi Chris,

Are you OK to queue this patch as bug fix. Rest of the patches of this
series is either
merged or not needed. Should I rebase and repost this alone ?

FWIW:
Acked-by: Balaji T K balaj...@ti.com


 Signed-off-by: Adrian Hunter adrian.hun...@nokia.com
 ---
  drivers/mmc/host/omap_hsmmc.c |   17 -
  1 files changed, 8 insertions(+), 9 deletions(-)

 diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
 index 4f6e552..8aa9440 100644
 --- a/drivers/mmc/host/omap_hsmmc.c
 +++ b/drivers/mmc/host/omap_hsmmc.c
 @@ -445,15 +445,14 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host 
 *host)
                * framework is fixed, we need a workaround like this
                * (which is safe for MMC, but not in general).
                */
 -               if (regulator_is_enabled(host-vcc)  0) {
 -                       regulator_enable(host-vcc);
 -                       regulator_disable(host-vcc);
 -               }
 -               if (host-vcc_aux) {
 -                       if (regulator_is_enabled(reg)  0) {
 -                               regulator_enable(reg);
 -                               regulator_disable(reg);
 -                       }
 +               if (regulator_is_enabled(host-vcc)  0 ||
 +                   (host-vcc_aux  regulator_is_enabled(host-vcc_aux))) {
 +                       int vdd = ffs(mmc_slot(host).ocr_mask) - 1;
 +
 +                       mmc_slot(host).set_power(host-dev, host-slot_id,
 +                                                1, vdd);
 +                       mmc_slot(host).set_power(host-dev, host-slot_id,
 +                                                0, 0);
                }
        }

 --
 1.7.0.4

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


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

2011-09-29 Thread Keshava Munegowda
The hwmod structure of usb_host_hs  and usb_tll are
retrieved and registered with omap device

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/mach-omap2/usb-host.c |  100 ++--
 1 files changed, 34 insertions(+), 66 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index 89ae298..771dc78 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -28,51 +28,28 @@
 #include mach/hardware.h
 #include mach/irqs.h
 #include plat/usb.h
+#include plat/omap_device.h
 
 #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 usb_host_hs
+#define USBHS_TLL_HWMODNAMEusb_tll_hs
 
 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,34 @@ 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 

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

2011-09-29 Thread Keshava Munegowda
Following 2 hwmod structures are added
1. usb_host_hs
 The hwmod of usbhs with uhh, ehci and ohci base addresses
 functional clock and ehci, ohci irqs

2. usb_tll_hs
  hwmod of usbhs with the TLL base address and irq.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  195 
 1 files changed, 195 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 59fdb9f..bc17493 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 = {
@@ -3196,6 +3198,194 @@ 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 = usb_host_hs,
+   .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_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,
+   },
+   {
+   .name   = ehci,
+   .pa_start   = 0x48064800,
+   .pa_end = 0x48064cff,
+   },
+   {}
+};
+
+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,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if omap34xx_usb_host_hs__ick = {
+   .clk= usbhost_ick,
+   .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_usb_host_hs__ick,
+};
+
+static struct omap_hwmod_opt_clk omap34xx_usb_host_hs_opt_clks[] = {
+ { .role = usbhost_fck2, .clk = usbhost_120m_fck, },
+};
+
+static struct omap_hwmod_irq_info omap34xx_usb_host_hs_irqs[] = {
+   { .name = ohci-irq, .irq = 76 },
+   { .name = ehci-irq, .irq = 77 },
+   { .irq = -1 }
+};
+
+static struct omap_hwmod omap34xx_usb_host_hs_hwmod = {
+   .name   = usb_host_hs,
+   .class  = omap34xx_usb_host_hs_hwmod_class,
+   .clkdm_name = l3_init_clkdm,
+   .mpu_irqs   = omap34xx_usb_host_hs_irqs,
+   .main_clk   = usbhost_48m_fck,
+   .prcm = {
+   .omap2 = {
+   .module_offs = OMAP3430ES2_USBHOST_MOD,
+   .prcm_reg_id = 1,
+   .module_bit = OMAP3430ES2_EN_USBHOST1_SHIFT,
+   .idlest_reg_id = 1,
+   .idlest_idle_bit = OMAP3430ES2_ST_USBHOST_IDLE_SHIFT,
+   .idlest_stdby_bit = OMAP3430ES2_ST_USBHOST_STDBY_SHIFT,
+   },
+   },
+   .opt_clks   = omap34xx_usb_host_hs_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(omap34xx_usb_host_hs_opt_clks),
+   .slaves = omap34xx_usb_host_hs_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap34xx_usb_host_hs_slaves),
+   .masters= omap34xx_usb_host_hs_masters,
+   .masters_cnt= 

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

2011-09-29 Thread Keshava Munegowda
From: Benoit Cousson b-cous...@ti.com

Following 2 hwmod structures are added
1. usb_host_hs
 The hwmod of usbhs with uhh, ehci and ohci base addresses
 functional clock and ehci, ohci irqs

2. usb_tll_hs
  hwmod of usbhs with the TLL base address and irq.

Signed-off-by: Benoit Cousson b-cous...@ti.com

- rebased to kernel version 3.0

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  171 +++-
 1 files changed, 170 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 6201422..5e6e3c6 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -68,6 +68,8 @@ static struct omap_hwmod omap44xx_mmc2_hwmod;
 static struct omap_hwmod omap44xx_mpu_hwmod;
 static struct omap_hwmod omap44xx_mpu_private_hwmod;
 static struct omap_hwmod omap44xx_usb_otg_hs_hwmod;
+static struct omap_hwmod omap44xx_usb_host_hs_hwmod;
+static struct omap_hwmod omap44xx_usb_tll_hs_hwmod;
 
 /*
  * Interconnects omap_hwmod structures
@@ -5336,6 +5338,170 @@ static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
+/*
+ * 'usb_host_hs' class
+ * high-speed multi-port usb host controller
+ */
+static struct omap_hwmod_ocp_if omap44xx_usb_host_hs__l3_main_2 = {
+   .master = omap44xx_usb_host_hs_hwmod,
+   .slave  = omap44xx_l3_main_2_hwmod,
+   .clk= l3_div_ck,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_class_sysconfig omap44xx_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 |
+  SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
+  MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
+   .sysc_fields= omap_hwmod_sysc_type2,
+};
+
+static struct omap_hwmod_class omap44xx_usb_host_hs_hwmod_class = {
+   .name = usb_host_hs,
+   .sysc = omap44xx_usb_host_hs_sysc,
+};
+
+static struct omap_hwmod_ocp_if *omap44xx_usb_host_hs_masters[] = {
+   omap44xx_usb_host_hs__l3_main_2,
+};
+
+static struct omap_hwmod_addr_space omap44xx_usb_host_hs_addrs[] = {
+   {
+   .name   = uhh,
+   .pa_start   = 0x4a064000,
+   .pa_end = 0x4a0647ff,
+   .flags  = ADDR_TYPE_RT
+   },
+   {
+   .name   = ohci,
+   .pa_start   = 0x4a064800,
+   .pa_end = 0x4a064bff,
+   },
+   {
+   .name   = ehci,
+   .pa_start   = 0x4a064c00,
+   .pa_end = 0x4a064fff,
+   },
+   {}
+};
+
+static struct omap_hwmod_irq_info omap44xx_usb_host_hs_irqs[] = {
+   { .name = ohci-irq, .irq = 76 + OMAP44XX_IRQ_GIC_START },
+   { .name = ehci-irq, .irq = 77 + OMAP44XX_IRQ_GIC_START },
+   { .irq = -1 }
+};
+
+static struct omap_hwmod_ocp_if omap44xx_l4_cfg__usb_host_hs = {
+   .master = omap44xx_l4_cfg_hwmod,
+   .slave  = omap44xx_usb_host_hs_hwmod,
+   .clk= l4_div_ck,
+   .addr   = omap44xx_usb_host_hs_addrs,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap44xx_usb_host_hs_slaves[] = {
+   omap44xx_l4_cfg__usb_host_hs,
+};
+
+static struct omap_hwmod omap44xx_usb_host_hs_hwmod = {
+   .name   = usb_host_hs,
+   .class  = omap44xx_usb_host_hs_hwmod_class,
+   .clkdm_name = l3_init_clkdm,
+   .main_clk   = usb_host_hs_fck,
+   .prcm = {
+   .omap4 = {
+   .clkctrl_offs = OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_OFFSET,
+   .context_offs = OMAP4_RM_L3INIT_USB_HOST_CONTEXT_OFFSET,
+   .modulemode   = MODULEMODE_SWCTRL,
+   },
+   },
+   .mpu_irqs   = omap44xx_usb_host_hs_irqs,
+   .slaves = omap44xx_usb_host_hs_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap44xx_usb_host_hs_slaves),
+   .masters= omap44xx_usb_host_hs_masters,
+   .masters_cnt= ARRAY_SIZE(omap44xx_usb_host_hs_masters),
+/*
+ * The usbhs controller prevents the enter omap to low power mode
+ * if other than FORCE IDLE and FORCE STANDBY are used.
+ */
+   .flags  = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+/*
+ * 'usb_tll_hs' class
+ * usb_tll_hs module is the adapter on the usb_host_hs ports
+ */
+static struct omap_hwmod_class_sysconfig omap44xx_usb_tll_hs_sysc = {
+   .rev_offs 

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

2011-09-29 Thread Keshava Munegowda
From: Keshava Munegowda keshava_mgo...@ti.com

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; The redudant clock nodes are removed.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c |   26 --
 arch/arm/mach-omap2/clock44xx_data.c |   10 +-
 drivers/mfd/omap-usb-host.c  |2 +-
 3 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index ffd55b1..63a822f 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,18 @@ 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(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(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(NULL,   wkup_32k_fck, wkup_32k_fck,  CK_3XXX),
diff --git a/arch/arm/mach-omap2/clock44xx_data.c 
b/arch/arm/mach-omap2/clock44xx_data.c
index 2af0e3f..088977a 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ 

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

2011-09-29 Thread Keshava Munegowda
From: Keshava Munegowda keshava_mgo...@ti.com

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.

TODO:
  - Adding mux-information to Hwmods.
  - Aggressive Clock Management around USB bus suspend/resume.
  - Remote Wakeup support implementation using IO-ring Wakeup
on EHCI/OHCI pads via PRCM IRQ chain handler.


In version 12:
  - The ehci, ohci and usb_host_hs hwmods combined as a single hwmod
usb_host_hs.
  - for omap3
the usbhost_ick and and usbtll_ick clocks are changed as interface
clocks. The usbtll_fck, usbhost_48m_fck clocks are changed as main
clocks and the 120mhz functional clock is changed to optional clock 
  - the usbhs mfd driver enable/disable this optional clock in 
runtime_resume and runtime_suspend callbacks of pm_runtime_get_sync
and pm_runtime_put_sync APIs.

Benoit Cousson (1):
  arm: omap: usb: ehci and ohci hwmod structures for omap4

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

 arch/arm/mach-omap2/clock3xxx_data.c   |   26 +-
 arch/arm/mach-omap2/clock44xx_data.c   |   10 +-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  195 
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  171 +++-
 arch/arm/mach-omap2/usb-host.c |  100 ++---
 arch/arm/plat-omap/include/plat/usb.h  |3 -
 drivers/mfd/omap-usb-host.c|  748 +++-
 drivers/usb/host/ehci-omap.c   |   17 +-
 drivers/usb/host/ohci-omap3.c  |   18 +-
 9 files changed, 727 insertions(+), 561 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


[PATCH 5/5] mfd: omap: usb: Runtime PM support

2011-09-29 Thread Keshava Munegowda
From: Keshava Munegowda keshava_mgo...@ti.com

The usbhs core driver does not enable/disable the interface and
functional clocks directly, These clocks are handled by runtime pm,
hence instead of the clock enable/disable, the runtime pm APIS are
used. however,the optional clocks and port clocks are handled by
the usbhs core.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Kevin Hilman khil...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/plat-omap/include/plat/usb.h |3 -
 drivers/mfd/omap-usb-host.c   |  746 +
 drivers/usb/host/ehci-omap.c  |   17 +-
 drivers/usb/host/ohci-omap3.c |   18 +-
 4 files changed, 310 insertions(+), 474 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/usb.h 
b/arch/arm/plat-omap/include/plat/usb.h
index 17d3c93..2b66dc2 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -100,9 +100,6 @@ extern void usb_musb_init(struct omap_musb_board_data 
*board_data);
 
 extern void usbhs_init(const struct usbhs_omap_board_data *pdata);
 
-extern int omap_usbhs_enable(struct device *dev);
-extern void omap_usbhs_disable(struct device *dev);
-
 extern int omap4430_phy_power(struct device *dev, int ID, int on);
 extern int omap4430_phy_set_clk(struct device *dev, int on);
 extern int omap4430_phy_init(struct device *dev);
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 9c2da29..a1d1843 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -26,6 +26,7 @@
 #include linux/spinlock.h
 #include linux/gpio.h
 #include plat/usb.h
+#include linux/pm_runtime.h
 
 #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,7 @@ 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;
+   struct clk  *opt_clk;
 
void __iomem*uhh_base;
void __iomem*tll_base;
@@ -168,7 +165,6 @@ struct usbhs_hcd_omap {
 
u32 usbhs_rev;
spinlock_t  lock;
-   int count;
 };
 /*-*/
 
@@ -318,269 +314,6 @@ err_end:
return ret;
 }
 
-/**
- * usbhs_omap_probe - initialize TI-based HCDs
- *
- * Allocates basic resources for this USB host controller.
- */
-static int __devinit usbhs_omap_probe(struct platform_device *pdev)
-{
-   struct device   *dev =  pdev-dev;
-   struct usbhs_omap_platform_data *pdata = dev-platform_data;
-   struct usbhs_hcd_omap   *omap;
-   struct resource *res;
-   int ret = 0;
-   int i;
-
-   if (!pdata) {
-   dev_err(dev, Missing platform data\n);
-   ret = -ENOMEM;
-   goto end_probe;
-   }
-
-   omap = kzalloc(sizeof(*omap), GFP_KERNEL);
-   if (!omap) {
-   dev_err(dev, Memory allocation failed\n);
-   ret = -ENOMEM;
-   goto end_probe;
-   }
-
-   spin_lock_init(omap-lock);
-
-   for (i = 0; i  OMAP3_HS_USB_PORTS; i++)
-   omap-platdata.port_mode[i] = pdata-port_mode[i];
-
-   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 = 

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

2011-09-29 Thread Keshava Munegowda
From: Keshava Munegowda keshava_mgo...@ti.com

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; The redudant clock nodes are removed.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c |   26 --
 arch/arm/mach-omap2/clock44xx_data.c |   10 +-
 drivers/mfd/omap-usb-host.c  |2 +-
 3 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index ffd55b1..63a822f 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,18 @@ 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(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(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(NULL,   wkup_32k_fck, wkup_32k_fck,  CK_3XXX),
diff --git a/arch/arm/mach-omap2/clock44xx_data.c 
b/arch/arm/mach-omap2/clock44xx_data.c
index 2af0e3f..088977a 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ 

[PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs

2011-09-29 Thread Keshava Munegowda
The hwmod structure of usb_host_hs  and usb_tll are
retrieved and registered with omap device

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/mach-omap2/usb-host.c |  100 ++--
 1 files changed, 34 insertions(+), 66 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index 89ae298..771dc78 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -28,51 +28,28 @@
 #include mach/hardware.h
 #include mach/irqs.h
 #include plat/usb.h
+#include plat/omap_device.h
 
 #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 usb_host_hs
+#define USBHS_TLL_HWMODNAMEusb_tll_hs
 
 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,34 @@ 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 

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

2011-09-29 Thread Keshava Munegowda
From: Benoit Cousson b-cous...@ti.com

Following 2 hwmod structures are added
1. usb_host_hs
 The hwmod of usbhs with uhh, ehci and ohci base addresses
 functional clock and ehci, ohci irqs

2. usb_tll_hs
  hwmod of usbhs with the TLL base address and irq.

Signed-off-by: Benoit Cousson b-cous...@ti.com

- rebased to kernel version 3.0

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  171 +++-
 1 files changed, 170 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 6201422..5e6e3c6 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -68,6 +68,8 @@ static struct omap_hwmod omap44xx_mmc2_hwmod;
 static struct omap_hwmod omap44xx_mpu_hwmod;
 static struct omap_hwmod omap44xx_mpu_private_hwmod;
 static struct omap_hwmod omap44xx_usb_otg_hs_hwmod;
+static struct omap_hwmod omap44xx_usb_host_hs_hwmod;
+static struct omap_hwmod omap44xx_usb_tll_hs_hwmod;
 
 /*
  * Interconnects omap_hwmod structures
@@ -5336,6 +5338,170 @@ static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
+/*
+ * 'usb_host_hs' class
+ * high-speed multi-port usb host controller
+ */
+static struct omap_hwmod_ocp_if omap44xx_usb_host_hs__l3_main_2 = {
+   .master = omap44xx_usb_host_hs_hwmod,
+   .slave  = omap44xx_l3_main_2_hwmod,
+   .clk= l3_div_ck,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_class_sysconfig omap44xx_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 |
+  SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
+  MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
+   .sysc_fields= omap_hwmod_sysc_type2,
+};
+
+static struct omap_hwmod_class omap44xx_usb_host_hs_hwmod_class = {
+   .name = usb_host_hs,
+   .sysc = omap44xx_usb_host_hs_sysc,
+};
+
+static struct omap_hwmod_ocp_if *omap44xx_usb_host_hs_masters[] = {
+   omap44xx_usb_host_hs__l3_main_2,
+};
+
+static struct omap_hwmod_addr_space omap44xx_usb_host_hs_addrs[] = {
+   {
+   .name   = uhh,
+   .pa_start   = 0x4a064000,
+   .pa_end = 0x4a0647ff,
+   .flags  = ADDR_TYPE_RT
+   },
+   {
+   .name   = ohci,
+   .pa_start   = 0x4a064800,
+   .pa_end = 0x4a064bff,
+   },
+   {
+   .name   = ehci,
+   .pa_start   = 0x4a064c00,
+   .pa_end = 0x4a064fff,
+   },
+   {}
+};
+
+static struct omap_hwmod_irq_info omap44xx_usb_host_hs_irqs[] = {
+   { .name = ohci-irq, .irq = 76 + OMAP44XX_IRQ_GIC_START },
+   { .name = ehci-irq, .irq = 77 + OMAP44XX_IRQ_GIC_START },
+   { .irq = -1 }
+};
+
+static struct omap_hwmod_ocp_if omap44xx_l4_cfg__usb_host_hs = {
+   .master = omap44xx_l4_cfg_hwmod,
+   .slave  = omap44xx_usb_host_hs_hwmod,
+   .clk= l4_div_ck,
+   .addr   = omap44xx_usb_host_hs_addrs,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap44xx_usb_host_hs_slaves[] = {
+   omap44xx_l4_cfg__usb_host_hs,
+};
+
+static struct omap_hwmod omap44xx_usb_host_hs_hwmod = {
+   .name   = usb_host_hs,
+   .class  = omap44xx_usb_host_hs_hwmod_class,
+   .clkdm_name = l3_init_clkdm,
+   .main_clk   = usb_host_hs_fck,
+   .prcm = {
+   .omap4 = {
+   .clkctrl_offs = OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_OFFSET,
+   .context_offs = OMAP4_RM_L3INIT_USB_HOST_CONTEXT_OFFSET,
+   .modulemode   = MODULEMODE_SWCTRL,
+   },
+   },
+   .mpu_irqs   = omap44xx_usb_host_hs_irqs,
+   .slaves = omap44xx_usb_host_hs_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap44xx_usb_host_hs_slaves),
+   .masters= omap44xx_usb_host_hs_masters,
+   .masters_cnt= ARRAY_SIZE(omap44xx_usb_host_hs_masters),
+/*
+ * The usbhs controller prevents the enter omap to low power mode
+ * if other than FORCE IDLE and FORCE STANDBY are used.
+ */
+   .flags  = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+/*
+ * 'usb_tll_hs' class
+ * usb_tll_hs module is the adapter on the usb_host_hs ports
+ */
+static struct omap_hwmod_class_sysconfig omap44xx_usb_tll_hs_sysc = {
+   .rev_offs 

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

2011-09-29 Thread Keshava Munegowda
From: Keshava Munegowda keshava_mgo...@ti.com

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.

TODO:
  - Adding mux-information to Hwmods.
  - Aggressive Clock Management around USB bus suspend/resume.
  - Remote Wakeup support implementation using IO-ring Wakeup
on EHCI/OHCI pads via PRCM IRQ chain handler.


In version 12:
  - The ehci, ohci and usb_host_hs hwmods combined as a single hwmod
usb_host_hs.
  - for omap3
the usbhost_ick and and usbtll_ick clocks are changed as interface
clocks. The usbtll_fck, usbhost_48m_fck clocks are changed as main
clocks and the 120mhz functional clock is changed to optional clock 
  - the usbhs mfd driver enable/disable this optional clock in 
runtime_resume and runtime_suspend callbacks of pm_runtime_get_sync
and pm_runtime_put_sync APIs.

Benoit Cousson (1):
  arm: omap: usb: ehci and ohci hwmod structures for omap4

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

 arch/arm/mach-omap2/clock3xxx_data.c   |   26 +-
 arch/arm/mach-omap2/clock44xx_data.c   |   10 +-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  195 
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  171 +++-
 arch/arm/mach-omap2/usb-host.c |  100 ++---
 arch/arm/plat-omap/include/plat/usb.h  |3 -
 drivers/mfd/omap-usb-host.c|  748 +++-
 drivers/usb/host/ehci-omap.c   |   17 +-
 drivers/usb/host/ohci-omap3.c  |   18 +-
 9 files changed, 727 insertions(+), 561 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


[PATCH 2/5 v12] arm: omap: usb: ehci and ohci hwmod structures for omap3

2011-09-29 Thread Keshava Munegowda
Following 2 hwmod structures are added
1. usb_host_hs
 The hwmod of usbhs with uhh, ehci and ohci base addresses
 functional clock and ehci, ohci irqs

2. usb_tll_hs
  hwmod of usbhs with the TLL base address and irq.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  195 
 1 files changed, 195 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 59fdb9f..bc17493 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 = {
@@ -3196,6 +3198,194 @@ 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 = usb_host_hs,
+   .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_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,
+   },
+   {
+   .name   = ehci,
+   .pa_start   = 0x48064800,
+   .pa_end = 0x48064cff,
+   },
+   {}
+};
+
+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,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if omap34xx_usb_host_hs__ick = {
+   .clk= usbhost_ick,
+   .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_usb_host_hs__ick,
+};
+
+static struct omap_hwmod_opt_clk omap34xx_usb_host_hs_opt_clks[] = {
+ { .role = usbhost_fck2, .clk = usbhost_120m_fck, },
+};
+
+static struct omap_hwmod_irq_info omap34xx_usb_host_hs_irqs[] = {
+   { .name = ohci-irq, .irq = 76 },
+   { .name = ehci-irq, .irq = 77 },
+   { .irq = -1 }
+};
+
+static struct omap_hwmod omap34xx_usb_host_hs_hwmod = {
+   .name   = usb_host_hs,
+   .class  = omap34xx_usb_host_hs_hwmod_class,
+   .clkdm_name = l3_init_clkdm,
+   .mpu_irqs   = omap34xx_usb_host_hs_irqs,
+   .main_clk   = usbhost_48m_fck,
+   .prcm = {
+   .omap2 = {
+   .module_offs = OMAP3430ES2_USBHOST_MOD,
+   .prcm_reg_id = 1,
+   .module_bit = OMAP3430ES2_EN_USBHOST1_SHIFT,
+   .idlest_reg_id = 1,
+   .idlest_idle_bit = OMAP3430ES2_ST_USBHOST_IDLE_SHIFT,
+   .idlest_stdby_bit = OMAP3430ES2_ST_USBHOST_STDBY_SHIFT,
+   },
+   },
+   .opt_clks   = omap34xx_usb_host_hs_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(omap34xx_usb_host_hs_opt_clks),
+   .slaves = omap34xx_usb_host_hs_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap34xx_usb_host_hs_slaves),
+   .masters= omap34xx_usb_host_hs_masters,
+   .masters_cnt= 

[PATCH 5/5 v12] mfd: omap: usb: Runtime PM support

2011-09-29 Thread Keshava Munegowda
From: Keshava Munegowda keshava_mgo...@ti.com

The usbhs core driver does not enable/disable the interface and
functional clocks directly, These clocks are handled by runtime pm,
hence instead of the clock enable/disable, the runtime pm APIS are
used. however,the optional clocks and port clocks are handled by
the usbhs core.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Kevin Hilman khil...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/plat-omap/include/plat/usb.h |3 -
 drivers/mfd/omap-usb-host.c   |  746 +
 drivers/usb/host/ehci-omap.c  |   17 +-
 drivers/usb/host/ohci-omap3.c |   18 +-
 4 files changed, 310 insertions(+), 474 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/usb.h 
b/arch/arm/plat-omap/include/plat/usb.h
index 17d3c93..2b66dc2 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -100,9 +100,6 @@ extern void usb_musb_init(struct omap_musb_board_data 
*board_data);
 
 extern void usbhs_init(const struct usbhs_omap_board_data *pdata);
 
-extern int omap_usbhs_enable(struct device *dev);
-extern void omap_usbhs_disable(struct device *dev);
-
 extern int omap4430_phy_power(struct device *dev, int ID, int on);
 extern int omap4430_phy_set_clk(struct device *dev, int on);
 extern int omap4430_phy_init(struct device *dev);
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 9c2da29..a1d1843 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -26,6 +26,7 @@
 #include linux/spinlock.h
 #include linux/gpio.h
 #include plat/usb.h
+#include linux/pm_runtime.h
 
 #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,7 @@ 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;
+   struct clk  *opt_clk;
 
void __iomem*uhh_base;
void __iomem*tll_base;
@@ -168,7 +165,6 @@ struct usbhs_hcd_omap {
 
u32 usbhs_rev;
spinlock_t  lock;
-   int count;
 };
 /*-*/
 
@@ -318,269 +314,6 @@ err_end:
return ret;
 }
 
-/**
- * usbhs_omap_probe - initialize TI-based HCDs
- *
- * Allocates basic resources for this USB host controller.
- */
-static int __devinit usbhs_omap_probe(struct platform_device *pdev)
-{
-   struct device   *dev =  pdev-dev;
-   struct usbhs_omap_platform_data *pdata = dev-platform_data;
-   struct usbhs_hcd_omap   *omap;
-   struct resource *res;
-   int ret = 0;
-   int i;
-
-   if (!pdata) {
-   dev_err(dev, Missing platform data\n);
-   ret = -ENOMEM;
-   goto end_probe;
-   }
-
-   omap = kzalloc(sizeof(*omap), GFP_KERNEL);
-   if (!omap) {
-   dev_err(dev, Memory allocation failed\n);
-   ret = -ENOMEM;
-   goto end_probe;
-   }
-
-   spin_lock_init(omap-lock);
-
-   for (i = 0; i  OMAP3_HS_USB_PORTS; i++)
-   omap-platdata.port_mode[i] = pdata-port_mode[i];
-
-   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 = 

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

2011-09-29 Thread Keshava Munegowda
From: Benoit Cousson b-cous...@ti.com

Following 2 hwmod structures are added
1. usb_host_hs
 The hwmod of usbhs with uhh, ehci and ohci base addresses
 functional clock and ehci, ohci irqs

2. usb_tll_hs
  hwmod of usbhs with the TLL base address and irq.

Signed-off-by: Benoit Cousson b-cous...@ti.com

- rebased to kernel version 3.0

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  171 +++-
 1 files changed, 170 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 6201422..5e6e3c6 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -68,6 +68,8 @@ static struct omap_hwmod omap44xx_mmc2_hwmod;
 static struct omap_hwmod omap44xx_mpu_hwmod;
 static struct omap_hwmod omap44xx_mpu_private_hwmod;
 static struct omap_hwmod omap44xx_usb_otg_hs_hwmod;
+static struct omap_hwmod omap44xx_usb_host_hs_hwmod;
+static struct omap_hwmod omap44xx_usb_tll_hs_hwmod;
 
 /*
  * Interconnects omap_hwmod structures
@@ -5336,6 +5338,170 @@ static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
+/*
+ * 'usb_host_hs' class
+ * high-speed multi-port usb host controller
+ */
+static struct omap_hwmod_ocp_if omap44xx_usb_host_hs__l3_main_2 = {
+   .master = omap44xx_usb_host_hs_hwmod,
+   .slave  = omap44xx_l3_main_2_hwmod,
+   .clk= l3_div_ck,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_class_sysconfig omap44xx_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 |
+  SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
+  MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
+   .sysc_fields= omap_hwmod_sysc_type2,
+};
+
+static struct omap_hwmod_class omap44xx_usb_host_hs_hwmod_class = {
+   .name = usb_host_hs,
+   .sysc = omap44xx_usb_host_hs_sysc,
+};
+
+static struct omap_hwmod_ocp_if *omap44xx_usb_host_hs_masters[] = {
+   omap44xx_usb_host_hs__l3_main_2,
+};
+
+static struct omap_hwmod_addr_space omap44xx_usb_host_hs_addrs[] = {
+   {
+   .name   = uhh,
+   .pa_start   = 0x4a064000,
+   .pa_end = 0x4a0647ff,
+   .flags  = ADDR_TYPE_RT
+   },
+   {
+   .name   = ohci,
+   .pa_start   = 0x4a064800,
+   .pa_end = 0x4a064bff,
+   },
+   {
+   .name   = ehci,
+   .pa_start   = 0x4a064c00,
+   .pa_end = 0x4a064fff,
+   },
+   {}
+};
+
+static struct omap_hwmod_irq_info omap44xx_usb_host_hs_irqs[] = {
+   { .name = ohci-irq, .irq = 76 + OMAP44XX_IRQ_GIC_START },
+   { .name = ehci-irq, .irq = 77 + OMAP44XX_IRQ_GIC_START },
+   { .irq = -1 }
+};
+
+static struct omap_hwmod_ocp_if omap44xx_l4_cfg__usb_host_hs = {
+   .master = omap44xx_l4_cfg_hwmod,
+   .slave  = omap44xx_usb_host_hs_hwmod,
+   .clk= l4_div_ck,
+   .addr   = omap44xx_usb_host_hs_addrs,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap44xx_usb_host_hs_slaves[] = {
+   omap44xx_l4_cfg__usb_host_hs,
+};
+
+static struct omap_hwmod omap44xx_usb_host_hs_hwmod = {
+   .name   = usb_host_hs,
+   .class  = omap44xx_usb_host_hs_hwmod_class,
+   .clkdm_name = l3_init_clkdm,
+   .main_clk   = usb_host_hs_fck,
+   .prcm = {
+   .omap4 = {
+   .clkctrl_offs = OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_OFFSET,
+   .context_offs = OMAP4_RM_L3INIT_USB_HOST_CONTEXT_OFFSET,
+   .modulemode   = MODULEMODE_SWCTRL,
+   },
+   },
+   .mpu_irqs   = omap44xx_usb_host_hs_irqs,
+   .slaves = omap44xx_usb_host_hs_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap44xx_usb_host_hs_slaves),
+   .masters= omap44xx_usb_host_hs_masters,
+   .masters_cnt= ARRAY_SIZE(omap44xx_usb_host_hs_masters),
+/*
+ * The usbhs controller prevents the enter omap to low power mode
+ * if other than FORCE IDLE and FORCE STANDBY are used.
+ */
+   .flags  = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+/*
+ * 'usb_tll_hs' class
+ * usb_tll_hs module is the adapter on the usb_host_hs ports
+ */
+static struct omap_hwmod_class_sysconfig omap44xx_usb_tll_hs_sysc = {
+   .rev_offs 

[PATCH 2/2] arm: omap4: hsmmc: configure SDMMC1_DR0 properly

2011-09-29 Thread Balaji T K
Fix the typo, instead it should be SDMMC1
USBC1 is not related to MMC1 I/Os

Signed-off-by: Balaji T K balaj...@ti.com
---
 arch/arm/mach-omap2/hsmmc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 9cc2eb7..1a9bc52 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -495,7 +495,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
OMAP4_SDMMC1_PUSTRENGTH_GRP1_MASK);
reg = ~(OMAP4_SDMMC1_PUSTRENGTH_GRP2_MASK |
OMAP4_SDMMC1_PUSTRENGTH_GRP3_MASK);
-   reg |= (OMAP4_USBC1_DR0_SPEEDCTRL_MASK|
+   reg |= (OMAP4_SDMMC1_DR0_SPEEDCTRL_MASK |
OMAP4_SDMMC1_DR1_SPEEDCTRL_MASK |
OMAP4_SDMMC1_DR2_SPEEDCTRL_MASK);
omap4_ctrl_pad_writel(reg, control_mmc1);
-- 
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] arm: omap4: hsmmc: pbias fixes

2011-09-29 Thread Balaji T K
MMC1 pbias and speed control fix for SDMMC1 extended I/O cell

Balaji T K (2):
  arm: omap4: hsmmc: Fix Pbias configuration on regulator OFF
  arm: omap4: hsmmc: configure SDMMC1_DR0 properly

 arch/arm/mach-omap2/hsmmc.c |   16 +++-
 1 files changed, 3 insertions(+), 13 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


[PATCH 1/2] arm: omap4: hsmmc: Fix Pbias configuration on regulator OFF

2011-09-29 Thread Balaji T K
MMC1 data line IO's are powered down in before set regulator function.
IO's should not be powered ON when regulator is OFF.
Keep the IO's in power pown mode after regulator OFF.
Delete incorrect comments which are not applicable for OMAP4.

Signed-off-by: Balaji T K balaj...@ti.com
Signed-off-by: Kishore Kadiyala kishore.kadiy...@ti.com
Reported-by: Viswanath Puttagunta vi...@ti.com
---
 arch/arm/mach-omap2/hsmmc.c |   14 ++
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 097a42d..9cc2eb7 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -129,15 +129,11 @@ static void omap4_hsmmc1_before_set_reg(struct device 
*dev, int slot,
 * Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the
 * card with Vcc regulator (from twl4030 or whatever).  OMAP has both
 * 1.8V and 3.0V modes, controlled by the PBIAS register.
-*
-* In 8-bit modes, OMAP VMMC1A (for DAT4..7) needs a supply, which
-* is most naturally TWL VSIM; those pins also use PBIAS.
-*
-* FIXME handle VMMC1A as needed ...
 */
reg = omap4_ctrl_pad_readl(control_pbias_offset);
reg = ~(OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK |
-   OMAP4_MMC1_PWRDNZ_MASK);
+   OMAP4_MMC1_PWRDNZ_MASK |
+   OMAP4_MMC1_PBIASLITE_VMODE_MASK);
omap4_ctrl_pad_writel(reg, control_pbias_offset);
 }
 
@@ -172,12 +168,6 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, 
int slot,
reg = ~(OMAP4_MMC1_PWRDNZ_MASK);
omap4_ctrl_pad_writel(reg, control_pbias_offset);
}
-   } else {
-   reg = omap4_ctrl_pad_readl(control_pbias_offset);
-   reg |= (OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK |
-   OMAP4_MMC1_PWRDNZ_MASK |
-   OMAP4_MMC1_PBIASLITE_VMODE_MASK);
-   omap4_ctrl_pad_writel(reg, control_pbias_offset);
}
 }
 
-- 
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: [PATCH 0/2] arm: omap4: hsmmc: pbias fixes

2011-09-29 Thread T Krishnamoorthy, Balaji
 From: Balaji T K balaj...@ti.com
Will resend this series as my email id is garbled.


 MMC1 pbias and speed control fix for SDMMC1 extended I/O cell

 Balaji T K (2):
  arm: omap4: hsmmc: Fix Pbias configuration on regulator OFF
  arm: omap4: hsmmc: configure SDMMC1_DR0 properly

  arch/arm/mach-omap2/hsmmc.c |   16 +++-
  1 files changed, 3 insertions(+), 13 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 1/2] arm: omap4: hsmmc: Fix Pbias configuration on regulator OFF

2011-09-29 Thread Tony Lindgren
* Balaji T K balaj...@ti.com [110929 07:11]:
 MMC1 data line IO's are powered down in before set regulator function.
 IO's should not be powered ON when regulator is OFF.
 Keep the IO's in power pown mode after regulator OFF.
 Delete incorrect comments which are not applicable for OMAP4.

Care to check how this is different from what I added into fixes
branch as commit 3fe8df93b0992199e3a0026fc51e90b705f94e40?

Is this a separate issue?

Tony

 
 Signed-off-by: Balaji T K balaj...@ti.com
 Signed-off-by: Kishore Kadiyala kishore.kadiy...@ti.com
 Reported-by: Viswanath Puttagunta vi...@ti.com
 ---
  arch/arm/mach-omap2/hsmmc.c |   14 ++
  1 files changed, 2 insertions(+), 12 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
 index 097a42d..9cc2eb7 100644
 --- a/arch/arm/mach-omap2/hsmmc.c
 +++ b/arch/arm/mach-omap2/hsmmc.c
 @@ -129,15 +129,11 @@ static void omap4_hsmmc1_before_set_reg(struct device 
 *dev, int slot,
* Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the
* card with Vcc regulator (from twl4030 or whatever).  OMAP has both
* 1.8V and 3.0V modes, controlled by the PBIAS register.
 -  *
 -  * In 8-bit modes, OMAP VMMC1A (for DAT4..7) needs a supply, which
 -  * is most naturally TWL VSIM; those pins also use PBIAS.
 -  *
 -  * FIXME handle VMMC1A as needed ...
*/
   reg = omap4_ctrl_pad_readl(control_pbias_offset);
   reg = ~(OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK |
 - OMAP4_MMC1_PWRDNZ_MASK);
 + OMAP4_MMC1_PWRDNZ_MASK |
 + OMAP4_MMC1_PBIASLITE_VMODE_MASK);
   omap4_ctrl_pad_writel(reg, control_pbias_offset);
  }
  
 @@ -172,12 +168,6 @@ static void omap4_hsmmc1_after_set_reg(struct device 
 *dev, int slot,
   reg = ~(OMAP4_MMC1_PWRDNZ_MASK);
   omap4_ctrl_pad_writel(reg, control_pbias_offset);
   }
 - } else {
 - reg = omap4_ctrl_pad_readl(control_pbias_offset);
 - reg |= (OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK |
 - OMAP4_MMC1_PWRDNZ_MASK |
 - OMAP4_MMC1_PBIASLITE_VMODE_MASK);
 - omap4_ctrl_pad_writel(reg, control_pbias_offset);
   }
  }
  
 -- 
 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: [PATCH v2 3/5] omap3evm: Add Camera board init/hookup file

2011-09-29 Thread Tony Lindgren
Hi,

Few comments below.

* Deepthy Ravi deepthy.r...@ti.com [110927 06:07]:
 +
 +#include linux/io.h
 +#include linux/i2c.h
 +#include linux/delay.h
 +#include linux/gpio.h
 +#include linux/err.h
 +#include linux/platform_device.h
 +#include mach/gpio.h

You can leave out mach/gpio.h as you already have linux/gpio.h
included.

 +static int __init omap3evm_cam_init(void)
 +{
 + int ret;
 +
 + ret = gpio_request_array(omap3evm_gpios,
 + ARRAY_SIZE(omap3evm_gpios));
 + if (ret  0) {
 + printk(KERN_ERR Unable to get GPIO pins\n);
 + return ret;
 + }
 +
 + omap3_init_camera(omap3evm_isp_platform_data);
 +
 + printk(KERN_INFO omap3evm camera init done successfully...\n);
 + return 0;
 +}
 +
 +static void __exit omap3evm_cam_exit(void)
 +{
 + gpio_free_array(omap3evm_gpios,
 + ARRAY_SIZE(omap3evm_gpios));
 +}
 +
 +module_init(omap3evm_cam_init);
 +module_exit(omap3evm_cam_exit);

Looks like most of this file should be under drivers/media.

For initializing the module you should pass some platform_data
(until we have DT doing it) so you know that the camera is
available on the booted board or not. Now the init tries to
wrongly initialize things on other boards too.


 --- a/arch/arm/mach-omap2/board-omap3evm.c
 +++ b/arch/arm/mach-omap2/board-omap3evm.c
 @@ -573,6 +573,8 @@ static struct omap_board_mux omap35x_board_mux[] 
 __initdata = {
   OMAP_PIN_OFF_NONE),
   OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
   OMAP_PIN_OFF_NONE),
 + OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
 + OMAP_PIN_OFF_NONE),
  #ifdef CONFIG_WL12XX_PLATFORM_DATA
   /* WLAN IRQ - GPIO 149 */
   OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
 @@ -598,6 +600,8 @@ static struct omap_board_mux omap36x_board_mux[] 
 __initdata = {
   OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
   OMAP_PIN_OFF_INPUT_PULLUP | 
 OMAP_PIN_OFF_OUTPUT_LOW |
   OMAP_PIN_OFF_WAKEUPENABLE),
 + OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
 + OMAP_PIN_OFF_NONE),
   /* AM/DM37x EVM: DSS data bus muxed with sys_boot */
   OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
   OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),

Is this safe to do on all boards, or only if you have the camera
board attached?

Regards,

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


Re: [PATCH 00/10] OMAP DSS related board changes

2011-09-29 Thread Tony Lindgren
* Tomi Valkeinen tomi.valkei...@ti.com [110925 23:04]:
 On Tue, 2011-09-20 at 11:18 +0300, Tomi Valkeinen wrote:
  Hi Tony,
  
  Here is a bunch of board file patches related to DSS. They have all been 
  sent
  for review earlier, and are currently in my tree. Some of them depend on DSS
  driver changes, so I'd like to keep them there to avoid compilation errors
  (these won't compile if you apply them without patches from DSS tree).
  
  Can you give your ack for these? Alternatively we can see which of these 
  could
  go through your tree and I can make a new set.
 
 Tony, ping. I'd like to get these in for 3.2, as many DSS driver patches
 depend on some of these.

Sorry for the delay. Looks like these will conflict with your
earlier patches I have in the board branch and other cleanup.

I'll drop the earlier patches from my board branch so you can
queue all of them:

OMAP: Apollon: Port the display driver to new DSS2
OMAP: H4: Port the display driver to new DSS2
OMAP: LDP: Port the display driver to new DSS2
OMAP: 2420SDP: Port the display driver to new DSS2
OMAP: omap3touchbook: Remove unused lcd stuff
OMAP: RX51: Remove unused old omapfb stuff

Your new patches all look OK to me, just please check what we
have in omap cleanup branch as we don't have all that queud up
yet in next.

It's likely these will need to be rebased on those, so maybe wait
a bit with these or adjust them accordingly if possible.

Also, you might want to start looking into passing the configuration
from DT instead to avoid the platform init code. Probably the
panel configuration would be the place to start with that?

So for all of them:

Acked-by: Tony Lindgren t...@atomide.com

 
  Thomas Weber (1):
OMAP: Devkit8000: Change lcd driver to AT070TN83
  
  Tomi Valkeinen (9):
OMAP: DSS2: Change DSI device naming
OMAP4: TWL: Add common omapdss supplies
OMAP: DSS2: HDMI: use default dividers
OMAP: use dvi panel driver instead of generic-dpi
OMAP: stalker: Remove LCD device from board file
OMAP: Add DDC i2c_bus_num to board files
OMAP: 4430SDP: Remove unneeded lcd config
OMAP4: 4430SDP: Add panel support to board file
OMAP4: 4430SDP: Add picodlp support to board file
  
   arch/arm/mach-omap2/board-3430sdp.c  |7 +-
   arch/arm/mach-omap2/board-4430sdp.c  |  208 
  ++
   arch/arm/mach-omap2/board-am3517evm.c|6 +-
   arch/arm/mach-omap2/board-cm-t35.c   |6 +-
   arch/arm/mach-omap2/board-devkit8000.c   |   10 +-
   arch/arm/mach-omap2/board-igep0020.c |8 +-
   arch/arm/mach-omap2/board-omap3beagle.c  |8 +-
   arch/arm/mach-omap2/board-omap3evm.c |7 +-
   arch/arm/mach-omap2/board-omap3pandora.c |2 +-
   arch/arm/mach-omap2/board-omap3stalker.c |   40 +--
   arch/arm/mach-omap2/board-omap4panda.c   |8 +-
   arch/arm/mach-omap2/board-overo.c|7 +-
   arch/arm/mach-omap2/display.c|6 +-
   arch/arm/mach-omap2/twl-common.c |   11 ++-
   14 files changed, 230 insertions(+), 104 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
--
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 7/8] OMAP4: clock: Add CPU local timer clock node.

2011-09-29 Thread Paul Walmsley
Hi Santosh,

On Thu, 8 Sep 2011, Santosh Shilimkar wrote:

 Local timer clock is sourced from the CPU clock and hence changes
 along with CPU clock. These per CPU local timers are used as
 clock-events, so they need to be reconfigured on CPU frequency
 change as part of CPUfreq governor.
 
 Newly introduced clockevents_reconfigure() needs to know the
 twd clock-rate. Provide a clock-node to make clk_get_rate() work
 for TWD.
 
 Signed-off-by: Santosh Shilimkar santosh.shilim...@ti.com
 Cc: Paul Walmsley p...@pwsan.com
 Cc: Kevin Hilman khil...@ti.com

This clock looks like the ARM Cortex-A9 MPCore PERIPHCLK, correct?  From 
ARM Cortex-A9 MPCore Technical Reference Manual (DDI 0407G) Section 5.1 
Clocks?

Assuming that is so, I've modified this patch appropriately, and added 
support to the autogeneration script to generate this clock node.
Care to take a quick look at it to make sure it's okay?


- Paul

From: Santosh Shilimkar santosh.shilim...@ti.com
Date: Thu, 8 Sep 2011 10:52:06 +0530
Subject: [PATCH] ARM: OMAP4: clock: Add CPU local timer clock node.

Local timer clock is sourced from the CPU clock and hence changes
along with CPU clock. These per CPU local timers are used as
clock-events, so they need to be reconfigured on CPU frequency
change as part of CPUfreq governor.

Newly introduced clockevents_reconfigure() needs to know the
twd clock-rate. Provide a clock-node to make clk_get_rate() work
for TWD.

Signed-off-by: Santosh Shilimkar santosh.shilim...@ti.com
Cc: Paul Walmsley p...@pwsan.com
Cc: Kevin Hilman khil...@ti.com
[p...@pwsan.com: renamed clock node to 'mpu_periphclk' to indicate that this
 is the Cortex-A9 MPCore subsystem clock PERIPHCLK (DDI 0407G); moved
 clock and clkdev entries to match the autogenerated script output]
Signed-off-by: Paul Walmsley p...@pwsan.com
---
 arch/arm/mach-omap2/clock44xx_data.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clock44xx_data.c 
b/arch/arm/mach-omap2/clock44xx_data.c
index 4873c00..9684233 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -1195,6 +1195,14 @@ static struct clk l4_wkup_clk_mux_ck = {
.recalc = omap2_clksel_recalc,
 };
 
+static struct clk mpu_periphclk = {
+   .name   = mpu_periphclk,
+   .parent = dpll_mpu_ck,
+   .ops= clkops_null,
+   .fixed_div  = 2,
+   .recalc = omap_fixed_divisor_recalc,
+};
+
 static const struct clksel_rate div2_2to1_rates[] = {
{ .div = 1, .val = 1, .flags = RATE_IN_4430 },
{ .div = 2, .val = 0, .flags = RATE_IN_4430 },
@@ -3189,6 +3197,7 @@ static struct omap_clk omap44xx_clks[] = {
CLK(NULL,   l4_div_ck,l4_div_ck, 
CK_443X),
CLK(NULL,   lp_clk_div_ck,lp_clk_div_ck, 
CK_443X),
CLK(NULL,   l4_wkup_clk_mux_ck,   l4_wkup_clk_mux_ck,
CK_443X),
+   CLK(NULL,   smp_twd,  mpu_periphclk, 
CK_443X),
CLK(NULL,   ocp_abe_iclk, ocp_abe_iclk,  
CK_443X),
CLK(NULL,   per_abe_24m_fclk, per_abe_24m_fclk,  
CK_443X),
CLK(NULL,   per_abe_nc_fclk,  per_abe_nc_fclk,   
CK_443X),
-- 
1.7.6.3

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


Re: [PATCH 12/13] arm/dts: omap3-beagle: Add twl4030 and i2c EEPROM

2011-09-29 Thread Grant Likely
On Mon, Sep 26, 2011 at 06:50:20PM +0200, Benoit Cousson wrote:
 Add required clock frequencies for the i2c client devices existing
 on beagle board.
 
 Add the twl4030 basic description with only the twl_rtc module.
 
 Add the EEPROM node.
 
 Based on original patch from Manju:
 http://www.spinics.net/lists/linux-omap/msg55831.html
 
 Signed-off-by: Benoit Cousson b-cous...@ti.com
 Cc: G, Manjunath Kondaiah manj...@ti.com
 ---
  arch/arm/boot/dts/omap3-beagle.dts |   38 
 
  1 files changed, 38 insertions(+), 0 deletions(-)
 
 diff --git a/arch/arm/boot/dts/omap3-beagle.dts 
 b/arch/arm/boot/dts/omap3-beagle.dts
 index 9486be6..a65f39d 100644
 --- a/arch/arm/boot/dts/omap3-beagle.dts
 +++ b/arch/arm/boot/dts/omap3-beagle.dts
 @@ -27,3 +27,41 @@
   reg = 0x8000 0x2000; /* 512 MB */
   };
  };
 +
 +i2c1 {
 + clock-frequency = 260;
 +
 + /*
 +  * Integrated Power Management Chip
 +  */
 + twl@48 {
 + compatible = ti,twl4030;
 + reg = 0x48;
 + interrupts = 7; /* SYS_NIRQ cascaded to intc */
 + interrupt-controller;
 + #interrupt-cells = 1;
 + interrupt-parent = intc;
 +
 + twl_rtc {

Nit: use the generic names recommended practise for node names (in
this case, simply 'rtc' sounds appropriate, and don't use underscores
(it's not forbidden, just doesn't match the style.

 + compatible = ti,twl4030-rtc;
 + interrupts = 11;
 + };
 + };
 +};
 +
 +i2c2 {
 + clock-frequency = 40;
 +};
 +
 +i2c3 {
 + clock-frequency = 10;
 +
 + /*
 +  * Display monitor features are burnt in the EEPROM
 +  * as EDID data.
 +  */
 + eeprom@50 {
 + compatible = ti,eeprom;
 + reg = 0x50;
 + };
 +};
 -- 
 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: [PATCH v3 2/2] OMAP: omap_device: Add a method to build an omap_device from a DT node

2011-09-29 Thread Grant Likely
On Wed, Sep 28, 2011 at 10:47:32AM -0700, Kevin Hilman wrote:
 Cousson, Benoit b-cous...@ti.com writes:
 
  Hi Grant, Kevin,
 
  Should I go ahead with this version and repost the series with that
  third patch?
 
 Fine with me.
 
 Grant let me know if you prefer if I merge it (with your ack) with the
 rest of the series or if you want to take it to avoid conflicts.

I'm happy with the way things have gone.  Go ahead and add my Ack and
merge it through your tree.  I'd like to avoid the conflicts.

g.

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


Re: [PATCH v3 2/2] OMAP: omap_device: Add a method to build an omap_device from a DT node

2011-09-29 Thread Kevin Hilman
Grant Likely grant.lik...@secretlab.ca writes:

 On Wed, Sep 28, 2011 at 10:47:32AM -0700, Kevin Hilman wrote:
 Cousson, Benoit b-cous...@ti.com writes:
 
  Hi Grant, Kevin,
 
  Should I go ahead with this version and repost the series with that
  third patch?
 
 Fine with me.
 
 Grant let me know if you prefer if I merge it (with your ack) with the
 rest of the series or if you want to take it to avoid conflicts.

 I'm happy with the way things have gone.  Go ahead and add my Ack and
 merge it through your tree.  I'd like to avoid the conflicts.

Thanks, I think keeping this series together will be smoothest.

Adding your ack, and queuing for v3.2 (branch: for_3.2/omap_device-2)

Kevin

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


Re: [PATCH v3 2/3] ARM: OMAP: TI814X: Add cpu type macros and detection support

2011-09-29 Thread Paul Walmsley
Hello Hemant,

a few comments:

On Thu, 29 Sep 2011, Hemant Pedanekar wrote:

 This patch adds cpu type, macros for identification of TI814X device.
 
 Note that following update to common OMAP data structures is made:
 
 cpu_mask and RATE_IN_XXX flags have crossed 8 bit hence struct
 clksel_rate.flags, struct prcm_config.flags and cpu_mask are changed to u16 
 from
 u8.
 
 Signed-off-by: Hemant Pedanekar hema...@ti.com

Also, the opp2xxx.h change looks spurious, is that really needed?

Could you please split the clock-related changes into a separate patch?  
Then this patch would just be the id.c and cpu.h changes.

Other than that, the patch looks okay to me.


- Paul
--
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 7/8] OMAP4: clock: Add CPU local timer clock node.

2011-09-29 Thread Linus Walleij
2011/9/8 Santosh Shilimkar santosh.shilim...@ti.com:

 Local timer clock is sourced from the CPU clock and hence changes
 along with CPU clock. These per CPU local timers are used as
 clock-events, so they need to be reconfigured on CPU frequency
 change as part of CPUfreq governor.

This requires patch 6956/2 right?
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=6956/2

Can I add your Tested-by: to the patch as well?

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


[PATCH] OMAP2+: clock: use clock's recalc in DPLL handling

2011-09-29 Thread Mike Turquette
Not all DPLLs are identical; some require special consideration such as
OMAP4's ABE DPLL, which can have an additional 4x multiplier added to
it's clock rate based on programming the REGM4XEN bit in it's CLKMODE
register.

Unfortunately the clock framework makes a few assumptions that all DPLLs
can have their rates calculated the same way which has led to incorrect
rates for OMAP4's DPLL_ABE in some cases.  This patch fixes the same by
replacing explicit calls to omap2_dpll_get_rate with clk-recalc if
.recalc is populated for a clock.  If .recalc is NULL then fall back to
omap2_dpll_get_rate.

Reported-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Mike Turquette mturque...@ti.com
---
 arch/arm/mach-omap2/dpll3xxx.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index f77022b..193868d 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -390,7 +390,8 @@ int omap3_noncore_dpll_enable(struct clk *clk)
 * propagating?
 */
if (!r)
-   clk-rate = omap2_get_dpll_rate(clk);
+   clk-rate = (clk-recalc) ? clk-recalc(clk) :
+   omap2_get_dpll_rate(clk);
 
return r;
 }
@@ -435,7 +436,8 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned 
long rate)
if (!dd)
return -EINVAL;
 
-   if (rate == omap2_get_dpll_rate(clk))
+   if (rate == ((clk-recalc) ? clk-recalc(clk) :
+   omap2_get_dpll_rate(clk)))
return 0;
 
/*
-- 
1.7.4.1

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


Re: [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks

2011-09-29 Thread Paul Walmsley
Hi

On Thu, 22 Sep 2011, Keerthy wrote:

 From: Vishwanath BS vishwanath...@ti.com
 
 OMAP4460 specific clocks are not getting added as the
 cpu_is_omap44xx is choosing only OMAP4430 specific clock nodes.
 Changing it to add to OMAP4460 specific clocks also.
 This is clocks are required of temperature sensor.
 
 Signed-off-by: Vishwanath BS vishwanath...@ti.com
 Signed-off-by: Keerthy j-keer...@ti.com
 Cc: p...@pwsan.com 

Thanks, this patch has been queued for 3.2.


- Paul
--
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] OMAP2+: clock: use clock's recalc in DPLL handling

2011-09-29 Thread Paul Walmsley
Hi

On Thu, 29 Sep 2011, Mike Turquette wrote:

 Not all DPLLs are identical; some require special consideration such as
 OMAP4's ABE DPLL, which can have an additional 4x multiplier added to
 it's clock rate based on programming the REGM4XEN bit in it's CLKMODE
 register.
 
 Unfortunately the clock framework makes a few assumptions that all DPLLs
 can have their rates calculated the same way which has led to incorrect
 rates for OMAP4's DPLL_ABE in some cases.  This patch fixes the same by
 replacing explicit calls to omap2_dpll_get_rate with clk-recalc if
 .recalc is populated for a clock.  If .recalc is NULL then fall back to
 omap2_dpll_get_rate.
 
 Reported-by: Misael Lopez Cruz misael.lo...@ti.com
 Signed-off-by: Mike Turquette mturque...@ti.com

The conditional in the second hunk of this patch has been simplified for 
readability.  Updated patch below.  Please let me know if I screwed 
something up.  Otherwise, queued for 3.2 fixes.

thanks


- Paul

From: Mike Turquette mturque...@ti.com
Date: Thu, 29 Sep 2011 17:51:28 -0700
Subject: [PATCH] ARM: OMAP2+: clock: use clock's recalc in DPLL handling

Not all DPLLs are identical; some require special consideration such as
OMAP4's ABE DPLL, which can have an additional 4x multiplier added to
it's clock rate based on programming the REGM4XEN bit in it's CLKMODE
register.

Unfortunately the clock framework makes a few assumptions that all DPLLs
can have their rates calculated the same way which has led to incorrect
rates for OMAP4's DPLL_ABE in some cases.  This patch fixes the same by
replacing explicit calls to omap2_dpll_get_rate with clk-recalc if
.recalc is populated for a clock.  If .recalc is NULL then fall back to
omap2_dpll_get_rate.

Reported-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Mike Turquette mturque...@ti.com
[p...@pwsan.com: simplified conditional]
Signed-off-by: Paul Walmsley p...@pwsan.com
---
 arch/arm/mach-omap2/dpll3xxx.c |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index f77022b..fe4533f 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -390,7 +390,8 @@ int omap3_noncore_dpll_enable(struct clk *clk)
 * propagating?
 */
if (!r)
-   clk-rate = omap2_get_dpll_rate(clk);
+   clk-rate = (clk-recalc) ? clk-recalc(clk) :
+   omap2_get_dpll_rate(clk);
 
return r;
 }
@@ -425,6 +426,7 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned 
long rate)
 {
struct clk *new_parent = NULL;
u16 freqsel = 0;
+   unsigned long hw_rate;
struct dpll_data *dd;
int ret;
 
@@ -435,7 +437,8 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned 
long rate)
if (!dd)
return -EINVAL;
 
-   if (rate == omap2_get_dpll_rate(clk))
+   hw_rate = (clk-recalc) ? clk-recalc(clk) : omap2_get_dpll_rate(clk);
+   if (rate == hw_rate)
return 0;
 
/*
-- 
1.7.6.3

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


Re: [PATCH] OMAP2+: clock: use clock's recalc in DPLL handling

2011-09-29 Thread Turquette, Mike
On Thu, Sep 29, 2011 at 6:26 PM, Paul Walmsley p...@pwsan.com wrote:
 Hi

 On Thu, 29 Sep 2011, Mike Turquette wrote:

 Not all DPLLs are identical; some require special consideration such as
 OMAP4's ABE DPLL, which can have an additional 4x multiplier added to
 it's clock rate based on programming the REGM4XEN bit in it's CLKMODE
 register.

 Unfortunately the clock framework makes a few assumptions that all DPLLs
 can have their rates calculated the same way which has led to incorrect
 rates for OMAP4's DPLL_ABE in some cases.  This patch fixes the same by
 replacing explicit calls to omap2_dpll_get_rate with clk-recalc if
 .recalc is populated for a clock.  If .recalc is NULL then fall back to
 omap2_dpll_get_rate.

 Reported-by: Misael Lopez Cruz misael.lo...@ti.com
 Signed-off-by: Mike Turquette mturque...@ti.com

 The conditional in the second hunk of this patch has been simplified for
 readability.  Updated patch below.  Please let me know if I screwed
 something up.  Otherwise, queued for 3.2 fixes.

Looks good to me.

Regards,
Mike

 thanks


 - Paul

 From: Mike Turquette mturque...@ti.com
 Date: Thu, 29 Sep 2011 17:51:28 -0700
 Subject: [PATCH] ARM: OMAP2+: clock: use clock's recalc in DPLL handling

 Not all DPLLs are identical; some require special consideration such as
 OMAP4's ABE DPLL, which can have an additional 4x multiplier added to
 it's clock rate based on programming the REGM4XEN bit in it's CLKMODE
 register.

 Unfortunately the clock framework makes a few assumptions that all DPLLs
 can have their rates calculated the same way which has led to incorrect
 rates for OMAP4's DPLL_ABE in some cases.  This patch fixes the same by
 replacing explicit calls to omap2_dpll_get_rate with clk-recalc if
 .recalc is populated for a clock.  If .recalc is NULL then fall back to
 omap2_dpll_get_rate.

 Reported-by: Misael Lopez Cruz misael.lo...@ti.com
 Signed-off-by: Mike Turquette mturque...@ti.com
 [p...@pwsan.com: simplified conditional]
 Signed-off-by: Paul Walmsley p...@pwsan.com
 ---
  arch/arm/mach-omap2/dpll3xxx.c |    7 +--
  1 files changed, 5 insertions(+), 2 deletions(-)

 diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
 index f77022b..fe4533f 100644
 --- a/arch/arm/mach-omap2/dpll3xxx.c
 +++ b/arch/arm/mach-omap2/dpll3xxx.c
 @@ -390,7 +390,8 @@ int omap3_noncore_dpll_enable(struct clk *clk)
         * propagating?
         */
        if (!r)
 -               clk-rate = omap2_get_dpll_rate(clk);
 +               clk-rate = (clk-recalc) ? clk-recalc(clk) :
 +                       omap2_get_dpll_rate(clk);

        return r;
  }
 @@ -425,6 +426,7 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned 
 long rate)
  {
        struct clk *new_parent = NULL;
        u16 freqsel = 0;
 +       unsigned long hw_rate;
        struct dpll_data *dd;
        int ret;

 @@ -435,7 +437,8 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned 
 long rate)
        if (!dd)
                return -EINVAL;

 -       if (rate == omap2_get_dpll_rate(clk))
 +       hw_rate = (clk-recalc) ? clk-recalc(clk) : omap2_get_dpll_rate(clk);
 +       if (rate == hw_rate)
                return 0;

        /*
 --
 1.7.6.3


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


Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-29 Thread Rajendra Nayak

[]...



+   init_data-supply_regulator = (char *)of_get_property(dev-of_node,
+   regulator-supplies, NULL);



I'd expect that in the device tree world the supply regulator would
reference the node for that regulator.



You mean using phandles? Thats what Grant proposed too but
I thought you instead had an inclination towards names? Or maybe
I misunderstood.


They need both.  We need to reference the device that provides the
supply and use a name to say which of the potentially multiple supplies
on the consumer device is which.


Mark, I still seem to be a little confused with this one as to why
we would need a phandle *and* a supply-name to reference a parent
regulator/supply.
The phandle would point to a regulator dt node and that node internally
would have just one name associated with it.




Hrm, I think loosing the signs here is bad karma - negative voltages do
exist after all.



Oops.. they do? didn't know about that.


Yup, ground is just a reference point.


--
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 6/9] regulator: make fixed regulator driver extract data from dt

2011-09-29 Thread Grant Likely
On Tue, Sep 27, 2011 at 03:42:49PM +0530, Rajendra Nayak wrote:
 Modify the fixed regulator driver to extract fixed_voltage_config from
 device tree when passed, instead of getting it through platform_data
 structures (on non-DT builds)
 
 Signed-off-by: Rajendra Nayak rna...@ti.com
 ---
  drivers/regulator/fixed.c |   18 +-
  1 files changed, 17 insertions(+), 1 deletions(-)
 
 diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
 index c09f791..0a9a10d 100644
 --- a/drivers/regulator/fixed.c
 +++ b/drivers/regulator/fixed.c
 @@ -140,10 +140,15 @@ static struct regulator_ops fixed_voltage_ops = {
  
  static int __devinit reg_fixed_voltage_probe(struct platform_device *pdev)
  {
 - struct fixed_voltage_config *config = pdev-dev.platform_data;
 + struct fixed_voltage_config *config;

This line doesn't actually need to change; just override it below if
the of_node is present.

   struct fixed_voltage_data *drvdata;
   int ret;
  
 + if (pdev-dev.of_node)
 + config = of_get_fixed_voltage_config(pdev-dev);
 + else
 + config = pdev-dev.platform_data;
 +
   drvdata = kzalloc(sizeof(struct fixed_voltage_data), GFP_KERNEL);
   if (drvdata == NULL) {
   dev_err(pdev-dev, Failed to allocate device data\n);
 @@ -252,12 +257,23 @@ static int __devexit reg_fixed_voltage_remove(struct 
 platform_device *pdev)
   return 0;
  }
  
 +#if defined(CONFIG_OF)
 +static const struct of_device_id fixed_of_match[] __devinitconst = {
 + { .compatible = regulator-fixed, },
 + {},
 +};
 +MODULE_DEVICE_TABLE(of, fixed_of_match);
 +#else
 +#define fixed_of_match NULL
 +#endif
 +
  static struct platform_driver regulator_fixed_voltage_driver = {
   .probe  = reg_fixed_voltage_probe,
   .remove = __devexit_p(reg_fixed_voltage_remove),
   .driver = {
   .name   = reg-fixed-voltage,
   .owner  = THIS_MODULE,
 + .of_match_table = fixed_of_match,


   },
  };
  
 -- 
 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


Re: [PATCH 0/9] Device tree support for regulators

2011-09-29 Thread Grant Likely
On Tue, Sep 27, 2011 at 03:42:43PM +0530, Rajendra Nayak wrote:
 Hi Mark, Grant,
 
 This is a respin of my RFC series I posted sometime back
 and is now based on top of the latest omap i2c-twl support
 series posted by Benoit
 git://gitorious.org/omap-pm/linux.git for_3.2/4_omap_dt_i2c_twl
 
 some changes done since the RFC:
 1. twl driver fixed to remove hardcoded board params
 2. regulator helpers moved from drivers/of to drivers/regulator
 3. Better compatible definitions for specific device type
 4. twl regulator driver doing internal table lookup based on
 compatible rather then pdev-id
 5. Seperate fixed voltage regulator bindings defined
 6. Changed the way devices associate with regulators
 i.e using name-supply = regulator-phandle;

Overall looks fairly good other than the comments made by Mark and myself.

g.

--
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 5/9] regulator: helper routine to extract fixed_voltage_config

2011-09-29 Thread Grant Likely
On Tue, Sep 27, 2011 at 03:42:48PM +0530, Rajendra Nayak wrote:
 The helper routine of_get_fixed_voltage_config() extracts
 fixed_voltage_config structure contents from device tree.
 
 Also add documenation for additional bindings for fixed
 regulators that can be passed through dt.
 
 Signed-off-by: Rajendra Nayak rna...@ti.com
 ---
  .../bindings/regulator/fixed-regulator.txt |   24 +
  drivers/regulator/fixed.c  |   36 
 
  include/linux/regulator/fixed.h|6 ++--
  3 files changed, 63 insertions(+), 3 deletions(-)
  create mode 100644 
 Documentation/devicetree/bindings/regulator/fixed-regulator.txt
 
 diff --git a/Documentation/devicetree/bindings/regulator/fixed-regulator.txt 
 b/Documentation/devicetree/bindings/regulator/fixed-regulator.txt
 new file mode 100644
 index 000..a204cbd
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/regulator/fixed-regulator.txt
 @@ -0,0 +1,24 @@
 +Fixed Voltage regulators
 +
 +Required properties:
 +- compatible: Must be regulator-fixed;
 +
 +Optional properties:
 +- regulator-fixed-supply: Name of the regulator supply
 +- regulator-fixed-microvolts: Output voltage of regulator
 +- regulator-fixed-gpio: gpio to use for enable control
 +- regulator-fixed-startup-delay: startup time in microseconds
 +- regulator-fixed-enable-high: Polarity of enable GPIO, 1 = Active High, 0 = 
 Active low
 +- regulator-fixed-enabled-at-boot: 1 = yes, 0 = no
 +
 +Example:
 +
 + abc: fixedregulator@0 {
 + compatible = regulator-fixed;
 + regulator-fixed-supply = fixed-supply;
 + regulator-fixed-microvolts = 180;
 + regulator-fixed-gpio = 43;
 + regulator-fixed-startup-delay = 7;
 + regulator-fixed-enable-high;
 + regulator-fixed-enabled-at-boot;
 + };
 diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
 index 2fe9d99..c09f791 100644
 --- a/drivers/regulator/fixed.c
 +++ b/drivers/regulator/fixed.c
 @@ -26,6 +26,8 @@
  #include linux/gpio.h
  #include linux/delay.h
  #include linux/slab.h
 +#include linux/of.h
 +#include linux/regulator/of_regulator.h
  
  struct fixed_voltage_data {
   struct regulator_desc desc;
 @@ -37,6 +39,40 @@ struct fixed_voltage_data {
   bool is_enabled;
  };
  
 +
 +/**
 + * of_get_fixed_voltage_config - extract fixed_voltage_config structure info
 + * @dev: device requesting for fixed_voltage_config
 + *
 + * Populates fixed_voltage_config structure by extracting data from device
 + * tree node, returns a pointer to the populated structure of NULL if memory
 + * alloc fails.
 + */
 +struct fixed_voltage_config *of_get_fixed_voltage_config(struct device *dev)
 +{
 + struct fixed_voltage_config *config;
 + struct device_node *np = dev-of_node;
 +
 + config = devm_kzalloc(dev, sizeof(struct fixed_voltage_config), 
 GFP_KERNEL);

Nit: config = devm_kzalloc(dev, *config, GFP_KERNEL);

g.
--
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 8/9] regulator: helper to extract regulator node based on supply name

2011-09-29 Thread Grant Likely
On Tue, Sep 27, 2011 at 03:42:51PM +0530, Rajendra Nayak wrote:
 Device nodes in DT can associate themselves with one or more
 regulators by providing a list of phandles (to regulator nodes)
 and corresponding supply names.
 
 For Example:
   devicenode: node@0x0 {
   ...
   ...
   vmmc-supply = regulator1;
   vpll-supply = regulator1;
   };
 
 The driver would then do a regulator_get(dev, vmmc); to get
 regulator1 and do a regulator_get(dev, vpll); to get
 regulator2.
 
 of_get_regulator() extracts the regulator node for a given
 device, based on the supply name.
 
 Signed-off-by: Rajendra Nayak rna...@ti.com
 ---
  drivers/regulator/of_regulator.c   |   39 
 
  include/linux/regulator/of_regulator.h |7 +
  2 files changed, 46 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/regulator/of_regulator.c 
 b/drivers/regulator/of_regulator.c
 index 7fa63ff..49dd105 100644
 --- a/drivers/regulator/of_regulator.c
 +++ b/drivers/regulator/of_regulator.c
 @@ -14,6 +14,45 @@
  #include linux/of.h
  #include linux/regulator/machine.h
  
 +
 +/**
 + * of_get_regulator - get a regulator device node based on supply name
 + * @dev: Device pointer for the consumer (of regulator) device
 + * @supply: regulator supply name
 + *
 + * Extract the regulator device node corresponding to the supply name.
 + * retruns the device node corresponding to the regulator if found, else
 + * returns NULL.
 + */
 +struct device_node *of_get_regulator(struct device *dev, const char *supply)
 +{
 + struct device_node *regnode = NULL;
 + u32 reghandle;
 + char prop_name[32]; /* 32 is max size of property name */
 + const void *prop;
 + int sz;
 +
 + if (!dev)
 + return NULL;
 +
 + dev_dbg(dev, Looking up %s-supply from device tree\n, supply);
 +
 + snprintf(prop_name, 32, %s-supply, supply);
 +
 + prop = of_get_property(dev-of_node, prop_name, sz);
 + if (!prop || sz  4)
 + return NULL;
 +
 + reghandle = be32_to_cpup(prop);
 + regnode = of_find_node_by_phandle(reghandle);

of_parse_phandle()

 + if (!regnode) {
 + pr_warn(%s: %s property in node %s references invalid phandle,
 + __func__, prop_name, dev-of_node-full_name);
 + return NULL;
 + }
 + return regnode;
 +}
 +
  static void of_get_regulation_constraints(struct device_node *np,
   struct regulator_init_data **init_data)
  {
 diff --git a/include/linux/regulator/of_regulator.h 
 b/include/linux/regulator/of_regulator.h
 index 3f63be9..edaba1a 100644
 --- a/include/linux/regulator/of_regulator.h
 +++ b/include/linux/regulator/of_regulator.h
 @@ -9,12 +9,19 @@
  #if defined(CONFIG_OF_REGULATOR)
  extern struct regulator_init_data
   *of_get_regulator_init_data(struct device *dev);
 +extern struct device_node *of_get_regulator(struct device *dev,
 + const char *supply);
  #else
  static inline struct regulator_init_data
   *of_get_regulator_init_data(struct device_node *np)
  {
   return NULL;
  }
 +static inline struct device_node *of_get_regulator(struct device *dev,
 + const char *id)
 +{
 + return NULL;
 +}
  #endif /* CONFIG_OF_REGULATOR */
  
  #endif /* __LINUX_OF_REG_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


Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-29 Thread Grant Likely
On Tue, Sep 27, 2011 at 01:10:04PM +0100, Mark Brown wrote:
 On Tue, Sep 27, 2011 at 03:42:45PM +0530, Rajendra Nayak wrote:
 
  +   init_data = devm_kzalloc(dev, sizeof(struct regulator_init_data),
  +GFP_KERNEL);
  +   if (!init_data)
  +   return NULL; /* Out of memory? */
 
 This means that the init data will be kept around for the entire
 lifetime of the device rather than being discarded.
 
  +   init_data-supply_regulator = (char *)of_get_property(dev-of_node,
  +   regulator-supplies, NULL);
 
 I'd expect that in the device tree world the supply regulator would
 reference the node for that regulator.

Yes, I would expect the same.
--
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 9/9] regulator: map consumer regulator based on device tree

2011-09-29 Thread Grant Likely
On Tue, Sep 27, 2011 at 03:42:52PM +0530, Rajendra Nayak wrote:
 Look up the regulator for a given consumer from device tree, during
 a regulator_get(). If not found fallback and lookup through
 the regulator_map_list instead.
 
 Devices can associate with one or more regulators by providing a
 list of phandles and supply names.
 
 For Example:
 devicenode: node@0x0 {
 ...
 ...
 vmmc-supply = regulator1;
 vpll-supply = regulator2;
 };
 
 When a device driver calls a regulator_get, specifying the
 supply name, the phandle and eventually the regulator node
 is extracted from the device node.
 
 Signed-off-by: Rajendra Nayak rna...@ti.com
 ---
  drivers/regulator/core.c |   14 ++
  include/linux/regulator/driver.h |3 +++
  2 files changed, 17 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
 index d8e6a42..47b851c 100644
 --- a/drivers/regulator/core.c
 +++ b/drivers/regulator/core.c
 @@ -25,9 +25,11 @@
  #include linux/mutex.h
  #include linux/suspend.h
  #include linux/delay.h
 +#include linux/of.h
  #include linux/regulator/consumer.h
  #include linux/regulator/driver.h
  #include linux/regulator/machine.h
 +#include linux/regulator/of_regulator.h
  
  #define CREATE_TRACE_POINTS
  #include trace/events/regulator.h
 @@ -1155,6 +1157,7 @@ static struct regulator *_regulator_get(struct device 
 *dev, const char *id,
   struct regulator_map *map;
   struct regulator *regulator = ERR_PTR(-ENODEV);
   const char *devname = NULL;
 + struct device_node *node;
   int ret;
  
   if (id == NULL) {
 @@ -1167,6 +1170,15 @@ static struct regulator *_regulator_get(struct device 
 *dev, const char *id,
  
   mutex_lock(regulator_list_mutex);
  
 + if (dev-of_node) {
 + node = of_get_regulator(dev, id);
 + if (!node)
 + goto retry; /* fallback and chk regulator_map_list */
 + list_for_each_entry(rdev, regulator_list, list)
 + if (node == rdev-node)
 + goto found;
 + }
 +retry:
   list_for_each_entry(map, regulator_map_list, list) {
   /* If the mapping has a device set up it must match */
   if (map-dev_name 
 @@ -2619,6 +2631,8 @@ struct regulator_dev *regulator_register(struct 
 regulator_desc *regulator_desc,
   rdev-reg_data = driver_data;
   rdev-owner = regulator_desc-owner;
   rdev-desc = regulator_desc;
 + if (dev  dev-of_node)
 + rdev-node = dev-of_node;
   INIT_LIST_HEAD(rdev-consumer_list);
   INIT_LIST_HEAD(rdev-list);
   BLOCKING_INIT_NOTIFIER_HEAD(rdev-notifier);
 diff --git a/include/linux/regulator/driver.h 
 b/include/linux/regulator/driver.h
 index 1a80bc7..4aebbf5 100644
 --- a/include/linux/regulator/driver.h
 +++ b/include/linux/regulator/driver.h
 @@ -196,6 +196,9 @@ struct regulator_dev {
   struct mutex mutex; /* consumer lock */
   struct module *owner;
   struct device dev;
 +#ifdef CONFIG_OF
 + struct device_node *node;
 +#endif

There is already an of_node pointer in regulator_dev-dev.of_node.
Why does another need to be added here?

g.

--
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 00/10] OMAP DSS related board changes

2011-09-29 Thread Tomi Valkeinen
On Thu, 2011-09-29 at 10:52 -0700, Tony Lindgren wrote:
 * Tomi Valkeinen tomi.valkei...@ti.com [110925 23:04]:
  On Tue, 2011-09-20 at 11:18 +0300, Tomi Valkeinen wrote:
   Hi Tony,
   
   Here is a bunch of board file patches related to DSS. They have all been 
   sent
   for review earlier, and are currently in my tree. Some of them depend on 
   DSS
   driver changes, so I'd like to keep them there to avoid compilation errors
   (these won't compile if you apply them without patches from DSS tree).
   
   Can you give your ack for these? Alternatively we can see which of these 
   could
   go through your tree and I can make a new set.
  
  Tony, ping. I'd like to get these in for 3.2, as many DSS driver patches
  depend on some of these.
 
 Sorry for the delay. Looks like these will conflict with your
 earlier patches I have in the board branch and other cleanup.
 
 I'll drop the earlier patches from my board branch so you can
 queue all of them:

Ok, I'll add them to dss branch.

 OMAP: Apollon: Port the display driver to new DSS2
 OMAP: H4: Port the display driver to new DSS2
 OMAP: LDP: Port the display driver to new DSS2
 OMAP: 2420SDP: Port the display driver to new DSS2
 OMAP: omap3touchbook: Remove unused lcd stuff
 OMAP: RX51: Remove unused old omapfb stuff
 
 Your new patches all look OK to me, just please check what we
 have in omap cleanup branch as we don't have all that queud up
 yet in next.

Sure, will do.

 It's likely these will need to be rebased on those, so maybe wait
 a bit with these or adjust them accordingly if possible.
 
 Also, you might want to start looking into passing the configuration
 from DT instead to avoid the platform init code. Probably the
 panel configuration would be the place to start with that?

I haven't actually looked at DT yet, but one reason I've been writing
and pushing these old omapfb cleanups is to get all omap2+ boards use
the new dss driver, and thus hopefully making DT adaptation easier as I
can (for now) ignore the old omapfb and omap1 boards regarding DT.

But yes, I definitely need to look at DT. Is there a driver to be used
as a sample when looking at DT?

 So for all of them:
 
 Acked-by: Tony Lindgren t...@atomide.com

Thanks.

 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


[PATCH 2/5 v12] arm: omap: usb: ehci and ohci hwmod structures for omap3

2011-09-29 Thread Keshava Munegowda
Following 2 hwmod structures are added
1. usb_host_hs
 The hwmod of usbhs with uhh, ehci and ohci base addresses
 functional clock and ehci, ohci irqs

2. usb_tll_hs
  hwmod of usbhs with the TLL base address and irq.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  195 
 1 files changed, 195 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 59fdb9f..bc17493 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 = {
@@ -3196,6 +3198,194 @@ 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 = usb_host_hs,
+   .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_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,
+   },
+   {
+   .name   = ehci,
+   .pa_start   = 0x48064800,
+   .pa_end = 0x48064cff,
+   },
+   {}
+};
+
+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,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if omap34xx_usb_host_hs__ick = {
+   .clk= usbhost_ick,
+   .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_usb_host_hs__ick,
+};
+
+static struct omap_hwmod_opt_clk omap34xx_usb_host_hs_opt_clks[] = {
+ { .role = usbhost_fck2, .clk = usbhost_120m_fck, },
+};
+
+static struct omap_hwmod_irq_info omap34xx_usb_host_hs_irqs[] = {
+   { .name = ohci-irq, .irq = 76 },
+   { .name = ehci-irq, .irq = 77 },
+   { .irq = -1 }
+};
+
+static struct omap_hwmod omap34xx_usb_host_hs_hwmod = {
+   .name   = usb_host_hs,
+   .class  = omap34xx_usb_host_hs_hwmod_class,
+   .clkdm_name = l3_init_clkdm,
+   .mpu_irqs   = omap34xx_usb_host_hs_irqs,
+   .main_clk   = usbhost_48m_fck,
+   .prcm = {
+   .omap2 = {
+   .module_offs = OMAP3430ES2_USBHOST_MOD,
+   .prcm_reg_id = 1,
+   .module_bit = OMAP3430ES2_EN_USBHOST1_SHIFT,
+   .idlest_reg_id = 1,
+   .idlest_idle_bit = OMAP3430ES2_ST_USBHOST_IDLE_SHIFT,
+   .idlest_stdby_bit = OMAP3430ES2_ST_USBHOST_STDBY_SHIFT,
+   },
+   },
+   .opt_clks   = omap34xx_usb_host_hs_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(omap34xx_usb_host_hs_opt_clks),
+   .slaves = omap34xx_usb_host_hs_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap34xx_usb_host_hs_slaves),
+   .masters= omap34xx_usb_host_hs_masters,
+   .masters_cnt= 

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

2011-09-29 Thread Keshava Munegowda
From: Benoit Cousson b-cous...@ti.com

Following 2 hwmod structures are added
1. usb_host_hs
 The hwmod of usbhs with uhh, ehci and ohci base addresses
 functional clock and ehci, ohci irqs

2. usb_tll_hs
  hwmod of usbhs with the TLL base address and irq.

Signed-off-by: Benoit Cousson b-cous...@ti.com

- rebased to kernel version 3.0

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  171 +++-
 1 files changed, 170 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 6201422..5e6e3c6 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -68,6 +68,8 @@ static struct omap_hwmod omap44xx_mmc2_hwmod;
 static struct omap_hwmod omap44xx_mpu_hwmod;
 static struct omap_hwmod omap44xx_mpu_private_hwmod;
 static struct omap_hwmod omap44xx_usb_otg_hs_hwmod;
+static struct omap_hwmod omap44xx_usb_host_hs_hwmod;
+static struct omap_hwmod omap44xx_usb_tll_hs_hwmod;
 
 /*
  * Interconnects omap_hwmod structures
@@ -5336,6 +5338,170 @@ static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
+/*
+ * 'usb_host_hs' class
+ * high-speed multi-port usb host controller
+ */
+static struct omap_hwmod_ocp_if omap44xx_usb_host_hs__l3_main_2 = {
+   .master = omap44xx_usb_host_hs_hwmod,
+   .slave  = omap44xx_l3_main_2_hwmod,
+   .clk= l3_div_ck,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_class_sysconfig omap44xx_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 |
+  SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
+  MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
+   .sysc_fields= omap_hwmod_sysc_type2,
+};
+
+static struct omap_hwmod_class omap44xx_usb_host_hs_hwmod_class = {
+   .name = usb_host_hs,
+   .sysc = omap44xx_usb_host_hs_sysc,
+};
+
+static struct omap_hwmod_ocp_if *omap44xx_usb_host_hs_masters[] = {
+   omap44xx_usb_host_hs__l3_main_2,
+};
+
+static struct omap_hwmod_addr_space omap44xx_usb_host_hs_addrs[] = {
+   {
+   .name   = uhh,
+   .pa_start   = 0x4a064000,
+   .pa_end = 0x4a0647ff,
+   .flags  = ADDR_TYPE_RT
+   },
+   {
+   .name   = ohci,
+   .pa_start   = 0x4a064800,
+   .pa_end = 0x4a064bff,
+   },
+   {
+   .name   = ehci,
+   .pa_start   = 0x4a064c00,
+   .pa_end = 0x4a064fff,
+   },
+   {}
+};
+
+static struct omap_hwmod_irq_info omap44xx_usb_host_hs_irqs[] = {
+   { .name = ohci-irq, .irq = 76 + OMAP44XX_IRQ_GIC_START },
+   { .name = ehci-irq, .irq = 77 + OMAP44XX_IRQ_GIC_START },
+   { .irq = -1 }
+};
+
+static struct omap_hwmod_ocp_if omap44xx_l4_cfg__usb_host_hs = {
+   .master = omap44xx_l4_cfg_hwmod,
+   .slave  = omap44xx_usb_host_hs_hwmod,
+   .clk= l4_div_ck,
+   .addr   = omap44xx_usb_host_hs_addrs,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap44xx_usb_host_hs_slaves[] = {
+   omap44xx_l4_cfg__usb_host_hs,
+};
+
+static struct omap_hwmod omap44xx_usb_host_hs_hwmod = {
+   .name   = usb_host_hs,
+   .class  = omap44xx_usb_host_hs_hwmod_class,
+   .clkdm_name = l3_init_clkdm,
+   .main_clk   = usb_host_hs_fck,
+   .prcm = {
+   .omap4 = {
+   .clkctrl_offs = OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_OFFSET,
+   .context_offs = OMAP4_RM_L3INIT_USB_HOST_CONTEXT_OFFSET,
+   .modulemode   = MODULEMODE_SWCTRL,
+   },
+   },
+   .mpu_irqs   = omap44xx_usb_host_hs_irqs,
+   .slaves = omap44xx_usb_host_hs_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap44xx_usb_host_hs_slaves),
+   .masters= omap44xx_usb_host_hs_masters,
+   .masters_cnt= ARRAY_SIZE(omap44xx_usb_host_hs_masters),
+/*
+ * The usbhs controller prevents the enter omap to low power mode
+ * if other than FORCE IDLE and FORCE STANDBY are used.
+ */
+   .flags  = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+/*
+ * 'usb_tll_hs' class
+ * usb_tll_hs module is the adapter on the usb_host_hs ports
+ */
+static struct omap_hwmod_class_sysconfig omap44xx_usb_tll_hs_sysc = {
+   .rev_offs 

[PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs

2011-09-29 Thread Keshava Munegowda
The hwmod structure of usb_host_hs  and usb_tll are
retrieved and registered with omap device

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/mach-omap2/usb-host.c |  100 ++--
 1 files changed, 34 insertions(+), 66 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index 89ae298..771dc78 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -28,51 +28,28 @@
 #include mach/hardware.h
 #include mach/irqs.h
 #include plat/usb.h
+#include plat/omap_device.h
 
 #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 usb_host_hs
+#define USBHS_TLL_HWMODNAMEusb_tll_hs
 
 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,34 @@ 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 

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

2011-09-29 Thread Keshava Munegowda
From: Keshava Munegowda keshava_mgo...@ti.com

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; The redudant clock nodes are removed.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c |   26 --
 arch/arm/mach-omap2/clock44xx_data.c |   10 +-
 drivers/mfd/omap-usb-host.c  |2 +-
 3 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index ffd55b1..63a822f 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,18 @@ 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(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(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(NULL,   wkup_32k_fck, wkup_32k_fck,  CK_3XXX),
diff --git a/arch/arm/mach-omap2/clock44xx_data.c 
b/arch/arm/mach-omap2/clock44xx_data.c
index 2af0e3f..088977a 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ 

[PATCH 5/5 v12] mfd: omap: usb: Runtime PM support

2011-09-29 Thread Keshava Munegowda
From: Keshava Munegowda keshava_mgo...@ti.com

The usbhs core driver does not enable/disable the interface and
functional clocks directly, These clocks are handled by runtime pm,
hence instead of the clock enable/disable, the runtime pm APIS are
used. however,the optional clocks and port clocks are handled by
the usbhs core.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
Reviewed-by: Kevin Hilman khil...@ti.com
Reviewed-by: Partha Basak part...@india.ti.com
---
 arch/arm/plat-omap/include/plat/usb.h |3 -
 drivers/mfd/omap-usb-host.c   |  746 +
 drivers/usb/host/ehci-omap.c  |   17 +-
 drivers/usb/host/ohci-omap3.c |   18 +-
 4 files changed, 310 insertions(+), 474 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/usb.h 
b/arch/arm/plat-omap/include/plat/usb.h
index 17d3c93..2b66dc2 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -100,9 +100,6 @@ extern void usb_musb_init(struct omap_musb_board_data 
*board_data);
 
 extern void usbhs_init(const struct usbhs_omap_board_data *pdata);
 
-extern int omap_usbhs_enable(struct device *dev);
-extern void omap_usbhs_disable(struct device *dev);
-
 extern int omap4430_phy_power(struct device *dev, int ID, int on);
 extern int omap4430_phy_set_clk(struct device *dev, int on);
 extern int omap4430_phy_init(struct device *dev);
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 9c2da29..a1d1843 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -26,6 +26,7 @@
 #include linux/spinlock.h
 #include linux/gpio.h
 #include plat/usb.h
+#include linux/pm_runtime.h
 
 #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,7 @@ 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;
+   struct clk  *opt_clk;
 
void __iomem*uhh_base;
void __iomem*tll_base;
@@ -168,7 +165,6 @@ struct usbhs_hcd_omap {
 
u32 usbhs_rev;
spinlock_t  lock;
-   int count;
 };
 /*-*/
 
@@ -318,269 +314,6 @@ err_end:
return ret;
 }
 
-/**
- * usbhs_omap_probe - initialize TI-based HCDs
- *
- * Allocates basic resources for this USB host controller.
- */
-static int __devinit usbhs_omap_probe(struct platform_device *pdev)
-{
-   struct device   *dev =  pdev-dev;
-   struct usbhs_omap_platform_data *pdata = dev-platform_data;
-   struct usbhs_hcd_omap   *omap;
-   struct resource *res;
-   int ret = 0;
-   int i;
-
-   if (!pdata) {
-   dev_err(dev, Missing platform data\n);
-   ret = -ENOMEM;
-   goto end_probe;
-   }
-
-   omap = kzalloc(sizeof(*omap), GFP_KERNEL);
-   if (!omap) {
-   dev_err(dev, Memory allocation failed\n);
-   ret = -ENOMEM;
-   goto end_probe;
-   }
-
-   spin_lock_init(omap-lock);
-
-   for (i = 0; i  OMAP3_HS_USB_PORTS; i++)
-   omap-platdata.port_mode[i] = pdata-port_mode[i];
-
-   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 = 

Re: [PATCH 0/5 v12] mfd: omap: usb: Runtime PM support for EHCI and OHCI drivers

2011-09-29 Thread Munegowda, Keshava
On Thu, Sep 29, 2011 at 7:54 PM, Keshava Munegowda
keshava_mgo...@ti.com wrote:
 From: Keshava Munegowda keshava_mgo...@ti.com

 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.

 TODO:
  - Adding mux-information to Hwmods.
  - Aggressive Clock Management around USB bus suspend/resume.
  - Remote Wakeup support implementation using IO-ring Wakeup
    on EHCI/OHCI pads via PRCM IRQ chain handler.


 In version 12:
  - The ehci, ohci and usb_host_hs hwmods combined as a single hwmod
    usb_host_hs.
  - for omap3
        the usbhost_ick and and usbtll_ick clocks are changed as interface
        clocks. The usbtll_fck, usbhost_48m_fck clocks are changed as main
        clocks and the 120mhz functional clock is changed to optional clock
  - the usbhs mfd driver enable/disable this optional clock in
    runtime_resume and runtime_suspend callbacks of pm_runtime_get_sync
    and pm_runtime_put_sync APIs.

 Benoit Cousson (1):
  arm: omap: usb: ehci and ohci hwmod structures for omap4

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

  arch/arm/mach-omap2/clock3xxx_data.c       |   26 +-
  arch/arm/mach-omap2/clock44xx_data.c       |   10 +-
  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  195 
  arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  171 +++-
  arch/arm/mach-omap2/usb-host.c             |  100 ++---
  arch/arm/plat-omap/include/plat/usb.h      |    3 -
  drivers/mfd/omap-usb-host.c                |  748 
 +++-
  drivers/usb/host/ehci-omap.c               |   17 +-
  drivers/usb/host/ohci-omap3.c              |   18 +-
  9 files changed, 727 insertions(+), 561 deletions(-)


Hi Paul/Benoit

due to Google mail box problems; the patches were not sent with proper version;
hence , i have re posted the patches again now.
please review this latest series.

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