public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP Backlight driver
@ 2007-05-16 15:28 stefano babic
  2007-05-16 17:56 ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: stefano babic @ 2007-05-16 15:28 UTC (permalink / raw)
  To: linux-omap-open-source

Hi all,

in the actual repository the video backlight API is already updated to the new 
one in kernel 2.6.22-rc1 (include/linux/backlight.h).
Some drivers are updated,too.
However, the backlight driver for Omap (drivers/video/backlight/omap_bl.c) ist 
not yet updated to the new API and for this reason cannot be compiled.

I changed the file according to the new interface :

diff --git a/drivers/video/backlight/omap_bl.c 
b/drivers/video/backlight/omap_bl.c
index 3b57b27..a9532fd 100644
--- a/drivers/video/backlight/omap_bl.c
+++ b/drivers/video/backlight/omap_bl.c
@@ -109,34 +109,34 @@ static int omapbl_update_status(struct b
 {
 	struct omap_backlight *bl = class_get_devdata(&dev->class_dev);
 
-	if (bl->current_intensity != dev->props->brightness) {
-		if (dev->props->brightness < 0)
+	if (bl->current_intensity != dev->props.brightness) {
+		if (dev->props.brightness < 0)
 			return -EPERM;	/* Leave current_intensity untouched */
 
 		if (bl->powermode == FB_BLANK_UNBLANK)
-			omapbl_send_intensity(dev->props->brightness);
-		bl->current_intensity = dev->props->brightness;
+			omapbl_send_intensity(dev->props.brightness);
+		bl->current_intensity = dev->props.brightness;
 	}
 
-	if (dev->props->fb_blank != bl->powermode)
-		omapbl_set_power(dev, dev->props->fb_blank);
+	if (dev->props.fb_blank != bl->powermode)
+		omapbl_set_power(dev, dev->props.fb_blank);
 
 	return 0;
 }
 
+
 static int omapbl_get_intensity(struct backlight_device *dev)
 {
 	struct omap_backlight *bl = class_get_devdata(&dev->class_dev);
 	return bl->current_intensity;
 }
 
-static struct backlight_properties omapbl_data = {
-	.owner		= THIS_MODULE,
-	.get_brightness	= omapbl_get_intensity,
-	.update_status	= omapbl_update_status,
-	.max_brightness = OMAPBL_MAX_INTENSITY,
+static struct backlight_ops omapbl_ops = {
+	.get_brightness = omapbl_get_intensity,
+	.update_status  = omapbl_update_status,
 };
 
+
 static int omapbl_probe(struct platform_device *pdev)
 {
 	struct backlight_device *dev;
@@ -146,14 +146,14 @@ static int omapbl_probe(struct platform_
 	if (!pdata)
 		return -ENXIO;
 
-	omapbl_data.check_fb = pdata->check_fb;
+	omapbl_ops.check_fb = pdata->check_fb;
 
 	bl = kzalloc(sizeof(struct omap_backlight), GFP_KERNEL);
 	if (unlikely(!bl))
 		return -ENOMEM;
 
 	dev = backlight_device_register("omap-bl", &pdev->dev,
-			bl, &omapbl_data);
+			bl, &omapbl_ops);
 	if (IS_ERR(dev)) {
 		kfree(bl);
 		return PTR_ERR(dev);
@@ -169,8 +169,8 @@ static int omapbl_probe(struct platform_
 
 	omap_cfg_reg(PWL);	/* Conflicts with UART3 */
 
-	omapbl_data.fb_blank = FB_BLANK_UNBLANK;
-	omapbl_data.brightness = pdata->default_intensity;
+	dev->props.fb_blank = FB_BLANK_UNBLANK;
+	dev->props.brightness = pdata->default_intensity;
 	omapbl_update_status(dev);
 
 	printk(KERN_INFO "OMAP LCD backlight initialised\n");

Regards,
stefano b.

-- 
stefano <stefano.babic@babic.homelinux.org>
GPG Key: 0x55814DDE 
Fingerprint 4E85 2A66 4CBA 497A 2A7B D3BF 5973 F216 5581 4DDE

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

end of thread, other threads:[~2007-05-16 22:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-16 15:28 [PATCH] OMAP Backlight driver stefano babic
2007-05-16 17:56 ` Tony Lindgren
2007-05-16 19:38   ` stefano babic
2007-05-16 22:01     ` Tony Lindgren

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