Linux PWM subsystem development
 help / color / mirror / Atom feed
* [PATCH] Patch for pwm backlight driver
@ 2014-08-26 21:14 Yang, Robert
  2014-08-27  5:44 ` Thierry Reding
  0 siblings, 1 reply; 2+ messages in thread
From: Yang, Robert @ 2014-08-26 21:14 UTC (permalink / raw)
  To: thierry.reding@gmail.com
  Cc: linux-pwm@vger.kernel.org, torvalds@linux-foundation.org


[-- Attachment #1.1: Type: text/plain, Size: 2584 bytes --]

Hi Thierry,



Attached is a patch which will fix a bug in the video/pwm backlight driver if multiple pwm chips exist. The defect could cause the backlight driver use the wrong pwm chip and fail finally and also lock up the unattended pwm. The patch will allow a deferral pwm backlight probing if the attended pwm driver is not loaded yet.



This patch is currently against a linux 3.16 kernel.

The technology in this patch is architecture-independent.

Please let me know any feedback you have on this patch or the approach used.

Thanks,


Signed-off-by: Robert Yang <ryang@hach.com>

Robert Yang | Sr. Software Engineer
P 970.6631377 ext 2626
Hach Company | www.hach.com<http://www.hach.com/> |ryang@hach.com<mailto:|email@hach.com>

Water analysis has to be right. You deserve complete solutions you can be fully confident in. Hach is your resource for expert answers, outstanding support, and reliable, easy-to-use products.

--- linux-linux-3.16/pwm_bl.c.orig              2014-08-26 14:26:02.210580989 -0600
+++ ./linux-linux-3.16/drivers/video/backlight/pwm_bl.c   2014-08-26 14:26:45.318582726 -0600
@@ -281,15 +281,9 @@ static int pwm_backlight_probe(struct pl
               pb->pwm = devm_pwm_get(&pdev->dev, NULL);
              if (IS_ERR(pb->pwm)) {
-                             dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n");
+                            dev_err(&pdev->dev, "unable to request PWM, trying a deferral binding later\n");
                             ret = PTR_ERR(pb->pwm);
-
-                             pb->pwm = pwm_request(data->pwm_id, "pwm-backlight");
-                             if (IS_ERR(pb->pwm)) {
-                                            dev_err(&pdev->dev, "unable to request legacy PWM\n");
-                                            ret = PTR_ERR(pb->pwm);
-                                            goto err_alloc;
-                             }
+                            goto err_alloc;
              }
               dev_dbg(&pdev->dev, "got pwm for backlight\n");

Please be advised that this email may contain confidential information. If you are not the intended recipient, please notify us by email by replying to the sender and delete this message. The sender disclaims that the content of this email constitutes an offer to enter into, or the acceptance of, any agreement; provided that the foregoing does not invalidate the binding effect of any digital or other electronic reproduction of a manual signature that is included in any attachment.

[-- Attachment #1.2: Type: text/html, Size: 9590 bytes --]

[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 749 bytes --]

--- linux-linux-3.16/pwm_bl.c.orig	2014-08-26 14:26:02.210580989 -0600
+++ ./linux-linux-3.16/drivers/video/backlight/pwm_bl.c	2014-08-26 14:26:45.318582726 -0600
@@ -281,15 +281,9 @@ static int pwm_backlight_probe(struct pl
 
 	pb->pwm = devm_pwm_get(&pdev->dev, NULL);
 	if (IS_ERR(pb->pwm)) {
-		dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n");
+		dev_err(&pdev->dev, "unable to request PWM, trying a deferral binding later\n");
 		ret = PTR_ERR(pb->pwm);
-
-		pb->pwm = pwm_request(data->pwm_id, "pwm-backlight");
-		if (IS_ERR(pb->pwm)) {
-			dev_err(&pdev->dev, "unable to request legacy PWM\n");
-			ret = PTR_ERR(pb->pwm);
-			goto err_alloc;
-		}
+		goto err_alloc;
 	}
 
 	dev_dbg(&pdev->dev, "got pwm for backlight\n");

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

end of thread, other threads:[~2014-08-27  5:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-26 21:14 [PATCH] Patch for pwm backlight driver Yang, Robert
2014-08-27  5:44 ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox