RE: [RFC][PATCH] omapfb: Reorder Register_framebuffer call

2009-09-04 Thread Gadiyar, Anand
 From: Sergio Aguirre saagui...@ti.com
 
 This fixes the issue in which mm_lock mutex was attempted to be
 used without initializing previously.
 
 Signed-off-by: Sergio Aguirre saagui...@ti.com

Tested-by: Anand Gadiyar gadi...@ti.com

This patch on top of current linux-omap kernel allows me to
boot with the default SDP defconfig on a 3430 SDP.

- Anand


 ---
  drivers/video/omap/omapfb_main.c |   20 +++-
  1 files changed, 11 insertions(+), 9 deletions(-)
 
 diff --git a/drivers/video/omap/omapfb_main.c 
 b/drivers/video/omap/omapfb_main.c
 index 125e605..60f9482 100644
 --- a/drivers/video/omap/omapfb_main.c
 +++ b/drivers/video/omap/omapfb_main.c
 @@ -1503,12 +1503,21 @@ static int fbinfo_init(struct omapfb_device *fbdev, 
 struct fb_info *info)
   var-rotate   = def_rotate;
   var-bits_per_pixel = fbdev-panel-bpp;
  
 + r = register_framebuffer(info);
 + if (r != 0) {
 + dev_err(fbdev-dev,
 + registering framebuffer failed\n);
 + return r;
 + }
 +
   set_fb_var(info, var);
   set_fb_fix(info);
  
   r = fb_alloc_cmap(info-cmap, 16, 0);
 - if (r != 0)
 + if (r != 0) {
   dev_err(fbdev-dev, unable to allocate color map memory\n);
 + unregister_framebuffer(info);
 + }
  
   return r;
  }
 @@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct platform_device 
 *pdev,
   init_state++;
  
   vram = 0;
 - for (i = 0; i  fbdev-mem_desc.region_cnt; i++) {
 - r = register_framebuffer(fbdev-fb_info[i]);
 - if (r != 0) {
 - dev_err(fbdev-dev,
 - registering framebuffer %d failed\n, i);
 - goto cleanup;
 - }
 + for (i = 0; i  fbdev-mem_desc.region_cnt; i++)
   vram += fbdev-mem_desc.region[i].size;
 - }
  
   fbdev-state = OMAPFB_ACTIVE;
  
 -- 
 1.6.3.2
 
 --
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


3430SDP: Crash on first UART keypress after boot

2009-09-04 Thread Gadiyar, Anand
Current linux-omap kernel boots up fine on 3430 SDP after
adding Sergio's patch [1], but then I get the following crash
on the first UART keypress.

This is new, it used to work okay a little while ago.

Regards,
Anand

1Unable to handle kernel NULL pointer dereference at virtual address 0010
1pgd = c79f8000
1[0010] *pgd=87b05031, *pte=, *ppte=
Internal error: Oops: 817 [#1]
dModules linked in:
CPU: 0Not tainted  (2.6.31-rc8-omap1 #5)
PC is at do_con_write+0x61c/0x1d30
LR is at do_con_write+0x404/0x1d30
pc : [c01d3a0c]lr : [c01d37f4]psr: 6013
sp : c7b7be38  ip :   fp : 0001
r10:   r9 :   r8 : c79d9000
r7 : 0073  r6 : 0100  r5 : 0073  r4 : 0073
r3 : 0173  r2 : 080104c0  r1 : 0010  r0 : 0173
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c5387d  Table: 879f8019  DAC: 0015
Process init (pid: 594, stack limit = 0xc7b7a2f0)
Stack: (0xc7b7be38 to 0xc7b7c000)
be20:   c7b0c800 
be40: c7a3e300 c01c3e70 002e c79e9400 c7b0c800 0100 0001 
be60:   00ff  c7b5a000 c74b0300 0022 c00bab3c
be80: c79fdab0 0004 c7b53580 c79fdab0 c00baa18  c79d9000 0073
bea0: c7b7a000 c7b0c800 c7b0c800 c79e9400 002f c7b7a000 c7b53580 c7b0cbc8
bec0: c79e9400 c01d5168 c7988000 c7b0c800 c79e9400 c01c4e00 c7b0c910 c7b0c89c
bee0:   c7988000 c004ece0 c7b0c910 c7b0c910  002f
bf00: 0400  c7b0c800 c7b7a000 002f  c7b53580 c01c28bc
bf20: c7a60a80 bed48554 c01c4bb4 c798e520  c7b44588 000b c7b53580
bf40: bed48554 c7b7bf80 002f 002f c7b7a000 40025000 bed48f14 c00b8988
bf60: c7b53580 bed48554   c7b53580 002f bed48554 c00b8adc
bf80:   002f  002f bed48554 0003 0004
bfa0: c002df44 c002ddc0 002f bed48554 0003 bed48554 002f 000c1704
bfc0: 002f bed48554 0003 0004 000c1764 0001 40025000 bed48f14
bfe0: 4001e6f0 bed48520 0004193c 401c1f6c 6010 0003  
[c01d3a0c] (do_con_write+0x61c/0x1d30) from [c01d5168] (con_write+0xc/0x20)
[c01d5168] (con_write+0xc/0x20) from [c01c4e00] (n_tty_write+0x24c/0x3ac)
[c01c4e00] (n_tty_write+0x24c/0x3ac) from [c01c28bc] (tty_write+0x188/0x224)
[c01c28bc] (tty_write+0x188/0x224) from [c00b8988] (vfs_write+0xac/0x154)
[c00b8988] (vfs_write+0xac/0x154) from [c00b8adc] (sys_write+0x3c/0x68)
[c00b8adc] (sys_write+0x3c/0x68) from [c002ddc0] (ret_fast_syscall+0x0/0x2c)
Code: e6ec2077 11a03000 e0833002 e6ff0073 (e1c100b0)
4---[ end trace 5a94e3c94d71be0e ]-
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [RFC][PATCH] omapfb: Reorder Register_framebuffer call

2009-09-04 Thread Hiremath, Vaibhav
 -Original Message-
 From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
 ow...@vger.kernel.org] On Behalf Of Gadiyar, Anand
 Sent: Friday, September 04, 2009 12:15 PM
 To: Aguirre Rodriguez, Sergio Alberto; linux-fbdev-
 de...@lists.sourceforge.net
 Cc: Imre Deak; linux-omap@vger.kernel.org
 Subject: RE: [RFC][PATCH] omapfb: Reorder Register_framebuffer call
 
  From: Sergio Aguirre saagui...@ti.com
 
  This fixes the issue in which mm_lock mutex was attempted to be
  used without initializing previously.
 
  Signed-off-by: Sergio Aguirre saagui...@ti.com
 
 Tested-by: Anand Gadiyar gadi...@ti.com
 
 This patch on top of current linux-omap kernel allows me to
 boot with the default SDP defconfig on a 3430 SDP.
 
[Hiremath, Vaibhav] I have tried it on OMAP3EVM and it allowed me to boot, 
which was crashing before.

Thanks,
Vaibhav

 - Anand
 
 
  ---
   drivers/video/omap/omapfb_main.c |   20 +++-
   1 files changed, 11 insertions(+), 9 deletions(-)
 
  diff --git a/drivers/video/omap/omapfb_main.c
 b/drivers/video/omap/omapfb_main.c
  index 125e605..60f9482 100644
  --- a/drivers/video/omap/omapfb_main.c
  +++ b/drivers/video/omap/omapfb_main.c
  @@ -1503,12 +1503,21 @@ static int fbinfo_init(struct
 omapfb_device *fbdev, struct fb_info *info)
  var-rotate   = def_rotate;
  var-bits_per_pixel = fbdev-panel-bpp;
 
  +   r = register_framebuffer(info);
  +   if (r != 0) {
  +   dev_err(fbdev-dev,
  +   registering framebuffer failed\n);
  +   return r;
  +   }
  +
  set_fb_var(info, var);
  set_fb_fix(info);
 
  r = fb_alloc_cmap(info-cmap, 16, 0);
  -   if (r != 0)
  +   if (r != 0) {
  dev_err(fbdev-dev, unable to allocate color map
 memory\n);
  +   unregister_framebuffer(info);
  +   }
 
  return r;
   }
  @@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct
 platform_device *pdev,
  init_state++;
 
  vram = 0;
  -   for (i = 0; i  fbdev-mem_desc.region_cnt; i++) {
  -   r = register_framebuffer(fbdev-fb_info[i]);
  -   if (r != 0) {
  -   dev_err(fbdev-dev,
  -   registering framebuffer %d failed\n, i);
  -   goto cleanup;
  -   }
  +   for (i = 0; i  fbdev-mem_desc.region_cnt; i++)
  vram += fbdev-mem_desc.region[i].size;
  -   }
 
  fbdev-state = OMAPFB_ACTIVE;
 
  --
  1.6.3.2
 
  --
 To unsubscribe from this list: send the line unsubscribe linux-
 omap in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

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


[PATCH 3/4] dspbridge: use linux memory allocator directly

2009-09-04 Thread Andy Shevchenko
From: Andy Shevchenko ext-andriy.shevche...@nokia.com

Instead of MEM_Calloc()/MEM_Free() use kzalloc()/kfree() calls. Thus we get rid
of mem.h dependency.

Signed-off-by: Andy Shevchenko ext-andriy.shevche...@nokia.com
---
 arch/arm/plat-omap/include/dspbridge/list.h |   11 +--
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/list.h 
b/arch/arm/plat-omap/include/dspbridge/list.h
index 414579f..867f5ac 100644
--- a/arch/arm/plat-omap/include/dspbridge/list.h
+++ b/arch/arm/plat-omap/include/dspbridge/list.h
@@ -49,8 +49,8 @@
 #define LIST_
 
 #include dspbridge/host_os.h
-/* MEM_Calloc(), MEM_NONPAGED, MEM_Free() */
-#include dspbridge/mem.h
+#include linux/types.h
+#include linux/slab.h
 #include linux/list.h
 
 #define LST_ELEMlist_head
@@ -85,9 +85,9 @@ struct LST_LIST {
 static inline struct LST_LIST *LST_Create(void)
 {
struct LST_LIST *pList;
+   gfp_t flags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL;
 
-   pList = (struct LST_LIST *) MEM_Calloc(sizeof(struct LST_LIST),
-   MEM_NONPAGED);
+   pList = kzalloc(sizeof(*pList), flags);
if (pList != NULL)
INIT_LIST_HEAD(pList-head);
 
@@ -116,8 +116,7 @@ static inline struct LST_LIST *LST_Create(void)
  */
 static inline void LST_Delete(struct LST_LIST *pList)
 {
-   if (pList != NULL)
-   MEM_Free(pList);
+   kfree(pList);
 }
 
 /*
-- 
1.5.6.5

--
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/4] DSPBRIDGE: Get rid of services/list.c

2009-09-04 Thread Andy Shevchenko
From: Andy Shevchenko ext-andriy.shevche...@nokia.com

* Use native list_empty() method instead of LST_IsEmpty() inside list.c. Remove
  extra local variables.
* Move methods from list.c as inline functions in the list.h. Get rid of list.c
  at all.
* Use list_head natively instead of LST_ELEM in the list.h.

Signed-off-by: Andy Shevchenko ext-andriy.shevche...@nokia.com
---
 arch/arm/plat-omap/include/dspbridge/list.h |   90 ++---
 drivers/dsp/bridge/Kbuild   |2 +-
 drivers/dsp/bridge/services/list.c  |  200 ---
 3 files changed, 74 insertions(+), 218 deletions(-)
 delete mode 100644 drivers/dsp/bridge/services/list.c

diff --git a/arch/arm/plat-omap/include/dspbridge/list.h 
b/arch/arm/plat-omap/include/dspbridge/list.h
index f9bbd13..414579f 100644
--- a/arch/arm/plat-omap/include/dspbridge/list.h
+++ b/arch/arm/plat-omap/include/dspbridge/list.h
@@ -49,14 +49,16 @@
 #define LIST_
 
 #include dspbridge/host_os.h
+/* MEM_Calloc(), MEM_NONPAGED, MEM_Free() */
+#include dspbridge/mem.h
 #include linux/list.h
 
 #define LST_ELEMlist_head
 #define LST_IsEmpty(l)  list_empty((l)-head)
 
-   struct LST_LIST {
-   struct LST_ELEM head;
-   } ;
+struct LST_LIST {
+   struct list_head head;
+};
 
 /*
  *   LST_Create 
@@ -80,7 +82,17 @@
  *  empty element, because its next and prev pointers point at
  *  the same location (the element itself).
  */
-   extern struct LST_LIST *LST_Create(void);
+static inline struct LST_LIST *LST_Create(void)
+{
+   struct LST_LIST *pList;
+
+   pList = (struct LST_LIST *) MEM_Calloc(sizeof(struct LST_LIST),
+   MEM_NONPAGED);
+   if (pList != NULL)
+   INIT_LIST_HEAD(pList-head);
+
+   return pList;
+}
 
 /*
  *   LST_Delete 
@@ -102,7 +114,11 @@
  *  chain of list elements.  Calling this function on a non-empty list
  *  will cause a memory leak.
  */
-   extern void LST_Delete(IN struct LST_LIST *pList);
+static inline void LST_Delete(struct LST_LIST *pList)
+{
+   if (pList != NULL)
+   MEM_Free(pList);
+}
 
 /*
  *   LST_First 
@@ -118,7 +134,12 @@
  *  - pList != NULL.
  *  Ensures:
  */
-   extern struct LST_ELEM *LST_First(IN struct LST_LIST *pList);
+static inline struct list_head *LST_First(struct LST_LIST *pList)
+{
+   if (pList  !list_empty(pList-head))
+   return pList-head.next;
+   return NULL;
+}
 
 /*
  *   LST_GetHead 
@@ -148,7 +169,19 @@
  *  the head of the list, and the head of the list points backward (its
  *  prev pointer) to the tail of the list, this list is circular.
  */
-   extern struct LST_ELEM *LST_GetHead(IN struct LST_LIST *pList);
+static inline struct list_head *LST_GetHead(struct LST_LIST *pList)
+{
+   struct list_head *pElem;
+
+   if (!pList  list_empty(pList-head))
+   return NULL;
+
+   pElem = pList-head.next;
+   pList-head.next = pElem-next;
+   pElem-next-prev = pList-head;
+
+   return pElem;
+}
 
 /*
  *   LST_InitElem 
@@ -166,7 +199,13 @@
  *  of a list chain -- that would break the chain.
  *
  */
-   extern void LST_InitElem(IN struct LST_ELEM *pListElem);
+static inline void LST_InitElem(struct list_head *pElem)
+{
+   if (pElem) {
+   pElem-next = NULL;
+   pElem-prev = NULL;
+   }
+}
 
 /*
  *   LST_InsertBefore 
@@ -184,9 +223,13 @@
  *  - pElemExisting != NULL.
  *  Ensures:
  */
-   extern void LST_InsertBefore(IN struct LST_LIST *pList,
-IN struct LST_ELEM *pElem,
-IN struct LST_ELEM *pElemExisting);
+static inline void LST_InsertBefore(struct LST_LIST *pList,
+   struct list_head *pElem,
+   struct list_head *pElemExisting)
+{
+   if (pList  pElem  pElemExisting)
+   list_add_tail(pElem, pElemExisting);
+}
 
 /*
  *   LST_Next 
@@ -204,8 +247,14 @@
  *  - pCurElem != NULL.
  *  Ensures:
  */
-   extern struct LST_ELEM *LST_Next(IN struct LST_LIST *pList,
-IN struct LST_ELEM *pCurElem);
+static inline struct list_head *LST_Next(struct LST_LIST *pList,
+struct list_head *pCurElem)
+{
+   if (pList  !list_empty(pList-head)  pCurElem 
+  (pCurElem-next != pList-head))
+   return pCurElem-next;
+   return NULL;
+}
 
 /*
  *   LST_PutTail 
@@ -235,8 +284,11 @@
  *  tail's next pointer points at the head of the list, and the head's
  *  prev pointer points at the tail of the list), the list is circular.
  */
-   extern void LST_PutTail(IN struct LST_LIST *pList,
-   IN struct LST_ELEM *pListElem);

dspbridge rfc: get rid of services/list.c (rebased)

2009-09-04 Thread Andy Shevchenko

Hello.

Here are a few patches which change driver's own circular linked list
implementation to native one in linux kernel. The initial idea was come from
Hiroshi Doyu.

This version includes corrections which I got from Imre and Felipe.
Additionally the fourth patch changes LST_ELEM name to native list_head in
whole dsp bridge driver.

All patches are rebased against android-bridge-2.6.29 kernel branch of the
kernel-dspbridge repository.

-- 
With Best Regards,
Andy Shevchenko

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


[PATCH 4/4] dspbridge: Change LST_ELEM to list_head entirely

2009-09-04 Thread Andy Shevchenko
From: Andy Shevchenko ext-andriy.shevche...@nokia.com

* Change struct LST_ELEM to struct list_head in whole dsp bridge driver
* Remove useless commentaries
* Minor change in the services/mem.c:
  ...
struct list_head *last = mMan.lst.head;
struct list_head *curr = last-next; /* was: mMan.lst.head.next */
  ...

Signed-off-by: Andy Shevchenko ext-andriy.shevche...@nokia.com
---
 arch/arm/plat-omap/include/dspbridge/_chnl_sm.h |2 +-
 arch/arm/plat-omap/include/dspbridge/list.h |1 -
 arch/arm/plat-omap/include/dspbridge/proc.h |2 +-
 drivers/dsp/bridge/pmgr/cmm.c   |   55 +++
 drivers/dsp/bridge/pmgr/dev.c   |8 ++--
 drivers/dsp/bridge/rmgr/drv.c   |   14 +++---
 drivers/dsp/bridge/rmgr/node.c  |   10 ++--
 drivers/dsp/bridge/rmgr/rmm.c   |   16 +++---
 drivers/dsp/bridge/services/cfg.c   |2 +-
 drivers/dsp/bridge/services/mem.c   |   26 +-
 drivers/dsp/bridge/services/ntfy.c  |   12 +++---
 drivers/dsp/bridge/wmd/_msg_sm.h|4 +-
 drivers/dsp/bridge/wmd/chnl_sm.c|   12 +++---
 drivers/dsp/bridge/wmd/io_sm.c  |   10 ++--
 drivers/dsp/bridge/wmd/msg_sm.c |   21 -
 15 files changed, 96 insertions(+), 99 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/_chnl_sm.h 
b/arch/arm/plat-omap/include/dspbridge/_chnl_sm.h
index 28af799..cc768c9 100644
--- a/arch/arm/plat-omap/include/dspbridge/_chnl_sm.h
+++ b/arch/arm/plat-omap/include/dspbridge/_chnl_sm.h
@@ -197,7 +197,7 @@ struct loadMonStruct {
 
 /* I/O Request/completion packet: */
struct CHNL_IRP {
-   struct LST_ELEM link;   /* Link to next CHIRP in queue. */
+   struct list_head link;  /* Link to next CHIRP in queue.  */
/* Buffer to be filled/emptied. (User)   */
u8 *pHostUserBuf;
/* Buffer to be filled/emptied. (System) */
diff --git a/arch/arm/plat-omap/include/dspbridge/list.h 
b/arch/arm/plat-omap/include/dspbridge/list.h
index 867f5ac..27e7ca9 100644
--- a/arch/arm/plat-omap/include/dspbridge/list.h
+++ b/arch/arm/plat-omap/include/dspbridge/list.h
@@ -53,7 +53,6 @@
 #include linux/slab.h
 #include linux/list.h
 
-#define LST_ELEMlist_head
 #define LST_IsEmpty(l)  list_empty((l)-head)
 
 struct LST_LIST {
diff --git a/arch/arm/plat-omap/include/dspbridge/proc.h 
b/arch/arm/plat-omap/include/dspbridge/proc.h
index d4896d5..eaf36a6 100644
--- a/arch/arm/plat-omap/include/dspbridge/proc.h
+++ b/arch/arm/plat-omap/include/dspbridge/proc.h
@@ -68,7 +68,7 @@
 
 /* The PROC_OBJECT structure.   */
 struct PROC_OBJECT {
-   struct LST_ELEM link;   /* Link to next PROC_OBJECT */
+   struct list_head link;  /* Link to next PROC_OBJECT */
u32 dwSignature;/* Used for object validation */
struct DEV_OBJECT *hDevObject;  /* Device this PROC represents */
u32 hProcess;   /* Process owning this Processor */
diff --git a/drivers/dsp/bridge/pmgr/cmm.c b/drivers/dsp/bridge/pmgr/cmm.c
index 9b19be2..571aa12 100644
--- a/drivers/dsp/bridge/pmgr/cmm.c
+++ b/drivers/dsp/bridge/pmgr/cmm.c
@@ -199,7 +199,7 @@ static struct CMM_XLATORATTRS CMM_DFLTXLATORATTRS = {
 
 /* SM node representing a block of memory. */
 struct CMM_MNODE {
-   struct LST_ELEM link;   /* must be 1st element */
+   struct list_head link;  /* must be 1st element */
u32 dwPA;   /* Phys addr */
u32 dwVA;   /* Virtual address in device process context */
u32 ulSize; /* SM block size in bytes */
@@ -289,7 +289,7 @@ void *CMM_CallocBuf(struct CMM_OBJECT *hCmmMgr, u32 uSize,
 
/* put our node on InUse list */
LST_PutTail(pAllocator-pInUseListHead,
-  (struct LST_ELEM *)pNode);
+  (struct list_head *)pNode);
pBufPA = (void *)pNode-dwPA;   /* physical address */
/* clear mem */
pByte = (u8 *)pNode-dwVA;
@@ -428,8 +428,6 @@ DSP_STATUS CMM_Destroy(struct CMM_OBJECT *hCmmMgr, bool 
bForce)
if (pCmmMgr-pNodeFreeListHead != NULL) {
/* Free the free nodes */
while (!LST_IsEmpty(pCmmMgr-pNodeFreeListHead)) {
-   /* (struct LST_ELEM*) pNode =
-* LST_GetHead(pCmmMgr-pNodeFreeListHead);*/
pNode = (struct CMM_MNODE *)LST_GetHead(pCmmMgr-
 pNodeFreeListHead);
MEM_Free(pNode);
@@ -496,7 +494,7 @@ DSP_STATUS CMM_FreeBuf(struct CMM_OBJECT *hCmmMgr, void 
*pBufPA, u32 ulSegId)
if ((u32)pBufPA == pCurNode-dwPA) {
/* 

Re: [RFC][PATCH] ARM: OMAP: McBSP: Use register cache

2009-09-04 Thread Janusz Krzysztofik
Friday 04 September 2009 07:39:36 Eero Nurkkala wrote:

 Register values should not get corrupted. Could you please point out the
 registers that may get corrupted? Do they get corrupted during audio
 play? I haven't seen corrupted register values.


Hi Eero,

Please have a look at some debug log lines below. Those were generated on my
Amstrad Delta videophone, using an application (asterisk softpbx with alsa
channel) that can restart a receiver of a prevoiusly requested McBSP by
calling omap_mcbsp_start() on user request. As you can see, corrupted values
can happen to get read from any register that is expected to return
predictable results.

Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp:  McBSP1 regs 
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: DRR2:  0x1000
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: DRR1:  0x009d
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: DXR2:  0x3000
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: DXR1:  0x7da1
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: SPCR2: 0x02f0
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: SPCR1: 0x7031
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: RCR2:  0x0045
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: RCR1:  0x0040
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: XCR2:  0x1045
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: XCR1:  0x0040
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: SRGR2: 0x310f
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: SRGR1: 0x
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: PCR0:  0x0003
Sep  4 08:21:17 amsdelta user.debug kernel: [309910.17] omap-mcbsp 
omap-mcbsp.1: mcbsp: ***
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp:  McBSP1 regs 
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: DRR2:  0x
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: DRR1:  0x1086
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: DXR2:  0x
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: DXR1:  0x7da1
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: SPCR2: 0x02f0
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: SPCR1: 0x0031
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: RCR2:  0x1045
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: RCR1:  0x1040
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: XCR2:  0x3045
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: XCR1:  0x1040
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: SRGR2: 0x000f
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: SRGR1: 0x
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: PCR0:  0x1003
Sep  4 08:21:19 amsdelta user.debug kernel: [309912.05] omap-mcbsp 
omap-mcbsp.1: mcbsp: ***
Sep  4 08:21:21 amsdelta user.debug kernel: [309913.95] omap-mcbsp 
omap-mcbsp.1: mcbsp:  McBSP1 regs 
Sep  4 08:21:21 amsdelta user.debug kernel: [309913.95] omap-mcbsp 
omap-mcbsp.1: mcbsp: DRR2:  0x1000
Sep  4 08:21:21 amsdelta user.debug kernel: [309913.95] omap-mcbsp 
omap-mcbsp.1: mcbsp: DRR1:  0x109e
Sep  4 08:21:21 amsdelta user.debug kernel: [309913.95] omap-mcbsp 
omap-mcbsp.1: mcbsp: DXR2:  0x1000
Sep  4 08:21:21 amsdelta user.debug kernel: [309913.95] omap-mcbsp 
omap-mcbsp.1: mcbsp: DXR1:  0x7da1
Sep  4 08:21:21 amsdelta user.debug kernel: [309913.95] omap-mcbsp 
omap-mcbsp.1: mcbsp: SPCR2: 0x02f0
Sep  4 08:21:21 amsdelta user.debug kernel: [309913.95] omap-mcbsp 
omap-mcbsp.1: mcbsp: SPCR1: 0x1031
Sep  4 08:21:21 amsdelta user.debug kernel: [309913.95] omap-mcbsp 
omap-mcbsp.1: mcbsp: RCR2:  0x1045
Sep  4 08:21:21 amsdelta user.debug kernel: [309913.95] omap-mcbsp 
omap-mcbsp.1: mcbsp: RCR1:  0x1040
Sep  4 08:21:21 amsdelta user.debug kernel: [309913.95] omap-mcbsp 
omap-mcbsp.1: mcbsp: XCR2:  0x2045
Sep  4 08:21:21 

[PATCH] OMAP3: Enable and autoidle DPLL5 at boot

2009-09-04 Thread Anand Gadiyar
From: Rajendra Nayak rna...@ti.com

OMAP3: Enable and autoidle DPLL5 at boot

Enable DPLL5 at bootup and put it into auto-idle.
This is required for the USBHOST 120MHz f-clock and USBTLL f-clock
to work.

Signed-off-by: Rajendra Nayak rna...@ti.com
Signed-off-by: Anand Gadiyar gadi...@ti.com
---
 arch/arm/mach-omap2/clock34xx.c |   25 +
 1 files changed, 25 insertions(+)

Index: linux-omap-2.6/arch/arm/mach-omap2/clock34xx.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/clock34xx.c
+++ linux-omap-2.6/arch/arm/mach-omap2/clock34xx.c
@@ -1056,6 +1056,25 @@ void omap2_clk_prepare_for_reboot(void)
 #endif
 }
 
+static void omap3_lock_dpll5(void)
+{
+   struct clk *dpll5_clk;
+   struct clk *dpll5_m2_clk;
+
+   dpll5_clk = clk_get(NULL, dpll5_ck);
+   clk_set_rate(dpll5_clk, 12000);
+   clk_enable(dpll5_clk);
+
+   /* Enable autoidle to allow it to enter low power bypass */
+   omap3_dpll_allow_idle(dpll5_clk);
+
+   /* Program dpll5_m2_clk divider for no division */
+   dpll5_m2_clk = clk_get(NULL, dpll5_m2_ck);
+   clk_enable(dpll5_m2_clk);
+   clk_set_rate(dpll5_m2_clk, 12000);
+   return;
+}
+
 /* REVISIT: Move this init stuff out into clock.c */
 
 /*
@@ -1148,6 +1167,12 @@ int __init omap2_clk_init(void)
 */
clk_enable_init_clocks();
 
+   /*
+* Lock DPLL5 and put it in autoidle.
+*/
+   if (omap_rev() = OMAP3430_REV_ES2_0)
+   omap3_lock_dpll5();
+
/* Avoid sleeping during omap2_clk_prepare_for_reboot() */
/* REVISIT: not yet ready for 343x */
 #if 0
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] dspbridge: use linux memory allocator directly

2009-09-04 Thread Artem Bityutskiy

Nice cleanups of the cra^H^Hode now one cared about!

:-)

On 09/04/2009 12:19 PM, Andy Shevchenko wrote:

  #define LST_ELEMlist_head
@@ -85,9 +85,9 @@ struct LST_LIST {
  static inline struct LST_LIST *LST_Create(void)
  {
struct LST_LIST *pList;
+   gfp_t flags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL;

-   pList = (struct LST_LIST *) MEM_Calloc(sizeof(struct LST_LIST),
-   MEM_NONPAGED);
+   pList = kzalloc(sizeof(*pList), flags);
if (pList != NULL)
INIT_LIST_HEAD(pList-head);


Would be nice to kill this whole function as well.
 


@@ -116,8 +116,7 @@ static inline struct LST_LIST *LST_Create(void)
   */
  static inline void LST_Delete(struct LST_LIST *pList)
  {
-   if (pList != NULL)
-   MEM_Free(pList);
+   kfree(pList);
  }


I guess whole 'LST_Delete()' could go away as well?

--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC][PATCH] ARM: OMAP: McBSP: Use register cache

2009-09-04 Thread Eero Nurkkala
On Fri, 2009-09-04 at 12:34 +0200, ext Janusz Krzysztofik wrote:
 in normal (handset) mode, the noise level seems still acceptable. The only
 missing piece of a puzzle is my patch, that prevents the kernel driver from
 putting corrupted values into the McBSP control registers.
 
 That learned, please reconsider:
 1. Can my patch break anything, related or not?

That needs to be investigated in more detail.

 2. How does it affect performance of otherwise unaffected machines?

Like you already know, shouldn't.

 3. Is correcting a poorly designed machine behaviour worth of the change?
 
 Thanks,
 Janusz


I'd say this is in the right track. All McBSP registers
(not status etc) will need to be stored in memory. (Now, they're not).
And all those register contents will need to be written back
in certain situations. So this is the case when there is an external
audio chip, that takes audio in in bursts. So once the
burst is complete, all McBSP clocks will be disabled for a duration.

Then (at least = 3430) device will hit OFF mode, meaning
all register contents are lost, also McBSP's. They will
need to be written back at some point.

My quick verdict is, that your patch is, going into right
direction. But the thing is that my words don't count much ;)

(Possibly worth taking the patch in, if guaranteed to not break
 any others).

- Eero

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


Re: [PATCH 3/4] dspbridge: use linux memory allocator directly

2009-09-04 Thread Andy Shevchenko
On Fri, Sep 4, 2009 at 2:02 PM, Artem Bityutskiydedeki...@gmail.com wrote:

  static inline struct LST_LIST *LST_Create(void)
 Would be nice to kill this whole function as well.

 I guess whole 'LST_Delete()' could go away as well?

Good point, I thought to get rid of a bit later.
Anyway, I will look into. But probably this mean to revert back to
MEM_* calls when we would like to create or destroy list head...

-- 
With Best Regards,
Andy Shevchenko
--
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/10] omap mailbox: Adding OMAP4 support

2009-09-04 Thread C.A, Subramaniam
Hi All,
This is the series of patches adding OMAP4 support for omap mailbox driver. The 
patches are generated against tag (2.6.31-rc5). Functionality has been tested 
in OMAP4430. These patches also include various cleanup done in the omap 
mailbox.

File modified:

arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/devices.c
arch/arm/plat-omap/include/mach/omap44xx.h
arch/arm/plat-omap/mailbox.c
arch/arm/plat-omap/include/mach/mailbox.h
arch/arm/mach-omap2/mailbox.c


Regards
Subramaniam C A,
Ramesh Gupta . G
Kanigeri Hari--
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/10] omap mailbox: OMAP4-Mailbox - Add build specific changes to support OMAP4 mailbox.

2009-09-04 Thread C.A, Subramaniam
From aa759db084be9a2893de5e61b11f6de6d05508d9 Mon Sep 17 00:00:00 2001
From: C A Subramaniam subramaniam...@ti.com
Date: Wed, 2 Sep 2009 17:52:22 +0530
Subject: [PATCH 1/10] omap mailbox: OMAP4-Mailbox - Add build specific changes 
to support OMAP4 mailbox.

This patch adds changes to the build related files of mailbox
driver to support OMAP4 mailbox

Signed-off-by: C A Subramaniam subramaniam...@ti.com
Signed-off-by: Ramesh Gupta G grgu...@ti.com
---
 arch/arm/mach-omap2/Makefile |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 735bae5..4bb426d 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -39,6 +39,10 @@ endif
 obj-$(CONFIG_ARCH_OMAP2)   += clock24xx.o
 obj-$(CONFIG_ARCH_OMAP3)   += clock34xx.o
 
+# MAILBOX
+obj-$(CONFIG_OMAP_MBOX_FWK)+= mailbox_mach.o
+mailbox_mach-objs  := mailbox.o
+
 iommu-y+= iommu2.o
 iommu-$(CONFIG_ARCH_OMAP3) += omap3-iommu.o
 
-- 
1.5.3.2
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/10] omap mailbox: OMAP4 - Add resources and mailbox register base address for OMAP4 mailbox

2009-09-04 Thread C.A, Subramaniam
From 80e74ada510bace7208d59c0f912f9b1077efb45 Mon Sep 17 00:00:00 2001
From: C A Subramaniam subramaniam...@ti.com
Date: Wed, 2 Sep 2009 17:58:57 +0530
Subject: [PATCH 2/10] omap mailbox: OMAP4 - Add resources and mailbox register 
base address
 for OMAP4 mailbox

This patch adds resource information of mailbox driver for
OMAP4 mailbox module. Register base address also added

Signed-off-by: C A Subramaniam subramaniam...@ti.com
Signed-off-by: Ramesh Gupta G grgu...@ti.com
---
 arch/arm/mach-omap2/devices.c  |   20 +++-
 arch/arm/plat-omap/include/mach/omap44xx.h |2 ++
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 894cc35..711ed6a 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -136,8 +136,11 @@ static inline void omap_init_camera(void)
 
 #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
 
+#ifdef CONFIG_ARCH_OMAP4
+#define MBOX_REG_SIZE   0x130
+#else
 #define MBOX_REG_SIZE  0x120
-
+#endif
 static struct resource omap2_mbox_resources[] = {
{
.start  = OMAP24XX_MAILBOX_BASE,
@@ -166,6 +169,18 @@ static struct resource omap3_mbox_resources[] = {
},
 };
 
+static struct resource omap4_mbox_resources[] = {
+   {
+   .start  = OMAP44xx_MAILBOX_BASE,
+   .end= OMAP44xx_MAILBOX_BASE + MBOX_REG_SIZE  - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = INT_44XX_MAIL_U0_MPU,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
 static struct platform_device mbox_device = {
.name   = omap2-mailbox,
.id = -1,
@@ -179,6 +194,9 @@ static inline void omap_init_mbox(void)
} else if (cpu_is_omap3430()) {
mbox_device.num_resources = ARRAY_SIZE(omap3_mbox_resources);
mbox_device.resource = omap3_mbox_resources;
+   } else if (cpu_is_omap44xx()) {
+   mbox_device.num_resources = ARRAY_SIZE(omap4_mbox_resources);
+   mbox_device.resource = omap4_mbox_resources;
} else {
pr_err(%s: platform not supported\n, __func__);
return;
diff --git a/arch/arm/plat-omap/include/mach/omap44xx.h 
b/arch/arm/plat-omap/include/mach/omap44xx.h
index 52f2f85..6a545d3 100644
--- a/arch/arm/plat-omap/include/mach/omap44xx.h
+++ b/arch/arm/plat-omap/include/mach/omap44xx.h
@@ -44,5 +44,7 @@
 #define OMAP44XX_WKUPGEN_BASE  0x48281000
 #define OMAP44XX_VA_WKUPGEN_BASE   IO_ADDRESS(OMAP44XX_WKUPGEN_BASE)
 
+#define OMAP44xx_MAILBOX_BASE  (L4_44XX_BASE + 0xF4000)
+
 #endif /* __ASM_ARCH_OMAP44XX_H */
 
-- 
1.5.3.2
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/10] omap mailbox: remove sequence bit checking

2009-09-04 Thread C.A, Subramaniam
From d7a03f1d174036edbad312dff1f1789736098bf0 Mon Sep 17 00:00:00 2001
From: Hiroshi DOYU hiroshi.d...@nokia.com
Date: Wed, 2 Sep 2009 19:32:42 +0530
Subject: [PATCH 3/10] omap mailbox: remove sequence bit checking

Any protocol should be handled in the upper layer and mailbox driver
shouldn't care about the contents of messages.

Signed-off-by: Hiroshi DOYU hiroshi.d...@nokia.com
---
 arch/arm/plat-omap/mailbox.c |   70 ++---
 1 files changed, 4 insertions(+), 66 deletions(-)

diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 40424ed..e2bcc9d 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -28,54 +28,9 @@
 
 #include mach/mailbox.h
 
-static int enable_seq_bit;
-module_param(enable_seq_bit, bool, 0);
-MODULE_PARM_DESC(enable_seq_bit, Enable sequence bit checking.);
-
 static struct omap_mbox *mboxes;
 static DEFINE_RWLOCK(mboxes_lock);
 
-/*
- * Mailbox sequence bit API
- */
-
-/* seq_rcv should be initialized with any value other than
- * 0 and 1  31, to allow either value for the first
- * message.  */
-static inline void mbox_seq_init(struct omap_mbox *mbox)
-{
-   if (!enable_seq_bit)
-   return;
-
-   /* any value other than 0 and 1  31 */
-   mbox-seq_rcv = 0x;
-}
-
-static inline void mbox_seq_toggle(struct omap_mbox *mbox, mbox_msg_t * msg)
-{
-   if (!enable_seq_bit)
-   return;
-
-   /* add seq_snd to msg */
-   *msg = (*msg  0x7fff) | mbox-seq_snd;
-   /* flip seq_snd */
-   mbox-seq_snd ^= 1  31;
-}
-
-static inline int mbox_seq_test(struct omap_mbox *mbox, mbox_msg_t msg)
-{
-   mbox_msg_t seq;
-
-   if (!enable_seq_bit)
-   return 0;
-
-   seq = msg  (1  31);
-   if (seq == mbox-seq_rcv)
-   return -1;
-   mbox-seq_rcv = seq;
-   return 0;
-}
-
 /* Mailbox FIFO handle functions */
 static inline mbox_msg_t mbox_fifo_read(struct omap_mbox *mbox)
 {
@@ -113,13 +68,6 @@ static inline int is_mbox_irq(struct omap_mbox *mbox, 
omap_mbox_irq_t irq)
return mbox-ops-is_irq(mbox, irq);
 }
 
-/* Mailbox Sequence Bit function */
-void omap_mbox_init_seq(struct omap_mbox *mbox)
-{
-   mbox_seq_init(mbox);
-}
-EXPORT_SYMBOL(omap_mbox_init_seq);
-
 /*
  * message sender
  */
@@ -141,7 +89,6 @@ static int __mbox_msg_send(struct omap_mbox *mbox, 
mbox_msg_t msg, void *arg)
goto out;
}
 
-   mbox_seq_toggle(mbox, msg);
mbox_fifo_write(mbox, msg);
  out:
return ret;
@@ -254,11 +201,11 @@ static void mbox_rx_work(struct work_struct *work)
 /*
  * Mailbox interrupt handler
  */
-static void mbox_txq_fn(struct request_queue * q)
+static void mbox_txq_fn(struct request_queue *q)
 {
 }
 
-static void mbox_rxq_fn(struct request_queue * q)
+static void mbox_rxq_fn(struct request_queue *q)
 {
 }
 
@@ -284,11 +231,6 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
 
msg = mbox_fifo_read(mbox);
 
-   if (unlikely(mbox_seq_test(mbox, msg))) {
-   pr_info(mbox: Illegal seq bit!(%08x)\n, msg);
-   if (mbox-err_notify)
-   mbox-err_notify();
-   }
 
blk_insert_request(q, rq, 0, (void *)msg);
if (mbox-ops-type == OMAP_MBOX_TYPE1)
@@ -320,7 +262,7 @@ static irqreturn_t mbox_interrupt(int irq, void *p)
  */
 static ssize_t
 omap_mbox_write(struct device *dev, struct device_attribute *attr,
-   const char * buf, size_t count)
+   const char *buf, size_t count)
 {
int ret;
mbox_msg_t *p = (mbox_msg_t *)buf;
@@ -357,10 +299,6 @@ omap_mbox_read(struct device *dev, struct device_attribute 
*attr, char *buf)
 
blk_end_request_all(rq, 0);
 
-   if (unlikely(mbox_seq_test(mbox, *p))) {
-   pr_info(mbox: Illegal seq bit!(%08x) ignored\n, *p);
-   continue;
-   }
p++;
}
 
@@ -383,7 +321,7 @@ static struct class omap_mbox_class = {
 };
 
 static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox,
-   request_fn_proc * proc,
+   request_fn_proc *proc,
void (*work) (struct work_struct *))
 {
struct request_queue *q;
-- 
1.5.3.2
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/10] omap mailbox: remove class interface

2009-09-04 Thread C.A, Subramaniam
From ddba6182ca716f9f5f5072088475a613f3141eb8 Mon Sep 17 00:00:00 2001
From: Hiroshi DOYU hiroshi.d...@nokia.com
Date: Wed, 2 Sep 2009 20:03:19 +0530
Subject: [PATCH 4/10] omap mailbox: remove class interface

It's not used at present.

Signed-off-by: Hiroshi DOYU hiroshi.d...@nokia.com
---
 arch/arm/plat-omap/include/mach/mailbox.h |1 -
 arch/arm/plat-omap/mailbox.c  |  115 ++--
 2 files changed, 9 insertions(+), 107 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/mailbox.h 
b/arch/arm/plat-omap/include/mach/mailbox.h
index b7a6991..319306a 100644
--- a/arch/arm/plat-omap/include/mach/mailbox.h
+++ b/arch/arm/plat-omap/include/mach/mailbox.h
@@ -8,7 +8,6 @@
 #include linux/blkdev.h
 
 typedef u32 mbox_msg_t;
-typedef void (mbox_receiver_t)(mbox_msg_t msg);
 struct omap_mbox;
 
 typedef int __bitwise omap_mbox_irq_t;
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index e2bcc9d..6e713a7 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -71,7 +71,7 @@ static inline int is_mbox_irq(struct omap_mbox *mbox, 
omap_mbox_irq_t irq)
 /*
  * message sender
  */
-static int __mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg, void *arg)
+static int __mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
 {
int ret = 0, i = 1000;
 
@@ -82,15 +82,7 @@ static int __mbox_msg_send(struct omap_mbox *mbox, 
mbox_msg_t msg, void *arg)
return -1;
udelay(1);
}
-
-   if (arg  mbox-txq-callback) {
-   ret = mbox-txq-callback(arg);
-   if (ret)
-   goto out;
-   }
-
mbox_fifo_write(mbox, msg);
- out:
return ret;
 }
 
@@ -152,7 +144,7 @@ static void mbox_tx_work(struct work_struct *work)
 
tx_data = rq-special;
 
-   ret = __mbox_msg_send(mbox, tx_data-msg, tx_data-arg);
+   ret = __mbox_msg_send(mbox, tx_data-msg);
if (ret) {
enable_mbox_irq(mbox, IRQ_TX);
spin_lock(q-queue_lock);
@@ -180,11 +172,6 @@ static void mbox_rx_work(struct work_struct *work)
mbox_msg_t msg;
unsigned long flags;
 
-   if (mbox-rxq-callback == NULL) {
-   sysfs_notify(mbox-dev-kobj, NULL, mbox);
-   return;
-   }
-
while (1) {
spin_lock_irqsave(q-queue_lock, flags);
rq = blk_fetch_request(q);
@@ -257,69 +244,6 @@ static irqreturn_t mbox_interrupt(int irq, void *p)
return IRQ_HANDLED;
 }
 
-/*
- * sysfs files
- */
-static ssize_t
-omap_mbox_write(struct device *dev, struct device_attribute *attr,
-   const char *buf, size_t count)
-{
-   int ret;
-   mbox_msg_t *p = (mbox_msg_t *)buf;
-   struct omap_mbox *mbox = dev_get_drvdata(dev);
-
-   for (; count = sizeof(mbox_msg_t); count -= sizeof(mbox_msg_t)) {
-   ret = omap_mbox_msg_send(mbox, be32_to_cpu(*p), NULL);
-   if (ret)
-   return -EAGAIN;
-   p++;
-   }
-
-   return (size_t)((char *)p - buf);
-}
-
-static ssize_t
-omap_mbox_read(struct device *dev, struct device_attribute *attr, char *buf)
-{
-   unsigned long flags;
-   struct request *rq;
-   mbox_msg_t *p = (mbox_msg_t *) buf;
-   struct omap_mbox *mbox = dev_get_drvdata(dev);
-   struct request_queue *q = mbox-rxq-queue;
-
-   while (1) {
-   spin_lock_irqsave(q-queue_lock, flags);
-   rq = blk_fetch_request(q);
-   spin_unlock_irqrestore(q-queue_lock, flags);
-
-   if (!rq)
-   break;
-
-   *p = (mbox_msg_t)rq-special;
-
-   blk_end_request_all(rq, 0);
-
-   p++;
-   }
-
-   pr_debug(%02x %02x %02x %02x\n, buf[0], buf[1], buf[2], buf[3]);
-
-   return (size_t) ((char *)p - buf);
-}
-
-static DEVICE_ATTR(mbox, S_IRUGO | S_IWUSR, omap_mbox_read, omap_mbox_write);
-
-static ssize_t mbox_show(struct class *class, char *buf)
-{
-   return sprintf(buf, mbox);
-}
-
-static CLASS_ATTR(mbox, S_IRUGO, mbox_show, NULL);
-
-static struct class omap_mbox_class = {
-   .name = omap-mailbox,
-};
-
 static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox,
request_fn_proc *proc,
void (*work) (struct work_struct *))
@@ -353,7 +277,7 @@ static void mbox_queue_free(struct omap_mbox_queue *q)
kfree(q);
 }
 
-static int omap_mbox_init(struct omap_mbox *mbox)
+static int omap_mbox_startup(struct omap_mbox *mbox)
 {
int ret;
struct omap_mbox_queue *mq;
@@ -436,7 +360,7 @@ struct omap_mbox *omap_mbox_get(const char *name)
 
read_unlock(mboxes_lock);
 
-   ret = omap_mbox_init(mbox);
+   ret = omap_mbox_startup(mbox);
if (ret)
return ERR_PTR(-ENODEV);
 

[PATCH 5/10] omap mailbox: remove disalbe_/enable_mbox_irq in isr

2009-09-04 Thread C.A, Subramaniam
From 20a90cfa9b06b70c495f1699825dd9fded381949 Mon Sep 17 00:00:00 2001
From: Hiroshi DOYU hiroshi.d...@nokia.com
Date: Wed, 2 Sep 2009 20:06:38 +0530
Subject: [PATCH 5/10] omap mailbox: remove disalbe_/enable_mbox_irq in isr

No need to handle it in isr, since irq won't happen during isr.

Signed-off-by: Hiroshi DOYU hiroshi.d...@nokia.com
---
 arch/arm/plat-omap/mailbox.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 6e713a7..8a6d087 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -209,8 +209,6 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
mbox_msg_t msg;
struct request_queue *q = mbox-rxq-queue;
 
-   disable_mbox_irq(mbox, IRQ_RX);
-
while (!mbox_fifo_empty(mbox)) {
rq = blk_get_request(q, WRITE, GFP_ATOMIC);
if (unlikely(!rq))
@@ -226,7 +224,6 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
 
/* no more messages in the fifo. clear IRQ source. */
ack_mbox_irq(mbox, IRQ_RX);
-   enable_mbox_irq(mbox, IRQ_RX);
 nomem:
schedule_work(mbox-rxq-work);
 }
-- 
1.5.3.2
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/10] omap mailbox: remove unnecessary arg for omap_mbox_msg_send

2009-09-04 Thread C.A, Subramaniam
From 4e4fbfa64b2b77ec6f1140178770a70ff6f8caed Mon Sep 17 00:00:00 2001
From: Hiroshi DOYU hiroshi.d...@nokia.com
Date: Wed, 2 Sep 2009 20:14:24 +0530
Subject: [PATCH 6/10] omap mailbox: remove unnecessary arg for 
omap_mbox_msg_send

Signed-off-by: Hiroshi DOYU hiroshi.d...@nokia.com
---
 arch/arm/plat-omap/include/mach/mailbox.h |2 +-
 arch/arm/plat-omap/mailbox.c  |3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/mailbox.h 
b/arch/arm/plat-omap/include/mach/mailbox.h
index 319306a..8260a3f 100644
--- a/arch/arm/plat-omap/include/mach/mailbox.h
+++ b/arch/arm/plat-omap/include/mach/mailbox.h
@@ -63,7 +63,7 @@ struct omap_mbox {
void(*err_notify)(void);
 };
 
-int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg, void *);
+int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg);
 void omap_mbox_init_seq(struct omap_mbox *);
 
 struct omap_mbox *omap_mbox_get(const char *);
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 8a6d087..b7c0d5f 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -97,7 +97,7 @@ static void omap_msg_tx_end_io(struct request *rq, int error)
__blk_put_request(rq-q, rq);
 }
 
-int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg, void* arg)
+int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
 {
struct omap_msg_tx_data *tx_data;
struct request *rq;
@@ -114,7 +114,6 @@ int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t 
msg, void* arg)
}
 
tx_data-msg = msg;
-   tx_data-arg = arg;
rq-end_io = omap_msg_tx_end_io;
blk_insert_request(q, rq, 0, tx_data);
 
-- 
1.5.3.2
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/10] omap mailbox: expose omap_mbox_enable()/disable_irq()

2009-09-04 Thread C.A, Subramaniam
From 76e10e3b49c987894164375b2f5171418b9778e5 Mon Sep 17 00:00:00 2001
From: Hiroshi DOYU hiroshi.d...@nokia.com
Date: Wed, 2 Sep 2009 20:18:53 +0530
Subject: [PATCH 7/10] omap mailbox: expose omap_mbox_enable()/disable_irq()

Signed-off-by: Hiroshi DOYU hiroshi.d...@nokia.com
---
 arch/arm/plat-omap/include/mach/mailbox.h |   12 
 arch/arm/plat-omap/mailbox.c  |   12 ++--
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/mailbox.h 
b/arch/arm/plat-omap/include/mach/mailbox.h
index 8260a3f..bf06953 100644
--- a/arch/arm/plat-omap/include/mach/mailbox.h
+++ b/arch/arm/plat-omap/include/mach/mailbox.h
@@ -92,4 +92,16 @@ static inline void omap_mbox_restore_ctx(struct omap_mbox 
*mbox)
mbox-ops-restore_ctx(mbox);
 }
 
+static inline void omap_mbox_enable_irq(struct omap_mbox *mbox,
+   omap_mbox_irq_t irq)
+{
+   mbox-ops-enable_irq(mbox, irq);
+}
+
+static inline void omap_mbox_disable_irq(struct omap_mbox *mbox,
+omap_mbox_irq_t irq)
+{
+   mbox-ops-disable_irq(mbox, irq);
+}
+
 #endif /* MAILBOX_H */
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index b7c0d5f..f6d6b67 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -50,14 +50,6 @@ static inline int mbox_fifo_full(struct omap_mbox *mbox)
 }
 
 /* Mailbox IRQ handle functions */
-static inline void enable_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
-{
-   mbox-ops-enable_irq(mbox, irq);
-}
-static inline void disable_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t 
irq)
-{
-   mbox-ops-disable_irq(mbox, irq);
-}
 static inline void ack_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
 {
if (mbox-ops-ack_irq)
@@ -145,7 +137,7 @@ static void mbox_tx_work(struct work_struct *work)
 
ret = __mbox_msg_send(mbox, tx_data-msg);
if (ret) {
-   enable_mbox_irq(mbox, IRQ_TX);
+   omap_mbox_enable_irq(mbox, IRQ_TX);
spin_lock(q-queue_lock);
blk_requeue_request(q, rq);
spin_unlock(q-queue_lock);
@@ -197,7 +189,7 @@ static void mbox_rxq_fn(struct request_queue *q)
 
 static void __mbox_tx_interrupt(struct omap_mbox *mbox)
 {
-   disable_mbox_irq(mbox, IRQ_TX);
+   omap_mbox_disable_irq(mbox, IRQ_TX);
ack_mbox_irq(mbox, IRQ_TX);
schedule_work(mbox-txq-work);
 }
-- 
1.5.3.2
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/10] omap mailbox: OMAP4-Mailbox - Adds code changes to support OMAP4 mailbox.

2009-09-04 Thread C.A, Subramaniam
From eeaa22aff9df8027f91884ee78328028bd5a6782 Mon Sep 17 00:00:00 2001
From: C A Subramaniam subramaniam...@ti.com
Date: Thu, 3 Sep 2009 17:53:27 +0530
Subject: [PATCH 8/10] omap mailbox: OMAP4-Mailbox - Adds code changes to 
support OMAP4 mailbox.

This patch adds code changes in the mailbox driver module to
add support for OMAP4 mailbox.

Signed-off-by: Hari Kanigeri h-kanige...@ti.com
Signed-off-by: C A Subramaniam subramaniam...@ti.com
Signed-off-by: Ramesh Gupta G grgu...@ti.com
---
 arch/arm/mach-omap2/mailbox.c |  156 +
 1 files changed, 125 insertions(+), 31 deletions(-)

diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 6f71f37..4ab3e1d 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -18,21 +18,36 @@
 #include mach/mailbox.h
 #include mach/irqs.h
 
+#define DRV_NAME omap2-mailbox
+
 #define MAILBOX_REVISION   0x000
 #define MAILBOX_SYSCONFIG  0x010
 #define MAILBOX_SYSSTATUS  0x014
 #define MAILBOX_MESSAGE(m) (0x040 + 4 * (m))
 #define MAILBOX_FIFOSTATUS(m)  (0x080 + 4 * (m))
 #define MAILBOX_MSGSTATUS(m)   (0x0c0 + 4 * (m))
+
+#ifdef CONFIG_ARCH_OMAP4
+#define MAILBOX_IRQSTATUS(u)   (0x104 + 10 * (u))
+#define MAILBOX_IRQENABLE(u)   (0x108 + 10 * (u))
+#define MAILBOX_IRQENABLE_CLR(u)   (0x10c + 10 * (u))
+#else
 #define MAILBOX_IRQSTATUS(u)   (0x100 + 8 * (u))
 #define MAILBOX_IRQENABLE(u)   (0x104 + 8 * (u))
+#endif
 
-#define MAILBOX_IRQ_NEWMSG(u)  (1  (2 * (u)))
-#define MAILBOX_IRQ_NOTFULL(u) (1  (2 * (u) + 1))
+#define MAILBOX_IRQ_NEWMSG(m)  (1  (2 * (m)))
+#define MAILBOX_IRQ_NOTFULL(m) (1  (2 * (m) + 1))
 
+#ifdef CONFIG_ARCH_OMAP4
+#define MBOX_REG_SIZE  0x130
+#else
 #define MBOX_REG_SIZE  0x120
+#endif
+
 #define MBOX_NR_REGS   (MBOX_REG_SIZE / sizeof(u32))
 
+
 static void __iomem *mbox_base;
 
 struct omap_mbox2_fifo {
@@ -49,9 +64,13 @@ struct omap_mbox2_priv {
u32 newmsg_bit;
u32 notfull_bit;
u32 ctx[MBOX_NR_REGS];
+#ifdef CONFIG_ARCH_OMAP4
+   unsigned long irqdisable;
+#endif
 };
 
 static struct clk *mbox_ick_handle;
+static int mbox_configured;
 
 static void omap2_mbox_enable_irq(struct omap_mbox *mbox,
  omap_mbox_type_t irq);
@@ -70,31 +89,37 @@ static inline void mbox_write_reg(u32 val, size_t ofs)
 static int omap2_mbox_startup(struct omap_mbox *mbox)
 {
unsigned int l;
+   if (!mbox_configured) {
+   mbox_ick_handle = clk_get(NULL, mailboxes_ick);
+   if (IS_ERR(mbox_ick_handle)) {
+   printk(KERN_ERR Could not get mailboxes_ick\n);
+   return -ENODEV;
+   }
+   clk_enable(mbox_ick_handle);
 
-   mbox_ick_handle = clk_get(NULL, mailboxes_ick);
-   if (IS_ERR(mbox_ick_handle)) {
-   printk(Could not get mailboxes_ick\n);
-   return -ENODEV;
-   }
-   clk_enable(mbox_ick_handle);
-
-   l = mbox_read_reg(MAILBOX_REVISION);
-   pr_info(omap mailbox rev %d.%d\n, (l  0xf0)  4, (l  0x0f));
-
-   /* set smart-idle  autoidle */
-   l = mbox_read_reg(MAILBOX_SYSCONFIG);
-   l |= 0x0011;
-   mbox_write_reg(l, MAILBOX_SYSCONFIG);
+   l = mbox_read_reg(MAILBOX_REVISION);
+   pr_info(omap mailbox rev %d.%d\n, (l  0xf0)  4,
+   (l  0x0f));
 
+   /* set smart-idle  autoidle */
+   l = mbox_read_reg(MAILBOX_SYSCONFIG);
+   l |= 0x0011;
+   mbox_write_reg(l, MAILBOX_SYSCONFIG);
+   }
+   mbox_configured++;
omap2_mbox_enable_irq(mbox, IRQ_RX);
 
return 0;
 }
 
 static void omap2_mbox_shutdown(struct omap_mbox *mbox)
-{
-   clk_disable(mbox_ick_handle);
-   clk_put(mbox_ick_handle);
+{  if (mbox_configured  0)
+   mbox_configured--;
+   if (!mbox_configured) {
+   clk_disable(mbox_ick_handle);
+   clk_put(mbox_ick_handle);
+   mbox_ick_handle = NULL;
+   }
 }
 
 /* Mailbox FIFO handle functions */
@@ -123,7 +148,7 @@ static int omap2_mbox_fifo_full(struct omap_mbox *mbox)
 {
struct omap_mbox2_fifo *fifo =
((struct omap_mbox2_priv *)mbox-priv)-tx_fifo;
-   return (mbox_read_reg(fifo-fifo_stat));
+   return mbox_read_reg(fifo-fifo_stat);
 }
 
 /* Mailbox IRQ handle functions */
@@ -143,10 +168,9 @@ static void omap2_mbox_disable_irq(struct omap_mbox *mbox,
 {
struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox-priv;
u32 l, bit = (irq == IRQ_TX) ? p-notfull_bit : p-newmsg_bit;
-
-   l = mbox_read_reg(p-irqenable);
+   l = mbox_read_reg(p-irqdisable);
l = ~bit;
- 

[PATCH 10/10] omap mailbox: OMAP4 Mailbox-driver Patch to support tasklet implementation

2009-09-04 Thread C.A, Subramaniam
From e759173e77f73fabce5177b4f685df20b16c6922 Mon Sep 17 00:00:00 2001
From: C A Subramaniam subramaniam...@ti.com
Date: Thu, 3 Sep 2009 17:42:35 +0530
Subject: [PATCH 10/10] omap mailbox: OMAP4 Mailbox-driver Patch to support 
tasklet
   implementation

This patch uses a tasklet implementation for
sending mailbox messages.

Signed-off-by: C A Subramaniam subramaniam...@ti.com
Signed-off-by: Ramesh Gupta G grgu...@ti.com
---
 arch/arm/mach-omap2/mailbox.c |   43 ++-
 arch/arm/plat-omap/include/mach/mailbox.h |   16 +-
 arch/arm/plat-omap/mailbox.c  |   80 ++---
 3 files changed, 81 insertions(+), 58 deletions(-)

diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 52a1670..45aea98 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -236,6 +237,17 @@ static struct omap_mbox_ops omap2_mbox_ops = {
.restore_ctx= omap2_mbox_restore_ctx,
 };
 
+
+static struct omap_mbox_task omap_mbox_1_tasklet = {
+   .arg= NULL,
+};
+
+static struct omap_mbox_task omap_mbox_2_tasklet = {
+   .arg= NULL,
+};
+
+
+
 /*
  * MAILBOX 0: ARM - DSP,
  * MAILBOX 1: ARM - DSP.
@@ -272,6 +284,7 @@ struct omap_mbox mbox_1_info = {
.name   = mailbox-1,
.ops= omap2_mbox_ops,
.priv   = omap2_mbox_1_priv,
+   .tx_tasklet = omap_mbox_1_tasklet,
 };
 EXPORT_SYMBOL(mbox_1_info);
 #else
@@ -305,8 +318,10 @@ struct omap_mbox mbox_2_info = {
.name   = mailbox-2,
.ops= omap2_mbox_ops,
.priv   = omap2_mbox_2_priv,
+   .tx_tasklet = omap_mbox_2_tasklet,
 };
 EXPORT_SYMBOL(mbox_2_info);
+
 #endif
 
 
diff --git a/arch/arm/plat-omap/include/mach/mailbox.h 
b/arch/arm/plat-omap/include/mach/mailbox.h
index bf06953..5271345 100644
--- a/arch/arm/plat-omap/include/mach/mailbox.h
+++ b/arch/arm/plat-omap/include/mach/mailbox.h
@@ -28,8 +28,10 @@ struct omap_mbox_ops {
int (*fifo_empty)(struct omap_mbox *mbox);
int (*fifo_full)(struct omap_mbox *mbox);
/* irq */
-   void(*enable_irq)(struct omap_mbox *mbox, omap_mbox_irq_t 
irq);
-   void(*disable_irq)(struct omap_mbox *mbox, omap_mbox_irq_t 
irq);
+   void(*enable_irq)(struct omap_mbox *mbox,
+   omap_mbox_irq_t irq);
+   void(*disable_irq)(struct omap_mbox *mbox,
+   omap_mbox_irq_t irq);
void(*ack_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq);
int (*is_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq);
/* ctx */
@@ -45,12 +47,22 @@ struct omap_mbox_queue {
struct omap_mbox*mbox;
 };
 
+struct omap_mbox_task{
+   spinlock_t  lock;
+   struct tasklet_struct   *t;
+   mbox_msg_t  msg;
+   void*arg;
+};
+
+
 struct omap_mbox {
char*name;
unsigned intirq;
 
struct omap_mbox_queue  *txq, *rxq;
 
+   struct omap_mbox_task   *tx_tasklet;
+
struct omap_mbox_ops*ops;
 
mbox_msg_t  seq_snd, seq_rcv;
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 84cf6af..b5e53d4 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -63,60 +63,49 @@ static inline int is_mbox_irq(struct omap_mbox *mbox, 
omap_mbox_irq_t irq)
 /*
  * message sender
  */
-static int __mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
+static void __mbox_msg_send(unsigned long tx)
 {
+   struct omap_mbox_task *tx_data  =  (struct omap_mbox_task *)tx;
+   struct omap_mbox *mbox = (struct omap_mbox *)tx_data-arg;
+   mbox_msg_t msg = tx_data-msg;
int ret = 0, i = 1000;
 
while (mbox_fifo_full(mbox)) {
-   if (mbox-ops-type == OMAP_MBOX_TYPE2)
-   return -1;
-   if (--i == 0)
-   return -1;
+   if (mbox-ops-type == OMAP_MBOX_TYPE2) {
+   printk(KERN_ERR Invalid mailbox type\n);
+   return ;
+   }
+   if (--i == 0) {
+   printk(KERN_ERR Time out writing to mailbox\n);
+   return ;
+   }
udelay(1);
}
mbox_fifo_write(mbox, msg);
-   return ret;
-}
-
-struct omap_msg_tx_data {
-   mbox_msg_t  msg;
-   void*arg;
-};
+   tx_data-arg = NULL;
+   spin_unlock((mbox-tx_tasklet-lock));
 
-static void omap_msg_tx_end_io(struct request *rq, int error)
-{
-   kfree(rq-special);
-   __blk_put_request(rq-q, rq);
+   return;
 }
 
+
 int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
 {
-   struct omap_msg_tx_data *tx_data;
-   struct request *rq;
-   struct 

RE: [RFC][PATCH] omapfb: Reorder Register_framebuffer call

2009-09-04 Thread Peter Barada
On Fri, 2009-09-04 at 12:14 +0530, Gadiyar, Anand wrote:
  From: Sergio Aguirre saagui...@ti.com
  
  This fixes the issue in which mm_lock mutex was attempted to be
  used without initializing previously.
  
  Signed-off-by: Sergio Aguirre saagui...@ti.com
 
 Tested-by: Anand Gadiyar gadi...@ti.com
 
 This patch on top of current linux-omap kernel allows me to
 boot with the default SDP defconfig on a 3430 SDP.

Tested-by: Peter Barada pet...@logicpd.com

This patch on top of current linux-omap kernel allows me to boot with
the LCD enabled on LogicPD's OMAP boards.

  ---
   drivers/video/omap/omapfb_main.c |   20 +++-
   1 files changed, 11 insertions(+), 9 deletions(-)
  
  diff --git a/drivers/video/omap/omapfb_main.c 
  b/drivers/video/omap/omapfb_main.c
  index 125e605..60f9482 100644
  --- a/drivers/video/omap/omapfb_main.c
  +++ b/drivers/video/omap/omapfb_main.c
  @@ -1503,12 +1503,21 @@ static int fbinfo_init(struct omapfb_device *fbdev, 
  struct fb_info *info)
  var-rotate   = def_rotate;
  var-bits_per_pixel = fbdev-panel-bpp;
   
  +   r = register_framebuffer(info);
  +   if (r != 0) {
  +   dev_err(fbdev-dev,
  +   registering framebuffer failed\n);
  +   return r;
  +   }
  +
  set_fb_var(info, var);
  set_fb_fix(info);
   
  r = fb_alloc_cmap(info-cmap, 16, 0);
  -   if (r != 0)
  +   if (r != 0) {
  dev_err(fbdev-dev, unable to allocate color map memory\n);
  +   unregister_framebuffer(info);
  +   }
   
  return r;
   }
  @@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct platform_device 
  *pdev,
  init_state++;
   
  vram = 0;
  -   for (i = 0; i  fbdev-mem_desc.region_cnt; i++) {
  -   r = register_framebuffer(fbdev-fb_info[i]);
  -   if (r != 0) {
  -   dev_err(fbdev-dev,
  -   registering framebuffer %d failed\n, i);
  -   goto cleanup;
  -   }
  +   for (i = 0; i  fbdev-mem_desc.region_cnt; i++)
  vram += fbdev-mem_desc.region[i].size;
  -   }
   
  fbdev-state = OMAPFB_ACTIVE;
   
  -- 
  1.6.3.2
  
  --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Peter Barada pet...@logicpd.com
Logic Product Development, Inc.
--
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


New and improved omapzoom.org

2009-09-04 Thread Joshi, Rhishi

http://www.omapzoom.org
http://omappedia.org/wiki/LinuxOMAP_Kernel_Project

There is lot more information on new projects, resources for development and 
platform specs. 

And of course it points to linux-omap kernel. 

Regards,
Rhishi

--
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] OMAP4: MMC driver support on OMAP4

2009-09-04 Thread Andrew Morton
On Wed, 2 Sep 2009 18:54:36 +0530 (IST)
kishore kadiyala kishore.kadiy...@ti.com wrote:

 This Patch adds basic support for all 5 MMC controllers on OMAP4.
 
 -Kishore
 
 Signed-off-by: Kishore Kadiyala kishore.kadiy...@ti.com
 ---
 This patch doesn't include mmc-regulator support
 
  arch/arm/mach-omap2/devices.c  |   42 
 +
  arch/arm/plat-omap/include/mach/irqs.h |2 +
  arch/arm/plat-omap/include/mach/mmc.h  |9 ++-
  drivers/mmc/host/Kconfig   |6 ++--
  drivers/mmc/host/omap_hsmmc.c  |   10 +++
  5 files changed, 60 insertions(+), 9 deletions(-)

This looks like an ARM patch more than an MMC patch.  I grabbed it as
an MMC thing but hopefully someone else will grab it for a more
appropriate tree.

--
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] OMAP4: MMC driver support on OMAP4

2009-09-04 Thread Pandita, Vikram
Andrew/Kishore

-Original Message-
From: linux-omap-ow...@vger.kernel.org 
[mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Andrew
Morton
Sent: Friday, September 04, 2009 2:19 PM

On Wed, 2 Sep 2009 18:54:36 +0530 (IST)
kishore kadiyala kishore.kadiy...@ti.com wrote:

 This Patch adds basic support for all 5 MMC controllers on OMAP4.

 -Kishore

 Signed-off-by: Kishore Kadiyala kishore.kadiy...@ti.com
 ---
 This patch doesn't include mmc-regulator support


This looks like an ARM patch more than an MMC patch.  I grabbed it as
an MMC thing but hopefully someone else will grab it for a more
appropriate tree.

A patch split is required:

  arch/arm/mach-omap2/devices.c  |   42 
 +
  arch/arm/plat-omap/include/mach/irqs.h |2 +
  arch/arm/plat-omap/include/mach/mmc.h  |9 ++-

These files will go through linux-omap - arm: to RMK

  drivers/mmc/host/Kconfig   |6 ++--
  drivers/mmc/host/omap_hsmmc.c  |   10 +++
  5 files changed, 60 insertions(+), 9 deletions(-)

These files can go through Andrew.


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

--
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] OMAP4: MMC driver support on OMAP4

2009-09-04 Thread Tony Lindgren
* Pandita, Vikram vikram.pand...@ti.com [090904 12:24]:
 Andrew/Kishore
 
 -Original Message-
 From: linux-omap-ow...@vger.kernel.org 
 [mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Andrew
 Morton
 Sent: Friday, September 04, 2009 2:19 PM
 
 On Wed, 2 Sep 2009 18:54:36 +0530 (IST)
 kishore kadiyala kishore.kadiy...@ti.com wrote:
 
  This Patch adds basic support for all 5 MMC controllers on OMAP4.
 
  -Kishore
 
  Signed-off-by: Kishore Kadiyala kishore.kadiy...@ti.com
  ---
  This patch doesn't include mmc-regulator support
 
 
 This looks like an ARM patch more than an MMC patch.  I grabbed it as
 an MMC thing but hopefully someone else will grab it for a more
 appropriate tree.
 
 A patch split is required:
 
   arch/arm/mach-omap2/devices.c  |   42 
  +
   arch/arm/plat-omap/include/mach/irqs.h |2 +
   arch/arm/plat-omap/include/mach/mmc.h  |9 ++-
 
 These files will go through linux-omap - arm: to RMK
 
   drivers/mmc/host/Kconfig   |6 ++--
   drivers/mmc/host/omap_hsmmc.c  |   10 +++
   5 files changed, 60 insertions(+), 9 deletions(-)
 
 These files can go through Andrew.

No need to split it IMHO, it's best to merge it all together
via Andrew's MMC queue as it should not conflict with other
arch/arm/*omap* stuff.

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


RE: [PATCH] OMAP4: MMC driver support on OMAP4

2009-09-04 Thread Madhusudhan


 -Original Message-
 From: Tony Lindgren [mailto:t...@atomide.com]
 Sent: Friday, September 04, 2009 2:34 PM
 To: Pandita, Vikram
 Cc: Andrew Morton; Kadiyala, Kishore; linux-ker...@vger.kernel.org; linux-
 o...@vger.kernel.org; jarkko.lavi...@nokia.com; Chikkature Rajashekar,
 Madhusudhan; linux-arm-ker...@lists.arm.linux.org.uk; linux-arm-
 ker...@lists.infradead.org; linux-...@vger.kernel.org
 Subject: Re: [PATCH] OMAP4: MMC driver support on OMAP4
 
 * Pandita, Vikram vikram.pand...@ti.com [090904 12:24]:
  Andrew/Kishore
 
  -Original Message-
  From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
 ow...@vger.kernel.org] On Behalf Of Andrew
  Morton
  Sent: Friday, September 04, 2009 2:19 PM
  
  On Wed, 2 Sep 2009 18:54:36 +0530 (IST)
  kishore kadiyala kishore.kadiy...@ti.com wrote:
  
   This Patch adds basic support for all 5 MMC controllers on OMAP4.
  
   -Kishore
  
   Signed-off-by: Kishore Kadiyala kishore.kadiy...@ti.com
   ---
   This patch doesn't include mmc-regulator support
  
  
  This looks like an ARM patch more than an MMC patch.  I grabbed it as
  an MMC thing but hopefully someone else will grab it for a more
  appropriate tree.
 
  A patch split is required:
 
arch/arm/mach-omap2/devices.c  |   42
 +
arch/arm/plat-omap/include/mach/irqs.h |2 +
arch/arm/plat-omap/include/mach/mmc.h  |9 ++-
 
  These files will go through linux-omap - arm: to RMK
 
drivers/mmc/host/Kconfig   |6 ++--
drivers/mmc/host/omap_hsmmc.c  |   10 +++
5 files changed, 60 insertions(+), 9 deletions(-)
 
  These files can go through Andrew.
 
 No need to split it IMHO, it's best to merge it all together
 via Andrew's MMC queue as it should not conflict with other
 arch/arm/*omap* stuff.
 
 Acked-by: Tony Lindgren t...@atomide.com

Request to add my ACK.

Acked-by: Madhusudhan Chikkature madhu...@ti.com


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


RE: [PATCH] OMAP4: MMC driver support on OMAP4

2009-09-04 Thread Madhusudhan


 -Original Message-
 From: Tony Lindgren [mailto:t...@atomide.com]
 Sent: Friday, September 04, 2009 2:34 PM
 To: Pandita, Vikram
 Cc: Andrew Morton; Kadiyala, Kishore; linux-ker...@vger.kernel.org; linux-
 o...@vger.kernel.org; jarkko.lavi...@nokia.com; Chikkature Rajashekar,
 Madhusudhan; linux-arm-ker...@lists.arm.linux.org.uk; linux-arm-
 ker...@lists.infradead.org; linux-...@vger.kernel.org
 Subject: Re: [PATCH] OMAP4: MMC driver support on OMAP4
 
 * Pandita, Vikram vikram.pand...@ti.com [090904 12:24]:
  Andrew/Kishore
 
  -Original Message-
  From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
 ow...@vger.kernel.org] On Behalf Of Andrew
  Morton
  Sent: Friday, September 04, 2009 2:19 PM
  
  On Wed, 2 Sep 2009 18:54:36 +0530 (IST)
  kishore kadiyala kishore.kadiy...@ti.com wrote:
  
   This Patch adds basic support for all 5 MMC controllers on OMAP4.
  
   -Kishore
  
   Signed-off-by: Kishore Kadiyala kishore.kadiy...@ti.com
   ---
   This patch doesn't include mmc-regulator support
  
  
  This looks like an ARM patch more than an MMC patch.  I grabbed it as
  an MMC thing but hopefully someone else will grab it for a more
  appropriate tree.
 
  A patch split is required:
 
arch/arm/mach-omap2/devices.c  |   42
 +
arch/arm/plat-omap/include/mach/irqs.h |2 +
arch/arm/plat-omap/include/mach/mmc.h  |9 ++-
 
  These files will go through linux-omap - arm: to RMK
 
drivers/mmc/host/Kconfig   |6 ++--
drivers/mmc/host/omap_hsmmc.c  |   10 +++
5 files changed, 60 insertions(+), 9 deletions(-)
 
  These files can go through Andrew.
 
 No need to split it IMHO, it's best to merge it all together
 via Andrew's MMC queue as it should not conflict with other
 arch/arm/*omap* stuff.
 
 Acked-by: Tony Lindgren t...@atomide.com

Request to add my ACK.

Acked-by: Madhusudhan Chikkature madhu...@ti.com


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


Re: several OMAP newbie questions

2009-09-04 Thread Cliff Brake
On Tue, Sep 1, 2009 at 6:34 AM, Mike Rapoportm...@compulab.co.il wrote:

 3) If I'm not much mistaken, board specific pin mux configuration has to deal
 with arch/arm/plat-omap/include/mach/mux.h and arch/arm/mach-omap2/mux.c. For
 instance, if my board uses ULPI pins that have not been defined already, I 
 need
 to patch those file with my pin mux definitions. Am I right here, or have I
 missed something?

It seems to me there should be a global mux configuration per CPU, but
should be configurable per board, group of boards, etc.  What I would
like is a set of routines can be used to configure the mux that is
then called by the board files (similar to PXA).  Especially once we
get into supporting multiple base boards with things like beagle and
overo, it would be nice to have have all this logic both places
(kernel/uboot), but maybe its needed there anyway.

Cliff
--
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/3] USB: MUSB: Provide Platform specific suspend/resume hooks

2009-09-04 Thread Vikram Pandita
Patch 1:
This patch series creates MUSB platform specific power hooks for different
MUSB platforms (OMAP/Blackfin/Davinci/TUSB)

Patch 2 and 3:
This fixes issues with musb omap file for xceivr pointer passing and clock
enable race

Series is tested for MUSB:OMAP on Zoom2 platform.

Vikram Pandita (3):
  USB: musb: All each platform to have power hooks
  USB: musb: omap: Fix wrong xceivr passing to twl4030
  USB: musb: omap: Enable MUSB clocks before xceiver resume

 drivers/usb/musb/blackfin.c  |   15 +++
 drivers/usb/musb/davinci.c   |   24 
 drivers/usb/musb/musb_core.c |   15 +++
 drivers/usb/musb/omap2430.c  |   15 +--
 drivers/usb/musb/tusb6010.c  |   24 
 include/linux/usb/musb.h |5 +
 6 files changed, 80 insertions(+), 18 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/3] USB: musb: All each platform to have power hooks

2009-09-04 Thread Vikram Pandita
This patch allows each MUSB platform (Davinci/TUSB/OMAP/Blackfin)
to have their own musb_platform_suspend/musb_platform_resume hooks

Each platform has its own power handling requirements and hence
distribute the suspend/resume functionality per platform

No new functionality is added for other platforms (blackfin/davinci/tusb)
In future these platforms can optimize their suspend/resume routines for
power.

Signed-off-by: Vikram Pandita vikram.pand...@ti.com
Cc: Ajay Kumar Gupta ajay.gu...@ti.com
---
 drivers/usb/musb/blackfin.c  |   15 +++
 drivers/usb/musb/davinci.c   |   24 
 drivers/usb/musb/musb_core.c |   15 +++
 drivers/usb/musb/omap2430.c  |4 +---
 drivers/usb/musb/tusb6010.c  |   24 
 include/linux/usb/musb.h |5 +
 6 files changed, 72 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index f2f66eb..9a716b2 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -305,11 +305,26 @@ int __init musb_platform_init(struct musb *musb)
 
 int musb_platform_suspend(struct musb *musb)
 {
+   if (!musb-clock)
+   return 0;
+
+   if (musb-set_clock)
+   musb-set_clock(musb-clock, 0);
+   else
+   clk_disable(musb-clock);
+
return 0;
 }
 
 int musb_platform_resume(struct musb *musb)
 {
+   if (!musb-clock)
+   return 0;
+
+   if (musb-set_clock)
+   musb-set_clock(musb-clock, 1);
+   else
+   clk_enable(musb-clock);
return 0;
 }
 
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index e16ff60..684e769 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -499,3 +499,27 @@ int musb_platform_exit(struct musb *musb)
 
return 0;
 }
+
+int musb_platform_suspend(struct musb *musb)
+{
+   if (!musb-clock)
+   return 0;
+
+   if (musb-set_clock)
+   musb-set_clock(musb-clock, 0);
+   else
+   clk_disable(musb-clock);
+   return 0;
+}
+
+int musb_platform_resume(struct musb *musb)
+{
+   if (!musb-clock)
+   return 0;
+
+   if (musb-set_clock)
+   musb-set_clock(musb-clock, 1);
+   else
+   clk_enable(musb-clock);
+   return 0;
+}
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index c7c1ca0..ef97a0c 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2186,13 +2186,9 @@ static int musb_suspend(struct platform_device *pdev, 
pm_message_t message)
 * they will even be wakeup-enabled.
 */
}
-
-   if (musb-set_clock)
-   musb-set_clock(musb-clock, 0);
-   else
-   clk_disable(musb-clock);
spin_unlock_irqrestore(musb-lock, flags);
-   return 0;
+
+   return musb_platform_suspend(musb);
 }
 
 static int musb_resume_early(struct platform_device *pdev)
@@ -2202,16 +2198,11 @@ static int musb_resume_early(struct platform_device 
*pdev)
if (!musb-clock)
return 0;
 
-   if (musb-set_clock)
-   musb-set_clock(musb-clock, 1);
-   else
-   clk_enable(musb-clock);
-
/* for static cmos like DaVinci, register values were preserved
 * unless for some reason the whole soc powered down or the USB
 * module got reset through the PSC (vs just being disabled).
 */
-   return 0;
+   return musb_platform_resume(musb);
 }
 
 #else
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 3487520..b957575 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -188,8 +188,6 @@ static void omap_set_vbus(struct musb *musb, int is_on)
musb_readb(musb-mregs, MUSB_DEVCTL));
 }
 
-static int musb_platform_resume(struct musb *musb);
-
 int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
 {
u8  devctl = musb_readb(musb-mregs, MUSB_DEVCTL);
@@ -281,7 +279,7 @@ int musb_platform_suspend(struct musb *musb)
return 0;
 }
 
-static int musb_platform_resume(struct musb *musb)
+int musb_platform_resume(struct musb *musb)
 {
u32 l;
 
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index 88b587c..7da5272 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -1169,3 +1169,27 @@ int musb_platform_exit(struct musb *musb)
usb_nop_xceiv_unregister();
return 0;
 }
+
+int musb_platform_suspend(struct musb *musb)
+{
+   if (!musb-clock)
+   return 0;
+
+   if (musb-set_clock)
+   musb-set_clock(musb-clock, 0);
+   else
+   clk_disable(musb-clock);
+   return 0;
+}
+
+int musb_platform_resume(struct musb *musb)
+{
+   if (!musb-clock)
+   return 0;
+
+   if (musb-set_clock)
+   

[PATCH 2/3] USB: musb: omap: Fix wrong xceivr passing to twl4030

2009-09-04 Thread Vikram Pandita
Wrong pointer was getting passed to twl4030 transceiver.

Call path is:
otg_set_suspend - twl4030_set_suspend

drivers/usb/otg/twl4030-usb.c: twl4030_set_suspend() uses:
struct twl4030_usb *twl = xceiv_to_twl(x);

and xceiv_to_twl is container_of()

So the same pointer needs to be passed to otg_set_suspend() as has
been used for otg_set_transceiver.

A crash is seen without this patch, as twl pointer access is worng

Signed-off-by: Vikram Pandita vikram.pand...@ti.com
---
 drivers/usb/musb/omap2430.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index b957575..ea7a798 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -269,7 +269,7 @@ int musb_platform_suspend(struct musb *musb)
l |= ENABLEWAKEUP;  /* enable wakeup */
omap_writel(l, OTG_SYSCONFIG);
 
-   otg_set_suspend(musb-xceiv, 1);
+   otg_set_suspend(otg_get_transceiver(), 1);
 
if (musb-set_clock)
musb-set_clock(musb-clock, 0);
@@ -286,7 +286,7 @@ int musb_platform_resume(struct musb *musb)
if (!musb-clock)
return 0;
 
-   otg_set_suspend(musb-xceiv, 0);
+   otg_set_suspend(otg_get_transceiver(), 0);
 
if (musb-set_clock)
musb-set_clock(musb-clock, 1);
-- 
1.6.3.3.334.g916e1

--
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/3] USB: musb: omap: Enable MUSB clocks before xceiver resume

2009-09-04 Thread Vikram Pandita
Enable MUSB clocks before the xceiver resume is called.
As soon as xceiver resume is called, xceiver communicates an
interrupt to MUSB over ULPI bus and the interrupt handler crashes
as the clocks are not enabled on going to resume.

So enable the MUSB clocks so that its ready to handle interrupts
from the xceiver

Signed-off-by: Vikram Pandita vikram.pand...@ti.com
---
 drivers/usb/musb/omap2430.c |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index ea7a798..67dabe1 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -286,13 +286,18 @@ int musb_platform_resume(struct musb *musb)
if (!musb-clock)
return 0;
 
-   otg_set_suspend(otg_get_transceiver(), 0);
-
+   /* Keep MUSB clock enabled
+* this is needed when phy xvr is enabled, MUSB gets
+* an interrupt and system crashes.
+* So enable clock before calling phy resume
+*/
if (musb-set_clock)
musb-set_clock(musb-clock, 1);
else
clk_enable(musb-clock);
 
+   otg_set_suspend(otg_get_transceiver(), 0);
+
l = omap_readl(OTG_SYSCONFIG);
l = ~ENABLEWAKEUP; /* disable wakeup */
omap_writel(l, OTG_SYSCONFIG);
-- 
1.6.3.3.334.g916e1

--
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/3] [ARM] omap850: Fix wrong jtag_id.

2009-09-04 Thread Angelo Arrifano
Original message:
The previous value of the jtag_id was set for the omap730.  For the
omap850, this value is different, and this was causing
autodetection to fail.

Reported-by:
  Cory Maccarrone darkstar6...@gmail.com
  Angelo Arrifano mik...@gmail.com
  Alistair Buxton a.j.bux...@gmail.com

Signed-off-by: Angelo Arrifano mik...@gmail.com
---
 arch/arm/mach-omap1/id.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index 4ef26fa..e5dcdf7 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -38,7 +38,7 @@ static struct omap_id omap_ids[] __initdata = {
{ .jtag_id = 0xb574, .die_rev = 0x2, .omap_id = 0x03310315, .type =
0x0310},
{ .jtag_id = 0x355f, .die_rev = 0x0, .omap_id = 0x0332, .type =
0x07300100},
{ .jtag_id = 0xb55f, .die_rev = 0x0, .omap_id = 0x0332, .type =
0x07300300},
-   { .jtag_id = 0xb55f, .die_rev = 0x0, .omap_id = 0x03320500, .type =
0x0850},
+   { .jtag_id = 0xb62c, .die_rev = 0x1, .omap_id = 0x03320500, .type =
0x0850},
{ .jtag_id = 0xb470, .die_rev = 0x0, .omap_id = 0x03310100, .type =
0x1510},
{ .jtag_id = 0xb576, .die_rev = 0x0, .omap_id = 0x0332, .type =
0x1610},
{ .jtag_id = 0xb576, .die_rev = 0x2, .omap_id = 0x03320100, .type =
0x1611},
-- 
1.6.3.3

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


[PATCH 2/3] [ARM] omap850: Fix a OMAP_MPUIO_VBASE typo.

2009-09-04 Thread Angelo Arrifano
This was crashing omap850 devices.

Reported-by:
  Alistair Buxton a.j.bux...@gmail.com

Signed-off-by: Angelo Arrifano mik...@gmail.com
---
 arch/arm/plat-omap/gpio.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 7c70a6a..66c7006 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -224,7 +224,7 @@ static struct gpio_bank gpio_bank_730[7] = {

 #ifdef CONFIG_ARCH_OMAP850
 static struct gpio_bank gpio_bank_850[7] = {
-   { OMAP1_MPUIO_BASE, INT_850_MPUIO,  IH_MPUIO_BASE,  
METHOD_MPUIO },
+   { OMAP1_MPUIO_VBASE, INT_850_MPUIO, IH_MPUIO_BASE,  
METHOD_MPUIO },
{ OMAP850_GPIO1_BASE,  INT_850_GPIO_BANK1,  IH_GPIO_BASE,
METHOD_GPIO_850 },
{ OMAP850_GPIO2_BASE,  INT_850_GPIO_BANK2,  IH_GPIO_BASE + 32,
METHOD_GPIO_850 },
{ OMAP850_GPIO3_BASE,  INT_850_GPIO_BANK3,  IH_GPIO_BASE + 64,
METHOD_GPIO_850 },
-- 
1.6.3.3

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


[PATCH 3/3] [ARM] omap850: Use ck_ref clock for omap850.

2009-09-04 Thread Angelo Arrifano
This clock is required for booting.

Signed-off-by: Angelo Arrifano mik...@gmail.com
---
 arch/arm/mach-omap1/clock.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 436eed2..d2d5ece 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -75,7 +75,7 @@ struct omap_clk {

 static struct omap_clk omap_clks[] = {
/* non-ULPD clocks */
-   CLK(NULL,   ck_ref,   ck_ref,CK_16XX | CK_1510 | 
CK_310),
+   CLK(NULL,   ck_ref,   ck_ref,CK_16XX | CK_1510 | 
CK_7XX | CK_310),
CLK(NULL,   ck_dpll1, ck_dpll1,  CK_16XX | CK_1510 | 
CK_310),
/* CK_GEN1 clocks */
CLK(NULL,   ck_dpll1out,  ck_dpll1out.clk, CK_16XX),
-- 
1.6.3.3

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