Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
OMAP: OMAPFB: fix clk_get for RFBI
Browse files Browse the repository at this point in the history
omapfb platform device was still used to get clocks inside rfbi.c

Signed-off-by: Tomi Valkeinen <[email protected]>
Tested-by: Sergey Lapin <[email protected]>
  • Loading branch information
Tomi Valkeinen committed Jan 11, 2010
1 parent fc248a4 commit f778a12
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
18 changes: 3 additions & 15 deletions drivers/video/omap/dispc.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,6 @@ static struct {
struct omapfb_color_key color_key;
} dispc;

static struct platform_device omapdss_device = {
.name = "omapdss",
.id = -1,
};

static void enable_lcd_clocks(int enable);

static void inline dispc_write_reg(int idx, u32 val)
Expand Down Expand Up @@ -920,20 +915,20 @@ static irqreturn_t omap_dispc_irq_handler(int irq, void *dev)

static int get_dss_clocks(void)
{
dispc.dss_ick = clk_get(&omapdss_device.dev, "ick");
dispc.dss_ick = clk_get(&dispc.fbdev->dssdev->dev, "ick");
if (IS_ERR(dispc.dss_ick)) {
dev_err(dispc.fbdev->dev, "can't get ick\n");
return PTR_ERR(dispc.dss_ick);
}

dispc.dss1_fck = clk_get(&omapdss_device.dev, "dss1_fck");
dispc.dss1_fck = clk_get(&dispc.fbdev->dssdev->dev, "dss1_fck");
if (IS_ERR(dispc.dss1_fck)) {
dev_err(dispc.fbdev->dev, "can't get dss1_fck\n");
clk_put(dispc.dss_ick);
return PTR_ERR(dispc.dss1_fck);
}

dispc.dss_54m_fck = clk_get(&omapdss_device.dev, "tv_fck");
dispc.dss_54m_fck = clk_get(&dispc.fbdev->dssdev->dev, "tv_fck");
if (IS_ERR(dispc.dss_54m_fck)) {
dev_err(dispc.fbdev->dev, "can't get tv_fck\n");
clk_put(dispc.dss_ick);
Expand Down Expand Up @@ -1385,12 +1380,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
int skip_init = 0;
int i;

r = platform_device_register(&omapdss_device);
if (r) {
dev_err(fbdev->dev, "can't register omapdss device\n");
return r;
}

memset(&dispc, 0, sizeof(dispc));

dispc.base = ioremap(DISPC_BASE, SZ_1K);
Expand Down Expand Up @@ -1534,7 +1523,6 @@ static void omap_dispc_cleanup(void)
free_irq(INT_24XX_DSS_IRQ, dispc.fbdev);
put_dss_clocks();
iounmap(dispc.base);
platform_device_unregister(&omapdss_device);
}

const struct lcd_ctrl omap2_int_ctrl = {
Expand Down
2 changes: 2 additions & 0 deletions drivers/video/omap/omapfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ struct omapfb_device {

struct omapfb_mem_desc mem_desc;
struct fb_info *fb_info[OMAPFB_PLANE_NUM];

struct platform_device *dssdev; /* dummy dev for clocks */
};

#ifdef CONFIG_ARCH_OMAP1
Expand Down
18 changes: 18 additions & 0 deletions drivers/video/omap/omapfb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ static struct caps_table_struct color_caps[] = {
{ 1 << OMAPFB_COLOR_YUY422, "YUY422", },
};

/* dummy device for clocks */
static struct platform_device omapdss_device = {
.name = "omapdss",
.id = -1,
};

/*
* ---------------------------------------------------------------------------
* LCD panel
Expand Down Expand Up @@ -1700,6 +1706,7 @@ static int omapfb_do_probe(struct platform_device *pdev,

fbdev->dev = &pdev->dev;
fbdev->panel = panel;
fbdev->dssdev = &omapdss_device;
platform_set_drvdata(pdev, fbdev);

mutex_init(&fbdev->rqueue_mutex);
Expand Down Expand Up @@ -1814,8 +1821,16 @@ static int omapfb_do_probe(struct platform_device *pdev,

static int omapfb_probe(struct platform_device *pdev)
{
int r;

BUG_ON(fbdev_pdev != NULL);

r = platform_device_register(&omapdss_device);
if (r) {
dev_err(&pdev->dev, "can't register omapdss device\n");
return r;
}

/* Delay actual initialization until the LCD is registered */
fbdev_pdev = pdev;
if (fbdev_panel != NULL)
Expand Down Expand Up @@ -1843,6 +1858,9 @@ static int omapfb_remove(struct platform_device *pdev)
fbdev->state = OMAPFB_DISABLED;
omapfb_free_resources(fbdev, saved_state);

platform_device_unregister(&omapdss_device);
fbdev->dssdev = NULL;

return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/video/omap/rfbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ static inline u32 rfbi_read_reg(int idx)

static int rfbi_get_clocks(void)
{
rfbi.dss_ick = clk_get(rfbi.fbdev->dev, "ick");
rfbi.dss_ick = clk_get(&dispc.fbdev->dssdev->dev, "ick");
if (IS_ERR(rfbi.dss_ick)) {
dev_err(rfbi.fbdev->dev, "can't get ick\n");
return PTR_ERR(rfbi.dss_ick);
}

rfbi.dss1_fck = clk_get(rfbi.fbdev->dev, "dss1_fck");
rfbi.dss1_fck = clk_get(&dispc.fbdev->dssdev->dev, "dss1_fck");
if (IS_ERR(rfbi.dss1_fck)) {
dev_err(rfbi.fbdev->dev, "can't get dss1_fck\n");
clk_put(rfbi.dss_ick);
Expand Down

0 comments on commit f778a12

Please sign in to comment.