]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
video: sh_mobile_lcdcfb: Support HAVE_CLK=n configurations.
authorPaul Mundt <lethal@linux-sh.org>
Wed, 1 Oct 2008 07:24:32 +0000 (16:24 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 1 Oct 2008 07:24:32 +0000 (16:24 +0900)
This provides a workaround for users of sh_mobile_lcdcfb that don't
define HAVE_CLK and have otherwise sane clock initialization.

At the same time, move the sh_mobile_lcdc.h header to include/video/.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/boards/board-ap325rxa.c
arch/sh/boards/mach-migor/lcd_qvga.c
arch/sh/boards/mach-migor/setup.c
arch/sh/include/asm/migor.h
arch/sh/include/asm/sh_mobile_lcdc.h [deleted file]
drivers/video/sh_mobile_lcdcfb.c
include/video/sh_mobile_lcdc.h [new file with mode: 0644]

index 00e632fc0688ec63be754a22983276b0f3059043..7ae8dcddfeb4185511f962d059eaf4f1ea40d3f8 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/smc911x.h>
 #include <media/soc_camera_platform.h>
 #include <media/sh_mobile_ceu.h>
-#include <asm/sh_mobile_lcdc.h>
+#include <video/sh_mobile_lcdc.h>
 #include <asm/io.h>
 #include <asm/clock.h>
 
index 6e960959644825daba418076b68c6a70ab753087..735326c04497cda402831861eb0ad447e9f30356 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <asm/sh_mobile_lcdc.h>
+#include <video/sh_mobile_lcdc.h>
 #include <asm/migor.h>
 
 /* LCD Module is a PH240320T according to board schematics. This module
index 714dce91cc9bbb30684764c33eef963c09844866..f27475d2fa0ca5852944bad647b0d3332091ad42 100644 (file)
 #include <linux/clk.h>
 #include <media/soc_camera_platform.h>
 #include <media/sh_mobile_ceu.h>
+#include <video/sh_mobile_lcdc.h>
 #include <asm/clock.h>
 #include <asm/machvec.h>
 #include <asm/io.h>
 #include <asm/sh_keysc.h>
-#include <asm/sh_mobile_lcdc.h>
 #include <asm/migor.h>
 
 /* Address     IRQ  Size  Bus  Description
index c12b632c540bc27a18f6d350ff9e680a23a79b9b..70596d38fd67108edc5ea67e5c30617aaf49d416 100644 (file)
@@ -54,7 +54,7 @@
 
 #define BSC_CS6ABCR 0xfec1001c
 
-#include <asm/sh_mobile_lcdc.h>
+#include <video/sh_mobile_lcdc.h>
 
 int migor_lcd_qvga_setup(void *board_data, void *sys_ops_handle,
                         struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
diff --git a/arch/sh/include/asm/sh_mobile_lcdc.h b/arch/sh/include/asm/sh_mobile_lcdc.h
deleted file mode 100644 (file)
index 130102f..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef __ASM_SH_MOBILE_LCDC_H__
-#define __ASM_SH_MOBILE_LCDC_H__
-
-#include <linux/fb.h>
-
-enum { RGB8,   /* 24bpp, 8:8:8 */
-       RGB9,   /* 18bpp, 9:9 */
-       RGB12A, /* 24bpp, 12:12 */
-       RGB12B, /* 12bpp */
-       RGB16,  /* 16bpp */
-       RGB18,  /* 18bpp */
-       RGB24,  /* 24bpp */
-       SYS8A,  /* 24bpp, 8:8:8 */
-       SYS8B,  /* 18bpp, 8:8:2 */
-       SYS8C,  /* 18bpp, 2:8:8 */
-       SYS8D,  /* 16bpp, 8:8 */
-       SYS9,   /* 18bpp, 9:9 */
-       SYS12,  /* 24bpp, 12:12 */
-       SYS16A, /* 16bpp */
-       SYS16B, /* 18bpp, 16:2 */
-       SYS16C, /* 18bpp, 2:16 */
-       SYS18,  /* 18bpp */
-       SYS24 };/* 24bpp */
-
-enum { LCDC_CHAN_DISABLED = 0,
-       LCDC_CHAN_MAINLCD,
-       LCDC_CHAN_SUBLCD };
-
-enum { LCDC_CLK_BUS, LCDC_CLK_PERIPHERAL, LCDC_CLK_EXTERNAL };
-
-struct sh_mobile_lcdc_sys_bus_cfg {
-       unsigned long ldmt2r;
-       unsigned long ldmt3r;
-};
-
-struct sh_mobile_lcdc_sys_bus_ops {
-       void (*write_index)(void *handle, unsigned long data);
-       void (*write_data)(void *handle, unsigned long data);
-       unsigned long (*read_data)(void *handle);
-};
-
-struct sh_mobile_lcdc_board_cfg {
-       void *board_data;
-       int (*setup_sys)(void *board_data, void *sys_ops_handle,
-                        struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
-       void (*display_on)(void *board_data);
-       void (*display_off)(void *board_data);
-};
-
-struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
-       unsigned long width;
-       unsigned long height;
-};
-
-struct sh_mobile_lcdc_chan_cfg {
-       int chan;
-       int bpp;
-       int interface_type; /* selects RGBn or SYSn I/F, see above */
-       int clock_divider;
-       struct fb_videomode lcd_cfg;
-       struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg;
-       struct sh_mobile_lcdc_board_cfg board_cfg;
-       struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
-};
-
-struct sh_mobile_lcdc_info {
-       unsigned long lddckr;
-       int clock_source;
-       struct sh_mobile_lcdc_chan_cfg ch[2];
-};
-
-#endif /* __ASM_SH_MOBILE_LCDC_H__ */
index 4c32c06579a04c7826e56f5f5b4f87acf95eeab6..b7468bacce8015794b18dda44b1b8f3f61ed8e11 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/clk.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
-#include <asm/sh_mobile_lcdc.h>
+#include <video/sh_mobile_lcdc.h>
 
 #define PALETTE_NR 16
 
@@ -34,7 +34,9 @@ struct sh_mobile_lcdc_chan {
 
 struct sh_mobile_lcdc_priv {
        void __iomem *base;
+#ifdef CONFIG_HAVE_CLK
        struct clk *clk;
+#endif
        unsigned long lddckr;
        struct sh_mobile_lcdc_chan ch[2];
 };
@@ -422,6 +424,7 @@ static int sh_mobile_lcdc_setup_clocks(struct device *dev, int clock_source,
 
        priv->lddckr = icksel << 16;
 
+#ifdef CONFIG_HAVE_CLK
        if (str) {
                priv->clk = clk_get(dev, str);
                if (IS_ERR(priv->clk)) {
@@ -431,6 +434,7 @@ static int sh_mobile_lcdc_setup_clocks(struct device *dev, int clock_source,
 
                clk_enable(priv->clk);
        }
+#endif
 
        return 0;
 }
@@ -688,10 +692,12 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
                fb_dealloc_cmap(&info->cmap);
        }
 
+#ifdef CONFIG_HAVE_CLK
        if (priv->clk) {
                clk_disable(priv->clk);
                clk_put(priv->clk);
        }
+#endif
 
        if (priv->base)
                iounmap(priv->base);
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
new file mode 100644 (file)
index 0000000..130102f
--- /dev/null
@@ -0,0 +1,72 @@
+#ifndef __ASM_SH_MOBILE_LCDC_H__
+#define __ASM_SH_MOBILE_LCDC_H__
+
+#include <linux/fb.h>
+
+enum { RGB8,   /* 24bpp, 8:8:8 */
+       RGB9,   /* 18bpp, 9:9 */
+       RGB12A, /* 24bpp, 12:12 */
+       RGB12B, /* 12bpp */
+       RGB16,  /* 16bpp */
+       RGB18,  /* 18bpp */
+       RGB24,  /* 24bpp */
+       SYS8A,  /* 24bpp, 8:8:8 */
+       SYS8B,  /* 18bpp, 8:8:2 */
+       SYS8C,  /* 18bpp, 2:8:8 */
+       SYS8D,  /* 16bpp, 8:8 */
+       SYS9,   /* 18bpp, 9:9 */
+       SYS12,  /* 24bpp, 12:12 */
+       SYS16A, /* 16bpp */
+       SYS16B, /* 18bpp, 16:2 */
+       SYS16C, /* 18bpp, 2:16 */
+       SYS18,  /* 18bpp */
+       SYS24 };/* 24bpp */
+
+enum { LCDC_CHAN_DISABLED = 0,
+       LCDC_CHAN_MAINLCD,
+       LCDC_CHAN_SUBLCD };
+
+enum { LCDC_CLK_BUS, LCDC_CLK_PERIPHERAL, LCDC_CLK_EXTERNAL };
+
+struct sh_mobile_lcdc_sys_bus_cfg {
+       unsigned long ldmt2r;
+       unsigned long ldmt3r;
+};
+
+struct sh_mobile_lcdc_sys_bus_ops {
+       void (*write_index)(void *handle, unsigned long data);
+       void (*write_data)(void *handle, unsigned long data);
+       unsigned long (*read_data)(void *handle);
+};
+
+struct sh_mobile_lcdc_board_cfg {
+       void *board_data;
+       int (*setup_sys)(void *board_data, void *sys_ops_handle,
+                        struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
+       void (*display_on)(void *board_data);
+       void (*display_off)(void *board_data);
+};
+
+struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
+       unsigned long width;
+       unsigned long height;
+};
+
+struct sh_mobile_lcdc_chan_cfg {
+       int chan;
+       int bpp;
+       int interface_type; /* selects RGBn or SYSn I/F, see above */
+       int clock_divider;
+       struct fb_videomode lcd_cfg;
+       struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg;
+       struct sh_mobile_lcdc_board_cfg board_cfg;
+       struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
+};
+
+struct sh_mobile_lcdc_info {
+       unsigned long lddckr;
+       int clock_source;
+       struct sh_mobile_lcdc_chan_cfg ch[2];
+};
+
+#endif /* __ASM_SH_MOBILE_LCDC_H__ */