linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 4/6] pwm_backlight: Add deferred probe support
@ 2012-07-24 14:40 Laurent Pinchart
  2012-08-25  6:57 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Laurent Pinchart @ 2012-07-24 14:40 UTC (permalink / raw)
  To: linux-sh

If the PWM instance is not available yet at probe time, request a
deferred probe.

A better way to fix might be to create a PWM subsystem (possibly
integrated into the GPIO subsystem) to support generic PWM objects, and
make sure the subsystem gets initialized first.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Simon Horman <horms@verge.net.au>
---
 drivers/video/backlight/pwm_bl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 342b7d7..5df8b91 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -121,6 +121,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 	if (IS_ERR(pb->pwm)) {
 		dev_err(&pdev->dev, "unable to request PWM for backlight\n");
 		ret = PTR_ERR(pb->pwm);
+		if (ret = -ENODEV)
+			ret = -EPROBE_DEFER;
 		goto err_alloc;
 	} else
 		dev_dbg(&pdev->dev, "got pwm for backlight\n");
-- 
1.7.8.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 4/6] pwm_backlight: Add deferred probe support
  2012-07-24 14:40 [PATCH v2 4/6] pwm_backlight: Add deferred probe support Laurent Pinchart
@ 2012-08-25  6:57 ` Simon Horman
  2012-09-19 18:27 ` Laurent Pinchart
  2012-09-20  1:52 ` Simon Horman
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2012-08-25  6:57 UTC (permalink / raw)
  To: linux-sh

On Tue, Jul 24, 2012 at 04:40:21PM +0200, Laurent Pinchart wrote:
> If the PWM instance is not available yet at probe time, request a
> deferred probe.
> 
> A better way to fix might be to create a PWM subsystem (possibly
> integrated into the GPIO subsystem) to support generic PWM objects, and
> make sure the subsystem gets initialized first.

Hi Richard,

I am wondering if you have had a chance to review this change.
I believe that it is a pre-requisite for work that Laurent has
done to enable the backlight on the Armadillo 800 EVA board.

If the change is ok I am happy to take it through
my shmobile tree if that makes life easier for you.

Below is an updated version of the patch which applies on top of 3.6-rc3.

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

pwm_backlight: Add deferred probe support

If the PWM instance is not available yet at probe time, request a
deferred probe.

A better way to fix might be to create a PWM subsystem (possibly
integrated into the GPIO subsystem) to support generic PWM objects, and
make sure the subsystem gets initialized first.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms@verge.net.au>

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 995f016..cc71f87 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -221,6 +221,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 		if (IS_ERR(pb->pwm)) {
 			dev_err(&pdev->dev, "unable to request legacy PWM\n");
 			ret = PTR_ERR(pb->pwm);
+			if (ret = -ENODEV)
+				ret = -EPROBE_DEFER;
 			goto err_alloc;
 		}
 	}

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 4/6] pwm_backlight: Add deferred probe support
  2012-07-24 14:40 [PATCH v2 4/6] pwm_backlight: Add deferred probe support Laurent Pinchart
  2012-08-25  6:57 ` Simon Horman
@ 2012-09-19 18:27 ` Laurent Pinchart
  2012-09-20  1:52 ` Simon Horman
  2 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2012-09-19 18:27 UTC (permalink / raw)
  To: linux-sh

Hi Simon,

On Saturday 25 August 2012 15:57:12 Simon Horman wrote:
> On Tue, Jul 24, 2012 at 04:40:21PM +0200, Laurent Pinchart wrote:
> > If the PWM instance is not available yet at probe time, request a
> > deferred probe.
> > 
> > A better way to fix might be to create a PWM subsystem (possibly
> > integrated into the GPIO subsystem) to support generic PWM objects, and
> > make sure the subsystem gets initialized first.
> 
> Hi Richard,
> 
> I am wondering if you have had a chance to review this change.
> I believe that it is a pre-requisite for work that Laurent has
> done to enable the backlight on the Armadillo 800 EVA board.

The PWM core now returns -EPROBE_DEFER if pwm_get() or pwm_request() can't 
find the requested device, so this patch isn't needed anymore.

> If the change is ok I am happy to take it through
> my shmobile tree if that makes life easier for you.
> 
> Below is an updated version of the patch which applies on top of 3.6-rc3.
> 
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> pwm_backlight: Add deferred probe support
> 
> If the PWM instance is not available yet at probe time, request a
> deferred probe.
> 
> A better way to fix might be to create a PWM subsystem (possibly
> integrated into the GPIO subsystem) to support generic PWM objects, and
> make sure the subsystem gets initialized first.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>
> 
> diff --git a/drivers/video/backlight/pwm_bl.c
> b/drivers/video/backlight/pwm_bl.c index 995f016..cc71f87 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -221,6 +221,8 @@ static int pwm_backlight_probe(struct platform_device
> *pdev) if (IS_ERR(pb->pwm)) {
>  			dev_err(&pdev->dev, "unable to request legacy PWM\n");
>  			ret = PTR_ERR(pb->pwm);
> +			if (ret = -ENODEV)
> +				ret = -EPROBE_DEFER;
>  			goto err_alloc;
>  		}
>  	}
-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 4/6] pwm_backlight: Add deferred probe support
  2012-07-24 14:40 [PATCH v2 4/6] pwm_backlight: Add deferred probe support Laurent Pinchart
  2012-08-25  6:57 ` Simon Horman
  2012-09-19 18:27 ` Laurent Pinchart
@ 2012-09-20  1:52 ` Simon Horman
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2012-09-20  1:52 UTC (permalink / raw)
  To: linux-sh

On Wed, Sep 19, 2012 at 08:27:55PM +0200, Laurent Pinchart wrote:
> Hi Simon,
> 
> On Saturday 25 August 2012 15:57:12 Simon Horman wrote:
> > On Tue, Jul 24, 2012 at 04:40:21PM +0200, Laurent Pinchart wrote:
> > > If the PWM instance is not available yet at probe time, request a
> > > deferred probe.
> > > 
> > > A better way to fix might be to create a PWM subsystem (possibly
> > > integrated into the GPIO subsystem) to support generic PWM objects, and
> > > make sure the subsystem gets initialized first.
> > 
> > Hi Richard,
> > 
> > I am wondering if you have had a chance to review this change.
> > I believe that it is a pre-requisite for work that Laurent has
> > done to enable the backlight on the Armadillo 800 EVA board.
> 
> The PWM core now returns -EPROBE_DEFER if pwm_get() or pwm_request() can't 
> find the requested device, so this patch isn't needed anymore.

Thanks, case closed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-20  1:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-24 14:40 [PATCH v2 4/6] pwm_backlight: Add deferred probe support Laurent Pinchart
2012-08-25  6:57 ` Simon Horman
2012-09-19 18:27 ` Laurent Pinchart
2012-09-20  1:52 ` Simon Horman

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).