diff options
| author | Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> | 2009-12-11 19:16:36 -0500 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2009-12-11 19:16:36 -0500 |
| commit | 8d72c796c9d966b0efc26092dae7005c345b3efa (patch) | |
| tree | 4f608e2c9e06efca0d0d31394752177fd774138c | |
| parent | 9cb87a6b443fe6061d91b7eb220d15d01e0dc611 (diff) | |
omap1: LCD_DMA: Use some define rather than a hexadecimal
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/
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>
| -rw-r--r-- | arch/arm/mach-omap1/include/mach/lcdc.h | 57 | ||||
| -rw-r--r-- | arch/arm/mach-omap1/lcd_dma.c | 3 | ||||
| -rw-r--r-- | drivers/video/omap/lcdc.c | 33 |
3 files changed, 60 insertions, 33 deletions
diff --git a/arch/arm/mach-omap1/include/mach/lcdc.h b/arch/arm/mach-omap1/include/mach/lcdc.h new file mode 100644 index 000000000000..89bd703adaf6 --- /dev/null +++ b/arch/arm/mach-omap1/include/mach/lcdc.h | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-omap1/include/mach/lcdc.h | ||
| 3 | * | ||
| 4 | * Extracted from drivers/video/omap/lcdc.c | ||
| 5 | * Copyright (C) 2004 Nokia Corporation | ||
| 6 | * Author: Imre Deak <imre.deak@nokia.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, but | ||
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 16 | * General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License along | ||
| 19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 20 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 21 | */ | ||
| 22 | #ifndef __MACH_LCDC_H__ | ||
| 23 | #define __MACH_LCDC_H__ | ||
| 24 | |||
| 25 | #define OMAP_LCDC_BASE 0xfffec000 | ||
| 26 | #define OMAP_LCDC_SIZE 256 | ||
| 27 | #define OMAP_LCDC_IRQ INT_LCD_CTRL | ||
| 28 | |||
| 29 | #define OMAP_LCDC_CONTROL (OMAP_LCDC_BASE + 0x00) | ||
| 30 | #define OMAP_LCDC_TIMING0 (OMAP_LCDC_BASE + 0x04) | ||
| 31 | #define OMAP_LCDC_TIMING1 (OMAP_LCDC_BASE + 0x08) | ||
| 32 | #define OMAP_LCDC_TIMING2 (OMAP_LCDC_BASE + 0x0c) | ||
| 33 | #define OMAP_LCDC_STATUS (OMAP_LCDC_BASE + 0x10) | ||
| 34 | #define OMAP_LCDC_SUBPANEL (OMAP_LCDC_BASE + 0x14) | ||
| 35 | #define OMAP_LCDC_LINE_INT (OMAP_LCDC_BASE + 0x18) | ||
| 36 | #define OMAP_LCDC_DISPLAY_STATUS (OMAP_LCDC_BASE + 0x1c) | ||
| 37 | |||
| 38 | #define OMAP_LCDC_STAT_DONE (1 << 0) | ||
| 39 | #define OMAP_LCDC_STAT_VSYNC (1 << 1) | ||
| 40 | #define OMAP_LCDC_STAT_SYNC_LOST (1 << 2) | ||
| 41 | #define OMAP_LCDC_STAT_ABC (1 << 3) | ||
| 42 | #define OMAP_LCDC_STAT_LINE_INT (1 << 4) | ||
| 43 | #define OMAP_LCDC_STAT_FUF (1 << 5) | ||
| 44 | #define OMAP_LCDC_STAT_LOADED_PALETTE (1 << 6) | ||
| 45 | |||
| 46 | #define OMAP_LCDC_CTRL_LCD_EN (1 << 0) | ||
| 47 | #define OMAP_LCDC_CTRL_LCD_TFT (1 << 7) | ||
| 48 | #define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL (1 << 10) | ||
| 49 | |||
| 50 | #define OMAP_LCDC_IRQ_VSYNC (1 << 2) | ||
| 51 | #define OMAP_LCDC_IRQ_DONE (1 << 3) | ||
| 52 | #define OMAP_LCDC_IRQ_LOADED_PALETTE (1 << 4) | ||
| 53 | #define OMAP_LCDC_IRQ_LINE_NIRQ (1 << 5) | ||
| 54 | #define OMAP_LCDC_IRQ_LINE (1 << 6) | ||
| 55 | #define OMAP_LCDC_IRQ_MASK (((1 << 5) - 1) << 2) | ||
| 56 | |||
| 57 | #endif /* __MACH_LCDC_H__ */ | ||
diff --git a/arch/arm/mach-omap1/lcd_dma.c b/arch/arm/mach-omap1/lcd_dma.c index 48895140695f..3be11af687bb 100644 --- a/arch/arm/mach-omap1/lcd_dma.c +++ b/arch/arm/mach-omap1/lcd_dma.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
| 29 | 29 | ||
| 30 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
| 31 | #include <mach/lcdc.h> | ||
| 31 | #include <plat/dma.h> | 32 | #include <plat/dma.h> |
| 32 | 33 | ||
| 33 | int omap_lcd_dma_running(void) | 34 | int omap_lcd_dma_running(void) |
| @@ -37,7 +38,7 @@ int omap_lcd_dma_running(void) | |||
| 37 | * when it gets enabled, so assume DMA running if LCD enabled. | 38 | * when it gets enabled, so assume DMA running if LCD enabled. |
| 38 | */ | 39 | */ |
| 39 | if (cpu_is_omap1510()) | 40 | if (cpu_is_omap1510()) |
| 40 | if (omap_readw(0xfffec000 + 0x00) & (1 << 0)) | 41 | if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN) |
| 41 | return 1; | 42 | return 1; |
| 42 | 43 | ||
| 43 | /* Check if LCD DMA is running */ | 44 | /* Check if LCD DMA is running */ |
diff --git a/drivers/video/omap/lcdc.c b/drivers/video/omap/lcdc.c index b831e1df629e..a33483910dc8 100644 --- a/drivers/video/omap/lcdc.c +++ b/drivers/video/omap/lcdc.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/vmalloc.h> | 29 | #include <linux/vmalloc.h> |
| 30 | #include <linux/clk.h> | 30 | #include <linux/clk.h> |
| 31 | 31 | ||
| 32 | #include <mach/lcdc.h> | ||
| 32 | #include <plat/dma.h> | 33 | #include <plat/dma.h> |
| 33 | 34 | ||
| 34 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
| @@ -39,38 +40,6 @@ | |||
| 39 | 40 | ||
| 40 | #define MODULE_NAME "lcdc" | 41 | #define MODULE_NAME "lcdc" |
| 41 | 42 | ||
| 42 | #define OMAP_LCDC_BASE 0xfffec000 | ||
| 43 | #define OMAP_LCDC_SIZE 256 | ||
| 44 | #define OMAP_LCDC_IRQ INT_LCD_CTRL | ||
| 45 | |||
| 46 | #define OMAP_LCDC_CONTROL (OMAP_LCDC_BASE + 0x00) | ||
| 47 | #define OMAP_LCDC_TIMING0 (OMAP_LCDC_BASE + 0x04) | ||
| 48 | #define OMAP_LCDC_TIMING1 (OMAP_LCDC_BASE + 0x08) | ||
| 49 | #define OMAP_LCDC_TIMING2 (OMAP_LCDC_BASE + 0x0c) | ||
| 50 | #define OMAP_LCDC_STATUS (OMAP_LCDC_BASE + 0x10) | ||
| 51 | #define OMAP_LCDC_SUBPANEL (OMAP_LCDC_BASE + 0x14) | ||
| 52 | #define OMAP_LCDC_LINE_INT (OMAP_LCDC_BASE + 0x18) | ||
| 53 | #define OMAP_LCDC_DISPLAY_STATUS (OMAP_LCDC_BASE + 0x1c) | ||
| 54 | |||
| 55 | #define OMAP_LCDC_STAT_DONE (1 << 0) | ||
| 56 | #define OMAP_LCDC_STAT_VSYNC (1 << 1) | ||
| 57 | #define OMAP_LCDC_STAT_SYNC_LOST (1 << 2) | ||
| 58 | #define OMAP_LCDC_STAT_ABC (1 << 3) | ||
| 59 | #define OMAP_LCDC_STAT_LINE_INT (1 << 4) | ||
| 60 | #define OMAP_LCDC_STAT_FUF (1 << 5) | ||
| 61 | #define OMAP_LCDC_STAT_LOADED_PALETTE (1 << 6) | ||
| 62 | |||
| 63 | #define OMAP_LCDC_CTRL_LCD_EN (1 << 0) | ||
| 64 | #define OMAP_LCDC_CTRL_LCD_TFT (1 << 7) | ||
| 65 | #define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL (1 << 10) | ||
| 66 | |||
| 67 | #define OMAP_LCDC_IRQ_VSYNC (1 << 2) | ||
| 68 | #define OMAP_LCDC_IRQ_DONE (1 << 3) | ||
| 69 | #define OMAP_LCDC_IRQ_LOADED_PALETTE (1 << 4) | ||
| 70 | #define OMAP_LCDC_IRQ_LINE_NIRQ (1 << 5) | ||
| 71 | #define OMAP_LCDC_IRQ_LINE (1 << 6) | ||
| 72 | #define OMAP_LCDC_IRQ_MASK (((1 << 5) - 1) << 2) | ||
| 73 | |||
| 74 | #define MAX_PALETTE_SIZE PAGE_SIZE | 43 | #define MAX_PALETTE_SIZE PAGE_SIZE |
| 75 | 44 | ||
| 76 | enum lcdc_load_mode { | 45 | enum lcdc_load_mode { |
