RE: [PATCH v3] ARM: OMAP: i2c: fix interrupt flood during resume

2012-10-15 Thread Kalle Jokiniemi
Hi,

pe, 2012-10-12 kello 14:46 +, Strashko, Grygorii kirjoitti:
 Hi Kevin,
 
 yep, [1] is the same fix - thanks. 
 
 Hi Kalle,
 
 i've applied these changes and PM runtime fix on top of 
 git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git 
 (omap2plus_defconfig)
 Could you check it with your use case, pls? (just to be sure that idea is 
 right)

Odd, it's not working. I'll add some debug prints to see what happens
there.

- Kalle

 
 diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
 index a0e49f6..cb09e20 100644
 --- a/drivers/i2c/busses/i2c-omap.c
 +++ b/drivers/i2c/busses/i2c-omap.c
 @@ -586,6 +586,9 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg 
 msgs[], int num)
 if (IS_ERR_VALUE(r))
 goto out;
  
 +   /* We have the bus, enable IRQ */
 +   enable_irq(dev-irq);
 +
 r = omap_i2c_wait_for_bb(dev);
 if (r  0)
 goto out;
 @@ -606,6 +609,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg 
 msgs[], int num)
 r = num;
  
 omap_i2c_wait_for_bb(dev);
 +   disable_irq(dev-irq);
  out:
 pm_runtime_put(dev-dev);
 return r;
 @@ -1060,6 +1064,9 @@ omap_i2c_probe(struct platform_device *pdev)

 omap_i2c_isr;
 r = request_irq(dev-irq, isr, IRQF_NO_SUSPEND, pdev-name, dev);
  
 +   /* We enable IRQ only when request for I2C from master */
 +disable_irq(dev-irq);
 +
 if (r) {
 dev_err(dev-dev, failure requesting irq %i\n, dev-irq);
 goto err_unuse_clocks;
 @@ -1182,7 +1189,23 @@ static int omap_i2c_runtime_resume(struct device *dev)
  }
  #endif /* CONFIG_PM_RUNTIME */
  
 +static int omap_i2c_suspend(struct device *dev)
 +{
 +   int ret;
 +
 +   /*
 +*  Enable I2C device, so it will be accessible during
 +* later stages of suspending when device Runtime PM is disabled.
 +* I2C device will be turned off at noirq suspend stage.
 +*/
 +   ret = pm_runtime_resume(dev);
 +   if (ret  0)
 +   return ret;
 +   return 0;
 +}
 +
  static struct dev_pm_ops omap_i2c_pm_ops = {
 +   SET_SYSTEM_SLEEP_PM_OPS(omap_i2c_suspend, NULL)
 SET_RUNTIME_PM_OPS(omap_i2c_runtime_suspend,
omap_i2c_runtime_resume, NULL)
  };
 
 - Grygorii
 
 From: Kevin Hilman [khil...@deeprootsystems.com]
 Sent: Friday, October 12, 2012 5:34 PM
 To: Strashko, Grygorii
 Cc: Kalle Jokiniemi; linux-...@vger.kernel.org; w.s...@pengutronix.de; 
 ben-li...@fluff.org; t...@atomide.com; linux-omap@vger.kernel.org; Datta, 
 Shubhrajyoti; Kankroliwala, Huzefa
 Subject: Re: [PATCH v3] ARM: OMAP: i2c: fix interrupt flood during resume
 
 Strashko, Grygorii grygorii.stras...@ti.com writes:
 
  Hi All,
 
  Sorry, for the late reply.
  + CC Huzefa Kankroliwala - who is I2C driver owner on Android Kernel 3.4.
 
 Hi Grygorii, thanks for reviewing.  I was hoping you would have some
 ideas here as this was sounding familiar to something you had
 mentioned elsewhere.
 
  Regarding this patch -  from my point of view, it fixes corner case and not 
  an issue in general.
  Let take a look on resume sequence:
 - platform resume
 - syscore resume
 - resume_noirq
 - enable IRQs - resume_device_irqs()
   |- at this point IRQ handler will be invoked if IRQ state is 
  IRQS_PENDING.
   |- so, the I2C device IRQ handler may be called at time when I2C 
  adapter IRQ is still disabled and, as result, the I2C device IRQ-handler 
  may fail. (I2C device and I2C adapter may use different physical IRQ lines)
 - resume_late
   |- enable I2C bus IRQ
 
  Possibly, the better way is to enable/disable I2C bus IRQ when needed - in 
  our case in omap_i2c_xfer().
  We use such approach in Android kernel 3.4
  (http://git.omapzoom.org/?p=kernel/omap.git;a=commitdiff;h=1445a4d3b587c164bd30d108b6176007365e)
 
 I agree, that should work and cover the cases where I2C is used by other
 processors also.  Shubhrajyoti already posted something similar[1] but
 it needed some rework (comments from Russell and myself.)
 
 Huzefa, Shubhrajyoti, who can rework this idea for the upstream and/or
 follow up with the earlier patch[1]?
 
 Wolfram, I guess for now lets hold off on $SUBJECT patch.  Seems we can
 come up with a broader solution.  Thanks.
 
 Kevin
 
 [1] 
 http://lists.infradead.org/pipermail/linux-arm-kernel/2012-October/124427.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] i2c: omap: fix spurious IRQs: disable/enable IRQ at INTC when idle

2012-10-15 Thread Kalle Jokiniemi
Hi,

la, 2012-10-13 kello 01:00 +0530, Shubhrajyoti Datta kirjoitti:
 On Sat, Oct 13, 2012 at 12:10 AM, Kevin Hilman
 khil...@deeprootsystems.com wrote:
  From: Kevin Hilman khil...@ti.com
 
  Currently, runtime PM is used to keep the device enabled only during
  active transfers and for a configurable runtime PM autosuspend timout
  after an xfer.
 
  In addition to idling the device, driver's -runtime_suspend() method
  currently disables device interrupts when idle.  However, on some SoCs
  (notably OMAP4+), the I2C hardware may shared with other coprocessors.
  This means that the MPU will still recieve interrupts if a coprocessor
  is using the I2C device.  To avoid this, also disable interrupts at
  the MPU INTC when idling the device in -runtime_suspend() (and
  re-enable them in -runtime_resume().)  This part based on an original
  patch from Shubhrajyoti Datta.  NOTE: for proper sharing the I2C with
  a coprocessor, this driver still needs hwspinlock support added.
 
  This change is also meant to address an issue reported by Kalle
  Jokiniemi where I2C bus interrupt may be enabled before an I2C device
  interrupt handler (e.g. just after noirq resume phase) causing an

It is actually in middle of resume_noirq.

  interrupt flood on the I2C bus interrupt before the device interrupt
  is enabled (e.g. interrupts coming from devices on I2C connected PMIC
  before the PMIC chained hanlder is enabled.)  This problem is addresed
  by ensuring that the I2C bus interrupt left disabled until an I2C xfer
  is requested.
 
 Looks good to me.
 Will wait for Kalle though.

Does not work for me :(

As I said, the issue occurs for me when I enter static suspend (echo mem
 /sys/power/autosleep or /sys/power/state). I don't think doing this
just in runtime pm will fix my issue. Or do those handlers get run in
the normal suspend path as well?

- Kalle

 
 
  Cc: Kalle Jokiniemi kalle.jokini...@jollamobile.com
  Cc: Grygorii Strashko grygorii.stras...@ti.com
  Cc: Shubhrajyoti Datta shubhrajy...@ti.com,
  Cc: Huzefa Kankroliwala huzef...@ti.com
  Cc: Nishanth Menon n...@ti.com
  Signed-off-by: Kevin Hilman khil...@ti.com
  ---
   drivers/i2c/busses/i2c-omap.c |3 +++
   1 file changed, 3 insertions(+)
 
  diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
  index db31eae..e6413e8 100644
  --- a/drivers/i2c/busses/i2c-omap.c
  +++ b/drivers/i2c/busses/i2c-omap.c
  @@ -1255,6 +1255,7 @@ static int omap_i2c_runtime_suspend(struct device 
  *dev)
  /* Flush posted write */
  omap_i2c_read_reg(_dev, OMAP_I2C_STAT_REG);
  }
  +   disable_irq(_dev-irq);
 
  return 0;
   }
  @@ -1275,6 +1276,8 @@ static int omap_i2c_runtime_resume(struct device *dev)
  omap_i2c_write_reg(_dev, OMAP_I2C_CON_REG, OMAP_I2C_CON_EN);
  }
 
  +   enable_irq(_dev-irq);
  +
  /*
   * Don't write to this register if the IE state is 0 as it can
   * cause deadlock.
  --
  1.7.9.2
 
  --
  To unsubscribe from this list: send the line unsubscribe linux-i2c 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] i2c: omap: revert i2c: omap: switch to threaded IRQ support

2012-10-15 Thread Felipe Balbi
Hi,

On Mon, Oct 15, 2012 at 01:51:08AM +, Paul Walmsley wrote:
 
 Commit 3b2f8f82dad7d1f79cdc8fc05bd1c94baf109bde (i2c: omap: switch to
 threaded IRQ support) causes communication with I2C devices to fail
 after system suspend/resume on all OMAP3 devices:
 
 ...
 [   40.228576] PM: noirq resume of devices complete after 3.723 msecs
 [   40.233184] PM: early resume of devices complete after 3.173 msecs
 [   40.242736] [sched_delayed] sched: RT throttling activated
 [   41.235046] omap_i2c omap_i2c.1: controller timed out

instead of just reverting the patch, I'd rather try to figure out why
controller times out in that situation.

It should make no difference if you're running an IRQ thread or not.

Do you have any extra debugging information which might help figuring
out what the issue really is ?

If the thread is actually at fault, then we need to add IRQF_NO_THREAD
to the IRQ flags, otherwise same issue will appear if we boot with
threadirqs kernel parameter.

 [   41.235351] twl: i2c_read failed to transfer all messages
 [   41.235382] omap_hsmmc omap_hsmmc.0: could not set regulator OCR (-110)
 [   41.396453] mmc0: error -110 during resume (card was removed?)
 [   42.391754] omap_i2c omap_i2c.1: controller timed out
 [   42.391876] twl: i2c_write failed to transfer all messages
 [   42.391906] twl_rtc: Could not write TWLregister F - error -110
 [   43.391326] omap_i2c omap_i2c.1: controller timed out
 [   43.391479] twl: i2c_read failed to transfer all messages
 [   43.391510] twl_rtc: Could not read TWLregister D - error -110
 [   43.391540] twl_rtc twl_rtc: twl_rtc_read_time: reading CTRL_REG, error 
 -110
 [   43.392364] PM: resume of devices complete after 3158.935 msecs
 
 When the root filesystem is on MMC, as in the above example, the
 card's voltage regulator is not re-enabled and the filesystem becomes
 inaccessible after resume.

but it fails because I2C times out and I'd like to understand why,
before just reverting the patch.

 Fix by reverting the conversion to a threaded IRQ handler.
 
 Signed-off-by: Paul Walmsley p...@pwsan.com
 Cc: Felipe Balbi ba...@ti.com
 Cc: Shubhrajyoti D shubhrajy...@ti.com
 Cc: Wolfram Sang w.s...@pengutronix.de
 Cc: Ben Dooks ben-li...@fluff.org
 ---
  drivers/i2c/busses/i2c-omap.c |   44 
 +++--
  1 file changed, 7 insertions(+), 37 deletions(-)
 
 diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
 index db31eae..e001c2a 100644
 --- a/drivers/i2c/busses/i2c-omap.c
 +++ b/drivers/i2c/busses/i2c-omap.c
 @@ -180,7 +180,6 @@ enum {
  #define I2C_OMAP_ERRATA_I462 (1  1)
  
  struct omap_i2c_dev {
 - spinlock_t  lock;   /* IRQ synchronization */
   struct device   *dev;
   void __iomem*base;  /* virtual */
   int irq;
 @@ -865,35 +864,13 @@ static int omap_i2c_transmit_data(struct omap_i2c_dev 
 *dev, u8 num_bytes,
  }
  
  static irqreturn_t
 -omap_i2c_isr(int irq, void *dev_id)
 +omap_i2c_isr(int this_irq, void *dev_id)
  {
   struct omap_i2c_dev *dev = dev_id;
 - irqreturn_t ret = IRQ_HANDLED;
 - u16 mask;
 - u16 stat;
 -
 - spin_lock(dev-lock);
 - mask = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
 - stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
 -
 - if (stat  mask)
 - ret = IRQ_WAKE_THREAD;
 -
 - spin_unlock(dev-lock);
 -
 - return ret;
 -}
 -
 -static irqreturn_t
 -omap_i2c_isr_thread(int this_irq, void *dev_id)
 -{
 - struct omap_i2c_dev *dev = dev_id;
 - unsigned long flags;
   u16 bits;
   u16 stat;
   int err = 0, count = 0;
  
 - spin_lock_irqsave(dev-lock, flags);
   do {
   bits = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
   stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
 @@ -907,7 +884,7 @@ omap_i2c_isr_thread(int this_irq, void *dev_id)
  
   if (!stat) {
   /* my work here is done */
 - goto out;
 + return IRQ_HANDLED;
   }
  
   dev_dbg(dev-dev, IRQ (ISR = 0x%04x)\n, stat);
 @@ -1016,8 +993,6 @@ omap_i2c_isr_thread(int this_irq, void *dev_id)
   omap_i2c_complete_cmd(dev, err);
  
  out:
 - spin_unlock_irqrestore(dev-lock, flags);
 -
   return IRQ_HANDLED;
  }
  
 @@ -1062,6 +1037,7 @@ omap_i2c_probe(struct platform_device *pdev)
   pdev-dev.platform_data;
   struct device_node  *node = pdev-dev.of_node;
   const struct of_device_id *match;
 + irq_handler_t isr;
   int irq;
   int r;
  
 @@ -1110,8 +1086,6 @@ omap_i2c_probe(struct platform_device *pdev)
   dev-dev = pdev-dev;
   dev-irq = irq;
  
 - spin_lock_init(dev-lock);
 -
   platform_set_drvdata(pdev, dev);
   init_completion(dev-cmd_complete);
  
 @@ -1166,14 +1140,10 @@ omap_i2c_probe(struct platform_device *pdev)
   /* reset ASAP, clearing any IRQs */
   

Re: Errors at boot time from OMAP4430SDP (and a whinge about serial stuff)

2012-10-15 Thread Péter Ujfalusi
On 10/12/2012 06:24 PM, Tony Lindgren wrote:
 twl6040-codec twl6040-codec: ASoC: Failed to create Capture debugfs file
 
 Peter, can you take a look please?

Patch to fix this has been already sent:
http://mailman.alsa-project.org/pipermail/alsa-devel/2012-September/055684.html

The same issue has been also fixed for twl4030:
http://mailman.alsa-project.org/pipermail/alsa-devel/2012-September/055683.html

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


Re: [balbi-usb:merge-result-for-greg 59/99] webcam.c:(.text+0x14afec): undefined reference to `config_ep_by_speed'

2012-10-15 Thread Sebastian Andrzej Siewior

On 10/12/2012 06:39 PM, Fengguang Wu wrote:

Hi Sebastian,


Hi Fengguang,


FYI, kernel build failed on

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 
merge-result-for-greg
head:   23953bde3e4d6aa8780dc054f6ad9882ac63f4f4
commit: 721e2e91945bc2520d57d795dfe1b502ecec567c [59/99] usb: gadget: 
libcomposite: move composite.c into libcomposite
config: i386-randconfig-b199 (attached as .config)

All error/warnings:

drivers/built-in.o: In function `uvc_function_set_alt':


Yes. I accidentally broke this and this still fails in 3.7-rc1. Greg
has a patch for this in his tree (usb: gadget: Make webcam gadget
select USB_LIBCOMPOSITE) which fixes this.

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


Re: [PATCH] ARM: OMAP4: hwmod data: gpmc main clk

2012-10-15 Thread Benoit Cousson
Hi Afzal,

On 10/15/2012 07:47 AM, Afzal Mohammed wrote:
 gpmc has been converted to a driver. It requests clock with
 con-id fck, if not available, probe fails. Clock for gpmc
 device with con-id fck is created (aliased) along with
 hwmod device, and for that to happen, main_clk needs to be
 specified in hwmod entry, add it for OMAP4.

Well, in this case, this is not the preferred way. The hwmod data are supposed 
to reflect the real HW capabilities.
We'd better add the alias in the already existing dummy clock node.

Here is the patch to do that.

Thanks,
Benoit

---
From: Benoit Cousson b-cous...@ti.com
Date: Mon, 15 Oct 2012 11:41:42 +0200
Subject: [PATCH] ARM: OMAP2+: clock data: Add dev-id for the omap-gpmc dummy fck

The GPMC code has been converted to a driver by the following commit:

 commit da496873970c57c4b31e186d967933da0ffa0d7c
 Author: Afzal Mohammed af...@ti.com
 Date:   Sun Sep 23 17:28:25 2012 -0600

   ARM: OMAP2+: gpmc: minimal driver support

It now requests a clock with con-id fck otherwise the probe will fails.

[0.342010] omap-gpmc omap-gpmc: error: clk_get
[0.346771] omap-gpmc: probe of omap-gpmc failed with error -2

Add the omap-gmpc dev-id and fck con-id to the already existing
gmpc-fck dummy clock.

Reported-by: Russell King rmk+ker...@arm.linux.org.uk
Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Afzal Mohammed af...@ti.com
---
 arch/arm/mach-omap2/clock44xx_data.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/clock44xx_data.c 
b/arch/arm/mach-omap2/clock44xx_data.c
index d661d13..6efc30c 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -3294,7 +3294,7 @@ static struct omap_clk omap44xx_clks[] = {
CLK(NULL,   auxclk5_src_ck,   auxclk5_src_ck,
CK_443X),
CLK(NULL,   auxclk5_ck,   auxclk5_ck,
CK_443X),
CLK(NULL,   auxclkreq5_ck,auxclkreq5_ck, 
CK_443X),
-   CLK(NULL,   gpmc_ck,  dummy_ck,  
CK_443X),
+   CLK(omap-gpmc,fck,  dummy_ck,  
CK_443X),
CLK(omap_i2c.1,   ick,  dummy_ck,  
CK_443X),
CLK(omap_i2c.2,   ick,  dummy_ck,  
CK_443X),
CLK(omap_i2c.3,   ick,  dummy_ck,  
CK_443X),
-- 
1.7.0.4

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


Re: [PATCH v3] ARM: OMAP: i2c: fix interrupt flood during resume

2012-10-15 Thread Shubhrajyoti Datta
On Mon, Oct 15, 2012 at 2:46 PM, Kalle Jokiniemi
kalle.jokini...@jollamobile.com wrote:
 ma, 2012-10-15 kello 09:21 +0300, Kalle Jokiniemi kirjoitti:
 Hi,

 pe, 2012-10-12 kello 14:46 +, Strashko, Grygorii kirjoitti:
  Hi Kevin,
 
  yep, [1] is the same fix - thanks.
 
  Hi Kalle,
 
  i've applied these changes and PM runtime fix on top of 
  git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git 
  (omap2plus_defconfig)
  Could you check it with your use case, pls? (just to be sure that idea is 
  right)

 Odd, it's not working. I'll add some debug prints to see what happens
 there.

 Well, seems after enabling irq 23 in the resume_noirq, someone does
 i2c_xfer and there is consequent flood of i2c_xfers and interrupts.
If there is continuous xfers, you could enable debug LL and see who is
queuing the
transfers.


 Not sure now how these IRQ numbers get mapped these days, my debug print
 says it's irq number 72 (UART1 from TRM) that is flooding (although it's
 printed from the i2c-omap isr function, so it's still I2C bus irq...).

Can you do a cat /proc/interrupts



 The irq enabling (in resume_noirq) is still slightly progressing after
 the flooding starts, but my watchdog kicks in before we get to the
 finish.

 Attached my debug prints patch and log. I used also no_console_suspend
 boot option.

 - Kalle

--
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: [PATCHv4] Input: keypad: Add smsc ece1099 keypad driver

2012-10-15 Thread Sourav

Hi Dmitry,
On Friday 05 October 2012 12:56 PM, Sourav Poddar wrote:

From: G, Manjunath Kondaiah manj...@ti.com

SMSC ECE1099 is a keyboard scan or GPIO expansion device.The device
supports a keypad scan matrix of 23*8.This driver uses this
device as a keypad driver.

Tested on omap5430 evm with 3.6-rc6 custom kernel.

Cc: Benoit Cousson b-cous...@ti.com
Cc: Felipe Balbi ba...@ti.com
Cc: Santosh Shilimkar santosh.shilim...@ti.com
Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
Signed-off-by: Sourav Poddar sourav.pod...@ti.com
Acked-by: Felipe Balbi ba...@ti.com
---
This patch was posted as a series initially
http://www.spinics.net/lists/linux-omap/msg78772.html

But the parent mfd driver has beeen already picked by mfd maintainer.
So this patch can now posted as an standalone patch.

v3-v4:
Fix Dmitry's comments:
  - Error patch(input_free_device/input_unregister_device).
  - Few cleanups.
  - Included INPUT_MATRIXKMAP
  drivers/input/keyboard/Kconfig   |   12 +
  drivers/input/keyboard/Makefile  |1 +
  drivers/input/keyboard/smsc-ece1099-keypad.c |  303 ++
  3 files changed, 316 insertions(+), 0 deletions(-)
  create mode 100644 drivers/input/keyboard/smsc-ece1099-keypad.c

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index c50fa75..e370b03 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -593,6 +593,18 @@ config KEYBOARD_TWL4030
  To compile this driver as a module, choose M here: the
  module will be called twl4030_keypad.
  
+config KEYBOARD_SMSC

+   tristate SMSC ECE1099 keypad support
+   depends on I2C
+   select INPUT_MATRIXKMAP
+   help
+ Say Y here if your board use the smsc keypad controller
+ for omap5 defconfig. It's safe to say enable this
+ even on boards that don't use the keypad controller.
+
+ To compile this driver as a module, choose M here: the
+ module will be called smsc-ece1099-keypad.
+
  config KEYBOARD_XTKBD
tristate XT keyboard
select SERIO
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 44e7600..0f2aa26 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -52,5 +52,6 @@ obj-$(CONFIG_KEYBOARD_TC3589X)+= 
tc3589x-keypad.o
  obj-$(CONFIG_KEYBOARD_TEGRA)  += tegra-kbc.o
  obj-$(CONFIG_KEYBOARD_TNETV107X)  += tnetv107x-keypad.o
  obj-$(CONFIG_KEYBOARD_TWL4030)+= twl4030_keypad.o
+obj-$(CONFIG_KEYBOARD_SMSC)+= smsc-ece1099-keypad.o
  obj-$(CONFIG_KEYBOARD_XTKBD)  += xtkbd.o
  obj-$(CONFIG_KEYBOARD_W90P910)+= w90p910_keypad.o
diff --git a/drivers/input/keyboard/smsc-ece1099-keypad.c 
b/drivers/input/keyboard/smsc-ece1099-keypad.c
new file mode 100644
index 000..a4a0dfe
--- /dev/null
+++ b/drivers/input/keyboard/smsc-ece1099-keypad.c
@@ -0,0 +1,303 @@
+/*
+ * SMSC_ECE1099 Keypad driver
+ *
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/i2c.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/init.h
+#include linux/interrupt.h
+#include linux/input.h
+#include linux/gpio.h
+#include linux/slab.h
+#include linux/jiffies.h
+#include linux/input/matrix_keypad.h
+#include linux/delay.h
+#include linux/mfd/core.h
+#include linux/mfd/smsc.h
+#include linux/of_gpio.h
+#include linux/of.h
+
+#define KEYPRESS_TIME  200
+
+struct smsc_keypad {
+   struct smsc *smsc;
+   struct matrix_keymap_data *keymap_data;
+   unsigned int last_key_state[16];
+   unsigned int last_col;
+   unsigned int last_key_ms[16];
+   unsigned short *keymap;
+   struct i2c_client *client;
+   struct input_dev *input;
+   int rows, cols;
+   int row_shift;
+   bool no_autorepeat;
+   unsignedirq;
+   struct device *dev;
+};
+
+static void smsc_kp_scan(struct smsc_keypad *kp)
+{
+   struct input_dev *input = kp-input;
+   int i, j;
+   int row, col;
+   int temp, code;
+   unsigned int new_state[16];
+   unsigned int bits_changed;
+   int this_ms;
+
+   smsc_write(kp-dev, SMSC_KP_INT_MASK, 0x00);
+   smsc_write(kp-dev, SMSC_KP_INT_STAT, 0xFF);
+
+   /* Scan for row and column */
+   for (i = 0; i  kp-cols; i++) {
+   smsc_write(kp-dev, SMSC_KP_OUT, SMSC_KSO_EVAL + i);
+   /* Read Row Status */
+   smsc_read(kp-dev, SMSC_KP_IN, temp);
+   if (temp == 0xFF)
+   continue;
+
+   col = i;
+   for (j = 0; j  kp-rows; j++) {
+   if ((temp  0x01) != 0x00) {
+   temp = 

Re: [PATCH 1/3] usb: dwc3: Add the suspend/resume functionality

2012-10-15 Thread Felipe Balbi
On Fri, Oct 12, 2012 at 07:24:33PM +0530, Vikas Sajjan wrote:
 Hi kishon,
 
 On 12 October 2012 16:27, kishon kis...@ti.com wrote:
  Hi,
 
 
  On Wednesday 10 October 2012 07:35 PM, Vikas C Sajjan wrote:
 
  From: Vikas Sajjan vikas.saj...@linaro.org
 
  Adding the suspend and resume funtionality to DWC3 core.
 
  Signed-off-by: Abhilash Kesavan a.kesa...@samsung.com
  Signed-off-by: Vikas C Sajjan vikas.saj...@linaro.org
  CC: Doug Anderson diand...@chromium.org
  ---
drivers/usb/dwc3/core.c |  268
  +-
1 files changed, 169 insertions(+), 99 deletions(-)
 
  diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
  index b415c0c..58b51e1 100644
  --- a/drivers/usb/dwc3/core.c
  +++ b/drivers/usb/dwc3/core.c
 
  @@ -70,51 +70,20 @@ MODULE_PARM_DESC(maximum_speed, Maximum supported
  speed.);
 
static DECLARE_BITMAP(dwc3_devs, DWC3_DEVS_POSSIBLE);
 
  -int dwc3_get_device_id(void)
  -{
  -   int id;
  -
  -again:
  -   id = find_first_zero_bit(dwc3_devs, DWC3_DEVS_POSSIBLE);
  -   if (id  DWC3_DEVS_POSSIBLE) {
  -   int old;
  -
  -   old = test_and_set_bit(id, dwc3_devs);
  -   if (old)
  -   goto again;
  -   } else {
  -   pr_err(dwc3: no space for new device\n);
  -   id = -ENOMEM;
  -   }
  -
  -   return id;
  -}
  -EXPORT_SYMBOL_GPL(dwc3_get_device_id);
  -
  -void dwc3_put_device_id(int id)
  -{
  -   int ret;
  -
  -   if (id  0)
  -   return;
  -
  -   ret = test_bit(id, dwc3_devs);
  -   WARN(!ret, dwc3: ID %d not in use\n, id);
  -   smp_mb__before_clear_bit();
  -   clear_bit(id, dwc3_devs);
  -}
  -EXPORT_SYMBOL_GPL(dwc3_put_device_id);
  -
  -void dwc3_set_mode(struct dwc3 *dwc, u32 mode)
  +static void __devinit dwc3_cache_hwparams(struct dwc3 *dwc)
{
  -   u32 reg;
  +   struct dwc3_hwparams*parms = dwc-hwparams;
 
  -   reg = dwc3_readl(dwc-regs, DWC3_GCTL);
  -   reg = ~(DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_OTG));
  -   reg |= DWC3_GCTL_PRTCAPDIR(mode);
  -   dwc3_writel(dwc-regs, DWC3_GCTL, reg);
  +   parms-hwparams0 = dwc3_readl(dwc-regs, DWC3_GHWPARAMS0);
  +   parms-hwparams1 = dwc3_readl(dwc-regs, DWC3_GHWPARAMS1);
  +   parms-hwparams2 = dwc3_readl(dwc-regs, DWC3_GHWPARAMS2);
  +   parms-hwparams3 = dwc3_readl(dwc-regs, DWC3_GHWPARAMS3);
  +   parms-hwparams4 = dwc3_readl(dwc-regs, DWC3_GHWPARAMS4);
  +   parms-hwparams5 = dwc3_readl(dwc-regs, DWC3_GHWPARAMS5);
  +   parms-hwparams6 = dwc3_readl(dwc-regs, DWC3_GHWPARAMS6);
  +   parms-hwparams7 = dwc3_readl(dwc-regs, DWC3_GHWPARAMS7);
  +   parms-hwparams8 = dwc3_readl(dwc-regs, DWC3_GHWPARAMS8);
}
  -
/**
 * dwc3_core_soft_reset - Issues core soft reset and PHY reset
 * @dwc: pointer to our context structure
  @@ -160,6 +129,102 @@ static void dwc3_core_soft_reset(struct dwc3 *dwc)
  dwc3_writel(dwc-regs, DWC3_GCTL, reg);
}
 
  +static int dwc3_core_reset(struct dwc3 *dwc)
  +{
  +   unsigned long   timeout;
  +   u32 reg;
  +
  +   /* issue device SoftReset too */
  +   timeout = jiffies + msecs_to_jiffies(500);
  +   dwc3_writel(dwc-regs, DWC3_DCTL, DWC3_DCTL_CSFTRST);
  +   do {
  +   reg = dwc3_readl(dwc-regs, DWC3_DCTL);
  +   if (!(reg  DWC3_DCTL_CSFTRST))
  +   break;
  +
  +   if (time_after(jiffies, timeout)) {
  +   dev_err(dwc-dev, Reset Timed Out\n);
  +   return -ETIMEDOUT;
  +   }
  +
  +   cpu_relax();
  +   } while (true);
  +
  +   dwc3_core_soft_reset(dwc);
  +
  +   dwc3_cache_hwparams(dwc);
  +
  +   reg = dwc3_readl(dwc-regs, DWC3_GCTL);
  +   reg = ~DWC3_GCTL_SCALEDOWN_MASK;
  +   reg = ~DWC3_GCTL_DISSCRAMBLE;
  +
  +   switch (DWC3_GHWPARAMS1_EN_PWROPT(dwc-hwparams.hwparams1)) {
  +   case DWC3_GHWPARAMS1_EN_PWROPT_CLK:
  +   reg = ~DWC3_GCTL_DSBLCLKGTNG;
  +   break;
  +   default:
  +   dev_dbg(dwc-dev, No power optimization available\n);
  +   }
  +
  +   /*
 
  +* WORKAROUND: DWC3 revisions 1.90a have a bug
  +* where the device can fail to connect at SuperSpeed
  +* and falls back to high-speed mode which causes
  +* the device to enter a Connect/Disconnect loop
  +*/
  +   if (dwc-revision  DWC3_REVISION_190A)
  +   reg |= DWC3_GCTL_U2RSTECN;
  +
  +   dwc3_writel(dwc-regs, DWC3_GCTL, reg);
  +
  +   return 0;
  +}
  +
  +int dwc3_get_device_id(void)
  +{
  +   int id;
  +
  +again:
  +   id = find_first_zero_bit(dwc3_devs, DWC3_DEVS_POSSIBLE);
  +   if (id  DWC3_DEVS_POSSIBLE) {
  +   int old;
  +
  +   old = test_and_set_bit(id, dwc3_devs);
 

[GIT PULL] OMAP-GPMC cleanup for common zImage

2012-10-15 Thread Afzal Mohammed
The following changes since commit ddffeb8c4d0331609ef2581d84de4d763607bd37:

  Linux 3.7-rc1 (2012-10-14 14:41:04 -0700)

are available in the git repository at:

  g...@gitorious.org:x0148406-public/linux-kernel.git tags/gpmc-czimage

for you to fetch changes up to 3ef5d0071cf6c8b9a00b559232bb700ad5d7:

  ARM: OMAP2+: gpmc: localize gpmc header (2012-10-15 14:42:15 +0530)


gpmc cleanup for common ARM zImage


Afzal Mohammed (16):
  ARM: OMAP2+: nand: unify init functions
  ARM: OMAP2+: onenand: refactor for clarity
  ARM: OMAP2+: gpmc: remove cs# in sync clk div calc
  mtd: onenand: omap: cleanup gpmc dependency
  mtd: nand: omap: free region as per resource size
  mtd: nand: omap: read nand using register address
  ARM: OMAP2+: onenand: connected soc info in pdata
  mtd: onenand: omap: use pdata info instead of cpu_is
  ARM: OMAP2+: onenand: header cleanup
  ARM: OMAP2+: nand: header cleanup
  mtd: nand: omap: bring in gpmc nand macros
  ARM: OMAP2+: nand: bch capability check
  ARM: OMAP2+: gpmc: nand register helper bch update
  mtd: nand: omap: handle gpmc bch[48]
  ARM: OMAP2+: gpmc: remove exported nand functions
  ARM: OMAP2+: gpmc: localize gpmc header

Jon Hunter (1):
  ARM: OMAP2+: GPMC: Remove unused OneNAND get_freq() platform function

 arch/arm/mach-omap2/board-2430sdp.c|   2 +-
 arch/arm/mach-omap2/board-3430sdp.c|   2 +-
 arch/arm/mach-omap2/board-apollon.c|   2 +-
 arch/arm/mach-omap2/board-cm-t35.c |   5 +-
 arch/arm/mach-omap2/board-cm-t3517.c   |   5 +-
 arch/arm/mach-omap2/board-devkit8000.c |  10 +-
 arch/arm/mach-omap2/board-flash.c  |  50 +--
 arch/arm/mach-omap2/board-flash.h  |   8 +-
 arch/arm/mach-omap2/board-h4.c |   2 +-
 arch/arm/mach-omap2/board-igep0020.c   |   5 +-
 arch/arm/mach-omap2/board-ldp.c|   6 +-
 arch/arm/mach-omap2/board-n8x0.c   |   1 +
 arch/arm/mach-omap2/board-omap3beagle.c|  10 +-
 arch/arm/mach-omap2/board-omap3evm.c   |   8 +-
 arch/arm/mach-omap2/board-omap3logic.c |   2 +-
 arch/arm/mach-omap2/board-omap3pandora.c   |   3 +-
 arch/arm/mach-omap2/board-omap3stalker.c   |   2 +-
 arch/arm/mach-omap2/board-omap3touchbook.c |  10 +-
 arch/arm/mach-omap2/board-overo.c  |   9 +-
 arch/arm/mach-omap2/board-rm680.c  |   3 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c   |   3 +-
 arch/arm/mach-omap2/board-rx51.c   |   2 +-
 arch/arm/mach-omap2/board-zoom-debugboard.c|   2 +-
 arch/arm/mach-omap2/board-zoom.c   |   5 +-
 arch/arm/mach-omap2/common-board-devices.c |  46 ---
 arch/arm/mach-omap2/common-board-devices.h |   1 -
 arch/arm/mach-omap2/gpmc-nand.c|  85 ++--
 arch/arm/mach-omap2/gpmc-nand.h|  27 ++
 arch/arm/mach-omap2/gpmc-onenand.c | 214 +-
 arch/arm/mach-omap2/gpmc-onenand.h |  24 ++
 arch/arm/mach-omap2/gpmc-smc91x.c  |   2 +-
 arch/arm/mach-omap2/gpmc-smsc911x.c|   2 +-
 arch/arm/mach-omap2/gpmc.c | 459 +
 .../{plat-omap/include/plat = mach-omap2}/gpmc.h  |  61 +--
 arch/arm/mach-omap2/pm34xx.c   |   2 +-
 arch/arm/mach-omap2/usb-tusb6010.c |   2 +-
 drivers/mtd/nand/omap2.c   | 125 +-
 drivers/mtd/onenand/omap2.c|   9 +-
 include/linux/platform_data/mtd-nand-omap2.h   |  46 ++-
 include/linux/platform_data/mtd-onenand-omap2.h|  28 +-
 40 files changed, 493 insertions(+), 797 deletions(-)
 create mode 100644 arch/arm/mach-omap2/gpmc-nand.h
 create mode 100644 arch/arm/mach-omap2/gpmc-onenand.h
 rename arch/arm/{plat-omap/include/plat = mach-omap2}/gpmc.h (67%)
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/3] usb: dwc3: Add the suspend/resume functionality

2012-10-15 Thread Felipe Balbi
On Sat, Oct 13, 2012 at 06:40:23PM +0530, Vikas Sajjan wrote:
 Adding the suspend and resume funtionality to DWC3 core.

typo - functionality.

Also this is quite lame as a commit log. I'm sure you can do better than
this.

 Signed-off-by: Abhilash Kesavan a.kesa...@samsung.com
 Signed-off-by: Vikas C Sajjan vikas.saj...@linaro.org
 CC: Doug Anderson diand...@chromium.org
 ---
  drivers/usb/dwc3/core.c |   54 
 +++
  1 files changed, 54 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
 index b415c0c..0699061 100644
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
 @@ -622,11 +622,65 @@ static int __devexit dwc3_remove(struct platform_device 
 *pdev)
   return 0;
  }
  
 +#ifdef CONFIG_PM
 +static int dwc3_resume(struct device *dev)
 +{
 + struct dwc3 *dwc = dev_get_drvdata(dev);
 + int ret;
 +
 + usb_phy_init(dwc-usb2_phy);
 + usb_phy_init(dwc-usb3_phy);
 +
 + ret = dwc3_event_buffers_setup(dwc);
 + if (ret  0)
 + return ret;
 +
 + switch (dwc-mode) {
 + case DWC3_MODE_DEVICE:
 + dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE);
 + break;
 + case DWC3_MODE_HOST:
 + dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST);
 + break;
 + case DWC3_MODE_DRD:
 + dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG);
 + }

this is wrong. You should be calling dwc3_core_init(). Databook is very
clear that we _must_ use a softreset to make sure PHY and DWC3 are in
sync, otherwise some rather difficult-to-debug bugs might show up.

 +
 + /* runtime set active to reflect active state. */
 + pm_runtime_disable(dev);
 + pm_runtime_set_active(dev);
 + pm_runtime_enable(dev);
 +
 + return 0;
 +}
 +
 +static int dwc3_suspend(struct device *dev)
 +{
 + struct dwc3 *dwc = dev_get_drvdata(dev);
 +
 + dwc3_event_buffers_cleanup(dwc);
 +
 + usb_phy_shutdown(dwc-usb2_phy);
 + usb_phy_shutdown(dwc-usb3_phy);
 +
 + return 0;
 +}
 +
 +static const struct dev_pm_ops dwc3_pm_ops = {
 + .suspend= dwc3_suspend,
 + .resume = dwc3_resume,
 +};
 +#define DWC3_PM_OPS (dwc3_pm_ops)
 +#else
 +#define DWC3_PM_OPS NULL
 +#endif /* CONFIG_PM */
 +
  static struct platform_driver dwc3_driver = {
   .probe  = dwc3_probe,
   .remove = __devexit_p(dwc3_remove),
   .driver = {
   .name   = dwc3,
 + .pm = DWC3_PM_OPS,
   },
  };
  
 -- 
 1.7.6.5
 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v2 2/3] usb: xhci: Add the suspend/resume functionality

2012-10-15 Thread Felipe Balbi
On Sat, Oct 13, 2012 at 06:40:24PM +0530, Vikas Sajjan wrote:
 Adding the suspend and resume functionality for the XHCI driver

please do better on your commit log.

 Signed-off-by: Abhilash Kesavan a.kesa...@samsung.com
 Signed-off-by: Vikas C Sajjan vikas.saj...@linaro.org
 CC: Doug Anderson diand...@chromium.org
 ---
  drivers/usb/host/xhci-plat.c |   33 +
  1 files changed, 33 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
 index df90fe5..15c7c89 100644
 --- a/drivers/usb/host/xhci-plat.c
 +++ b/drivers/usb/host/xhci-plat.c
 @@ -185,11 +185,44 @@ static int xhci_plat_remove(struct platform_device *dev)
   return 0;
  }
  
 +#ifdef CONFIG_PM
 +static int xhci_plat_suspend(struct device *dev)
 +{
 + struct usb_hcd  *hcd= dev_get_drvdata(dev);
 + struct xhci_hcd *xhci   = hcd_to_xhci(hcd);
 +
 + /* Make sure that the HCD Core has set state to HC_STATE_SUSPENDED */
 + if (hcd-state != HC_STATE_SUSPENDED ||
 + xhci-shared_hcd-state != HC_STATE_SUSPENDED)
 + return -EINVAL;
 +
 + return xhci_suspend(xhci);
 +}
 +
 +static int xhci_plat_resume(struct device *dev)
 +{
 + struct usb_hcd  *hcdi   = dev_get_drvdata(dev);
 + struct xhci_hcd *xhci   = hcd_to_xhci(hcd);
 +
 + return xhci_resume(xhci, 0);
 +}
 +
 +static const struct dev_pm_ops xhci_plat_pm_ops = {
 + .suspend= xhci_plat_suspend,
 + .resume = xhci_plat_resume,

I believe you should be using SET_SYSTEM_PM_SLEEP_PM_OPS()

 +};
 +
 +#define XHCI_PLAT_PM_OPS(xhci_plat_pm_ops)
 +#else
 +#define XHCI_PLAT_PM_OPSNULL
 +#endif
 +
  static struct platform_driver usb_xhci_driver = {
   .probe  = xhci_plat_probe,
   .remove = xhci_plat_remove,
   .driver = {
   .name = xhci-hcd,
 + .pm = XHCI_PLAT_PM_OPS,
   },
  };
  MODULE_ALIAS(platform:xhci-hcd);
 -- 
 1.7.6.5
 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v2 1/3] usb: dwc3: Add the suspend/resume functionality

2012-10-15 Thread Felipe Balbi
On Sat, Oct 13, 2012 at 06:40:23PM +0530, Vikas Sajjan wrote:
 Adding the suspend and resume funtionality to DWC3 core.
 
 Signed-off-by: Abhilash Kesavan a.kesa...@samsung.com
 Signed-off-by: Vikas C Sajjan vikas.saj...@linaro.org
 CC: Doug Anderson diand...@chromium.org
 ---
  drivers/usb/dwc3/core.c |   54 
 +++
  1 files changed, 54 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
 index b415c0c..0699061 100644
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
 @@ -622,11 +622,65 @@ static int __devexit dwc3_remove(struct platform_device 
 *pdev)
   return 0;
  }
  
 +#ifdef CONFIG_PM
 +static int dwc3_resume(struct device *dev)
 +{
 + struct dwc3 *dwc = dev_get_drvdata(dev);
 + int ret;
 +
 + usb_phy_init(dwc-usb2_phy);
 + usb_phy_init(dwc-usb3_phy);
 +
 + ret = dwc3_event_buffers_setup(dwc);
 + if (ret  0)
 + return ret;
 +
 + switch (dwc-mode) {
 + case DWC3_MODE_DEVICE:
 + dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE);
 + break;
 + case DWC3_MODE_HOST:
 + dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST);
 + break;
 + case DWC3_MODE_DRD:
 + dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG);
 + }
 +
 + /* runtime set active to reflect active state. */
 + pm_runtime_disable(dev);
 + pm_runtime_set_active(dev);
 + pm_runtime_enable(dev);
 +
 + return 0;
 +}
 +
 +static int dwc3_suspend(struct device *dev)
 +{
 + struct dwc3 *dwc = dev_get_drvdata(dev);
 +
 + dwc3_event_buffers_cleanup(dwc);
 +
 + usb_phy_shutdown(dwc-usb2_phy);
 + usb_phy_shutdown(dwc-usb3_phy);
 +
 + return 0;
 +}
 +
 +static const struct dev_pm_ops dwc3_pm_ops = {
 + .suspend= dwc3_suspend,
 + .resume = dwc3_resume,
 +};

one extra comment:

SET_SYSTEM_SLEEP_PM_OPS()

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v2 3/3] exynos5: usb: dwc3: Add the suspend/resume functionality

2012-10-15 Thread Felipe Balbi
Hi,

On Sat, Oct 13, 2012 at 06:40:25PM +0530, Vikas Sajjan wrote:
 Adding the suspend and resume functionality to exynos dwc3 driver

better commit log.

 Signed-off-by: Abhilash Kesavan a.kesa...@samsung.com
 Signed-off-by: Vikas C Sajjan vikas.saj...@linaro.org
 CC: Doug Anderson diand...@chromium.org
 ---
  drivers/usb/dwc3/dwc3-exynos.c |   39 +++
  1 files changed, 39 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
 index ca65978..2781301 100644
 --- a/drivers/usb/dwc3/dwc3-exynos.c
 +++ b/drivers/usb/dwc3/dwc3-exynos.c
 @@ -15,6 +15,7 @@
  #include linux/module.h
  #include linux/kernel.h
  #include linux/slab.h
 +#include linux/pm_runtime.h
  #include linux/platform_device.h
  #include linux/platform_data/dwc3-exynos.h
  #include linux/dma-mapping.h
 @@ -200,11 +201,49 @@ static int __devexit dwc3_exynos_remove(struct 
 platform_device *pdev)
   return 0;
  }
  
 +#ifdef CONFIG_PM
 +static int dwc3_exynos_suspend(struct device *dev)
 +{
 + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
 +
 + BUG_ON(!exynos);

drop this. It's nonsense. This will never happen and if it does
clk_disable() call will already oops for us.

 +
 + clk_disable(exynos-clk);
 +
 + return 0;
 +}
 +
 +static int dwc3_exynos_resume(struct device *dev)
 +{
 + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
 +
 + BUG_ON(!exynos);

drop this. It's nonsense. This will never happen and if it does
clk_enable() call will already oops for us.

 + clk_enable(exynos-clk);
 +
 + /* runtime set active to reflect active state. */
 + pm_runtime_disable(dev);
 + pm_runtime_set_active(dev);
 + pm_runtime_enable(dev);
 +
 + return 0;
 +}
 +
 +static const struct dev_pm_ops dwc3_exynos_pm_ops = {
 + .suspend= dwc3_exynos_suspend,
 + .resume = dwc3_exynos_resume,

use SET_SYSTEM_SLEEP_PM_OPS()

 +};
 +#define DWC3_EXYNOS_DEV_PM_OPS  (dwc3_exynos_pm_ops)
 +#else
 +#define DWC3_EXYNOS_DEV_PM_OPS  NULL
 +#endif /* CONFIG_PM */
 +
  static struct platform_driver dwc3_exynos_driver = {
   .probe  = dwc3_exynos_probe,
   .remove = __devexit_p(dwc3_exynos_remove),
   .driver = {
   .name   = exynos-dwc3,
 + .pm = DWC3_EXYNOS_DEV_PM_OPS,
   },
  };
  
 -- 
 1.7.6.5
 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] USB: DWC3: Shutdown usb_phy when removing the device

2012-10-15 Thread Felipe Balbi
On Sat, Oct 13, 2012 at 07:20:18PM +0530, Vivek Gautam wrote:
 We do usb_phy_init() while doing core_init() in probe,
 so adding usb_phy_shutdown() when we do core_exit()
 while removing the device.
 
 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com

I believe this needs to be sent to stable too for v3.6, right ?

please resend with a proper Cc: sta...@vger.kernel.org # v3.6 tag

 ---
  drivers/usb/dwc3/core.c |4 
  1 files changed, 4 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
 index b415c0c..c14ebc9 100644
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
 @@ -409,6 +409,10 @@ static void dwc3_core_exit(struct dwc3 *dwc)
  {
   dwc3_event_buffers_cleanup(dwc);
   dwc3_free_event_buffers(dwc);
 +
 + usb_phy_shutdown(dwc-usb2_phy);
 + usb_phy_shutdown(dwc-usb3_phy);
 +
  }
  
  #define DWC3_ALIGN_MASK  (16 - 1)
 -- 
 1.7.6.5
 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 1/1] musb : remove generic_interrupt and have all drivers define the isr on their own. Remove some unneeded CONFIG_SOC_OMAP_3430 instances

2012-10-15 Thread Felipe Balbi
Hi,

On Mon, Oct 08, 2012 at 09:34:51AM -0700, Tony Lindgren wrote:
 * Philippe De Swert philippedesw...@gmail.com [121004 10:00]:
  This patch is based on the discussion of a previous patch to fix an issue
  where the omap2430 musb driver is not working for N9/N950.
  
  Moving all the interrupt handling to the devices. Avoids inclusion of 
  generic
  interrupt and breakage due to sometimes misleading CONFIG options. This 
  makes 
  sure usb always works if on of the subdrivers is chosen. Tested on Nokia 
  N9/N950. 
  
  Partially clean up CONFIG_SOC_OMAP3430 which is not necessary in the cases
  where I removed it. Also helps with the removal work of those options that 
  Tony Lindgren predicted would happen at some point.
 
 Thanks looks OK to me:
 
 Acked-by: Tony Lindgren t...@atomide.com

Can someone please resend this patch with Tony's Ack ? We have some mail
server change recently and I lost a few mails in the process :-(

sorry

-- 
balbi


signature.asc
Description: Digital signature


RE: [GIT PULL] OMAP-GPMC cleanup for common zImage

2012-10-15 Thread Mohammed, Afzal
Hi,

On Mon, Oct 15, 2012 at 17:44:07, Mohammed, Afzal wrote:

 The following changes since commit ddffeb8c4d0331609ef2581d84de4d763607bd37:
 
   Linux 3.7-rc1 (2012-10-14 14:41:04 -0700)
 
 are available in the git repository at:
 
   g...@gitorious.org:x0148406-public/linux-kernel.git tags/gpmc-czimage

Please ignore this, will repost with correct url.

Regards
Afzal


[GIT PULL] OMAP-GPMC related cleanup for common zImage

2012-10-15 Thread Afzal Mohammed
The following changes since commit ddffeb8c4d0331609ef2581d84de4d763607bd37:

  Linux 3.7-rc1 (2012-10-14 14:41:04 -0700)

are available in the git repository at:

  git://gitorious.org/x0148406-public/linux-kernel.git tags/gpmc-czimage

for you to fetch changes up to 3ef5d0071cf6c8b9a00b559232bb700ad5d7:

  ARM: OMAP2+: gpmc: localize gpmc header (2012-10-15 14:42:15 +0530)


gpmc cleanup for common ARM zImage


Afzal Mohammed (16):
  ARM: OMAP2+: nand: unify init functions
  ARM: OMAP2+: onenand: refactor for clarity
  ARM: OMAP2+: gpmc: remove cs# in sync clk div calc
  mtd: onenand: omap: cleanup gpmc dependency
  mtd: nand: omap: free region as per resource size
  mtd: nand: omap: read nand using register address
  ARM: OMAP2+: onenand: connected soc info in pdata
  mtd: onenand: omap: use pdata info instead of cpu_is
  ARM: OMAP2+: onenand: header cleanup
  ARM: OMAP2+: nand: header cleanup
  mtd: nand: omap: bring in gpmc nand macros
  ARM: OMAP2+: nand: bch capability check
  ARM: OMAP2+: gpmc: nand register helper bch update
  mtd: nand: omap: handle gpmc bch[48]
  ARM: OMAP2+: gpmc: remove exported nand functions
  ARM: OMAP2+: gpmc: localize gpmc header

Jon Hunter (1):
  ARM: OMAP2+: GPMC: Remove unused OneNAND get_freq() platform function

 arch/arm/mach-omap2/board-2430sdp.c|   2 +-
 arch/arm/mach-omap2/board-3430sdp.c|   2 +-
 arch/arm/mach-omap2/board-apollon.c|   2 +-
 arch/arm/mach-omap2/board-cm-t35.c |   5 +-
 arch/arm/mach-omap2/board-cm-t3517.c   |   5 +-
 arch/arm/mach-omap2/board-devkit8000.c |  10 +-
 arch/arm/mach-omap2/board-flash.c  |  50 +--
 arch/arm/mach-omap2/board-flash.h  |   8 +-
 arch/arm/mach-omap2/board-h4.c |   2 +-
 arch/arm/mach-omap2/board-igep0020.c   |   5 +-
 arch/arm/mach-omap2/board-ldp.c|   6 +-
 arch/arm/mach-omap2/board-n8x0.c   |   1 +
 arch/arm/mach-omap2/board-omap3beagle.c|  10 +-
 arch/arm/mach-omap2/board-omap3evm.c   |   8 +-
 arch/arm/mach-omap2/board-omap3logic.c |   2 +-
 arch/arm/mach-omap2/board-omap3pandora.c   |   3 +-
 arch/arm/mach-omap2/board-omap3stalker.c   |   2 +-
 arch/arm/mach-omap2/board-omap3touchbook.c |  10 +-
 arch/arm/mach-omap2/board-overo.c  |   9 +-
 arch/arm/mach-omap2/board-rm680.c  |   3 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c   |   3 +-
 arch/arm/mach-omap2/board-rx51.c   |   2 +-
 arch/arm/mach-omap2/board-zoom-debugboard.c|   2 +-
 arch/arm/mach-omap2/board-zoom.c   |   5 +-
 arch/arm/mach-omap2/common-board-devices.c |  46 ---
 arch/arm/mach-omap2/common-board-devices.h |   1 -
 arch/arm/mach-omap2/gpmc-nand.c|  85 ++--
 arch/arm/mach-omap2/gpmc-nand.h|  27 ++
 arch/arm/mach-omap2/gpmc-onenand.c | 214 +-
 arch/arm/mach-omap2/gpmc-onenand.h |  24 ++
 arch/arm/mach-omap2/gpmc-smc91x.c  |   2 +-
 arch/arm/mach-omap2/gpmc-smsc911x.c|   2 +-
 arch/arm/mach-omap2/gpmc.c | 459 +
 .../{plat-omap/include/plat = mach-omap2}/gpmc.h  |  61 +--
 arch/arm/mach-omap2/pm34xx.c   |   2 +-
 arch/arm/mach-omap2/usb-tusb6010.c |   2 +-
 drivers/mtd/nand/omap2.c   | 125 +-
 drivers/mtd/onenand/omap2.c|   9 +-
 include/linux/platform_data/mtd-nand-omap2.h   |  46 ++-
 include/linux/platform_data/mtd-onenand-omap2.h|  28 +-
 40 files changed, 493 insertions(+), 797 deletions(-)
 create mode 100644 arch/arm/mach-omap2/gpmc-nand.h
 create mode 100644 arch/arm/mach-omap2/gpmc-onenand.h
 rename arch/arm/{plat-omap/include/plat = mach-omap2}/gpmc.h (67%)
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ARM: dts: Add am335x-evmsk.dts

2012-10-15 Thread AnilKumar Ch
Add AM335X EVM-SK device tree source (am335x-sk.dts) file to use
the am33xx.dtsi SoC file, along with the memory node information.

Also adds support for tps65910 regulator and lis331dlh accelerometer.
Following drivers/functionality were tested on AM335x-EVM-SK.
* I2C
* TPS65910 regulators
* lis331dlh accelerometer

AM335x EVM Starter Kit details can be accessed from:
http://www.ti.com/tool/tmdssk3358

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evmsk.dts |  166 
 1 file changed, 166 insertions(+)
 create mode 100644 arch/arm/boot/dts/am335x-evmsk.dts

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
new file mode 100644
index 000..6f53879
--- /dev/null
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.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.
+ */
+
+/*
+ * AM335x Starter Kit
+ * http://www.ti.com/tool/tmdssk3358
+ */
+
+/dts-v1/;
+
+/include/ am33xx.dtsi
+
+/ {
+   model = TI AM335x EVM-SK;
+   compatible = ti,am335x-evmsk, ti,am33xx;
+
+   cpus {
+   cpu@0 {
+   cpu0-supply = vdd1_reg;
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0x8000 0x1000; /* 256 MB */
+   };
+
+   ocp {
+   uart1: serial@44e09000 {
+   status = okay;
+   };
+
+   i2c1: i2c@44e0b000 {
+   status = okay;
+   clock-frequency = 40;
+
+   tps: tps@2d {
+   reg = 0x2d;
+   };
+
+   lis331dlh: lis331dlh@18 {
+   compatible = st,lis331dlh, st,lis3lv02d;
+   reg = 0x18;
+   Vdd-supply = lis3_reg;
+   Vdd_IO-supply = lis3_reg;
+
+   st,click-single-x;
+   st,click-single-y;
+   st,click-single-z;
+   st,click-thresh-x = 10;
+   st,click-thresh-y = 10;
+   st,click-thresh-z = 10;
+   st,irq1-click;
+   st,irq2-click;
+   st,wakeup-x-lo;
+   st,wakeup-x-hi;
+   st,wakeup-y-lo;
+   st,wakeup-y-hi;
+   st,wakeup-z-lo;
+   st,wakeup-z-hi;
+   st,min-limit-x = 120;
+   st,min-limit-y = 120;
+   st,min-limit-z = 140;
+   st,max-limit-x = 550;
+   st,max-limit-y = 550;
+   st,max-limit-z = 750;
+   };
+   };
+   };
+
+   vbat: fixedregulator@0 {
+   compatible = regulator-fixed;
+   regulator-name = vbat;
+   regulator-min-microvolt = 500;
+   regulator-max-microvolt = 500;
+   regulator-boot-on;
+   };
+
+   lis3_reg: fixedregulator@1 {
+   compatible = regulator-fixed;
+   regulator-name = lis3_reg;
+   regulator-boot-on;
+   };
+};
+
+/include/ tps65910.dtsi
+
+tps {
+   vcc1-supply = vbat;
+   vcc2-supply = vbat;
+   vcc3-supply = vbat;
+   vcc4-supply = vbat;
+   vcc5-supply = vbat;
+   vcc6-supply = vbat;
+   vcc7-supply = vbat;
+   vccio-supply = vbat;
+
+   regulators {
+   vrtc_reg: regulator@0 {
+   regulator-always-on;
+   };
+
+   vio_reg: regulator@1 {
+   regulator-always-on;
+   };
+
+   vdd1_reg: regulator@2 {
+   /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% 
tolerance */
+   regulator-name = vdd_mpu;
+   regulator-min-microvolt = 912500;
+   regulator-max-microvolt = 1312500;
+   regulator-boot-on;
+   regulator-always-on;
+   };
+
+   vdd2_reg: regulator@3 {
+   /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% 
tolerance */
+   regulator-name = vdd_core;
+   regulator-min-microvolt = 912500;
+   regulator-max-microvolt = 115;
+   regulator-boot-on;
+   

Re: [PATCH v3 0/7] usb: dwc3-omap: add dt support

2012-10-15 Thread Felipe Balbi
Hi,

On Mon, Oct 08, 2012 at 02:53:49PM +0530, Kishon Vijay Abraham I wrote:
 This patch series adds dt support to dwc3 core and fixes few minor
 stuff in dwc3-omap glue to get dwc3 working.
 
 While at that it also uses *of_platform* to create the child device
 (dwc3-core) and fixes to use runtime API's to enable clock and write
 to SYSCONFIG register.
 
 Changes from v2:
 * Fixed Sergei comment to use of_property_read_u32 insted of of_get_property
 
 Changes from v1:
 * made device_for_each_child() as a seperate patch
 * made all other minor fixes wrt typos and function renames
 
 This patch series is developed on:
 git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git dwc3

will any of the DT folks review this or should I take it as is ? I'd
like to keep this in linux-next for a long time for v3.8 merge window.

cheers

 Kishon Vijay Abraham I (7):
   usb: dwc3-omap: use device_for_each_child to handle child removal
   usb: dwc3-omap: use of_platform API to create dwc3 core pdev
   usb: dwc3-omap: use runtime API's to enable clocks
   usb: dwc3-omap: Remove explicit writes to SYSCONFIG register
   usb: dwc3-omap: Add an API to write to dwc mailbox
   usb: dwc3-omap: Minor fixes to get dt working
   usb: dwc3: core: add dt support for dwc3 core
 
  Documentation/devicetree/bindings/usb/dwc3.txt |   23 
  drivers/usb/dwc3/core.c|   14 +-
  drivers/usb/dwc3/dwc3-omap.c   |  173 
 +---
  include/linux/usb/dwc3-omap.h  |   30 
  4 files changed, 160 insertions(+), 80 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
  create mode 100644 include/linux/usb/dwc3-omap.h
 
 -- 
 1.7.9.5
 

-- 
balbi


signature.asc
Description: Digital signature


RE: [PATCH 0/4] OMAP-GPMC generic timing migration

2012-10-15 Thread Mohammed, Afzal
Hi Tony,

On Thu, Oct 11, 2012 at 20:17:56, Tony Lindgren wrote:
 * Mohammed, Afzal af...@ti.com [121011 05:48]:

 After -rc1 is out, let's plan on adding the minimal
 set required for removing plat and mach includes from
 drivers into a clean-up branch. Afzal, can you maybe
 do a pull request for that set against -rc1 when it's
 out? Just the minimal set of patches.

Pull request on gpmc cleanup for common ARM zImage has
been sent.

 Yes, then please do a second pull request for what's needed
 to apply the minimal DT bindings. For the DT binding, let's
 just leave out the timings for now as we can load those from
 auxdata. Then the binding for the timings can be added
 later on. So just the minimal binding using standard features
 for the iorange and interrupt.

Ok, I will keep timings aside for now and proceed with DT
(avoiding auxdata usage with generic routine looked to me a
saner approach though, with an initial DT'fy delay)

Regards
Afzal


Re: [PATCH] USB: DWC3: Shutdown usb_phy when removing the device

2012-10-15 Thread Vivek Gautam
Hi Felipe,

On Mon, Oct 15, 2012 at 5:44 PM, Felipe Balbi ba...@ti.com wrote:
 On Sat, Oct 13, 2012 at 07:20:18PM +0530, Vivek Gautam wrote:
 We do usb_phy_init() while doing core_init() in probe,
 so adding usb_phy_shutdown() when we do core_exit()
 while removing the device.

 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com

 I believe this needs to be sent to stable too for v3.6, right ?

As i can see, 51e1e7b usb: dwc3: add basic PHY support, is yet to be
merged in stable. Then only it will be possible to merge this in stable, right ?

 please resend with a proper Cc: sta...@vger.kernel.org # v3.6 tag

 ---
  drivers/usb/dwc3/core.c |4 
  1 files changed, 4 insertions(+), 0 deletions(-)

 diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
 index b415c0c..c14ebc9 100644
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
 @@ -409,6 +409,10 @@ static void dwc3_core_exit(struct dwc3 *dwc)
  {
   dwc3_event_buffers_cleanup(dwc);
   dwc3_free_event_buffers(dwc);
 +
 + usb_phy_shutdown(dwc-usb2_phy);
 + usb_phy_shutdown(dwc-usb3_phy);
 +
  }

  #define DWC3_ALIGN_MASK  (16 - 1)
 --
 1.7.6.5


 --
 balbi

Thanks  Regards
Vivek
--
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 v4 7/7] usb: dwc3: core: add dt support for dwc3 core

2012-10-15 Thread Kishon Vijay Abraham I
Added dwc3 support for dwc3 core and update the documentation with
device tree binding information.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 Documentation/devicetree/bindings/usb/dwc3.txt |   23 +++
 drivers/usb/dwc3/core.c|   14 --
 2 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt

diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt 
b/Documentation/devicetree/bindings/usb/dwc3.txt
new file mode 100644
index 000..9ec9316
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/dwc3.txt
@@ -0,0 +1,23 @@
+synopsys DWC3 CORE
+
+DWC3- USB3 CONTROLLER
+
+Required properties:
+ - compatible: must be synopsys,dwc3
+ - reg : Address and length of the register set for the device
+ - interrupts: Interrupts used by the dwc3 controller.
+ - interrupt-parent: the phandle for the interrupt controller that
+   services interrupts for this device.
+
+Optional properties:
+ - tx-fifo-resize: determines if the FIFO *has* to be reallocated.
+
+This is usually a subnode to DWC3 glue to which it is connected.
+
+dwc3@4a03 {
+   compatible = synopsys,dwc3;
+   reg = 0x4a03 0xcfff;
+   interrupts = 0 92 4
+   interrupt-parent = gic
+   tx-fifo-resize;
+};
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index b923183..c76d8e9 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -491,8 +491,7 @@ static int __devinit dwc3_probe(struct platform_device 
*pdev)
else
dwc-maximum_speed = DWC3_DCFG_SUPERSPEED;
 
-   if (of_get_property(node, tx-fifo-resize, NULL))
-   dwc-needs_fifo_resize = true;
+   dwc-needs_fifo_resize = of_property_read_bool(node, tx-fifo-resize);
 
pm_runtime_enable(dev);
pm_runtime_get_sync(dev);
@@ -619,11 +618,22 @@ static int __devexit dwc3_remove(struct platform_device 
*pdev)
return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id of_dwc3_match[] = {
+   {
+   .compatible = synopsys,dwc3
+   },
+   { },
+};
+MODULE_DEVICE_TABLE(of, of_dwc3_match);
+#endif
+
 static struct platform_driver dwc3_driver = {
.probe  = dwc3_probe,
.remove = __devexit_p(dwc3_remove),
.driver = {
.name   = dwc3,
+   .of_match_table = of_match_ptr(of_dwc3_match),
},
 };
 
-- 
1.7.9.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 v4 1/7] usb: dwc3-omap: use device_for_each_child to handle child removal

2012-10-15 Thread Kishon Vijay Abraham I
Used device_for_each_child() to handle child device (dwc3 core) removal
during devexit of dwc3 omap.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/usb/dwc3/dwc3-omap.c |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index ee57a10..d51c69c 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -262,6 +262,15 @@ static irqreturn_t dwc3_omap_interrupt(int irq, void 
*_omap)
return IRQ_HANDLED;
 }
 
+static int dwc3_omap_remove_core(struct device *dev, void *c)
+{
+   struct platform_device *pdev = to_platform_device(dev);
+
+   platform_device_unregister(pdev);
+
+   return 0;
+}
+
 static int __devinit dwc3_omap_probe(struct platform_device *pdev)
 {
struct dwc3_omap_data   *pdata = pdev-dev.platform_data;
@@ -434,11 +443,11 @@ static int __devexit dwc3_omap_remove(struct 
platform_device *pdev)
 {
struct dwc3_omap*omap = platform_get_drvdata(pdev);
 
-   platform_device_unregister(omap-dwc3);
platform_device_unregister(omap-usb2_phy);
platform_device_unregister(omap-usb3_phy);
 
dwc3_put_device_id(omap-dwc3-id);
+   device_for_each_child(pdev-dev, NULL, dwc3_omap_remove_core);
 
return 0;
 }
-- 
1.7.9.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 v4 0/7] usb: dwc3-omap: add dt support

2012-10-15 Thread Kishon Vijay Abraham I
This patch series adds dt support to dwc3 core and fixes few minor
stuff in dwc3-omap glue to get dwc3 working.

While at that it also uses *of_platform* to create the child device
(dwc3-core) and fixes to use runtime API's to enable clock and write
to SYSCONFIG register.

Changes from v3:
* rebased to latest commit in balbi's tree
* Fixed few typos in the commit log
* Added *extern* keyword for dwc3_omap_mailbox function declaration

Changes from v2:
* Fixed Sergei comment to use of_property_read_u32 insted of of_get_property

Changes from v1:
* made device_for_each_child() as a seperate patch
* made all other minor fixes wrt typos and function renames

This patch series is developed on:
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git dwc3

Kishon Vijay Abraham I (7):
  usb: dwc3-omap: use device_for_each_child to handle child removal
  usb: dwc3-omap: use of_platform API to create dwc3 core pdev
  usb: dwc3-omap: use runtime API's to enable clocks
  usb: dwc3-omap: Remove explicit writes to SYSCONFIG register
  usb: dwc3-omap: Add an API to write to dwc mailbox
  usb: dwc3-omap: Minor fixes to get dt working
  usb: dwc3: core: add dt support for dwc3 core

 Documentation/devicetree/bindings/usb/dwc3.txt |   23 
 drivers/usb/dwc3/core.c|   14 +-
 drivers/usb/dwc3/dwc3-omap.c   |  172 +---
 include/linux/usb/dwc3-omap.h  |   30 +
 4 files changed, 162 insertions(+), 77 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
 create mode 100644 include/linux/usb/dwc3-omap.h

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


Re: [PATCH] USB: DWC3: Shutdown usb_phy when removing the device

2012-10-15 Thread Felipe Balbi
On Mon, Oct 15, 2012 at 06:56:13PM +0530, Vivek Gautam wrote:
 Hi Felipe,
 
 On Mon, Oct 15, 2012 at 5:44 PM, Felipe Balbi ba...@ti.com wrote:
  On Sat, Oct 13, 2012 at 07:20:18PM +0530, Vivek Gautam wrote:
  We do usb_phy_init() while doing core_init() in probe,
  so adding usb_phy_shutdown() when we do core_exit()
  while removing the device.
 
  Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
 
  I believe this needs to be sent to stable too for v3.6, right ?
 
 As i can see, 51e1e7b usb: dwc3: add basic PHY support, is yet to be
 merged in stable. Then only it will be possible to merge this in
 stable, right ?

oh indeed. that was added on v3.7 merge window. My bad. No need to Cc
stable, I'll apply this as a fix.

cheers

-- 
balbi


signature.asc
Description: Digital signature


[PATCH v4 6/7] usb: dwc3-omap: Minor fixes to get dt working

2012-10-15 Thread Kishon Vijay Abraham I
Includes few minor fixes in dwc3-omap like populating the compatible
string in a correct way, extracting the utmi-mode property properly and
changing the index of get_irq since irq of core is removed from hwmod
entry.
Also updated the documentation with dwc3-omap device tree binding
information.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/usb/dwc3/dwc3-omap.c |   14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index b84ddf3..10aad46 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -318,11 +318,10 @@ static int __devinit dwc3_omap_probe(struct 
platform_device *pdev)
struct resource *res;
struct device   *dev = pdev-dev;
 
-   int size;
int ret = -ENOMEM;
int irq;
 
-   const u32   *utmi_mode;
+   u32 utmi_mode;
u32 reg;
 
void __iomem*base;
@@ -336,13 +335,13 @@ static int __devinit dwc3_omap_probe(struct 
platform_device *pdev)
 
platform_set_drvdata(pdev, omap);
 
-   irq = platform_get_irq(pdev, 1);
+   irq = platform_get_irq(pdev, 0);
if (irq  0) {
dev_err(dev, missing IRQ resource\n);
return -EINVAL;
}
 
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, missing memory base resource\n);
return -EINVAL;
@@ -389,9 +388,8 @@ static int __devinit dwc3_omap_probe(struct platform_device 
*pdev)
 
reg = dwc3_omap_readl(omap-base, USBOTGSS_UTMI_OTG_STATUS);
 
-   utmi_mode = of_get_property(node, utmi-mode, size);
-   if (utmi_mode  size == sizeof(*utmi_mode)) {
-   reg |= *utmi_mode;
+   if (!of_property_read_u32(node, utmi-mode, utmi_mode)) {
+   reg |= utmi_mode;
} else {
if (!pdata) {
dev_dbg(dev, missing platform data\n);
@@ -469,7 +467,7 @@ static int __devexit dwc3_omap_remove(struct 
platform_device *pdev)
 
 static const struct of_device_id of_dwc3_matach[] = {
{
-   ti,dwc3,
+   .compatible =   ti,dwc3
},
{ },
 };
-- 
1.7.9.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 v4 3/7] usb: dwc3-omap: use runtime API's to enable clocks

2012-10-15 Thread Kishon Vijay Abraham I
Before accessing any register, runtime API's should be invoked to enable
the clocks. runtime API's are added here to prevent abort during register
access.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/usb/dwc3/dwc3-omap.c |   11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 4aaeec4..1fdf7e2 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -43,6 +43,7 @@
 #include linux/spinlock.h
 #include linux/platform_device.h
 #include linux/platform_data/dwc3-omap.h
+#include linux/pm_runtime.h
 #include linux/dma-mapping.h
 #include linux/ioport.h
 #include linux/io.h
@@ -336,6 +337,13 @@ static int __devinit dwc3_omap_probe(struct 
platform_device *pdev)
omap-irq   = irq;
omap-base  = base;
 
+   pm_runtime_enable(dev);
+   ret = pm_runtime_get_sync(dev);
+   if (ret  0) {
+   dev_err(dev, get_sync failed with err %d\n, ret);
+   return ret;
+   }
+
reg = dwc3_omap_readl(omap-base, USBOTGSS_UTMI_OTG_STATUS);
 
utmi_mode = of_get_property(node, utmi-mode, size);
@@ -417,6 +425,9 @@ static int __devexit dwc3_omap_remove(struct 
platform_device *pdev)
platform_device_unregister(omap-usb2_phy);
platform_device_unregister(omap-usb3_phy);
 
+   pm_runtime_put_sync(pdev-dev);
+   pm_runtime_disable(pdev-dev);
+
device_for_each_child(pdev-dev, NULL, dwc3_omap_remove_core);
 
return 0;
-- 
1.7.9.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 v4 5/7] usb: dwc3-omap: Add an API to write to dwc mailbox

2012-10-15 Thread Kishon Vijay Abraham I
Add an API in the omap glue layer to write to the mailbox register which
can be used by comparator driver(twl). To pass the detection of the attached
device (signified by VBUS, ID) to the dwc3 core, dwc3 glue has to write
to the mailbox regiter.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/usb/dwc3/dwc3-omap.c  |   60 +
 include/linux/usb/dwc3-omap.h |   30 +
 2 files changed, 90 insertions(+)
 create mode 100644 include/linux/usb/dwc3-omap.h

diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index edc7292..b84ddf3 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -43,6 +43,7 @@
 #include linux/spinlock.h
 #include linux/platform_device.h
 #include linux/platform_data/dwc3-omap.h
+#include linux/usb/dwc3-omap.h
 #include linux/pm_runtime.h
 #include linux/dma-mapping.h
 #include linux/ioport.h
@@ -131,6 +132,8 @@ struct dwc3_omap {
u32 dma_status:1;
 };
 
+struct dwc3_omap   *_omap;
+
 static inline u32 dwc3_omap_readl(void __iomem *base, u32 offset)
 {
return readl(base + offset);
@@ -141,6 +144,57 @@ static inline void dwc3_omap_writel(void __iomem *base, 
u32 offset, u32 value)
writel(value, base + offset);
 }
 
+void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status)
+{
+   u32 val;
+   struct dwc3_omap*omap = _omap;
+
+   switch (status) {
+   case OMAP_DWC3_ID_GROUND:
+   dev_dbg(omap-dev, ID GND\n);
+
+   val = dwc3_omap_readl(omap-base, USBOTGSS_UTMI_OTG_STATUS);
+   val = ~(USBOTGSS_UTMI_OTG_STATUS_IDDIG
+   | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID
+   | USBOTGSS_UTMI_OTG_STATUS_SESSEND);
+   val |= USBOTGSS_UTMI_OTG_STATUS_SESSVALID
+   | USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT;
+   dwc3_omap_writel(omap-base, USBOTGSS_UTMI_OTG_STATUS, val);
+   break;
+
+   case OMAP_DWC3_VBUS_VALID:
+   dev_dbg(omap-dev, VBUS Connect\n);
+
+   val = dwc3_omap_readl(omap-base, USBOTGSS_UTMI_OTG_STATUS);
+   val = ~USBOTGSS_UTMI_OTG_STATUS_SESSEND;
+   val |= USBOTGSS_UTMI_OTG_STATUS_IDDIG
+   | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID
+   | USBOTGSS_UTMI_OTG_STATUS_SESSVALID
+   | USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT;
+   dwc3_omap_writel(omap-base, USBOTGSS_UTMI_OTG_STATUS, val);
+   break;
+
+   case OMAP_DWC3_ID_FLOAT:
+   case OMAP_DWC3_VBUS_OFF:
+   dev_dbg(omap-dev, VBUS Disconnect\n);
+
+   val = dwc3_omap_readl(omap-base, USBOTGSS_UTMI_OTG_STATUS);
+   val = ~(USBOTGSS_UTMI_OTG_STATUS_SESSVALID
+   | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID
+   | USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT);
+   val |= USBOTGSS_UTMI_OTG_STATUS_SESSEND
+   | USBOTGSS_UTMI_OTG_STATUS_IDDIG;
+   dwc3_omap_writel(omap-base, USBOTGSS_UTMI_OTG_STATUS, val);
+   break;
+
+   default:
+   dev_dbg(omap-dev, ID float\n);
+   }
+
+   return;
+}
+EXPORT_SYMBOL_GPL(dwc3_omap_mailbox);
+
 static int __devinit dwc3_omap_register_phys(struct dwc3_omap *omap)
 {
struct nop_usb_xceiv_platform_data pdata;
@@ -320,6 +374,12 @@ static int __devinit dwc3_omap_probe(struct 
platform_device *pdev)
omap-irq   = irq;
omap-base  = base;
 
+   /*
+* REVISIT if we ever have two instances of the wrapper, we will be
+* in big trouble
+*/
+   _omap   = omap;
+
pm_runtime_enable(dev);
ret = pm_runtime_get_sync(dev);
if (ret  0) {
diff --git a/include/linux/usb/dwc3-omap.h b/include/linux/usb/dwc3-omap.h
new file mode 100644
index 000..1107d8c
--- /dev/null
+++ b/include/linux/usb/dwc3-omap.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2011-2012 by Texas Instruments
+ *
+ * The Inventra Controller Driver for Linux 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.
+ */
+
+#ifndef __DWC3_OMAP_H__
+#define __DWC3_OMAP_H__
+
+enum omap_dwc3_vbus_id_status {
+   OMAP_DWC3_UNKNOWN = 0,
+   OMAP_DWC3_ID_GROUND,
+   OMAP_DWC3_ID_FLOAT,
+   OMAP_DWC3_VBUS_VALID,
+   OMAP_DWC3_VBUS_OFF,
+};
+
+#if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE))
+extern void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status);
+#else
+static inline void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status)
+{
+   return;
+}
+#endif
+
+#endif /* __DWC3_OMAP_H__ */
-- 
1.7.9.5

--
To unsubscribe from this list: send the 

[PATCH v4 4/7] usb: dwc3-omap: Remove explicit writes to SYSCONFIG register

2012-10-15 Thread Kishon Vijay Abraham I
The runtime API's takes care of setting the SYSCONFIG register with
appropriate values. Hence explicit writes to SYSCONFIG register is
removed.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/usb/dwc3/dwc3-omap.c |   26 --
 1 file changed, 26 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 1fdf7e2..edc7292 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -80,23 +80,6 @@
 
 /* SYSCONFIG REGISTER */
 #define USBOTGSS_SYSCONFIG_DMADISABLE  (1  16)
-#define USBOTGSS_SYSCONFIG_STANDBYMODE(x)  ((x)  4)
-
-#define USBOTGSS_STANDBYMODE_FORCE_STANDBY 0
-#define USBOTGSS_STANDBYMODE_NO_STANDBY1
-#define USBOTGSS_STANDBYMODE_SMART_STANDBY 2
-#define USBOTGSS_STANDBYMODE_SMART_WAKEUP  3
-
-#define USBOTGSS_STANDBYMODE_MASK  (0x03  4)
-
-#define USBOTGSS_SYSCONFIG_IDLEMODE(x) ((x)  2)
-
-#define USBOTGSS_IDLEMODE_FORCE_IDLE   0
-#define USBOTGSS_IDLEMODE_NO_IDLE  1
-#define USBOTGSS_IDLEMODE_SMART_IDLE   2
-#define USBOTGSS_IDLEMODE_SMART_WAKEUP 3
-
-#define USBOTGSS_IDLEMODE_MASK (0x03  2)
 
 /* IRQ_EOI REGISTER */
 #define USBOTGSS_IRQ_EOI_LINE_NUMBER   (1  0)
@@ -373,15 +356,6 @@ static int __devinit dwc3_omap_probe(struct 
platform_device *pdev)
reg = dwc3_omap_readl(omap-base, USBOTGSS_SYSCONFIG);
omap-dma_status = !!(reg  USBOTGSS_SYSCONFIG_DMADISABLE);
 
-   /* Set No-Idle and No-Standby */
-   reg = ~(USBOTGSS_STANDBYMODE_MASK
-   | USBOTGSS_IDLEMODE_MASK);
-
-   reg |= (USBOTGSS_SYSCONFIG_STANDBYMODE(USBOTGSS_STANDBYMODE_NO_STANDBY)
-   | USBOTGSS_SYSCONFIG_IDLEMODE(USBOTGSS_IDLEMODE_NO_IDLE));
-
-   dwc3_omap_writel(omap-base, USBOTGSS_SYSCONFIG, reg);
-
ret = devm_request_irq(dev, omap-irq, dwc3_omap_interrupt, 0,
dwc3-omap, omap);
if (ret) {
-- 
1.7.9.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 v4 2/7] usb: dwc3-omap: use of_platform API to create dwc3 core pdev

2012-10-15 Thread Kishon Vijay Abraham I
Used of_platform_populate() to populate dwc3 core platform_device
from device tree data. Since now the allocation of unique device id is
handled by of_*, removed the call to dwc3_get_device_id.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/usb/dwc3/dwc3-omap.c |   50 +-
 1 file changed, 10 insertions(+), 40 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index d51c69c..4aaeec4 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -47,6 +47,7 @@
 #include linux/ioport.h
 #include linux/io.h
 #include linux/of.h
+#include linux/of_platform.h
 
 #include linux/usb/otg.h
 #include linux/usb/nop-usb-xceiv.h
@@ -133,7 +134,6 @@ struct dwc3_omap {
/* device lock */
spinlock_t  lock;
 
-   struct platform_device  *dwc3;
struct platform_device  *usb2_phy;
struct platform_device  *usb3_phy;
struct device   *dev;
@@ -276,12 +276,10 @@ static int __devinit dwc3_omap_probe(struct 
platform_device *pdev)
struct dwc3_omap_data   *pdata = pdev-dev.platform_data;
struct device_node  *node = pdev-dev.of_node;
 
-   struct platform_device  *dwc3;
struct dwc3_omap*omap;
struct resource *res;
struct device   *dev = pdev-dev;
 
-   int devid;
int size;
int ret = -ENOMEM;
int irq;
@@ -324,34 +322,19 @@ static int __devinit dwc3_omap_probe(struct 
platform_device *pdev)
return ret;
}
 
-   devid = dwc3_get_device_id();
-   if (devid  0)
-   return -ENODEV;
-
-   dwc3 = platform_device_alloc(dwc3, devid);
-   if (!dwc3) {
-   dev_err(dev, couldn't allocate dwc3 device\n);
-   goto err1;
-   }
-
context = devm_kzalloc(dev, resource_size(res), GFP_KERNEL);
if (!context) {
dev_err(dev, couldn't allocate dwc3 context memory\n);
-   goto err2;
+   return -ENOMEM;
}
 
spin_lock_init(omap-lock);
-   dma_set_coherent_mask(dwc3-dev, dev-coherent_dma_mask);
 
-   dwc3-dev.parent = dev;
-   dwc3-dev.dma_mask = dev-dma_mask;
-   dwc3-dev.dma_parms = dev-dma_parms;
omap-resource_size = resource_size(res);
omap-context   = context;
omap-dev   = dev;
omap-irq   = irq;
omap-base  = base;
-   omap-dwc3  = dwc3;
 
reg = dwc3_omap_readl(omap-base, USBOTGSS_UTMI_OTG_STATUS);
 
@@ -396,7 +379,7 @@ static int __devinit dwc3_omap_probe(struct platform_device 
*pdev)
if (ret) {
dev_err(dev, failed to request IRQ #%d -- %d\n,
omap-irq, ret);
-   goto err2;
+   return ret;
}
 
/* enable all IRQs */
@@ -415,28 +398,16 @@ static int __devinit dwc3_omap_probe(struct 
platform_device *pdev)
 
dwc3_omap_writel(omap-base, USBOTGSS_IRQENABLE_SET_1, reg);
 
-   ret = platform_device_add_resources(dwc3, pdev-resource,
-   pdev-num_resources);
-   if (ret) {
-   dev_err(dev, couldn't add resources to dwc3 device\n);
-   goto err2;
-   }
-
-   ret = platform_device_add(dwc3);
-   if (ret) {
-   dev_err(dev, failed to register dwc3 device\n);
-   goto err2;
+   if (node) {
+   ret = of_platform_populate(node, NULL, NULL, dev);
+   if (ret) {
+   dev_err(pdev-dev,
+   failed to add create dwc3 core\n);
+   return ret;
+   }
}
 
return 0;
-
-err2:
-   platform_device_put(dwc3);
-
-err1:
-   dwc3_put_device_id(devid);
-
-   return ret;
 }
 
 static int __devexit dwc3_omap_remove(struct platform_device *pdev)
@@ -446,7 +417,6 @@ static int __devexit dwc3_omap_remove(struct 
platform_device *pdev)
platform_device_unregister(omap-usb2_phy);
platform_device_unregister(omap-usb3_phy);
 
-   dwc3_put_device_id(omap-dwc3-id);
device_for_each_child(pdev-dev, NULL, dwc3_omap_remove_core);
 
return 0;
-- 
1.7.9.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


Re: [PATCH] USB: DWC3: Shutdown usb_phy when removing the device

2012-10-15 Thread Vivek Gautam
Hi,

On Mon, Oct 15, 2012 at 6:54 PM, Felipe Balbi ba...@ti.com wrote:
 On Mon, Oct 15, 2012 at 06:56:13PM +0530, Vivek Gautam wrote:
 Hi Felipe,

 On Mon, Oct 15, 2012 at 5:44 PM, Felipe Balbi ba...@ti.com wrote:
  On Sat, Oct 13, 2012 at 07:20:18PM +0530, Vivek Gautam wrote:
  We do usb_phy_init() while doing core_init() in probe,
  so adding usb_phy_shutdown() when we do core_exit()
  while removing the device.
 
  Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
 
  I believe this needs to be sent to stable too for v3.6, right ?
 
 As i can see, 51e1e7b usb: dwc3: add basic PHY support, is yet to be
 merged in stable. Then only it will be possible to merge this in
 stable, right ?

 oh indeed. that was added on v3.7 merge window. My bad. No need to Cc
 stable, I'll apply this as a fix.

Ok, Thank you.
 cheers

 --
 balbi

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


Re: [PATCH v3] ARM: OMAP: i2c: fix interrupt flood during resume

2012-10-15 Thread Kalle Jokiniemi
ma, 2012-10-15 kello 15:41 +0530, Shubhrajyoti Datta kirjoitti:
 On Mon, Oct 15, 2012 at 2:46 PM, Kalle Jokiniemi
 kalle.jokini...@jollamobile.com wrote:
  ma, 2012-10-15 kello 09:21 +0300, Kalle Jokiniemi kirjoitti:
  Hi,
 
  pe, 2012-10-12 kello 14:46 +, Strashko, Grygorii kirjoitti:
   Hi Kevin,
  
   yep, [1] is the same fix - thanks.
  
   Hi Kalle,
  
   i've applied these changes and PM runtime fix on top of 
   git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git 
   (omap2plus_defconfig)
   Could you check it with your use case, pls? (just to be sure that idea 
   is right)
 
  Odd, it's not working. I'll add some debug prints to see what happens
  there.
 
  Well, seems after enabling irq 23 in the resume_noirq, someone does
  i2c_xfer and there is consequent flood of i2c_xfers and interrupts.
 If there is continuous xfers, you could enable debug LL and see who is
 queuing the
 transfers.
 
 
  Not sure now how these IRQ numbers get mapped these days, my debug print
  says it's irq number 72 (UART1 from TRM) that is flooding (although it's
  printed from the i2c-omap isr function, so it's still I2C bus irq...).
 
 Can you do a cat /proc/interrupts

Yes :)

[root@localhost proc]# cat
interrupts  

CPU0 
 20:  0  INTC  gpmc
 23:  2  INTC  TWL4030-PIH
 25:  0  INTC  l3-debug-irq
 26:  0  INTC  l3-app-irq
 28:  48157  INTC  DMA
 40:  0  INTC  omap-iommu.0
 52:  0  INTC  dsp_wdt
 53: 807807  INTC  gp_timer
 65:  0  INTC  omap-sham
 72:   5490  INTC  omap_i2c
 73: 85  INTC  omap_i2c
 77:  0  INTC  omap_i2c
 90:   1069  INTC  OMAP UART2
102:  55940  INTC  mmc0
179:   6142  GPIO  omap2-onenand
306:  44666  PRCM  pm_wkup
315:  4  PRCM  hwmod_io, pm_io
338:  0   twl4030  twl4030_gpio
343:  2   twl4030  twl4030_power
346:  0   twl4030  twl4030_pwrbutton
348:  2   twl4030  twl4030_usb
349:  0   twl4030  rtc0

Hmm, I did not notice that PIH handler before, makes sense now that it
triggers the flood (irq 23) as it is really the one that passes the
interrupts to other handlers.

- Kalle

 
 
 
  The irq enabling (in resume_noirq) is still slightly progressing after
  the flooding starts, but my watchdog kicks in before we get to the
  finish.
 
  Attached my debug prints patch and log. I used also no_console_suspend
  boot option.
 
  - Kalle
 


--
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] i2c: omap: revert i2c: omap: switch to threaded IRQ support

2012-10-15 Thread Paul Walmsley
Hi

On Mon, 15 Oct 2012, Felipe Balbi wrote:

 On Mon, Oct 15, 2012 at 01:51:08AM +, Paul Walmsley wrote:
  
  Commit 3b2f8f82dad7d1f79cdc8fc05bd1c94baf109bde (i2c: omap: switch to
  threaded IRQ support) causes communication with I2C devices to fail
  after system suspend/resume on all OMAP3 devices:
  
  ...
  [   40.228576] PM: noirq resume of devices complete after 3.723 msecs
  [   40.233184] PM: early resume of devices complete after 3.173 msecs
  [   40.242736] [sched_delayed] sched: RT throttling activated
  [   41.235046] omap_i2c omap_i2c.1: controller timed out
 
 instead of just reverting the patch, I'd rather try to figure out why
 controller times out in that situation.
 
 It should make no difference if you're running an IRQ thread or not.
 
 Do you have any extra debugging information which might help figuring
 out what the issue really is ?

As mentioned, the problem can be easily reproduced on OMAP3 is test by 
running

echo mem  /sys/power/state

in userspace when rootfs is on MMC.  Then wake up out of suspend, for 
example, by hitting ENTER on the serial console.

This needs to be part of the testing before any OMAP patches are posted to 
the lists -- if for no other reason than because Android kernels enter and 
exit system suspend frequently as part of their standard usage model.

 If the thread is actually at fault, then we need to add IRQF_NO_THREAD
 to the IRQ flags, otherwise same issue will appear if we boot with
 threadirqs kernel parameter.

...

 but it fails because I2C times out and I'd like to understand why,
 before just reverting the patch.

It doesn't matter to me how it's fixed as long as it's fixed quickly 
during the early 3.7-rcs.  


- 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 0/4] OMAP-GPMC generic timing migration

2012-10-15 Thread Tony Lindgren
* Mohammed, Afzal af...@ti.com [121015 05:42]:
 Hi Tony,
 
 On Thu, Oct 11, 2012 at 20:17:56, Tony Lindgren wrote:
  * Mohammed, Afzal af...@ti.com [121011 05:48]:
 
  After -rc1 is out, let's plan on adding the minimal
  set required for removing plat and mach includes from
  drivers into a clean-up branch. Afzal, can you maybe
  do a pull request for that set against -rc1 when it's
  out? Just the minimal set of patches.
 
 Pull request on gpmc cleanup for common ARM zImage has
 been sent.

Thanks.
 
  Yes, then please do a second pull request for what's needed
  to apply the minimal DT bindings. For the DT binding, let's
  just leave out the timings for now as we can load those from
  auxdata. Then the binding for the timings can be added
  later on. So just the minimal binding using standard features
  for the iorange and interrupt.
 
 Ok, I will keep timings aside for now and proceed with DT
 (avoiding auxdata usage with generic routine looked to me a
 saner approach though, with an initial DT'fy delay)

Oh well if you think it's easier to do the timings too in
the DT binding, please go ahead with that. It may take some
longer discussion on the lists for the binding though. But
up to you.

Regards,

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


[PATCH 1/4] MMC: omap_hsmmc: claim pinctrl at probe time

2012-10-15 Thread Venkatraman S
From: Daniel Mack zon...@gmail.com

This allows DT-driven board to set up the pin mux only when the driver
is in use.

Signed-off-by: Daniel Mack zon...@gmail.com
Cc: Venkatraman S svenk...@ti.com
Cc: Chris Ball c...@laptop.org
Cc: Grant Likely grant.lik...@secretlab.ca
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Linus Walleij linus.wall...@linaro.org
Cc: linux-omap@vger.kernel.org
Acked-by: Linus Walleij linus.wall...@linaro.org
Signed-off-by: Venkatraman S svenk...@ti.com
---
 drivers/mmc/host/omap_hsmmc.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 54bfd0c..01eeeae 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -37,6 +37,7 @@
 #include linux/io.h
 #include linux/gpio.h
 #include linux/regulator/consumer.h
+#include linux/pinctrl/consumer.h
 #include linux/pm_runtime.h
 #include mach/hardware.h
 #include plat/mmc.h
@@ -1720,6 +1721,7 @@ static int __devinit omap_hsmmc_probe(struct 
platform_device *pdev)
const struct of_device_id *match;
dma_cap_mask_t mask;
unsigned tx_req, rx_req;
+   struct pinctrl *pinctrl;
 
match = of_match_device(of_match_ptr(omap_mmc_of_match), pdev-dev);
if (match) {
@@ -1923,6 +1925,11 @@ static int __devinit omap_hsmmc_probe(struct 
platform_device *pdev)
 
omap_hsmmc_disable_irq(host);
 
+   pinctrl = devm_pinctrl_get_select_default(pdev-dev);
+   if (IS_ERR(pinctrl))
+   dev_warn(pdev-dev,
+   pins are not configured from the driver\n);
+
omap_hsmmc_protect_card(host);
 
mmc_add_host(mmc);
-- 
1.7.11.1.25.g0e18bef

--
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] MMC: omap_hsmmc: add DT property for max bus frequency

2012-10-15 Thread Venkatraman S
From: Daniel Mack zon...@gmail.com

Maximum bus frequency can be limited by external circuitry like level
shifters etc. Allow passing this value from DT.

Signed-off-by: Daniel Mack zon...@gmail.com
Cc: Venkatraman S svenk...@ti.com
Cc: Chris Ball c...@laptop.org
Cc: Grant Likely grant.lik...@secretlab.ca
Cc: Rob Herring rob.herr...@calxeda.com
Cc: linux-omap@vger.kernel.org
Signed-off-by: Venkatraman S svenk...@ti.com
---
 drivers/mmc/host/omap_hsmmc.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 01eeeae..a33ab74 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1674,7 +1674,7 @@ static struct omap_mmc_platform_data 
*of_get_hsmmc_pdata(struct device *dev)
 {
struct omap_mmc_platform_data *pdata;
struct device_node *np = dev-of_node;
-   u32 bus_width;
+   u32 bus_width, max_freq;
 
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
@@ -1701,6 +1701,9 @@ static struct omap_mmc_platform_data 
*of_get_hsmmc_pdata(struct device *dev)
if (of_find_property(np, ti,needs-special-reset, NULL))
pdata-slots[0].features |= HSMMC_HAS_UPDATED_RESET;
 
+   if (!of_property_read_u32(np, max-frequency, max_freq))
+   pdata-max_freq = max_freq;
+
return pdata;
 }
 #else
-- 
1.7.11.1.25.g0e18bef

--
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] mmc: omap_hsmmc: fix host reference after mmc_free_host

2012-10-15 Thread Venkatraman S
From: Balaji T K balaj...@ti.com

struct omap_hsmmc_host *host should not be accessed after mmc_free_host().
Reorder mmc_free_host() after iounmap(host-base).

Signed-off-by: Balaji T K balaj...@ti.com
Signed-off-by: Venkatraman S svenk...@ti.com
---
 drivers/mmc/host/omap_hsmmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index a33ab74..a3929b7 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2019,8 +2019,8 @@ static int __devexit omap_hsmmc_remove(struct 
platform_device *pdev)
clk_put(host-dbclk);
}
 
-   mmc_free_host(host-mmc);
iounmap(host-base);
+   mmc_free_host(host-mmc);
omap_hsmmc_gpio_free(pdev-dev.platform_data);
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- 
1.7.11.1.25.g0e18bef

--
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] mmc: omap_hsmmc: Fix NULL pointer dereference for dt boot

2012-10-15 Thread Venkatraman S
From: Balaji T K balaj...@ti.com

dev-platform_data is NULL in case of device tree boot,
instead use the saved version in struct omap_hsmmc_host.

Signed-off-by: Balaji T K balaj...@ti.com
Signed-off-by: Venkatraman S svenk...@ti.com
---
 drivers/mmc/host/omap_hsmmc.c | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index a3929b7..0b5e7ab 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -179,7 +179,8 @@ struct omap_hsmmc_host {
 
 static int omap_hsmmc_card_detect(struct device *dev, int slot)
 {
-   struct omap_mmc_platform_data *mmc = dev-platform_data;
+   struct omap_hsmmc_host *host = dev_get_drvdata(dev);
+   struct omap_mmc_platform_data *mmc = host-pdata;
 
/* NOTE: assumes card detect signal is active-low */
return !gpio_get_value_cansleep(mmc-slots[0].switch_pin);
@@ -187,7 +188,8 @@ static int omap_hsmmc_card_detect(struct device *dev, int 
slot)
 
 static int omap_hsmmc_get_wp(struct device *dev, int slot)
 {
-   struct omap_mmc_platform_data *mmc = dev-platform_data;
+   struct omap_hsmmc_host *host = dev_get_drvdata(dev);
+   struct omap_mmc_platform_data *mmc = host-pdata;
 
/* NOTE: assumes write protect signal is active-high */
return gpio_get_value_cansleep(mmc-slots[0].gpio_wp);
@@ -195,7 +197,8 @@ static int omap_hsmmc_get_wp(struct device *dev, int slot)
 
 static int omap_hsmmc_get_cover_state(struct device *dev, int slot)
 {
-   struct omap_mmc_platform_data *mmc = dev-platform_data;
+   struct omap_hsmmc_host *host = dev_get_drvdata(dev);
+   struct omap_mmc_platform_data *mmc = host-pdata;
 
/* NOTE: assumes card detect signal is active-low */
return !gpio_get_value_cansleep(mmc-slots[0].switch_pin);
@@ -205,7 +208,8 @@ static int omap_hsmmc_get_cover_state(struct device *dev, 
int slot)
 
 static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot)
 {
-   struct omap_mmc_platform_data *mmc = dev-platform_data;
+   struct omap_hsmmc_host *host = dev_get_drvdata(dev);
+   struct omap_mmc_platform_data *mmc = host-pdata;
 
disable_irq(mmc-slots[0].card_detect_irq);
return 0;
@@ -213,7 +217,8 @@ static int omap_hsmmc_suspend_cdirq(struct device *dev, int 
slot)
 
 static int omap_hsmmc_resume_cdirq(struct device *dev, int slot)
 {
-   struct omap_mmc_platform_data *mmc = dev-platform_data;
+   struct omap_hsmmc_host *host = dev_get_drvdata(dev);
+   struct omap_mmc_platform_data *mmc = host-pdata;
 
enable_irq(mmc-slots[0].card_detect_irq);
return 0;
@@ -2019,9 +2024,9 @@ static int __devexit omap_hsmmc_remove(struct 
platform_device *pdev)
clk_put(host-dbclk);
}
 
+   omap_hsmmc_gpio_free(host-pdata);
iounmap(host-base);
mmc_free_host(host-mmc);
-   omap_hsmmc_gpio_free(pdev-dev.platform_data);
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res)
-- 
1.7.11.1.25.g0e18bef

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


Re: [PATCH 0/4] MMC: some omap_hsmmc fixes

2012-10-15 Thread Venkatraman S
Daniel,
On Sat, Oct 13, 2012 at 2:31 PM, Daniel Mack zon...@gmail.com wrote:
 On 12.10.2012 12:58, Daniel Mack wrote:
 Here are some assorted patches for the omap_hsmmc driver that I need on
 top Linus' current development branch to make it work on a AM33xx board.

 1/4 and 2/4 qualify as bug fixes and I'm puzzled that these didn't hit
 anyone else yet.


 Daniel Mack (4):
   MMC: omap_hsmmc: set platform data after probe from DT node
   MMC: omap_hsmmc: fix DMA config block
   MMC: omap_hsmmc: claim pinctrl at probe time
   MMC: omap_hsmmc: add DT property for max bus frequency

 Ok, so 1/4 and 2/4 will be solved differently upstream, so they can be
 dropped.

 The other two remain, and 3/4 got an Acked-by Linus W.

Thanks.
I've just clubbed your two patches with Balaji's fixes and sent to Chris.
--
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: omap DSS fails with tft410 driver panel?

2012-10-15 Thread Enric Balletbo Serra
Hi Tomi,

Thanks for your answer.

2012/10/12 Tomi Valkeinen tomi.valkei...@ti.com:
 On 2012-10-11 18:58, Enric Balletbo Serra wrote:
 Hi all,

 I see that commit dac8eb5f (OMAPDSS: TFP410: rename dvi files to
 tfp410) and commit 2e6f2ee7 (OMAPDSS: TFP410: rename dvi - tfp410)
 changes the panel driver used on some boards. I tested current
 linux-next-20101011 kernel with my IGEPv2 board and DSS fails with
 following error (see http://pastebin.com/VjPGCQDt for full log) :

[   21.222808] omapdss OVERLAY error: check_overlay: paddr cannot be 0
[   21.229583] omapdss OVERLAY error: check_overlay: paddr cannot be 0
[   21.236236] omapfb omapfb: setup_plane failed

 Before checking what happens there is a known issue with this ?

 Works fine for me, although only with a quite minimal test environment.


I tried with a minimal environment (without X) and I don't see the
error, so looks you've reason and the problem is with my userspace
application (X). OTOH, I don't see the video output. I remember that
this worked before, but seems now is broken. I'll check mux and others
hints to try to solve the problem ..

 Looking at the log, it looks to me that your userspace is trying to
 configure the overlays, and that somehow leads to the driver getting
 zero as the fb address.

 I'm guessing that some wrong value is passed when configuring, or
 missing some step in configuring. However, It should be the omapfb that
 rejects configuration that would lead to paddr == 0, not omapdss, so
 there's definitely bug in the error handling of omapfb.

 Can you tell me more what's going on there? I presume the error happens
 when booting? What userspace component is using omapfb in your setup? X?

Yes, the error occurs while booting, and the rootfs tries to load X server.


 If you can, put some debug prints into omapfb-ioctl.c:omapfb_setup_plane
 to see what code path it takes, and where it goes wrong.


First I'll try to get video output without X, then, if you want I can
debug this problem if you think it's interesting.

Regards,
Enric
--
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: [balbi-usb:merge-result-for-greg 59/99] webcam.c:(.text+0x14afec): undefined reference to `config_ep_by_speed'

2012-10-15 Thread Greg KH
On Mon, Oct 15, 2012 at 09:49:20AM +0200, Sebastian Andrzej Siewior wrote:
 On 10/12/2012 06:39 PM, Fengguang Wu wrote:
 Hi Sebastian,
 
 Hi Fengguang,
 
 FYI, kernel build failed on
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 
 merge-result-for-greg
 head:   23953bde3e4d6aa8780dc054f6ad9882ac63f4f4
 commit: 721e2e91945bc2520d57d795dfe1b502ecec567c [59/99] usb: gadget: 
 libcomposite: move composite.c into libcomposite
 config: i386-randconfig-b199 (attached as .config)
 
 All error/warnings:
 
 drivers/built-in.o: In function `uvc_function_set_alt':
 
 Yes. I accidentally broke this and this still fails in 3.7-rc1. Greg
 has a patch for this in his tree (usb: gadget: Make webcam gadget
 select USB_LIBCOMPOSITE) which fixes this.

Yes, now queued up in my tree.

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


Re: [PATCH] i2c: omap: fix spurious IRQs: disable/enable IRQ at INTC when idle

2012-10-15 Thread Kevin Hilman
Kalle Jokiniemi kalle.jokini...@jollamobile.com writes:

 Hi,

 la, 2012-10-13 kello 01:00 +0530, Shubhrajyoti Datta kirjoitti:
 On Sat, Oct 13, 2012 at 12:10 AM, Kevin Hilman
 khil...@deeprootsystems.com wrote:
  From: Kevin Hilman khil...@ti.com
 
  Currently, runtime PM is used to keep the device enabled only during
  active transfers and for a configurable runtime PM autosuspend timout
  after an xfer.
 
  In addition to idling the device, driver's -runtime_suspend() method
  currently disables device interrupts when idle.  However, on some SoCs
  (notably OMAP4+), the I2C hardware may shared with other coprocessors.
  This means that the MPU will still recieve interrupts if a coprocessor
  is using the I2C device.  To avoid this, also disable interrupts at
  the MPU INTC when idling the device in -runtime_suspend() (and
  re-enable them in -runtime_resume().)  This part based on an original
  patch from Shubhrajyoti Datta.  NOTE: for proper sharing the I2C with
  a coprocessor, this driver still needs hwspinlock support added.
 
  This change is also meant to address an issue reported by Kalle
  Jokiniemi where I2C bus interrupt may be enabled before an I2C device
  interrupt handler (e.g. just after noirq resume phase) causing an

 It is actually in middle of resume_noirq.

  interrupt flood on the I2C bus interrupt before the device interrupt
  is enabled (e.g. interrupts coming from devices on I2C connected PMIC
  before the PMIC chained hanlder is enabled.)  This problem is addresed
  by ensuring that the I2C bus interrupt left disabled until an I2C xfer
  is requested.
 
 Looks good to me.
 Will wait for Kalle though.

 Does not work for me :(

 As I said, the issue occurs for me when I enter static suspend (echo mem
 /sys/power/autosleep or /sys/power/state). I don't think doing this
 just in runtime pm will fix my issue. Or do those handlers get run in
 the normal suspend path as well?

If the I2C device is still active during the suspend path, these
handlers will get run by the PM domain code (in omap_device.)  However,
now that I think about it, the current omap_device PM domain code calls
these at the noirq level, not the late/early level, so it does not
address your original problem. :(

I suspect we'll need this and your original patch.


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


Re: [PATCH v3] ARM: vfp: fix save and restore when running on pre-VFPv3 and CONFIG_VFPv3 set

2012-10-15 Thread Tony Lindgren
* Paul Walmsley p...@pwsan.com [121014 22:26]:
 
 After commit 846a136881b8f73c1f74250bf6acfaa309cab1f2 (ARM: vfp: fix
 saving d16-d31 vfp registers on v6+ kernels), the OMAP 2430SDP board
 started crashing during boot with omap2plus_defconfig:
 
 [3.875122] mmcblk0: mmc0:e624 SD04G 3.69 GiB
 [3.915954]  mmcblk0: p1
 [4.086639] Internal error: Oops - undefined instruction: 0 [#1] SMP ARM
 [4.093719] Modules linked in:
 [4.096954] CPU: 0Not tainted  (3.6.0-02232-g759e00b #570)
 [4.103149] PC is at vfp_reload_hw+0x1c/0x44
 [4.107666] LR is at __und_usr_fault_32+0x0/0x8
 
 It turns out that the context save/restore fix unmasked a latent bug
 in commit 5aaf254409f8d58229107b59507a8235b715a960 (ARM: 6203/1: Make
 VFPv3 usable on ARMv6).  When CONFIG_VFPv3 is set, but the kernel is
 booted on a pre-VFPv3 core, the code attempts to save and restore the
 d16-d31 VFP registers.  These are only present on non-D16 VFPv3+, so
 this results in an undefined instruction exception.  The code didn't
 crash before commit 846a136 because the save and restore code was
 only touching d0-d15, present on all VFP.
 
 Fix by implementing a request from Russell King to add a new HWCAP
 flag that affirmatively indicates the presence of the d16-d31
 registers:
 
http://marc.info/?l=linux-arm-kernelm=135013547905283w=2
 
 and some feedback from Måns to clarify the name of the HWCAP flag.
 
 Signed-off-by: Paul Walmsley p...@pwsan.com
 Cc: Tony Lindgren t...@atomide.com
 Cc: Russell King rmk+ker...@arm.linux.org.uk
 Cc: Catalin Marinas catalin.mari...@arm.com
 Cc: Dave Martin dave.mar...@linaro.org
 Cc: Måns Rullgård mans.rullg...@linaro.org

This fixes the error above on my 2430sdp:

Tested-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 1/4] mtd: nand: omap2: Update nerrors using ecc.strength

2012-10-15 Thread Peter Korsgaard
 Philip, Avinash avinashphi...@ti.com writes:

  Update number of errors using nand ecc strength.
  Also add macro definitions BCH8_ERROR_MAX  BCH4_ERROR_MAX

  Signed-off-by: Philip, Avinash avinashphi...@ti.com
  ---
  :100644 100644 5b31386... af511a9... M   drivers/mtd/nand/omap2.c
   drivers/mtd/nand/omap2.c |   12 
   1 files changed, 8 insertions(+), 4 deletions(-)

  diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
  index 5b31386..af511a9 100644
  --- a/drivers/mtd/nand/omap2.c
  +++ b/drivers/mtd/nand/omap2.c
  @@ -111,6 +111,9 @@
   #define ECCCLEAR0x100
   #define ECC10x1
 
  +#define BCH8_MAX_ERROR  8   /* upto 8 bit coorectable */
  +#define BCH4_MAX_ERROR  4   /* upto 4 bit correctable */

First 'correctable' misspelled.

I don't personally think these defines improve readability very much
compared to to just using 4/8, though.

-- 
Bye, Peter Korsgaard
--
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] ARM: OMAP2: gpmc: Add support for BCH ECC scheme

2012-10-15 Thread Peter Korsgaard
 Philip, Avinash avinashphi...@ti.com writes:

  Add support for BCH ECC scheme to gpmc driver and also enabling multi
  sector read/write. This helps in doing single shot NAND page read and
  write.

  ECC engine configurations
  BCH 4 bit support
  1. write = ECC engine configured in wrap mode 6 and with ecc_size0 as 32.
  2. read  = ECC engine configured in wrap mode 1 and with ecc_size0 as
  13 and ecc_size1 as 1.

  BCH 8 bit support
  1. write = ECC engine configured in wrap mode 6 and with ecc_size0 as 32.
  2. read  = ECC engine configured in wrap mode 1 and with ecc_size0 as
  26 and ecc_size1 as 2.

  Note: For BCH8 ECC bytes set to 14 to make compatible with RBL.

On what device? In the am335x TRM (spruh73f.pdf) figure 26-15 (pg 4273)
the rom code is documented to not use any padding on the ECC bytes
(E.G. oob 2..53):

http://www.ti.com/litv/pdf/spruh73f

I see the driver in the u-boot-am33x tree (ti81xx_nand.c) seems to use
4x14 bytes as well though, so perhaps that's a bug in the documentation
instead?

-- 
Bye, Peter Korsgaard
--
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: [balbi-usb:merge-result-for-greg 59/99] webcam.c:(.text+0x14afec): undefined reference to `config_ep_by_speed'

2012-10-15 Thread Felipe Balbi
Hi,

On Mon, Oct 15, 2012 at 09:29:14AM -0700, Greg KH wrote:
 On Mon, Oct 15, 2012 at 09:49:20AM +0200, Sebastian Andrzej Siewior wrote:
  On 10/12/2012 06:39 PM, Fengguang Wu wrote:
  Hi Sebastian,
  
  Hi Fengguang,
  
  FYI, kernel build failed on
  
  tree:   git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 
  merge-result-for-greg
  head:   23953bde3e4d6aa8780dc054f6ad9882ac63f4f4
  commit: 721e2e91945bc2520d57d795dfe1b502ecec567c [59/99] usb: gadget: 
  libcomposite: move composite.c into libcomposite
  config: i386-randconfig-b199 (attached as .config)
  
  All error/warnings:
  
  drivers/built-in.o: In function `uvc_function_set_alt':
  
  Yes. I accidentally broke this and this still fails in 3.7-rc1. Greg
  has a patch for this in his tree (usb: gadget: Make webcam gadget
  select USB_LIBCOMPOSITE) which fixes this.
 
 Yes, now queued up in my tree.

thanks Greg ;-)

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 2/4] mtd: devices: elm: Add support for ELM error correction

2012-10-15 Thread Peter Korsgaard
 Philip, Avinash avinashphi...@ti.com writes:

  Platforms containing the ELM module can be used to correct errors
  reported by BCH 4, 8  16 bit ECC scheme. For now only 4  8 bit
  support is added.

This sounds odd to me. What about something like:

The ELM hardware module can be used to speedup BCH 4/8/16 ECC scheme
error correction.

For now only 4  8 bit support is added.


  +++ b/drivers/mtd/devices/Makefile
  @@ -17,8 +17,10 @@ obj-$(CONFIG_MTD_LART)+= lart.o
   obj-$(CONFIG_MTD_BLOCK2MTD) += block2mtd.o
   obj-$(CONFIG_MTD_DATAFLASH) += mtd_dataflash.o
   obj-$(CONFIG_MTD_M25P80)+= m25p80.o
  +obj-$(CONFIG_MTD_NAND_OMAP2)+= elm.o

You seem to only use it in 4/4 if CONFIG_MTD_NAND_OMAP_BCH is set, so it
probably makes more sense to use that symbol to not needlessly include
it if it won't be used.


  +++ b/drivers/mtd/devices/elm.c
  @@ -0,0 +1,440 @@
  +/*
  + * Error Location Module
  + *
  + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
  + *
  + * This program is free software; you can redistribute it and/or modify
  + * it under the terms of the GNU General Public License as published by
  + * the Free Software Foundation; either version 2 of the License, or
  + * (at your option) any later version.
  + *
  + * This program is distributed in the hope that it will be useful,
  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  + * GNU General Public License for more details.
  + *
  + */
  +
  +#include linux/platform_device.h
  +#include linux/module.h
  +#include linux/interrupt.h
  +#include linux/io.h
  +#include linux/of.h
  +#include linux/pm_runtime.h
  +#include linux/platform_data/elm.h
  +
  +#define ELM_IRQSTATUS   0x018
  +#define ELM_IRQENABLE   0x01c
  +#define ELM_LOCATION_CONFIG 0x020
  +#define ELM_PAGE_CTRL   0x080
  +#define ELM_SYNDROME_FRAGMENT_0 0x400
  +#define ELM_SYNDROME_FRAGMENT_6 0x418
  +#define ELM_LOCATION_STATUS 0x800
  +#define ELM_ERROR_LOCATION_00x880
  +
  +/* ELM Interrupt Status Register */
  +#define INTR_STATUS_PAGE_VALID  BIT(8)
  +
  +/* ELM Interrupt Enable Register */
  +#define INTR_EN_PAGE_MASK   BIT(8)
  +
  +/* ELM Location Configuration Register */
  +#define ECC_BCH_LEVEL_MASK  0x3
  +
  +/* ELM syndrome */
  +#define ELM_SYNDROME_VALID  BIT(16)
  +
  +/* ELM_LOCATION_STATUS Register */
  +#define ECC_CORRECTABLE_MASKBIT(8)
  +#define ECC_NB_ERRORS_MASK  0x1f
  +
  +/* ELM_ERROR_LOCATION_0-15 Registers */
  +#define ECC_ERROR_LOCATION_MASK 0x1fff
  +
  +#define ELM_ECC_SIZE0x7ff
  +
  +#define SYNDROME_FRAGMENT_REG_SIZE  0x40
  +#define ERROR_LOCATION_SIZE 0x100
  +#define MAX_BCH_ELM_ERROR   16
  +#define ELM_FRAGMENT_REG7
  +
  +typedef u32 syn_t[ELM_FRAGMENT_REG];
  +typedef u32 elm_error_t[MAX_BCH_ELM_ERROR];
  +
  +struct elm_info {
  +struct device *dev;
  +void __iomem *elm_base;
  +struct completion elm_completion;
  +struct list_head list;
  +enum bch_ecc bch_type;
  +};
  +
  +static LIST_HEAD(elm_devices);
  +
  +static void elm_write_reg(void *offset, u32 val)
  +{
  +writel(val, offset);
  +}
  +
  +static u32 elm_read_reg(void *offset)
  +{
  +return readl(offset);
  +}

As written these read/write wrappers don't add anything. How about
passing struct elm_info and offset as an integer so you can drop
elm_base from all call sites, E.G.:

static void elm_write_reg(struct elm_info *info, int offset, u32 val)
{
writel(val, info-elm_base + offset);
}


  +
  +/**
  + * elm_config - Configure ELM module
  + * @info:   elm info
  + */
  +static void elm_config(struct elm_info *info)
  +{
  +u32 reg_val;
  +
  +reg_val = (info-bch_type  ECC_BCH_LEVEL_MASK) | (ELM_ECC_SIZE  16);
  +elm_write_reg(info-elm_base + ELM_LOCATION_CONFIG, reg_val);
  +}
  +
  +/**
  + * elm_configure_page_mode - Enable/Disable page mode
  + * @info:   elm info
  + * @index:  index number of syndrome fragment vector
  + * @enable: enable/disable flag for page mode
  + *
  + * Enable page mode for syndrome fragment index
  + */
  +static void elm_configure_page_mode(struct elm_info *info, int index,
  +bool enable)
  +{
  +u32 reg_val;
  +
  +reg_val = elm_read_reg(info-elm_base + ELM_PAGE_CTRL);
  +if (enable)
  +reg_val |= BIT(index);  /* enable page mode */
  +else
  +reg_val = ~BIT(index); /* disable page mode */
  +
  +elm_write_reg(info-elm_base + ELM_PAGE_CTRL, reg_val);
  +}
  +
  +static void rearrange_bch4(u8 *syndrome)
  +{
  +/*
  + * BCH4 has 52 bit used for ecc, but OOB stored with
  + * nibble 0 appended, removes appended 0 nibble
  + */
  +u64 *dst = (u64 

Direct IP and USB modem

2012-10-15 Thread Marc Murphy
Hello,
I have been transitioning from 2.6.37 kernel to 3.6-rc6 and have most things 
running that I had previously.

Next hurdle is the Sierra Wireless 8705 card.  I have tried the kernel drivers 
for this device and the latest from the Sierra Wireless site but both result in 
the same.  When I try to setup the PDP context, which is needed for the setup 
of the wwan0 interface I get the following error;

Going to send : AT!SCACT=1,1
[   77.037811] sierra_net 1-1.3:1.7: wwan0: Link type unsupported: 0xff
[   77.044433] sierra_net 1-1.3:1.7: wwan0: Invalid LSI
AT!SCACT=1,1
ERROR

I have had a look in the sierra_net code and the return for Link type 
unsupported and for some reason its not configured;
    /* Validate the link type */
   if ((lsi-link_type != SIERRA_NET_AS_LINK_TYPE_IPv4) 
    (lsi-link_type != SIERRA_NET_AS_LINK_TYPE_IPv6)) {

And then the Invalid LSI is in response again to the device structure not being 
configured.

I was hoping someone out there has knowledge about additional components that 
might be needed to get this to work, or what might have changed from 2.6.37 
that needs implementing in the latest driver ?

I have also searched for other issues and it may be related, when the device is 
detected and installed there is a complaint about invalid interface number;
[   28.232543] usb 1-1.3: new high-speed USB device number 4 using ehci-omap
[   28.358734] usb 1-1.3: config 1 has an invalid interface number: 7 but max 
is 5
[   28.366424] usb 1-1.3: config 1 has no interface number 5
[   28.374114] usb 1-1.3: New USB device found, idVendor=1199, idProduct=68a3
[   28.381317] usb 1-1.3: New USB device strings: Mfr=3, Product=2, 
SerialNumber=4
[   28.388977] usb 1-1.3: Product: MC8705
[   28.392883] usb 1-1.3: Manufacturer: Sierra Wireless, Incorporated
[   28.399353] usb 1-1.3: SerialNumber: 353567040114127
[   28.466918] usbcore: registered new interface driver usbserial
[   28.473114] usbcore: registered new interface driver usbserial_generic
[   28.518005] USB Serial support registered for generic
[   28.523559] usbserial: USB Serial Driver core
[   28.531127] usbcore: registered new interface driver sierra
[   28.547454] sierra_net 1-1.3:1.7: wwan0: register 'sierra_net' at 
usb-ehci-omap.0-1.3, Sierra Wireless USB-to-WWAN Modem, a6:3d:31:a8:01:07
[   28.561248] USB Serial support registered for Sierra USB modem
[   28.573669] sierra 1-1.3:1.0: Sierra USB modem converter detected
[   28.580841] usbcore: registered new interface driver sierra_net
[   28.596099] usb 1-1.3: Sierra USB modem converter now attached to ttyUSB0
[   28.626525] sierra 1-1.3:1.1: Sierra USB modem converter detected
[   28.693054] usb 1-1.3: Sierra USB modem converter now attached to ttyUSB1
[   28.740051] sierra 1-1.3:1.2: Sierra USB modem converter detected
[   28.776702] usb 1-1.3: Sierra USB modem converter now attached to ttyUSB2
[   28.818206] sierra 1-1.3:1.3: Sierra USB modem converter detected
[   28.849243] usb 1-1.3: Sierra USB modem converter now attached to ttyUSB3
[   28.888488] sierra 1-1.3:1.4: Sierra USB modem converter detected
[   28.913116] usb 1-1.3: Sierra USB modem converter now attached to ttyUSB4

Hope someone can help.

Regards
Marc
--
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: [RFT/PATCH] serial: omap: prevent resume if device is not suspended.

2012-10-15 Thread Kevin Hilman
Tony Lindgren t...@atomide.com writes:

 * Kevin Hilman khil...@deeprootsystems.com [121012 13:34]:

 I'm not conviced (yet) that a mismatch is the root cause.  Yes, that's
 what the author of $SUBJECT patch assumed and stated, but I'm not
 pursuaded.  
 
 If it's an improperly configured mux issue, then the UART will break
 whenever the device is actually omap_device_enable'd, whether in the
 driver or in the bus layer.

 I tried booting n800 here with CONFIG_OMAP_MUX disabled, and no
 change. Serial console output stops right when the console initializes.

OK, since it's not mux, and since those who actually maintain this
driver don't seem to be taking care of this, I did some digging today.

Russell is right.  It's a mismatch between assumed runtime PM state
(disabled) and actual HW state.

During init, all omap_devices are idled by default, so that they are
correctly in the state that the runtime PM framework will later expect
them to be.  That is, all devices *except* the console UART.  For that
one, we use the special hwmod flag to not idle/reset the UART since that
will cause problems during earlyprintk usage, and the switch between
the earlyprintk console and the real console driver.

Since the console uart was left enabled during init, it needs to be
fully enabled and the runtime PM status set accordingly.

The patch below does this, and works fine on 2420/n810, as well as on
3530/Overo, 3730/OveroSTORM, 3730/Beagle-XM and 4430/PandaES.

Will send patch with a proper changelog shortly,

Kevin

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 0405c81..37b5dbe 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -327,6 +327,11 @@ void __init omap_serial_init_port(struct omap_board_data 
*bdata,
if ((console_uart_id == bdata-id)  no_console_suspend)
omap_device_disable_idle_on_suspend(pdev);
 
+   if (console_uart_id == bdata-id) {
+   omap_device_enable(pdev);
+   pm_runtime_set_active(pdev-dev);
+   }
+
oh-mux = omap_hwmod_mux_init(bdata-pads, bdata-pads_cnt);
 
oh-dev_attr = uart;
--
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/5] ARM: OMAP2+: PRM/CM cleanup series for 3.8

2012-10-15 Thread Paul Walmsley
Consolidate and remove some PRM/CM code in preparation for a future move
into drivers/:

- Remove some obsolete weak functions that allowed old OMAP4 code to
  reference OMAP2/3 PRM functions

- Split many of the functions in prm2xxx_3xxx.c and cm2xxx_3xxx.c into
  2xxx- and 3xxx-specific PRM/CM C files

- Move low-level powerdomain and clockdomain register access into the
  appropriate 2xxx- and 3xxx-specific PRM/CM files, and remove
  {power,clock}domain.c

This series shouldn't have any functional impact.


- Paul

---

prm_cm_split_cleanup_3.8
   textdata bss dec hex filename
7515444  696732 5613932 13826108 d2f83c vmlinux.omap2plus_defconfig.orig
7515308  696724 5613932 13825964 d2f7ac vmlinux.omap2plus_defconfig

Paul Walmsley (5):
  ARM: OMAP2+: PRM: remove PRM weak functions
  ARM: OMAP2+: PRM: split PRM functions into OMAP2, OMAP3-specific files
  ARM: OMAP2+: powerdomain/PRM: move the low-level powerdomain functions 
into PRM
  ARM: OMAP2+: CM/hwmod: split CM functions into OMAP2, OMAP3-specific files
  ARM: OMAP2/3: clockdomain/PRM/CM: move the low-level clockdomain 
functions into PRM/CM


 arch/arm/mach-omap2/Makefile   |  108 +
 arch/arm/mach-omap2/clkt2xxx_apll.c|2 
 arch/arm/mach-omap2/clkt2xxx_dpll.c|2 
 arch/arm/mach-omap2/clock.c|3 
 arch/arm/mach-omap2/clock2420_data.c   |2 
 arch/arm/mach-omap2/clock2430.c|2 
 arch/arm/mach-omap2/clock2430_data.c   |2 
 arch/arm/mach-omap2/clock34xx.c|2 
 arch/arm/mach-omap2/clock3517.c|2 
 arch/arm/mach-omap2/clock3xxx_data.c   |2 
 arch/arm/mach-omap2/clockdomain2xxx_3xxx.c |  339 
 arch/arm/mach-omap2/clockdomain33xx.c  |   74 --
 arch/arm/mach-omap2/clockdomain44xx.c  |  151 
 arch/arm/mach-omap2/cm2xxx.c   |  253 +
 arch/arm/mach-omap2/cm2xxx.h   |   68 ++
 arch/arm/mach-omap2/cm2xxx_3xxx.h  |  118 +++---
 arch/arm/mach-omap2/cm33xx.c   |   56 +
 arch/arm/mach-omap2/cm3xxx.c   |  303 ++---
 arch/arm/mach-omap2/cm3xxx.h   |   86 +--
 arch/arm/mach-omap2/cminst44xx.c   |  139 +++
 arch/arm/mach-omap2/control.c  |4 
 arch/arm/mach-omap2/omap_hwmod.c   |   51 +++-
 arch/arm/mach-omap2/pm24xx.c   |4 
 arch/arm/mach-omap2/pm34xx.c   |5 
 arch/arm/mach-omap2/powerdomain2xxx_3xxx.c |  242 
 arch/arm/mach-omap2/powerdomain33xx.c  |  229 ---
 arch/arm/mach-omap2/powerdomain44xx.c  |  285 
 arch/arm/mach-omap2/prm-regbits-24xx.h |2 
 arch/arm/mach-omap2/prm-regbits-34xx.h |2 
 arch/arm/mach-omap2/prm2xxx.c  |   57 +
 arch/arm/mach-omap2/prm2xxx.h  |  128 +++
 arch/arm/mach-omap2/prm2xxx_3xxx.c |  332 +--
 arch/arm/mach-omap2/prm2xxx_3xxx.h |  275 ++-
 arch/arm/mach-omap2/prm33xx.c  |  202 +
 arch/arm/mach-omap2/prm3xxx.c  |  268 ++
 arch/arm/mach-omap2/prm3xxx.h  |  158 +
 arch/arm/mach-omap2/prm44xx.c  |  275 ++-
 arch/arm/mach-omap2/prm_common.c   |   62 -
 arch/arm/mach-omap2/sdrc2xxx.c |2 
 arch/arm/mach-omap2/sleep34xx.S|4 
 arch/arm/mach-omap2/sram242x.S |4 
 arch/arm/mach-omap2/sram243x.S |4 
 arch/arm/mach-omap2/sram34xx.S |2 
 43 files changed, 1973 insertions(+), 2338 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
 delete mode 100644 arch/arm/mach-omap2/clockdomain33xx.c
 delete mode 100644 arch/arm/mach-omap2/clockdomain44xx.c
 create mode 100644 arch/arm/mach-omap2/cm2xxx.c
 create mode 100644 arch/arm/mach-omap2/cm2xxx.h
 rename arch/arm/mach-omap2/{cm2xxx_3xxx.c = cm3xxx.c} (72%)
 copy arch/arm/mach-omap2/{cm2xxx_3xxx.h = cm3xxx.h} (50%)
 delete mode 100644 arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
 delete mode 100644 arch/arm/mach-omap2/powerdomain33xx.c
 delete mode 100644 arch/arm/mach-omap2/powerdomain44xx.c
 create mode 100644 arch/arm/mach-omap2/prm2xxx.c
 create mode 100644 arch/arm/mach-omap2/prm2xxx.h
 copy arch/arm/mach-omap2/{prm2xxx_3xxx.c = prm3xxx.c} (58%)
 create mode 100644 arch/arm/mach-omap2/prm3xxx.h

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


[PATCH 1/5] ARM: OMAP2+: PRM: remove PRM weak functions

2012-10-15 Thread Paul Walmsley
Remove the now-unused PRM weak functions from prm_common.c.  These
were formerly used to ensure that some OMAP2/3 PRM code would build on
OMAP4, but none of those functions ever would have worked on OMAP4 due
to an incompatible PRM register layout.  Now all that has been cleaned
up and these can be removed.

Signed-off-by: Paul Walmsley p...@pwsan.com
---
 arch/arm/mach-omap2/prm_common.c |   62 --
 1 file changed, 62 deletions(-)

diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 6b4d332..0a100d9 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -318,65 +318,3 @@ err:
omap_prcm_irq_cleanup();
return -ENOMEM;
 }
-
-/*
- * Stubbed functions so that common files continue to build when
- * custom builds are used
- * XXX These are temporary and should be removed at the earliest possible
- * opportunity
- */
-u32 __weak omap2_prm_read_mod_reg(s16 module, u16 idx)
-{
-   WARN(1, prm: omap2xxx/omap3xxx specific function called on 
non-omap2xxx/3xxx\n);
-   return 0;
-}
-
-void __weak omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx)
-{
-   WARN(1, prm: omap2xxx/omap3xxx specific function called on 
non-omap2xxx/3xxx\n);
-}
-
-u32 __weak omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits,
-   s16 module, s16 idx)
-{
-   WARN(1, prm: omap2xxx/omap3xxx specific function called on 
non-omap2xxx/3xxx\n);
-   return 0;
-}
-
-u32 __weak omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
-{
-   WARN(1, prm: omap2xxx/omap3xxx specific function called on 
non-omap2xxx/3xxx\n);
-   return 0;
-}
-
-u32 __weak omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
-{
-   WARN(1, prm: omap2xxx/omap3xxx specific function called on 
non-omap2xxx/3xxx\n);
-   return 0;
-}
-
-u32 __weak omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask)
-{
-   WARN(1, prm: omap2xxx/omap3xxx specific function called on 
non-omap2xxx/3xxx\n);
-   return 0;
-}
-
-int __weak omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift)
-{
-   WARN(1, prm: omap2xxx/omap3xxx specific function called on 
non-omap2xxx/3xxx\n);
-   return 0;
-}
-
-int __weak omap2_prm_assert_hardreset(s16 prm_mod, u8 shift)
-{
-   WARN(1, prm: omap2xxx/omap3xxx specific function called on 
non-omap2xxx/3xxx\n);
-   return 0;
-}
-
-int __weak omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift,
-   u8 st_shift)
-{
-   WARN(1, prm: omap2xxx/omap3xxx specific function called on 
non-omap2xxx/3xxx\n);
-   return 0;
-}
-


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


[PATCH 2/5] ARM: OMAP2+: PRM: split PRM functions into OMAP2, OMAP3-specific files

2012-10-15 Thread Paul Walmsley
Move OMAP3xxx-specific PRM functions  macros into prm3xxx.[ch] and
OMAP2xxx-specific macros into prm2xxx.h.  (prm2xxx.c will be created
by a subsequent patch when it's needed.)  Move basic PRM register
access functions into static inline functions in prm2xxx_3xxx.h, leaving
only OMAP2/3 hardreset functions in prm2xxx_3xxx.c.

Also clarify the initcall function naming to reinforce that this code
is specifically for the PRM IP block.

This is in preparation for the upcoming powerdomain series and the
upcoming move of this code to drivers/.

Signed-off-by: Paul Walmsley p...@pwsan.com
---
 arch/arm/mach-omap2/Makefile   |  100 +++-
 arch/arm/mach-omap2/control.c  |2 
 arch/arm/mach-omap2/omap_hwmod.c   |2 
 arch/arm/mach-omap2/pm24xx.c   |2 
 arch/arm/mach-omap2/pm34xx.c   |2 
 arch/arm/mach-omap2/prm-regbits-24xx.h |2 
 arch/arm/mach-omap2/prm-regbits-34xx.h |2 
 arch/arm/mach-omap2/prm2xxx.h  |  122 +++
 arch/arm/mach-omap2/prm2xxx_3xxx.c |  265 
 arch/arm/mach-omap2/prm2xxx_3xxx.h |  256 ++-
 arch/arm/mach-omap2/prm3xxx.c  |  164 ++--
 arch/arm/mach-omap2/prm3xxx.h  |  158 +++
 arch/arm/mach-omap2/prm44xx.c  |   15 +-
 arch/arm/mach-omap2/sdrc2xxx.c |2 
 arch/arm/mach-omap2/sleep34xx.S|2 
 arch/arm/mach-omap2/sram242x.S |2 
 arch/arm/mach-omap2/sram243x.S |2 
 17 files changed, 421 insertions(+), 679 deletions(-)
 create mode 100644 arch/arm/mach-omap2/prm2xxx.h
 copy arch/arm/mach-omap2/{prm2xxx_3xxx.c = prm3xxx.c} (57%)
 create mode 100644 arch/arm/mach-omap2/prm3xxx.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fe40d9e..20849604 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -4,30 +4,36 @@
 
 # Common support
 obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \
-common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o
+common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o
 
-# INTCPS IP block support - XXX should be moved to drivers/
-obj-$(CONFIG_ARCH_OMAP2)   += irq.o
-obj-$(CONFIG_ARCH_OMAP3)   += irq.o
-obj-$(CONFIG_SOC_AM33XX)   += irq.o
+omap-2-3-common= irq.o
+hwmod-common   = omap_hwmod.o \
+ omap_hwmod_common_data.o
+clock-common   = clock.o clock_common_data.o \
+ clkt_dpll.o clkt_clksel.o
+secure-common  = omap-smc.o omap-secure.o
 
-# Secure monitor API support
-obj-$(CONFIG_ARCH_OMAP3)   += omap-smc.o omap-secure.o
-obj-$(CONFIG_ARCH_OMAP4)   += omap-smc.o omap-secure.o
-obj-$(CONFIG_SOC_OMAP5)+= omap-smc.o omap-secure.o
+obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
+obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
+obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common) $(secure-common)
+obj-$(CONFIG_SOC_AM33XX) += irq.o $(hwmod-common)
+obj-$(CONFIG_SOC_OMAP5) += prm44xx.o $(hwmod-common) $(secure-common)
 
 ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),)
 obj-y += mcbsp.o
 endif
 
-obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
+obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
+obj-$(CONFIG_SOC_HAS_OMAP2_SDRC)   += sdrc.o
 
 # SMP support ONLY available for OMAP4
 
 obj-$(CONFIG_SMP)  += omap-smp.o omap-headsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)  += omap-hotplug.o
-obj-$(CONFIG_ARCH_OMAP4)   += omap4-common.o omap-wakeupgen.o
-obj-$(CONFIG_SOC_OMAP5)+= omap4-common.o 
omap-wakeupgen.o
+omap-4-5-common=  omap4-common.o 
omap-wakeupgen.o \
+  sleep44xx.o
+obj-$(CONFIG_ARCH_OMAP4)   += $(omap-4-5-common)
+obj-$(CONFIG_SOC_OMAP5)+= $(omap-4-5-common)
 
 plus_sec := $(call as-instr,.arch_extension sec,+sec)
 AFLAGS_omap-headsmp.o  :=-Wa,-march=armv7-a$(plus_sec)
@@ -52,7 +58,6 @@ obj-$(CONFIG_ARCH_OMAP4)  += mux44xx.o
 # SMS/SDRC
 obj-$(CONFIG_ARCH_OMAP2)   += sdrc2xxx.o
 # obj-$(CONFIG_ARCH_OMAP3) += sdrc3xxx.o
-obj-$(CONFIG_SOC_HAS_OMAP2_SDRC)   += sdrc.o
 
 # OPP table initialization
 ifeq ($(CONFIG_PM_OPP),y)
@@ -63,15 +68,15 @@ endif
 
 # Power Management
 ifeq ($(CONFIG_PM),y)
-obj-$(CONFIG_ARCH_OMAP2)   += pm24xx.o sleep24xx.o
+obj-$(CONFIG_ARCH_OMAP2)   += pm24xx.o
+obj-$(CONFIG_ARCH_OMAP2)   += sleep24xx.o
 obj-$(CONFIG_ARCH_OMAP3)   += pm34xx.o sleep34xx.o
 obj-$(CONFIG_ARCH_OMAP4)   += pm44xx.o 

[PATCH 4/5] ARM: OMAP2+: CM/hwmod: split CM functions into OMAP2, OMAP3-specific files

2012-10-15 Thread Paul Walmsley
Move OMAP3xxx-specific CM functions  macros into cm3xxx.[ch] and
OMAP2xxx-specific macros into cm2xxx.[ch].  Move basic CM register
access functions into static inline functions in cm2xxx_3xxx.h,
leaving only OMAP2/3 hardreset functions in cm2xxx_3xxx.c.

As part of this, split the CM and hwmod code that waits for devices to
become ready into SoC-specific functions.

This is in preparation for the upcoming move of this code to drivers/.

Signed-off-by: Paul Walmsley p...@pwsan.com
---
 arch/arm/mach-omap2/Makefile   |6 -
 arch/arm/mach-omap2/clkt2xxx_apll.c|2 
 arch/arm/mach-omap2/clkt2xxx_dpll.c|2 
 arch/arm/mach-omap2/clock.c|3 -
 arch/arm/mach-omap2/clock2420_data.c   |2 
 arch/arm/mach-omap2/clock2430.c|2 
 arch/arm/mach-omap2/clock2430_data.c   |2 
 arch/arm/mach-omap2/clock34xx.c|2 
 arch/arm/mach-omap2/clock3517.c|2 
 arch/arm/mach-omap2/clock3xxx_data.c   |2 
 arch/arm/mach-omap2/clockdomain2xxx_3xxx.c |   27 ++---
 arch/arm/mach-omap2/cm2xxx.c   |  167 
 arch/arm/mach-omap2/cm2xxx.h   |   68 +++
 arch/arm/mach-omap2/cm2xxx_3xxx.h  |  112 +--
 arch/arm/mach-omap2/cm3xxx.c   |  160 ++-
 arch/arm/mach-omap2/cm3xxx.h   |   86 +-
 arch/arm/mach-omap2/control.c  |2 
 arch/arm/mach-omap2/omap_hwmod.c   |   49 +++-
 arch/arm/mach-omap2/pm24xx.c   |2 
 arch/arm/mach-omap2/pm34xx.c   |3 -
 arch/arm/mach-omap2/sleep34xx.S|2 
 arch/arm/mach-omap2/sram242x.S |2 
 arch/arm/mach-omap2/sram243x.S |2 
 arch/arm/mach-omap2/sram34xx.S |2 
 24 files changed, 360 insertions(+), 349 deletions(-)
 create mode 100644 arch/arm/mach-omap2/cm2xxx.c
 create mode 100644 arch/arm/mach-omap2/cm2xxx.h
 rename arch/arm/mach-omap2/{cm2xxx_3xxx.c = cm3xxx.c} (80%)
 copy arch/arm/mach-omap2/{cm2xxx_3xxx.h = cm3xxx.h} (50%)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 7404e3d..56a3386 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -94,10 +94,8 @@ endif
 
 # PRCM
 obj-y  += prcm.o prm_common.o
-obj-$(CONFIG_ARCH_OMAP2)   += cm2xxx_3xxx.o prm2xxx_3xxx.o
-obj-$(CONFIG_ARCH_OMAP2)   += prm2xxx.o
-obj-$(CONFIG_ARCH_OMAP3)   += cm2xxx_3xxx.o prm2xxx_3xxx.o
-obj-$(CONFIG_ARCH_OMAP3)   += prm3xxx.o
+obj-$(CONFIG_ARCH_OMAP2)   += prm2xxx_3xxx.o prm2xxx.o cm2xxx.o
+obj-$(CONFIG_ARCH_OMAP3)   += prm2xxx_3xxx.o prm3xxx.o cm3xxx.o
 obj-$(CONFIG_ARCH_OMAP3)   += vc3xxx_data.o vp3xxx_data.o
 obj-$(CONFIG_SOC_AM33XX)   += prm33xx.o cm33xx.o
 omap-prcm-4-5-common   =  cminst44xx.o cm44xx.o prm44xx.o \
diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c 
b/arch/arm/mach-omap2/clkt2xxx_apll.c
index c2d15212..3d2f67e 100644
--- a/arch/arm/mach-omap2/clkt2xxx_apll.c
+++ b/arch/arm/mach-omap2/clkt2xxx_apll.c
@@ -26,7 +26,7 @@
 
 #include clock.h
 #include clock2xxx.h
-#include cm2xxx_3xxx.h
+#include cm2xxx.h
 #include cm-regbits-24xx.h
 
 /* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */
diff --git a/arch/arm/mach-omap2/clkt2xxx_dpll.c 
b/arch/arm/mach-omap2/clkt2xxx_dpll.c
index 1502a7b..0f58779 100644
--- a/arch/arm/mach-omap2/clkt2xxx_dpll.c
+++ b/arch/arm/mach-omap2/clkt2xxx_dpll.c
@@ -17,7 +17,7 @@
 #include plat/clock.h
 
 #include clock.h
-#include cm2xxx_3xxx.h
+#include cm2xxx.h
 #include cm-regbits-24xx.h
 
 /* Private functions */
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 961ac8f..d0c6d9b 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -33,7 +33,8 @@
 #include soc.h
 #include clockdomain.h
 #include clock.h
-#include cm2xxx_3xxx.h
+#include cm2xxx.h
+#include cm3xxx.h
 #include cm-regbits-24xx.h
 #include cm-regbits-34xx.h
 
diff --git a/arch/arm/mach-omap2/clock2420_data.c 
b/arch/arm/mach-omap2/clock2420_data.c
index c3cde1a..969bc58 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -25,7 +25,7 @@
 #include clock.h
 #include clock2xxx.h
 #include opp2xxx.h
-#include cm2xxx_3xxx.h
+#include cm2xxx.h
 #include prm2xxx_3xxx.h
 #include prm-regbits-24xx.h
 #include cm-regbits-24xx.h
diff --git a/arch/arm/mach-omap2/clock2430.c b/arch/arm/mach-omap2/clock2430.c
index a8e3261..e786733 100644
--- a/arch/arm/mach-omap2/clock2430.c
+++ b/arch/arm/mach-omap2/clock2430.c
@@ -27,7 +27,7 @@
 #include iomap.h
 #include clock.h
 #include clock2xxx.h
-#include cm2xxx_3xxx.h
+#include cm2xxx.h
 #include cm-regbits-24xx.h
 
 /**
diff --git a/arch/arm/mach-omap2/clock2430_data.c 
b/arch/arm/mach-omap2/clock2430_data.c
index 22404fe..186f06a 100644
--- 

[PATCH 5/5] ARM: OMAP2/3: clockdomain/PRM/CM: move the low-level clockdomain functions into PRM/CM

2012-10-15 Thread Paul Walmsley
Move the low-level SoC-specific clockdomain control functions into
cm*.c and prm*.c.  For example, OMAP2xxx low-level clockdomain
functions go into cm2xxx.c.  Then remove the unnecessary
clockdomain*xxx*.c files.

The objective is to centralize low-level CM and PRM register accesses
into the cm*.[ch] and prm*.[ch] files, and then to export an OMAP
SoC-independent API to higher-level OMAP power management code.

Signed-off-by: Paul Walmsley p...@pwsan.com
Cc: Rajendra Nayak rna...@ti.com
Cc: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/Makefile   |5 
 arch/arm/mach-omap2/clockdomain2xxx_3xxx.c |  340 
 arch/arm/mach-omap2/clockdomain33xx.c  |   74 --
 arch/arm/mach-omap2/clockdomain44xx.c  |  151 
 arch/arm/mach-omap2/cm2xxx.c   |   86 +++
 arch/arm/mach-omap2/cm2xxx_3xxx.h  |   12 +
 arch/arm/mach-omap2/cm33xx.c   |   56 +
 arch/arm/mach-omap2/cm3xxx.c   |  169 ++
 arch/arm/mach-omap2/cminst44xx.c   |  139 +++
 arch/arm/mach-omap2/prm2xxx.c  |   17 +
 arch/arm/mach-omap2/prm2xxx.h  |6 
 arch/arm/mach-omap2/prm2xxx_3xxx.c |   43 
 arch/arm/mach-omap2/prm2xxx_3xxx.h |8 +
 13 files changed, 536 insertions(+), 570 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
 delete mode 100644 arch/arm/mach-omap2/clockdomain33xx.c
 delete mode 100644 arch/arm/mach-omap2/clockdomain44xx.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 56a3386..3751d56 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -133,22 +133,17 @@ obj-$(CONFIG_SOC_OMAP5)   += 
$(powerdomain-common)
 # PRCM clockdomain control
 clockdomain-common += clockdomain.o
 obj-$(CONFIG_ARCH_OMAP2)   += $(clockdomain-common)
-obj-$(CONFIG_ARCH_OMAP2)   += clockdomain2xxx_3xxx.o
 obj-$(CONFIG_ARCH_OMAP2)   += clockdomains2xxx_3xxx_data.o
 obj-$(CONFIG_SOC_OMAP2420) += clockdomains2420_data.o
 obj-$(CONFIG_SOC_OMAP2430) += clockdomains2430_data.o
 obj-$(CONFIG_ARCH_OMAP3)   += $(clockdomain-common)
-obj-$(CONFIG_ARCH_OMAP3)   += clockdomain2xxx_3xxx.o
 obj-$(CONFIG_ARCH_OMAP3)   += clockdomains2xxx_3xxx_data.o
 obj-$(CONFIG_ARCH_OMAP3)   += clockdomains3xxx_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += $(clockdomain-common)
-obj-$(CONFIG_ARCH_OMAP4)   += clockdomain44xx.o
 obj-$(CONFIG_ARCH_OMAP4)   += clockdomains44xx_data.o
 obj-$(CONFIG_SOC_AM33XX)   += $(clockdomain-common)
-obj-$(CONFIG_SOC_AM33XX)   += clockdomain33xx.o
 obj-$(CONFIG_SOC_AM33XX)   += clockdomains33xx_data.o
 obj-$(CONFIG_SOC_OMAP5)+= $(clockdomain-common)
-obj-$(CONFIG_SOC_OMAP5)+= clockdomain44xx.o
 
 # Clock framework
 obj-$(CONFIG_ARCH_OMAP2)   += $(clock-common) clock2xxx.o
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c 
b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
deleted file mode 100644
index 658487c..000
--- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * OMAP2 and OMAP3 clockdomain control
- *
- * Copyright (C) 2008-2010 Texas Instruments, Inc.
- * Copyright (C) 2008-2010 Nokia Corporation
- *
- * Derived from mach-omap2/clockdomain.c written by Paul Walmsley
- * Rajendra Nayak rna...@ti.com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include linux/types.h
-#include plat/prcm.h
-#include prm.h
-#include prm2xxx_3xxx.h
-#include cm.h
-#include cm2xxx.h
-#include cm3xxx.h
-#include cm-regbits-24xx.h
-#include cm-regbits-34xx.h
-#include prm-regbits-24xx.h
-#include clockdomain.h
-
-static int omap2_clkdm_add_wkdep(struct clockdomain *clkdm1,
-   struct clockdomain *clkdm2)
-{
-   omap2_prm_set_mod_reg_bits((1  clkdm2-dep_bit),
-   clkdm1-pwrdm.ptr-prcm_offs, PM_WKDEP);
-   return 0;
-}
-
-static int omap2_clkdm_del_wkdep(struct clockdomain *clkdm1,
-struct clockdomain *clkdm2)
-{
-   omap2_prm_clear_mod_reg_bits((1  clkdm2-dep_bit),
-   clkdm1-pwrdm.ptr-prcm_offs, PM_WKDEP);
-   return 0;
-}
-
-static int omap2_clkdm_read_wkdep(struct clockdomain *clkdm1,
-struct clockdomain *clkdm2)
-{
-   return omap2_prm_read_mod_bits_shift(clkdm1-pwrdm.ptr-prcm_offs,
-   PM_WKDEP, (1  clkdm2-dep_bit));
-}
-
-static int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
-{
-   struct 

[PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status

2012-10-15 Thread Kevin Hilman
From: Kevin Hilman khil...@ti.com

The runtime PM framework assumes that the hardware state of devices
when initialized is disabled.  For all omap_devices, we idle/disable
device by default.  However, the console uart uses a no idle option
during omap_device init in order to allow earlyprintk usage to work
seamlessly during boot.

Because the hardware is left partially enabled after init (whatever
the bootloader settings were), the omap_device should later be fully
initialized (including mux) and the runtime PM framework should be
told that the device is active, and not disabled so that the hardware
state is in sync with runtime PM state.

To fix, after the device has been created/registered, call
omap_device_enable() to finialize init and use pm_runtime_set_active()
to tell the runtime PM core the device is enabled.

Tested on 2420/n810, 3530/Overo, 3530/Beagle, 3730/OveroSTORM,
3730/Beagle-xM, 4460/PandaES.

Reported-by: Paul Walmsley p...@pwsan.com
Suggested-by: Russell King rmk+ker...@arm.linux.org.uk
Cc: Felipe Balbi ba...@ti.com
Cc: Sourav Poddar sourav.pod...@ti.com
Signed-off-by: Kevin Hilman khil...@ti.com
---
Applies against v3.7-rc1.
Fix targetted for v3.7.

I'm still not entirely sure why this has worked up to now on OMAP3/4
but not on OMAP2.  Even so, this fix is needed for all platforms to
ensure matching hardware state and runtime PM state.

 arch/arm/mach-omap2/serial.c |5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 0405c81..37b5dbe 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -327,6 +327,11 @@ void __init omap_serial_init_port(struct omap_board_data 
*bdata,
if ((console_uart_id == bdata-id)  no_console_suspend)
omap_device_disable_idle_on_suspend(pdev);
 
+   if (console_uart_id == bdata-id) {
+   omap_device_enable(pdev);
+   pm_runtime_set_active(pdev-dev);
+   }
+
oh-mux = omap_hwmod_mux_init(bdata-pads, bdata-pads_cnt);
 
oh-dev_attr = uart;
-- 
1.7.9.2

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


Re: [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status

2012-10-15 Thread Tony Lindgren
* Kevin Hilman khil...@deeprootsystems.com [121015 16:51]:
 From: Kevin Hilman khil...@ti.com
 
 The runtime PM framework assumes that the hardware state of devices
 when initialized is disabled.  For all omap_devices, we idle/disable
 device by default.  However, the console uart uses a no idle option
 during omap_device init in order to allow earlyprintk usage to work
 seamlessly during boot.
 
 Because the hardware is left partially enabled after init (whatever
 the bootloader settings were), the omap_device should later be fully
 initialized (including mux) and the runtime PM framework should be
 told that the device is active, and not disabled so that the hardware
 state is in sync with runtime PM state.
 
 To fix, after the device has been created/registered, call
 omap_device_enable() to finialize init and use pm_runtime_set_active()
 to tell the runtime PM core the device is enabled.
 
 Tested on 2420/n810, 3530/Overo, 3530/Beagle, 3730/OveroSTORM,
 3730/Beagle-xM, 4460/PandaES.
 
 Reported-by: Paul Walmsley p...@pwsan.com
 Suggested-by: Russell King rmk+ker...@arm.linux.org.uk
 Cc: Felipe Balbi ba...@ti.com
 Cc: Sourav Poddar sourav.pod...@ti.com
 Signed-off-by: Kevin Hilman khil...@ti.com

Seems to work for my n800:

Tested-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 1/2] ARM: OMAP: Trivial driver changes to remove include plat/cpu.h

2012-10-15 Thread Tony Lindgren
* Tony Lindgren t...@atomide.com [121009 17:21]:
 * Péter Ujfalusi peter.ujfal...@ti.com [121009 02:03]:
  On 10/08/2012 07:35 PM, Tony Lindgren wrote:
  
   - omap-dma.c and omap-pcm.c can test the arch locally as
 omap1 and omap2 cannot be compiled together because of
 conflicting compiler flags
  
sound/soc/omap/omap-pcm.c |9 +++--
  
  Tony: is this going to be included in 3.7?
 
 Hmm I guess we could try to get this out of the way
 to cut down the dependencies. Let's if maintainers
 of the other affected drivers this is OK for the
 -rc series.

It seems that nobody needs these until for v3.8, so I'll
be applying this into omap-for-v3.8/cleanup-headers-prepare
branch soon.

Anybody else care to ack?

Regards,

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


Re: [PATCH 08/16] ARM: OMAP2: Move plat/menelaus.h to linux/mfd/menelaus.h

2012-10-15 Thread Tony Lindgren
* Tony Lindgren t...@atomide.com [121004 15:09]:
 We can move menelaus.h to live with other mfd headers to
 get it out of plat for ARM common zImage support.
 
 Cc: Samuel Ortiz sa...@linux.intel.com
 Signed-off-by: Tony Lindgren t...@atomide.com

Samuel, want to ack this one if this looks OK to you?

I'm planning apply this into omap-for-v3.8/cleanup-headers-menelaus
branch that you can pull in too if needed.

Regards,

Tony

 ---
  arch/arm/mach-omap2/board-h4.c |2 +-
  arch/arm/mach-omap2/board-n8x0.c   |2 +-
  drivers/mfd/menelaus.c |2 +-
  include/linux/mfd/menelaus.h   |2 --
  4 files changed, 3 insertions(+), 5 deletions(-)
  rename arch/arm/plat-omap/include/plat/menelaus.h = 
 include/linux/mfd/menelaus.h (96%)
 
 diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
 index 8d04bf8..3977a02 100644
 --- a/arch/arm/mach-omap2/board-h4.c
 +++ b/arch/arm/mach-omap2/board-h4.c
 @@ -26,12 +26,12 @@
  #include linux/clk.h
  #include linux/io.h
  #include linux/input/matrix_keypad.h
 +#include linux/mfd/menelaus.h
  
  #include asm/mach-types.h
  #include asm/mach/arch.h
  #include asm/mach/map.h
  
 -#include plat/menelaus.h
  #include plat/dma.h
  #include plat/gpmc.h
  #include debug-devices.h
 diff --git a/arch/arm/mach-omap2/board-n8x0.c 
 b/arch/arm/mach-omap2/board-n8x0.c
 index d95f727..e3e8325 100644
 --- a/arch/arm/mach-omap2/board-n8x0.c
 +++ b/arch/arm/mach-omap2/board-n8x0.c
 @@ -22,13 +22,13 @@
  #include linux/usb/musb.h
  #include linux/platform_data/spi-omap2-mcspi.h
  #include linux/platform_data/mtd-onenand-omap2.h
 +#include linux/mfd/menelaus.h
  #include sound/tlv320aic3x.h
  
  #include asm/mach/arch.h
  #include asm/mach-types.h
  
  #include common.h
 -#include plat/menelaus.h
  #include plat/mmc.h
  
  #include mux.h
 diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
 index 55d5899..998ce8c 100644
 --- a/drivers/mfd/menelaus.c
 +++ b/drivers/mfd/menelaus.c
 @@ -41,11 +41,11 @@
  #include linux/rtc.h
  #include linux/bcd.h
  #include linux/slab.h
 +#include linux/mfd/menelaus.h
  
  #include asm/mach/irq.h
  
  #include asm/gpio.h
 -#include plat/menelaus.h
  
  #define DRIVER_NAME  menelaus
  
 diff --git a/arch/arm/plat-omap/include/plat/menelaus.h 
 b/include/linux/mfd/menelaus.h
 similarity index 96%
 rename from arch/arm/plat-omap/include/plat/menelaus.h
 rename to include/linux/mfd/menelaus.h
 index 4a970ec..f097e89 100644
 --- a/arch/arm/plat-omap/include/plat/menelaus.h
 +++ b/include/linux/mfd/menelaus.h
 @@ -1,6 +1,4 @@
  /*
 - * arch/arm/plat-omap/include/mach/menelaus.h
 - *
   * Functions to access Menelaus power management chip
   */
  
 
 --
 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 0/4] repost of the omap iommu header changes to remove plat includes

2012-10-15 Thread Tony Lindgren
Hi,

Looks like Joerg was not cc:d in the original series, so I'm reposting
these updated against v3.7-rc1.

Regards,

Tony

---

Ido Yariv (4):
  ARM: OMAP: Merge iommu2.h into iommu.h
  ARM: OMAP2+: Make some definitions local
  ARM: OMAP2+: Move iommu/iovmm headers to platform_data
  ARM: OMAP2+: Move iopgtable header to drivers/iommu/


 arch/arm/mach-omap2/devices.c   |2 
 arch/arm/mach-omap2/iommu2.c|8 ++
 arch/arm/mach-omap2/omap-iommu.c|2 
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c  |2 
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c  |2 
 arch/arm/plat-omap/include/plat/iommu2.h|   96 ---
 drivers/iommu/omap-iommu-debug.c|7 +-
 drivers/iommu/omap-iommu.c  |5 +
 drivers/iommu/omap-iommu.h  |   59 ++
 drivers/iommu/omap-iopgtable.h  |0 
 drivers/iommu/omap-iovmm.c  |7 +-
 drivers/media/platform/omap3isp/isp.h   |5 +
 drivers/media/platform/omap3isp/ispvideo.c  |5 -
 include/linux/platform_data/iommu-omap.h|  115 ---
 include/linux/platform_data/iovmm-omap.h|0 
 15 files changed, 155 insertions(+), 160 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/plat/iommu2.h
 create mode 100644 drivers/iommu/omap-iommu.h
 rename arch/arm/plat-omap/include/plat/iopgtable.h = 
drivers/iommu/omap-iopgtable.h (100%)
 rename arch/arm/plat-omap/include/plat/iommu.h = 
include/linux/platform_data/iommu-omap.h (69%)
 rename arch/arm/plat-omap/include/plat/iovmm.h = 
include/linux/platform_data/iovmm-omap.h (100%)

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


[PATCH 1/4] ARM: OMAP: Merge iommu2.h into iommu.h

2012-10-15 Thread Tony Lindgren
From: Ido Yariv i...@wizery.com

Since iommu is not supported on OMAP1 and will not likely to ever be
supported, merge plat/iommu2.h into iommu.h so only one file would have
to move to platform_data/ as part of the single zImage effort.

Cc: Joerg Roedel joerg.roe...@amd.com
Cc: Ohad Ben-Cohen o...@wizery.com
Signed-off-by: Ido Yariv i...@wizery.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/plat-omap/include/plat/iommu.h  |   88 ++--
 arch/arm/plat-omap/include/plat/iommu2.h |   96 --
 2 files changed, 83 insertions(+), 101 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/plat/iommu2.h

diff --git a/arch/arm/plat-omap/include/plat/iommu.h 
b/arch/arm/plat-omap/include/plat/iommu.h
index 68b5f03..7e8c7b6 100644
--- a/arch/arm/plat-omap/include/plat/iommu.h
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -13,6 +13,12 @@
 #ifndef __MACH_IOMMU_H
 #define __MACH_IOMMU_H
 
+#include linux/io.h
+
+#if defined(CONFIG_ARCH_OMAP1)
+#error iommu for this processor not implemented yet
+#endif
+
 struct iotlb_entry {
u32 da;
u32 pa;
@@ -159,11 +165,70 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct 
device *dev)
 #define OMAP_IOMMU_ERR_TBLWALK_FAULT   (1  3)
 #define OMAP_IOMMU_ERR_MULTIHIT_FAULT  (1  4)
 
-#if defined(CONFIG_ARCH_OMAP1)
-#error iommu for this processor not implemented yet
-#else
-#include plat/iommu2.h
-#endif
+/*
+ * MMU Register offsets
+ */
+#define MMU_REVISION   0x00
+#define MMU_SYSCONFIG  0x10
+#define MMU_SYSSTATUS  0x14
+#define MMU_IRQSTATUS  0x18
+#define MMU_IRQENABLE  0x1c
+#define MMU_WALKING_ST 0x40
+#define MMU_CNTL   0x44
+#define MMU_FAULT_AD   0x48
+#define MMU_TTB0x4c
+#define MMU_LOCK   0x50
+#define MMU_LD_TLB 0x54
+#define MMU_CAM0x58
+#define MMU_RAM0x5c
+#define MMU_GFLUSH 0x60
+#define MMU_FLUSH_ENTRY0x64
+#define MMU_READ_CAM   0x68
+#define MMU_READ_RAM   0x6c
+#define MMU_EMU_FAULT_AD   0x70
+
+#define MMU_REG_SIZE   256
+
+/*
+ * MMU Register bit definitions
+ */
+#define MMU_LOCK_BASE_SHIFT10
+#define MMU_LOCK_BASE_MASK (0x1f  MMU_LOCK_BASE_SHIFT)
+#define MMU_LOCK_BASE(x)   \
+   ((x  MMU_LOCK_BASE_MASK)  MMU_LOCK_BASE_SHIFT)
+
+#define MMU_LOCK_VICT_SHIFT4
+#define MMU_LOCK_VICT_MASK (0x1f  MMU_LOCK_VICT_SHIFT)
+#define MMU_LOCK_VICT(x)   \
+   ((x  MMU_LOCK_VICT_MASK)  MMU_LOCK_VICT_SHIFT)
+
+#define MMU_CAM_VATAG_SHIFT12
+#define MMU_CAM_VATAG_MASK \
+   ((~0UL  MMU_CAM_VATAG_SHIFT)  MMU_CAM_VATAG_SHIFT)
+#define MMU_CAM_P  (1  3)
+#define MMU_CAM_V  (1  2)
+#define MMU_CAM_PGSZ_MASK  3
+#define MMU_CAM_PGSZ_1M(0  0)
+#define MMU_CAM_PGSZ_64K   (1  0)
+#define MMU_CAM_PGSZ_4K(2  0)
+#define MMU_CAM_PGSZ_16M   (3  0)
+
+#define MMU_RAM_PADDR_SHIFT12
+#define MMU_RAM_PADDR_MASK \
+   ((~0UL  MMU_RAM_PADDR_SHIFT)  MMU_RAM_PADDR_SHIFT)
+#define MMU_RAM_ENDIAN_SHIFT   9
+#define MMU_RAM_ENDIAN_MASK(1  MMU_RAM_ENDIAN_SHIFT)
+#define MMU_RAM_ENDIAN_BIG (1  MMU_RAM_ENDIAN_SHIFT)
+#define MMU_RAM_ENDIAN_LITTLE  (0  MMU_RAM_ENDIAN_SHIFT)
+#define MMU_RAM_ELSZ_SHIFT 7
+#define MMU_RAM_ELSZ_MASK  (3  MMU_RAM_ELSZ_SHIFT)
+#define MMU_RAM_ELSZ_8 (0  MMU_RAM_ELSZ_SHIFT)
+#define MMU_RAM_ELSZ_16(1  MMU_RAM_ELSZ_SHIFT)
+#define MMU_RAM_ELSZ_32(2  MMU_RAM_ELSZ_SHIFT)
+#define MMU_RAM_ELSZ_NONE  (3  MMU_RAM_ELSZ_SHIFT)
+#define MMU_RAM_MIXED_SHIFT6
+#define MMU_RAM_MIXED_MASK (1  MMU_RAM_MIXED_SHIFT)
+#define MMU_RAM_MIXED  MMU_RAM_MIXED_MASK
 
 /*
  * utilities for super page(16MB, 1MB, 64KB and 4KB)
@@ -218,4 +283,17 @@ omap_iommu_dump_ctx(struct omap_iommu *obj, char *buf, 
ssize_t len);
 extern size_t
 omap_dump_tlb_entries(struct omap_iommu *obj, char *buf, ssize_t len);
 
+/*
+ * register accessors
+ */
+static inline u32 iommu_read_reg(struct omap_iommu *obj, size_t offs)
+{
+   return __raw_readl(obj-regbase + offs);
+}
+
+static inline void iommu_write_reg(struct omap_iommu *obj, u32 val, size_t 
offs)
+{
+   __raw_writel(val, obj-regbase + offs);
+}
+
 #endif /* __MACH_IOMMU_H */
diff --git a/arch/arm/plat-omap/include/plat/iommu2.h 
b/arch/arm/plat-omap/include/plat/iommu2.h
deleted file mode 100644
index d4116b5..000
--- a/arch/arm/plat-omap/include/plat/iommu2.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * omap iommu: omap2 architecture specific definitions
- *
- * Copyright (C) 2008-2009 Nokia Corporation
- *
- * Written by Hiroshi DOYU hiroshi.d...@nokia.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.
- 

[PATCH 2/4] ARM: OMAP2+: Make some definitions local

2012-10-15 Thread Tony Lindgren
From: Ido Yariv i...@wizery.com

Move some of the definitions in plat/iommu.h that can be made local to
either drivers/iommu or arch/arm/mach-omap2. This minimizes the number
of global definitions once plat/iommu.h moves to platform_data/ as part
of the single zImage effort.

Cc: Joerg Roedel joerg.roe...@amd.com
Cc: Ohad Ben-Cohen o...@wizery.com
Signed-off-by: Ido Yariv i...@wizery.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/iommu2.c|6 +++
 arch/arm/plat-omap/include/plat/iommu.h |   55 -
 drivers/iommu/omap-iommu-debug.c|2 +
 drivers/iommu/omap-iommu.c  |2 +
 drivers/iommu/omap-iommu.h  |   59 +++
 drivers/iommu/omap-iovmm.c  |2 +
 6 files changed, 71 insertions(+), 55 deletions(-)
 create mode 100644 drivers/iommu/omap-iommu.h

diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c
index eefc379..c986880 100644
--- a/arch/arm/mach-omap2/iommu2.c
+++ b/arch/arm/mach-omap2/iommu2.c
@@ -65,6 +65,12 @@
 ((pgsz) == MMU_CAM_PGSZ_64K) ? 0x :\
 ((pgsz) == MMU_CAM_PGSZ_4K)  ? 0xf000 : 0)
 
+/* IOMMU errors */
+#define OMAP_IOMMU_ERR_TLB_MISS(1  0)
+#define OMAP_IOMMU_ERR_TRANS_FAULT (1  1)
+#define OMAP_IOMMU_ERR_EMU_MISS(1  2)
+#define OMAP_IOMMU_ERR_TBLWALK_FAULT   (1  3)
+#define OMAP_IOMMU_ERR_MULTIHIT_FAULT  (1  4)
 
 static void __iommu_set_twl(struct omap_iommu *obj, bool on)
 {
diff --git a/arch/arm/plat-omap/include/plat/iommu.h 
b/arch/arm/plat-omap/include/plat/iommu.h
index 7e8c7b6..35a0245 100644
--- a/arch/arm/plat-omap/include/plat/iommu.h
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -77,11 +77,6 @@ struct cr_regs {
};
 };
 
-struct iotlb_lock {
-   short base;
-   short vict;
-};
-
 /* architecture specific functions */
 struct iommu_functions {
unsigned long   version;
@@ -145,26 +140,6 @@ struct omap_iommu_arch_data {
struct omap_iommu *iommu_dev;
 };
 
-#ifdef CONFIG_IOMMU_API
-/**
- * dev_to_omap_iommu() - retrieves an omap iommu object from a user device
- * @dev: iommu client device
- */
-static inline struct omap_iommu *dev_to_omap_iommu(struct device *dev)
-{
-   struct omap_iommu_arch_data *arch_data = dev-archdata.iommu;
-
-   return arch_data-iommu_dev;
-}
-#endif
-
-/* IOMMU errors */
-#define OMAP_IOMMU_ERR_TLB_MISS(1  0)
-#define OMAP_IOMMU_ERR_TRANS_FAULT (1  1)
-#define OMAP_IOMMU_ERR_EMU_MISS(1  2)
-#define OMAP_IOMMU_ERR_TBLWALK_FAULT   (1  3)
-#define OMAP_IOMMU_ERR_MULTIHIT_FAULT  (1  4)
-
 /*
  * MMU Register offsets
  */
@@ -192,16 +167,6 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct 
device *dev)
 /*
  * MMU Register bit definitions
  */
-#define MMU_LOCK_BASE_SHIFT10
-#define MMU_LOCK_BASE_MASK (0x1f  MMU_LOCK_BASE_SHIFT)
-#define MMU_LOCK_BASE(x)   \
-   ((x  MMU_LOCK_BASE_MASK)  MMU_LOCK_BASE_SHIFT)
-
-#define MMU_LOCK_VICT_SHIFT4
-#define MMU_LOCK_VICT_MASK (0x1f  MMU_LOCK_VICT_SHIFT)
-#define MMU_LOCK_VICT(x)   \
-   ((x  MMU_LOCK_VICT_MASK)  MMU_LOCK_VICT_SHIFT)
-
 #define MMU_CAM_VATAG_SHIFT12
 #define MMU_CAM_VATAG_MASK \
((~0UL  MMU_CAM_VATAG_SHIFT)  MMU_CAM_VATAG_SHIFT)
@@ -257,32 +222,12 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct 
device *dev)
 /*
  * global functions
  */
-extern u32 omap_iommu_arch_version(void);
-
-extern void omap_iotlb_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e);
-
-extern int
-omap_iopgtable_store_entry(struct omap_iommu *obj, struct iotlb_entry *e);
-
-extern int omap_iommu_set_isr(const char *name,
-int (*isr)(struct omap_iommu *obj, u32 da, u32 iommu_errs,
-   void *priv),
-void *isr_priv);
-
 extern void omap_iommu_save_ctx(struct device *dev);
 extern void omap_iommu_restore_ctx(struct device *dev);
 
 extern int omap_install_iommu_arch(const struct iommu_functions *ops);
 extern void omap_uninstall_iommu_arch(const struct iommu_functions *ops);
 
-extern int omap_foreach_iommu_device(void *data,
-   int (*fn)(struct device *, void *));
-
-extern ssize_t
-omap_iommu_dump_ctx(struct omap_iommu *obj, char *buf, ssize_t len);
-extern size_t
-omap_dump_tlb_entries(struct omap_iommu *obj, char *buf, ssize_t len);
-
 /*
  * register accessors
  */
diff --git a/drivers/iommu/omap-iommu-debug.c b/drivers/iommu/omap-iommu-debug.c
index f55fc5d..a0b0309 100644
--- a/drivers/iommu/omap-iommu-debug.c
+++ b/drivers/iommu/omap-iommu-debug.c
@@ -24,6 +24,8 @@
 
 #include plat/iopgtable.h
 
+#include omap-iommu.h
+
 #define MAXCOLUMN 100 /* for short messages */
 
 static DEFINE_MUTEX(iommu_debug_lock);
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index d0b1234..80844b3 100644
--- a/drivers/iommu/omap-iommu.c
+++ 

[PATCH 3/4] ARM: OMAP2+: Move iommu/iovmm headers to platform_data

2012-10-15 Thread Tony Lindgren
From: Ido Yariv i...@wizery.com

Move iommu/iovmm headers from plat/ to platform_data/ as part of the
single zImage work.

Cc: Joerg Roedel joerg.roe...@amd.com
Cc: Ohad Ben-Cohen o...@wizery.com
Signed-off-by: Ido Yariv i...@wizery.com
Acked-by: Mauro Carvalho Chehab mche...@redhat.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/devices.c  |2 +-
 arch/arm/mach-omap2/iommu2.c   |2 +-
 arch/arm/mach-omap2/omap-iommu.c   |2 +-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |2 +-
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |2 +-
 drivers/iommu/omap-iommu-debug.c   |4 ++--
 drivers/iommu/omap-iommu.c |2 +-
 drivers/iommu/omap-iovmm.c |4 ++--
 drivers/media/platform/omap3isp/isp.h  |5 +++--
 drivers/media/platform/omap3isp/ispvideo.c |5 ++---
 include/linux/platform_data/iommu-omap.h   |0 
 include/linux/platform_data/iovmm-omap.h   |0 
 12 files changed, 15 insertions(+), 15 deletions(-)
 rename arch/arm/plat-omap/include/plat/iommu.h = 
include/linux/platform_data/iommu-omap.h (100%)
 rename arch/arm/plat-omap/include/plat/iovmm.h = 
include/linux/platform_data/iovmm-omap.h (100%)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index c8c2117..6cd0c2a 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -126,7 +126,7 @@ static struct platform_device omap2cam_device = {
 
 #if defined(CONFIG_IOMMU_API)
 
-#include plat/iommu.h
+#include linux/platform_data/iommu-omap.h
 
 static struct resource omap3isp_resources[] = {
{
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c
index c986880..82f9174 100644
--- a/arch/arm/mach-omap2/iommu2.c
+++ b/arch/arm/mach-omap2/iommu2.c
@@ -18,7 +18,7 @@
 #include linux/slab.h
 #include linux/stringify.h
 
-#include plat/iommu.h
+#include linux/platform_data/iommu-omap.h
 
 /*
  * omap2 architecture specific register bit definitions
diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c
index df298d4..a6a4ff8 100644
--- a/arch/arm/mach-omap2/omap-iommu.c
+++ b/arch/arm/mach-omap2/omap-iommu.c
@@ -13,7 +13,7 @@
 #include linux/module.h
 #include linux/platform_device.h
 
-#include plat/iommu.h
+#include linux/platform_data/iommu-omap.h
 
 #include soc.h
 #include common.h
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index f67b7ee..621bc71 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -26,8 +26,8 @@
 #include plat/mmc.h
 #include linux/platform_data/asoc-ti-mcbsp.h
 #include linux/platform_data/spi-omap2-mcspi.h
+#include linux/platform_data/iommu-omap.h
 #include plat/dmtimer.h
-#include plat/iommu.h
 
 #include am35xx.h
 
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 652d028..5850b3e 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -27,10 +27,10 @@
 #include plat/dma.h
 #include linux/platform_data/spi-omap2-mcspi.h
 #include linux/platform_data/asoc-ti-mcbsp.h
+#include linux/platform_data/iommu-omap.h
 #include plat/mmc.h
 #include plat/dmtimer.h
 #include plat/common.h
-#include plat/iommu.h
 
 #include omap_hwmod_common_data.h
 #include cm1_44xx.h
diff --git a/drivers/iommu/omap-iommu-debug.c b/drivers/iommu/omap-iommu-debug.c
index a0b0309..8c1e30b 100644
--- a/drivers/iommu/omap-iommu-debug.c
+++ b/drivers/iommu/omap-iommu-debug.c
@@ -19,8 +19,8 @@
 #include linux/platform_device.h
 #include linux/debugfs.h
 
-#include plat/iommu.h
-#include plat/iovmm.h
+#include linux/platform_data/iommu-omap.h
+#include linux/platform_data/iovmm-omap.h
 
 #include plat/iopgtable.h
 
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 80844b3..6100334 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -24,7 +24,7 @@
 
 #include asm/cacheflush.h
 
-#include plat/iommu.h
+#include linux/platform_data/iommu-omap.h
 
 #include plat/iopgtable.h
 
diff --git a/drivers/iommu/omap-iovmm.c b/drivers/iommu/omap-iovmm.c
index b362fb5..b5ac2cd 100644
--- a/drivers/iommu/omap-iovmm.c
+++ b/drivers/iommu/omap-iovmm.c
@@ -21,8 +21,8 @@
 #include asm/cacheflush.h
 #include asm/mach/map.h
 
-#include plat/iommu.h
-#include plat/iovmm.h
+#include linux/platform_data/iommu-omap.h
+#include linux/platform_data/iovmm-omap.h
 
 #include plat/iopgtable.h
 
diff --git a/drivers/media/platform/omap3isp/isp.h 
b/drivers/media/platform/omap3isp/isp.h
index 8be7487..62c76f9 100644
--- a/drivers/media/platform/omap3isp/isp.h
+++ b/drivers/media/platform/omap3isp/isp.h
@@ -34,8 +34,9 @@
 #include linux/platform_device.h
 #include linux/wait.h
 #include linux/iommu.h
-#include plat/iommu.h
-#include plat/iovmm.h
+
+#include linux/platform_data/iommu-omap.h
+#include 

[PATCH 4/4] ARM: OMAP2+: Move iopgtable header to drivers/iommu/

2012-10-15 Thread Tony Lindgren
From: Ido Yariv i...@wizery.com

The iopgtable header file is only used by the iommu  iovmm drivers, so
move it to drivers/iommu/, as part of the single zImage effort.

Cc: Joerg Roedel joerg.roe...@amd.com
Cc: Ohad Ben-Cohen o...@wizery.com
Signed-off-by: Ido Yariv i...@wizery.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 drivers/iommu/omap-iommu-debug.c|3 +--
 drivers/iommu/omap-iommu.c  |3 +--
 drivers/iommu/omap-iopgtable.h  |0 
 drivers/iommu/omap-iovmm.c  |3 +--
 4 files changed, 3 insertions(+), 6 deletions(-)
 rename arch/arm/plat-omap/include/plat/iopgtable.h = 
drivers/iommu/omap-iopgtable.h (100%)

diff --git a/drivers/iommu/omap-iommu-debug.c b/drivers/iommu/omap-iommu-debug.c
index 8c1e30b..84dbfd2 100644
--- a/drivers/iommu/omap-iommu-debug.c
+++ b/drivers/iommu/omap-iommu-debug.c
@@ -22,8 +22,7 @@
 #include linux/platform_data/iommu-omap.h
 #include linux/platform_data/iovmm-omap.h
 
-#include plat/iopgtable.h
-
+#include omap-iopgtable.h
 #include omap-iommu.h
 
 #define MAXCOLUMN 100 /* for short messages */
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 6100334..1ca33b0 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -26,8 +26,7 @@
 
 #include linux/platform_data/iommu-omap.h
 
-#include plat/iopgtable.h
-
+#include omap-iopgtable.h
 #include omap-iommu.h
 
 #define for_each_iotlb_cr(obj, n, __i, cr) \
diff --git a/arch/arm/plat-omap/include/plat/iopgtable.h 
b/drivers/iommu/omap-iopgtable.h
similarity index 100%
rename from arch/arm/plat-omap/include/plat/iopgtable.h
rename to drivers/iommu/omap-iopgtable.h
diff --git a/drivers/iommu/omap-iovmm.c b/drivers/iommu/omap-iovmm.c
index b5ac2cd..2820e3a 100644
--- a/drivers/iommu/omap-iovmm.c
+++ b/drivers/iommu/omap-iovmm.c
@@ -24,8 +24,7 @@
 #include linux/platform_data/iommu-omap.h
 #include linux/platform_data/iovmm-omap.h
 
-#include plat/iopgtable.h
-
+#include omap-iopgtable.h
 #include omap-iommu.h
 
 static struct kmem_cache *iovm_area_cachep;

--
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] ARM: OMAP2+: Move iommu/iovmm headers to platform_data

2012-10-15 Thread Tony Lindgren
* Tony Lindgren t...@atomide.com [121015 17:38]:
 From: Ido Yariv i...@wizery.com
 
 Move iommu/iovmm headers from plat/ to platform_data/ as part of the
 single zImage work.

Joerg, I'm planning to apply these four patches against -rc1 into
omap-for-v3.8/cleanup-headers-iommu branch if these look OK to you.

That branch won't contain other patches and you can pull it in too
if needed.

Regards,

Tony
 
 Cc: Joerg Roedel joerg.roe...@amd.com
 Cc: Ohad Ben-Cohen o...@wizery.com
 Signed-off-by: Ido Yariv i...@wizery.com
 Acked-by: Mauro Carvalho Chehab mche...@redhat.com
 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
  arch/arm/mach-omap2/devices.c  |2 +-
  arch/arm/mach-omap2/iommu2.c   |2 +-
  arch/arm/mach-omap2/omap-iommu.c   |2 +-
  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |2 +-
  arch/arm/mach-omap2/omap_hwmod_44xx_data.c |2 +-
  drivers/iommu/omap-iommu-debug.c   |4 ++--
  drivers/iommu/omap-iommu.c |2 +-
  drivers/iommu/omap-iovmm.c |4 ++--
  drivers/media/platform/omap3isp/isp.h  |5 +++--
  drivers/media/platform/omap3isp/ispvideo.c |5 ++---
  include/linux/platform_data/iommu-omap.h   |0 
  include/linux/platform_data/iovmm-omap.h   |0 
  12 files changed, 15 insertions(+), 15 deletions(-)
  rename arch/arm/plat-omap/include/plat/iommu.h = 
 include/linux/platform_data/iommu-omap.h (100%)
  rename arch/arm/plat-omap/include/plat/iovmm.h = 
 include/linux/platform_data/iovmm-omap.h (100%)
 
 diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
 index c8c2117..6cd0c2a 100644
 --- a/arch/arm/mach-omap2/devices.c
 +++ b/arch/arm/mach-omap2/devices.c
 @@ -126,7 +126,7 @@ static struct platform_device omap2cam_device = {
  
  #if defined(CONFIG_IOMMU_API)
  
 -#include plat/iommu.h
 +#include linux/platform_data/iommu-omap.h
  
  static struct resource omap3isp_resources[] = {
   {
 diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c
 index c986880..82f9174 100644
 --- a/arch/arm/mach-omap2/iommu2.c
 +++ b/arch/arm/mach-omap2/iommu2.c
 @@ -18,7 +18,7 @@
  #include linux/slab.h
  #include linux/stringify.h
  
 -#include plat/iommu.h
 +#include linux/platform_data/iommu-omap.h
  
  /*
   * omap2 architecture specific register bit definitions
 diff --git a/arch/arm/mach-omap2/omap-iommu.c 
 b/arch/arm/mach-omap2/omap-iommu.c
 index df298d4..a6a4ff8 100644
 --- a/arch/arm/mach-omap2/omap-iommu.c
 +++ b/arch/arm/mach-omap2/omap-iommu.c
 @@ -13,7 +13,7 @@
  #include linux/module.h
  #include linux/platform_device.h
  
 -#include plat/iommu.h
 +#include linux/platform_data/iommu-omap.h
  
  #include soc.h
  #include common.h
 diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
 b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
 index f67b7ee..621bc71 100644
 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
 +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
 @@ -26,8 +26,8 @@
  #include plat/mmc.h
  #include linux/platform_data/asoc-ti-mcbsp.h
  #include linux/platform_data/spi-omap2-mcspi.h
 +#include linux/platform_data/iommu-omap.h
  #include plat/dmtimer.h
 -#include plat/iommu.h
  
  #include am35xx.h
  
 diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c 
 b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
 index 652d028..5850b3e 100644
 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
 +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
 @@ -27,10 +27,10 @@
  #include plat/dma.h
  #include linux/platform_data/spi-omap2-mcspi.h
  #include linux/platform_data/asoc-ti-mcbsp.h
 +#include linux/platform_data/iommu-omap.h
  #include plat/mmc.h
  #include plat/dmtimer.h
  #include plat/common.h
 -#include plat/iommu.h
  
  #include omap_hwmod_common_data.h
  #include cm1_44xx.h
 diff --git a/drivers/iommu/omap-iommu-debug.c 
 b/drivers/iommu/omap-iommu-debug.c
 index a0b0309..8c1e30b 100644
 --- a/drivers/iommu/omap-iommu-debug.c
 +++ b/drivers/iommu/omap-iommu-debug.c
 @@ -19,8 +19,8 @@
  #include linux/platform_device.h
  #include linux/debugfs.h
  
 -#include plat/iommu.h
 -#include plat/iovmm.h
 +#include linux/platform_data/iommu-omap.h
 +#include linux/platform_data/iovmm-omap.h
  
  #include plat/iopgtable.h
  
 diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
 index 80844b3..6100334 100644
 --- a/drivers/iommu/omap-iommu.c
 +++ b/drivers/iommu/omap-iommu.c
 @@ -24,7 +24,7 @@
  
  #include asm/cacheflush.h
  
 -#include plat/iommu.h
 +#include linux/platform_data/iommu-omap.h
  
  #include plat/iopgtable.h
  
 diff --git a/drivers/iommu/omap-iovmm.c b/drivers/iommu/omap-iovmm.c
 index b362fb5..b5ac2cd 100644
 --- a/drivers/iommu/omap-iovmm.c
 +++ b/drivers/iommu/omap-iovmm.c
 @@ -21,8 +21,8 @@
  #include asm/cacheflush.h
  #include asm/mach/map.h
  
 -#include plat/iommu.h
 -#include plat/iovmm.h
 +#include linux/platform_data/iommu-omap.h
 +#include linux/platform_data/iovmm-omap.h
  
  #include plat/iopgtable.h
  

Re: [PATCH] i2c: omap: fix spurious IRQs: disable/enable IRQ at INTC when idle

2012-10-15 Thread Tony Lindgren
* Kevin Hilman khil...@deeprootsystems.com [121015 10:32]:
 Kalle Jokiniemi kalle.jokini...@jollamobile.com writes:
 
  Does not work for me :(
 
  As I said, the issue occurs for me when I enter static suspend (echo mem
  /sys/power/autosleep or /sys/power/state). I don't think doing this
  just in runtime pm will fix my issue. Or do those handlers get run in
  the normal suspend path as well?
 
 If the I2C device is still active during the suspend path, these
 handlers will get run by the PM domain code (in omap_device.)  However,
 now that I think about it, the current omap_device PM domain code calls
 these at the noirq level, not the late/early level, so it does not
 address your original problem. :(
 
 I suspect we'll need this and your original patch.

Have you checked that this is not related to flushing the posted
write? If it is, reading back any register from the i2c controller
after writing to it ensures the write actually reaches the i2c
controller.

Regards,

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


Re: [PATCH 2/6] ARM: OMAP3/4: iommu: adapt to runtime pm

2012-10-15 Thread Omar Ramirez Luna
Hi Felipe,

On 12 October 2012 16:25, Felipe Contreras felipe.contre...@gmail.com wrote:
 @@ -142,11 +142,10 @@ static int iommu_enable(struct omap_iommu *obj)
 }
 }

 -   clk_enable(obj-clk);
 +   pm_runtime_get_sync(obj-dev);

 err = arch_iommu-enable(obj);

 -   clk_disable(obj-clk);

 The device will never go to sleep, until iommu_disable is called.
 clk_enable - pm_runtime_get_sync, clk_disable pm_runtime_put.

 Which is what you want... why would you want your iommu to be disabled
 if the client of that iommu could request a translation?

 That's the whole point of *dynamic* pm; _when_ the client wants to
 request a translation, _then_ the device is waken up, which is what I
 believe the code currently does.

No it doesn't, current code is working because the processor and the
iommu share the same clock, so enabling the processor is implicitly
guaranteeing that the iommu will be enabled. IMHO, there shouldn't be
such assumption that you can control both with the same clock.

So, once the remote processor is enabled, any dynamic pm from iommu
with current code has no effect because the clock was already enabled
for the processor.

 After your patch, even if I don't use the camera, or the DSP, the
 iommu devices will be enabled, and will be consuming energy *all the
 time*. Which I don't think is what we want.

Wrong, the iommu device will be enabled by pm_runtime_get_sync once
you decide to attach with iommu_attach_device, if you do not use
camera or the dsp, you won't turn ON the iommus.

On probe this patch does pm_runtime_enable, however this doesn't mean
the device is turned ON or resumed or kept ON all the time.

 I'm not saying I have a solution, I'm simply saying that's what's
 going to happen if I'm correct.

Ok, but that is not what happens here.

 Remember that these iommus, sit along of other processors not on the
 main processor side. So, this code should enable it for the other
 processor to use, and there is no point where the processor can say
 I'm not using it, shut it down or I'm using it, turn it on in the
 middle of execution, other than suspend/resume and if supported,
 autosuspend.

 I understand, but perhaps there should be?

Autosuspend is a feature missing and should handle the scenario where
the remote processor can sleep dynamically, this scenario should turn
off the iommu and the remote processor itself when there is no
workload but it depends on the remote processor activity not the iommu
activity.

 @@ -1009,7 +1001,8 @@ static int __devexit omap_iommu_remove(struct 
 platform_device *pdev)
 release_mem_region(res-start, resource_size(res));
 iounmap(obj-regbase);

 -   clk_put(obj-clk);
 +   pm_runtime_disable(obj-dev);

 This will turn on the device unnecessarily, wasting power, and there's
 no need for that, kfree will take care of that without resuming.

 Left aside the aesthetics of having balanced calls, the device will be
 enabled if there was a pending resume to be executed, otherwise it
 won't, kfree won't increment the disable_depth counter and I don't
 think that freeing the pointer is enough reason to ignore
 pm_runtime_disable.

 You are doing __pm_runtime_disable(dev, true), kfree will do
 __pm_runtime_disable(dev, false), which is what we want. Both will
 decrement the disable_depth.

I'm quite confused here, could you please point me to the kfree snip
that does __pm_runtime_disable(dev, false)?

 But at least you agree that there's a chance that the device will be waken up.

Of course, if there is a pending resume to be executed, it must honor
that resume request and then turn off the device before removing the
iommu, IMHO.

 Also, I still think that something like this is needed:
 ...
 +static struct clk cam_fck = {
 +   .name   = cam_fck,
 +   .ops= clkops_omap2_iclk_dflt,
 +   .parent = l3_ick,
 +   .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),

 a cam_fck name to enable the ick?

 Yeap, according to the TRM. Take a look at 12.3 Camera ISP Integration
 Fig 12-50.

What I meant is that, you are using the CM_ICLKEN to enable a clock
named cam_fck which has l3_ick as a parent. And that is not
consistent with what that register is meant to do, which is:

4.14.1.10 CAM_CM Registers

CM_ICKLEN_CAM
0x0: CAM_L3_ICK and CAM_L4_ICLK are disabled
0x1: CAM_L3_ICK and CAM_L4_ICLK are enabled

So, I'm complaining about the name cam_fck, for an interface clock
with parent l3_ick. However I don't know why on section 12.3 they
refer to CAM_FCK to a l3_ick child clock.

Cheers,

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


[PATCH 1/6] OMAPDSS: HDMI: Rename resource variable at probe.

2012-10-15 Thread Ricardo Neri
Minor cleanup to give to the resource variable a more proper name.

Signed-off-by: Ricardo Neri ricardo.n...@ti.com
---
 drivers/video/omap2/dss/hdmi.c |9 -
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index a48a7dd..2cba177 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -997,22 +997,21 @@ static void __exit hdmi_uninit_output(struct 
platform_device *pdev)
 /* HDMI HW IP initialisation */
 static int __init omapdss_hdmihw_probe(struct platform_device *pdev)
 {
-   struct resource *hdmi_mem;
+   struct resource *res;
int r;
 
hdmi.pdev = pdev;
 
mutex_init(hdmi.lock);
 
-   hdmi_mem = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0);
-   if (!hdmi_mem) {
+   res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0);
+   if (!res) {
DSSERR(can't get IORESOURCE_MEM HDMI\n);
return -EINVAL;
}
 
/* Base address taken from platform */
-   hdmi.ip_data.base_wp = ioremap(hdmi_mem-start,
-   resource_size(hdmi_mem));
+   hdmi.ip_data.base_wp = ioremap(res-start, resource_size(res));
if (!hdmi.ip_data.base_wp) {
DSSERR(can't ioremap WP\n);
return -ENOMEM;
-- 
1.7.5.4

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


[PATCH 0/6] Create platform device for audio support

2012-10-15 Thread Ricardo Neri
Hi Tomi, l-o list,

The main purpose of this patch set is to create a platform device for audio
support from the OMAPDSS HDMI driver. This follows an approach similar to MFD
drivers in which a core driver creates domain-specific devices. Under this
approach, the OMAPDSS HDMI drivers as the core driver, retrieves its resources
(from DT or hwmod) and passes them to the platform device for audio for other
drivers to use (e.g., ASoC).

This is also beneficial for future DT boot support, as the OMAP HDMI IP will be
represented by a single node in the tree.

Before creating the platform device for audio, I also did minor cleanup to the
OMAPDSS HDMI driver probe.

BR,

Ricardo

Ricardo Neri (6):
  OMAPDSS: HDMI: Rename resource variable at probe.
  OMAPDSS: Convert to devm_ioremap
  OMAPDSS: HDMI: Make panel return error if cannot register driver
  OMAPDSS: HDMI: Uninit display if unable to register device
  OMAPDSS: HDMI: Handle error when initing the display at probe
  OMAPDSS: HDMI: Create platform device to support audio.

 drivers/video/omap2/dss/hdmi.c   |  101 ++
 drivers/video/omap2/dss/hdmi_panel.c |4 +-
 2 files changed, 91 insertions(+), 14 deletions(-)

-- 
1.7.5.4

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


[PATCH 5/6] OMAPDSS: HDMI: Handle error when initing the display at probe

2012-10-15 Thread Ricardo Neri
Do not blindly assume that the panel could be init'ed.

While there, put mutex initialization in the same place.

Signed-off-by: Ricardo Neri ricardo.n...@ti.com
---
 drivers/video/omap2/dss/hdmi.c |   14 +++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index bea42f4..e5be0a5 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -60,6 +60,7 @@
 static struct {
struct mutex lock;
struct platform_device *pdev;
+
struct hdmi_ip_data ip_data;
 
struct clk *sys_clk;
@@ -1004,6 +1005,7 @@ static int __init omapdss_hdmihw_probe(struct 
platform_device *pdev)
hdmi.pdev = pdev;
 
mutex_init(hdmi.lock);
+   mutex_init(hdmi.ip_data.lock);
 
res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0);
if (!res) {
@@ -1036,9 +1038,11 @@ static int __init omapdss_hdmihw_probe(struct 
platform_device *pdev)
hdmi.ip_data.pll_offset = HDMI_PLLCTRL;
hdmi.ip_data.phy_offset = HDMI_PHY;
 
-   mutex_init(hdmi.ip_data.lock);
-
-   hdmi_panel_init();
+   r = hdmi_panel_init();
+   if (r) {
+   DSSERR(can't init panel\n);
+   goto err_panel_init;
+   }
 
dss_debugfs_create_file(hdmi, hdmi_dump_regs);
 
@@ -1047,6 +1051,10 @@ static int __init omapdss_hdmihw_probe(struct 
platform_device *pdev)
hdmi_probe_pdata(pdev);
 
return 0;
+
+err_panel_init:
+   hdmi_put_clocks();
+   return r;
 }
 
 static int __exit hdmi_remove_child(struct device *dev, void *data)
-- 
1.7.5.4

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


[PATCH 2/6] OMAPDSS: Convert to devm_ioremap

2012-10-15 Thread Ricardo Neri
Using devm_ioremap provides better memory handling and improves
readability.

Signed-off-by: Ricardo Neri ricardo.n...@ti.com
---
 drivers/video/omap2/dss/hdmi.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 2cba177..6773e2c 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -1010,8 +1010,13 @@ static int __init omapdss_hdmihw_probe(struct 
platform_device *pdev)
return -EINVAL;
}
 
+   if (!devm_request_mem_region(pdev-dev, res-start,
+resource_size(res), HDMI))
+   return -EBUSY;
+
/* Base address taken from platform */
-   hdmi.ip_data.base_wp = ioremap(res-start, resource_size(res));
+   hdmi.ip_data.base_wp = devm_ioremap(pdev-dev, res-start,
+resource_size(res));
if (!hdmi.ip_data.base_wp) {
DSSERR(can't ioremap WP\n);
return -ENOMEM;
@@ -1019,7 +1024,7 @@ static int __init omapdss_hdmihw_probe(struct 
platform_device *pdev)
 
r = hdmi_get_clocks(pdev);
if (r) {
-   iounmap(hdmi.ip_data.base_wp);
+   DSSERR(can't get clocks\n);
return r;
}
 
@@ -1064,8 +1069,6 @@ static int __exit omapdss_hdmihw_remove(struct 
platform_device *pdev)
 
hdmi_put_clocks();
 
-   iounmap(hdmi.ip_data.base_wp);
-
return 0;
 }
 
-- 
1.7.5.4

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


[PATCH 6/6] OMAPDSS: HDMI: Create platform device to support audio

2012-10-15 Thread Ricardo Neri
Creating the accessory devices, such as audio, from the HDMI driver
allows to regard HDMI as a single entity with audio an display
functionality. This intends to follow the design of drivers such
as MFD, in which a single entity handles the creation of the accesory
devices. Such devices are then used by domain-specific drivers; audio in
this case.

Also, this is in line with the DT implementation of HDMI, in which we will
have a single node to describe this feature of the OMAP SoC.

Signed-off-by: Ricardo Neri ricardo.n...@ti.com
---
 drivers/video/omap2/dss/hdmi.c |   68 
 1 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index e5be0a5..c62c5ab 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -60,6 +60,9 @@
 static struct {
struct mutex lock;
struct platform_device *pdev;
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+   struct platform_device *audio_pdev;
+#endif
 
struct hdmi_ip_data ip_data;
 
@@ -73,6 +76,13 @@ static struct {
struct omap_dss_output output;
 } hdmi;
 
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+#define HDMI_AUDIO_MEM_RESOURCE 0
+#define HDMI_AUDIO_DMA_RESOURCE 1
+static struct resource hdmi_aud_res[2];
+#endif
+
+
 /*
  * Logic for the below structure :
  * user enters the CEA or VESA timings by specifying the HDMI/DVI code.
@@ -765,6 +775,50 @@ static void hdmi_put_clocks(void)
 }
 
 #if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+static int hdmi_probe_audio(struct platform_device *pdev)
+{
+   struct resource *res;
+
+   hdmi.audio_pdev = ERR_PTR(-EINVAL);
+
+   res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0);
+   if (!res) {
+   DSSERR(can't get IORESOURCE_MEM HDMI\n);
+   return -EINVAL;
+   }
+
+   /*
+* Pass this resource to audio_pdev.
+* Audio drivers should not remap it
+*/
+   hdmi_aud_res[HDMI_AUDIO_MEM_RESOURCE].start = res-start;
+   hdmi_aud_res[HDMI_AUDIO_MEM_RESOURCE].end = res-end;
+   hdmi_aud_res[HDMI_AUDIO_MEM_RESOURCE].flags = IORESOURCE_MEM;
+
+   res = platform_get_resource(hdmi.pdev, IORESOURCE_DMA, 0);
+   if (!res) {
+   DSSERR(can't get IORESOURCE_DMA HDMI\n);
+   return -EINVAL;
+   }
+
+   /* Pass this resource to audio_pdev */
+   hdmi_aud_res[HDMI_AUDIO_DMA_RESOURCE].start = res-start;
+   hdmi_aud_res[HDMI_AUDIO_DMA_RESOURCE].end = res-end;
+   hdmi_aud_res[HDMI_AUDIO_DMA_RESOURCE].flags = IORESOURCE_DMA;
+
+   /* create platform device for HDMI audio driver */
+   hdmi.audio_pdev = platform_device_register_simple(
+ omap_hdmi_audio,
+ -1, hdmi_aud_res,
+  
ARRAY_SIZE(hdmi_aud_res));
+   if (IS_ERR(hdmi.audio_pdev)) {
+   DSSERR(Can't instantiate hdmi-audio\n);
+   return PTR_ERR(hdmi.audio_pdev);
+   }
+
+   return 0;
+}
+
 int hdmi_compute_acr(u32 sample_freq, u32 *n, u32 *cts)
 {
u32 deep_color;
@@ -1044,6 +1098,11 @@ static int __init omapdss_hdmihw_probe(struct 
platform_device *pdev)
goto err_panel_init;
}
 
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+   r = hdmi_probe_audio(pdev);
+   if (r)
+   goto err_audio_dev;
+#endif
dss_debugfs_create_file(hdmi, hdmi_dump_regs);
 
hdmi_init_output(pdev);
@@ -1052,6 +,10 @@ static int __init omapdss_hdmihw_probe(struct 
platform_device *pdev)
 
return 0;
 
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+err_audio_dev:
+   hdmi_panel_exit();
+#endif
 err_panel_init:
hdmi_put_clocks();
return r;
@@ -1066,6 +1129,11 @@ static int __exit hdmi_remove_child(struct device *dev, 
void *data)
 
 static int __exit omapdss_hdmihw_remove(struct platform_device *pdev)
 {
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+   if (!IS_ERR(hdmi.audio_pdev))
+   platform_device_unregister(hdmi.audio_pdev);
+#endif
+
device_for_each_child(pdev-dev, NULL, hdmi_remove_child);
 
dss_unregister_child_devices(pdev-dev);
-- 
1.7.5.4

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


[PATCH 4/6] OMAPDSS: HDMI: Uninit display if unable to register device

2012-10-15 Thread Ricardo Neri
The display must be uninit'ed in order to free the requested GPIOs.

Signed-off-by: Ricardo Neri ricardo.n...@ti.com
---
 drivers/video/omap2/dss/hdmi.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 6773e2c..bea42f4 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -971,6 +971,7 @@ static void __init hdmi_probe_pdata(struct platform_device 
*pdev)
r = dss_add_device(dssdev);
if (r) {
DSSERR(device %s register failed: %d\n, dssdev-name, r);
+   hdmi_uninit_display(dssdev);
dss_put_device(dssdev);
return;
}
-- 
1.7.5.4

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


[PATCH 3/6] OMAPDSS: HDMI: Make panel return error if cannot register driver

2012-10-15 Thread Ricardo Neri
Do not assume blindly that the DSS driver was registered successfully.

Signed-off-by: Ricardo Neri ricardo.n...@ti.com
---
 drivers/video/omap2/dss/hdmi_panel.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/video/omap2/dss/hdmi_panel.c 
b/drivers/video/omap2/dss/hdmi_panel.c
index 69fb115..129107b 100644
--- a/drivers/video/omap2/dss/hdmi_panel.c
+++ b/drivers/video/omap2/dss/hdmi_panel.c
@@ -454,9 +454,7 @@ int hdmi_panel_init(void)
spin_lock_init(hdmi.audio_lock);
 #endif
 
-   omap_dss_register_driver(hdmi_driver);
-
-   return 0;
+   return omap_dss_register_driver(hdmi_driver);
 }
 
 void hdmi_panel_exit(void)
-- 
1.7.5.4

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


[PATCH 0/7] ARM: OMAP: second set of PRM/CM/CGRM cleanup patches for 3.8

2012-10-15 Thread Paul Walmsley
This series removes the omap_prcm_get_reset_sources() function.  This
was exported from arch/arm/mach-omap2/prcm.c for use by the OMAP
watchdog driver to report the boot reason.  This series reimplements
this using a platform_data function pointer for the time being, but
after the upcoming PRM/CM drivers are merged, the watchdog driver can be
patched to use an exported function from the drivers.

This series will also be used as a base for other PRM/CM cleanup during the
3.8 time frame, since it adds the prm_register() and prm_unregister() functions.
These are called by SoC-specific PRM IP block drivers to register function
pointers with the PRM subsystem.

This series changes the format of the watchdog's boot reason data to conform
with the watchdog subsystem standard (the WDIOF_* flags).  If users need
more detail than that interface provides, either the watchdog interface can
be patched, or those users can get that information from the upcoming PRM
drivers.


- Paul

---

prcm_cleanup_b_3.8
   textdata bss dec hex filename
7519295  696796 5613996 13830087 d307c7 vmlinux.omap2plus_defconfig.orig
7520203  696868 5613996 13831067 d30b9b vmlinux.omap2plus_defconfig

Paul Walmsley (7):
  ARM: OMAP2+: PRM: prepare for use of prm_ll_data function pointers
  ARM: OMAP2+: CM: prepare for use of cm_ll_data function pointers
  ARM: OMAP1: create read_reset_sources() function (for initial use by 
watchdog)
  ARM: OMAP2+: PRM: create PRM reset source API for the watchdog timer 
driver
  ARM: OMAP2+: WDT: move init; add read_reset_sources pdata function pointer
  watchdog: OMAP: use standard GETBOOTSTATUS interface; use platform_data 
fn ptr
  ARM: OMAP2+: PRCM: remove omap_prcm_get_reset_sources()


 arch/arm/mach-omap1/common.h|2 +
 arch/arm/mach-omap1/devices.c   |   21 ++-
 arch/arm/mach-omap1/reset.c |   39 +
 arch/arm/mach-omap2/Makefile|2 -
 arch/arm/mach-omap2/cm.h|   12 
 arch/arm/mach-omap2/cm_common.c |   71 +++
 arch/arm/mach-omap2/devices.c   |   26 
 arch/arm/mach-omap2/prcm.c  |   12 
 arch/arm/mach-omap2/prm-regbits-24xx.h  |4 +
 arch/arm/mach-omap2/prm-regbits-34xx.h  |   10 +++
 arch/arm/mach-omap2/prm.h   |   53 +
 arch/arm/mach-omap2/prm2xxx.c   |   68 ++
 arch/arm/mach-omap2/prm2xxx.h   |4 +
 arch/arm/mach-omap2/prm2xxx_3xxx.h  |2 +
 arch/arm/mach-omap2/prm3xxx.c   |   65 +
 arch/arm/mach-omap2/prm3xxx.h   |2 +
 arch/arm/mach-omap2/prm44xx.c   |   83 ++-
 arch/arm/mach-omap2/prm44xx.h   |2 +
 arch/arm/mach-omap2/prm_common.c|   78 +
 arch/arm/mach-omap2/wd_timer.c  |   33 +++
 arch/arm/plat-omap/include/plat/prcm.h  |1 
 drivers/watchdog/omap_wdt.c |   26 
 include/linux/platform_data/omap-wd-timer.h |   38 
 23 files changed, 594 insertions(+), 60 deletions(-)
 create mode 100644 arch/arm/mach-omap2/cm_common.c
 create mode 100644 include/linux/platform_data/omap-wd-timer.h

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


[PATCH 3/7] ARM: OMAP1: create read_reset_sources() function (for initial use by watchdog)

2012-10-15 Thread Paul Walmsley
On OMAP1, the existing OMAP watchdog driver reads a register directly
from a non-watchdog IP block.  It also does not convert the register's
contents into the standard WDIOF_* bits expected from the
GETBOOTSTATUS ioctl().

To move towards fixing these problems, create an function in
arch/arm/mach-omap1 to return the reset source data.  A subsequent
patch will provide this function to the watchdog driver via
platform_data.

In the long term, the best approach would be to move this function
to a new OMAP1 driver that handles access to the OMAP1 Clock
Generation and Reset Management IP block.  Then no platform_data would
be needed.

Signed-off-by: Paul Walmsley p...@pwsan.com
---
 arch/arm/mach-omap1/common.h |2 ++
 arch/arm/mach-omap1/reset.c  |   39 +++
 2 files changed, 41 insertions(+)

diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
index c2552b2..e83fd70 100644
--- a/arch/arm/mach-omap1/common.h
+++ b/arch/arm/mach-omap1/common.h
@@ -90,4 +90,6 @@ extern int ocpi_enable(void);
 static inline int ocpi_enable(void) { return 0; }
 #endif
 
+extern u32 omap1_read_reset_sources(void);
+
 #endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
diff --git a/arch/arm/mach-omap1/reset.c b/arch/arm/mach-omap1/reset.c
index b177091..3e894fb 100644
--- a/arch/arm/mach-omap1/reset.c
+++ b/arch/arm/mach-omap1/reset.c
@@ -8,8 +8,22 @@
 
 #include mach/hardware.h
 
+#include iomap.h
 #include common.h
 
+/* ARM_SYSST bit shifts related to SoC reset sources */
+#define ARM_SYSST_POR_SHIFT5
+#define ARM_SYSST_EXT_RST_SHIFT4
+#define ARM_SYSST_ARM_WDRST_SHIFT  2
+#define ARM_SYSST_GLOB_SWRST_SHIFT 1
+
+/* Standardized reset source bits (across all OMAP SoCs) */
+#define OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT  0
+#define OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT  1
+#define OMAP_MPU_WD_RST_SRC_ID_SHIFT   3
+#define OMAP_EXTWARM_RST_SRC_ID_SHIFT  5
+
+
 void omap1_restart(char mode, const char *cmd)
 {
/*
@@ -23,3 +37,28 @@ void omap1_restart(char mode, const char *cmd)
 
omap_writew(1, ARM_RSTCT1);
 }
+
+/**
+ * omap1_read_reset_sources - return the source of the SoC's last reset
+ *
+ * Returns bits that represent the last reset source for the SoC.  The
+ * format is standardized across OMAPs for use by the OMAP watchdog.
+ */
+u32 omap1_read_reset_sources(void)
+{
+   int ret = 0;
+   u16 rs;
+
+   rs = __raw_readw(OMAP1_IO_ADDRESS(ARM_SYSST));
+
+   if (rs  (1  ARM_SYSST_POR_SHIFT))
+   ret |= 1  OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT;
+   if (rs  (1  ARM_SYSST_EXT_RST_SHIFT))
+   ret |= 1  OMAP_EXTWARM_RST_SRC_ID_SHIFT;
+   if (rs  (1  ARM_SYSST_ARM_WDRST_SHIFT))
+   ret |= 1  OMAP_MPU_WD_RST_SRC_ID_SHIFT;
+   if (rs  (1  ARM_SYSST_GLOB_SWRST_SHIFT))
+   ret |= 1  OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT;
+
+   return ret;
+}


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


[PATCH 1/7] ARM: OMAP2+: PRM: prepare for use of prm_ll_data function pointers

2012-10-15 Thread Paul Walmsley
There are several PRM operations which behave similarly across OMAP2+
SoCs, but which have slight differences in their underlying
implementations.  For example, to fetch the SoC's last reset sources,
different registers are read across OMAP2xxx, 3xxx, and 44xx, and
different bits are used on each SoC.  But the information returned is
so similar that a single, common interface for drivers is useful.

This patch creates the support code for this function pointer
registration process.  No function pointers are included yet, but a
subsequent patch will create one for the reset source API.

To illustrate the end goal with the above reset source example, each
per-SoC driver will use its own low-level implementation function --
e.g., prm2xxx.c would contain omap2xxx_prm_read_reset_sources().  This
function would read the appropriate register and remap the register
bits to a standard set of reset source bits.  When the prm2xxx.c
driver is loaded, it would register this function with the common PRM
driver, prm.c.  prm.c would then export a common function,
omap_prm_read_reset_sources().  Calling it would call through to the
function pointer for the currently-registered SoC PRM driver.  This
will allow other drivers to use PRM-provided data and operations
without needing to know which SoC is currently in use.

Signed-off-by: Paul Walmsley p...@pwsan.com
---
 arch/arm/mach-omap2/prm.h|   11 
 arch/arm/mach-omap2/prm_common.c |   52 ++
 2 files changed, 63 insertions(+)

diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index 39d5621..3e51c1d 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -52,5 +52,16 @@
 #define OMAP_POWERSTATE_SHIFT  0
 #define OMAP_POWERSTATE_MASK   (0x3  0)
 
+#ifndef __ASSEMBLER__
+
+/**
+ * struct prm_ll_data - fn ptrs to per-SoC PRM function implementations
+ */
+struct prm_ll_data {};
+
+extern int prm_register(struct prm_ll_data *pld);
+extern int prm_unregister(struct prm_ll_data *pld);
+
+#endif
 
 #endif
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 0a100d9..8670a3c 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -53,6 +53,13 @@ static struct irq_chip_generic **prcm_irq_chips;
  */
 static struct omap_prcm_irq_setup *prcm_irq_setup;
 
+/*
+ * prm_ll_data: function pointers to SoC-specific implementations of
+ * common PRM functions
+ */
+static struct prm_ll_data null_prm_ll_data;
+static struct prm_ll_data *prm_ll_data = null_prm_ll_data;
+
 /* Private functions */
 
 /*
@@ -318,3 +325,48 @@ err:
omap_prcm_irq_cleanup();
return -ENOMEM;
 }
+
+/**
+ * prm_register - register per-SoC low-level data with the PRM
+ * @pld: low-level per-SoC OMAP PRM data  function pointers to register
+ *
+ * Register per-SoC low-level OMAP PRM data and function pointers with
+ * the OMAP PRM common interface.  The caller must keep the data
+ * pointed to by @pld valid until it calls prm_unregister() and
+ * it returns successfully.  Returns 0 upon success, -EINVAL if @pld
+ * is NULL, or -EEXIST if prm_register() has already been called
+ * without an intervening prm_unregister().
+ */
+int prm_register(struct prm_ll_data *pld)
+{
+   if (!pld)
+   return -EINVAL;
+
+   if (prm_ll_data != null_prm_ll_data)
+   return -EEXIST;
+
+   prm_ll_data = pld;
+
+   return 0;
+}
+
+/**
+ * prm_unregister - unregister per-SoC low-level data  function pointers
+ * @pld: low-level per-SoC OMAP PRM data  function pointers to unregister
+ *
+ * Unregister per-SoC low-level OMAP PRM data and function pointers
+ * that were previously registered with prm_register().  The
+ * caller may not destroy any of the data pointed to by @pld until
+ * this function returns successfully.  Returns 0 upon success, or
+ * -EINVAL if @pld is NULL or if @pld does not match the struct
+ * prm_ll_data * previously registered by prm_register().
+ */
+int prm_unregister(struct prm_ll_data *pld)
+{
+   if (!pld || prm_ll_data != pld)
+   return -EINVAL;
+
+   prm_ll_data = null_prm_ll_data;
+
+   return 0;
+}


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


[PATCH 2/7] ARM: OMAP2+: CM: prepare for use of cm_ll_data function pointers

2012-10-15 Thread Paul Walmsley
There are several CM operations which behave similarly across OMAP2+
SoCs, but which have slight differences in their underlying
implementations.

This patch creates the support code for this function pointer
registration process.  No function pointers are included yet, but a
subsequent patch will create these for the module IDLEST registers.

This patch allows other code to use CM-provided data and operations
without needing to know which SoC is currently in use.  A further
description of the concept is provided in the patch entitled
ARM: OMAP2+: PRM: prepare for use of prm_ll_data function pointers.

Signed-off-by: Paul Walmsley p...@pwsan.com
---
 arch/arm/mach-omap2/Makefile|2 +
 arch/arm/mach-omap2/cm.h|   12 +++
 arch/arm/mach-omap2/cm_common.c |   71 +++
 3 files changed, 84 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-omap2/cm_common.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 3751d56..f7cf382 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -93,7 +93,7 @@ obj-$(CONFIG_ARCH_OMAP4)+= cpuidle44xx.o
 endif
 
 # PRCM
-obj-y  += prcm.o prm_common.o
+obj-y  += prcm.o prm_common.o cm_common.o
 obj-$(CONFIG_ARCH_OMAP2)   += prm2xxx_3xxx.o prm2xxx.o cm2xxx.o
 obj-$(CONFIG_ARCH_OMAP3)   += prm2xxx_3xxx.o prm3xxx.o cm3xxx.o
 obj-$(CONFIG_ARCH_OMAP3)   += vc3xxx_data.o vp3xxx_data.o
diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h
index f24e3f7..b3cee91 100644
--- a/arch/arm/mach-omap2/cm.h
+++ b/arch/arm/mach-omap2/cm.h
@@ -33,4 +33,16 @@
  */
 #define MAX_MODULE_DISABLE_TIME5000
 
+# ifndef __ASSEMBLER__
+
+/**
+ * struct cm_ll_data - fn ptrs to per-SoC CM function implementations
+ */
+struct cm_ll_data {};
+
+extern int cm_register(struct cm_ll_data *cld);
+extern int cm_unregister(struct cm_ll_data *cld);
+
+# endif
+
 #endif
diff --git a/arch/arm/mach-omap2/cm_common.c b/arch/arm/mach-omap2/cm_common.c
new file mode 100644
index 000..3246cef
--- /dev/null
+++ b/arch/arm/mach-omap2/cm_common.c
@@ -0,0 +1,71 @@
+/*
+ * OMAP2+ common Clock Management (CM) IP block functions
+ *
+ * Copyright (C) 2012 Texas Instruments, Inc.
+ * Paul Walmsley p...@pwsan.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.
+ *
+ * XXX This code should eventually be moved to a CM driver.
+ */
+
+#include linux/kernel.h
+#include linux/init.h
+
+#include cm2xxx.h
+#include cm3xxx.h
+#include cm44xx.h
+
+/*
+ * cm_ll_data: function pointers to SoC-specific implementations of
+ * common CM functions
+ */
+static struct cm_ll_data null_cm_ll_data;
+static struct cm_ll_data *cm_ll_data = null_cm_ll_data;
+
+/**
+ * cm_register - register per-SoC low-level data with the CM
+ * @cld: low-level per-SoC OMAP CM data  function pointers to register
+ *
+ * Register per-SoC low-level OMAP CM data and function pointers with
+ * the OMAP CM common interface.  The caller must keep the data
+ * pointed to by @cld valid until it calls cm_unregister() and
+ * it returns successfully.  Returns 0 upon success, -EINVAL if @cld
+ * is NULL, or -EEXIST if cm_register() has already been called
+ * without an intervening cm_unregister().
+ */
+int cm_register(struct cm_ll_data *cld)
+{
+   if (!cld)
+   return -EINVAL;
+
+   if (cm_ll_data != null_cm_ll_data)
+   return -EEXIST;
+
+   cm_ll_data = cld;
+
+   return 0;
+}
+
+/**
+ * cm_unregister - unregister per-SoC low-level data  function pointers
+ * @cld: low-level per-SoC OMAP CM data  function pointers to unregister
+ *
+ * Unregister per-SoC low-level OMAP CM data and function pointers
+ * that were previously registered with cm_register().  The
+ * caller may not destroy any of the data pointed to by @cld until
+ * this function returns successfully.  Returns 0 upon success, or
+ * -EINVAL if @cld is NULL or if @cld does not match the struct
+ * cm_ll_data * previously registered by cm_register().
+ */
+int cm_unregister(struct cm_ll_data *cld)
+{
+   if (!cld || cm_ll_data != cld)
+   return -EINVAL;
+
+   cm_ll_data = null_cm_ll_data;
+
+   return 0;
+}


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


[PATCH 7/7] ARM: OMAP2+: PRCM: remove omap_prcm_get_reset_sources()

2012-10-15 Thread Paul Walmsley
omap_prcm_get_reset_sources() is now unused; so, remove it.

Signed-off-by: Paul Walmsley p...@pwsan.com
---
 arch/arm/mach-omap2/prcm.c |   12 
 arch/arm/plat-omap/include/plat/prcm.h |1 -
 2 files changed, 13 deletions(-)

diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index 0f51e03..0a2c33b 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -46,18 +46,6 @@ void __iomem *prcm_mpu_base;
 
 #define MAX_MODULE_ENABLE_WAIT 10
 
-u32 omap_prcm_get_reset_sources(void)
-{
-   /* XXX This presumably needs modification for 34XX */
-   if (cpu_is_omap24xx() || cpu_is_omap34xx())
-   return omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST)  0x7f;
-   if (cpu_is_omap44xx())
-   return omap2_prm_read_mod_reg(WKUP_MOD, OMAP4_RM_RSTST)  0x7f;
-
-   return 0;
-}
-EXPORT_SYMBOL(omap_prcm_get_reset_sources);
-
 /* Resets clock rates and reboots the system. Only called from system.h */
 void omap_prcm_restart(char mode, const char *cmd)
 {
diff --git a/arch/arm/plat-omap/include/plat/prcm.h 
b/arch/arm/plat-omap/include/plat/prcm.h
index 267f43b..a76cbd4 100644
--- a/arch/arm/plat-omap/include/plat/prcm.h
+++ b/arch/arm/plat-omap/include/plat/prcm.h
@@ -27,7 +27,6 @@
 #ifndef __ASM_ARM_ARCH_OMAP_PRCM_H
 #define __ASM_ARM_ARCH_OMAP_PRCM_H
 
-u32 omap_prcm_get_reset_sources(void);
 int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
 const char *name);
 


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


[PATCH 6/7] watchdog: OMAP: use standard GETBOOTSTATUS interface; use platform_data fn ptr

2012-10-15 Thread Paul Walmsley
Previously the OMAP watchdog driver used a non-standard way to report
the chip reset source via the GETBOOTSTATUS ioctl.  This patch
converts the driver to use the standard WDIOF_* flags for this
purpose.

This patch may break existing userspace code that uses the existing
non-standard data format returned by the OMAP watchdog driver's
GETBOOTSTATUS ioctl.  To fetch detailed reset source information,
userspace code will need to retrieve it directly from the CGRM or PRM
drivers when those are completed.

Previously, to fetch the reset source, the driver either read a
register outside the watchdog IP block (OMAP1), or called a function
exported directly from arch/arm/mach-omap2.  Both approaches are
broken.  This patch also converts the driver to use a platform_data
function pointer.  This approach is temporary, and is due to the lack
of drivers for the OMAP16xx+ Clock Generation and Reset Management IP
block and the OMAP2+ Power and Reset Management IP block.  Once
drivers are available for those IP blocks, the watchdog driver can be
converted to call exported drivers from those functions directly.
At that point, the platform_data function pointer can be removed.

In the short term, this patch is needed to allow the PRM code to be
removed from arch/arm/mach-omap2 (it is being moved to a driver).

Signed-off-by: Paul Walmsley p...@pwsan.com
Cc: Wim Van Sebroeck w...@iguana.be
---
 drivers/watchdog/omap_wdt.c |   26 --
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index f5db18db..5d33bc0 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -46,8 +46,8 @@
 #include linux/slab.h
 #include linux/pm_runtime.h
 #include mach/hardware.h
-#include plat/cpu.h
-#include plat/prcm.h
+
+#include linux/platform_data/omap-wd-timer.h
 
 #include omap_wdt.h
 
@@ -202,8 +202,10 @@ static ssize_t omap_wdt_write(struct file *file, const 
char __user *data,
 static long omap_wdt_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
 {
+   struct omap_wd_timer_platform_data *pdata;
struct omap_wdt_dev *wdev;
-   int new_margin;
+   u32 rs;
+   int new_margin, bs;
static const struct watchdog_info ident = {
.identity = OMAP Watchdog,
.options = WDIOF_SETTIMEOUT,
@@ -211,6 +213,7 @@ static long omap_wdt_ioctl(struct file *file, unsigned int 
cmd,
};
 
wdev = file-private_data;
+   pdata = wdev-dev-platform_data;
 
switch (cmd) {
case WDIOC_GETSUPPORT:
@@ -219,17 +222,12 @@ static long omap_wdt_ioctl(struct file *file, unsigned 
int cmd,
case WDIOC_GETSTATUS:
return put_user(0, (int __user *)arg);
case WDIOC_GETBOOTSTATUS:
-#ifdef CONFIG_ARCH_OMAP1
-   if (cpu_is_omap16xx())
-   return put_user(__raw_readw(ARM_SYSST),
-   (int __user *)arg);
-#endif
-#ifdef CONFIG_ARCH_OMAP2PLUS
-   if (cpu_is_omap24xx())
-   return put_user(omap_prcm_get_reset_sources(),
-   (int __user *)arg);
-#endif
-   return put_user(0, (int __user *)arg);
+   if (!pdata-read_reset_sources)
+   return put_user(0, (int __user *)arg);
+   rs = pdata-read_reset_sources();
+   bs = (rs  (1  OMAP_MPU_WD_RST_SRC_ID_SHIFT)) ?
+   WDIOF_CARDRESET : 0;
+   return put_user(bs, (int __user *)arg);
case WDIOC_KEEPALIVE:
spin_lock(wdt_lock);
omap_wdt_ping(wdev);


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


[PATCH 5/7] ARM: OMAP2+: WDT: move init; add read_reset_sources pdata function pointer

2012-10-15 Thread Paul Walmsley
The OMAP watchdog timer driver directly calls a function exported by
code in arch/arm/mach-omap2.  This is not good; it tightly couples
this driver to the mach-omap2 integration code.  Instead, add a
temporary platform_data function pointer to abstract this function
call.  A subsequent patch will convert the watchdog driver to use this
function pointer.

This patch also moves the device creation code out of
arch/arm/mach-omap2/devices.c and into arch/arm/mach-omap2/wd_timer.c.
This is another step towards the removal of
arch/arm/mach-omap2/devices.c.

Signed-off-by: Paul Walmsley p...@pwsan.com
Cc: Wim Van Sebroeck w...@iguana.be
---
 arch/arm/mach-omap1/devices.c   |   21 +--
 arch/arm/mach-omap2/devices.c   |   26 --
 arch/arm/mach-omap2/wd_timer.c  |   33 +++
 include/linux/platform_data/omap-wd-timer.h |   38 +++
 4 files changed, 89 insertions(+), 29 deletions(-)
 create mode 100644 include/linux/platform_data/omap-wd-timer.h

diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index d3fec92..c3408e7 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -17,6 +17,8 @@
 #include linux/platform_device.h
 #include linux/spi/spi.h
 
+#include linux/platform_data/omap-wd-timer.h
+
 #include asm/mach/map.h
 
 #include plat/tc.h
@@ -439,18 +441,31 @@ static struct resource wdt_resources[] = {
 };
 
 static struct platform_device omap_wdt_device = {
-   .name  = omap_wdt,
-   .id  = -1,
+   .name   = omap_wdt,
+   .id = -1,
.num_resources  = ARRAY_SIZE(wdt_resources),
.resource   = wdt_resources,
 };
 
 static int __init omap_init_wdt(void)
 {
+   struct omap_wd_timer_platform_data pdata;
+   int ret;
+
if (!cpu_is_omap16xx())
return -ENODEV;
 
-   return platform_device_register(omap_wdt_device);
+   pdata.read_reset_sources = omap1_read_reset_sources;
+
+   ret = platform_device_register(omap_wdt_device);
+   if (!ret) {
+   ret = platform_device_add_data(omap_wdt_device, pdata,
+  sizeof(pdata));
+   if (ret)
+   platform_device_del(omap_wdt_device);
+   }
+
+   return ret;
 }
 subsys_initcall(omap_init_wdt);
 #endif
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index c8c2117..2ab2c99 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -644,29 +644,3 @@ static int __init omap2_init_devices(void)
return 0;
 }
 arch_initcall(omap2_init_devices);
-
-#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
-static int __init omap_init_wdt(void)
-{
-   int id = -1;
-   struct platform_device *pdev;
-   struct omap_hwmod *oh;
-   char *oh_name = wd_timer2;
-   char *dev_name = omap_wdt;
-
-   if (!cpu_class_is_omap2() || of_have_populated_dt())
-   return 0;
-
-   oh = omap_hwmod_lookup(oh_name);
-   if (!oh) {
-   pr_err(Could not look up wd_timer%d hwmod\n, id);
-   return -EINVAL;
-   }
-
-   pdev = omap_device_build(dev_name, id, oh, NULL, 0, NULL, 0, 0);
-   WARN(IS_ERR(pdev), Can't build omap_device for %s:%s.\n,
-   dev_name, oh-name);
-   return 0;
-}
-subsys_initcall(omap_init_wdt);
-#endif
diff --git a/arch/arm/mach-omap2/wd_timer.c b/arch/arm/mach-omap2/wd_timer.c
index b2f1c67..00ef54c 100644
--- a/arch/arm/mach-omap2/wd_timer.c
+++ b/arch/arm/mach-omap2/wd_timer.c
@@ -11,10 +11,14 @@
 #include linux/io.h
 #include linux/err.h
 
+#include linux/platform_data/omap-wd-timer.h
+
 #include plat/omap_hwmod.h
+#include plat/omap_device.h
 
 #include wd_timer.h
 #include common.h
+#include prm.h
 
 /*
  * In order to avoid any assumptions from bootloader regarding WDT
@@ -99,3 +103,32 @@ int omap2_wd_timer_reset(struct omap_hwmod *oh)
return (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT :
omap2_wd_timer_disable(oh);
 }
+
+static int __init omap_init_wdt(void)
+{
+   int id = -1;
+   struct platform_device *pdev;
+   struct omap_hwmod *oh;
+   char *oh_name = wd_timer2;
+   char *dev_name = omap_wdt;
+   struct omap_wd_timer_platform_data pdata;
+
+   if (!cpu_class_is_omap2())
+   return 0;
+
+   oh = omap_hwmod_lookup(oh_name);
+   if (!oh) {
+   pr_err(Could not look up wd_timer%d hwmod\n, id);
+   return -EINVAL;
+   }
+
+   pdata.read_reset_sources = prm_read_reset_sources;
+
+   pdev = omap_device_build(dev_name, id, oh, pdata,
+sizeof(struct omap_wd_timer_platform_data),
+NULL, 0, 0);
+   WARN(IS_ERR(pdev), Can't build omap_device for %s:%s.\n,
+dev_name, 

[PATCH 4/7] ARM: OMAP2+: PRM: create PRM reset source API for the watchdog timer driver

2012-10-15 Thread Paul Walmsley
The OMAP watchdog timer driver needs to determine what caused the SoC
to reset for its GETBOOTSTATUS ioctl.  So, define a set of standard
reset sources across OMAP SoCs.  For OMAP2xxx, 3xxx, and 4xxx SoCs,
define mappings from the SoC-specific reset source register bits to
the standardized reset source IDs.  Create SoC-specific PRM functions
that read the appropriate per-SoC register and use the mapping to
return the standardized reset bits.  Register the SoC-specific PRM
functions with the common PRM code via prm_register().  Create a
function in the common PRM code, prm_read_reset_sources(), that
calls the SoC-specific function, registered during boot.

This patch does not yet handle some SoCs, such as AM33xx.  Those SoCs
were not handled by the code this will replace.

Signed-off-by: Paul Walmsley p...@pwsan.com
---
 arch/arm/mach-omap2/prm-regbits-24xx.h |4 ++
 arch/arm/mach-omap2/prm-regbits-34xx.h |   10 
 arch/arm/mach-omap2/prm.h  |   44 +
 arch/arm/mach-omap2/prm2xxx.c  |   68 ++
 arch/arm/mach-omap2/prm2xxx.h  |4 ++
 arch/arm/mach-omap2/prm2xxx_3xxx.h |2 +
 arch/arm/mach-omap2/prm3xxx.c  |   65 +
 arch/arm/mach-omap2/prm3xxx.h  |2 +
 arch/arm/mach-omap2/prm44xx.c  |   83 +++-
 arch/arm/mach-omap2/prm44xx.h  |2 +
 arch/arm/mach-omap2/prm_common.c   |   26 ++
 11 files changed, 306 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/prm-regbits-24xx.h 
b/arch/arm/mach-omap2/prm-regbits-24xx.h
index bd70a5a..638da6d 100644
--- a/arch/arm/mach-omap2/prm-regbits-24xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-24xx.h
@@ -209,9 +209,13 @@
 
 /* RM_RSTST_WKUP specific bits */
 /* 2430 calls EXTWMPU_RST EXTWARM_RST and GLOBALWMPU_RST GLOBALWARM_RST */
+#define OMAP24XX_EXTWMPU_RST_SHIFT 6
 #define OMAP24XX_EXTWMPU_RST_MASK  (1  6)
+#define OMAP24XX_SECU_WD_RST_SHIFT 5
 #define OMAP24XX_SECU_WD_RST_MASK  (1  5)
+#define OMAP24XX_MPU_WD_RST_SHIFT  4
 #define OMAP24XX_MPU_WD_RST_MASK   (1  4)
+#define OMAP24XX_SECU_VIOL_RST_SHIFT   3
 #define OMAP24XX_SECU_VIOL_RST_MASK(1  3)
 
 /* PM_WKEN_WKUP specific bits */
diff --git a/arch/arm/mach-omap2/prm-regbits-34xx.h 
b/arch/arm/mach-omap2/prm-regbits-34xx.h
index 073d4db..838b594 100644
--- a/arch/arm/mach-omap2/prm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-34xx.h
@@ -509,15 +509,25 @@
 #define OMAP3430_RSTTIME1_MASK (0xff  0)
 
 /* PRM_RSTST */
+#define OMAP3430_ICECRUSHER_RST_SHIFT  10
 #define OMAP3430_ICECRUSHER_RST_MASK   (1  10)
+#define OMAP3430_ICEPICK_RST_SHIFT 9
 #define OMAP3430_ICEPICK_RST_MASK  (1  9)
+#define OMAP3430_VDD2_VOLTAGE_MANAGER_RST_SHIFT8
 #define OMAP3430_VDD2_VOLTAGE_MANAGER_RST_MASK (1  8)
+#define OMAP3430_VDD1_VOLTAGE_MANAGER_RST_SHIFT7
 #define OMAP3430_VDD1_VOLTAGE_MANAGER_RST_MASK (1  7)
+#define OMAP3430_EXTERNAL_WARM_RST_SHIFT   6
 #define OMAP3430_EXTERNAL_WARM_RST_MASK(1  6)
+#define OMAP3430_SECURE_WD_RST_SHIFT   5
 #define OMAP3430_SECURE_WD_RST_MASK(1  5)
+#define OMAP3430_MPU_WD_RST_SHIFT  4
 #define OMAP3430_MPU_WD_RST_MASK   (1  4)
+#define OMAP3430_SECURITY_VIOL_RST_SHIFT   3
 #define OMAP3430_SECURITY_VIOL_RST_MASK(1  3)
+#define OMAP3430_GLOBAL_SW_RST_SHIFT   1
 #define OMAP3430_GLOBAL_SW_RST_MASK(1  1)
+#define OMAP3430_GLOBAL_COLD_RST_SHIFT 0
 #define OMAP3430_GLOBAL_COLD_RST_MASK  (1  0)
 
 /* PRM_VOLTCTRL */
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index 3e51c1d..c30ab5d 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -52,16 +52,58 @@
 #define OMAP_POWERSTATE_SHIFT  0
 #define OMAP_POWERSTATE_MASK   (0x3  0)
 
+/*
+ * Standardized OMAP reset source bits
+ *
+ * To the extent these happen to match the hardware register bit
+ * shifts, it's purely coincidental.  Used by omap-wdt.c.
+ * OMAP_UNKNOWN_RST_SRC_ID_SHIFT is a special value, used whenever
+ * there are any bits remaining in the global PRM_RSTST register that
+ * haven't been identified, or when the PRM code for the current SoC
+ * doesn't know how to interpret the register.
+ */
+#define OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT  0
+#define OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT  1
+#define OMAP_SECU_VIOL_RST_SRC_ID_SHIFT2
+#define OMAP_MPU_WD_RST_SRC_ID_SHIFT  

Re: [PATCH V6 2/2] dmaengine: add helper function to request a slave DMA channel

2012-10-15 Thread Shawn Guo
On Tue, Sep 25, 2012 at 10:05:01AM +0530, Vinod Koul wrote:
 On Mon, 2012-09-24 at 17:25 -0500, Jon Hunter wrote:
   For DT bindings, I think the binding itself shouldn't change based on my
   work but I would like these same bindings to help build the DMA engine
   code mappings.
   
   Now would it make sense to NOT merge these changes for 3.7 and postpone
   to 3.8. I can host these patches on a topic branch and merge them when
   we are ready. I plan to spend some good amount of time on my work this
   week so we should be ready pretty soon.
   One these changes are merged, users can start moving to this scheme.
  
  I just wanted to see how things are progressing your side. Did you
  create a topic branch for this? If so let me know where I can find it, I
  did not find a branch on your infradead git tree.
  
  I wanted to pull in the latest patches for some testing. 
 Sorry for delay, I had everything ready, but couldn't manage to commit
 and push. I have pushed to topic/dmaengine_dt, it is pushing out now...
 
Vinod,

Looks it seemed 3.7-rc1.  Does that mean we have to wait for 3.8, or
will it show on later -rc for 3.7?

Shawn
--
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 V6 2/2] dmaengine: add helper function to request a slave DMA channel

2012-10-15 Thread Vinod Koul
On Tue, 2012-10-16 at 10:43 +0800, Shawn Guo wrote:
 On Tue, Sep 25, 2012 at 10:05:01AM +0530, Vinod Koul wrote:
  On Mon, 2012-09-24 at 17:25 -0500, Jon Hunter wrote:
For DT bindings, I think the binding itself shouldn't change based on my
work but I would like these same bindings to help build the DMA engine
code mappings.

Now would it make sense to NOT merge these changes for 3.7 and postpone
to 3.8. I can host these patches on a topic branch and merge them when
we are ready. I plan to spend some good amount of time on my work this
week so we should be ready pretty soon.
One these changes are merged, users can start moving to this scheme.
   
   I just wanted to see how things are progressing your side. Did you
   create a topic branch for this? If so let me know where I can find it, I
   did not find a branch on your infradead git tree.
   
   I wanted to pull in the latest patches for some testing. 
  Sorry for delay, I had everything ready, but couldn't manage to commit
  and push. I have pushed to topic/dmaengine_dt, it is pushing out now...
  
 Vinod,
 
 Looks it seemed 3.7-rc1.  Does that mean we have to wait for 3.8, or
 will it show on later -rc for 3.7?
Yes this will be merged once we work out the common interface, otherwise
we will end up redoing interfaces for all drivers.

-- 
~Vinod

--
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: [PATCHv6 01/11] ARM: OMAP: clockdomain: Fix locking on _clkdm_clk_hwmod_enable / disable

2012-10-15 Thread Paul Walmsley
On Tue, 25 Sep 2012, Tero Kristo wrote:

 Previously the code only acquired spinlock after increasing / decreasing
 the usecount value, which is wrong. This leaves a small window where
 a task switch may occur between the check of the usecount and the actual
 wakeup / sleep of the domain. Fixed by moving the spinlock locking before
 the usecount access. Left the usecount as atomic_t if someone wants an
 easy access to the parameter through atomic_read.
 
 Signed-off-by: Tero Kristo t-kri...@ti.com

Thanks, queued for 3.7-rc fixes.


- 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