Re: [PATCH] mfd: twl4030: Driver for twl4030 madc module

2010-01-25 Thread Janakiram Sistla
   drivers/mfd/Kconfig  |   21 ++
   drivers/mfd/Makefile |3 +-
   drivers/mfd/twl4030-madc.c   |  548 
  ++
   include/linux/i2c/twl4030-madc.h |  126 +
   4 files changed, 697 insertions(+), 1 deletions(-)
   create mode 100644 drivers/mfd/twl4030-madc.c
   create mode 100644 include/linux/i2c/twl4030-madc.h
 

 We have just tried to adopt this driver to our custom OMAP3 board, but
 were unable to get any interrupts.
 Any ideas on what is missing? We've checked whole TRM and found
 nothing wrong yet :(

we tried the same driver for Omap zoom platform ,I too dont see any
interrupts from this driver.I also observe that duing bluetooth file
transfer i see the below crash from twl4030-madc driver.

Once i disable the madc driver in kernel configuration my Bluetooth
works fine,while Bluetooth has nothing to do with i2c or madc driver.A
similar crash is also observed during GFX operation

Regards,
Ram.

here is the log:
i2c_omap i2c_omap.1: controller timed out waiting for start condition to finish
twl: i2c_write failed to transfer all messages
Unable to handle kernel NULL pointer dereference at virtual address 0044
pgd = c0004000
[0044] *pgd=
Internal error: Oops: 17 [#1] PREEMPT
last sysfs file: /sys/devices/platform/kim/firmware/kim/loading
Modules linked in: bt_drv st_drv
CPU: 0Not tainted  (2.6.32-14922-g86eec44 #1)
PC is at dev_driver_string+0x0/0x38
LR is at twl4030_madc_write+0x2c/0x4c
pc : [c01f2bc0]lr : [c01fede0]psr: a013
sp : cf02bf08  ip : 738f  fp : 
r10: cf002cc8  r9 : c038a839  r8 : 
r7 : cf02bf3c  r6 : c04edff8  r5 : 0007  r4 : cf227a00
r3 : 0007  r2 : 02070002  r1 : 0007  r0 : 
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387d  Table: 8d23c019  DAC: 0017
Process events/0 (pid: 5, stack limit = 0xcf02a2e8)
Stack: (0xcf02bf08 to 0xcf02c000)
bf00:   0006 0002 c04edff8 c01fef6c cf179680 cf179680
bf20: cf02a000 cf002cc0 c028a5a8  cf002cc8 c028a5dc  0200
bf40: cf020001  cf020d40 0017 cf0213c0 c007f1dc  cd277e40
bf60: cf02bf94 c036e58c cd0bac9c cf020ed4 6013 cf002cc0 cf002cbc cf02a000
bf80: cf002cc0 c01dcc00 cf002cc0  cf179684 c0076ff4 cf02bfcc 
bfa0: cf020d40 c007a660 cf02bfa8 cf02bfa8 cf023f60 cf02bfd4 cf023f60 cf002cc0
bfc0: c0076e8c   c007a334   cf02bfd8 cf02bfd8
bfe0:      c0035f80  
[c01f2bc0] (dev_driver_string+0x0/0x38) from [c01fede0] (twl4030_madc_write+
0x2c/0x4c)
[c01fede0] (twl4030_madc_write+0x2c/0x4c) from [c01fef6c] (twl4030_madc_conv
ersion+0x74/0x288)
[c01fef6c] (twl4030_madc_conversion+0x74/0x288) from [c028a5dc] (twl4030_bk_
bci_battery_work+0x34/0x60)
[c028a5dc] (twl4030_bk_bci_battery_work+0x34/0x60) from [c0076ff4] (worker_t
hread+0x168/0x214)
[c0076ff4] (worker_thread+0x168/0x214) from [c007a334] (kthread+0x7c/0x84)
[c007a334] (kthread+0x7c/0x84) from [c0035f80] (kernel_thread_exit+0x0/0x8)
Code: c04edd3c c04eddcc c042bef5 c040d709 (e5903044)
--
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: support for OFF-mode

2010-01-25 Thread Kauppi Ari (EXT-Ixonos/Oulu)
On Fri, 2010-01-22 at 09:42 +0100, Mandy Arnaud.2 (EXT-Teleca/Helsinki)
wrote:

Hi,

 using a wrapper between the transceiver driver and the controller
 driver to signal the controller driver to turn on/off the controller
 when VBUS event is detected.

I think there is one register mismatch, please see below.

 based-on: Heikki Krogerus ext-heikki.kroge...@nokia.com
 Signed-off-by: Arnaud Mandy ext-arnaud.2.ma...@nokia.com
 ---
  drivers/usb/musb/musb_core.c  |   30 +-
  drivers/usb/musb/musb_core.h  |   17 +-
  drivers/usb/musb/omap2430.c   |   66 
 -
  drivers/usb/otg/otg.c |   16 ++
  drivers/usb/otg/twl4030-usb.c |2 +
  include/linux/usb/otg.h   |   11 +++
  6 files changed, 137 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
 index 2f59892..ab97a02 100644
 --- a/drivers/usb/musb/musb_core.c
 +++ b/drivers/usb/musb/musb_core.c
 @@ -965,6 +965,8 @@ void musb_start(struct musb *musb)
   }
   musb_platform_enable(musb);
   musb_writeb(regs, MUSB_DEVCTL, devctl);
 +
 + musb_save_context(musb);
  }
  
 
 @@ -1948,6 +1950,25 @@ static void musb_free(struct musb *musb)
  #endif
  }
  
 +int musb_power_controller(struct otg_controller *controller, bool vbus)
 +{
 + struct musb *musb = dev_to_musb(controller-dev);
 +
 + if (!musb-off_mode_support)
 + return 0;
 +
 + if (vbus)
 + musb_power_on_controller(musb);
 + else
 + musb_power_off_controller(musb);
 +
 + return 0;
 +}
 +
 +struct otg_controller musb_controller = {
 + .power_controller = musb_power_controller,
 +};
 +
  /*
   * Perform generic per-controller initialization.
   *
 @@ -2044,6 +2065,9 @@ bad_config:
   goto fail2;
   }
  
 + musb_controller.dev = dev;
 + musb-xceiv-controller = musb_controller;
 +
  #ifndef CONFIG_MUSB_PIO_ONLY
   if (use_dma  dev-dma_mask) {
   struct dma_controller   *c;
 @@ -2313,7 +2337,8 @@ void musb_save_context(struct musb *musb)
  
   musb_writeb(musb_base, MUSB_INDEX, musb_context.index);
  
 - musb_platform_save_context(musb, musb_context);
 + if (!musb-off_mode)
 + musb_platform_save_context(musb, musb_context);
  }
  
  void musb_restore_context(struct musb *musb)
 @@ -2322,7 +2347,8 @@ void musb_restore_context(struct musb *musb)
   void __iomem *musb_base = musb-mregs;
   void __iomem *ep_target_regs;
  
 - musb_platform_restore_context(musb, musb_context);
 + if (!musb-off_mode)
 + musb_platform_restore_context(musb, musb_context);
  
   if (is_host_enabled(musb)) {
   musb_writew(musb_base, MUSB_FRAME, musb_context.frame);
 diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
 index 1e3da4e..8105a47 100644
 --- a/drivers/usb/musb/musb_core.h
 +++ b/drivers/usb/musb/musb_core.h
 @@ -448,6 +448,11 @@ struct musb {
   struct usb_gadget   g;  /* the gadget */
   struct usb_gadget_driver *gadget_driver;/* its driver */
  #endif
 + /* true if off-mode is supported */
 + unsignedoff_mode_support:1;
 +
 + /* true if off-mode is requested */
 + unsignedoff_mode:1;
  
   /* true if we're using dma */
   unsigneduse_dma:1;
 @@ -498,8 +503,16 @@ extern void musb_platform_restore_context(struct musb 
 *musb,
  #define musb_platform_save_context(m, x) do {} while (0)
  #define musb_platform_restore_context(m, x)  do {} while (0)
  #endif
 -
 -#endif
 +extern void musb_power_on_controller(struct musb *musb);
 +extern void musb_power_off_controller(struct musb *musb);
 +void musb_save_context(struct musb *musb);
 +void musb_restore_context(struct musb *musb);
 +#else
 +static inline void musb_power_on_controller(struct musb *musb) {};
 +static inline void musb_power_off_controller(struct musb *musb) {};
 +static inline void musb_save_context(struct musb *musb) {};
 +static inline void musb_restore_context(struct musb *musb) {};
 +#endif /* CONFIG_PM */
  
  static inline void musb_set_vbus(struct musb *musb, int is_on)
  {
 diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
 index 21cff53..3cc894b 100644
 --- a/drivers/usb/musb/omap2430.c
 +++ b/drivers/usb/musb/omap2430.c
 @@ -220,6 +220,9 @@ int __init musb_platform_init(struct musb *musb)
  
   musb_platform_resume(musb);
  
 +#ifdef CONFIG_PM
 + musb-off_mode_support = 1;
 +#endif
   l = musb_readl(musb-mregs, OTG_SYSCONFIG);
   l = ~ENABLEWAKEUP; /* disable wakeup */
   l = ~NOSTDBY;  /* remove possible nostdby */
 @@ -271,7 +274,68 @@ void musb_platform_restore_context(struct musb *musb,
   musb_writel(musb-mregs, OTG_SYSCONFIG, musb_context-otg_sysconfig);
   musb_writel(musb-mregs, OTG_FORCESTDBY, 
 musb_context-otg_forcestandby);
  }
 -#endif
 +
 

Re: [PATCHv2 0/6] McPDM driver patch series

2010-01-25 Thread Mark Brown
On Fri, Jan 22, 2010 at 05:14:48PM -0600, Candelaria Villareal, Jorge wrote:
 McPDM module is the interface between the OMAP and TWL6030 audio codec.

 The interface supports the following:
 * Up to 5 downlink channels and 3 uplink channels
 * 88.2 and 96 KHz
 * 32 bit sample size

Liam already asked all the questions I had about this series - apart
from what he said it looks OK to me.
--
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/RFC 1/3] OMAP3: VC: create common init code

2010-01-25 Thread Cousson, Benoit
Hi Kevin,

From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
ow...@vger.kernel.org] On Behalf Of Kevin Hilman

Move VC init code from PM core into separate VC core.

No functional changes.
---
 arch/arm/mach-omap2/Makefile|3 +-
 arch/arm/mach-omap2/board-3430sdp.c |1 +
 arch/arm/mach-omap2/pm.h|   25 
 arch/arm/mach-omap2/pm34xx.c|   91 ---
 arch/arm/mach-omap2/vc.c|  116
+++
 arch/arm/mach-omap2/vc.h|   47 ++
 6 files changed, 166 insertions(+), 117 deletions(-)
 create mode 100644 arch/arm/mach-omap2/vc.c
 create mode 100644 arch/arm/mach-omap2/vc.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 4ca93f1..4c6f017 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -37,7 +37,8 @@ obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o
 ifeq ($(CONFIG_PM),y)
 obj-$(CONFIG_ARCH_OMAP2)  += pm24xx.o
 obj-$(CONFIG_ARCH_OMAP24XX)   += sleep24xx.o
-obj-$(CONFIG_ARCH_OMAP3)  += pm34xx.o sleep34xx.o cpuidle34xx.o
+obj-$(CONFIG_ARCH_OMAP3)  += pm34xx.o sleep34xx.o cpuidle34xx.o \
+ vc.o
 obj-$(CONFIG_PM_DEBUG)+= pm-debug.o
 obj-$(CONFIG_OMAP_SMARTREFLEX)+= smartreflex.o
 endif
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-
omap2/board-3430sdp.c
index 7d68445..65ab469 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -48,6 +48,7 @@
 #include mmc-twl4030.h
 #include pm.h
 #include omap3-opp.h
+#include vc.h

 #define SDP3430_TS_GPIO_IRQ_SDPV1 3
 #define SDP3430_TS_GPIO_IRQ_SDPV2 2
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 75aa685..78b5a06 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -40,31 +40,6 @@ inline void omap3_pm_init_cpuidle(struct cpuidle_params
*cpuidle_board_params)
 }
 #endif

-struct prm_setup_vc {
-  u16 clksetup;
-  u16 voltsetup_time1;
-  u16 voltsetup_time2;
-  u16 voltoffset;
-  u16 voltsetup2;
-/* PRM_VC_CMD_VAL_0 specific bits */
-  u16 vdd0_on;
-  u16 vdd0_onlp;
-  u16 vdd0_ret;
-  u16 vdd0_off;
-/* PRM_VC_CMD_VAL_1 specific bits */
-  u16 vdd1_on;
-  u16 vdd1_onlp;
-  u16 vdd1_ret;
-  u16 vdd1_off;
-};
-#ifdef CONFIG_PM
-extern void omap3_pm_init_vc(struct prm_setup_vc *setup_vc);
-#else
-static inline void omap3_pm_init_vc(struct prm_setup_vc *setup_vc)
-{
-}
-#endif
-
 extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
 extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int
state);

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 190f25c..df437a5 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -95,22 +95,6 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
 static struct powerdomain *core_pwrdm, *per_pwrdm;
 static struct powerdomain *cam_pwrdm;

-static struct prm_setup_vc prm_setup = {
-  .clksetup = 0xff,
-  .voltsetup_time1 = 0xfff,
-  .voltsetup_time2 = 0xfff,
-  .voltoffset = 0xff,
-  .voltsetup2 = 0xff,
-  .vdd0_on = 0x30,/* 1.2v */
-  .vdd0_onlp = 0x20,  /* 1.0v */
-  .vdd0_ret = 0x1e,   /* 0.975v */
-  .vdd0_off = 0x00,   /* 0.6v */
-  .vdd1_on = 0x2c,/* 1.15v */
-  .vdd1_onlp = 0x20,  /* 1.0v */
-  .vdd1_ret = 0x1e,   /* .975v */
-  .vdd1_off = 0x00,   /* 0.6v */
-};
-
 static inline void omap3_per_save_context(void)
 {
   omap_gpio_save_context();
@@ -1072,26 +1056,6 @@ int omap3_pm_set_suspend_state(struct powerdomain
*pwrdm, int state)
   return -EINVAL;
 }

-void omap3_pm_init_vc(struct prm_setup_vc *setup_vc)
-{
-  if (!setup_vc)
-  return;
-
-  prm_setup.clksetup = setup_vc-clksetup;
-  prm_setup.voltsetup_time1 = setup_vc-voltsetup_time1;
-  prm_setup.voltsetup_time2 = setup_vc-voltsetup_time2;
-  prm_setup.voltoffset = setup_vc-voltoffset;
-  prm_setup.voltsetup2 = setup_vc-voltsetup2;
-  prm_setup.vdd0_on = setup_vc-vdd0_on;
-  prm_setup.vdd0_onlp = setup_vc-vdd0_onlp;
-  prm_setup.vdd0_ret = setup_vc-vdd0_ret;
-  prm_setup.vdd0_off = setup_vc-vdd0_off;
-  prm_setup.vdd1_on = setup_vc-vdd1_on;
-  prm_setup.vdd1_onlp = setup_vc-vdd1_onlp;
-  prm_setup.vdd1_ret = setup_vc-vdd1_ret;
-  prm_setup.vdd1_off = setup_vc-vdd1_off;
-}
-
 static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
 {
   struct power_state *pwrst;
@@ -1228,60 +1192,5 @@ err2:
   return ret;
 }

-static void __init configure_vc(void)
-{
-
-  prm_write_mod_reg((R_SRI2C_SLAVE_ADDR  OMAP3430_SMPS_SA1_SHIFT) |
-(R_SRI2C_SLAVE_ADDR  OMAP3430_SMPS_SA0_SHIFT),
-OMAP3430_GR_MOD, 

Re: [PATCH] DSPBRIDGE: Various compile warning fixes

2010-01-25 Thread Omar Ramirez Luna

Patch looks good, just one question:


This patch contains indentation fixes and cleans up various warnings
uncovered with extra warning flags:

  - empty if() bodies


am i missing something? which hunk fix this?


  - incorrect use of unsigned variables
  - bad comparison of pointer value
  - pointless check of unsigned value being smaller than zero
  - keyword 'extern' has to be first one in variable declaration

Signed-off-by: Mika Kukkonen mika.kukko...@nokia.com
Signed-off-by: Ameya Palande ameya.pala...@nokia.com
---
 arch/arm/plat-omap/include/dspbridge/dbc.h |6 +++---
 arch/arm/plat-omap/include/dspbridge/dbg.h |4 ++--
 arch/arm/plat-omap/include/dspbridge/gt.h  |   16 +---
 arch/arm/plat-omap/include/dspbridge/mem.h |2 +-
 drivers/dsp/bridge/wmd/io_sm.c |2 +-
 drivers/dsp/bridge/wmd/ue_deh.c|2 +-
 6 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dbc.h 
b/arch/arm/plat-omap/include/dspbridge/dbc.h
index ac5d178..1b3ac44 100644
--- a/arch/arm/plat-omap/include/dspbridge/dbc.h
+++ b/arch/arm/plat-omap/include/dspbridge/dbc.h
@@ -43,9 +43,9 @@

 #else

-#define DBC_Assert(exp)
-#define DBC_Require(exp)
-#define DBC_Ensure(exp)
+#define DBC_Assert(exp) {}
+#define DBC_Require(exp) {}
+#define DBC_Ensure(exp) {}

 #endif /* DEBUG */

diff --git a/arch/arm/plat-omap/include/dspbridge/dbg.h 
b/arch/arm/plat-omap/include/dspbridge/dbg.h
index 2f61dab..4d01eca 100644
--- a/arch/arm/plat-omap/include/dspbridge/dbg.h
+++ b/arch/arm/plat-omap/include/dspbridge/dbg.h
@@ -80,9 +80,9 @@
extern DSP_STATUS DBG_Trace(IN u8 bLevel, IN char *pstrFormat, ...);
 #else

-#define DBG_Exit(void)
+#define DBG_Exit(void) do {} while (0)
 #define DBG_Init(void) true
-#define DBG_Trace(bLevel, pstrFormat, args...)
+#define DBG_Trace(bLevel, pstrFormat, args...) do {} while (0)

 #endif /* (CONFIG_BRIDGE_DEBUG || DDSP_DEBUG_PRODUCT)  GT_TRACE */

diff --git a/arch/arm/plat-omap/include/dspbridge/gt.h 
b/arch/arm/plat-omap/include/dspbridge/gt.h
index 6082d15..9097910 100644
--- a/arch/arm/plat-omap/include/dspbridge/gt.h
+++ b/arch/arm/plat-omap/include/dspbridge/gt.h
@@ -252,13 +252,15 @@ extern struct GT_Config _GT_params;

 #define GT_query(mask, class) false

-#define GT_0trace(mask, class, format)
-#define GT_1trace(mask, class, format, arg1)
-#define GT_2trace(mask, class, format, arg1, arg2)
-#define GT_3trace(mask, class, format, arg1, arg2, arg3)
-#define GT_4trace(mask, class, format, arg1, arg2, arg3, arg4)
-#define GT_5trace(mask, class, format, arg1, arg2, arg3, arg4, arg5)
-#define GT_6trace(mask, class, format, arg1, arg2, arg3, arg4, arg5, arg6)
+#define GT_0trace(mask, class, format) do {} while (0)
+#define GT_1trace(mask, class, format, arg1) do {} while (0)
+#define GT_2trace(mask, class, format, arg1, arg2) do {} while (0)
+#define GT_3trace(mask, class, format, arg1, arg2, arg3) do {} while (0)
+#define GT_4trace(mask, class, format, arg1, arg2, arg3, arg4) do {} while (0)
+#define GT_5trace(mask, class, format, arg1, arg2, arg3, arg4, arg5) \
+   do {} while (0)
+#define GT_6trace(mask, class, format, arg1, arg2, arg3, arg4, arg5, arg6) \
+   do {} while (0)

 #else  /* GT_TRACE == 1 */

diff --git a/arch/arm/plat-omap/include/dspbridge/mem.h 
b/arch/arm/plat-omap/include/dspbridge/mem.h
index 03b419a..353ffb0 100644
--- a/arch/arm/plat-omap/include/dspbridge/mem.h
+++ b/arch/arm/plat-omap/include/dspbridge/mem.h
@@ -286,7 +286,7 @@
  *  Ensures:
  *  - pBaseAddr no longer points to a valid linear address.
  */
-#define MEM_UnmapLinearAddress(pBaseAddr)
+#define MEM_UnmapLinearAddress(pBaseAddr) {}

 /*
  *   MEM_ExtPhysPoolInit 
diff --git a/drivers/dsp/bridge/wmd/io_sm.c b/drivers/dsp/bridge/wmd/io_sm.c
index e35ce57..64eba5a 100644
--- a/drivers/dsp/bridge/wmd/io_sm.c
+++ b/drivers/dsp/bridge/wmd/io_sm.c
@@ -1210,7 +1210,7 @@ static void InputChnl(struct IO_MGR *pIOMgr, struct 
CHNL_OBJECT *pChnl,
pChnlMgr-uWordSize;
chnlId = IO_GetValue(pIOMgr-hWmdContext, struct SHM, sm, inputId);
dwArg = IO_GetLong(pIOMgr-hWmdContext, struct SHM, sm, arg);
-   if (!(chnlId = 0) || !(chnlId  CHNL_MAXCHANNELS)) {
+   if (chnlId = CHNL_MAXCHANNELS) {
/* Shouldn't be here: would indicate corrupted SHM. */
DBC_Assert(chnlId);
goto func_end;
diff --git a/drivers/dsp/bridge/wmd/ue_deh.c b/drivers/dsp/bridge/wmd/ue_deh.c
index 6166d97..2c3a2cd 100644
--- a/drivers/dsp/bridge/wmd/ue_deh.c
+++ b/drivers/dsp/bridge/wmd/ue_deh.c
@@ -189,7 +189,7 @@ void WMD_DEH_Notify(struct DEH_MGR *hDehMgr, u32 
ulEventMask,
DSP_STATUS status = DSP_SOK;
u32 memPhysical = 0;
u32 HW_MMU_MAX_TLB_COUNT = 31;
-   u32 extern faultAddr;
+   extern u32 faultAddr;
struct CFG_HOSTRES resources;
HW_STATUS 

RE: [PATCH] DSPBRIDGE: Various compile warning fixes

2010-01-25 Thread ameya.palande
Hi Omar,

Sorry for the top posthing :(
I guess the original patch had empty if() bodies. 
That comment can be removed :)

Cheers,
Ameya.

From: ext Omar Ramirez Luna [omar.rami...@ti.com]
Sent: Monday, January 25, 2010 6:59 PM
To: Palande Ameya (Nokia-D/Helsinki)
Cc: linux-omap@vger.kernel.org; Menon, Nishanth; Chitriki Rudramuni, Deepak; 
Kukkonen Mika (Nokia-D/Helsinki)
Subject: Re: [PATCH] DSPBRIDGE: Various compile warning fixes

Patch looks good, just one question:

 This patch contains indentation fixes and cleans up various warnings
 uncovered with extra warning flags:

   - empty if() bodies

am i missing something? which hunk fix this?

   - incorrect use of unsigned variables
   - bad comparison of pointer value
   - pointless check of unsigned value being smaller than zero
   - keyword 'extern' has to be first one in variable declaration

 Signed-off-by: Mika Kukkonen mika.kukko...@nokia.com
 Signed-off-by: Ameya Palande ameya.pala...@nokia.com
 ---
  arch/arm/plat-omap/include/dspbridge/dbc.h |6 +++---
  arch/arm/plat-omap/include/dspbridge/dbg.h |4 ++--
  arch/arm/plat-omap/include/dspbridge/gt.h  |   16 +---
  arch/arm/plat-omap/include/dspbridge/mem.h |2 +-
  drivers/dsp/bridge/wmd/io_sm.c |2 +-
  drivers/dsp/bridge/wmd/ue_deh.c|2 +-
  6 files changed, 17 insertions(+), 15 deletions(-)

 diff --git a/arch/arm/plat-omap/include/dspbridge/dbc.h 
 b/arch/arm/plat-omap/include/dspbridge/dbc.h
 index ac5d178..1b3ac44 100644
 --- a/arch/arm/plat-omap/include/dspbridge/dbc.h
 +++ b/arch/arm/plat-omap/include/dspbridge/dbc.h
 @@ -43,9 +43,9 @@

  #else

 -#define DBC_Assert(exp)
 -#define DBC_Require(exp)
 -#define DBC_Ensure(exp)
 +#define DBC_Assert(exp) {}
 +#define DBC_Require(exp) {}
 +#define DBC_Ensure(exp) {}

  #endif   /* DEBUG */

 diff --git a/arch/arm/plat-omap/include/dspbridge/dbg.h 
 b/arch/arm/plat-omap/include/dspbridge/dbg.h
 index 2f61dab..4d01eca 100644
 --- a/arch/arm/plat-omap/include/dspbridge/dbg.h
 +++ b/arch/arm/plat-omap/include/dspbridge/dbg.h
 @@ -80,9 +80,9 @@
   extern DSP_STATUS DBG_Trace(IN u8 bLevel, IN char *pstrFormat, ...);
  #else

 -#define DBG_Exit(void)
 +#define DBG_Exit(void) do {} while (0)
  #define DBG_Init(void) true
 -#define DBG_Trace(bLevel, pstrFormat, args...)
 +#define DBG_Trace(bLevel, pstrFormat, args...) do {} while (0)

  #endif   /* (CONFIG_BRIDGE_DEBUG || DDSP_DEBUG_PRODUCT)  GT_TRACE */

 diff --git a/arch/arm/plat-omap/include/dspbridge/gt.h 
 b/arch/arm/plat-omap/include/dspbridge/gt.h
 index 6082d15..9097910 100644
 --- a/arch/arm/plat-omap/include/dspbridge/gt.h
 +++ b/arch/arm/plat-omap/include/dspbridge/gt.h
 @@ -252,13 +252,15 @@ extern struct GT_Config _GT_params;

  #define GT_query(mask, class) false

 -#define GT_0trace(mask, class, format)
 -#define GT_1trace(mask, class, format, arg1)
 -#define GT_2trace(mask, class, format, arg1, arg2)
 -#define GT_3trace(mask, class, format, arg1, arg2, arg3)
 -#define GT_4trace(mask, class, format, arg1, arg2, arg3, arg4)
 -#define GT_5trace(mask, class, format, arg1, arg2, arg3, arg4, arg5)
 -#define GT_6trace(mask, class, format, arg1, arg2, arg3, arg4, arg5, arg6)
 +#define GT_0trace(mask, class, format) do {} while (0)
 +#define GT_1trace(mask, class, format, arg1) do {} while (0)
 +#define GT_2trace(mask, class, format, arg1, arg2) do {} while (0)
 +#define GT_3trace(mask, class, format, arg1, arg2, arg3) do {} while (0)
 +#define GT_4trace(mask, class, format, arg1, arg2, arg3, arg4) do {} while 
 (0)
 +#define GT_5trace(mask, class, format, arg1, arg2, arg3, arg4, arg5) \
 + do {} while (0)
 +#define GT_6trace(mask, class, format, arg1, arg2, arg3, arg4, arg5, arg6) \
 + do {} while (0)

  #else/* GT_TRACE == 1 */

 diff --git a/arch/arm/plat-omap/include/dspbridge/mem.h 
 b/arch/arm/plat-omap/include/dspbridge/mem.h
 index 03b419a..353ffb0 100644
 --- a/arch/arm/plat-omap/include/dspbridge/mem.h
 +++ b/arch/arm/plat-omap/include/dspbridge/mem.h
 @@ -286,7 +286,7 @@
   *  Ensures:
   *  - pBaseAddr no longer points to a valid linear address.
   */
 -#define MEM_UnmapLinearAddress(pBaseAddr)
 +#define MEM_UnmapLinearAddress(pBaseAddr) {}

  /*
   *   MEM_ExtPhysPoolInit 
 diff --git a/drivers/dsp/bridge/wmd/io_sm.c b/drivers/dsp/bridge/wmd/io_sm.c
 index e35ce57..64eba5a 100644
 --- a/drivers/dsp/bridge/wmd/io_sm.c
 +++ b/drivers/dsp/bridge/wmd/io_sm.c
 @@ -1210,7 +1210,7 @@ static void InputChnl(struct IO_MGR *pIOMgr, struct 
 CHNL_OBJECT *pChnl,
   pChnlMgr-uWordSize;
   chnlId = IO_GetValue(pIOMgr-hWmdContext, struct SHM, sm, inputId);
   dwArg = IO_GetLong(pIOMgr-hWmdContext, struct SHM, sm, arg);
 - if (!(chnlId = 0) || !(chnlId  CHNL_MAXCHANNELS)) {
 + if (chnlId = CHNL_MAXCHANNELS) {
   /* Shouldn't be here: would indicate corrupted 

Re: [PATCH 2/2] omap: define _toggle_gpio_edge_triggering only for OMAP1

2010-01-25 Thread Kevin Hilman
Uwe Kleine-König u.kleine-koe...@pengutronix.de writes:

 The only usage of _toggle_gpio_edge_triggering is in an
 CONFIG_ARCH_OMAP1 is defined, too.

 This fixes a compiler warning:

   arch/arm/plat-omap/gpio.c:758: warning: '_toggle_gpio_edge_triggering' 
 defined but not used

 when compiling for ARCH_OMAP2, ARCH_OMAP3 or ARCH_OMAP4.

 Signed-off-by: Uwe Kleine-König u.kleine-koe...@pengutronix.de

Acked-by: Kevin Hilman khil...@deeprootsystems.com

 ---
  arch/arm/plat-omap/gpio.c |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

 diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
 index d17620c..d2422c7 100644
 --- a/arch/arm/plat-omap/gpio.c
 +++ b/arch/arm/plat-omap/gpio.c
 @@ -750,6 +750,7 @@ static inline void set_24xx_gpio_triggering(struct 
 gpio_bank *bank, int gpio,
  }
  #endif
  
 +#ifdef CONFIG_ARCH_OMAP1
  /*
   * This only applies to chips that can't do both rising and falling edge
   * detection at once.  For all other chips, this function is a noop.
 @@ -760,11 +761,9 @@ static void _toggle_gpio_edge_triggering(struct 
 gpio_bank *bank, int gpio)
   u32 l = 0;
  
   switch (bank-method) {
 -#ifdef CONFIG_ARCH_OMAP1
   case METHOD_MPUIO:
   reg += OMAP_MPUIO_GPIO_INT_EDGE;
   break;
 -#endif
  #ifdef CONFIG_ARCH_OMAP15XX
   case METHOD_GPIO_1510:
   reg += OMAP1510_GPIO_INT_CONTROL;
 @@ -787,6 +786,7 @@ static void _toggle_gpio_edge_triggering(struct gpio_bank 
 *bank, int gpio)
  
   __raw_writel(l, reg);
  }
 +#endif
  
  static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int 
 trigger)
  {
 -- 
 1.6.6
--
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] DSPBRIDGE: Fix memory leak in PROC_AutoStart()

2010-01-25 Thread Omar Ramirez Luna

Hi,

On 1/21/2010 7:03 AM, Ameya Palande wrote:

Signed-off-by: Ameya Palandeameya.pala...@nokia.com
---
  drivers/dsp/bridge/rmgr/proc.c |4 
  1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
index a75b64a..91ab64f 100644
--- a/drivers/dsp/bridge/rmgr/proc.c
+++ b/drivers/dsp/bridge/rmgr/proc.c
@@ -512,6 +512,10 @@ DSP_STATUS PROC_AutoStart(struct CFG_DEVNODE *hDevNode,
 No Exec file found \n);
}
  func_cont:
+   if (hProcObject-g_pszLastCoff) {
+   MEM_Free(hProcObject-g_pszLastCoff);
+   hProcObject-g_pszLastCoff = NULL;
+   }


Wouldn't be better to keep this inside PROC_Load in case of error?

Also MEM_Free checks for NULL.


MEM_FreeObject(hProcObject);
  func_end:
GT_1trace(PROC_DebugMask, GT_ENTER,


Regards,

Omar
--
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/RFC 1/3] OMAP3: VC: create common init code

2010-01-25 Thread Kevin Hilman
Kevin Hilman khil...@deeprootsystems.com writes:

 Move VC init code from PM core into separate VC core.

 No functional changes.

FYI... retracting this patch as Thara is working on the same reorg as part of
the SmartReflex rework.

Kevin

 ---
  arch/arm/mach-omap2/Makefile|3 +-
  arch/arm/mach-omap2/board-3430sdp.c |1 +
  arch/arm/mach-omap2/pm.h|   25 
  arch/arm/mach-omap2/pm34xx.c|   91 ---
  arch/arm/mach-omap2/vc.c|  116 
 +++
  arch/arm/mach-omap2/vc.h|   47 ++
  6 files changed, 166 insertions(+), 117 deletions(-)
  create mode 100644 arch/arm/mach-omap2/vc.c
  create mode 100644 arch/arm/mach-omap2/vc.h

 diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
 index 4ca93f1..4c6f017 100644
 --- a/arch/arm/mach-omap2/Makefile
 +++ b/arch/arm/mach-omap2/Makefile
 @@ -37,7 +37,8 @@ obj-$(CONFIG_ARCH_OMAP2)+= sdrc2xxx.o
  ifeq ($(CONFIG_PM),y)
  obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o
  obj-$(CONFIG_ARCH_OMAP24XX)  += sleep24xx.o
 -obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o cpuidle34xx.o
 +obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o cpuidle34xx.o \
 +vc.o
  obj-$(CONFIG_PM_DEBUG)   += pm-debug.o
  obj-$(CONFIG_OMAP_SMARTREFLEX)   += smartreflex.o
  endif
 diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
 b/arch/arm/mach-omap2/board-3430sdp.c
 index 7d68445..65ab469 100644
 --- a/arch/arm/mach-omap2/board-3430sdp.c
 +++ b/arch/arm/mach-omap2/board-3430sdp.c
 @@ -48,6 +48,7 @@
  #include mmc-twl4030.h
  #include pm.h
  #include omap3-opp.h
 +#include vc.h
  
  #define SDP3430_TS_GPIO_IRQ_SDPV13
  #define SDP3430_TS_GPIO_IRQ_SDPV22
 diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
 index 75aa685..78b5a06 100644
 --- a/arch/arm/mach-omap2/pm.h
 +++ b/arch/arm/mach-omap2/pm.h
 @@ -40,31 +40,6 @@ inline void omap3_pm_init_cpuidle(struct cpuidle_params 
 *cpuidle_board_params)
  }
  #endif
  
 -struct prm_setup_vc {
 - u16 clksetup;
 - u16 voltsetup_time1;
 - u16 voltsetup_time2;
 - u16 voltoffset;
 - u16 voltsetup2;
 -/* PRM_VC_CMD_VAL_0 specific bits */
 - u16 vdd0_on;
 - u16 vdd0_onlp;
 - u16 vdd0_ret;
 - u16 vdd0_off;
 -/* PRM_VC_CMD_VAL_1 specific bits */
 - u16 vdd1_on;
 - u16 vdd1_onlp;
 - u16 vdd1_ret;
 - u16 vdd1_off;
 -};
 -#ifdef CONFIG_PM
 -extern void omap3_pm_init_vc(struct prm_setup_vc *setup_vc);
 -#else
 -static inline void omap3_pm_init_vc(struct prm_setup_vc *setup_vc)
 -{
 -}
 -#endif
 -
  extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
  extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);
  
 diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
 index 190f25c..df437a5 100644
 --- a/arch/arm/mach-omap2/pm34xx.c
 +++ b/arch/arm/mach-omap2/pm34xx.c
 @@ -95,22 +95,6 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
  static struct powerdomain *core_pwrdm, *per_pwrdm;
  static struct powerdomain *cam_pwrdm;
  
 -static struct prm_setup_vc prm_setup = {
 - .clksetup = 0xff,
 - .voltsetup_time1 = 0xfff,
 - .voltsetup_time2 = 0xfff,
 - .voltoffset = 0xff,
 - .voltsetup2 = 0xff,
 - .vdd0_on = 0x30,/* 1.2v */
 - .vdd0_onlp = 0x20,  /* 1.0v */
 - .vdd0_ret = 0x1e,   /* 0.975v */
 - .vdd0_off = 0x00,   /* 0.6v */
 - .vdd1_on = 0x2c,/* 1.15v */
 - .vdd1_onlp = 0x20,  /* 1.0v */
 - .vdd1_ret = 0x1e,   /* .975v */
 - .vdd1_off = 0x00,   /* 0.6v */
 -};
 -
  static inline void omap3_per_save_context(void)
  {
   omap_gpio_save_context();
 @@ -1072,26 +1056,6 @@ int omap3_pm_set_suspend_state(struct powerdomain 
 *pwrdm, int state)
   return -EINVAL;
  }
  
 -void omap3_pm_init_vc(struct prm_setup_vc *setup_vc)
 -{
 - if (!setup_vc)
 - return;
 -
 - prm_setup.clksetup = setup_vc-clksetup;
 - prm_setup.voltsetup_time1 = setup_vc-voltsetup_time1;
 - prm_setup.voltsetup_time2 = setup_vc-voltsetup_time2;
 - prm_setup.voltoffset = setup_vc-voltoffset;
 - prm_setup.voltsetup2 = setup_vc-voltsetup2;
 - prm_setup.vdd0_on = setup_vc-vdd0_on;
 - prm_setup.vdd0_onlp = setup_vc-vdd0_onlp;
 - prm_setup.vdd0_ret = setup_vc-vdd0_ret;
 - prm_setup.vdd0_off = setup_vc-vdd0_off;
 - prm_setup.vdd1_on = setup_vc-vdd1_on;
 - prm_setup.vdd1_onlp = setup_vc-vdd1_onlp;
 - prm_setup.vdd1_ret = setup_vc-vdd1_ret;
 - prm_setup.vdd1_off = setup_vc-vdd1_off;
 -}
 -
  static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
  {
   struct power_state *pwrst;
 @@ -1228,60 +1192,5 @@ err2:
   return ret;
  }
  
 -static void __init configure_vc(void)
 -{
 -
 - prm_write_mod_reg((R_SRI2C_SLAVE_ADDR  

Re: [PATCHv2 1/1] omap3: cpuidle: Update statistics for correct state

2010-01-25 Thread Kevin Hilman
Sanjeev Premi pr...@ti.com writes:

 When 'enable_off_mode' is 0, the target power state for MPU
 and CORE was locally changed to PWRDM_POWER_RET but, the
 statistics are updated for idle state originally selected
 by the governor.

 This patch 'invalidates' the idle states that lead either of
 MPU or Core to PWRDM_POWER_OFF state when 'enable_off_mode'
 is '0'. The states are valid once 'enable_off_mode' is set
 to '1'.

 Added function next_valid_state() to check if current state
 is valid; else get the next valid state. It is called from
 omap3_enter_idle_bm().

 Signed-off-by: Sanjeev Premi pr...@ti.com

Hi Sanjeev,

I quite like this approach, but have a few minor comments.  First,
please fix the checkpatch errors and warnings, as well as a few minor
things below...

 ---
  arch/arm/mach-omap2/cpuidle34xx.c |   98 
 ++---
  arch/arm/mach-omap2/pm.h  |1 +
  arch/arm/mach-omap2/pm34xx.c  |4 ++
  3 files changed, 95 insertions(+), 8 deletions(-)

 diff --git a/arch/arm/mach-omap2/cpuidle34xx.c 
 b/arch/arm/mach-omap2/cpuidle34xx.c
 index fdfa1d5..308865c 100644
 --- a/arch/arm/mach-omap2/cpuidle34xx.c
 +++ b/arch/arm/mach-omap2/cpuidle34xx.c
 @@ -45,6 +45,8 @@
  #define OMAP3_STATE_C6 5 /* C6 - MPU OFF + Core RET */
  #define OMAP3_STATE_C7 6 /* C7 - MPU OFF + Core OFF */
  
 +#define OMAP3_STATE_MAX OMAP3_STATE_C7
 +
  struct omap3_processor_cx {
   u8 valid;
   u8 type;
 @@ -128,13 +130,6 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
   local_irq_disable();
   local_fiq_disable();
  
 - if (!enable_off_mode) {
 - if (mpu_state  PWRDM_POWER_RET)
 - mpu_state = PWRDM_POWER_RET;
 - if (core_state  PWRDM_POWER_RET)
 - core_state = PWRDM_POWER_RET;
 - }
 -
   pwrdm_set_next_pwrst(mpu_pd, mpu_state);
   pwrdm_set_next_pwrst(core_pd, core_state);
  
 @@ -164,6 +159,65 @@ return_sleep_time:
   return (u32)timespec_to_ns(ts_idle)/1000;
  }
  
 +
 +/* next_valid_state - Find next valid c-state
 + * @dev: cpuidle device
 + * @state: Currently selected c-state
 + *
 + * If the current state is valid, it is returned back to the caller.
 + * Else, this function searches for a lower c-state which is still
 + * valid (as defined in omap3_power_states[]).
 + */

Please fix kerneldoc style.   Opening comment should be '/**'

 +static struct cpuidle_state* next_valid_state(struct cpuidle_device *dev,
 + struct cpuidle_state *curr)
 +{
 + struct cpuidle_state *next = NULL;
 + struct omap3_processor_cx *cx;
 +
 + cx = (struct omap3_processor_cx *)cpuidle_get_statedata(curr);
 +
 + /* Check if current state is valid */
 + if (cx-valid) {
 + next = curr;

could just return curr here

 + }
 + else {
 + u8 idx = OMAP3_STATE_MAX;
 +
 + /* Reach the current state starting at highest C-state */
 + for (; idx = OMAP3_STATE_C1; idx--) {
 + if (dev-states[idx] == curr) {
 + next = dev-states[idx];
 + break;
 + }
 + }
 +
 + /*
 +  * Should never hit this condition.
 +  */
 + BUG_ON(next == NULL);

This shouldn't trigger a panic.  Please fail more cleanly using WARN_ON()

 + /* Drop to next valid state.
 +  * Start search from the next (lower) state.
 +  */

fix multiline comment.  Should start with '/*' on its own line.
(c.f. Documentation/CodingStyle, search for 'multi-line')

 + idx--;
 + for (; idx = OMAP3_STATE_C1; idx--) {
 + if (((struct omap3_processor_cx *)
 + cpuidle_get_statedata(
 + dev-states[idx]))-valid) {
 + next = dev-states[idx];
 + break;
 + }
 + }

Due to line-wrapping etc., this has readabiliyt problems.  Consider this
instead:

for (; idx = OMAP3_STATE_C1; idx--) {
struct omap3_processor_cx *cx;

cx = cpuidle_get_statedata(dev-states[idx]);
if (cx-valid) {
next = dev-states[idx];
break;
}
}

 + /*
 +  * C1 and C2 are always valid.
 +  * So, no need to check for 'next==NULL' outside this loop.
 +  */
 + }
 +
 + return next;
 +}
 +
 +
  /**
   * omap3_enter_idle_bm - Checks for any bus activity
   * @dev: cpuidle device
 @@ -176,7 +230,7 @@ return_sleep_time:
  static int omap3_enter_idle_bm(struct cpuidle_device *dev,
  struct cpuidle_state *state)
  {
 - struct cpuidle_state 

Re: [PATCH 8/8] OMAP3 PM: Support to enable disable OSWR feature from pm debug fs

2010-01-25 Thread Kevin Hilman
Gopinath, Thara th...@ti.com writes:

-Original Message-
From: Kevin Hilman [mailto:khil...@deeprootsystems.com]
Sent: Saturday, January 23, 2010 6:12 AM
To: Gopinath, Thara
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH 8/8] OMAP3 PM: Support to enable disable OSWR feature 
from pm debug fs

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

 This patch adds enable_oswr flag in pm debug fs to enable
 disable OSWR feature.
 To enable this feature:
echo 1  path/debug/pm_debug/enable_oswr
 To disable this feature
echo 0  path/debug/pm_debug/enable_oswr

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

I don't like this approach since it leads to incorrect CPUidle statistics.

Sanjeev has proposed a different approach[1] (which I still need to
review/merge) which just invalidates particular CPUidle states and
then lets the CPUidle enter hook only pick a valid state.

This then will work for the enable_off_mode support and the enable_oswr 
support
as well as anything else we can dream up down the road.

 Hi Kevin,

 Yes I agree with you.. I did not implement this for OSWR as I did
 not see it in you pm branch. I thought let the first set of patches
 for OSWR be merged in and then when we change enable_off_mode we can
 change enable_oswr also. Is there an issue with this?

I would rather merge Sanjeev's patch first.  I just reviewed it and
asked him for a few minor fixes and then I'd like to merge it.

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: [alsa-devel] [PATCHv2 5/6] ASoC: OMAP4: Add support for McPDM

2010-01-25 Thread Candelaria Villareal, Jorge
Liam Girdwood wrote:

 On Fri, 2010-01-22 at 17:15 -0600, Candelaria Villareal, Jorge wrote:
  McPDM is the interface between Phoenix audio codec
  and the OMAP4430 processor. It enables data to be transfered
  to/from Phoenix at sample rates of 88.4 or 96 KHz.
 
  Signed-off-by: Jorge Eduardo Candelaria x0107...@ti.com
  Signed-off-by: Margarita Olaya x0080...@ti.com

 It initially looks like a some of this can be called directly
 as DAI ops
 rather than by the machine driver.

Could you explain a little further?


  ---
   sound/soc/omap/Kconfig  |3 +
   sound/soc/omap/Makefile |2 +
   sound/soc/omap/mcpdm.c  |  474
 +++
   sound/soc/omap/mcpdm.h  |  152 +++
   4 files changed, 631 insertions(+), 0 deletions(-)
   create mode 100644 sound/soc/omap/mcpdm.c
   create mode 100644 sound/soc/omap/mcpdm.h
 
  diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
  index 61952aa..b96e9d8 100644
  --- a/sound/soc/omap/Kconfig
  +++ b/sound/soc/omap/Kconfig
  @@ -6,6 +6,9 @@ config SND_OMAP_SOC_MCBSP
  tristate
  select OMAP_MCBSP
 
  +config SND_OMAP_SOC_MCPDM
  +   tristate
  +
   config SND_OMAP_SOC_N810
  tristate SoC Audio support for Nokia N810
  depends on SND_OMAP_SOC  MACH_NOKIA_N810  I2C
  diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
  index 3db8a6c..bf8b388 100644
  --- a/sound/soc/omap/Makefile
  +++ b/sound/soc/omap/Makefile
  @@ -1,9 +1,11 @@
   # OMAP Platform Support
   snd-soc-omap-objs := omap-pcm.o
   snd-soc-omap-mcbsp-objs := omap-mcbsp.o
  +snd-soc-omap-mcpdm-objs := mcpdm.o
 
   obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o
   obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o
  +obj-$(CONFIG_SND_OMAP_SOC_MCPDM) += snd-soc-omap-mcpdm.o
 
   # OMAP Machine Support
   snd-soc-n810-objs := n810.o
  diff --git a/sound/soc/omap/mcpdm.c b/sound/soc/omap/mcpdm.c
  new file mode 100644
  index 000..2bc5acd
  --- /dev/null
  +++ b/sound/soc/omap/mcpdm.c
  @@ -0,0 +1,474 @@
  +/*
  + * mcpdm.c  --  McPDM interface driver
  + *
  + * Author: Jorge Eduardo Candelaria x0107...@ti.com
  + * Copyright (C) 2009 - Texas Instruments, Inc.
  + *
  + * This program is free software; you can redistribute it and/or
  + * modify it under the terms of the GNU General Public License
  + * version 2 as published by the Free Software Foundation.
  + *
  + * This program is distributed in the hope that it will be
 useful, but
  + * WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 See the GNU
  + * General Public License for more details.
  + *
  + * You should have received a copy of the GNU General
 Public License
  + * along with this program; if not, write to the Free Software
  + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  + * 02110-1301 USA
  + *
  + */
  +
  +#include linux/module.h
  +#include linux/init.h
  +#include linux/device.h
  +#include linux/platform_device.h
  +#include linux/wait.h
  +#include linux/interrupt.h
  +#include linux/err.h
  +#include linux/clk.h
  +#include linux/delay.h
  +#include linux/io.h
  +#include linux/irq.h
  +
  +#include mcpdm.h
  +
  +static struct omap_mcpdm *mcpdm;
  +
  +static inline void omap_mcpdm_write(u16 reg, u32 val)
  +{
  +   __raw_writel(val, mcpdm-io_base + reg);
  +}
  +
  +static inline int omap_mcpdm_read(u16 reg)
  +{
  +   return __raw_readl(mcpdm-io_base + reg);
  +}
  +
  +void omap_mcpdm_reg_dump(void)
  +{
  +   dev_dbg(mcpdm-dev, ***\n);
  +   dev_dbg(mcpdm-dev, IRQSTATUS_RAW:  0x%04x\n,
  +   omap_mcpdm_read(MCPDM_IRQSTATUS_RAW));
  +   dev_dbg(mcpdm-dev, IRQSTATUS:  0x%04x\n,
  +   omap_mcpdm_read(MCPDM_IRQSTATUS));
  +   dev_dbg(mcpdm-dev, IRQENABLE_SET:  0x%04x\n,
  +   omap_mcpdm_read(MCPDM_IRQENABLE_SET));
  +   dev_dbg(mcpdm-dev, IRQENABLE_CLR:  0x%04x\n,
  +   omap_mcpdm_read(MCPDM_IRQENABLE_CLR));
  +   dev_dbg(mcpdm-dev, IRQWAKE_EN: 0x%04x\n,
  +   omap_mcpdm_read(MCPDM_IRQWAKE_EN));
  +   dev_dbg(mcpdm-dev, DMAENABLE_SET: 0x%04x\n,
  +   omap_mcpdm_read(MCPDM_DMAENABLE_SET));
  +   dev_dbg(mcpdm-dev, DMAENABLE_CLR:  0x%04x\n,
  +   omap_mcpdm_read(MCPDM_DMAENABLE_CLR));
  +   dev_dbg(mcpdm-dev, DMAWAKEEN:  0x%04x\n,
  +   omap_mcpdm_read(MCPDM_DMAWAKEEN));
  +   dev_dbg(mcpdm-dev, CTRL:  0x%04x\n,
  +   omap_mcpdm_read(MCPDM_CTRL));
  +   dev_dbg(mcpdm-dev, DN_DATA:  0x%04x\n,
  +   omap_mcpdm_read(MCPDM_DN_DATA));
  +   dev_dbg(mcpdm-dev, UP_DATA: 0x%04x\n,
  +   omap_mcpdm_read(MCPDM_UP_DATA));
  +   dev_dbg(mcpdm-dev, FIFO_CTRL_DN: 0x%04x\n,
  +   omap_mcpdm_read(MCPDM_FIFO_CTRL_DN));
  +   

RE: [alsa-devel] [PATCHv2 6/6] ASoC: OMAP4: Add McPDM platform driver

2010-01-25 Thread Candelaria Villareal, Jorge
From: Liam Girdwood wrote:
 On Fri, 2010-01-22 at 17:15 -0600, Candelaria Villareal, Jorge wrote:
  From: Misael Lopez Cruz x0052...@ti.com
  
  McPDM platform driver is configured to use sDMA in order to transfer
  to/from memory. Support for interfacing with ABE will be 
 added later.
  
  McPDM dai currently supports up to 4 downlink channels and 2 uplink
  channels simultaneously, as well as 88.2 and 96 KHz, and a sample
  size of 32 bits.
  
  Signed-off-by: Misael Lopez Cruz x0052...@ti.com
  Signed-off-by: Margarita Olaya x0080...@ti.com
  Signed-off-by: Jorge Eduardo Candelaria x0107...@ti.com
  ---
   sound/soc/omap/Makefile |2 +-
   sound/soc/omap/omap-mcpdm.c |  250 
 +++
   sound/soc/omap/omap-mcpdm.h |   29 +
   3 files changed, 280 insertions(+), 1 deletions(-)
   create mode 100644 sound/soc/omap/omap-mcpdm.c
   create mode 100644 sound/soc/omap/omap-mcpdm.h
  
  diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
  index bf8b388..d6382fa 100644
  --- a/sound/soc/omap/Makefile
  +++ b/sound/soc/omap/Makefile
  @@ -1,7 +1,7 @@
   # OMAP Platform Support
   snd-soc-omap-objs := omap-pcm.o
   snd-soc-omap-mcbsp-objs := omap-mcbsp.o
  -snd-soc-omap-mcpdm-objs := mcpdm.o
  +snd-soc-omap-mcpdm-objs := mcpdm.o omap-mcpdm.o
   
   obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o
   obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o
  diff --git a/sound/soc/omap/omap-mcpdm.c 
 b/sound/soc/omap/omap-mcpdm.c
  new file mode 100644
  index 000..180cca6
  --- /dev/null
  +++ b/sound/soc/omap/omap-mcpdm.c
  @@ -0,0 +1,250 @@
  +/*
  + * omap-mcpdm.c  --  OMAP ALSA SoC DAI driver using McPDM port
  + *
  + * Copyright (C) 2009 Texas Instruments
  + *
  + * Author: Misael Lopez Cruz x0052...@ti.com
  + * Contact: Jorge Eduardo Candelaria x0107...@ti.com
  + *  Margarita Olaya magi.ol...@ti.com
  + *
  + * This program is free software; you can redistribute it and/or
  + * modify it under the terms of the GNU General Public License
  + * version 2 as published by the Free Software Foundation.
  + *
  + * This program is distributed in the hope that it will be 
 useful, but
  + * WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 See the GNU
  + * General Public License for more details.
  + *
  + * You should have received a copy of the GNU General 
 Public License
  + * along with this program; if not, write to the Free Software
  + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  + * 02110-1301 USA
  + *
  + */
  +
  +#include linux/init.h
  +#include linux/module.h
  +#include linux/device.h
  +#include sound/core.h
  +#include sound/pcm.h
  +#include sound/pcm_params.h
  +#include sound/initval.h
  +#include sound/soc.h
  +
  +#include mach/control.h
  +#include mach/dma.h
  +#include mach/mcbsp.h
  +#include mcpdm.h
  +#include omap-mcpdm.h
  +#include omap-pcm.h
  +
  +struct omap_mcpdm_data {
  +   struct omap_mcpdm_link *links;
  +   int active;
  +};
  +
  +static struct omap_mcpdm_link omap_mcpdm_links[] = {
  +   /* downlink */
  +   {
  +   .irq_mask = MCPDM_DN_IRQ_EMPTY | MCPDM_DN_IRQ_FULL,
  +   .threshold = 1,
  +   .format = PDMOUTFORMAT_LJUST,
  +   },
  +   /* uplink */
  +   {
  +   .irq_mask = MCPDM_UP_IRQ_EMPTY | MCPDM_UP_IRQ_FULL,
  +   .threshold = 1,
  +   .format = PDMOUTFORMAT_LJUST,
  +   },
  +};
  +
  +static struct omap_mcpdm_data mcpdm_data = {
  +   .links = omap_mcpdm_links,
  +   .active = 0,
  +};
  +
  +/*
  + * Stream DMA parameters
  + */
  +static struct omap_pcm_dma_data omap_mcpdm_dai_dma_params[] = {
  +   {
  +   .name = Audio downlink,
  +   .dma_req = OMAP44XX_DMA_MCPDM_DL,
  +   .data_type = OMAP_DMA_DATA_TYPE_S32,
  +   .sync_mode = OMAP_DMA_SYNC_PACKET,
  +   .packet_size = 16,
  +   .port_addr = OMAP44XX_MCPDM_L3_BASE + MCPDM_DN_DATA,
  +   },
  +   {
  +   .name = Audio uplink,
  +   .dma_req = OMAP44XX_DMA_MCPDM_UP,
  +   .data_type = OMAP_DMA_DATA_TYPE_S32,
  +   .sync_mode = OMAP_DMA_SYNC_PACKET,
  +   .packet_size = 16,
  +   .port_addr = OMAP44XX_MCPDM_L3_BASE + MCPDM_UP_DATA,
  +   },
  +};
  +
  +static int omap_mcpdm_dai_startup(struct snd_pcm_substream 
 *substream,
  + struct snd_soc_dai *dai)
  +{
  +   struct snd_soc_pcm_runtime *rtd = substream-private_data;
  +   struct snd_soc_dai *cpu_dai = rtd-dai-cpu_dai;
  +   int err = 0;
  +
  +   if (!cpu_dai-active)
  +   err = omap_mcpdm_request();
 
 Will anything else use this hw interface other than ALSA audio ?
 If not, the request is probably better in the machine driver probe().

omap_mcpdm_request will enable the functional clock. Isn't it better
for the clock to be enabled only when is about to get used?

 
  +
  +   return err;
  +}
  +
  +static void 

Re: [PATCH 2/2] omap: define _toggle_gpio_edge_triggering only for OMAP1

2010-01-25 Thread Tony Lindgren
* Kevin Hilman khil...@deeprootsystems.com [100125 10:20]:
 Uwe Kleine-König u.kleine-koe...@pengutronix.de writes:
 
  The only usage of _toggle_gpio_edge_triggering is in an
  CONFIG_ARCH_OMAP1 is defined, too.
 
  This fixes a compiler warning:
 
  arch/arm/plat-omap/gpio.c:758: warning: '_toggle_gpio_edge_triggering' 
  defined but not used
 
  when compiling for ARCH_OMAP2, ARCH_OMAP3 or ARCH_OMAP4.
 
  Signed-off-by: Uwe Kleine-König u.kleine-koe...@pengutronix.de
 
 Acked-by: Kevin Hilman khil...@deeprootsystems.com

Ack, I'll add this into omap-fixes for the -rc cycle.

Regards,

Tony
 
  ---
   arch/arm/plat-omap/gpio.c |4 ++--
   1 files changed, 2 insertions(+), 2 deletions(-)
 
  diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
  index d17620c..d2422c7 100644
  --- a/arch/arm/plat-omap/gpio.c
  +++ b/arch/arm/plat-omap/gpio.c
  @@ -750,6 +750,7 @@ static inline void set_24xx_gpio_triggering(struct 
  gpio_bank *bank, int gpio,
   }
   #endif
   
  +#ifdef CONFIG_ARCH_OMAP1
   /*
* This only applies to chips that can't do both rising and falling edge
* detection at once.  For all other chips, this function is a noop.
  @@ -760,11 +761,9 @@ static void _toggle_gpio_edge_triggering(struct 
  gpio_bank *bank, int gpio)
  u32 l = 0;
   
  switch (bank-method) {
  -#ifdef CONFIG_ARCH_OMAP1
  case METHOD_MPUIO:
  reg += OMAP_MPUIO_GPIO_INT_EDGE;
  break;
  -#endif
   #ifdef CONFIG_ARCH_OMAP15XX
  case METHOD_GPIO_1510:
  reg += OMAP1510_GPIO_INT_CONTROL;
  @@ -787,6 +786,7 @@ static void _toggle_gpio_edge_triggering(struct 
  gpio_bank *bank, int gpio)
   
  __raw_writel(l, reg);
   }
  +#endif
   
   static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int 
  trigger)
   {
  -- 
  1.6.6
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] omap-fixes for 2.6.33-rc5

2010-01-25 Thread Tony Lindgren
Linus,

Please pull omap-fixes from:

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

Regards,

Tony


The following changes since commit 92dcffb916d309aa01778bf8963a6932e4014d07:
  Linus Torvalds (1):
Linux 2.6.33-rc5

are available in the git repository at:

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

Kevin Hilman (1):
  OMAP: timekeeping: time should not stop during suspend

Manjunatha GK (1):
  OMAP3: PM debug: fix build error when !CONFIG_DEBUG_FS

Olof Johansson (1):
  omap: Enable GPMC clock in gpmc_init

Paul Walmsley (1):
  OMAP1 clock: fix for BUG: spinlock lockup on CPU#0

Peter Ujfalusi (1):
  OMAP3: PM: Enable wake-up from McBSP2, 3 and 4 modules

Rajendra Nayak (2):
  OMAP4: PRCM: Fix the base address for CHIRONSS reg defines
  OMAP4: clocks: Fix the clksel_rate struct DPLL divs

Roel Kluin (2):
  OMAP: dma_chan[lch_head].flag  OMAP_DMA_ACTIVE tested twice in 
omap_dma_unlink_lch()
  OMAP: omap3_pm_get_suspend_state() error ignored in pwrdm_suspend_get()

Russell King (1):
  OMAP3: clock: Remove unnecessarily .init initializers from OMAP3 clocks

Sanjeev Premi (1):
  OMAP3: PM: Remove duplicate code blocks

Sergio Aguirre (1):
  PM debug: Fix warning when no CONFIG_DEBUG_FS

Sripathy, Vishwanath (1):
  OMAP3: PM: Removing redundant and potentially dangerous PRCM configration

Subramani Venkatesh (1):
  OMAP3: PM: DSS PM_WKEN to refill DMA

Tero Kristo (7):
  OMAP3: PM: Ack pending interrupts before entering suspend
  OMAP3: PM: Enable system control module autoidle
  OMAP3: PM: Disable interrupt controller AUTOIDLE before WFI
  OMAP3: CPUidle: Fixed timer resolution
  OMAP3: Fixed ARM aux ctrl register save/restore
  OMAP3: PM: Force write last pad config register into save area
  OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer

Thara Gopinath (1):
  OMAP3: hwmod: Adding flag to prevent caching of sysconfig register.

Tony Lindgren (6):
  omap: Fix cmdline muxing
  omap: Fix functions for dynamic remuxing of pins
  omap3: Fix cpu detection
  Merge branch 'for_2.6.33rc_d' of git://git.pwsan.com/linux-2.6 into 
omap-fixes-for-linus
  Merge branch 'pm-fixes' of master.kernel.org:/.../khilman/linux-omap-pm 
into omap-fixes-for-linus
  Merge branch 'omap-fixes' into omap-fixes-for-linus

 arch/arm/mach-omap1/clock.c  |6 +-
 arch/arm/mach-omap2/clock34xx_data.c |4 --
 arch/arm/mach-omap2/clock44xx_data.c |   62 +-
 arch/arm/mach-omap2/cpuidle34xx.c|2 +-
 arch/arm/mach-omap2/gpmc.c   |2 +
 arch/arm/mach-omap2/id.c |   41 ++---
 arch/arm/mach-omap2/irq.c|   18 +++
 arch/arm/mach-omap2/mux.c|   27 ++-
 arch/arm/mach-omap2/mux.h|   24 ++
 arch/arm/mach-omap2/omap_hwmod.c |3 +-
 arch/arm/mach-omap2/pm-debug.c   |   12 +++---
 arch/arm/mach-omap2/pm.h |8 +++-
 arch/arm/mach-omap2/pm34xx.c |   47 +++-
 arch/arm/mach-omap2/prcm.c   |   11 -
 arch/arm/mach-omap2/prm.h|2 +
 arch/arm/mach-omap2/prm44xx.h|   32 +++---
 arch/arm/mach-omap2/sleep34xx.S  |   13 --
 arch/arm/plat-omap/common.c  |   26 +++
 arch/arm/plat-omap/dma.c |2 +-
 arch/arm/plat-omap/dmtimer.c |   13 +
 arch/arm/plat-omap/include/plat/cpu.h|1 +
 arch/arm/plat-omap/include/plat/irqs.h   |3 +
 arch/arm/plat-omap/include/plat/omap_hwmod.h |1 +
 23 files changed, 229 insertions(+), 131 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RESEND][PATCH] DSPBRIDGE: cache operation against kernel address instead of user's

2010-01-25 Thread Omar Ramirez Luna

From: Hiroshi DOYU hiroshi.d...@nokia.com

Based on the discussion:
  http://www.spinics.net/lists/arm-kernel/msg72810.html

HACK: export follow_page() for dspbridge cache operation

Signed-off-by: Hiroshi DOYU hiroshi.d...@nokia.com
---
 drivers/dsp/bridge/rmgr/proc.c |   68 
++-

 mm/memory.c|1 +
 2 files changed, 53 insertions(+), 16 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
index 491661f..3e05281 100644
--- a/drivers/dsp/bridge/rmgr/proc.c
+++ b/drivers/dsp/bridge/rmgr/proc.c
@@ -574,8 +574,43 @@ DSP_STATUS PROC_EnumNodes(DSP_HPROCESSOR 
hProcessor, OUT DSP_HNODE *aNodeTab,

return status;
 }

+/* Cache operation against kernel address instead of users */
+static int memory_sync_page(struct vm_area_struct *vma, unsigned long 
start,

+   ssize_t len, enum DSP_FLUSHTYPE ftype)
+{
+   struct page *page;
+   void *kaddr;
+   unsigned long offset;
+   ssize_t rest;
+
+   while (len) {
+   page = follow_page(vma, start, FOLL_GET);
+   if (!page) {
+   pr_err(%s: no page for %08lx\n, __func__, start);
+   return -EINVAL;
+   } else if (IS_ERR(page)) {
+   pr_err(%s: err page for %08lx(%lu)\n, __func__, start,
+  IS_ERR(page));
+   return IS_ERR(page);
+   }
+
+   offset = start  ~PAGE_MASK;
+   kaddr = page_address(page) + offset;
+   rest = min_t(ssize_t, PAGE_SIZE - offset, len);
+
+   MEM_FlushCache(kaddr, rest, ftype);
+
+   put_page(page);
+   len -= rest;
+   start += rest;
+   }
+
+   return 0;
+}
+
 /* Check if the given area blongs to process virtul memory address 
space */

-static int memory_check_vma(unsigned long start, u32 len)
+static int memory_sync_vma(unsigned long start, u32 len,
+  enum DSP_FLUSHTYPE ftype)
 {
int err = 0;
unsigned long end;
@@ -585,14 +620,19 @@ static int memory_check_vma(unsigned long start, 
u32 len)

if (end = start)
return -EINVAL;

-   down_read(current-mm-mmap_sem);
-
while ((vma = find_vma(current-mm, start)) != NULL) {
+   ssize_t size;

-   if (vma-vm_start  start) {
-   err = -EINVAL;
+   if (vma-vm_flags  (VM_IO | VM_PFNMAP))
+   return -EINVAL;
+
+   if (vma-vm_start  start)
+   return -EINVAL;
+
+   size = min_t(ssize_t, vma-vm_end - start, len);
+   err = memory_sync_page(vma, start, size, ftype);
+   if (err)
break;
-   }

if (end = vma-vm_end)
break;
@@ -603,8 +643,6 @@ static int memory_check_vma(unsigned long start, u32 
len)

if (!vma)
err = -EINVAL;

-   up_read(current-mm-mmap_sem);
-
return err;
 }

@@ -629,17 +667,15 @@ static DSP_STATUS proc_memory_sync(DSP_HPROCESSOR 
hProcessor, void *pMpuAddr,

goto err_out;
}

-   if (memory_check_vma((u32)pMpuAddr, ulSize)) {
-   GT_3trace(PROC_DebugMask, GT_7CLASS,
- %s: InValid address parameters\n,
- __func__, pMpuAddr, ulSize);
+   down_read(current-mm-mmap_sem);
+
+   if (memory_sync_vma((u32)pMpuAddr, ulSize, FlushMemType)) {
+   pr_err(%s: InValid address parameters %p %x\n,
+  __func__, pMpuAddr, ulSize);
status = DSP_EHANDLE;
-   goto err_out;
}

-   (void)SYNC_EnterCS(hProcLock);
-   MEM_FlushCache(pMpuAddr, ulSize, FlushMemType);
-   (void)SYNC_LeaveCS(hProcLock);
+   up_read(current-mm-mmap_sem);

 err_out:
GT_2trace(PROC_DebugMask, GT_ENTER,
diff --git a/mm/memory.c b/mm/memory.c
index 6ab19dd..377be88 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1228,6 +1228,7 @@ no_page_table:
return ERR_PTR(-EFAULT);
return page;
 }
+EXPORT_SYMBOL_GPL(follow_page);

 int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
 unsigned long start, int nr_pages, unsigned int gup_flags,
--
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


[RESEND][PATCH 4/5] DSPBRIDGE: Remove multiple initializations of REG module

2010-01-25 Thread Omar Ramirez Luna

From cab08d7241af701397f6e78723d8e2125c3f2306 Mon Sep 17 00:00:00 2001
From: Omar Ramirez Luna omar.rami...@ti.com
Date: Thu, 21 Jan 2010 20:34:20 -0600
Subject: [PATCH 08/15] DSPBRIDGE: Remove multiple initializations of REG 
module


REG module should be only initialized by services layer.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/rmgr/dbdcd.c |9 +
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/dbdcd.c 
b/drivers/dsp/bridge/rmgr/dbdcd.c

index cb244f4..caa57f1 100644
--- a/drivers/dsp/bridge/rmgr/dbdcd.c
+++ b/drivers/dsp/bridge/rmgr/dbdcd.c
@@ -350,7 +350,6 @@ void DCD_Exit(void)

cRefs--;
if (cRefs == 0) {
-   REG_Exit();
COD_Exit();
}

@@ -821,7 +820,6 @@ DSP_STATUS DCD_GetLibraryName(IN struct DCD_MANAGER 
*hDcdMgr,

  */
 bool DCD_Init(void)
 {
-   bool fInitREG;
bool fInitCOD;
bool fInit = true;

@@ -833,18 +831,13 @@ bool DCD_Init(void)
if (cRefs == 0) {
/* Initialize required modules. */
fInitCOD = COD_Init();
-   fInitREG = REG_Init();

-   if (!fInitCOD || !fInitREG) {
+   if (!fInitCOD) {
fInit = false;
GT_0trace(curTrace, GT_6CLASS, DCD_Init failed\n);
/* Exit initialized modules. */
if (fInitCOD)
COD_Exit();
-
-   if (fInitREG)
-   REG_Exit();
-
}
}

--
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] OMAP3: SDRC : Errata 1.176 Fix - Accesses to DDR stall in SDRC after a Warm-reset

2010-01-25 Thread Paul Walmsley
Hello Teerth,

On Mon, 25 Jan 2010, Reddy, Teerth wrote:

  From: Paul Walmsley [mailto:p...@pwsan.com]
 
  I wonder if this also needs to make sure that all the other system
  initiators are mute before continuing, for the same reason cited in commit
  18862cbe47e37beba98f22c088fbe6fe029df889 ?  I suppose that, for example,
  if an interrupt occurs on the IVA2.2 or the DMA controller tries to access
  the SDRC, it would hopefully only wedge those initiators and not the whole
  chip?
  Do you think we need to take care of the system initiators if we are 
 disabling all the interrupts before going for a warm reset?

Are you disabling _all_ the interrupts, or just the MPU's interrupts?  
Even if you did disable all of the system interrupts, couldn't DMA be 
ongoing from/to another system initiator, independently of interrupts?

 I think this doesn't seem to hold good here.

You may be right, but I'd like you to describe your reasoning on this 
point. 

 Please let me know if you understanding is wrong.

My concerns here are twofold:

1. If other system initiators are interacting with the SDRC during this 
process, is there a danger that the interconnect could enter a state that 
would prevent the warm reset from occurring, thus wedging the system?

2. When the warm-reset occurs, will it also completely reset other 
initiators that may be wedged waiting for some SDRC access to complete?


- 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] DSPBRIDGE: Various compile warning fixes

2010-01-25 Thread mika.kukkonen
 

-Original Message-
From: Palande Ameya (Nokia-D/Helsinki) 
Sent: 25 January, 2010 19:03
To: ext Omar Ramirez Luna
Cc: linux-omap@vger.kernel.org; Menon, Nishanth; Chitriki 
Rudramuni, Deepak; Kukkonen Mika (Nokia-D/Helsinki)
Subject: RE: [PATCH] DSPBRIDGE: Various compile warning fixes

Hi Omar,

Sorry for the top posthing :(
I guess the original patch had empty if() bodies. 
That comment can be removed :)

No, the empty if() bodies fix is the chunk that modifies
those macros:

 -#define DBC_Assert(exp)
 -#define DBC_Require(exp)
 -#define DBC_Ensure(exp)
 +#define DBC_Assert(exp) {}
 +#define DBC_Require(exp) {}
 +#define DBC_Ensure(exp) {}
(...)
 -#define DBG_Exit(void)
 +#define DBG_Exit(void) do {} while (0)

etc. Those are used in code as

if (whatever)
   do_stuff();
else
   DBC_Assert(exp);
do_something_else();

and you really want to DBC_Assert() not to be totally
empty, but instead evaluate to an empty statement block.

--MiKu--
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 0/4] twl4030 threaded_irq support

2010-01-25 Thread David Brownell
On Monday 14 December 2009, Felipe Balbi wrote:
 move twl4030 children to threaded irq.
 
 Felipe Balbi (4):
   input: keyboard: twl4030: move to request_threaded_irq
   input: misc: twl4030: move to request_threaded_irq
   rtc: twl4030: move to request_threaded_irq
   usb: otg: twl4030: move to request_threaded_irq

But nothing in drivers/mfd ... the entry to the whole stack?

Did the threaded IRQ stuff ever get set up so that the top
level IRQ thread didn't have to hand off to another thread
each time?  (That's how the current stuff works.  One thread
calling out to each handler.)

If so, I'd like to see that be used here, rather than needlessly
spend all those pages on mostly-unused stacks.  


 
  drivers/input/keyboard/twl4030_keypad.c |   11 ++-
  drivers/input/misc/twl4030-pwrbutton.c  |   12 +---
  drivers/rtc/rtc-twl4030.c   |   10 +-
  drivers/usb/otg/twl4030-usb.c   |   10 +-
  4 files changed, 5 insertions(+), 38 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: [RFC/PATCH 0/4] twl4030 threaded_irq support

2010-01-25 Thread David Brownell
On Monday 25 January 2010, David Brownell wrote:
 Did the threaded IRQ stuff ever get set up so that the top
 level IRQ thread didn't have to hand off to another thread
 each time?  (That's how the current stuff works.  One thread
 calling out to each handler.)

Yes:  set_irq_nested_thread().  Looks like the toplevel IRQ
demux (in drivers/mfd/twl*irq*c) should use that, along with
the ONESHOT flag and (eventually) bus_lock stuff.

All the key parts that were missing a few years ago now seem
to be present.  But, not yet in use here.  :)

- Dave

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