[PATCH RFC] ARM: dts: am335x: update USB DT references

2014-04-16 Thread Leigh Brown
In ARM: dts: am33xx: correcting dt node unit address for usb, the
usb_ctrl_mod and cppi41dma nodes were updated with the correct register
addresses.  However, the dts files that reference these nodes were not
updated, and those devices are no longer being enabled.

This patch corrects the references for the affected dts files.

Signed-off-by: Leigh Brown le...@solinno.co.uk
---
 arch/arm/boot/dts/am335x-bone-common.dtsi | 4 ++--
 arch/arm/boot/dts/am335x-evm.dts  | 4 ++--
 arch/arm/boot/dts/am335x-evmsk.dts| 4 ++--
 arch/arm/boot/dts/am335x-igep0033.dtsi| 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi 
b/arch/arm/boot/dts/am335x-bone-common.dtsi
index e3f27ec..2e7d932 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -183,7 +183,7 @@
 usb {
status = okay;
 
-   control@44e1 {
+   control@44e10620 {
status = okay;
};
 
@@ -204,7 +204,7 @@
dr_mode = host;
};
 
-   dma-controller@07402000  {
+   dma-controller@47402000  {
status = okay;
};
 };
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 28ae040..77df10d 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -331,7 +331,7 @@
 usb {
status = okay;
 
-   control@44e1 {
+   control@44e10620 {
status = okay;
};
 
@@ -352,7 +352,7 @@
dr_mode = host;
};
 
-   dma-controller@07402000  {
+   dma-controller@47402000  {
status = okay;
};
 };
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index ec08f6f..ab23885 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -364,7 +364,7 @@
 usb {
status = okay;
 
-   control@44e1 {
+   control@44e10620 {
status = okay;
};
 
@@ -385,7 +385,7 @@
dr_mode = host;
};
 
-   dma-controller@07402000  {
+   dma-controller@47402000  {
status = okay;
};
 };
diff --git a/arch/arm/boot/dts/am335x-igep0033.dtsi 
b/arch/arm/boot/dts/am335x-igep0033.dtsi
index 7063311..5942e7d 100644
--- a/arch/arm/boot/dts/am335x-igep0033.dtsi
+++ b/arch/arm/boot/dts/am335x-igep0033.dtsi
@@ -202,7 +202,7 @@
 usb {
status = okay;
 
-   control@44e1 {
+   control@44e10620 {
status = okay;
};
 
@@ -223,7 +223,7 @@
dr_mode = host;
};
 
-   dma-controller@07402000  {
+   dma-controller@47402000  {
status = okay;
};
 };
-- 
1.9.1

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


[PATCH 2/5] w1: omap_hdq: Add compatible property for omap hdq driver.

2014-04-16 Thread Sourav Poddar
Add compatible property for omap hdq driver.

Signed-off-by: Sourav Poddar sourav.pod...@ti.com
---
 .../devicetree/bindings/hdq1w/omap_hdq.txt |   20 
 drivers/w1/masters/omap_hdq.c  |8 
 2 files changed, 28 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hdq1w/omap_hdq.txt

diff --git a/Documentation/devicetree/bindings/hdq1w/omap_hdq.txt 
b/Documentation/devicetree/bindings/hdq1w/omap_hdq.txt
new file mode 100644
index 000..a7e011e
--- /dev/null
+++ b/Documentation/devicetree/bindings/hdq1w/omap_hdq.txt
@@ -0,0 +1,20 @@
+HDQ/1w for OMAP platforms
+
+Required properties :
+- compatible : Must be ti,am43xx-hdq.
+- ti,hwmods : Must be hdq1w.
+- reg: Should contain register location and length.
+- interrupts: Should contain interrupt.
+- clock: Clock input to HDQ1w controller.
+
+Example:
+
+   hdq: hdq@48347000 {
+   compatible = ti,am43xx-hdq;
+   reg = 0x48347000 0x1000;
+   interrupts = GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH;
+   clocks = func_12m_clk;
+   clock-names = fck;
+   ti,hwmods = hdq1w;
+   status = disabled;
+   };
diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 0a7bf7f..ec36bee 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -17,6 +17,7 @@
 #include linux/io.h
 #include linux/sched.h
 #include linux/pm_runtime.h
+#include linux/of.h
 
 #include ../w1.h
 #include ../w1_int.h
@@ -73,11 +74,18 @@ struct hdq_data {
 static int omap_hdq_probe(struct platform_device *pdev);
 static int omap_hdq_remove(struct platform_device *pdev);
 
+static const struct of_device_id omap_hdq_dt_match[] = {
+   { .compatible = ti,am43xx-hdq},
+   {},
+};
+MODULE_DEVICE_TABLE(of, omap_hdq_dt_match);
+
 static struct platform_driver omap_hdq_driver = {
.probe =omap_hdq_probe,
.remove =   omap_hdq_remove,
.driver =   {
.name = omap_hdq,
+   .of_match_table = of_match_ptr(omap_hdq_dt_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 0/5] AM437x: HDQ/1wire protocol

2014-04-16 Thread Sourav Poddar
This series adds support for HDQ/1w protocol driver for
am43x epos evm where it can be used for measuring the
temperature of a slave device connected to a particular header.

Tested the patch series on AM437x, hdq master and slave devices are
getting registered and interrupts are getting triggered for break and tx
conditions. 

Sourav Poddar (5):
  drivers: w1: omap_hdq: cleanup and bug fixes.
  w1: omap_hdq: Add compatible property for omap hdq driver.
  arm: mach-omap2: selective device build from the platform code.
  arm: dts: am4372: Add hdq device tree data.
  arm: hwmod: am437x: Add hwmod data for hdq1w.

 .../devicetree/bindings/hdq1w/omap_hdq.txt |   20 +
 arch/arm/boot/dts/am4372.dtsi  |   10 +++
 arch/arm/boot/dts/am43x-epos-evm.dts   |   12 +++
 arch/arm/mach-omap2/hdq1w.c|2 +
 arch/arm/mach-omap2/omap_hwmod_43xx_data.c |   36 
 arch/arm/mach-omap2/prcm43xx.h |1 +
 drivers/w1/masters/omap_hdq.c  |   93 
 7 files changed, 157 insertions(+), 17 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hdq1w/omap_hdq.txt

-- 
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 3/5] arm: omap2: skip device build from platform code for dt.

2014-04-16 Thread Sourav Poddar
For SOCs with dt enabled, device should be build through device tree.
Prevent device build call from platform code, if device tree is
enabled.

Signed-off-by: Sourav Poddar sourav.pod...@ti.com
---
 arch/arm/mach-omap2/hdq1w.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-omap2/hdq1w.c b/arch/arm/mach-omap2/hdq1w.c
index cbc8e3c..f78b4a1 100644
--- a/arch/arm/mach-omap2/hdq1w.c
+++ b/arch/arm/mach-omap2/hdq1w.c
@@ -76,6 +76,7 @@ int omap_hdq1w_reset(struct omap_hwmod *oh)
return 0;
 }
 
+#ifndef CONFIG_OF
 static int __init omap_init_hdq(void)
 {
int id = -1;
@@ -95,3 +96,4 @@ static int __init omap_init_hdq(void)
return 0;
 }
 omap_arch_initcall(omap_init_hdq);
+#endif
-- 
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 1/5] drivers: w1: omap_hdq: cleanup and bug fixes.

2014-04-16 Thread Sourav Poddar
The patch adds the following to the omap hdq driver.
1. HDQ Device reset call in probe.
2. Enabling '1 wire mode' and checking for presence pulse bit.
3. Proper disabling and enabling of interrupts during read path.
4. Add re-initialization code during SKIP ROM command execution.
5. Miscellaneous cleanup(formatting, return error checks).

Signed-off-by: Sourav Poddar sourav.pod...@ti.com
---
 drivers/w1/masters/omap_hdq.c |   85 -
 1 file changed, 68 insertions(+), 17 deletions(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 9900e8e..0a7bf7f 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -27,21 +27,22 @@
 #define OMAP_HDQ_TX_DATA   0x04
 #define OMAP_HDQ_RX_DATA   0x08
 #define OMAP_HDQ_CTRL_STATUS   0x0c
-#define OMAP_HDQ_CTRL_STATUS_INTERRUPTMASK (16)
-#define OMAP_HDQ_CTRL_STATUS_CLOCKENABLE   (15)
-#define OMAP_HDQ_CTRL_STATUS_GO(14)
-#define OMAP_HDQ_CTRL_STATUS_INITIALIZATION(12)
-#define OMAP_HDQ_CTRL_STATUS_DIR   (11)
-#define OMAP_HDQ_CTRL_STATUS_MODE  (10)
+#define OMAP_HDQ_CTRL_STATUS_INTERRUPTMASK (1  6)
+#define OMAP_HDQ_CTRL_STATUS_CLOCKENABLE   (1  5)
+#define OMAP_HDQ_CTRL_STATUS_PRESENCE  (1  3)
+#define OMAP_HDQ_CTRL_STATUS_GO (1  4)
+#define OMAP_HDQ_CTRL_STATUS_INITIALIZATION(1  2)
+#define OMAP_HDQ_CTRL_STATUS_DIR   (1  1)
+#define OMAP_HDQ_CTRL_STATUS_MODE  (1  0)
 #define OMAP_HDQ_INT_STATUS0x10
-#define OMAP_HDQ_INT_STATUS_TXCOMPLETE (12)
-#define OMAP_HDQ_INT_STATUS_RXCOMPLETE (11)
-#define OMAP_HDQ_INT_STATUS_TIMEOUT(10)
+#define OMAP_HDQ_INT_STATUS_TXCOMPLETE (1  2)
+#define OMAP_HDQ_INT_STATUS_RXCOMPLETE (1  1)
+#define OMAP_HDQ_INT_STATUS_TIMEOUT(1  0)
 #define OMAP_HDQ_SYSCONFIG 0x14
-#define OMAP_HDQ_SYSCONFIG_SOFTRESET   (11)
-#define OMAP_HDQ_SYSCONFIG_AUTOIDLE(10)
+#define OMAP_HDQ_SYSCONFIG_SOFTRESET   (1  1)
+#define OMAP_HDQ_SYSCONFIG_AUTOIDLE(1  0)
 #define OMAP_HDQ_SYSSTATUS 0x18
-#define OMAP_HDQ_SYSSTATUS_RESETDONE   (10)
+#define OMAP_HDQ_SYSSTATUS_RESETDONE   (1  0)
 
 #define OMAP_HDQ_FLAG_CLEAR0
 #define OMAP_HDQ_FLAG_SET  1
@@ -115,6 +116,15 @@ static inline u8 hdq_reg_merge(struct hdq_data *hdq_data, 
u32 offset,
return new_val;
 }
 
+static void hdq_disable_interrupt(struct hdq_data *hdq_data, u32 offset,
+ u8 mask)
+{
+   u32 ie;
+
+   ie = readl(hdq_data-hdq_base + offset);
+   writel(ie  mask, hdq_data-hdq_base + offset);
+}
+
 /*
  * Wait for one or more bits in flag change.
  * HDQ_FLAG_SET: wait until any bit in the flag is set.
@@ -263,8 +273,7 @@ static int _omap_hdq_reset(struct hdq_data *hdq_data)
 * interrupt.
 */
hdq_reg_out(hdq_data, OMAP_HDQ_CTRL_STATUS,
-   OMAP_HDQ_CTRL_STATUS_CLOCKENABLE |
-   OMAP_HDQ_CTRL_STATUS_INTERRUPTMASK);
+   OMAP_HDQ_CTRL_STATUS_CLOCKENABLE);
 
/* wait for reset to complete */
ret = hdq_wait_for_flag(hdq_data, OMAP_HDQ_SYSSTATUS,
@@ -275,7 +284,8 @@ static int _omap_hdq_reset(struct hdq_data *hdq_data)
else {
hdq_reg_out(hdq_data, OMAP_HDQ_CTRL_STATUS,
OMAP_HDQ_CTRL_STATUS_CLOCKENABLE |
-   OMAP_HDQ_CTRL_STATUS_INTERRUPTMASK);
+   OMAP_HDQ_CTRL_STATUS_INTERRUPTMASK |
+   OMAP_HDQ_CTRL_STATUS_MODE);
hdq_reg_out(hdq_data, OMAP_HDQ_SYSCONFIG,
OMAP_HDQ_SYSCONFIG_AUTOIDLE);
}
@@ -327,6 +337,18 @@ static int omap_hdq_break(struct hdq_data *hdq_data)
ret = -ETIMEDOUT;
goto out;
}
+
+   /*
+* check for the presence detect bit to get
+* set to show that the slave is responding
+*/
+   if (hdq_reg_in(hdq_data, OMAP_HDQ_CTRL_STATUS) 
+   OMAP_HDQ_CTRL_STATUS_PRESENCE) {
+   dev_dbg(hdq_data-dev, Presence bit not set\n);
+   ret = -ETIMEDOUT;
+   goto out;
+   }
+
/*
 * wait for both INIT and GO bits rerurn to zero.
 * zero wait time expected for interrupt mode.
@@ -361,6 +383,8 @@ static int hdq_read_byte(struct hdq_data *hdq_data, u8 *val)
goto out;
}
 
+   hdq_data-hdq_irqstatus = 0;
+
if (!(hdq_data-hdq_irqstatus  OMAP_HDQ_INT_STATUS_RXCOMPLETE)) {
hdq_reg_merge(hdq_data, OMAP_HDQ_CTRL_STATUS,
OMAP_HDQ_CTRL_STATUS_DIR | OMAP_HDQ_CTRL_STATUS_GO,
@@ -426,7 +450,8 @@ static int omap_hdq_get(struct hdq_data *hdq_data)
  

[PATCH 5/5] arm: hwmod: am437x: Add hwmod data for hdq1w.

2014-04-16 Thread Sourav Poddar
These adds hwmod data for hdq/1w driver.

Signed-off-by: Sourav Poddar sourav.pod...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod_43xx_data.c |   36 
 arch/arm/mach-omap2/prcm43xx.h |1 +
 2 files changed, 37 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
index 5c2cc80..3a8ca96 100644
--- a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
@@ -19,6 +19,7 @@
 #include omap_hwmod.h
 #include omap_hwmod_33xx_43xx_common_data.h
 #include prcm43xx.h
+#include hdq1w.h
 
 /* IP blocks */
 static struct omap_hwmod am43xx_l4_hs_hwmod = {
@@ -415,6 +416,32 @@ static struct omap_hwmod am43xx_qspi_hwmod = {
},
 };
 
+static struct omap_hwmod_class_sysconfig am43xx_hdq1w_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0014,
+   .syss_offs  = 0x0018,
+   .sysc_flags = (SYSC_HAS_SOFTRESET),
+   .sysc_fields= omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class am43xx_hdq1w_hwmod_class = {
+   .name   = hdq1w,
+   .sysc   = am43xx_hdq1w_sysc,
+   .reset  = omap_hdq1w_reset,
+};
+
+static struct omap_hwmod am43xx_hdq1w_hwmod = {
+   .name   = hdq1w,
+   .class  = am43xx_hdq1w_hwmod_class,
+   .clkdm_name = l4ls_clkdm,
+   .prcm = {
+   .omap4 = {
+   .clkctrl_offs = AM43XX_CM_PER_HDQ1W_CLKCTRL_OFFSET,
+   .modulemode   = MODULEMODE_SWCTRL,
+   },
+   },
+};
+
 /* Interfaces */
 static struct omap_hwmod_ocp_if am43xx_l3_main__l4_hs = {
.master = am33xx_l3_main_hwmod,
@@ -654,6 +681,14 @@ static struct omap_hwmod_ocp_if am43xx_l3_s__qspi = {
.user   = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
+/* l4_per - hdq1w */
+static struct omap_hwmod_ocp_if am43xx_l4_ls__hdq1w = {
+   .master = am33xx_l4_ls_hwmod,
+   .slave  = am43xx_hdq1w_hwmod,
+   .clk= l4ls_gclk,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {
am33xx_l4_wkup__synctimer,
am43xx_l4_ls__timer8,
@@ -748,6 +783,7 @@ static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] 
__initdata = {
am43xx_l4_ls__ocp2scp1,
am43xx_l3_s__usbotgss0,
am43xx_l3_s__usbotgss1,
+   am43xx_l4_ls__hdq1w,
NULL,
 };
 
diff --git a/arch/arm/mach-omap2/prcm43xx.h b/arch/arm/mach-omap2/prcm43xx.h
index 7785be9..cabff53 100644
--- a/arch/arm/mach-omap2/prcm43xx.h
+++ b/arch/arm/mach-omap2/prcm43xx.h
@@ -142,5 +142,6 @@
 #define AM43XX_CM_PER_USBPHYOCP2SCP0_CLKCTRL_OFFSET0x05B8
 #define AM43XX_CM_PER_USB_OTG_SS1_CLKCTRL_OFFSET0x0268
 #define AM43XX_CM_PER_USBPHYOCP2SCP1_CLKCTRL_OFFSET0x05C0
+#define AM43XX_CM_PER_HDQ1W_CLKCTRL_OFFSET 0x04a0
 
 #endif
-- 
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 4/5] arm: dts: am4372: Add hdq device tree data.

2014-04-16 Thread Sourav Poddar
Add device tree nodes and pinmux for hdq/1wire on
am43x epos evm.

Signed-off-by: Sourav Poddar sourav.pod...@ti.com
---
 arch/arm/boot/dts/am4372.dtsi|   10 ++
 arch/arm/boot/dts/am43x-epos-evm.dts |   12 
 2 files changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index 36d523a..5f7c167 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -735,6 +735,16 @@
#size-cells = 1;
status = disabled;
};
+
+   hdq: hdq@48347000 {
+   compatible = ti,am43xx-hdq;
+   reg = 0x48347000 0x1000;
+   interrupts = GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH;
+   clocks = func_12m_clk;
+   clock-names = fck;
+   ti,hwmods = hdq1w;
+   status = disabled;
+   };
};
 };
 
diff --git a/arch/arm/boot/dts/am43x-epos-evm.dts 
b/arch/arm/boot/dts/am43x-epos-evm.dts
index 167dbc8..e71ef1c 100644
--- a/arch/arm/boot/dts/am43x-epos-evm.dts
+++ b/arch/arm/boot/dts/am43x-epos-evm.dts
@@ -138,6 +138,12 @@
0x160 (PIN_INPUT | MUX_MODE7) /* 
spi0_cs1.gpio0_6 */
;
};
+
+   hdq_pins: pinmux_hdq_pins {
+   pinctrl-single,pins = 
+   0x234 (PIN_INPUT_PULLUP | MUX_MODE1)/* 
cam1_wen.hdq_gpio */
+   ;
+   };
};
 
matrix_keypad: matrix_keypad@0 {
@@ -367,3 +373,9 @@
pinctrl-0 = spi1_pins;
status = okay;
 };
+
+hdq {
+   status = okay;
+   pinctrl-names = default;
+   pinctrl-0 = hdq_pins;
+};
-- 
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 v2 05/14] arm: common: edma: Select event queue 1 as default when booted with DT

2014-04-16 Thread Peter Ujfalusi
On 04/14/2014 05:32 PM, Sekhar Nori wrote:
 Yes, you can. But as soon as you have other devices using the same priority
 (with eDMA3 at least) and asks for a 'long' transfer it can ruin the audio.
 During audio playback/capture you execute a long MMC read for example can
 introduce a glitch.

 Moreover, IMHO, encoding it in DT now will make it an ABI. Without a
 wide variety of example use cases, I think it is too early to commit to
 an ABI.

 True, but we need to start from somewhere?
 
 Right, and based on our IRC discussion, we are not really fixing up the
 priority value space. That makes me much more comfortable with the idea.

The only thing we should agree on is the 0 means lowest priority. I think this
will help in case when a new kernel is fed with an older dt blob where the
property does not exist.

 
 Not sure if we should set the range for this either. What I was thinking 
 is to
 add an optional new property to be set by the client nodes, using DMA:

 mcasp0: mcasp@48038000 {
compatible = ti,am33xx-mcasp-audio;
...
dmas =  edma 8,
edma 9;
dma-names = tx, rx;
dma-priorities = 2, 2;
 };

 
 We could agree that lower number means lower priority, higher is - well -
 higher priority.
 
 Even this does not have to be uniform across, right? The numbers could
 be left to interpretation per-SoC.
 
 If the dma-priority is missing we should assume lowest priority (0).
 The highest priority depends on the platform. For eDMA3 in AM335x it is 
 three
 level. For designware controller you might have the range 0-8 as valid.

 The question is how to get this information into use?
 We can take the priority number in the core when the dma channel is 
 requested
 and add field to struct dma_chan in order to store it and the DMA drivers
 could have access to it.
 
 How about Vinod's idea of extending dma_slave_config? Priority is
 similar to rest of the runtime setup dmaengine_slave_config() is meant
 to do.

The dma_slave_config is prepared by the client drivers, so they would need to
be updated to handle the priority for the DMA. This would lead to duplicated
code - unless we have a small function in dmaengine core to fetch this
information, but still all dmaengine clients would need to call that.
IMHO it would be better to let the dmaengine core to take the priority for the
channel when it has been asked so client drivers does not need to know about it.

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


[RFC 3/4] ARM: dts: Add dss_deshdcp clock node under dra7-ctrl-core

2014-04-16 Thread Archit Taneja
The DESHDCP clock is required only by the DES-HDCP block within HDMI in DSS.
However, if the clock isn't set before DSS clock domian is enabled, the clock
domain never comes out of idle state.

The DESHDCP clock is enabled/disabled at the DSS boundary by the bit
DSS_DESHDCP_CLKEN in CTRL_CORE_CONTROL_IO_2.

Add dss_deshdcp gate-clock node under dra7-ctrl-core. There are separate bit
fields for enabling and disabling the clock. We just map the enable bit since
this clock doesn't cause any impact if left enabled.

Signed-off-by: Archit Taneja arc...@ti.com
---
 arch/arm/boot/dts/dra7xx-clocks.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/dra7xx-clocks.dtsi 
b/arch/arm/boot/dts/dra7xx-clocks.dtsi
index e96da9a..78d309c 100644
--- a/arch/arm/boot/dts/dra7xx-clocks.dtsi
+++ b/arch/arm/boot/dts/dra7xx-clocks.dtsi
@@ -2007,6 +2007,16 @@
};
 };
 
+ctrl_core_clocks {
+   dss_deshdcp_clk: dss_deshdcp_clk {
+   #clock-cells = 0;
+   compatible = ti,gate-clock;
+   clocks = l3_iclk_div;
+   ti,bit-shift = 0;
+   reg = 0x0558;
+   };
+};
+
 cm_core_clockdomains {
coreaon_clkdm: coreaon_clkdm {
compatible = ti,clockdomain;
-- 
1.8.3.2

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


[RFC 4/4] CLK: TI: Enable dss_deshdcp clock in dra7xx_clk_init

2014-04-16 Thread Archit Taneja
The DESHDCP clock is required only by the DES-HDCP block within HDMI in DSS.
However, if the clock isn't set before DSS clock domian is enabled, the clock
domain never comes out of idle state.

This is because the DSS IP is designed in such a way that if DES-HDCP block
can't transition from idle state, the entire DSS clock domain also cannot
transition from idle to enabled. DES-HDCP block needs the DESHDCP clock
enabled to transition from idle successfully.

We enable the deshdcp clock in dra7xx_clk_init() which happens before omap
hwmods are setup. This clock is effectively a gate clock with the parent as
DSS_L3_GICLK. The parent is an automatically controlled clock by DSS clock
domain and hence doesn't have a clock node associated to it. Since
DSS_L3_GICLK is derived from the OCP clock, we set the dss_deshdcp_clk's
parent as l3_iclk_div.

Leaving this bit enabled doesn't prevent DSS or the system to suspend, and only
a very few flops get this clock all the time. So there is negligible impact.

Signed-off-by: Archit Taneja arc...@ti.com
---
 drivers/clk/ti/clk-7xx.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/ti/clk-7xx.c b/drivers/clk/ti/clk-7xx.c
index f7e4073..3f73a02 100644
--- a/drivers/clk/ti/clk-7xx.c
+++ b/drivers/clk/ti/clk-7xx.c
@@ -179,6 +179,7 @@ static struct ti_dt_clk dra7xx_clks[] = {
DT_CLK(NULL, dss_hdmi_clk, dss_hdmi_clk),
DT_CLK(NULL, dss_video1_clk, dss_video1_clk),
DT_CLK(NULL, dss_video2_clk, dss_video2_clk),
+   DT_CLK(NULL, dss_deshdcp_clk, dss_deshdcp_clk),
DT_CLK(NULL, gpio1_dbclk, gpio1_dbclk),
DT_CLK(NULL, gpio2_dbclk, gpio2_dbclk),
DT_CLK(NULL, gpio3_dbclk, gpio3_dbclk),
@@ -306,7 +307,7 @@ static struct ti_dt_clk dra7xx_clks[] = {
 int __init dra7xx_dt_clk_init(void)
 {
int rc;
-   struct clk *abe_dpll_mux, *sys_clkin2, *dpll_ck;
+   struct clk *abe_dpll_mux, *sys_clkin2, *dpll_ck, *dss_deshdcp_ck;
 
ti_dt_clocks_register(dra7xx_clks);
 
@@ -327,5 +328,10 @@ int __init dra7xx_dt_clk_init(void)
if (rc)
pr_err(%s: failed to configure GMAC DPLL!\n, __func__);
 
+   dss_deshdcp_ck = clk_get_sys(NULL, dss_deshdcp_clk);
+   rc = clk_prepare_enable(dss_deshdcp_ck);
+   if (rc)
+   pr_err(%s: failed to enable DESHDCP clock\n, __func__);
+
return rc;
 }
-- 
1.8.3.2

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


[RFC 2/4] ARM: dts: Add ctrl-core DT node for DRA7

2014-04-16 Thread Archit Taneja
Add DT node for the ctrl-core sub module of the DRA7 control module. We map the
CTRL_MODULE_CORE address region up to 0x4a002d60, this region contains register
fields which configure clocks. The remainder of the registers are related to
pad configurations or cross-bar configurations, and therefore aren't mapped.

Signed-off-by: Archit Taneja arc...@ti.com
---
 arch/arm/boot/dts/dra7.dtsi | 13 +
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 1c0f8e1..58bbdf3 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -148,6 +148,19 @@
};
};
 
+   ctrl_core: ctrl_core@4a002000 {
+   compatible = ti,dra7-ctrl-core;
+   reg = 0x4a002000 0x6d0;
+
+   ctrl_core_clocks: clocks {
+   #address-cells = 1;
+   #size-cells = 0;
+   };
+
+   ctrl_core_clockdomains: clockdomains {
+   };
+   };
+
counter32k: counter@4ae04000 {
compatible = ti,omap-counter32k;
reg = 0x4ae04000 0x40;
-- 
1.8.3.2

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


[RFC 1/4] ARM: OMAP2+: Add CTRL_MODULE_CORE as a master clock provider for DRA7

2014-04-16 Thread Archit Taneja
The control module isn't actually a clock management module, but there are a few
register bits which perform gating and muxing of clocks.

Add CTRL_MODULE_CORE sub block as a clock provider for DRA7. The control module
has 2 sub modules: CTRL_MODULE_CORE, and CTRL_MODULE_WKUP. Out of these, only
the CORE sub module has clock related register fields. We ignore the WKUP sub
module.

Signed-off-by: Archit Taneja arc...@ti.com
---
 arch/arm/mach-omap2/prm_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index b4c4ab9..f86029a 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -489,6 +489,7 @@ static struct of_device_id omap_prcm_dt_match_table[] = {
{ .compatible = ti,dra7-prm },
{ .compatible = ti,dra7-cm-core-aon },
{ .compatible = ti,dra7-cm-core },
+   { .compatible = ti,dra7-ctrl-core },
{ }
 };
 
-- 
1.8.3.2

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


Re: [PATCH V2] crypto: omap-des - handle error of pm_runtime_get_sync

2014-04-16 Thread Herbert Xu
On Tue, Apr 15, 2014 at 12:51:43PM -0500, Joel Fernandes wrote:
 On 04/15/2014 12:18 PM, Nishanth Menon wrote:
  On 04/15/2014 12:06 PM, Joachim Eastwood wrote:
  On 15 April 2014 18:58, Nishanth Menon n...@ti.com wrote:
  pm_runtime_get_sync may not always succeed depending on SoC involved.
  So handle the error appropriately ensuring usage_count is accurate in
  case of failure.
 
  Signed-off-by: Nishanth Menon n...@ti.com
  ---
  V2:
  - review fixes, print function names in error log as well.
 
  V1: https://patchwork.kernel.org/patch/3993861/
   drivers/crypto/omap-des.c |   26 +++---
   1 file changed, 23 insertions(+), 3 deletions(-)
 
 
  Fixes the runtime warning from omap_l3_noc when omap-des is built-in
  on my VAR-SOM-OM44 (OMAP4460) board.
 
  Tested-by: Joachim Eastwood manab...@gmail.com
  
  Thanks Joachim. Looks like in my hurry, I missed proper
  acknowledgement of your report. adding the following for patchworks to
  pickup.
  
  Reported-by: Joachim Eastwood manab...@gmail.com
  
 
 Acked-by: Joel Fernandes jo...@ti.com

Patch applied.  Thanks!
-- 
Email: Herbert Xu herb...@gondor.apana.org.au
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
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 02/11] ARM: OMAP3: Fix idle mode signaling for sys_clkreq and sys_off_mode

2014-04-16 Thread Grazvydas Ignotas
On Wed, Apr 16, 2014 at 1:56 AM, Tony Lindgren t...@atomide.com wrote:
 * Grazvydas Ignotas nota...@gmail.com [140414 15:51]:
 On Fri, Apr 11, 2014 at 2:47 AM, Tony Lindgren t...@atomide.com wrote:
  @@ -282,6 +283,7 @@ void omap_sram_idle(void)
 
  /* CORE */
  if (core_next_state  PWRDM_POWER_ON) {
  +   omap3_vc_set_pmic_signaling(core_next_state);

 I wonder how is it going to affect latencies, adding stuff to suspend
 path hurts things like NAND transfers, which consist of lots of small
 blocks with an interrupt after each..

 For most part this is the completely idle path, so there should
 not be much of hurry. Most devices should already block the deeper
 idle states for the devices listed in cm_idlest_per, cm_idlest1_core
 and cm_idlest3_core registers. So it should be mostly automatic with
 runtime PM.

 No idea what happens with GPMC though for NAND transfers :) Might
 be worth checking.

What happens there is that the interrupt arrives shortly after the
transfer was issued, but arm_pm_idle() would already be entered and
interrupts disabled, so it then has to go through all those slow
register accesses in omap_sram_idle(), which is just useless work in
such particular case (WFI will just return) and cause interrupt
response latency and loss of throughput. But this is mostly a problem
caused by pwrdm_pre_transition() and pwrdm_post_transition() calls
(they were optimized a bit at one point but later reverted),
core_next_state would probably stay ON and your function wouldn't be
called here, yes.


-- 
Gražvydas
--
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: [GIT PULL FOR v3.16] OMAP IOMMU fixes

2014-04-16 Thread Joerg Roedel
Hi Laurent,

On Fri, Apr 04, 2014 at 12:11:52AM +0200, Laurent Pinchart wrote:
 Laurent Pinchart (3):
   iommu/omap: Fix 'no page for' debug message in flush_iotlb_page()
   iommu/omap: Remove comment about supporting single page mappings only
   iommu/omap: Fix map protection value handling
 
 Suman Anna (3):
   iommu/omap: Correct init value of iotlb_entry valid field
   iommu/omap: Remove omap_iommu_domain_has_cap() function
   iommu/omap: Move to_iommu definition from omap-iopgtable.h
 
  drivers/iommu/omap-iommu.c | 31 ---
  drivers/iommu/omap-iopgtable.h |  3 ---
  2 files changed, 12 insertions(+), 22 deletions(-)

Can you please rebase this to v3.15-rc1 and send a new pull request? I
get a lot of commits besides these when I pull into v3.15-rc1.


Joerg


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


Re: [PATCH RFC 3/4] xhci: Tune PHY for the DWC3-Exynos host controller

2014-04-16 Thread Heikki Krogerus
Hi,

On Tue, Apr 15, 2014 at 06:24:11PM +0530, Vivek Gautam wrote:
 I had seen your patches in the mailing list, but i don't see any
 updated version of these patches.
 Are you planning to work on this above mentioned patch-series any time soon ?

I'm sorry, I forgot this completely. I have not prepared new version
of those patches as the drivers I need them for are not ready yet, but
I guess I can also use this case as justification for them.

 Or, should i try to find a different approach for handling the phy
 from the host controller (child of DWC3 in this case, which has the
 phys).

Well, there is now an issue with the lookup method I'm suggesting in
this case. Since the device ID is now generated automatically for
xhci-hcd in dwc3, we don't know the xhci-hcd device name before
platform_device_add(), and that is too late. I don't see why the
device could not be named when platform_device_alloc() is called, so I
think I'll suggest something like the attached patch to fix this
issue.

In any case, I'll send an updated version of the phy patches soon.

Thanks,

-- 
heikki
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index e714709..13f8edb 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -169,11 +169,47 @@ struct platform_object {
  */
 void platform_device_put(struct platform_device *pdev)
 {
-	if (pdev)
-		put_device(pdev-dev);
+	if (!pdev)
+		return;
+
+	if (pdev-id_auto) {
+		ida_simple_remove(platform_devid_ida, pdev-id);
+		pdev-id = PLATFORM_DEVID_AUTO;
+	}
+
+	put_device(pdev-dev);
 }
 EXPORT_SYMBOL_GPL(platform_device_put);
 
+static int pdev_set_name(struct platform_device *pdev)
+{
+	int ret;
+
+	switch (pdev-id) {
+	default:
+		dev_set_name(pdev-dev, %s.%d, pdev-name,  pdev-id);
+		break;
+	case PLATFORM_DEVID_NONE:
+		dev_set_name(pdev-dev, %s, pdev-name);
+		break;
+	case PLATFORM_DEVID_AUTO:
+		/*
+		 * Automatically allocated device ID. We mark it as such so
+		 * that we remember it must be freed, and we append a suffix
+		 * to avoid namespace collision with explicit IDs.
+		 */
+		ret = ida_simple_get(platform_devid_ida, 0, 0, GFP_KERNEL);
+		if (ret  0)
+			return ret;
+		pdev-id = ret;
+		pdev-id_auto = true;
+		dev_set_name(pdev-dev, %s.%d.auto, pdev-name, pdev-id);
+		break;
+	}
+
+	return 0;
+}
+
 static void platform_device_release(struct device *dev)
 {
 	struct platform_object *pa = container_of(dev, struct platform_object,
@@ -206,6 +242,10 @@ struct platform_device *platform_device_alloc(const char *name, int id)
 		device_initialize(pa-pdev.dev);
 		pa-pdev.dev.release = platform_device_release;
 		arch_setup_pdev_archdata(pa-pdev);
+		if (pdev_set_name(pa-pdev)) {
+			kfree(pa);
+			return NULL;
+		}
 	}
 
 	return pa ? pa-pdev : NULL;
@@ -286,28 +326,6 @@ int platform_device_add(struct platform_device *pdev)
 
 	pdev-dev.bus = platform_bus_type;
 
-	switch (pdev-id) {
-	default:
-		dev_set_name(pdev-dev, %s.%d, pdev-name,  pdev-id);
-		break;
-	case PLATFORM_DEVID_NONE:
-		dev_set_name(pdev-dev, %s, pdev-name);
-		break;
-	case PLATFORM_DEVID_AUTO:
-		/*
-		 * Automatically allocated device ID. We mark it as such so
-		 * that we remember it must be freed, and we append a suffix
-		 * to avoid namespace collision with explicit IDs.
-		 */
-		ret = ida_simple_get(platform_devid_ida, 0, 0, GFP_KERNEL);
-		if (ret  0)
-			goto err_out;
-		pdev-id = ret;
-		pdev-id_auto = true;
-		dev_set_name(pdev-dev, %s.%d.auto, pdev-name, pdev-id);
-		break;
-	}
-
 	for (i = 0; i  pdev-num_resources; i++) {
 		struct resource *p, *r = pdev-resource[i];
 
@@ -350,7 +368,6 @@ int platform_device_add(struct platform_device *pdev)
 			release_resource(r);
 	}
 
- err_out:
 	return ret;
 }
 EXPORT_SYMBOL_GPL(platform_device_add);
@@ -370,11 +387,6 @@ void platform_device_del(struct platform_device *pdev)
 	if (pdev) {
 		device_del(pdev-dev);
 
-		if (pdev-id_auto) {
-			ida_simple_remove(platform_devid_ida, pdev-id);
-			pdev-id = PLATFORM_DEVID_AUTO;
-		}
-
 		for (i = 0; i  pdev-num_resources; i++) {
 			struct resource *r = pdev-resource[i];
 			unsigned long type = resource_type(r);
@@ -392,8 +404,15 @@ EXPORT_SYMBOL_GPL(platform_device_del);
  */
 int platform_device_register(struct platform_device *pdev)
 {
+	int ret;
+
 	device_initialize(pdev-dev);
 	arch_setup_pdev_archdata(pdev);
+
+	ret = pdev_set_name(pdev);
+	if (ret)
+		return ret;
+
 	return platform_device_add(pdev);
 }
 EXPORT_SYMBOL_GPL(platform_device_register);


Re: [GIT PULL FOR v3.16] OMAP IOMMU fixes

2014-04-16 Thread Laurent Pinchart
Hi Joerg,

On Wednesday 16 April 2014 16:01:07 Joerg Roedel wrote:
 Hi Laurent,
 
 On Fri, Apr 04, 2014 at 12:11:52AM +0200, Laurent Pinchart wrote:
  Laurent Pinchart (3):
iommu/omap: Fix 'no page for' debug message in flush_iotlb_page()
iommu/omap: Remove comment about supporting single page mappings
only
iommu/omap: Fix map protection value handling
  
  Suman Anna (3):
iommu/omap: Correct init value of iotlb_entry valid field
iommu/omap: Remove omap_iommu_domain_has_cap() function
iommu/omap: Move to_iommu definition from omap-iopgtable.h
   
   drivers/iommu/omap-iommu.c | 31 ---
   drivers/iommu/omap-iopgtable.h |  3 ---
   2 files changed, 12 insertions(+), 22 deletions(-)
 
 Can you please rebase this to v3.15-rc1 and send a new pull request? I
 get a lot of commits besides these when I pull into v3.15-rc1.

Sure. The branch was based on top of your iommu master branch, I'll rebase on 
top of v3.15-rc1 and resend a pull request.

-- 
Regards,

Laurent Pinchart

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


[GIT PULL v2 FOR v3.16] OMAP IOMMU fixes

2014-04-16 Thread Laurent Pinchart
Hi Joerg,

The following changes since commit c9eaa447e77efe77b7fa4c953bd62de8297fd6c5:

  Linux 3.15-rc1 (2014-04-13 14:18:35 -0700)

are available in the git repository at:

  git://linuxtv.org/pinchartl/media.git iommu/omap

for you to fetch changes up to 286f600bc890347f7ec7bd50d33210d53a9095a3:

  iommu/omap: Fix map protection value handling (2014-04-16 16:30:18 +0200)

Compared to the v1 pull request, the patches have been rebased directly on top 
of v3.15-rc1.


Laurent Pinchart (3):
  iommu/omap: Fix 'no page for' debug message in flush_iotlb_page()
  iommu/omap: Remove comment about supporting single page mappings only
  iommu/omap: Fix map protection value handling

Suman Anna (3):
  iommu/omap: Correct init value of iotlb_entry valid field
  iommu/omap: Remove omap_iommu_domain_has_cap() function
  iommu/omap: Move to_iommu definition from omap-iopgtable.h

 drivers/iommu/omap-iommu.c | 31 ---
 drivers/iommu/omap-iopgtable.h |  3 ---
 2 files changed, 12 insertions(+), 22 deletions(-)

-- 
Regards,

Laurent Pinchart

--
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: [GIT PULL v2 FOR v3.16] OMAP IOMMU fixes

2014-04-16 Thread Laurent Pinchart
Hi Joerg,

Last but not least, could you please provide a stable branch with those 
patches, directly on top of v3.15-rc1 ? I'll need to base OMAP3 ISP driver 
patches on top of it.

On Wednesday 16 April 2014 16:51:56 Laurent Pinchart wrote:
 Hi Joerg,
 
 The following changes since commit c9eaa447e77efe77b7fa4c953bd62de8297fd6c5:
 
   Linux 3.15-rc1 (2014-04-13 14:18:35 -0700)
 
 are available in the git repository at:
 
   git://linuxtv.org/pinchartl/media.git iommu/omap
 
 for you to fetch changes up to 286f600bc890347f7ec7bd50d33210d53a9095a3:
 
   iommu/omap: Fix map protection value handling (2014-04-16 16:30:18 +0200)
 
 Compared to the v1 pull request, the patches have been rebased directly on
 top of v3.15-rc1.
 
 
 Laurent Pinchart (3):
   iommu/omap: Fix 'no page for' debug message in flush_iotlb_page()
   iommu/omap: Remove comment about supporting single page mappings only
   iommu/omap: Fix map protection value handling
 
 Suman Anna (3):
   iommu/omap: Correct init value of iotlb_entry valid field
   iommu/omap: Remove omap_iommu_domain_has_cap() function
   iommu/omap: Move to_iommu definition from omap-iopgtable.h
 
  drivers/iommu/omap-iommu.c | 31 ---
  drivers/iommu/omap-iopgtable.h |  3 ---
  2 files changed, 12 insertions(+), 22 deletions(-)

-- 
Regards,

Laurent Pinchart

--
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] power: twl4030_charger: clear IRQs after handling them

2014-04-16 Thread Felipe Balbi
TRM says we *must* write 1 to each bit we're handling
in order to clear the IRQ status and bring IRQ line
low. This patch implements that.

Signed-off-by: Felipe Balbi ba...@ti.com
---

Russell, I don't have HW to test, but this should
solve the problem you saw when not using battery
with Zoom board. Let me know if it doesn't.

cheers

 drivers/power/twl4030_charger.c | 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
index f141088..b090842 100644
--- a/drivers/power/twl4030_charger.c
+++ b/drivers/power/twl4030_charger.c
@@ -301,12 +301,24 @@ static irqreturn_t twl4030_bci_interrupt(int irq, void 
*arg)
ret = twl_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, irqs1,
  TWL4030_INTERRUPTS_BCIISR1A);
if (ret  0)
-   return IRQ_HANDLED;
+   return IRQ_NONE;
+
+   /* clear IRQs early */
+   ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, irqs1,
+   TWL4030_INTERRUPTS_BCIISR1A);
+   if (ret  0)
+   return IRQ_NONE;
 
ret = twl_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, irqs2,
  TWL4030_INTERRUPTS_BCIISR2A);
if (ret  0)
-   return IRQ_HANDLED;
+   return IRQ_NONE;
+
+   /* clear IRQs early */
+   ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, irqs2,
+ TWL4030_INTERRUPTS_BCIISR2A);
+   if (ret  0)
+   return IRQ_NONE;
 
dev_dbg(bci-dev, BCI irq %02x %02x\n, irqs2, irqs1);
 
-- 
1.9.1.286.g5172cb3

--
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 05/14] arm: common: edma: Select event queue 1 as default when booted with DT

2014-04-16 Thread Joel Fernandes
On 04/16/2014 07:59 AM, Peter Ujfalusi wrote:
[..]
 If the dma-priority is missing we should assume lowest priority (0).
 The highest priority depends on the platform. For eDMA3 in AM335x it is 
 three
 level. For designware controller you might have the range 0-8 as valid.

 The question is how to get this information into use?
 We can take the priority number in the core when the dma channel is 
 requested
 and add field to struct dma_chan in order to store it and the DMA 
 drivers
 could have access to it.

 How about Vinod's idea of extending dma_slave_config? Priority is
 similar to rest of the runtime setup dmaengine_slave_config() is meant
 to do.
 
 The dma_slave_config is prepared by the client drivers, so they would need to
 be updated to handle the priority for the DMA. This would lead to duplicated
 code - unless we have a small function in dmaengine core to fetch this
 information, but still all dmaengine clients would need to call that.
 IMHO it would be better to let the dmaengine core to take the priority for the
 channel when it has been asked so client drivers does not need to know about 
 it.
 

I still feel it is much cleaner to keep this out of DT and have audio
driver configure the channel manually for higher priority. Because,
AFAIK audio is the only device that uses slave DMA and needs higher
priority. I'd imagine everyone else who needs high priority, have their
own dedicated DMAC, so from that sense I don't see the priority
mechanism being used a lot anywhere else but audio, so atleast we can
rule out things like code duplication in other drivers. Priority can be
set to a default of low for those drivers that don't configure the
channel for priority. I'm also OK with EDMA driver configuring channel
for higher priority manually for the Cyclic case like you did initially.

Thanks,
-Joel

--
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: HDMI on OMAP4460: clk rate mismatch warning

2014-04-16 Thread Joachim Eastwood
On 16 April 2014 07:40, Tomi Valkeinen tomi.valkei...@ti.com wrote:
 On 15/04/14 20:36, Joachim Eastwood wrote:
 Hello,

 I am trying to get HDMI work with DT on my VAR-STK-OM44 (4460) board.
 But during kernel boot I get the following message:

 [ 0.953796] [ cut here ]
 [ 0.953826] WARNING: CPU: 0 PID: 1 at
 drivers/video/omap2/dss/dss.c:483 dss_set_fck_rate+0x7c/0x8c()
 [ 0.953826] clk rate mismatch: 15360 != 17066

 I have a fix (attached) for this in fbdev-fixes, which I'll probably be
 sending to Linus today. I couldn't send it in the main fbdev pull
 request, as it depended on clk driver changes. And it's not fatal, most
 likely things work fine even with the warning.

The warning disappeared after the patch. Thanks.
Feel free to add: Tested-By: Joachim Eastwood manab...@gmail.com


 [ 0.954345] OMAP DSS rev 4.0
 [ 0.956970] connector-hdmi connector.10: failed to find video source
 [ 0.957031] connector-hdmi: probe of connector.10 failed with error -22
 [ 0.959167] omapfb omapfb: no displays
 [ 0.961547] omapfb omapfb: failed to setup omapfb
 [ 0.961578] platform omapfb: Driver omapfb requests probe deferral

 Your DT data is not right. The shorter endpoint format you use is not
 supported. Have a look at arch/arm/boot/dts/omap4-panda-common.dtsi for
 an example.

 Also the HDMI driver does not currently work if the OMAP HDMI is
 directly connected to the HDMI connector. Panda and 4430 SDP boards use
 TPD12S015 chip in between. This should be fixed in the future, but at
 the moment you'll see problems if your board does not have that chip.

This board (VAR-STK-OM44) has a TPD12S521 which has no controllable
settings so adding a driver for it would be pretty meaningless. I
think it's the same situation with Gumstix Parlor. That board also
just have a very simple HDMI transmitter which shouldn't require a
driver.

But never the less I got HDMI working on my board adding the tpd21s015
nodes and providing a dummy gpio for CT CP HPD. This works but it's
a bit hacky.

During boot I got this warning from the tpd12s015 driver:
[ 2.955444] WARNING: CPU: 0 PID: 16 at
drivers/video/omap2/displays-new/encoder-tpd12s015.c:87
tpd_connect+0xb8/0xc8()
[ 2.955444] Modules linked in:
[ 2.955444] CPU: 0 PID: 16 Comm: kworker/u4:1 Not tainted
3.15.0-rc1-00058-ge6c0e0fdf274-dirty #33
[ 2.979309] Workqueue: deferwq deferred_probe_work_func
[ 2.984863] [c0014f48] (unwind_backtrace) from [c0011c2c]
(show_stack+0x10/0x14)
[ 3.000427] [c0011c2c] (show_stack) from [c05cb494] (dump_stack+0x84/0x94)
[ 3.008087] [c05cb494] (dump_stack) from [c0036ba8]
(warn_slowpath_common+0x70/0x8c)
[ 3.016632] [c0036ba8] (warn_slowpath_common) from [c0036c60]
(warn_slowpath_null+0x1c/0x24)
[ 3.025878] [c0036c60] (warn_slowpath_null) from [c02c8d30]
(tpd_connect+0xb8/0xc8)
[ 3.034332] [c02c8d30] (tpd_connect) from [c031f640] (pdev_probe+0x40/0xdc)
[ 3.042053] [c031f640] (pdev_probe) from [c0330474]
(platform_drv_probe+0x18/0x48)
[ 3.042083] [c0330474] (platform_drv_probe) from [c032ecf8]
(driver_probe_device+0x124/0x240)
[ 3.059722] [c032ecf8] (driver_probe_device) from [c032d370]
(bus_for_each_drv+0x58/0x8c)
[ 3.068695] [c032d370] (bus_for_each_drv) from [c032eba4]
(device_attach+0x78/0x8c)
[ 3.077148] [c032eba4] (device_attach) from [c032e22c]
(bus_probe_device+0x88/0xac)
[ 3.085571] [c032e22c] (bus_probe_device) from [c032e674]
(deferred_probe_work_func+0x6c/0xa0)
[ 3.095031] [c032e674] (deferred_probe_work_func) from [c004edb0]
(process_one_work+0x1b0/0x4c4)
[ 3.095031] [c004edb0] (process_one_work) from [c004fc74]
(worker_thread+0x13c/0x3dc)
[ 3.113220] [c004fc74] (worker_thread) from [c0055844] (kthread+0xe0/0xf4)
[ 3.121032] [c0055844] (kthread) from [c000e2c8] (ret_from_fork+0x14/0x2c)
[ 3.128631] ---[ end trace 7cb21223a2b91cf6 ]---

One other thing.
Does HDMI audio work with DT or is that a still TODO?
I am only getting probe deferral's from omap-hdmi-audio. Haven't look
to far into it.

regards
Joachim Eastwood
--
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/2] ARM: dts: omap5: Add dr_mode for dwc3

2014-04-16 Thread Felipe Balbi
On Fri, Oct 11, 2013 at 05:46:12PM +0300, Roger Quadros wrote:
 Hi,
 
 On 10/10/2013 01:49 PM, Kishon Vijay Abraham I wrote:
  From: George Cherian george.cher...@ti.com
  
  Added dr_mode property in dwc3 and set its default mode to device.
 
 If there is a specific reason why this is not set to otg, we need
 to explain it here.
 
 AFAIK the port is meant to be used as OTG port.

we still don't have the workaround for dual role ports, I've been
working on it but still need to retest and make sure it's working fine
before merging upstream.

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 2/2] ARM: dts: omap5: Add dr_mode for dwc3

2014-04-16 Thread Felipe Balbi
On Wed, Apr 16, 2014 at 11:16:19AM -0500, Felipe Balbi wrote:
 On Fri, Oct 11, 2013 at 05:46:12PM +0300, Roger Quadros wrote:
  Hi,
  
  On 10/10/2013 01:49 PM, Kishon Vijay Abraham I wrote:
   From: George Cherian george.cher...@ti.com
   
   Added dr_mode property in dwc3 and set its default mode to device.
  
  If there is a specific reason why this is not set to otg, we need
  to explain it here.
  
  AFAIK the port is meant to be used as OTG port.
 
 we still don't have the workaround for dual role ports, I've been
 working on it but still need to retest and make sure it's working fine
 before merging upstream.

man, I went back in time. Nevermind :-)

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] power: twl4030_charger: clear IRQs after handling them

2014-04-16 Thread Tony Lindgren
* Felipe Balbi ba...@ti.com [140416 08:18]:
 TRM says we *must* write 1 to each bit we're handling
 in order to clear the IRQ status and bring IRQ line
 low. This patch implements that.
 
 Signed-off-by: Felipe Balbi ba...@ti.com
 ---
 
 Russell, I don't have HW to test, but this should
 solve the problem you saw when not using battery
 with Zoom board. Let me know if it doesn't.

BTW, looks like we're enabling BCI automatically in twl4030.dtsi
while the legacy booting does not have TWL_COMMON_PDATA_BCI
enabled for LDP. Anyways, for LDP BCI should be enabled for
sure, that's the only way to power at least the earlier LDP
revisions.

  drivers/power/twl4030_charger.c | 16 ++--
  1 file changed, 14 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
 index f141088..b090842 100644
 --- a/drivers/power/twl4030_charger.c
 +++ b/drivers/power/twl4030_charger.c
 @@ -301,12 +301,24 @@ static irqreturn_t twl4030_bci_interrupt(int irq, void 
 *arg)
   ret = twl_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, irqs1,
 TWL4030_INTERRUPTS_BCIISR1A);
   if (ret  0)
 - return IRQ_HANDLED;
 + return IRQ_NONE;
 +
 + /* clear IRQs early */
 + ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, irqs1,
 + TWL4030_INTERRUPTS_BCIISR1A);
 + if (ret  0)
 + return IRQ_NONE;
  
   ret = twl_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, irqs2,
 TWL4030_INTERRUPTS_BCIISR2A);
   if (ret  0)
 - return IRQ_HANDLED;
 + return IRQ_NONE;
 +
 + /* clear IRQs early */
 + ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, irqs2,
 +   TWL4030_INTERRUPTS_BCIISR2A);
 + if (ret  0)
 + return IRQ_NONE;
  
   dev_dbg(bci-dev, BCI irq %02x %02x\n, irqs2, irqs1);
  
 -- 
 1.9.1.286.g5172cb3
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
--
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 00/10] dma: edma: Fixes for cyclic (audio) operation

2014-04-16 Thread Joel Fernandes
On 04/14/2014 06:41 AM, Peter Ujfalusi wrote:
 Hi,
 
 Changes since v2:
 - Dropped patch 10 from v2 (simplify direction configuration...)
 - Dropped the channel priority related patches since we are going to go via
   different route for configuring the priority.
 - Added ACK from Joel for the patches since they are not changed since v2
 
 Changes since v1:
 - ASoC patches removed
 - Comments from Andriy Shevchenko addressed
 - patch added to fix cases when src/dst_maxburst is set to 0
 
 The series contains now only:
 Support for DMA pause/resume in cyclic mode
 device_slave_caps callback and DMA_CYCLIC flag correction.
 While debugging the edma to get things sorted out I noticed that the debug was
 too verbose and the important information was hidden even when the we did not
 asked for verbose dmaengine debug.
 I have included some debug cleanups for the edma dmaengine driver also.
 
 Regards,
 Peter
 ---
 Peter Ujfalusi (10):
   platform_data: edma: Be precise with the paRAM struct
   arm: common: edma: Save the number of event queues/TCs
   dmaengine: edma: Correct the handling of src/dst_maxburst == 0
   dmaengine: edma: Add support for DMA_PAUSE/RESUME operation
   dmaengine: edma: Set DMA_CYCLIC capability flag
   dmaengine: edma: Implement device_slave_caps callback
   dmaengine: edma: Reduce debug print verbosity for non verbose
 debugging
   dmaengine: edma: Prefix debug prints where the text were identical in
 prep callbacks
   dmaengine: edma: Add channel number to debug prints
   dmaengine: edma: Print the direction value as well when it is not
 supported
 
  arch/arm/common/edma.c |  4 ++
  drivers/dma/edma.c | 87 
 ++
  include/linux/platform_data/edma.h | 18 
  3 files changed, 83 insertions(+), 26 deletions(-)
 

I reviewed and tested all the patches in the new series to make sure it
doesn't break anything with non-cyclic users (MMC and Crypto).

Reviewed-and-Tested-by: Joel Fernandes jo...@ti.com


regards,
-Joel
--
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: [GIT PULL v2 FOR v3.16] OMAP IOMMU fixes

2014-04-16 Thread Joerg Roedel
On Wed, Apr 16, 2014 at 04:51:56PM +0200, Laurent Pinchart wrote:
 The following changes since commit c9eaa447e77efe77b7fa4c953bd62de8297fd6c5:
 
   Linux 3.15-rc1 (2014-04-13 14:18:35 -0700)
 
 are available in the git repository at:
 
   git://linuxtv.org/pinchartl/media.git iommu/omap
 
 for you to fetch changes up to 286f600bc890347f7ec7bd50d33210d53a9095a3:
 
   iommu/omap: Fix map protection value handling (2014-04-16 16:30:18 +0200)
 
 Compared to the v1 pull request, the patches have been rebased directly on 
 top 
 of v3.15-rc1.
 
 
 Laurent Pinchart (3):
   iommu/omap: Fix 'no page for' debug message in flush_iotlb_page()
   iommu/omap: Remove comment about supporting single page mappings only
   iommu/omap: Fix map protection value handling
 
 Suman Anna (3):
   iommu/omap: Correct init value of iotlb_entry valid field
   iommu/omap: Remove omap_iommu_domain_has_cap() function
   iommu/omap: Move to_iommu definition from omap-iopgtable.h
 
  drivers/iommu/omap-iommu.c | 31 ---
  drivers/iommu/omap-iopgtable.h |  3 ---
  2 files changed, 12 insertions(+), 22 deletions(-)

Pulled, thanks Laurent. You can use the arm/omap branch to base your
work on (when I pushed it, which will probably happen tomorrow).


Joerg


--
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/8] usb: dwc3: core: refactor mode initialization to its own function

2014-04-16 Thread Felipe Balbi
Move mode (Host, Peripheral, OTG) initialization
to its own function in order to decrease the size
of our probe() routine.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/core.c | 133 
 1 file changed, 67 insertions(+), 66 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 38976f3..2a68aea 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -553,6 +553,69 @@ static int dwc3_core_get_phy(struct dwc3 *dwc)
return 0;
 }
 
+static int dwc3_core_init_mode(struct dwc3 *dwc)
+{
+   struct device *dev = dwc-dev;
+   int ret;
+
+   switch (dwc-dr_mode) {
+   case USB_DR_MODE_PERIPHERAL:
+   dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE);
+   ret = dwc3_gadget_init(dwc);
+   if (ret) {
+   dev_err(dev, failed to initialize gadget\n);
+   return ret;
+   }
+   break;
+   case USB_DR_MODE_HOST:
+   dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST);
+   ret = dwc3_host_init(dwc);
+   if (ret) {
+   dev_err(dev, failed to initialize host\n);
+   return ret;
+   }
+   break;
+   case USB_DR_MODE_OTG:
+   dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG);
+   ret = dwc3_host_init(dwc);
+   if (ret) {
+   dev_err(dev, failed to initialize host\n);
+   return ret;
+   }
+
+   ret = dwc3_gadget_init(dwc);
+   if (ret) {
+   dev_err(dev, failed to initialize gadget\n);
+   return ret;
+   }
+   break;
+   default:
+   dev_err(dev, Unsupported mode of operation %d\n, 
dwc-dr_mode);
+   return ret;
+   }
+
+   return 0;
+}
+
+static void dwc3_core_exit_mode(struct dwc3 *dwc)
+{
+   switch (dwc-dr_mode) {
+   case USB_DR_MODE_PERIPHERAL:
+   dwc3_gadget_exit(dwc);
+   break;
+   case USB_DR_MODE_HOST:
+   dwc3_host_exit(dwc);
+   break;
+   case USB_DR_MODE_OTG:
+   dwc3_host_exit(dwc);
+   dwc3_gadget_exit(dwc);
+   break;
+   default:
+   /* do nothing */
+   break;
+   }
+}
+
 #define DWC3_ALIGN_MASK(16 - 1)
 
 static int dwc3_probe(struct platform_device *pdev)
@@ -682,41 +745,9 @@ static int dwc3_probe(struct platform_device *pdev)
goto err_usb3phy_power;
}
 
-   switch (dwc-dr_mode) {
-   case USB_DR_MODE_PERIPHERAL:
-   dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE);
-   ret = dwc3_gadget_init(dwc);
-   if (ret) {
-   dev_err(dev, failed to initialize gadget\n);
-   goto err2;
-   }
-   break;
-   case USB_DR_MODE_HOST:
-   dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST);
-   ret = dwc3_host_init(dwc);
-   if (ret) {
-   dev_err(dev, failed to initialize host\n);
-   goto err2;
-   }
-   break;
-   case USB_DR_MODE_OTG:
-   dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG);
-   ret = dwc3_host_init(dwc);
-   if (ret) {
-   dev_err(dev, failed to initialize host\n);
-   goto err2;
-   }
-
-   ret = dwc3_gadget_init(dwc);
-   if (ret) {
-   dev_err(dev, failed to initialize gadget\n);
-   goto err2;
-   }
-   break;
-   default:
-   dev_err(dev, Unsupported mode of operation %d\n, 
dwc-dr_mode);
+   ret = dwc3_core_init_mode(dwc);
+   if (ret)
goto err2;
-   }
 
ret = dwc3_debugfs_init(dwc);
if (ret) {
@@ -729,21 +760,7 @@ static int dwc3_probe(struct platform_device *pdev)
return 0;
 
 err3:
-   switch (dwc-dr_mode) {
-   case USB_DR_MODE_PERIPHERAL:
-   dwc3_gadget_exit(dwc);
-   break;
-   case USB_DR_MODE_HOST:
-   dwc3_host_exit(dwc);
-   break;
-   case USB_DR_MODE_OTG:
-   dwc3_host_exit(dwc);
-   dwc3_gadget_exit(dwc);
-   break;
-   default:
-   /* do nothing */
-   break;
-   }
+   dwc3_core_exit_mode(dwc);
 
 err2:
dwc3_event_buffers_cleanup(dwc);
@@ -778,23 +795,7 @@ static int dwc3_remove(struct platform_device *pdev)
pm_runtime_disable(pdev-dev);
 
dwc3_debugfs_exit(dwc);
-
-   switch (dwc-dr_mode) {
-   case USB_DR_MODE_PERIPHERAL:
-   dwc3_gadget_exit(dwc);
-   break;
-   case 

[PATCH 5/8] usb: phy: rename usb_nop_xceiv to usb_phy_generic

2014-04-16 Thread Felipe Balbi
no functional changes, just renaming the function
in order to make it slightly clearer what it should
be used for, also matching the driver name.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/dwc3-exynos.c|  6 ++---
 drivers/usb/dwc3/dwc3-pci.c   |  6 ++---
 drivers/usb/musb/am35x.c  |  4 +--
 drivers/usb/musb/blackfin.c   |  4 +--
 drivers/usb/musb/da8xx.c  |  4 +--
 drivers/usb/musb/davinci.c|  6 ++---
 drivers/usb/musb/tusb6010.c   |  6 ++---
 drivers/usb/phy/phy-am335x.c  |  2 +-
 drivers/usb/phy/phy-generic.c | 50 +--
 drivers/usb/phy/phy-generic.h |  6 ++---
 drivers/usb/phy/phy-keystone.c|  2 +-
 include/linux/usb/usb_phy_gen_xceiv.h | 10 +++
 12 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index 28c8ad7..821cc59 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -38,13 +38,13 @@ struct dwc3_exynos {
 
 static int dwc3_exynos_register_phys(struct dwc3_exynos *exynos)
 {
-   struct usb_phy_gen_xceiv_platform_data pdata;
+   struct usb_phy_generic_platform_data pdata;
struct platform_device  *pdev;
int ret;
 
memset(pdata, 0x00, sizeof(pdata));
 
-   pdev = platform_device_alloc(usb_phy_gen_xceiv, PLATFORM_DEVID_AUTO);
+   pdev = platform_device_alloc(usb_phy_generic, PLATFORM_DEVID_AUTO);
if (!pdev)
return -ENOMEM;
 
@@ -56,7 +56,7 @@ static int dwc3_exynos_register_phys(struct dwc3_exynos 
*exynos)
if (ret)
goto err1;
 
-   pdev = platform_device_alloc(usb_phy_gen_xceiv, PLATFORM_DEVID_AUTO);
+   pdev = platform_device_alloc(usb_phy_generic, PLATFORM_DEVID_AUTO);
if (!pdev) {
ret = -ENOMEM;
goto err1;
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index f393c18..8b162f0 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -40,13 +40,13 @@ struct dwc3_pci {
 
 static int dwc3_pci_register_phys(struct dwc3_pci *glue)
 {
-   struct usb_phy_gen_xceiv_platform_data pdata;
+   struct usb_phy_generic_platform_data pdata;
struct platform_device  *pdev;
int ret;
 
memset(pdata, 0x00, sizeof(pdata));
 
-   pdev = platform_device_alloc(usb_phy_gen_xceiv, 0);
+   pdev = platform_device_alloc(usb_phy_generic, 0);
if (!pdev)
return -ENOMEM;
 
@@ -58,7 +58,7 @@ static int dwc3_pci_register_phys(struct dwc3_pci *glue)
if (ret)
goto err1;
 
-   pdev = platform_device_alloc(usb_phy_gen_xceiv, 1);
+   pdev = platform_device_alloc(usb_phy_generic, 1);
if (!pdev) {
ret = -ENOMEM;
goto err1;
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index b3aa018..77ed664 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -360,7 +360,7 @@ static int am35x_musb_init(struct musb *musb)
if (!rev)
return -ENODEV;
 
-   usb_nop_xceiv_register();
+   usb_phy_generic_register();
musb-xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb-xceiv))
return -EPROBE_DEFER;
@@ -402,7 +402,7 @@ static int am35x_musb_exit(struct musb *musb)
data-set_phy_power(0);
 
usb_put_phy(musb-xceiv);
-   usb_nop_xceiv_unregister();
+   usb_phy_generic_unregister();
 
return 0;
 }
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index 796677f..607f3ae 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -401,7 +401,7 @@ static int bfin_musb_init(struct musb *musb)
}
gpio_direction_output(musb-config-gpio_vrsel, 0);
 
-   usb_nop_xceiv_register();
+   usb_phy_generic_register();
musb-xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb-xceiv)) {
gpio_free(musb-config-gpio_vrsel);
@@ -426,7 +426,7 @@ static int bfin_musb_exit(struct musb *musb)
gpio_free(musb-config-gpio_vrsel);
 
usb_put_phy(musb-xceiv);
-   usb_nop_xceiv_unregister();
+   usb_phy_generic_unregister();
return 0;
 }
 
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index e3486de..bcdce8e 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -418,7 +418,7 @@ static int da8xx_musb_init(struct musb *musb)
if (!rev)
goto fail;
 
-   usb_nop_xceiv_register();
+   usb_phy_generic_register();
musb-xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb-xceiv)) {
ret = -EPROBE_DEFER;
@@ -453,7 +453,7 @@ static int da8xx_musb_exit(struct musb *musb)
phy_off();
 

[PATCH 6/8] usb: phy: rename linux/usb/usb_phy_gen_xceiv.h to linux/usb/usb_phy_generic.h

2014-04-16 Thread Felipe Balbi
now that all functions match the driver name,
the only missing piece is to rename the header
file itself.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/dwc3-exynos.c   | 2 +-
 drivers/usb/dwc3/dwc3-pci.c  | 2 +-
 drivers/usb/musb/am35x.c | 2 +-
 drivers/usb/musb/blackfin.c  | 2 +-
 drivers/usb/musb/da8xx.c | 2 +-
 drivers/usb/musb/davinci.c   | 2 +-
 drivers/usb/musb/musb_dsps.c | 2 +-
 drivers/usb/musb/tusb6010.c  | 2 +-
 drivers/usb/phy/phy-am335x.c | 2 +-
 drivers/usb/phy/phy-generic.c| 2 +-
 drivers/usb/phy/phy-generic.h| 2 +-
 drivers/usb/phy/phy-keystone.c   | 2 +-
 include/linux/usb/{usb_phy_gen_xceiv.h = usb_phy_generic.h} | 0
 13 files changed, 12 insertions(+), 12 deletions(-)
 rename include/linux/usb/{usb_phy_gen_xceiv.h = usb_phy_generic.h} (100%)

diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index 821cc59..ed22d72 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -24,7 +24,7 @@
 #include linux/dma-mapping.h
 #include linux/clk.h
 #include linux/usb/otg.h
-#include linux/usb/usb_phy_gen_xceiv.h
+#include linux/usb/usb_phy_generic.h
 #include linux/of.h
 #include linux/of_platform.h
 
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 8b162f0..1ed95e0 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -23,7 +23,7 @@
 #include linux/platform_device.h
 
 #include linux/usb/otg.h
-#include linux/usb/usb_phy_gen_xceiv.h
+#include linux/usb/usb_phy_generic.h
 
 /* FIXME define these in linux/pci_ids.h */
 #define PCI_VENDOR_ID_SYNOPSYS 0x16c3
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 77ed664..044cd82 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -32,7 +32,7 @@
 #include linux/io.h
 #include linux/platform_device.h
 #include linux/dma-mapping.h
-#include linux/usb/usb_phy_gen_xceiv.h
+#include linux/usb/usb_phy_generic.h
 #include linux/platform_data/usb-omap.h
 
 #include musb_core.h
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index 607f3ae..c9992a2 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -18,7 +18,7 @@
 #include linux/platform_device.h
 #include linux/dma-mapping.h
 #include linux/prefetch.h
-#include linux/usb/usb_phy_gen_xceiv.h
+#include linux/usb/usb_phy_generic.h
 
 #include asm/cacheflush.h
 
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index bcdce8e..a0dabb0 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -32,7 +32,7 @@
 #include linux/io.h
 #include linux/platform_device.h
 #include linux/dma-mapping.h
-#include linux/usb/usb_phy_gen_xceiv.h
+#include linux/usb/usb_phy_generic.h
 
 #include mach/da8xx.h
 #include linux/platform_data/usb-davinci.h
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index c0e07ed..7370354 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -32,7 +32,7 @@
 #include linux/gpio.h
 #include linux/platform_device.h
 #include linux/dma-mapping.h
-#include linux/usb/usb_phy_gen_xceiv.h
+#include linux/usb/usb_phy_generic.h
 
 #include mach/cputype.h
 #include mach/hardware.h
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 3372ded..1888292 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -35,7 +35,7 @@
 #include linux/dma-mapping.h
 #include linux/pm_runtime.h
 #include linux/module.h
-#include linux/usb/usb_phy_gen_xceiv.h
+#include linux/usb/usb_phy_generic.h
 #include linux/platform_data/usb-omap.h
 #include linux/sizes.h
 
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index 0c0f5ee..8d4a819 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -24,7 +24,7 @@
 #include linux/io.h
 #include linux/platform_device.h
 #include linux/dma-mapping.h
-#include linux/usb/usb_phy_gen_xceiv.h
+#include linux/usb/usb_phy_generic.h
 
 #include musb_core.h
 
diff --git a/drivers/usb/phy/phy-am335x.c b/drivers/usb/phy/phy-am335x.c
index bb866e4..585e50c 100644
--- a/drivers/usb/phy/phy-am335x.c
+++ b/drivers/usb/phy/phy-am335x.c
@@ -2,7 +2,7 @@
 #include linux/platform_device.h
 #include linux/dma-mapping.h
 #include linux/usb/otg.h
-#include linux/usb/usb_phy_gen_xceiv.h
+#include linux/usb/usb_phy_generic.h
 #include linux/slab.h
 #include linux/clk.h
 #include linux/regulator/consumer.h
diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index e76ca4c..2c49cd8 100644
--- a/drivers/usb/phy/phy-generic.c
+++ 

[PATCH 1/8] usb: dwc3: gadget: clear stall when disabling endpoint

2014-04-16 Thread Felipe Balbi
so it seems like DWC3 IP doesn't clear stalls
automatically when we disable an endpoint, because
of that, we _must_ make sure stalls are cleared
before clearing the proper bit in DALEPENA register.

Cc: sta...@vger.kernel.org # v3.4+
Reported-by: Johannes Stezenbach j...@sig21.net
Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/gadget.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index a740eac..f0dc0ee 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -608,6 +608,10 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep)
 
dwc3_remove_requests(dwc, dep);
 
+   /* make sure HW endpoint isn't stalled */
+   if (dep-flags  DWC3_EP_STALL)
+   __dwc3_gadget_ep_set_halt(dep, 0);
+
reg = dwc3_readl(dwc-regs, DWC3_DALEPENA);
reg = ~DWC3_DALEPENA_EP(dep-number);
dwc3_writel(dwc-regs, DWC3_DALEPENA, reg);
-- 
1.9.2.459.g68773ac

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


[PATCH 8/8] usb: phy: generic: allow multiples calls to usb_phy_generic_register()

2014-04-16 Thread Felipe Balbi
it's now very easy to return a platform_device pointer
and have the caller pass it as argument when calling
usb_phy_generic_unregister().

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/musb/am35x.c| 12 +---
 drivers/usb/musb/blackfin.c | 10 --
 drivers/usb/musb/da8xx.c| 14 +++---
 drivers/usb/musb/tusb6010.c |  3 ++-
 drivers/usb/phy/phy-generic.c   | 19 +--
 include/linux/usb/usb_phy_generic.h |  8 
 6 files changed, 39 insertions(+), 27 deletions(-)

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 05459b5..0a34dd8 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -85,6 +85,7 @@
 struct am35x_glue {
struct device   *dev;
struct platform_device  *musb;
+   struct platform_device  *phy;
struct clk  *phy_clk;
struct clk  *clk;
 };
@@ -503,7 +504,9 @@ static int am35x_probe(struct platform_device *pdev)
 
pdata-platform_ops = am35x_ops;
 
-   usb_phy_generic_register();
+   glue-phy = usb_phy_generic_register();
+   if (IS_ERR(glue-phy))
+   goto err7;
platform_set_drvdata(pdev, glue);
 
pinfo = am35x_dev_info;
@@ -517,11 +520,14 @@ static int am35x_probe(struct platform_device *pdev)
if (IS_ERR(musb)) {
ret = PTR_ERR(musb);
dev_err(pdev-dev, failed to register musb device: %d\n, 
ret);
-   goto err7;
+   goto err8;
}
 
return 0;
 
+err8:
+   usb_phy_generic_unregister(glue-phy);
+
 err7:
clk_disable(clk);
 
@@ -546,7 +552,7 @@ static int am35x_remove(struct platform_device *pdev)
struct am35x_glue   *glue = platform_get_drvdata(pdev);
 
platform_device_unregister(glue-musb);
-   usb_phy_generic_unregister();
+   usb_phy_generic_unregister(glue-phy);
clk_disable(glue-clk);
clk_disable(glue-phy_clk);
clk_put(glue-clk);
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index 53acffe..d40d5f0 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -29,6 +29,7 @@
 struct bfin_glue {
struct device   *dev;
struct platform_device  *musb;
+   struct platform_device  *phy;
 };
 #define glue_to_musb(g)platform_get_drvdata(g-musb)
 
@@ -475,7 +476,9 @@ static int bfin_probe(struct platform_device *pdev)
 
pdata-platform_ops = bfin_ops;
 
-   usb_phy_generic_register();
+   glue-phy = usb_phy_generic_register();
+   if (IS_ERR(glue-phy))
+   goto err2;
platform_set_drvdata(pdev, glue);
 
memset(musb_resources, 0x00, sizeof(*musb_resources) *
@@ -513,6 +516,9 @@ static int bfin_probe(struct platform_device *pdev)
return 0;
 
 err3:
+   usb_phy_generic_unregister(glue-phy);
+
+err2:
platform_device_put(musb);
 
 err1:
@@ -527,7 +533,7 @@ static int bfin_remove(struct platform_device *pdev)
struct bfin_glue*glue = platform_get_drvdata(pdev);
 
platform_device_unregister(glue-musb);
-   usb_phy_generic_unregister();
+   usb_phy_generic_unregister(glue-phy);
kfree(glue);
 
return 0;
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 024751f..058775e 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -85,6 +85,7 @@
 struct da8xx_glue {
struct device   *dev;
struct platform_device  *musb;
+   struct platform_device  *phy;
struct clk  *clk;
 };
 
@@ -510,7 +511,11 @@ static int da8xx_probe(struct platform_device *pdev)
 
pdata-platform_ops = da8xx_ops;
 
-   usb_phy_generic_register();
+   glue-phy = usb_phy_generic_register();
+   if (IS_ERR(glue-phy)) {
+   ret = PTR_ERR(glue-phy);
+   goto err5;
+   }
platform_set_drvdata(pdev, glue);
 
memset(musb_resources, 0x00, sizeof(*musb_resources) *
@@ -537,11 +542,14 @@ static int da8xx_probe(struct platform_device *pdev)
if (IS_ERR(musb)) {
ret = PTR_ERR(musb);
dev_err(pdev-dev, failed to register musb device: %d\n, 
ret);
-   goto err5;
+   goto err6;
}
 
return 0;
 
+err6:
+   usb_phy_generic_unregister(glue-phy);
+
 err5:
clk_disable(clk);
 
@@ -560,7 +568,7 @@ static int da8xx_remove(struct platform_device *pdev)
struct da8xx_glue   *glue = platform_get_drvdata(pdev);
 
platform_device_unregister(glue-musb);
-   usb_phy_generic_unregister();
+   usb_phy_generic_unregister(glue-phy);
clk_disable(glue-clk);
clk_put(glue-clk);
kfree(glue);
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index e1da199..f38a8db 100644

[PATCH 7/8] usb: musb: move usb_phy_generic_{un,}register calls to probe()/remove()

2014-04-16 Thread Felipe Balbi
This patch is in preparation to supporting
calling those functions multiple times.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/musb/am35x.c| 4 ++--
 drivers/usb/musb/blackfin.c | 6 +++---
 drivers/usb/musb/da8xx.c| 4 ++--
 drivers/usb/musb/davinci.c  | 4 ++--
 drivers/usb/musb/tusb6010.c | 5 ++---
 5 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 044cd82..05459b5 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -360,7 +360,6 @@ static int am35x_musb_init(struct musb *musb)
if (!rev)
return -ENODEV;
 
-   usb_phy_generic_register();
musb-xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb-xceiv))
return -EPROBE_DEFER;
@@ -402,7 +401,6 @@ static int am35x_musb_exit(struct musb *musb)
data-set_phy_power(0);
 
usb_put_phy(musb-xceiv);
-   usb_phy_generic_unregister();
 
return 0;
 }
@@ -505,6 +503,7 @@ static int am35x_probe(struct platform_device *pdev)
 
pdata-platform_ops = am35x_ops;
 
+   usb_phy_generic_register();
platform_set_drvdata(pdev, glue);
 
pinfo = am35x_dev_info;
@@ -547,6 +546,7 @@ static int am35x_remove(struct platform_device *pdev)
struct am35x_glue   *glue = platform_get_drvdata(pdev);
 
platform_device_unregister(glue-musb);
+   usb_phy_generic_unregister();
clk_disable(glue-clk);
clk_disable(glue-phy_clk);
clk_put(glue-clk);
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index c9992a2..53acffe 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -401,7 +401,6 @@ static int bfin_musb_init(struct musb *musb)
}
gpio_direction_output(musb-config-gpio_vrsel, 0);
 
-   usb_phy_generic_register();
musb-xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb-xceiv)) {
gpio_free(musb-config-gpio_vrsel);
@@ -424,9 +423,8 @@ static int bfin_musb_init(struct musb *musb)
 static int bfin_musb_exit(struct musb *musb)
 {
gpio_free(musb-config-gpio_vrsel);
-
usb_put_phy(musb-xceiv);
-   usb_phy_generic_unregister();
+
return 0;
 }
 
@@ -477,6 +475,7 @@ static int bfin_probe(struct platform_device *pdev)
 
pdata-platform_ops = bfin_ops;
 
+   usb_phy_generic_register();
platform_set_drvdata(pdev, glue);
 
memset(musb_resources, 0x00, sizeof(*musb_resources) *
@@ -528,6 +527,7 @@ static int bfin_remove(struct platform_device *pdev)
struct bfin_glue*glue = platform_get_drvdata(pdev);
 
platform_device_unregister(glue-musb);
+   usb_phy_generic_unregister();
kfree(glue);
 
return 0;
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index a0dabb0..024751f 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -418,7 +418,6 @@ static int da8xx_musb_init(struct musb *musb)
if (!rev)
goto fail;
 
-   usb_phy_generic_register();
musb-xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb-xceiv)) {
ret = -EPROBE_DEFER;
@@ -453,7 +452,6 @@ static int da8xx_musb_exit(struct musb *musb)
phy_off();
 
usb_put_phy(musb-xceiv);
-   usb_phy_generic_unregister();
 
return 0;
 }
@@ -512,6 +510,7 @@ static int da8xx_probe(struct platform_device *pdev)
 
pdata-platform_ops = da8xx_ops;
 
+   usb_phy_generic_register();
platform_set_drvdata(pdev, glue);
 
memset(musb_resources, 0x00, sizeof(*musb_resources) *
@@ -561,6 +560,7 @@ static int da8xx_remove(struct platform_device *pdev)
struct da8xx_glue   *glue = platform_get_drvdata(pdev);
 
platform_device_unregister(glue-musb);
+   usb_phy_generic_unregister();
clk_disable(glue-clk);
clk_put(glue-clk);
kfree(glue);
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 7370354..de8492b 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -381,7 +381,6 @@ static int davinci_musb_init(struct musb *musb)
u32 revision;
int ret = -ENODEV;
 
-   usb_phy_generic_register();
musb-xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb-xceiv)) {
ret = -EPROBE_DEFER;
@@ -487,7 +486,6 @@ static int davinci_musb_exit(struct musb *musb)
phy_off();
 
usb_put_phy(musb-xceiv);
-   usb_phy_generic_unregister();
 
return 0;
 }
@@ -545,6 +543,7 @@ static int davinci_probe(struct platform_device *pdev)
 
pdata-platform_ops = davinci_ops;
 
+   usb_phy_generic_register();
platform_set_drvdata(pdev, glue);
 
memset(musb_resources, 0x00, 

[PATCH 2/8] usb: dwc3: core: refactor PHY initialization

2014-04-16 Thread Felipe Balbi
our probe() routine is too large and we can
easily refactor PHY-related code out to another
function to make it slightly less painful to read.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/core.c | 120 ++--
 1 file changed, 66 insertions(+), 54 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index d001417..38976f3 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -486,70 +486,20 @@ static void dwc3_core_exit(struct dwc3 *dwc)
phy_exit(dwc-usb3_generic_phy);
 }
 
-#define DWC3_ALIGN_MASK(16 - 1)
-
-static int dwc3_probe(struct platform_device *pdev)
+static int dwc3_core_get_phy(struct dwc3 *dwc)
 {
-   struct device   *dev = pdev-dev;
-   struct dwc3_platform_data *pdata = dev_get_platdata(dev);
+   struct device   *dev = dwc-dev;
struct device_node  *node = dev-of_node;
-   struct resource *res;
-   struct dwc3 *dwc;
-
-   int ret = -ENOMEM;
-
-   void __iomem*regs;
-   void*mem;
-
-   mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL);
-   if (!mem) {
-   dev_err(dev, not enough memory\n);
-   return -ENOMEM;
-   }
-   dwc = PTR_ALIGN(mem, DWC3_ALIGN_MASK + 1);
-   dwc-mem = mem;
-
-   res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-   if (!res) {
-   dev_err(dev, missing IRQ\n);
-   return -ENODEV;
-   }
-   dwc-xhci_resources[1].start = res-start;
-   dwc-xhci_resources[1].end = res-end;
-   dwc-xhci_resources[1].flags = res-flags;
-   dwc-xhci_resources[1].name = res-name;
-
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(dev, missing memory resource\n);
-   return -ENODEV;
-   }
+   int ret;
 
if (node) {
-   dwc-maximum_speed = of_usb_get_maximum_speed(node);
-
dwc-usb2_phy = devm_usb_get_phy_by_phandle(dev, usb-phy, 0);
dwc-usb3_phy = devm_usb_get_phy_by_phandle(dev, usb-phy, 1);
-
-   dwc-needs_fifo_resize = of_property_read_bool(node, 
tx-fifo-resize);
-   dwc-dr_mode = of_usb_get_dr_mode(node);
-   } else if (pdata) {
-   dwc-maximum_speed = pdata-maximum_speed;
-
-   dwc-usb2_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
-   dwc-usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3);
-
-   dwc-needs_fifo_resize = pdata-tx_fifo_resize;
-   dwc-dr_mode = pdata-dr_mode;
} else {
dwc-usb2_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
dwc-usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3);
}
 
-   /* default to superspeed if no maximum_speed passed */
-   if (dwc-maximum_speed == USB_SPEED_UNKNOWN)
-   dwc-maximum_speed = USB_SPEED_SUPER;
-
if (IS_ERR(dwc-usb2_phy)) {
ret = PTR_ERR(dwc-usb2_phy);
if (ret == -ENXIO || ret == -ENODEV) {
@@ -600,6 +550,69 @@ static int dwc3_probe(struct platform_device *pdev)
}
}
 
+   return 0;
+}
+
+#define DWC3_ALIGN_MASK(16 - 1)
+
+static int dwc3_probe(struct platform_device *pdev)
+{
+   struct device   *dev = pdev-dev;
+   struct dwc3_platform_data *pdata = dev_get_platdata(dev);
+   struct device_node  *node = dev-of_node;
+   struct resource *res;
+   struct dwc3 *dwc;
+
+   int ret = -ENOMEM;
+
+   void __iomem*regs;
+   void*mem;
+
+   mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL);
+   if (!mem) {
+   dev_err(dev, not enough memory\n);
+   return -ENOMEM;
+   }
+   dwc = PTR_ALIGN(mem, DWC3_ALIGN_MASK + 1);
+   dwc-mem = mem;
+   dwc-dev = dev;
+
+   res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+   if (!res) {
+   dev_err(dev, missing IRQ\n);
+   return -ENODEV;
+   }
+   dwc-xhci_resources[1].start = res-start;
+   dwc-xhci_resources[1].end = res-end;
+   dwc-xhci_resources[1].flags = res-flags;
+   dwc-xhci_resources[1].name = res-name;
+
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (!res) {
+   dev_err(dev, missing memory resource\n);
+   return -ENODEV;
+   }
+
+   if (node) {
+   dwc-maximum_speed = of_usb_get_maximum_speed(node);
+
+   dwc-needs_fifo_resize = of_property_read_bool(node, 
tx-fifo-resize);
+   dwc-dr_mode = of_usb_get_dr_mode(node);
+   } else if (pdata) {
+   dwc-maximum_speed = pdata-maximum_speed;
+
+   dwc-needs_fifo_resize 

[PATCH 4/8] usb: gadget: only GPL drivers in the gadget and phy framework

2014-04-16 Thread Felipe Balbi
We only support GPL drivers in the USB Gadget Framework,
it sounds correct to make all exported symbols GPL too.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/configfs.c   |  2 +-
 drivers/usb/gadget/f_fs.c   |  6 ++---
 drivers/usb/gadget/f_rndis.c|  2 +-
 drivers/usb/gadget/rndis.c  | 28 ++--
 drivers/usb/gadget/storage_common.c | 52 ++---
 drivers/usb/gadget/u_ether.c| 32 +++
 drivers/usb/gadget/u_f.c|  2 +-
 drivers/usb/phy/phy-generic.c   |  4 +--
 8 files changed, 64 insertions(+), 64 deletions(-)

diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index 7d1cc01..dcead55 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -1005,7 +1005,7 @@ void unregister_gadget_item(struct config_item *item)
 
unregister_gadget(gi);
 }
-EXPORT_SYMBOL(unregister_gadget_item);
+EXPORT_SYMBOL_GPL(unregister_gadget_item);
 
 static int __init gadget_cfs_init(void)
 {
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index 2e164dc..a01b3bd 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -190,7 +190,7 @@ ffs_sb_create_file(struct super_block *sb, const char 
*name, void *data,
 /* Devices management ***/
 
 DEFINE_MUTEX(ffs_lock);
-EXPORT_SYMBOL(ffs_lock);
+EXPORT_SYMBOL_GPL(ffs_lock);
 
 static struct ffs_dev *_ffs_find_dev(const char *name);
 static struct ffs_dev *_ffs_alloc_dev(void);
@@ -2876,7 +2876,7 @@ int ffs_name_dev(struct ffs_dev *dev, const char *name)
 
return ret;
 }
-EXPORT_SYMBOL(ffs_name_dev);
+EXPORT_SYMBOL_GPL(ffs_name_dev);
 
 int ffs_single_dev(struct ffs_dev *dev)
 {
@@ -2893,7 +2893,7 @@ int ffs_single_dev(struct ffs_dev *dev)
ffs_dev_unlock();
return ret;
 }
-EXPORT_SYMBOL(ffs_single_dev);
+EXPORT_SYMBOL_GPL(ffs_single_dev);
 
 /*
  * ffs_lock must be taken by the caller of this function
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c
index c11761c..139bc9c 100644
--- a/drivers/usb/gadget/f_rndis.c
+++ b/drivers/usb/gadget/f_rndis.c
@@ -834,7 +834,7 @@ void rndis_borrow_net(struct usb_function_instance *f, 
struct net_device *net)
opts-borrowed_net = opts-bound = true;
opts-net = net;
 }
-EXPORT_SYMBOL(rndis_borrow_net);
+EXPORT_SYMBOL_GPL(rndis_borrow_net);
 
 static inline struct f_rndis_opts *to_f_rndis_opts(struct config_item *item)
 {
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index d822d82..4c36694 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -760,7 +760,7 @@ int rndis_signal_connect(int configNr)
return rndis_indicate_status_msg(configNr,
  RNDIS_STATUS_MEDIA_CONNECT);
 }
-EXPORT_SYMBOL(rndis_signal_connect);
+EXPORT_SYMBOL_GPL(rndis_signal_connect);
 
 int rndis_signal_disconnect(int configNr)
 {
@@ -769,7 +769,7 @@ int rndis_signal_disconnect(int configNr)
return rndis_indicate_status_msg(configNr,
  RNDIS_STATUS_MEDIA_DISCONNECT);
 }
-EXPORT_SYMBOL(rndis_signal_disconnect);
+EXPORT_SYMBOL_GPL(rndis_signal_disconnect);
 
 void rndis_uninit(int configNr)
 {
@@ -784,13 +784,13 @@ void rndis_uninit(int configNr)
while ((buf = rndis_get_next_response(configNr, length)))
rndis_free_response(configNr, buf);
 }
-EXPORT_SYMBOL(rndis_uninit);
+EXPORT_SYMBOL_GPL(rndis_uninit);
 
 void rndis_set_host_mac(int configNr, const u8 *addr)
 {
rndis_per_dev_params[configNr].host_mac = addr;
 }
-EXPORT_SYMBOL(rndis_set_host_mac);
+EXPORT_SYMBOL_GPL(rndis_set_host_mac);
 
 /*
  * Message Parser
@@ -873,7 +873,7 @@ int rndis_msg_parser(u8 configNr, u8 *buf)
 
return -ENOTSUPP;
 }
-EXPORT_SYMBOL(rndis_msg_parser);
+EXPORT_SYMBOL_GPL(rndis_msg_parser);
 
 int rndis_register(void (*resp_avail)(void *v), void *v)
 {
@@ -895,7 +895,7 @@ int rndis_register(void (*resp_avail)(void *v), void *v)
 
return -ENODEV;
 }
-EXPORT_SYMBOL(rndis_register);
+EXPORT_SYMBOL_GPL(rndis_register);
 
 void rndis_deregister(int configNr)
 {
@@ -904,7 +904,7 @@ void rndis_deregister(int configNr)
if (configNr = RNDIS_MAX_CONFIGS) return;
rndis_per_dev_params[configNr].used = 0;
 }
-EXPORT_SYMBOL(rndis_deregister);
+EXPORT_SYMBOL_GPL(rndis_deregister);
 
 int rndis_set_param_dev(u8 configNr, struct net_device *dev, u16 *cdc_filter)
 {
@@ -918,7 +918,7 @@ int rndis_set_param_dev(u8 configNr, struct net_device 
*dev, u16 *cdc_filter)
 
return 0;
 }
-EXPORT_SYMBOL(rndis_set_param_dev);
+EXPORT_SYMBOL_GPL(rndis_set_param_dev);
 
 int rndis_set_param_vendor(u8 configNr, u32 vendorID, const char *vendorDescr)
 {
@@ -931,7 +931,7 @@ int rndis_set_param_vendor(u8 configNr, u32 vendorID, const 
char *vendorDescr)
 
return 0;
 }

[PATCH 0/8] usb: generic cleanup patches

2014-04-16 Thread Felipe Balbi
Hi folks,

I have been playing with following patches today and
I think they're ready to be queued up for v3.16 but
I wanted to get some comments/test results before
I apply them to my 'next' branch.

Thanks

Felipe Balbi (8):
  usb: dwc3: gadget: clear stall when disabling endpoint
  usb: dwc3: core: refactor PHY initialization
  usb: dwc3: core: refactor mode initialization to its own function
  usb: gadget: only GPL drivers in the gadget and phy framework
  usb: phy: rename usb_nop_xceiv to usb_phy_generic
  usb: phy: rename linux/usb/usb_phy_gen_xceiv.h to
linux/usb/usb_phy_generic.h
  usb: musb: move usb_phy_generic_{un,}register calls to
probe()/remove()
  usb: phy: generic: allow multiples calls to usb_phy_generic_register()

 drivers/usb/dwc3/core.c| 253 +++--
 drivers/usb/dwc3/dwc3-exynos.c |   8 +-
 drivers/usb/dwc3/dwc3-pci.c|   8 +-
 drivers/usb/dwc3/gadget.c  |   4 +
 drivers/usb/gadget/configfs.c  |   2 +-
 drivers/usb/gadget/f_fs.c  |   6 +-
 drivers/usb/gadget/f_rndis.c   |   2 +-
 drivers/usb/gadget/rndis.c |  28 +--
 drivers/usb/gadget/storage_common.c|  52 ++---
 drivers/usb/gadget/u_ether.c   |  32 +--
 drivers/usb/gadget/u_f.c   |   2 +-
 drivers/usb/musb/am35x.c   |  14 +-
 drivers/usb/musb/blackfin.c|  14 +-
 drivers/usb/musb/da8xx.c   |  16 +-
 drivers/usb/musb/davinci.c |   8 +-
 drivers/usb/musb/musb_dsps.c   |   2 +-
 drivers/usb/musb/tusb6010.c|   8 +-
 drivers/usb/phy/phy-am335x.c   |   4 +-
 drivers/usb/phy/phy-generic.c  |  65 +++---
 drivers/usb/phy/phy-generic.h  |   8 +-
 drivers/usb/phy/phy-keystone.c |   4 +-
 .../usb/{usb_phy_gen_xceiv.h = usb_phy_generic.h} |  10 +-
 22 files changed, 289 insertions(+), 261 deletions(-)
 rename include/linux/usb/{usb_phy_gen_xceiv.h = usb_phy_generic.h} (62%)

-- 
1.9.2.459.g68773ac

--
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: [GIT PULL v2 FOR v3.16] OMAP IOMMU fixes

2014-04-16 Thread Laurent Pinchart
Hi Joerg,

On Wednesday 16 April 2014 21:31:58 Joerg Roedel wrote:
 On Wed, Apr 16, 2014 at 04:51:56PM +0200, Laurent Pinchart wrote:
  The following changes since commit 
c9eaa447e77efe77b7fa4c953bd62de8297fd6c5:
Linux 3.15-rc1 (2014-04-13 14:18:35 -0700)
  
  are available in the git repository at:
git://linuxtv.org/pinchartl/media.git iommu/omap
  
  for you to fetch changes up to 286f600bc890347f7ec7bd50d33210d53a9095a3:
iommu/omap: Fix map protection value handling (2014-04-16 16:30:18
+0200)
  
  Compared to the v1 pull request, the patches have been rebased directly on
  top of v3.15-rc1.
  
  
  
  Laurent Pinchart (3):
iommu/omap: Fix 'no page for' debug message in flush_iotlb_page()
iommu/omap: Remove comment about supporting single page mappings
only
iommu/omap: Fix map protection value handling
  
  Suman Anna (3):
iommu/omap: Correct init value of iotlb_entry valid field
iommu/omap: Remove omap_iommu_domain_has_cap() function
iommu/omap: Move to_iommu definition from omap-iopgtable.h
   
   drivers/iommu/omap-iommu.c | 31 ---
   drivers/iommu/omap-iopgtable.h |  3 ---
   2 files changed, 12 insertions(+), 22 deletions(-)
 
 Pulled, thanks Laurent. You can use the arm/omap branch to base your
 work on (when I pushed it, which will probably happen tomorrow).

Thank you.

-- 
Regards,

Laurent Pinchart

--
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/9] dmtimer code clean-up first pass

2014-04-16 Thread Joel Fernandes
Here are some minor cleanups for dmtimer code in preparation for moving it out
to drivers.

There is OMAP1 specific dmtimer code earlier, that are handled in mach-omap1
directly now.   Other than this, few functions and code has been refactored to
reduce redundancy and some minor cleanups.

OMAP1 hasn't been tested so I welcome anyone with HW to test this.

Joel Fernandes (9):
  ARM: OMAP: dmtimer: Remove setting of clk parent indirectly through
platform hook
  ARM: OMAP: dmtimer: Add comments on OMAP1 clock framework
  ARM: OMAP: dmtimer: Add note to set parent from DT
  ARM: OMAP: dmtimer: Add function to check if timer is running
  ARM: OMAP1: dmtimer: Rewrite modify of IDLECT mask to use new
is_running function
  ARM: OMAP: dmtimer: Add a write_ctrl function to simplify bit setting
  ARM: OMAP: dmtimer: Have __omap_dm_timer_load_start set ST bit in
CTRL instead of caller
  ARM: OMAP: dmtimer: Add function to check for timer availability
  ARM: OMAP: dmtimer: Get rid of check for mem resource error

 arch/arm/mach-omap1/include/mach/hardware.h |2 +
 arch/arm/mach-omap1/timer.c |   34 -
 arch/arm/mach-omap2/timer.c |6 +-
 arch/arm/plat-omap/dmtimer.c|  185 +--
 arch/arm/plat-omap/include/plat/dmtimer.h   |4 +-
 include/linux/platform_data/dmtimer-omap.h  |2 -
 6 files changed, 129 insertions(+), 104 deletions(-)

-- 
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 2/9] ARM: OMAP: dmtimer: Add comments on OMAP1 clock framework

2014-04-16 Thread Joel Fernandes
OMAP1 doesn't support clock framework, add a comment where needed
and correct a FIXME.

Signed-off-by: Joel Fernandes jo...@ti.com
---
 arch/arm/plat-omap/dmtimer.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index ecd3f97..f5a674c 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -142,8 +142,7 @@ static int omap_dm_timer_prepare(struct omap_dm_timer 
*timer)
int rc;
 
/*
-* FIXME: OMAP1 devices do not use the clock framework for dmtimers so
-* do not call clk_get() for these devices.
+* Do not call clk_get() for OMAP1 due to no clock framework support.
 */
if (!(timer-capability  OMAP_TIMER_NEEDS_RESET)) {
timer-fclk = clk_get(timer-pdev-dev, fck);
@@ -461,6 +460,7 @@ int omap_dm_timer_stop(struct omap_dm_timer *timer)
if (unlikely(!timer))
return -EINVAL;
 
+   /* OMAP1 is not converted to clk framework so avoid clk_get_rate here */
if (!(timer-capability  OMAP_TIMER_NEEDS_RESET))
rate = clk_get_rate(timer-fclk);
 
-- 
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 7/9] ARM: OMAP: dmtimer: Have __omap_dm_timer_load_start set ST bit in CTRL instead of caller

2014-04-16 Thread Joel Fernandes
load_start implies start, so it makes sense to set the ST bit in
__omap_dm_timer_load_start instead of callers.

Signed-off-by: Joel Fernandes jo...@ti.com
---
 arch/arm/mach-omap2/timer.c   |6 +++---
 arch/arm/plat-omap/dmtimer.c  |1 -
 arch/arm/plat-omap/include/plat/dmtimer.h |1 +
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 74044aa..dfb19df 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -95,7 +95,7 @@ static struct irqaction omap2_gp_timer_irq = {
 static int omap2_gp_timer_set_next_event(unsigned long cycles,
 struct clock_event_device *evt)
 {
-   __omap_dm_timer_load_start(clkev, OMAP_TIMER_CTRL_ST,
+   __omap_dm_timer_load_start(clkev, 0,
   0x - cycles, OMAP_TIMER_POSTED);
 
return 0;
@@ -116,7 +116,7 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode 
mode,
__omap_dm_timer_write(clkev, OMAP_TIMER_LOAD_REG,
  0x - period, OMAP_TIMER_POSTED);
__omap_dm_timer_load_start(clkev,
-   OMAP_TIMER_CTRL_AR | OMAP_TIMER_CTRL_ST,
+   OMAP_TIMER_CTRL_AR,
0x - period, OMAP_TIMER_POSTED);
break;
case CLOCK_EVT_MODE_ONESHOT:
@@ -469,7 +469,7 @@ static void __init omap2_gptimer_clocksource_init(int 
gptimer_id,
BUG_ON(res);
 
__omap_dm_timer_load_start(clksrc,
-  OMAP_TIMER_CTRL_ST | OMAP_TIMER_CTRL_AR, 0,
+  OMAP_TIMER_CTRL_AR, 0,
   OMAP_TIMER_NONPOSTED);
sched_clock_register(dmtimer_read_sched_clock, 32, clksrc.rate);
 
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 782ff10..8a4a97c 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -573,7 +573,6 @@ int omap_dm_timer_set_load_start(struct omap_dm_timer 
*timer, int autoreload,
} else {
l = ~OMAP_TIMER_CTRL_AR;
}
-   l |= OMAP_TIMER_CTRL_ST;
 
__omap_dm_timer_load_start(timer, l, load, timer-posted);
 
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h 
b/arch/arm/plat-omap/include/plat/dmtimer.h
index 16ea9fd..fe3780a 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -393,6 +393,7 @@ static inline void __omap_dm_timer_load_start(struct 
omap_dm_timer *timer,
u32 ctrl, unsigned int load,
int posted)
 {
+   ctrl |= OMAP_TIMER_CTRL_ST;
__omap_dm_timer_write(timer, OMAP_TIMER_COUNTER_REG, load, posted);
__omap_dm_timer_write(timer, OMAP_TIMER_CTRL_REG, ctrl, posted);
 }
-- 
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 9/9] ARM: OMAP: dmtimer: Get rid of check for mem resource error

2014-04-16 Thread Joel Fernandes
The subsequent devm_ioremap_resource will catch it and print an error, let it
be checked there.

Signed-off-by: Joel Fernandes jo...@ti.com
---
 arch/arm/plat-omap/dmtimer.c |4 
 1 file changed, 4 deletions(-)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 7e806f9..1fd30fa 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -810,10 +810,6 @@ static int omap_dm_timer_probe(struct platform_device 
*pdev)
}
 
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (unlikely(!mem)) {
-   dev_err(dev, %s: no memory resource.\n, __func__);
-   return -ENODEV;
-   }
 
timer = devm_kzalloc(dev, sizeof(struct omap_dm_timer), GFP_KERNEL);
if (!timer) {
-- 
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 4/9] ARM: OMAP: dmtimer: Add function to check if timer is running

2014-04-16 Thread Joel Fernandes
Inorder to move non-DM timer specific code that modifies the idlect
mask on OMAP1, from dmtimer code, to OMAP1 specific timer initialization code,
we introduce a new function that can possibly be reused for other purposes in
the future. The function just checks if a timer is running based on the timer ID
which should be same as pdev-id. This allows us to cleanly separate the timer 
vs
non-timer bits and keep the timer bits in the dmtimer code.

Signed-off-by: Joel Fernandes jo...@ti.com
---
 arch/arm/plat-omap/dmtimer.c  |   29 +
 arch/arm/plat-omap/include/plat/dmtimer.h |2 ++
 2 files changed, 31 insertions(+)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 4debb3d..86b2641 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -187,6 +187,35 @@ int omap_dm_timer_reserve_systimer(int id)
return 0;
 }
 
+/*
+ * Check if a timer is running based on timer_id, used for OMAP1 currently.
+ */
+int omap_dm_timer_is_running(int timer_id)
+{
+   int i = 1, ret = 0;
+   struct omap_dm_timer *timer = NULL;
+   unsigned long flags;
+
+   spin_lock_irqsave(dm_timer_lock, flags);
+   list_for_each_entry(timer, omap_timer_list, node) {
+   if (i == timer_id) {
+   u32 l;
+   l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
+   if (l  OMAP_TIMER_CTRL_ST) {
+   ret = 1;
+   goto done;
+   } else {
+   goto done;
+   }
+   }
+   i++;
+   }
+done:
+   spin_unlock_irqrestore(dm_timer_lock, flags);
+   return ret;
+}
+EXPORT_SYMBOL_GPL(omap_dm_timer_is_running);
+
 static struct omap_dm_timer *_omap_dm_timer_request(int req_type, void *data)
 {
struct omap_dm_timer *timer = NULL, *t;
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h 
b/arch/arm/plat-omap/include/plat/dmtimer.h
index 2861b15..41df0a6 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -135,6 +135,8 @@ void omap_dm_timer_disable(struct omap_dm_timer *timer);
 
 int omap_dm_timer_get_irq(struct omap_dm_timer *timer);
 
+int omap_dm_timer_is_running(int timer_id);
+
 u32 omap_dm_timer_modify_idlect_mask(u32 inputmask);
 struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer);
 
-- 
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 5/9] ARM: OMAP1: dmtimer: Rewrite modify of IDLECT mask to use new is_running function

2014-04-16 Thread Joel Fernandes
While at it, also delete the old definition of the function in dmtimer.c code.
This completes the separation and removal of OMAP1 header dependency in dmtimer
code and removes references to MOD_CONF_CTRL registers in dmtimer.

Signed-off-by: Joel Fernandes jo...@ti.com
---
 arch/arm/mach-omap1/include/mach/hardware.h |2 ++
 arch/arm/mach-omap1/timer.c |   26 +++
 arch/arm/plat-omap/dmtimer.c|   48 ---
 arch/arm/plat-omap/include/plat/dmtimer.h   |1 -
 4 files changed, 28 insertions(+), 49 deletions(-)

diff --git a/arch/arm/mach-omap1/include/mach/hardware.h 
b/arch/arm/mach-omap1/include/mach/hardware.h
index 5875a50..46de040 100644
--- a/arch/arm/mach-omap1/include/mach/hardware.h
+++ b/arch/arm/mach-omap1/include/mach/hardware.h
@@ -70,6 +70,8 @@ static inline u32 omap_cs3_phys(void)
? 0 : OMAP_CS3_PHYS;
 }
 
+__u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask);
+
 #endif /* ifndef __ASSEMBLER__ */
 
 #define OMAP1_IO_OFFSET0x0100  /* Virtual IO = 
0xfefb */
diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
index 4b9c604..0a039f1 100644
--- a/arch/arm/mach-omap1/timer.c
+++ b/arch/arm/mach-omap1/timer.c
@@ -42,6 +42,32 @@
 
 #define OMAP1_DM_TIMER_COUNT   8
 
+/**
+ * omap_dm_timer_modify_idlect_mask - Check if any running timers use ARMXOR
+ * @inputmask: current value of idlect mask
+ */
+__u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
+{
+   int i;
+
+   /* If ARMXOR cannot be idled this function call is unnecessary */
+   if (!(inputmask  (1  1)))
+   return inputmask;
+
+   for (i = 1; i = OMAP1_DM_TIMER_COUNT; i++) {
+   if (omap_dm_timer_is_running(i)) {
+   if (((omap_readl(MOD_CONF_CTRL_1)  ((i-1) * 2))
+  0x03) == 0)
+   inputmask = ~(1  1);
+   else
+   inputmask = ~(1  2);
+   }
+   i++;
+   }
+
+   return inputmask;
+}
+
 static int omap1_dm_timer_set_src(struct platform_device *pdev,
int source)
 {
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 86b2641..0e96ad2 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -397,44 +397,6 @@ int omap_dm_timer_get_irq(struct omap_dm_timer *timer)
 }
 EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq);
 
-#if defined(CONFIG_ARCH_OMAP1)
-#include mach/hardware.h
-/**
- * omap_dm_timer_modify_idlect_mask - Check if any running timers use ARMXOR
- * @inputmask: current value of idlect mask
- */
-__u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
-{
-   int i = 0;
-   struct omap_dm_timer *timer = NULL;
-   unsigned long flags;
-
-   /* If ARMXOR cannot be idled this function call is unnecessary */
-   if (!(inputmask  (1  1)))
-   return inputmask;
-
-   /* If any active timer is using ARMXOR return modified mask */
-   spin_lock_irqsave(dm_timer_lock, flags);
-   list_for_each_entry(timer, omap_timer_list, node) {
-   u32 l;
-
-   l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
-   if (l  OMAP_TIMER_CTRL_ST) {
-   if (((omap_readl(MOD_CONF_CTRL_1)  (i * 2))  0x03) 
== 0)
-   inputmask = ~(1  1);
-   else
-   inputmask = ~(1  2);
-   }
-   i++;
-   }
-   spin_unlock_irqrestore(dm_timer_lock, flags);
-
-   return inputmask;
-}
-EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask);
-
-#else
-
 struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
 {
if (timer  !IS_ERR(timer-fclk))
@@ -443,16 +405,6 @@ struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer 
*timer)
 }
 EXPORT_SYMBOL_GPL(omap_dm_timer_get_fclk);
 
-__u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
-{
-   BUG();
-
-   return 0;
-}
-EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask);
-
-#endif
-
 int omap_dm_timer_trigger(struct omap_dm_timer *timer)
 {
if (unlikely(!timer || pm_runtime_suspended(timer-pdev-dev))) {
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h 
b/arch/arm/plat-omap/include/plat/dmtimer.h
index 41df0a6..16ea9fd 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -137,7 +137,6 @@ int omap_dm_timer_get_irq(struct omap_dm_timer *timer);
 
 int omap_dm_timer_is_running(int timer_id);
 
-u32 omap_dm_timer_modify_idlect_mask(u32 inputmask);
 struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer);
 
 int omap_dm_timer_trigger(struct omap_dm_timer *timer);
-- 
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  

[PATCH 8/9] ARM: OMAP: dmtimer: Add function to check for timer availability

2014-04-16 Thread Joel Fernandes
Simplify the check for a timer availability in atleast 4 places by providing a
function to do the same.

Signed-off-by: Joel Fernandes jo...@ti.com
---
 arch/arm/plat-omap/dmtimer.c |   24 ++--
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 8a4a97c..7e806f9 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -704,14 +704,22 @@ int omap_dm_timer_set_int_disable(struct omap_dm_timer 
*timer, u32 mask)
 }
 EXPORT_SYMBOL_GPL(omap_dm_timer_set_int_disable);
 
+static int is_timer_available(struct omap_dm_timer *timer)
+{
+   if (unlikely(!timer || pm_runtime_suspended(timer-pdev-dev))) {
+   pr_err(Timer not available or enabled.\n);
+   WARN_ON(1);
+   return 0;
+   }
+   return 1;
+}
+
 unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer)
 {
unsigned int l;
 
-   if (unlikely(!timer || pm_runtime_suspended(timer-pdev-dev))) {
-   pr_err(%s: timer not available or enabled.\n, __func__);
+   if (!is_timer_available(timer))
return 0;
-   }
 
l = __raw_readl(timer-irq_stat);
 
@@ -721,7 +729,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_read_status);
 
 int omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value)
 {
-   if (unlikely(!timer || pm_runtime_suspended(timer-pdev-dev)))
+   if (!is_timer_available(timer))
return -EINVAL;
 
__omap_dm_timer_write_status(timer, value);
@@ -732,10 +740,8 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_write_status);
 
 unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer)
 {
-   if (unlikely(!timer || pm_runtime_suspended(timer-pdev-dev))) {
-   pr_err(%s: timer not iavailable or enabled.\n, __func__);
+   if (!is_timer_available(timer))
return 0;
-   }
 
return __omap_dm_timer_read_counter(timer, timer-posted);
 }
@@ -743,10 +749,8 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_read_counter);
 
 int omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int 
value)
 {
-   if (unlikely(!timer || pm_runtime_suspended(timer-pdev-dev))) {
-   pr_err(%s: timer not available or enabled.\n, __func__);
+   if (!is_timer_available(timer))
return -EINVAL;
-   }
 
omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, value);
 
-- 
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 1/9] ARM: OMAP: dmtimer: Remove setting of clk parent indirectly through platform hook

2014-04-16 Thread Joel Fernandes
There is a platform specific hook just for OMAP1 to set its clk parent.  Remove
this hook and have OMAP1 set its parent in omap1_dm_timer_init.  If OMAP1 is
ever migrated to clock framework, the correct way to do this would be through
clk_set_parent like other platforms.

Signed-off-by: Joel Fernandes jo...@ti.com
---
 arch/arm/mach-omap1/timer.c|8 +++-
 arch/arm/plat-omap/dmtimer.c   |8 +++-
 include/linux/platform_data/dmtimer-omap.h |2 --
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
index bde7a35..4b9c604 100644
--- a/arch/arm/mach-omap1/timer.c
+++ b/arch/arm/mach-omap1/timer.c
@@ -140,7 +140,13 @@ static int __init omap1_dm_timer_init(void)
goto err_free_pdata;
}
 
-   pdata-set_timer_src = omap1_dm_timer_set_src;
+   /*
+* Since OMAP1 doesn't support clock framework, set timer clock
+* source to 32KHz here instead of expecting it to be set by
+* dmtimer code.
+*/
+   omap1_dm_timer_set_src(pdev, 0x01);
+
pdata-timer_capability = OMAP_TIMER_ALWON |
OMAP_TIMER_NEEDS_RESET | OMAP_TIMER_HAS_DSP_IRQ;
 
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 869254c..ecd3f97 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -494,12 +494,10 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, 
int source)
return -EINVAL;
 
/*
-* FIXME: Used for OMAP1 devices only because they do not currently
-* use the clock framework to set the parent clock. To be removed
-* once OMAP1 migrated to using clock framework for dmtimers
+* For OMAP1, timer source is already set during omap1_dm_timer_init.
 */
-   if (pdata  pdata-set_timer_src)
-   return pdata-set_timer_src(timer-pdev, source);
+   if (timer-capability  OMAP_TIMER_NEEDS_RESET)
+   return 0;
 
if (IS_ERR(timer-fclk))
return -EINVAL;
diff --git a/include/linux/platform_data/dmtimer-omap.h 
b/include/linux/platform_data/dmtimer-omap.h
index a19b78d..9f42b06 100644
--- a/include/linux/platform_data/dmtimer-omap.h
+++ b/include/linux/platform_data/dmtimer-omap.h
@@ -21,8 +21,6 @@
 #define __PLATFORM_DATA_DMTIMER_OMAP_H__
 
 struct dmtimer_platform_data {
-   /* set_timer_src - Only used for OMAP1 devices */
-   int (*set_timer_src)(struct platform_device *pdev, int source);
u32 timer_capability;
u32 timer_errata;
int (*get_context_loss_count)(struct device *);
-- 
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 6/9] ARM: OMAP: dmtimer: Add a write_ctrl function to simplify bit setting

2014-04-16 Thread Joel Fernandes
A common pattern in dmtimer code is to read the control reg, set and reset
certain bits, and write it back. We abstract this pattern and introduce a
new function to do so.

Signed-off-by: Joel Fernandes jo...@ti.com
---
 arch/arm/plat-omap/dmtimer.c |   63 --
 1 file changed, 36 insertions(+), 27 deletions(-)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 0e96ad2..782ff10 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -91,6 +91,18 @@ static void omap_dm_timer_write_reg(struct omap_dm_timer 
*timer, u32 reg,
__omap_dm_timer_write(timer, reg, value, timer-posted);
 }
 
+static u32 omap_dm_timer_write_ctrl(struct omap_dm_timer *timer, u32 mask,
+   u32 value)
+{
+   u32 l;
+
+   l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
+   l = mask;
+   l |= value;
+   omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
+   return l;
+}
+
 static void omap_timer_restore_context(struct omap_dm_timer *timer)
 {
omap_dm_timer_write_reg(timer, OMAP_TIMER_WAKEUP_EN_REG,
@@ -521,23 +533,22 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_set_source);
 int omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload,
unsigned int load)
 {
-   u32 l;
+   u32 mask = ~0, val = 0;
 
if (unlikely(!timer))
return -EINVAL;
 
omap_dm_timer_enable(timer);
-   l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
if (autoreload)
-   l |= OMAP_TIMER_CTRL_AR;
+   val |= OMAP_TIMER_CTRL_AR;
else
-   l = ~OMAP_TIMER_CTRL_AR;
-   omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
+   mask = ~OMAP_TIMER_CTRL_AR;
+   val = omap_dm_timer_write_ctrl(timer, mask, val);
omap_dm_timer_write_reg(timer, OMAP_TIMER_LOAD_REG, load);
 
omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0);
/* Save the context */
-   timer-context.tclr = l;
+   timer-context.tclr = val;
timer-context.tldr = load;
omap_dm_timer_disable(timer);
return 0;
@@ -577,22 +588,22 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_set_load_start);
 int omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable,
 unsigned int match)
 {
-   u32 l;
+   u32 mask = ~0, val = 0;
 
if (unlikely(!timer))
return -EINVAL;
 
omap_dm_timer_enable(timer);
-   l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
if (enable)
-   l |= OMAP_TIMER_CTRL_CE;
+   val |= OMAP_TIMER_CTRL_CE;
else
-   l = ~OMAP_TIMER_CTRL_CE;
+   mask = ~OMAP_TIMER_CTRL_CE;
+
omap_dm_timer_write_reg(timer, OMAP_TIMER_MATCH_REG, match);
-   omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
+   val = omap_dm_timer_write_ctrl(timer, mask, val);
 
/* Save the context */
-   timer-context.tclr = l;
+   timer-context.tclr = val;
timer-context.tmar = match;
omap_dm_timer_disable(timer);
return 0;
@@ -602,24 +613,23 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_set_match);
 int omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on,
   int toggle, int trigger)
 {
-   u32 l;
+   u32 mask = ~0, val = 0;
 
if (unlikely(!timer))
return -EINVAL;
 
omap_dm_timer_enable(timer);
-   l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
-   l = ~(OMAP_TIMER_CTRL_GPOCFG | OMAP_TIMER_CTRL_SCPWM |
+   mask = ~(OMAP_TIMER_CTRL_GPOCFG | OMAP_TIMER_CTRL_SCPWM |
   OMAP_TIMER_CTRL_PT | (0x03  10));
if (def_on)
-   l |= OMAP_TIMER_CTRL_SCPWM;
+   val |= OMAP_TIMER_CTRL_SCPWM;
if (toggle)
-   l |= OMAP_TIMER_CTRL_PT;
-   l |= trigger  10;
-   omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
+   val |= OMAP_TIMER_CTRL_PT;
+   val |= trigger  10;
+   val = omap_dm_timer_write_ctrl(timer, mask, val);
 
/* Save the context */
-   timer-context.tclr = l;
+   timer-context.tclr = val;
omap_dm_timer_disable(timer);
return 0;
 }
@@ -627,22 +637,21 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_set_pwm);
 
 int omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler)
 {
-   u32 l;
+   u32 mask = ~0, val = 0;
 
if (unlikely(!timer))
return -EINVAL;
 
omap_dm_timer_enable(timer);
-   l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
-   l = ~(OMAP_TIMER_CTRL_PRE | (0x07  2));
+   mask = ~(OMAP_TIMER_CTRL_PRE | (0x07  2));
if (prescaler = 0x00  prescaler = 0x07) {
-   l |= OMAP_TIMER_CTRL_PRE;
-   l |= prescaler  2;
+   val |= OMAP_TIMER_CTRL_PRE;
+   val |= prescaler  2;
}
-  

[PATCH 3/9] ARM: OMAP: dmtimer: Add note to set parent from DT

2014-04-16 Thread Joel Fernandes
Once clock-parents or default-parent support for DT clocks is available,
we should use it to set clock parent and turn clk_set_parent into a NOOP.

Signed-off-by: Joel Fernandes jo...@ti.com
---
 arch/arm/plat-omap/dmtimer.c |4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index f5a674c..4debb3d 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -165,6 +165,10 @@ static int omap_dm_timer_prepare(struct omap_dm_timer 
*timer)
__omap_dm_timer_enable_posted(timer);
omap_dm_timer_disable(timer);
 
+   /*
+* FIXME: Once DT clock-parents or set-parents support is upstream,
+* this is to become a NOOP.
+*/
return omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
 }
 
-- 
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] dmaengine: edma: No need save/restore interrupt flags during spin_lock in IRQ

2014-04-16 Thread Joel Fernandes
The vchan lock in edma_callback is acquired in hard interrupt context. As
interrupts are already disabled, there's no point in save/restoring interrupt
mask bit or cpsr flags.

Get rid of flags local variable and use spin_lock instead of spin_lock_irqsave.

Signed-off-by: Joel Fernandes jo...@ti.com
---
 drivers/dma/edma.c |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 91849aa..25a75e2 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -638,7 +638,6 @@ static void edma_callback(unsigned ch_num, u16 ch_status, 
void *data)
struct edma_chan *echan = data;
struct device *dev = echan-vchan.chan.device-dev;
struct edma_desc *edesc;
-   unsigned long flags;
struct edmacc_param p;
 
edesc = echan-edesc;
@@ -649,7 +648,7 @@ static void edma_callback(unsigned ch_num, u16 ch_status, 
void *data)
 
switch (ch_status) {
case EDMA_DMA_COMPLETE:
-   spin_lock_irqsave(echan-vchan.lock, flags);
+   spin_lock(echan-vchan.lock);
 
if (edesc) {
if (edesc-cyclic) {
@@ -665,11 +664,11 @@ static void edma_callback(unsigned ch_num, u16 ch_status, 
void *data)
}
}
 
-   spin_unlock_irqrestore(echan-vchan.lock, flags);
+   spin_unlock(echan-vchan.lock);
 
break;
case EDMA_DMA_CC_ERROR:
-   spin_lock_irqsave(echan-vchan.lock, flags);
+   spin_lock(echan-vchan.lock);
 
edma_read_slot(EDMA_CHAN_SLOT(echan-slot[0]), p);
 
@@ -700,7 +699,7 @@ static void edma_callback(unsigned ch_num, u16 ch_status, 
void *data)
edma_trigger_channel(echan-ch_num);
}
 
-   spin_unlock_irqrestore(echan-vchan.lock, flags);
+   spin_unlock(echan-vchan.lock);
 
break;
default:
-- 
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