* [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer
@ 2010-04-30 16:07 Guennadi Liakhovetski
2010-05-01 12:08 ` [PATCH 2/2] sh: make interrupt resource optional in SH Magnus Damm
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Guennadi Liakhovetski @ 2010-04-30 16:07 UTC (permalink / raw)
To: linux-fbdev
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] sh: make interrupt resource optional in SH
2010-04-30 16:07 [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer Guennadi Liakhovetski
@ 2010-05-01 12:08 ` Magnus Damm
2010-05-01 12:15 ` [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer Guennadi Liakhovetski
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Magnus Damm @ 2010-05-01 12:08 UTC (permalink / raw)
To: linux-fbdev
On Sat, May 1, 2010 at 1:07 AM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> 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>
Why? Doesn't the LCDC hardware block always come with an IRQ line?
/ magnus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer
2010-04-30 16:07 [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer Guennadi Liakhovetski
2010-05-01 12:08 ` [PATCH 2/2] sh: make interrupt resource optional in SH Magnus Damm
@ 2010-05-01 12:15 ` Guennadi Liakhovetski
2010-05-01 12:43 ` [PATCH 2/2] sh: make interrupt resource optional in SH Magnus Damm
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Guennadi Liakhovetski @ 2010-05-01 12:15 UTC (permalink / raw)
To: linux-fbdev
On Sat, 1 May 2010, Magnus Damm wrote:
> On Sat, May 1, 2010 at 1:07 AM, Guennadi Liakhovetski
> <g.liakhovetski@gmx.de> wrote:
> > 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>
>
> Why? Doesn't the LCDC hardware block always come with an IRQ line?
Because on AP4 intcs is not supported in the mainline yet. And because we
can?;) Some code paths in the driver already care for the case, when no
IRQ is configured, so, we can just use it.
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] sh: make interrupt resource optional in SH
2010-04-30 16:07 [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer Guennadi Liakhovetski
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 ` 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
4 siblings, 0 replies; 6+ messages in thread
From: Magnus Damm @ 2010-05-01 12:43 UTC (permalink / raw)
To: linux-fbdev
On Sat, May 1, 2010 at 9:15 PM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> On Sat, 1 May 2010, Magnus Damm wrote:
>
>> On Sat, May 1, 2010 at 1:07 AM, Guennadi Liakhovetski
>> <g.liakhovetski@gmx.de> wrote:
>> > 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>
>>
>> Why? Doesn't the LCDC hardware block always come with an IRQ line?
>
> Because on AP4 intcs is not supported in the mainline yet. And because we
> can?;) Some code paths in the driver already care for the case, when no
> IRQ is configured, so, we can just use it.
Patches for INTCS have been posted for SH-Mobile ARM G3/G4/AP4. They
will be part of the upcoming .35 release. The merge order dependencies
are a bit tricky, so please apply whatever needed locally for now.
I don't agree with you that allowing people to not hook up an IRQ is a
good thing. The driver already has too many different modes of
operation, adding another one will just make it more error prone.
Trying to reduce the number of special cases is the way forward, not
making yet another one...
Thanks for the LCDC fixes though!
/ magnus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer driver
2010-04-30 16:07 [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer Guennadi Liakhovetski
` (2 preceding siblings ...)
2010-05-01 12:43 ` [PATCH 2/2] sh: make interrupt resource optional in SH Magnus Damm
@ 2010-05-01 12:55 ` Paul Mundt
2010-05-01 20:07 ` [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer Guennadi Liakhovetski
4 siblings, 0 replies; 6+ messages in thread
From: Paul Mundt @ 2010-05-01 12:55 UTC (permalink / raw)
To: linux-fbdev
On Sat, May 01, 2010 at 09:43:14PM +0900, Magnus Damm wrote:
> On Sat, May 1, 2010 at 9:15 PM, Guennadi Liakhovetski
> <g.liakhovetski@gmx.de> wrote:
> > On Sat, 1 May 2010, Magnus Damm wrote:
> >> Why? Doesn't the LCDC hardware block always come with an IRQ line?
> >
> > Because on AP4 intcs is not supported in the mainline yet. And because we
> > can?;) Some code paths in the driver already care for the case, when no
> > IRQ is configured, so, we can just use it.
>
> Patches for INTCS have been posted for SH-Mobile ARM G3/G4/AP4. They
> will be part of the upcoming .35 release. The merge order dependencies
> are a bit tricky, so please apply whatever needed locally for now.
>
> I don't agree with you that allowing people to not hook up an IRQ is a
> good thing. The driver already has too many different modes of
> operation, adding another one will just make it more error prone.
> Trying to reduce the number of special cases is the way forward, not
> making yet another one...
>
I tend to agree. Adding functionality for functionality's sake really
only creates an undue maintenance burden. If there are LCDC blocks that
don't have IRQ lines, then of course we will have to do something like
this. If we're just waiting on patches to get upstream in order to enable
the IRQs then I don't really see the point -- there are out of tree
patches we're waiting on in both cases, so this can only really be
considered a stop-gap until the intcs patches are merged anyways,
especially since we'll still want to enable the IRQs on AP4 once those
patches are merged.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer
2010-04-30 16:07 [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer Guennadi Liakhovetski
` (3 preceding siblings ...)
2010-05-01 12:55 ` [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer driver Paul Mundt
@ 2010-05-01 20:07 ` Guennadi Liakhovetski
4 siblings, 0 replies; 6+ messages in thread
From: Guennadi Liakhovetski @ 2010-05-01 20:07 UTC (permalink / raw)
To: linux-fbdev
On Sat, 1 May 2010, Magnus Damm wrote:
> On Sat, May 1, 2010 at 9:15 PM, Guennadi Liakhovetski
> <g.liakhovetski@gmx.de> wrote:
> > On Sat, 1 May 2010, Magnus Damm wrote:
> >
> >> On Sat, May 1, 2010 at 1:07 AM, Guennadi Liakhovetski
> >> <g.liakhovetski@gmx.de> wrote:
> >> > 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>
> >>
> >> Why? Doesn't the LCDC hardware block always come with an IRQ line?
> >
> > Because on AP4 intcs is not supported in the mainline yet. And because we
> > can?;) Some code paths in the driver already care for the case, when no
> > IRQ is configured, so, we can just use it.
>
> Patches for INTCS have been posted for SH-Mobile ARM G3/G4/AP4. They
> will be part of the upcoming .35 release. The merge order dependencies
> are a bit tricky, so please apply whatever needed locally for now.
Ah, sorry, I must have missed those patches. Sure, then just drop this
patch.
> I don't agree with you that allowing people to not hook up an IRQ is a
> good thing. The driver already has too many different modes of
> operation, adding another one will just make it more error prone.
> Trying to reduce the number of special cases is the way forward, not
> making yet another one...
>
> Thanks for the LCDC fixes though!
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-05-01 20:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-30 16:07 [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer Guennadi Liakhovetski
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
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).