linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Cc: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Subject: [PATCH 06/15] OMAP: OMAPFB: fix clk_get for RFBI
Date: Fri, 08 Jan 2010 13:22:40 +0000	[thread overview]
Message-ID: <1262956969-1664-7-git-send-email-tomi.valkeinen@nokia.com> (raw)
In-Reply-To: <1262956969-1664-6-git-send-email-tomi.valkeinen@nokia.com>

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

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Tested-by: Sergey Lapin <slapin@ossfans.org>
---
 drivers/video/omap/dispc.c       |   18 +++---------------
 drivers/video/omap/omapfb.h      |    2 ++
 drivers/video/omap/omapfb_main.c |   18 ++++++++++++++++++
 drivers/video/omap/rfbi.c        |    4 ++--
 4 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c
index c7c6455..e192b05 100644
--- a/drivers/video/omap/dispc.c
+++ b/drivers/video/omap/dispc.c
@@ -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)
@@ -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);
@@ -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);
@@ -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 = {
diff --git a/drivers/video/omap/omapfb.h b/drivers/video/omap/omapfb.h
index 46e4714..af3c9e5 100644
--- a/drivers/video/omap/omapfb.h
+++ b/drivers/video/omap/omapfb.h
@@ -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
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index c7f59a5..f74aec9 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -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
@@ -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);
@@ -1814,8 +1821,16 @@ cleanup:
 
 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)
@@ -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;
 }
 
diff --git a/drivers/video/omap/rfbi.c b/drivers/video/omap/rfbi.c
index fed7b1b..1162603 100644
--- a/drivers/video/omap/rfbi.c
+++ b/drivers/video/omap/rfbi.c
@@ -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);
-- 
1.6.5


  reply	other threads:[~2010-01-08 13:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-08 13:22 [PATCH 00/15] OMAP DSS fixes Tomi Valkeinen
2010-01-08 13:22 ` [PATCH 01/15] OMAP: DSS2: DSI: fix VC channels in send_short and send_null Tomi Valkeinen
2010-01-08 13:22   ` [PATCH 02/15] OMAP: DSS2: DSI: print debug DCS cmd in hex Tomi Valkeinen
2010-01-08 13:22     ` [PATCH 03/15] OMAP: DSS2: Collect interrupt statistics Tomi Valkeinen
2010-01-08 13:22       ` [PATCH 04/15] OMAP: DSS2: Fix crash when panel doesn't define enable_te() Tomi Valkeinen
2010-01-08 13:22         ` [PATCH 05/15] OMAP: DSS2: RFBI: convert to new kfifo API Tomi Valkeinen
2010-01-08 13:22           ` Tomi Valkeinen [this message]
2010-01-08 13:22             ` [PATCH 07/15] OMAP: OMAPFB: add dummy release function for omapdss Tomi Valkeinen
2010-01-08 13:22               ` [PATCH 08/15] MAINTAINERS: change omapfb maintainer Tomi Valkeinen
2010-01-08 13:22                 ` [PATCH 09/15] MAINTAINERS: Combine DSS2 and OMAPFB2 into one entry Tomi Valkeinen
2010-01-08 13:22                   ` [PATCH 10/15] OMAP: DSS2: Fix compile warning Tomi Valkeinen
2010-01-08 13:22                     ` [PATCH 11/15] video/omap: add __init/__exit macros to drivers/video/omap/lcd_htcherald.c Tomi Valkeinen
2010-01-08 13:22                       ` [PATCH 12/15] OMAP: DSS2: OMAPFB: fix omapfb_free_fbmem() Tomi Valkeinen
2010-01-08 13:22                         ` [PATCH 13/15] OMAP: DSS2: Make check-delay-loops consistent Tomi Valkeinen
2010-01-08 13:22                           ` [PATCH 14/15] DSS2: Reject scaling settings when they cannot be supported Tomi Valkeinen
2010-01-08 13:22                             ` [PATCH 15/15] OMAP: DSS2: OMAPFB: fix crash when panel driver was not loaded Tomi Valkeinen
2010-01-11 11:46                   ` [PATCH 09/15] MAINTAINERS: Combine DSS2 and OMAPFB2 into one Grazvydas Ignotas
2010-01-08 16:52           ` [PATCH 05/15] OMAP: DSS2: RFBI: convert to new kfifo API Tony Lindgren
2010-01-11  9:09             ` Tomi Valkeinen
2010-01-11  9:25               ` Sergey Lapin
2010-01-12 10:35                 ` Tomi Valkeinen
2010-01-08 13:29   ` [PATCH 01/15] OMAP: DSS2: DSI: fix VC channels in send_short Aguirre, Sergio
2010-01-08 13:33     ` Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1262956969-1664-7-git-send-email-tomi.valkeinen@nokia.com \
    --to=tomi.valkeinen@nokia.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).