Skip to contentSkip to conversation

OMAP: DMA: Use some define rather than a hexadecimal constant for LCD register

PATCH Superseded Tony Lindgren 2 participants 13 messages Nov 16, 2009 – Dec 7, 2009

Subsystems (4)
lore
Share & tools
lore

Tony Lindgren

author reviewer
#0 lore raw
Quoted 6 lines · Janusz Krzysztofik

The patch corrects the issue introduced with my previous patch:
"OMAP: DMA: Fix omapfb/lcdc on OMAP1510 broken when PM set"
as pointed out by OMAP subsystem maintainer.

Created and tested against linux-omap for-next,
commit 155a75d9725e66e5ec8a383822957dee52427057

Oops, looks like this needs one more update. This breaks building for mach-omap2 machines:

arch/arm/plat-omap/dma.c: In function 'omap_dma_running':
arch/arm/plat-omap/dma.c:1132: error: 'OMAP_LCDC_CONTROL' undeclared (first use in this function) arch/arm/plat-omap/dma.c:1132: error: (Each undeclared identifier is reported only once arch/arm/plat-omap/dma.c:1132: error: for each function it appears in.) arch/arm/plat-omap/dma.c:1132: error: 'OMAP_LCDC_CTRL_LCD_EN' undeclared (first use in this function)

So removing from omap for-next.

Regards,

Tony

Quoted 150 lines

---
This version creates a new OMAP1 machine specific header file instead of modifying an OMAP platform common one.

Thanks,
Janusz

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

diff -uprN a/arch/arm/mach-omap1/include/mach/lcdc.h b/arch/arm/mach-omap1/include/mach/lcdc.h

arch/arm/mach-omap1/include/mach/lcdc.h +59 -0
@@ -0,0 +1,59 @@
+/*
+ * Header file for OMAP1 internal LCD controller
+ *
+ * Extracted from drivers/video/omap/lcdc.c
+ *
+ * Copyright (C) 2004 Nokia Corporation
+ * Author: Imre Deak <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifndef __ARCH_OMAP_LCDC_H__
+#define __ARCH_OMAP_LCDC_H__
+
+#define OMAP_LCDC_BASE			0xfffec000
+#define OMAP_LCDC_SIZE			256
+#define OMAP_LCDC_IRQ			INT_LCD_CTRL
+
+#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)
+#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)
+#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)
+#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)
+#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)
+#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)
+#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)
+#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)
+
+#define OMAP_LCDC_STAT_DONE		(1 << 0)
+#define OMAP_LCDC_STAT_VSYNC		(1 << 1)
+#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)
+#define OMAP_LCDC_STAT_ABC		(1 << 3)
+#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)
+#define OMAP_LCDC_STAT_FUF		(1 << 5)
+#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)
+
+#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)
+#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)
+#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)
+
+#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)
+#define OMAP_LCDC_IRQ_DONE		(1 << 3)
+#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)
+#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)
+#define OMAP_LCDC_IRQ_LINE		(1 << 6)
+#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)
+
+#endif

diff -uprN a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c

arch/arm/plat-omap/dma.c +5 -1
@@ -36,6 +36,10 @@
 
 #include <plat/tc.h>
 
+#ifdef CONFIG_ARCH_OMAP1
+#include <mach/lcdc.h>
+#endif
+
 #undef DEBUG
 
 #ifndef CONFIG_ARCH_OMAP1
@@ -1125,7 +1129,7 @@ int omap_dma_running(void)
 	 * when it gets enabled, so assume DMA running if LCD enabled.
 	 */
 	if (cpu_is_omap1510())
-		if (omap_readw(0xfffec000 + 0x00) & (1 << 0))
+		if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
 			return 1;
 
 	/* Check if LCD DMA is running */

diff -uprN a/drivers/video/omap/lcdc.c b/drivers/video/omap/lcdc.c

drivers/video/omap/lcdc.c +1 -32
@@ -31,6 +31,7 @@
 
 #include <plat/dma.h>
 #include <plat/omapfb.h>
+#include <mach/lcdc.h>
 
 #include <asm/mach-types.h>
 
@@ -38,38 +39,6 @@
 
 #define MODULE_NAME			"lcdc"
 
-#define OMAP_LCDC_BASE			0xfffec000
-#define OMAP_LCDC_SIZE			256
-#define OMAP_LCDC_IRQ			INT_LCD_CTRL
-
-#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)
-#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)
-#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)
-#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)
-#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)
-#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)
-#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)
-#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)
-
-#define OMAP_LCDC_STAT_DONE		(1 << 0)
-#define OMAP_LCDC_STAT_VSYNC		(1 << 1)
-#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)
-#define OMAP_LCDC_STAT_ABC		(1 << 3)
-#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)
-#define OMAP_LCDC_STAT_FUF		(1 << 5)
-#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)
-
-#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)
-#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)
-#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)
-
-#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)
-#define OMAP_LCDC_IRQ_DONE		(1 << 3)
-#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)
-#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)
-#define OMAP_LCDC_IRQ_LINE		(1 << 6)
-#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)
-
 #define MAX_PALETTE_SIZE		PAGE_SIZE
 
 enum lcdc_load_mode {
#1 lore raw

Monday 16 November 2009 23:25:18 Tony Lindgren napisał(a):

Quoted 19 lines · Janusz Krzysztofik
Quoted 6 lines

The patch corrects the issue introduced with my previous patch:
"OMAP: DMA: Fix omapfb/lcdc on OMAP1510 broken when PM set"
as pointed out by OMAP subsystem maintainer.

Created and tested against linux-omap for-next,
commit 155a75d9725e66e5ec8a383822957dee52427057

Oops, looks like this needs one more update. This breaks building for mach-omap2 machines:

arch/arm/plat-omap/dma.c: In function 'omap_dma_running':
arch/arm/plat-omap/dma.c:1132: error: 'OMAP_LCDC_CONTROL' undeclared (first use in this function) arch/arm/plat-omap/dma.c:1132: error: (Each undeclared identifier is reported only once arch/arm/plat-omap/dma.c:1132:
error: for each function it appears in.) arch/arm/plat-omap/dma.c:1132:
error: 'OMAP_LCDC_CTRL_LCD_EN' undeclared (first use in this function)

So removing from omap for-next.

[snip]

Quoted 5 lines

Review

Quoted 5 lines
(quoted diff) +1 -1
 	if (cpu_is_omap1510())
-		if (omap_readw(0xfffec000 + 0x00) & (1 << 0))
+		if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
 			return 1;

Sorry, I was sure it would be optimized out by a compiler. I'll put that into #ifdef block then.

Thanks,
Janusz
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

PATCH v4 1/1 OMAP: DMA: Use some define rather than a hexadecimal constant for LCD register

In reply to Tony Lindgren

The patch corrects the issue introduced with my previous patch:
"OMAP: DMA: Fix omapfb/lcdc on OMAP1510 broken when PM set"
as pointed out by OMAP subsystem maintainer.

Created and tested against linux-omap for-next,
commit 155a75d9725e66e5ec8a383822957dee52427057

---

Quoted 11 lines · Monday 16 November 2009 23:25:18 Tony Lindgren wrote:

Oops, looks like this needs one more update. This breaks building for mach-omap2 machines:

arch/arm/plat-omap/dma.c: In function 'omap_dma_running':
arch/arm/plat-omap/dma.c:1132: error: 'OMAP_LCDC_CONTROL' undeclared (first use in this function) arch/arm/plat-omap/dma.c:1132: error: (Each undeclared identifier is reported only once arch/arm/plat-omap/dma.c:1132:
error: for each function it appears in.) arch/arm/plat-omap/dma.c:1132:
error: 'OMAP_LCDC_CTRL_LCD_EN' undeclared (first use in this function)

So removing from omap for-next.

This time, compile tested with omap_generic_2420_defconfig as well. Once again, sorry for that noise :(.

Thanks,
Janusz

arch/arm/mach-omap1/include/mach/lcdc.h +59 -0
diff -uprN a/arch/arm/mach-omap1/include/mach/lcdc.h b/arch/arm/mach-omap1/include/mach/lcdc.h
@@ -0,0 +1,59 @@
+/*
+ * Heder file for OMAP1 internal LCD controller
+ *
+ * Extracted from drivers/video/omap/lcdc.c
+ *
+ * Copyright (C) 2004 Nokia Corporation
+ * Author: Imre Deak <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifndef __ARCH_OMAP_LCDC_H__
+#define __ARCH_OMAP_LCDC_H__
+
+#define OMAP_LCDC_BASE			0xfffec000
+#define OMAP_LCDC_SIZE			256
+#define OMAP_LCDC_IRQ			INT_LCD_CTRL
+
+#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)
+#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)
+#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)
+#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)
+#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)
+#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)
+#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)
+#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)
+
+#define OMAP_LCDC_STAT_DONE		(1 << 0)
+#define OMAP_LCDC_STAT_VSYNC		(1 << 1)
+#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)
+#define OMAP_LCDC_STAT_ABC		(1 << 3)
+#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)
+#define OMAP_LCDC_STAT_FUF		(1 << 5)
+#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)
+
+#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)
+#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)
+#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)
+
+#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)
+#define OMAP_LCDC_IRQ_DONE		(1 << 3)
+#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)
+#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)
+#define OMAP_LCDC_IRQ_LINE		(1 << 6)
+#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)
+
+#endif
arch/arm/plat-omap/dma.c +7 -1
diff -uprN a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
@@ -36,6 +36,10 @@
 
 #include <plat/tc.h>
 
+#ifdef CONFIG_ARCH_OMAP1
+#include <mach/lcdc.h>
+#endif
+
 #undef DEBUG
 
 #ifndef CONFIG_ARCH_OMAP1
@@ -1124,9 +1128,11 @@ int omap_dma_running(void)
 	 * On OMAP1510, internal LCD controller will start the transfer
 	 * when it gets enabled, so assume DMA running if LCD enabled.
 	 */
+#ifdef CONFIG_ARCH_OMAP1
 	if (cpu_is_omap1510())
-		if (omap_readw(0xfffec000 + 0x00) & (1 << 0))
+		if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
 			return 1;
+#endif
 
 	/* Check if LCD DMA is running */
 	if (cpu_is_omap16xx())
drivers/video/omap/lcdc.c +1 -32
diff -uprN a/drivers/video/omap/lcdc.c b/drivers/video/omap/lcdc.c
@@ -31,6 +31,7 @@
 
 #include <plat/dma.h>
 #include <plat/omapfb.h>
+#include <mach/lcdc.h>
 
 #include <asm/mach-types.h>
 
@@ -38,38 +39,6 @@
 
 #define MODULE_NAME			"lcdc"
 
-#define OMAP_LCDC_BASE			0xfffec000
-#define OMAP_LCDC_SIZE			256
-#define OMAP_LCDC_IRQ			INT_LCD_CTRL
-
-#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)
-#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)
-#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)
-#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)
-#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)
-#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)
-#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)
-#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)
-
-#define OMAP_LCDC_STAT_DONE		(1 << 0)
-#define OMAP_LCDC_STAT_VSYNC		(1 << 1)
-#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)
-#define OMAP_LCDC_STAT_ABC		(1 << 3)
-#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)
-#define OMAP_LCDC_STAT_FUF		(1 << 5)
-#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)
-
-#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)
-#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)
-#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)
-
-#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)
-#define OMAP_LCDC_IRQ_DONE		(1 << 3)
-#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)
-#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)
-#define OMAP_LCDC_IRQ_LINE		(1 << 6)
-#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)
-
 #define MAX_PALETTE_SIZE		PAGE_SIZE
 
 enum lcdc_load_mode {
author reviewer
#3 lore raw
Quoted 109 lines · Janusz Krzysztofik

The patch corrects the issue introduced with my previous patch:
"OMAP: DMA: Fix omapfb/lcdc on OMAP1510 broken when PM set"
as pointed out by OMAP subsystem maintainer.

Created and tested against linux-omap for-next,
commit 155a75d9725e66e5ec8a383822957dee52427057

---

Quoted 11 lines · Monday 16 November 2009 23:25:18 Tony Lindgren wrote:

Oops, looks like this needs one more update. This breaks building for mach-omap2 machines:

arch/arm/plat-omap/dma.c: In function 'omap_dma_running':
arch/arm/plat-omap/dma.c:1132: error: 'OMAP_LCDC_CONTROL' undeclared (first use in this function) arch/arm/plat-omap/dma.c:1132: error: (Each undeclared identifier is reported only once arch/arm/plat-omap/dma.c:1132:
error: for each function it appears in.) arch/arm/plat-omap/dma.c:1132:
error: 'OMAP_LCDC_CTRL_LCD_EN' undeclared (first use in this function)

So removing from omap for-next.

This time, compile tested with omap_generic_2420_defconfig as well. Once again, sorry for that noise :(.

Thanks,
Janusz

diff -uprN a/arch/arm/mach-omap1/include/mach/lcdc.h b/arch/arm/mach-omap1/include/mach/lcdc.h

arch/arm/mach-omap1/include/mach/lcdc.h +59 -0
@@ -0,0 +1,59 @@
+/*
+ * Heder file for OMAP1 internal LCD controller
+ *
+ * Extracted from drivers/video/omap/lcdc.c
+ *
+ * Copyright (C) 2004 Nokia Corporation
+ * Author: Imre Deak <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifndef __ARCH_OMAP_LCDC_H__
+#define __ARCH_OMAP_LCDC_H__
+
+#define OMAP_LCDC_BASE			0xfffec000
+#define OMAP_LCDC_SIZE			256
+#define OMAP_LCDC_IRQ			INT_LCD_CTRL
+
+#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)
+#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)
+#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)
+#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)
+#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)
+#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)
+#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)
+#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)
+
+#define OMAP_LCDC_STAT_DONE		(1 << 0)
+#define OMAP_LCDC_STAT_VSYNC		(1 << 1)
+#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)
+#define OMAP_LCDC_STAT_ABC		(1 << 3)
+#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)
+#define OMAP_LCDC_STAT_FUF		(1 << 5)
+#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)
+
+#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)
+#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)
+#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)
+
+#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)
+#define OMAP_LCDC_IRQ_DONE		(1 << 3)
+#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)
+#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)
+#define OMAP_LCDC_IRQ_LINE		(1 << 6)
+#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)
+
+#endif

diff -uprN a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c

arch/arm/plat-omap/dma.c +4 -0
@@ -36,6 +36,10 @@
 
 #include <plat/tc.h>
 
+#ifdef CONFIG_ARCH_OMAP1
+#include <mach/lcdc.h>
+#endif
+
 #undef DEBUG
 
 #ifndef CONFIG_ARCH_OMAP1
@@ -1124,9 +1128,11 @@ int omap_dma_running(void)
 	 * On OMAP1510, internal LCD controller will start the transfer
 	 * when it gets enabled, so assume DMA running if LCD enabled.

arch/arm/plat-omap/dma.c int omap_dma_running(void) · line 1138

Quoted 10 lines
arch/arm/plat-omap/dma.c +3 -1
 	 */
+#ifdef CONFIG_ARCH_OMAP1
 	if (cpu_is_omap1510())
-		if (omap_readw(0xfffec000 + 0x00) & (1 << 0))
+		if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
 			return 1;
+#endif
 
 	/* Check if LCD DMA is running */
 	if (cpu_is_omap16xx())

Hmm, this is getting complicated... How about just add function to drivers/video/omap/lcdc.c for something like omap_lcdc_get_status() or similar?

Then you can define that function in some header as:

#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP) extern int omap_lcdc_get_status(void);
#else
static inline int omap_lcdc_get_status(void)

{
	return -ENODEV;
}

#endif

That way the defines can stay where they are and you don't need the ugly ifdefs.

Regards,

Tony

Quoted 50 lines

diff -uprN a/drivers/video/omap/lcdc.c b/drivers/video/omap/lcdc.c

drivers/video/omap/lcdc.c +1 -32
@@ -31,6 +31,7 @@
 
 #include <plat/dma.h>
 #include <plat/omapfb.h>
+#include <mach/lcdc.h>
 
 #include <asm/mach-types.h>
 
@@ -38,38 +39,6 @@
 
 #define MODULE_NAME			"lcdc"
 
-#define OMAP_LCDC_BASE			0xfffec000
-#define OMAP_LCDC_SIZE			256
-#define OMAP_LCDC_IRQ			INT_LCD_CTRL
-
-#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)
-#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)
-#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)
-#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)
-#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)
-#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)
-#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)
-#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)
-
-#define OMAP_LCDC_STAT_DONE		(1 << 0)
-#define OMAP_LCDC_STAT_VSYNC		(1 << 1)
-#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)
-#define OMAP_LCDC_STAT_ABC		(1 << 3)
-#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)
-#define OMAP_LCDC_STAT_FUF		(1 << 5)
-#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)
-
-#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)
-#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)
-#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)
-
-#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)
-#define OMAP_LCDC_IRQ_DONE		(1 << 3)
-#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)
-#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)
-#define OMAP_LCDC_IRQ_LINE		(1 << 6)
-#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)
-
 #define MAX_PALETTE_SIZE		PAGE_SIZE
 
 enum lcdc_load_mode {
#4 lore raw

Tuesday 17 November 2009 01:16:58 Tony Lindgren napisał(a):

Quoted 122 lines · Janusz Krzysztofik
Quoted 121 lines

The patch corrects the issue introduced with my previous patch:
"OMAP: DMA: Fix omapfb/lcdc on OMAP1510 broken when PM set"
as pointed out by OMAP subsystem maintainer.

Created and tested against linux-omap for-next,
commit 155a75d9725e66e5ec8a383822957dee52427057

---

Quoted 11 lines · Monday 16 November 2009 23:25:18 Tony Lindgren wrote:

Oops, looks like this needs one more update. This breaks building for mach-omap2 machines:

arch/arm/plat-omap/dma.c: In function 'omap_dma_running':
arch/arm/plat-omap/dma.c:1132: error: 'OMAP_LCDC_CONTROL' undeclared (first use in this function) arch/arm/plat-omap/dma.c:1132: error:
(Each undeclared identifier is reported only once arch/arm/plat-omap/dma.c:1132: error: for each function it appears in.) arch/arm/plat-omap/dma.c:1132: error: 'OMAP_LCDC_CTRL_LCD_EN' undeclared (first use in this function)

Quoted 1 line

So removing from omap for-next.

This time, compile tested with omap_generic_2420_defconfig as well. Once again, sorry for that noise :(.

Thanks,
Janusz

diff -uprN a/arch/arm/mach-omap1/include/mach/lcdc.h b/arch/arm/mach-omap1/include/mach/lcdc.h ---
a/arch/arm/mach-omap1/include/mach/lcdc.h 1970-01-01 01:00:00.000000000
+0100 +++ b/arch/arm/mach-omap1/include/mach/lcdc.h 2009-11-16
21:13:33.000000000 +0100 @@ -0,0 +1,59 @@
+/*
+ * Heder file for OMAP1 internal LCD controller
+ *
+ * Extracted from drivers/video/omap/lcdc.c
+ *
+ * Copyright (C) 2004 Nokia Corporation
+ * Author: Imre Deak <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */

arch/arm/mach-omap1/include/mach/lcdc.h +37 -0
+
+#ifndef __ARCH_OMAP_LCDC_H__
+#define __ARCH_OMAP_LCDC_H__
+
+#define OMAP_LCDC_BASE			0xfffec000
+#define OMAP_LCDC_SIZE			256
+#define OMAP_LCDC_IRQ			INT_LCD_CTRL
+
+#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)
+#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)
+#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)
+#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)
+#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)
+#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)
+#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)
+#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)
+
+#define OMAP_LCDC_STAT_DONE		(1 << 0)
+#define OMAP_LCDC_STAT_VSYNC		(1 << 1)
+#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)
+#define OMAP_LCDC_STAT_ABC		(1 << 3)
+#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)
+#define OMAP_LCDC_STAT_FUF		(1 << 5)
+#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)
+
+#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)
+#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)
+#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)
+
+#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)
+#define OMAP_LCDC_IRQ_DONE		(1 << 3)
+#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)
+#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)
+#define OMAP_LCDC_IRQ_LINE		(1 << 6)
+#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)
+
+#endif

diff -uprN a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c

arch/arm/plat-omap/dma.c +7 -1
@@ -36,6 +36,10 @@
 
 #include <plat/tc.h>
 
+#ifdef CONFIG_ARCH_OMAP1
+#include <mach/lcdc.h>
+#endif
+
 #undef DEBUG
 
 #ifndef CONFIG_ARCH_OMAP1
@@ -1124,9 +1128,11 @@ int omap_dma_running(void)
 	 * On OMAP1510, internal LCD controller will start the transfer
 	 * when it gets enabled, so assume DMA running if LCD enabled.
 	 */
+#ifdef CONFIG_ARCH_OMAP1
 	if (cpu_is_omap1510())
-		if (omap_readw(0xfffec000 + 0x00) & (1 << 0))
+		if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
 			return 1;
+#endif
 
Quoted 6 lines

arch/arm/plat-omap/dma.c int omap_dma_running(void) · line 1138

Quoted 2 lines
arch/arm/plat-omap/dma.c +0 -0
 	/* Check if LCD DMA is running */
 	if (cpu_is_omap16xx())

Hmm, this is getting complicated... How about just add function to drivers/video/omap/lcdc.c for something like omap_lcdc_get_status() or similar?

Good idea.

Quoted 6 lines

Then you can define that function in some header as:

#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP) extern int omap_lcdc_get_status(void);
#else
static inline int omap_lcdc_get_status(void)

Quoted 7 lines
{
	return -ENODEV;
}

#endif

That way the defines can stay where they are and you don't need the ugly ifdefs.

Sorry if my question seems stupid, but assuming the function can be as simple as:

int omap_lcdc_get_status(void)

{
	return omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN;
}

could't it be defined as static inline too and put inside lcdc.h?

Thanks,
Janusz
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author reviewer
#5 lore raw
Quoted 149 lines · Janusz Krzysztofik

Tuesday 17 November 2009 01:16:58 Tony Lindgren napisał(a):

Quoted 122 lines · Janusz Krzysztofik
Quoted 121 lines

The patch corrects the issue introduced with my previous patch:
"OMAP: DMA: Fix omapfb/lcdc on OMAP1510 broken when PM set"
as pointed out by OMAP subsystem maintainer.

Created and tested against linux-omap for-next,
commit 155a75d9725e66e5ec8a383822957dee52427057

---

Quoted 11 lines · Monday 16 November 2009 23:25:18 Tony Lindgren wrote:

Oops, looks like this needs one more update. This breaks building for mach-omap2 machines:

arch/arm/plat-omap/dma.c: In function 'omap_dma_running':
arch/arm/plat-omap/dma.c:1132: error: 'OMAP_LCDC_CONTROL' undeclared (first use in this function) arch/arm/plat-omap/dma.c:1132: error:
(Each undeclared identifier is reported only once arch/arm/plat-omap/dma.c:1132: error: for each function it appears in.) arch/arm/plat-omap/dma.c:1132: error: 'OMAP_LCDC_CTRL_LCD_EN' undeclared (first use in this function)

Quoted 1 line

So removing from omap for-next.

This time, compile tested with omap_generic_2420_defconfig as well. Once again, sorry for that noise :(.

Thanks,
Janusz

diff -uprN a/arch/arm/mach-omap1/include/mach/lcdc.h b/arch/arm/mach-omap1/include/mach/lcdc.h ---
a/arch/arm/mach-omap1/include/mach/lcdc.h 1970-01-01 01:00:00.000000000
+0100 +++ b/arch/arm/mach-omap1/include/mach/lcdc.h 2009-11-16
21:13:33.000000000 +0100 @@ -0,0 +1,59 @@
+/*
+ * Heder file for OMAP1 internal LCD controller
+ *
+ * Extracted from drivers/video/omap/lcdc.c
+ *
+ * Copyright (C) 2004 Nokia Corporation
+ * Author: Imre Deak <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */

arch/arm/mach-omap1/include/mach/lcdc.h +37 -0
+
+#ifndef __ARCH_OMAP_LCDC_H__
+#define __ARCH_OMAP_LCDC_H__
+
+#define OMAP_LCDC_BASE			0xfffec000
+#define OMAP_LCDC_SIZE			256
+#define OMAP_LCDC_IRQ			INT_LCD_CTRL
+
+#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)
+#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)
+#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)
+#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)
+#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)
+#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)
+#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)
+#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)
+
+#define OMAP_LCDC_STAT_DONE		(1 << 0)
+#define OMAP_LCDC_STAT_VSYNC		(1 << 1)
+#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)
+#define OMAP_LCDC_STAT_ABC		(1 << 3)
+#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)
+#define OMAP_LCDC_STAT_FUF		(1 << 5)
+#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)
+
+#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)
+#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)
+#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)
+
+#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)
+#define OMAP_LCDC_IRQ_DONE		(1 << 3)
+#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)
+#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)
+#define OMAP_LCDC_IRQ_LINE		(1 << 6)
+#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)
+
+#endif

diff -uprN a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c

arch/arm/plat-omap/dma.c +7 -1
@@ -36,6 +36,10 @@
 
 #include <plat/tc.h>
 
+#ifdef CONFIG_ARCH_OMAP1
+#include <mach/lcdc.h>
+#endif
+
 #undef DEBUG
 
 #ifndef CONFIG_ARCH_OMAP1
@@ -1124,9 +1128,11 @@ int omap_dma_running(void)
 	 * On OMAP1510, internal LCD controller will start the transfer
 	 * when it gets enabled, so assume DMA running if LCD enabled.
 	 */
+#ifdef CONFIG_ARCH_OMAP1
 	if (cpu_is_omap1510())
-		if (omap_readw(0xfffec000 + 0x00) & (1 << 0))
+		if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
 			return 1;
+#endif
 
Quoted 6 lines

arch/arm/plat-omap/dma.c int omap_dma_running(void) · line 1138

Quoted 2 lines
arch/arm/plat-omap/dma.c +0 -0
 	/* Check if LCD DMA is running */
 	if (cpu_is_omap16xx())

Hmm, this is getting complicated... How about just add function to drivers/video/omap/lcdc.c for something like omap_lcdc_get_status() or similar?

Good idea.

Quoted 6 lines

Then you can define that function in some header as:

#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP) extern int omap_lcdc_get_status(void);
#else
static inline int omap_lcdc_get_status(void)

Quoted 7 lines
{
	return -ENODEV;
}

#endif

That way the defines can stay where they are and you don't need the ugly ifdefs.

Sorry if my question seems stupid, but assuming the function can be as simple as:

Quoted 6 lines

int omap_lcdc_get_status(void)

{
	return omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN;
}

could't it be defined as static inline too and put inside lcdc.h?

Sure, but then you need to move the defines again, no?

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

#6 lore raw

Tuesday 17 November 2009 02:24:35 Tony Lindgren napisał(a):

Quoted 28 lines · Janusz Krzysztofik
Quoted 27 lines

Tuesday 17 November 2009 01:16:58 Tony Lindgren napisał(a):

Quoted 26 lines · Janusz Krzysztofik
Quoted 25 lines

diff -uprN a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c

arch/arm/plat-omap/dma.c +7 -1
@@ -36,6 +36,10 @@
 
 #include <plat/tc.h>
 
+#ifdef CONFIG_ARCH_OMAP1
+#include <mach/lcdc.h>
+#endif
+
 #undef DEBUG
 
 #ifndef CONFIG_ARCH_OMAP1
@@ -1124,9 +1128,11 @@ int omap_dma_running(void)
 	 * On OMAP1510, internal LCD controller will start the transfer
 	 * when it gets enabled, so assume DMA running if LCD enabled.
 	 */
+#ifdef CONFIG_ARCH_OMAP1
 	if (cpu_is_omap1510())
-		if (omap_readw(0xfffec000 + 0x00) & (1 << 0))
+		if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
 			return 1;
+#endif
 
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

arch/arm/plat-omap/dma.c int omap_dma_running(void) · line 1138

Quoted 2 lines
arch/arm/plat-omap/dma.c +0 -0
 	/* Check if LCD DMA is running */
 	if (cpu_is_omap16xx())

Hmm, this is getting complicated... How about just add function to drivers/video/omap/lcdc.c for something like omap_lcdc_get_status() or similar?

Good idea.

... for a function itself, but not for putting it there, since omapfb, that lcdc is a part of, can be build as a module :).

Quoted 17 lines
Quoted 17 lines
Quoted 6 lines

Then you can define that function in some header as:

#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP) extern int omap_lcdc_get_status(void);
#else
static inline int omap_lcdc_get_status(void)

Quoted 7 lines
{
	return -ENODEV;
}

#endif

That way the defines can stay where they are and you don't need the ugly ifdefs.

Sorry if my question seems stupid, but assuming the function can be as simple as:

Quoted 8 lines
Quoted 6 lines

int omap_lcdc_get_status(void)

{
	return omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN;
}

could't it be defined as static inline too and put inside lcdc.h?

Sure, but then you need to move the defines again, no?

I can see 3 options:

1. While keeping those hex constants as they are for now, solve the issue during refactoring arch/arm/plat-omap/dma.c for a separate arch/arm/mach-omap1/lcd_dma.c, as Paul suggested (may take some time). Since the register test would be put there, some headers will have to be moved out of drivers/video/omap/lcdc.c anyway.

2. Temporarily apply v2 of the patch. It compiles cleanly since defines are put into <plat/omapfb.h> that exists for all OMAP classes. Then, clean up things while doing #1. I'm not sure if that temporary solution could result in one more conflict with DSS2.

3. Based on v4 and your suggestion for a function, work out an intermediate solution as soon as possible. I would appreciate any further suggestions on how that could be arranged.

If there are no better options, please suggest which of those three you would like me to take.

Thanks,
Janusz
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw

Tuesday 17 November 2009 11:45:53 Janusz Krzysztofik napisał(a):

Quoted 36 lines

Tuesday 17 November 2009 02:24:35 Tony Lindgren napisał(a):

Quoted 35 lines · Janusz Krzysztofik
Quoted 34 lines

Tuesday 17 November 2009 01:16:58 Tony Lindgren napisał(a):

Quoted 32 lines · Janusz Krzysztofik
Quoted 17 lines

diff -uprN a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c

arch/arm/plat-omap/dma.c +4 -0
@@ -36,6 +36,10 @@
 
 #include <plat/tc.h>
 
+#ifdef CONFIG_ARCH_OMAP1
+#include <mach/lcdc.h>
+#endif
+
 #undef DEBUG
 
 #ifndef CONFIG_ARCH_OMAP1
@@ -1124,9 +1128,11 @@ int omap_dma_running(void)
 	 * On OMAP1510, internal LCD controller will start the transfer
 	 * when it gets enabled, so assume DMA running if LCD enabled.

arch/arm/plat-omap/dma.c int omap_dma_running(void) · line 1138

Quoted 10 lines
arch/arm/plat-omap/dma.c +3 -1
 	 */
+#ifdef CONFIG_ARCH_OMAP1
 	if (cpu_is_omap1510())
-		if (omap_readw(0xfffec000 + 0x00) & (1 << 0))
+		if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
 			return 1;
+#endif
 
 	/* Check if LCD DMA is running */
 	if (cpu_is_omap16xx())

Hmm, this is getting complicated... How about just add function to drivers/video/omap/lcdc.c for something like omap_lcdc_get_status() or similar?

Quoted 4 lines
Quoted 1 line
Quoted 1 line

Good idea.

... for a function itself, but not for putting it there, since omapfb, that lcdc is a part of, can be build as a module :).

Hmm, looks like building omapfb as a module is broken (Kconfig/Makefile allow for this), at least for OMAP1. Anyway, I don't like the idea of putting something that depends on drivers into arch (even if it happened to be one of my initial concepts).

Thanks,
Janusz
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author reviewer
#8 lore raw
In reply to Janusz Krzysztofik
Quoted 67 lines · Janusz Krzysztofik

Tuesday 17 November 2009 02:24:35 Tony Lindgren napisał(a):

Quoted 28 lines · Janusz Krzysztofik
Quoted 27 lines

Tuesday 17 November 2009 01:16:58 Tony Lindgren napisał(a):

Quoted 26 lines · Janusz Krzysztofik
Quoted 25 lines

diff -uprN a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c

arch/arm/plat-omap/dma.c +7 -1
@@ -36,6 +36,10 @@
 
 #include <plat/tc.h>
 
+#ifdef CONFIG_ARCH_OMAP1
+#include <mach/lcdc.h>
+#endif
+
 #undef DEBUG
 
 #ifndef CONFIG_ARCH_OMAP1
@@ -1124,9 +1128,11 @@ int omap_dma_running(void)
 	 * On OMAP1510, internal LCD controller will start the transfer
 	 * when it gets enabled, so assume DMA running if LCD enabled.
 	 */
+#ifdef CONFIG_ARCH_OMAP1
 	if (cpu_is_omap1510())
-		if (omap_readw(0xfffec000 + 0x00) & (1 << 0))
+		if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
 			return 1;
+#endif
 
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

arch/arm/plat-omap/dma.c int omap_dma_running(void) · line 1138

Quoted 2 lines
arch/arm/plat-omap/dma.c +0 -0
 	/* Check if LCD DMA is running */
 	if (cpu_is_omap16xx())

Hmm, this is getting complicated... How about just add function to drivers/video/omap/lcdc.c for something like omap_lcdc_get_status() or similar?

Good idea.

... for a function itself, but not for putting it there, since omapfb, that lcdc is a part of, can be build as a module :).

Quoted 17 lines
Quoted 17 lines
Quoted 6 lines

Then you can define that function in some header as:

#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP) extern int omap_lcdc_get_status(void);
#else
static inline int omap_lcdc_get_status(void)

Quoted 7 lines
{
	return -ENODEV;
}

#endif

That way the defines can stay where they are and you don't need the ugly ifdefs.

Sorry if my question seems stupid, but assuming the function can be as simple as:

Quoted 8 lines
Quoted 6 lines

int omap_lcdc_get_status(void)

{
	return omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN;
}

could't it be defined as static inline too and put inside lcdc.h?

Sure, but then you need to move the defines again, no?

Quoted 7 lines

I can see 3 options:

1. While keeping those hex constants as they are for now, solve the issue during refactoring arch/arm/plat-omap/dma.c for a separate arch/arm/mach-omap1/lcd_dma.c, as Paul suggested (may take some time). Since the register test would be put there, some headers will have to be moved out of drivers/video/omap/lcdc.c anyway.

This sounds like the best way to go to me.

Quoted 4 lines

2. Temporarily apply v2 of the patch. It compiles cleanly since defines are put into <plat/omapfb.h> that exists for all OMAP classes. Then, clean up things while doing #1. I'm not sure if that temporary solution could result in one more conflict with DSS2.

Yeah let's rather do the real fix at #1 above :)

Quoted 6 lines

3. Based on v4 and your suggestion for a function, work out an intermediate solution as soon as possible. I would appreciate any further suggestions on how that could be arranged.

If there are no better options, please suggest which of those three you would like me to take.

I think #1 above is the way to go.

Regards,

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

#9 lore raw

PATCH v5 1/1 OMAP1: LCD_DMA: Use some define rather than a hexadecimal constant for LCD register

The patch corrects the issue introduced with one of my earlier patches:
OMAP: DMA: Fix omapfb/lcdc on OMAP1510 broken when PM set[1]
as pointed out by OMAP subsystem maintainer.

Applies on top of my prevoius patch:
OMAP: DMA: move LCD DMA related code from plat-omap to mach-omap1[2]

Tested on Amstrad Delta
Compile tested with omap_generic_2420_defconfig

[1] http://patchwork.kernel.org/patch/57922/
[2] http://patchwork.kernel.org/patch/61952/
---

Quoted 9 lines · Tuesday 17 November 2009 17:10:58 Tony Lindgren wrote:
Quoted 6 lines · Janusz Krzysztofik

1. While keeping those hex constants as they are for now, solve the issue during refactoring arch/arm/plat-omap/dma.c for a separate arch/arm/mach-omap1/lcd_dma.c, as Paul suggested (may take some time). Since the register test would be put there, some headers will have to be moved out of drivers/video/omap/lcdc.c anyway.

This sounds like the best way to go to me.

Tony,

At your service :-).

Since it's very similiar to reverted v3[*], I hope you have no problems with this one.

Thanks,
Janusz

[*] http://patchwork.kernel.org/patch/60478/

arch/arm/mach-omap1/include/mach/lcdc.h +57 -0
diff -uprN git.orig/arch/arm/mach-omap1/include/mach/lcdc.h git/arch/arm/mach-omap1/include/mach/lcdc.h
@@ -0,0 +1,57 @@
+/*
+ * arch/arm/mach-omap1/include/mach/lcdc.h
+ *
+ * Extracted from drivers/video/omap/lcdc.c
+ * Copyright (C) 2004 Nokia Corporation
+ * Author: Imre Deak <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+#ifndef __MACH_LCDC_H__
+#define __MACH_LCDC_H__
+
+#define OMAP_LCDC_BASE			0xfffec000
+#define OMAP_LCDC_SIZE			256
+#define OMAP_LCDC_IRQ			INT_LCD_CTRL
+
+#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)
+#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)
+#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)
+#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)
+#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)
+#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)
+#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)
+#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)
+
+#define OMAP_LCDC_STAT_DONE		(1 << 0)
+#define OMAP_LCDC_STAT_VSYNC		(1 << 1)
+#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)
+#define OMAP_LCDC_STAT_ABC		(1 << 3)
+#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)
+#define OMAP_LCDC_STAT_FUF		(1 << 5)
+#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)
+
+#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)
+#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)
+#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)
+
+#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)
+#define OMAP_LCDC_IRQ_DONE		(1 << 3)
+#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)
+#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)
+#define OMAP_LCDC_IRQ_LINE		(1 << 6)
+#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)
+
+#endif /* __MACH_LCDC_H__ */
arch/arm/mach-omap1/lcd_dma.c +2 -1
diff -uprN git.orig/arch/arm/mach-omap1/lcd_dma.c git/arch/arm/mach-omap1/lcd_dma.c
@@ -28,6 +28,7 @@
 #include <linux/io.h>
 
 #include <mach/hardware.h>
+#include <mach/lcdc.h>
 #include <plat/dma.h>
 
 int omap_lcd_dma_running(void)
@@ -37,7 +38,7 @@ int omap_lcd_dma_running(void)
 	 * when it gets enabled, so assume DMA running if LCD enabled.
 	 */
 	if (cpu_is_omap1510())
-		if (omap_readw(0xfffec000 + 0x00) & (1 << 0))
+		if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
 			return 1;
 
 	/* Check if LCD DMA is running */
drivers/video/omap/lcdc.c +1 -32
diff -uprN git.orig/drivers/video/omap/lcdc.c git/drivers/video/omap/lcdc.c
@@ -29,6 +29,7 @@
 #include <linux/vmalloc.h>
 #include <linux/clk.h>
 
+#include <mach/lcdc.h>
 #include <plat/dma.h>
 #include <plat/omapfb.h>
 
@@ -38,38 +39,6 @@
 
 #define MODULE_NAME			"lcdc"
 
-#define OMAP_LCDC_BASE			0xfffec000
-#define OMAP_LCDC_SIZE			256
-#define OMAP_LCDC_IRQ			INT_LCD_CTRL
-
-#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)
-#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)
-#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)
-#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)
-#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)
-#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)
-#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)
-#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)
-
-#define OMAP_LCDC_STAT_DONE		(1 << 0)
-#define OMAP_LCDC_STAT_VSYNC		(1 << 1)
-#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)
-#define OMAP_LCDC_STAT_ABC		(1 << 3)
-#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)
-#define OMAP_LCDC_STAT_FUF		(1 << 5)
-#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)
-
-#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)
-#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)
-#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)
-
-#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)
-#define OMAP_LCDC_IRQ_DONE		(1 << 3)
-#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)
-#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)
-#define OMAP_LCDC_IRQ_LINE		(1 << 6)
-#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)
-
 #define MAX_PALETTE_SIZE		PAGE_SIZE
 
 enum lcdc_load_mode {
#10 lore raw

Re: [PATCH v5] OMAP1: LCD_DMA: Use some define rather than a hexadecimal constant for LCD register

Tuesday 24 November 2009 22:34:10 Janusz Krzysztofik napisał(a):

Quoted 3 lines

The patch corrects the issue introduced with one of my earlier patches:
OMAP: DMA: Fix omapfb/lcdc on OMAP1510 broken when PM set[1]
as pointed out by OMAP subsystem maintainer.

Tony,

I've noticed that you've marked this patch as Superseded in your patchwork queue. This is not the case. It is still supposed to correct the issue, now sitting in mach-omap1/lcd_dma.c after being moved from plat-omap/dma.c.

Thanks,
Janusz

Quoted 158 lines

Applies on top of my prevoius patch:
OMAP: DMA: move LCD DMA related code from plat-omap to mach-omap1[2]

Tested on Amstrad Delta
Compile tested with omap_generic_2420_defconfig

[1] http://patchwork.kernel.org/patch/57922/
[2] http://patchwork.kernel.org/patch/61952/
---

Quoted 8 lines · Tuesday 17 November 2009 17:10:58 Tony Lindgren wrote:
Quoted 5 lines · Janusz Krzysztofik

1. While keeping those hex constants as they are for now, solve the issue during refactoring arch/arm/plat-omap/dma.c for a separate arch/arm/mach-omap1/lcd_dma.c, as Paul suggested (may take some time). Since the register test would be put there, some headers will have to be moved out of drivers/video/omap/lcdc.c anyway.

This sounds like the best way to go to me.

Tony,

At your service :-).

Since it's very similiar to reverted v3[*], I hope you have no problems with this one.

Thanks,
Janusz

[*] http://patchwork.kernel.org/patch/60478/

diff -uprN git.orig/arch/arm/mach-omap1/include/mach/lcdc.h git/arch/arm/mach-omap1/include/mach/lcdc.h ---
git.orig/arch/arm/mach-omap1/include/mach/lcdc.h 1970-01-01
01:00:00.000000000 +0100 +++
git/arch/arm/mach-omap1/include/mach/lcdc.h 2009-11-21 03:26:32.000000000
+0100 @@ -0,0 +1,57 @@

arch/arm/mach-omap1/include/mach/lcdc.h +57 -0
+/*
+ * arch/arm/mach-omap1/include/mach/lcdc.h
+ *
+ * Extracted from drivers/video/omap/lcdc.c
+ * Copyright (C) 2004 Nokia Corporation
+ * Author: Imre Deak <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+#ifndef __MACH_LCDC_H__
+#define __MACH_LCDC_H__
+
+#define OMAP_LCDC_BASE			0xfffec000
+#define OMAP_LCDC_SIZE			256
+#define OMAP_LCDC_IRQ			INT_LCD_CTRL
+
+#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)
+#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)
+#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)
+#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)
+#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)
+#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)
+#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)
+#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)
+
+#define OMAP_LCDC_STAT_DONE		(1 << 0)
+#define OMAP_LCDC_STAT_VSYNC		(1 << 1)
+#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)
+#define OMAP_LCDC_STAT_ABC		(1 << 3)
+#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)
+#define OMAP_LCDC_STAT_FUF		(1 << 5)
+#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)
+
+#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)
+#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)
+#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)
+
+#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)
+#define OMAP_LCDC_IRQ_DONE		(1 << 3)
+#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)
+#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)
+#define OMAP_LCDC_IRQ_LINE		(1 << 6)
+#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)
+
+#endif /* __MACH_LCDC_H__ */

diff -uprN git.orig/arch/arm/mach-omap1/lcd_dma.c
git/arch/arm/mach-omap1/lcd_dma.c ---
git/arch/arm/mach-omap1/lcd_dma.c 2009-11-21 14:36:59.000000000 +0100 +++
git.orig/arch/arm/mach-omap1/lcd_dma.c 2009-11-21 03:42:25.000000000 +0100

arch/arm/mach-omap1/lcd_dma.c +2 -1
@@ -28,6 +28,7 @@
 #include <linux/io.h>
 
 #include <mach/hardware.h>
+#include <mach/lcdc.h>
 #include <plat/dma.h>
 
 int omap_lcd_dma_running(void)
@@ -37,7 +38,7 @@ int omap_lcd_dma_running(void)
 	 * when it gets enabled, so assume DMA running if LCD enabled.
 	 */
 	if (cpu_is_omap1510())
-		if (omap_readw(0xfffec000 + 0x00) & (1 << 0))
+		if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
 			return 1;
 
 	/* Check if LCD DMA is running */

diff -uprN git.orig/drivers/video/omap/lcdc.c git/drivers/video/omap/lcdc.c

drivers/video/omap/lcdc.c +1 -25
@@ -29,6 +29,7 @@
 #include <linux/vmalloc.h>
 #include <linux/clk.h>
 
+#include <mach/lcdc.h>
 #include <plat/dma.h>
 #include <plat/omapfb.h>
 
@@ -38,38 +39,6 @@
 
 #define MODULE_NAME			"lcdc"
 
-#define OMAP_LCDC_BASE			0xfffec000
-#define OMAP_LCDC_SIZE			256
-#define OMAP_LCDC_IRQ			INT_LCD_CTRL
-
-#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)
-#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)
-#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)
-#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)
-#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)
-#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)
-#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)
-#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)
-
-#define OMAP_LCDC_STAT_DONE		(1 << 0)
-#define OMAP_LCDC_STAT_VSYNC		(1 << 1)
-#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)
-#define OMAP_LCDC_STAT_ABC		(1 << 3)
-#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)
-#define OMAP_LCDC_STAT_FUF		(1 << 5)
-#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)
-
-#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)
-#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)
-#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)
-

drivers/video/omap/lcdc.c line 44

Quoted 10 lines
drivers/video/omap/lcdc.c +0 -7
-#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)
-#define OMAP_LCDC_IRQ_DONE		(1 << 3)
-#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)
-#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)
-#define OMAP_LCDC_IRQ_LINE		(1 << 6)
-#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)
-
 #define MAX_PALETTE_SIZE		PAGE_SIZE
 
 enum lcdc_load_mode {

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

author reviewer
#11 lore raw

Re: [PATCH v5] OMAP1: LCD_DMA: Use some define rather than a hexadecimal constant for LCD register

Quoted 10 lines · Janusz Krzysztofik

Tuesday 24 November 2009 22:34:10 Janusz Krzysztofik napisał(a):

Quoted 3 lines

The patch corrects the issue introduced with one of my earlier patches:
OMAP: DMA: Fix omapfb/lcdc on OMAP1510 broken when PM set[1]
as pointed out by OMAP subsystem maintainer.

Tony,

I've noticed that you've marked this patch as Superseded in your patchwork queue. This is not the case. It is still supposed to correct the issue, now sitting in mach-omap1/lcd_dma.c after being moved from plat-omap/dma.c.

OK, thanks for letting me know. Adding it to for-next-vol2.

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

author reviewer
#12 lore raw

PATCH v5 1/1 OMAP1: LCD_DMA: Use some define rather than a

In reply to Janusz Krzysztofik

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: for-next-vol2

Initial commit ID (Likely to change): 7b381eef0d82f9bbdff08d930e9cfc43ee98f0b7

PatchWorks
http://patchwork.kernel.org/patch/62623/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=7b381eef0d82f9bbdff08d930e9cfc43ee98f0b7