Linux Framebuffer Layer development
 help / color / mirror / Atom feed
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: linux-fbdev@vger.kernel.org
Subject: [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer
Date: Fri, 30 Apr 2010 16:07:14 +0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1004301805371.4055@axis700.grange> (raw)

The SH LCDC driver can also function without the IRQ, in which case the
FBIO_WAITFORVSYNC ioctl() cannot be supported. Enable such a mode.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/video/sh_mobile_lcdcfb.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index e498fb5..b8f7811 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -791,6 +791,9 @@ static int sh_mobile_wait_for_vsync(struct fb_info *info)
 	unsigned long ldintr;
 	int ret;
 
+	if (!ch->lcdc->irq)
+		return -ENOIOCTLCMD;
+
 	/* Enable VSync End interrupt */
 	ldintr = lcdc_read(ch->lcdc, _LDINTR);
 	ldintr |= LDINTR_VEE;
@@ -962,7 +965,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	i = platform_get_irq(pdev, 0);
-	if (!res || i < 0) {
+	if (!res) {
 		dev_err(&pdev->dev, "cannot get platform resources\n");
 		return -ENOENT;
 	}
@@ -975,14 +978,16 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, priv);
 
-	error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED,
-			    dev_name(&pdev->dev), priv);
-	if (error) {
-		dev_err(&pdev->dev, "unable to request irq\n");
-		goto err1;
+	if (i >= 0) {
+		error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED,
+				    dev_name(&pdev->dev), priv);
+		if (error) {
+			dev_err(&pdev->dev, "unable to request irq\n");
+			goto err1;
+		}
+		priv->irq = i;
 	}
 
-	priv->irq = i;
 	pdata = pdev->dev.platform_data;
 
 	j = 0;
-- 
1.6.2.4


             reply	other threads:[~2010-04-30 16:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-30 16:07 Guennadi Liakhovetski [this message]
2010-05-01 12:08 ` [PATCH 2/2] sh: make interrupt resource optional in SH Magnus Damm
2010-05-01 12:15 ` [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer Guennadi Liakhovetski
2010-05-01 12:43 ` [PATCH 2/2] sh: make interrupt resource optional in SH Magnus Damm
2010-05-01 12:55 ` [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer driver Paul Mundt
2010-05-01 20:07 ` [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer Guennadi Liakhovetski

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=Pine.LNX.4.64.1004301805371.4055@axis700.grange \
    --to=g.liakhovetski@gmx.de \
    --cc=linux-fbdev@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