[PATCH v3 3/4] drm/omap: fix: disable encoder before destroying it

2014-01-02 Thread Archit Taneja
Currently, an encoder is disabled only when an apply work is queued for the corresponding crtc. This works fine for the paths where userspace explicitly disables crtc, this results in disabling the omapdss device in the crtc's pre_apply function. However, when the omapdrm module is removed, there

[PATCH v3 1/4] drm/omap: fix: Defer probe if an omapdss device requests for it at connect

2014-01-02 Thread Archit Taneja
With the omapdss device model changes. omapdrm is required to call dssdriver's connect() op to register a panel. This is currently done in omap_modeset_init() A call to connect() can fail if the omapdss panels or the encoders(HDMI/DPI) they connect to have some resource(like regulators, I2C

[PATCH v3 4/4] drm/omap: fix: change dev_unload order

2014-01-02 Thread Archit Taneja
The current dev_unload order uninits the irqs too early. In the current sequence, it's possible that a crtc queues work(apply_worker) to display a buffer, which registers to omap_crtc_apply_irq to notfiy the completion of the configuration we applied. Calling drm_vblank_cleanup and

[PATCH v3 2/4] drm/omap: fix: disconnect devices when omapdrm module is removed

2014-01-02 Thread Archit Taneja
At omapdrm probe, we install manager ops and connect omapdss devices. This needs to be undone when omapdrm module is removed so that omapdss is in a clean state. This ensures that we can re-insert omapdrm module, or some other module which uses omapdss(like omapfb/omap_vout). Currently, omapdrm's

[PATCH v3 0/4] drm/omap: fix issues in omap_drv probe/remove

2014-01-02 Thread Archit Taneja
At the moment, the omapdrm driver doesn't work on panda/beagle when built-in the kernel. The problem is that omapdrm doesn't defer probe if resources like regulator/I2C etc are missing. The first patch fixes that. The next 3 patches make sure that omapdrm module can be inserted and removed

[PATCH RFC 00/26] Migrate more OMAP DMA code to DMA engine

2014-01-02 Thread Russell King - ARM Linux
The following patch series moves code to setup the DMA hardware and service interrupts from the hardware to the DMA engine driver. This reduces the dependency on the legacy DMA implementation. This series does not remove the channel allocation/freeing hooks which are used to manage the

[PATCH RFC 00/26] Migrate more OMAP DMA code to DMA engine

2014-01-02 Thread Russell King - ARM Linux
The following patch series moves code to setup the DMA hardware and service interrupts from the hardware to the DMA engine driver. This reduces the dependency on the legacy DMA implementation. This series does not remove the channel allocation/freeing hooks which are used to manage the

[PATCH RFC 19/26] ARM: omap: remove almost-const variables

2014-01-02 Thread Russell King
dma_stride and dma_common_ch_start are only ever initialised to one known value at initialisation, and are private to each of these files. There's no point these being variables at all. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/arm/mach-omap1/dma.c | 14 --

[PATCH RFC 18/26] ARM: omap: remove references to disable_irq_lch

2014-01-02 Thread Russell King
The disable_irq_lch method is never actually used, so there's not much point it existing; remove it. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/arm/mach-omap1/dma.c |1 - arch/arm/mach-omap2/dma.c | 10 -- include/linux/omap-dma.h |1 - 3 files changed, 0

[PATCH RFC 23/26] ARM: omap: dma: get rid of 'p' allocation and clean up

2014-01-02 Thread Russell King
The omap_system_dma_plat_info structure is only seven words, it's not worth the expense of kmalloc()'ing backing store for this only to release it later. Note that platform_device_add_data() copies the data anyway. Clean up the initialisation of this structure - we don't even need code to

[PATCH RFC 21/26] ARM: omap: dma: get rid of errata global

2014-01-02 Thread Russell King
There's no need for this to be a global variable; move it into the errata configuration function instead. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/arm/mach-omap1/dma.c |4 ++-- arch/arm/mach-omap2/dma.c |5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-)

[PATCH RFC 22/26] ARM: omap: move dma channel allocation into plat-omap code

2014-01-02 Thread Russell King
This really needs to be there, because otherwise the plat-omap code can kfree() this data structure, and then re-use the pointer later. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/arm/mach-omap1/dma.c | 11 --- arch/arm/mach-omap2/dma.c |7 ---

[PATCH RFC 20/26] ARM: omap: clean up DMA register accesses

2014-01-02 Thread Russell King
We can do much better with this by using a structure to describe each register, rather than code. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/arm/mach-omap1/dma.c | 121 + arch/arm/mach-omap2/dma.c | 99

[PATCH RFC 17/26] dmaengine: omap-dma: cleanup errata 3.3 handling

2014-01-02 Thread Russell King
Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c | 52 ++- 1 files changed, 29 insertions(+), 23 deletions(-) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index a1aefe9fe3fe..04631e6732c4 100644 ---

[PATCH RFC 24/26] dmaengine: omap-dma: move register read/writes into omap-dma.c

2014-01-02 Thread Russell King
Export the DMA register information from the SoC specific data, such that we can access the registers directly in omap-dma.c, mapping the register region ourselves as well. Rather than calculating the DMA channel register in its entirety for each access, we pre-calculate an offset base address

[PATCH RFC 25/26] dmaengine: omap-dma: move IRQ handling to omap-dma

2014-01-02 Thread Russell King
Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c | 121 +-- 1 files changed, 115 insertions(+), 6 deletions(-) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index 611963e82623..f219c9a4dab7 100644 ---

[PATCH RFC 26/26] ARM: omap2: ensure dma platform device has resources

2014-01-02 Thread Russell King
Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/arm/mach-omap2/dma.c | 16 ++-- 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c index e08e55a173b6..5689c88d986d 100644 ---

[PATCH RFC 04/26] dmaengine: omap-dma: consolidate writes to DMA registers

2014-01-02 Thread Russell King
There's no need to keep writing registers which don't change value in omap_dma_start_sg(). Move this into omap_dma_start_desc() and merge the register updates together. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c | 123

[PATCH RFC 03/26] dmaengine: omap-dma: program hardware directly

2014-01-02 Thread Russell King
Program the transfer parameters directly into the hardware, rather than using the functions in arch/arm/plat-omap/dma.c. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c | 144 - include/linux/omap-dma.h |6 +-

[PATCH RFC 10/26] dmaengine: omap-dma: move CCR buffering disable errata out of the fast path

2014-01-02 Thread Russell King
Since we record the CCR register in the dma transaction, we can move the processing of the iframe buffering errata out of the omap_dma_start(). Move it to the preparation functions. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c |7 +-- 1 files

[PATCH RFC 13/26] dmaengine: omap-dma: move clnk_ctrl setting to preparation functions

2014-01-02 Thread Russell King
Move the clnk_ctrl setup to the preparation functions, saving its value in the omap_desc. This only needs to be set once per descriptor, not for each segment, so set it in omap_dma_start_desc() rather than omap_dma_start(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk ---

[PATCH RFC 11/26] dmaengine: omap-dma: consolidate clearing channel status register

2014-01-02 Thread Russell King
Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c | 20 ++-- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index ba0e10db5185..574f38e3fead 100644 --- a/drivers/dma/omap-dma.c +++

[PATCH RFC 16/26] dmaengine: omap-dma: provide register read/write functions

2014-01-02 Thread Russell King
Provide a pair of channel register accessors, and a pair of global accessors for non-channel specific registers. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c | 102 --- 1 files changed, 61 insertions(+), 41

[PATCH RFC 07/26] dmaengine: omap-dma: consolidate setup of CSDP

2014-01-02 Thread Russell King
Consolidate the setup of the channel source destination parameters register. This way, we calculate the required CSDP value when we setup a transfer descriptor, and only write it to the device registers once when we start the descriptor. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk

[PATCH RFC 01/26] dmaengine: omap-dma: use devm_kzalloc() to allocate omap_dmadev.

2014-01-02 Thread Russell King
Use devm_kzalloc() to allocate omap_dmadev() so that we don't need complex error cleanup paths. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/dma/omap-dma.c

[PATCH RFC 12/26] dmaengine: omap-dma: improve efficiency loading C.SA/C.EI/C.FI registers

2014-01-02 Thread Russell King
Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c | 32 1 files changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index 574f38e3fead..b4700e1f7c57 100644 ---

[PATCH RFC 15/26] dmaengine: omap-dma: use cached CCR value when enabling DMA

2014-01-02 Thread Russell King
We don't need to read-modify-write the CCR register; we already know what value it should contain at this point. Use the cached CCR value when setting the enable bit. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c |6 ++ 1 files changed, 2

[PATCH RFC 09/26] dmaengine: omap-dma: provide register definitions

2014-01-02 Thread Russell King
Provide our own set of more complete register definitions; this allows us to get rid of the meaningless 1 n constants scattered throughout this code. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c | 166 +--- 1

[PATCH RFC 01/26] dmaengine: omap-dma: use devm_kzalloc() to allocate omap_dmadev.

2014-01-02 Thread Russell King
Use devm_kzalloc() to allocate omap_dmadev() so that we don't need complex error cleanup paths. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/dma/omap-dma.c

[PATCH RFC 05/26] dmaengine: omap-dma: control start/stop directly

2014-01-02 Thread Russell King
Program the non-cyclic mode DMA start/stop directly, rather than via arch/arm/plat-omap/dma.c. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c | 152 --- 1 files changed, 142 insertions(+), 10 deletions(-) diff

[PATCH RFC 04/26] dmaengine: omap-dma: consolidate writes to DMA registers

2014-01-02 Thread Russell King
There's no need to keep writing registers which don't change value in omap_dma_start_sg(). Move this into omap_dma_start_desc() and merge the register updates together. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c | 123

[PATCH RFC 14/26] dmaengine: omap-dma: move barrier to omap_dma_start_desc()

2014-01-02 Thread Russell King
We don't need to issue a barrier for every segment of a DMA transfer; doing this just once per descriptor will do. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git

[PATCH RFC 08/26] dmaengine: omap-dma: consolidate setup of CCR

2014-01-02 Thread Russell King
Consolidate the setup of the channel control register. Prepare the basic value in the preparation of the DMA descriptor, and write it into the register upon descriptor execution. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c | 133

[PATCH RFC 03/26] dmaengine: omap-dma: program hardware directly

2014-01-02 Thread Russell King
Program the transfer parameters directly into the hardware, rather than using the functions in arch/arm/plat-omap/dma.c. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c | 144 - include/linux/omap-dma.h |6 +-

[PATCH RFC 06/26] dmaengine: omap-dma: move reading of dma position to omap-dma.c

2014-01-02 Thread Russell King
Read the current DMA position from the hardware directly rather than via arch/arm/plat-omap/dma.c. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/omap-dma.c | 66 ++- 1 files changed, 64 insertions(+), 2 deletions(-) diff

[PATCH RFC 02/26] dmaengine: omap-dma: provide a hook to get the underlying DMA platform ops

2014-01-02 Thread Russell King
Provide and use a hook to obtain the underlying DMA platform operations so that omap-dma.c can access the hardware more directly without involving the legacy DMA driver. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/arm/plat-omap/dma.c |6 ++ drivers/dma/omap-dma.c |

[PATCH RFC 02/26] dmaengine: omap-dma: provide a hook to get the underlying DMA platform ops

2014-01-02 Thread Russell King
Provide and use a hook to obtain the underlying DMA platform operations so that omap-dma.c can access the hardware more directly without involving the legacy DMA driver. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/arm/plat-omap/dma.c |6 ++ drivers/dma/omap-dma.c |

Re: [PATCH RFC 22/26] ARM: omap: move dma channel allocation into plat-omap code

2014-01-02 Thread Andy Shevchenko
On Thu, 2014-01-02 at 15:12 +, Russell King wrote: This really needs to be there, because otherwise the plat-omap code can kfree() this data structure, and then re-use the pointer later. One comment bellow. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk ---

Re: [PATCH RFC 20/26] ARM: omap: clean up DMA register accesses

2014-01-02 Thread Andy Shevchenko
On Thu, 2014-01-02 at 15:12 +, Russell King wrote: We can do much better with this by using a structure to describe each register, rather than code. One comment bellow. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/arm/mach-omap1/dma.c | 121

Re: [PATCH RFC 20/26] ARM: omap: clean up DMA register accesses

2014-01-02 Thread Russell King - ARM Linux
On Thu, Jan 02, 2014 at 05:49:38PM +0200, Andy Shevchenko wrote: On Thu, 2014-01-02 at 15:12 +, Russell King wrote: We can do much better with this by using a structure to describe each register, rather than code. One comment bellow. Signed-off-by: Russell King

Re: [RFT/RFC/PATCH 00/31] arm: omap: irq: cleanup INTC driver

2014-01-02 Thread Felipe Balbi
Hi, On Mon, Dec 23, 2013 at 11:34:09AM -0600, Felipe Balbi wrote: On Fri, Dec 20, 2013 at 04:53:09PM -0800, Tony Lindgren wrote: * Felipe Balbi ba...@ti.com [131219 15:23]: On Thu, Dec 19, 2013 at 10:48:15AM -0800, Tony Lindgren wrote: * Felipe Balbi ba...@ti.com [131120 10:10]: