[oe-commits] org.oe.dev linux: updated progear backlight support

hrw commit openembedded-commits at lists.openembedded.org
Tue Feb 13 16:03:43 UTC 2007


linux: updated progear backlight support

Author: hrw at openembedded.org
Branch: org.openembedded.dev
Revision: 762759b3b4d3a2e666f5c0ac9446fabdc7617929
ViewMTN: http://monotone.openembedded.org/revision.psp?id=762759b3b4d3a2e666f5c0ac9446fabdc7617929
Files:
1
packages/linux/linux/progear/progear_bl-r6.patch
Diffs:

#
# mt diff -r2b7851249db23b5e0ec0c3cd08f2eedfd98916fc -r762759b3b4d3a2e666f5c0ac9446fabdc7617929
#
# 
# 
# patch "packages/linux/linux/progear/progear_bl-r6.patch"
#  from [16429f71a585293f576a90b1e59c43d517b46a43]
#    to [757c3fadb014307f56e2ee27c7dac5ac93dabcf7]
# 
============================================================
--- packages/linux/linux/progear/progear_bl-r6.patch	16429f71a585293f576a90b1e59c43d517b46a43
+++ packages/linux/linux/progear/progear_bl-r6.patch	757c3fadb014307f56e2ee27c7dac5ac93dabcf7
@@ -7,35 +7,34 @@ Signed-Off-By: Marcin Juszkiewicz <opene
 Signed-Off-By: Marcin Juszkiewicz <openembedded at hrw.one.pl>
 
 ---
-Patch follow kernel version 2.6.19-rc6
+Patch follow kernel version 2.6.20
 
  Kconfig      |    8 +++
- Makefile     |    1
- progear_bl.c |  155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 164 insertions(+)
+ Makefile     |    1 
+ progear_bl.c |  154 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 163 insertions(+)
 
-
-Index: linux-2.6.20/drivers/video/backlight/Kconfig
+Index: git/drivers/video/backlight/Kconfig
 ===================================================================
---- linux-2.6.20.orig/drivers/video/backlight/Kconfig	2007-02-04 19:44:54.000000000 +0100
-+++ linux-2.6.20/drivers/video/backlight/Kconfig	2007-02-05 16:13:13.000000000 +0100
+--- git.orig/drivers/video/backlight/Kconfig	2006-12-29 17:31:36.511043439 +0100
++++ git/drivers/video/backlight/Kconfig	2007-02-07 08:57:31.020095845 +0100
 @@ -66,3 +66,11 @@
  	  If you have a HP Jornada 680, say y to enable the
  	  backlight driver.
  
 +config BACKLIGHT_PROGEAR
 +       tristate "Frontpath ProGear Backlight Driver"
-+       depends on BACKLIGHT_DEVICE && PCI
++       depends on BACKLIGHT_DEVICE && PCI && X86
 +       default y
 +       help
 +         If you have a Frontpath ProGear say Y to enable the
 +         backlight driver.
 +
-Index: linux-2.6.20/drivers/video/backlight/progear_bl.c
+Index: git/drivers/video/backlight/progear_bl.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20/drivers/video/backlight/progear_bl.c	2007-02-05 16:29:14.000000000 +0100
-@@ -0,0 +1,157 @@
++++ git/drivers/video/backlight/progear_bl.c	2007-02-07 08:55:46.813993140 +0100
+@@ -0,0 +1,154 @@
 +/*
 + *  Backlight Driver for Frontpath ProGear HX1050+
 + *
@@ -68,123 +67,120 @@ Index: linux-2.6.20/drivers/video/backli
 +#define HW_LEVEL_MAX           0x77
 +#define HW_LEVEL_MIN           0x4f
 +
-+static int progearbl_intensity;
-+static struct backlight_properties progearbl_data;
-+static struct backlight_device *progear_backlight_device;
-+
 +static struct pci_dev *pmu_dev = NULL;
 +static struct pci_dev *sb_dev = NULL;
 +
-+static int progearbl_send_intensity(struct backlight_device *bd)
++static int progearbl_set_intensity(struct backlight_device *bd)
 +{
-+       int intensity = bd->props->brightness;
++	int intensity = bd->props->brightness;
 +
-+       if (bd->props->power != FB_BLANK_UNBLANK)
-+               intensity = 0;
-+       if (bd->props->fb_blank != FB_BLANK_UNBLANK)
-+               intensity = 0;
++	if (bd->props->power != FB_BLANK_UNBLANK)
++		intensity = 0;
++	if (bd->props->fb_blank != FB_BLANK_UNBLANK)
++		intensity = 0;
 +
-+       pci_write_config_byte(pmu_dev, PMU_LPCR, intensity + HW_LEVEL_MIN);
++	pci_write_config_byte(pmu_dev, PMU_LPCR, intensity + HW_LEVEL_MIN);
 +
-+       progearbl_intensity = intensity;
-+
-+       return 0;
++	return 0;
 +}
 +
 +static int progearbl_get_intensity(struct backlight_device *bd)
 +{
-+       return progearbl_intensity;
-+}
++	u8 intensity;
++	pci_read_config_byte(pmu_dev, PMU_LPCR, &intensity);
 +
-+static int progearbl_set_intensity(struct backlight_device *bd)
-+{
-+       progearbl_send_intensity(progear_backlight_device);
-+
-+       return 0;
++	return intensity - HW_LEVEL_MIN;
 +}
 +
 +static struct backlight_properties progearbl_data = {
-+       .owner = THIS_MODULE,
-+       .get_brightness = progearbl_get_intensity,
-+       .update_status = progearbl_set_intensity,
++	.owner = THIS_MODULE,
++	.get_brightness = progearbl_get_intensity,
++	.update_status = progearbl_set_intensity,
 +};
 +
 +static int progearbl_probe(struct platform_device *pdev)
 +{
-+       u8 temp;
++	u8 temp;
++	struct backlight_device *progear_backlight_device;
 +
-+       pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, 0);
-+       if (!pmu_dev) {
-+               printk("ALI M7101 PMU not found.\n");
-+               return -ENODEV;
-+       }
++	pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, 0);
++	if (!pmu_dev) {
++		printk("ALI M7101 PMU not found.\n");
++		return -ENODEV;
++	}
 +
-+       sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, 0);
-+       if (!sb_dev) {
-+               printk("ALI 1533 SB not found.\n");
-+               pci_dev_put(pmu_dev);
-+               return -ENODEV;
-+       }
++	sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, 0);
++	if (!sb_dev) {
++		printk("ALI 1533 SB not found.\n");
++		pci_dev_put(pmu_dev);
++		return -ENODEV;
++	}
 +
-+       /*     Set SB_MPS1 to enable brightness control. */
-+       pci_read_config_byte(sb_dev, SB_MPS1, &temp);
-+       pci_write_config_byte(sb_dev, SB_MPS1, temp | 0x20);
++	/*     Set SB_MPS1 to enable brightness control. */
++	pci_read_config_byte(sb_dev, SB_MPS1, &temp);
++	pci_write_config_byte(sb_dev, SB_MPS1, temp | 0x20);
 +
-+       progear_backlight_device = backlight_device_register("progear-bl",
-+			   &pdev->dev, NULL, &progearbl_data);
-+       if (IS_ERR(progear_backlight_device))
-+               return PTR_ERR(progear_backlight_device);
++	progear_backlight_device = backlight_device_register("progear-bl",
++							     &pdev->dev, NULL,
++							     &progearbl_data);
++	if (IS_ERR(progear_backlight_device))
++		return PTR_ERR(progear_backlight_device);
 +
-+       progearbl_data.power = FB_BLANK_UNBLANK;
-+       progearbl_data.brightness = HW_LEVEL_MAX - HW_LEVEL_MIN;
-+       progearbl_data.max_brightness = HW_LEVEL_MAX - HW_LEVEL_MIN;
-+       progearbl_send_intensity(progear_backlight_device);
++	platform_set_drvdata(pdev, progear_backlight_device);
 +
-+       return 0;
++	progearbl_data.power = FB_BLANK_UNBLANK;
++	progearbl_data.brightness = HW_LEVEL_MAX - HW_LEVEL_MIN;
++	progearbl_data.max_brightness = HW_LEVEL_MAX - HW_LEVEL_MIN;
++	progearbl_set_intensity(progear_backlight_device);
++
++	return 0;
 +}
 +
-+static int progearbl_remove(struct platform_device *dev)
++static int progearbl_remove(struct platform_device *pdev)
 +{
-+       backlight_device_unregister(progear_backlight_device);
++	struct backlight_device *bd = platform_get_drvdata(pdev);
++	backlight_device_unregister(bd);
 +
-+       return 0;
++	return 0;
 +}
 +
 +static struct platform_driver progearbl_driver = {
-+       .probe = progearbl_probe,
-+       .remove = progearbl_remove,
-+       .driver = {
-+                  .name = "progear-bl",
-+                  },
++	.probe = progearbl_probe,
++	.remove = progearbl_remove,
++	.driver = {
++		   .name = "progear-bl",
++		   },
 +};
 +
 +static struct platform_device *progearbl_device;
 +
 +static int __init progearbl_init(void)
 +{
-+       int ret = platform_driver_register(&progearbl_driver);
-+       if (!ret) {
-+               progearbl_device = platform_device_alloc("progear-bl", -1);
-+               if (!progearbl_device)
-+                       return -ENOMEM;
++	int ret = platform_driver_register(&progearbl_driver);
 +
-+               ret = platform_device_add(progearbl_device);
++	if (!ret) {
++		progearbl_device = platform_device_alloc("progear-bl", -1);
++		if (!progearbl_device)
++			return -ENOMEM;
 +
-+               if (ret) {
-+                       platform_device_put(progearbl_device);
-+                       platform_driver_unregister(&progearbl_driver);
-+               }
-+       }
-+       return ret;
++		ret = platform_device_add(progearbl_device);
++
++		if (ret) {
++			platform_device_put(progearbl_device);
++			platform_driver_unregister(&progearbl_driver);
++		}
++	}
++
++	return ret;
 +}
 +
 +static void __exit progearbl_exit(void)
 +{
-+       pci_dev_put(pmu_dev);
-+       pci_dev_put(sb_dev);
++	pci_dev_put(pmu_dev);
++	pci_dev_put(sb_dev);
 +
-+       platform_device_unregister(progearbl_device);
-+       platform_driver_unregister(&progearbl_driver);
++	platform_device_unregister(progearbl_device);
++	platform_driver_unregister(&progearbl_driver);
 +}
 +
 +module_init(progearbl_init);
@@ -193,10 +189,10 @@ Index: linux-2.6.20/drivers/video/backli
 +MODULE_AUTHOR("Marcin Juszkiewicz <linux at hrw.one.pl>");
 +MODULE_DESCRIPTION("ProGear Backlight Driver");
 +MODULE_LICENSE("GPL");
-Index: linux-2.6.20/drivers/video/backlight/Makefile
+Index: git/drivers/video/backlight/Makefile
 ===================================================================
---- linux-2.6.20.orig/drivers/video/backlight/Makefile	2007-02-04 19:44:54.000000000 +0100
-+++ linux-2.6.20/drivers/video/backlight/Makefile	2007-02-05 16:13:13.000000000 +0100
+--- git.orig/drivers/video/backlight/Makefile	2006-12-29 17:31:36.511043439 +0100
++++ git/drivers/video/backlight/Makefile	2007-02-06 21:34:54.503712923 +0100
 @@ -5,3 +5,4 @@
  obj-$(CONFIG_BACKLIGHT_CORGI)	+= corgi_bl.o
  obj-$(CONFIG_BACKLIGHT_HP680)	+= hp680_bl.o






More information about the Openembedded-commits mailing list