Skip to content

Commit

Permalink
video: sh_mobile_lcdcfb: Support HAVE_CLK=n configurations.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Mundt committed Oct 1, 2008
1 parent bbfbd8b commit 225c9a8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion arch/sh/boards/board-ap325rxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion arch/sh/boards/mach-migor/lcd_qvga.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/boards/mach-migor/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#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
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/include/asm/migor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 7 additions & 1 deletion drivers/video/sh_mobile_lcdcfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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];
};
Expand Down Expand Up @@ -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)) {
Expand All @@ -431,6 +434,7 @@ static int sh_mobile_lcdc_setup_clocks(struct device *dev, int clock_source,

clk_enable(priv->clk);
}
#endif

return 0;
}
Expand Down Expand Up @@ -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);
Expand Down
File renamed without changes.

0 comments on commit 225c9a8

Please sign in to comment.