Commit f778a12d authored by Tomi Valkeinen's avatar Tomi Valkeinen
Browse files

OMAP: OMAPFB: fix clk_get for RFBI



omapfb platform device was still used to get clocks inside rfbi.c

Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@nokia.com>
Tested-by: default avatarSergey Lapin <slapin@ossfans.org>
parent fc248a49
Loading
Loading
Loading
Loading
+3 −15
Original line number Original line Diff line number Diff line
@@ -189,11 +189,6 @@ static struct {
	struct omapfb_color_key	color_key;
	struct omapfb_color_key	color_key;
} dispc;
} dispc;


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

static void enable_lcd_clocks(int enable);
static void enable_lcd_clocks(int enable);


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


static int get_dss_clocks(void)
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)) {
	if (IS_ERR(dispc.dss_ick)) {
		dev_err(dispc.fbdev->dev, "can't get ick\n");
		dev_err(dispc.fbdev->dev, "can't get ick\n");
		return PTR_ERR(dispc.dss_ick);
		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)) {
	if (IS_ERR(dispc.dss1_fck)) {
		dev_err(dispc.fbdev->dev, "can't get dss1_fck\n");
		dev_err(dispc.fbdev->dev, "can't get dss1_fck\n");
		clk_put(dispc.dss_ick);
		clk_put(dispc.dss_ick);
		return PTR_ERR(dispc.dss1_fck);
		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)) {
	if (IS_ERR(dispc.dss_54m_fck)) {
		dev_err(dispc.fbdev->dev, "can't get tv_fck\n");
		dev_err(dispc.fbdev->dev, "can't get tv_fck\n");
		clk_put(dispc.dss_ick);
		clk_put(dispc.dss_ick);
@@ -1385,12 +1380,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
	int skip_init = 0;
	int skip_init = 0;
	int i;
	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));
	memset(&dispc, 0, sizeof(dispc));


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


const struct lcd_ctrl omap2_int_ctrl = {
const struct lcd_ctrl omap2_int_ctrl = {
+2 −0
Original line number Original line Diff line number Diff line
@@ -203,6 +203,8 @@ struct omapfb_device {


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

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


#ifdef CONFIG_ARCH_OMAP1
#ifdef CONFIG_ARCH_OMAP1
+18 −0
Original line number Original line Diff line number Diff line
@@ -83,6 +83,12 @@ static struct caps_table_struct color_caps[] = {
	{ 1 << OMAPFB_COLOR_YUY422,	"YUY422", },
	{ 1 << OMAPFB_COLOR_YUY422,	"YUY422", },
};
};


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

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


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


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


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

	BUG_ON(fbdev_pdev != NULL);
	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 */
	/* Delay actual initialization until the LCD is registered */
	fbdev_pdev = pdev;
	fbdev_pdev = pdev;
	if (fbdev_panel != NULL)
	if (fbdev_panel != NULL)
@@ -1843,6 +1858,9 @@ static int omapfb_remove(struct platform_device *pdev)
	fbdev->state = OMAPFB_DISABLED;
	fbdev->state = OMAPFB_DISABLED;
	omapfb_free_resources(fbdev, saved_state);
	omapfb_free_resources(fbdev, saved_state);


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

	return 0;
	return 0;
}
}


+2 −2
Original line number Original line Diff line number Diff line
@@ -83,13 +83,13 @@ static inline u32 rfbi_read_reg(int idx)


static int rfbi_get_clocks(void)
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)) {
	if (IS_ERR(rfbi.dss_ick)) {
		dev_err(rfbi.fbdev->dev, "can't get ick\n");
		dev_err(rfbi.fbdev->dev, "can't get ick\n");
		return PTR_ERR(rfbi.dss_ick);
		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)) {
	if (IS_ERR(rfbi.dss1_fck)) {
		dev_err(rfbi.fbdev->dev, "can't get dss1_fck\n");
		dev_err(rfbi.fbdev->dev, "can't get dss1_fck\n");
		clk_put(rfbi.dss_ick);
		clk_put(rfbi.dss_ick);