Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight

* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight:
backlight: panasonic-laptop - Fix incomplete registration failure handling
backlight: msi-laptop, msi-wmi: fix incomplete registration failure handling
backlight: blackfin - Fix missing registration failure handling
backlight: classmate-laptop - Fix missing registration failure handling
backlight: mbp_nvidia_bl - add five more MacBook variants
backlight: Allow properties to be passed at registration
backlight: Add backlight_device parameter to check_fb
video: backlight/progear, fix pci device refcounting
backlight: l4f00242t03: Fix module licence absence.
backlight: Revert some const qualifiers
backlight: Add Epson L4F00242T03 LCD driver

+658 -167
+6 -3
drivers/acpi/video.c
··· 998 } 999 1000 if (acpi_video_backlight_support()) { 1001 int result; 1002 static int count = 0; 1003 char *name; ··· 1011 return; 1012 1013 sprintf(name, "acpi_video%d", count++); 1014 - device->backlight = backlight_device_register(name, 1015 - NULL, device, &acpi_backlight_ops); 1016 kfree(name); 1017 if (IS_ERR(device->backlight)) 1018 return; 1019 - device->backlight->props.max_brightness = device->brightness->count-3; 1020 1021 result = sysfs_create_link(&device->backlight->dev.kobj, 1022 &device->dev->dev.kobj, "device");
··· 998 } 999 1000 if (acpi_video_backlight_support()) { 1001 + struct backlight_properties props; 1002 int result; 1003 static int count = 0; 1004 char *name; ··· 1010 return; 1011 1012 sprintf(name, "acpi_video%d", count++); 1013 + memset(&props, 0, sizeof(struct backlight_properties)); 1014 + props.max_brightness = device->brightness->count - 3; 1015 + device->backlight = backlight_device_register(name, NULL, device, 1016 + &acpi_backlight_ops, 1017 + &props); 1018 kfree(name); 1019 if (IS_ERR(device->backlight)) 1020 return; 1021 1022 result = sysfs_create_link(&device->backlight->dev.kobj, 1023 &device->dev->dev.kobj, "device");
+8 -4
drivers/gpu/drm/nouveau/nouveau_backlight.c
··· 89 90 static int nouveau_nv40_backlight_init(struct drm_device *dev) 91 { 92 struct drm_nouveau_private *dev_priv = dev->dev_private; 93 struct backlight_device *bd; 94 95 if (!(nv_rd32(dev, NV40_PMC_BACKLIGHT) & NV40_PMC_BACKLIGHT_MASK)) 96 return 0; 97 98 bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev, 99 - &nv40_bl_ops); 100 if (IS_ERR(bd)) 101 return PTR_ERR(bd); 102 103 dev_priv->backlight = bd; 104 - bd->props.max_brightness = 31; 105 bd->props.brightness = nv40_get_intensity(bd); 106 backlight_update_status(bd); 107 ··· 112 113 static int nouveau_nv50_backlight_init(struct drm_device *dev) 114 { 115 struct drm_nouveau_private *dev_priv = dev->dev_private; 116 struct backlight_device *bd; 117 118 if (!nv_rd32(dev, NV50_PDISPLAY_SOR_BACKLIGHT)) 119 return 0; 120 121 bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev, 122 - &nv50_bl_ops); 123 if (IS_ERR(bd)) 124 return PTR_ERR(bd); 125 126 dev_priv->backlight = bd; 127 - bd->props.max_brightness = 1025; 128 bd->props.brightness = nv50_get_intensity(bd); 129 backlight_update_status(bd); 130 return 0;
··· 89 90 static int nouveau_nv40_backlight_init(struct drm_device *dev) 91 { 92 + struct backlight_properties props; 93 struct drm_nouveau_private *dev_priv = dev->dev_private; 94 struct backlight_device *bd; 95 96 if (!(nv_rd32(dev, NV40_PMC_BACKLIGHT) & NV40_PMC_BACKLIGHT_MASK)) 97 return 0; 98 99 + memset(&props, 0, sizeof(struct backlight_properties)); 100 + props.max_brightness = 31; 101 bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev, 102 + &nv40_bl_ops, &props); 103 if (IS_ERR(bd)) 104 return PTR_ERR(bd); 105 106 dev_priv->backlight = bd; 107 bd->props.brightness = nv40_get_intensity(bd); 108 backlight_update_status(bd); 109 ··· 110 111 static int nouveau_nv50_backlight_init(struct drm_device *dev) 112 { 113 + struct backlight_properties props; 114 struct drm_nouveau_private *dev_priv = dev->dev_private; 115 struct backlight_device *bd; 116 117 if (!nv_rd32(dev, NV50_PDISPLAY_SOR_BACKLIGHT)) 118 return 0; 119 120 + memset(&props, 0, sizeof(struct backlight_properties)); 121 + props.max_brightness = 1025; 122 bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev, 123 + &nv50_bl_ops, &props); 124 if (IS_ERR(bd)) 125 return PTR_ERR(bd); 126 127 dev_priv->backlight = bd; 128 bd->props.brightness = nv50_get_intensity(bd); 129 backlight_update_status(bd); 130 return 0;
+5 -2
drivers/macintosh/via-pmu-backlight.c
··· 144 145 void __init pmu_backlight_init() 146 { 147 struct backlight_device *bd; 148 char name[10]; 149 int level, autosave; ··· 162 163 snprintf(name, sizeof(name), "pmubl"); 164 165 - bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data); 166 if (IS_ERR(bd)) { 167 printk(KERN_ERR "PMU Backlight registration failed\n"); 168 return; 169 } 170 uses_pmu_bl = 1; 171 - bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 172 pmu_backlight_init_curve(0x7F, 0x46, 0x0E); 173 174 level = bd->props.max_brightness;
··· 144 145 void __init pmu_backlight_init() 146 { 147 + struct backlight_properties props; 148 struct backlight_device *bd; 149 char name[10]; 150 int level, autosave; ··· 161 162 snprintf(name, sizeof(name), "pmubl"); 163 164 + memset(&props, 0, sizeof(struct backlight_properties)); 165 + props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 166 + bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data, 167 + &props); 168 if (IS_ERR(bd)) { 169 printk(KERN_ERR "PMU Backlight registration failed\n"); 170 return; 171 } 172 uses_pmu_bl = 1; 173 pmu_backlight_init_curve(0x7F, 0x46, 0x0E); 174 175 level = bd->props.max_brightness;
+5 -2
drivers/platform/x86/acer-wmi.c
··· 922 923 static int __devinit acer_backlight_init(struct device *dev) 924 { 925 struct backlight_device *bd; 926 927 - bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops); 928 if (IS_ERR(bd)) { 929 printk(ACER_ERR "Could not register Acer backlight device\n"); 930 acer_backlight_device = NULL; ··· 939 940 bd->props.power = FB_BLANK_UNBLANK; 941 bd->props.brightness = read_brightness(bd); 942 - bd->props.max_brightness = max_brightness; 943 backlight_update_status(bd); 944 return 0; 945 }
··· 922 923 static int __devinit acer_backlight_init(struct device *dev) 924 { 925 + struct backlight_properties props; 926 struct backlight_device *bd; 927 928 + memset(&props, 0, sizeof(struct backlight_properties)); 929 + props.max_brightness = max_brightness; 930 + bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops, 931 + &props); 932 if (IS_ERR(bd)) { 933 printk(ACER_ERR "Could not register Acer backlight device\n"); 934 acer_backlight_device = NULL; ··· 935 936 bd->props.power = FB_BLANK_UNBLANK; 937 bd->props.brightness = read_brightness(bd); 938 backlight_update_status(bd); 939 return 0; 940 }
+5 -2
drivers/platform/x86/asus-laptop.c
··· 639 { 640 struct backlight_device *bd; 641 struct device *dev = &asus->platform_device->dev; 642 643 if (!acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_GET, NULL) && 644 !acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_SET, NULL) && 645 lcd_switch_handle) { 646 bd = backlight_device_register(ASUS_LAPTOP_FILE, dev, 647 - asus, &asusbl_ops); 648 if (IS_ERR(bd)) { 649 pr_err("Could not register asus backlight device\n"); 650 asus->backlight_device = NULL; ··· 657 658 asus->backlight_device = bd; 659 660 - bd->props.max_brightness = 15; 661 bd->props.power = FB_BLANK_UNBLANK; 662 bd->props.brightness = asus_read_brightness(bd); 663 backlight_update_status(bd);
··· 639 { 640 struct backlight_device *bd; 641 struct device *dev = &asus->platform_device->dev; 642 + struct backlight_properties props; 643 644 if (!acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_GET, NULL) && 645 !acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_SET, NULL) && 646 lcd_switch_handle) { 647 + memset(&props, 0, sizeof(struct backlight_properties)); 648 + props.max_brightness = 15; 649 + 650 bd = backlight_device_register(ASUS_LAPTOP_FILE, dev, 651 + asus, &asusbl_ops, &props); 652 if (IS_ERR(bd)) { 653 pr_err("Could not register asus backlight device\n"); 654 asus->backlight_device = NULL; ··· 653 654 asus->backlight_device = bd; 655 656 bd->props.power = FB_BLANK_UNBLANK; 657 bd->props.brightness = asus_read_brightness(bd); 658 backlight_update_status(bd);
+5 -2
drivers/platform/x86/asus_acpi.c
··· 1481 1482 static int __init asus_acpi_init(void) 1483 { 1484 int result; 1485 1486 result = acpi_bus_register_driver(&asus_hotk_driver); ··· 1508 return -ENODEV; 1509 } 1510 1511 asus_backlight_device = backlight_device_register("asus", NULL, NULL, 1512 - &asus_backlight_data); 1513 if (IS_ERR(asus_backlight_device)) { 1514 printk(KERN_ERR "Could not register asus backlight device\n"); 1515 asus_backlight_device = NULL; 1516 asus_acpi_exit(); 1517 return -ENODEV; 1518 } 1519 - asus_backlight_device->props.max_brightness = 15; 1520 1521 return 0; 1522 }
··· 1481 1482 static int __init asus_acpi_init(void) 1483 { 1484 + struct backlight_properties props; 1485 int result; 1486 1487 result = acpi_bus_register_driver(&asus_hotk_driver); ··· 1507 return -ENODEV; 1508 } 1509 1510 + memset(&props, 0, sizeof(struct backlight_properties)); 1511 + props.max_brightness = 15; 1512 asus_backlight_device = backlight_device_register("asus", NULL, NULL, 1513 + &asus_backlight_data, 1514 + &props); 1515 if (IS_ERR(asus_backlight_device)) { 1516 printk(KERN_ERR "Could not register asus backlight device\n"); 1517 asus_backlight_device = NULL; 1518 asus_acpi_exit(); 1519 return -ENODEV; 1520 } 1521 1522 return 0; 1523 }
+8 -4
drivers/platform/x86/classmate-laptop.c
··· 455 return -1; 456 } 457 458 - static struct backlight_ops cmpc_bl_ops = { 459 .get_brightness = cmpc_bl_get_brightness, 460 .update_status = cmpc_bl_update_status 461 }; 462 463 static int cmpc_bl_add(struct acpi_device *acpi) 464 { 465 struct backlight_device *bd; 466 467 - bd = backlight_device_register("cmpc_bl", &acpi->dev, 468 - acpi->handle, &cmpc_bl_ops); 469 - bd->props.max_brightness = 7; 470 dev_set_drvdata(&acpi->dev, bd); 471 return 0; 472 }
··· 455 return -1; 456 } 457 458 + static const struct backlight_ops cmpc_bl_ops = { 459 .get_brightness = cmpc_bl_get_brightness, 460 .update_status = cmpc_bl_update_status 461 }; 462 463 static int cmpc_bl_add(struct acpi_device *acpi) 464 { 465 + struct backlight_properties props; 466 struct backlight_device *bd; 467 468 + memset(&props, 0, sizeof(struct backlight_properties)); 469 + props.max_brightness = 7; 470 + bd = backlight_device_register("cmpc_bl", &acpi->dev, acpi->handle, 471 + &cmpc_bl_ops, &props); 472 + if (IS_ERR(bd)) 473 + return PTR_ERR(bd); 474 dev_set_drvdata(&acpi->dev, bd); 475 return 0; 476 }
+7 -4
drivers/platform/x86/compal-laptop.c
··· 291 /* Register backlight stuff */ 292 293 if (!acpi_video_backlight_support()) { 294 - compalbl_device = backlight_device_register("compal-laptop", NULL, NULL, 295 - &compalbl_ops); 296 if (IS_ERR(compalbl_device)) 297 return PTR_ERR(compalbl_device); 298 - 299 - compalbl_device->props.max_brightness = COMPAL_LCD_LEVEL_MAX-1; 300 } 301 302 ret = platform_driver_register(&compal_driver);
··· 291 /* Register backlight stuff */ 292 293 if (!acpi_video_backlight_support()) { 294 + struct backlight_properties props; 295 + memset(&props, 0, sizeof(struct backlight_properties)); 296 + props.max_brightness = COMPAL_LCD_LEVEL_MAX - 1; 297 + compalbl_device = backlight_device_register("compal-laptop", 298 + NULL, NULL, 299 + &compalbl_ops, 300 + &props); 301 if (IS_ERR(compalbl_device)) 302 return PTR_ERR(compalbl_device); 303 } 304 305 ret = platform_driver_register(&compal_driver);
+8 -5
drivers/platform/x86/dell-laptop.c
··· 559 release_buffer(); 560 561 if (max_intensity) { 562 - dell_backlight_device = backlight_device_register( 563 - "dell_backlight", 564 - &platform_device->dev, NULL, 565 - &dell_ops); 566 567 if (IS_ERR(dell_backlight_device)) { 568 ret = PTR_ERR(dell_backlight_device); ··· 574 goto fail_backlight; 575 } 576 577 - dell_backlight_device->props.max_brightness = max_intensity; 578 dell_backlight_device->props.brightness = 579 dell_get_intensity(dell_backlight_device); 580 backlight_update_status(dell_backlight_device);
··· 559 release_buffer(); 560 561 if (max_intensity) { 562 + struct backlight_properties props; 563 + memset(&props, 0, sizeof(struct backlight_properties)); 564 + props.max_brightness = max_intensity; 565 + dell_backlight_device = backlight_device_register("dell_backlight", 566 + &platform_device->dev, 567 + NULL, 568 + &dell_ops, 569 + &props); 570 571 if (IS_ERR(dell_backlight_device)) { 572 ret = PTR_ERR(dell_backlight_device); ··· 570 goto fail_backlight; 571 } 572 573 dell_backlight_device->props.brightness = 574 dell_get_intensity(dell_backlight_device); 575 backlight_update_status(dell_backlight_device);
+5 -3
drivers/platform/x86/eeepc-laptop.c
··· 1131 1132 static int eeepc_backlight_init(struct eeepc_laptop *eeepc) 1133 { 1134 struct backlight_device *bd; 1135 1136 bd = backlight_device_register(EEEPC_LAPTOP_FILE, 1137 - &eeepc->platform_device->dev, 1138 - eeepc, &eeepcbl_ops); 1139 if (IS_ERR(bd)) { 1140 pr_err("Could not register eeepc backlight device\n"); 1141 eeepc->backlight_device = NULL; 1142 return PTR_ERR(bd); 1143 } 1144 eeepc->backlight_device = bd; 1145 - bd->props.max_brightness = 15; 1146 bd->props.brightness = read_brightness(bd); 1147 bd->props.power = FB_BLANK_UNBLANK; 1148 backlight_update_status(bd);
··· 1131 1132 static int eeepc_backlight_init(struct eeepc_laptop *eeepc) 1133 { 1134 + struct backlight_properties props; 1135 struct backlight_device *bd; 1136 1137 + memset(&props, 0, sizeof(struct backlight_properties)); 1138 + props.max_brightness = 15; 1139 bd = backlight_device_register(EEEPC_LAPTOP_FILE, 1140 + &eeepc->platform_device->dev, eeepc, 1141 + &eeepcbl_ops, &props); 1142 if (IS_ERR(bd)) { 1143 pr_err("Could not register eeepc backlight device\n"); 1144 eeepc->backlight_device = NULL; 1145 return PTR_ERR(bd); 1146 } 1147 eeepc->backlight_device = bd; 1148 bd->props.brightness = read_brightness(bd); 1149 bd->props.power = FB_BLANK_UNBLANK; 1150 backlight_update_status(bd);
+9 -5
drivers/platform/x86/fujitsu-laptop.c
··· 1126 /* Register backlight stuff */ 1127 1128 if (!acpi_video_backlight_support()) { 1129 - fujitsu->bl_device = 1130 - backlight_device_register("fujitsu-laptop", NULL, NULL, 1131 - &fujitsubl_ops); 1132 if (IS_ERR(fujitsu->bl_device)) { 1133 ret = PTR_ERR(fujitsu->bl_device); 1134 fujitsu->bl_device = NULL; 1135 goto fail_sysfs_group; 1136 } 1137 - max_brightness = fujitsu->max_brightness; 1138 - fujitsu->bl_device->props.max_brightness = max_brightness - 1; 1139 fujitsu->bl_device->props.brightness = fujitsu->brightness_level; 1140 } 1141
··· 1126 /* Register backlight stuff */ 1127 1128 if (!acpi_video_backlight_support()) { 1129 + struct backlight_properties props; 1130 + 1131 + memset(&props, 0, sizeof(struct backlight_properties)); 1132 + max_brightness = fujitsu->max_brightness; 1133 + props.max_brightness = max_brightness - 1; 1134 + fujitsu->bl_device = backlight_device_register("fujitsu-laptop", 1135 + NULL, NULL, 1136 + &fujitsubl_ops, 1137 + &props); 1138 if (IS_ERR(fujitsu->bl_device)) { 1139 ret = PTR_ERR(fujitsu->bl_device); 1140 fujitsu->bl_device = NULL; 1141 goto fail_sysfs_group; 1142 } 1143 fujitsu->bl_device->props.brightness = fujitsu->brightness_level; 1144 } 1145
+5 -2
drivers/platform/x86/msi-laptop.c
··· 683 printk(KERN_INFO "MSI: Brightness ignored, must be controlled " 684 "by ACPI video driver\n"); 685 } else { 686 msibl_device = backlight_device_register("msi-laptop-bl", NULL, 687 - NULL, &msibl_ops); 688 if (IS_ERR(msibl_device)) 689 return PTR_ERR(msibl_device); 690 - msibl_device->props.max_brightness = MSI_LCD_LEVEL_MAX-1; 691 } 692 693 ret = platform_driver_register(&msipf_driver);
··· 683 printk(KERN_INFO "MSI: Brightness ignored, must be controlled " 684 "by ACPI video driver\n"); 685 } else { 686 + struct backlight_properties props; 687 + memset(&props, 0, sizeof(struct backlight_properties)); 688 + props.max_brightness = MSI_LCD_LEVEL_MAX - 1; 689 msibl_device = backlight_device_register("msi-laptop-bl", NULL, 690 + NULL, &msibl_ops, 691 + &props); 692 if (IS_ERR(msibl_device)) 693 return PTR_ERR(msibl_device); 694 } 695 696 ret = platform_driver_register(&msipf_driver);
+10 -5
drivers/platform/x86/msi-wmi.c
··· 138 return msi_wmi_set_block(0, backlight_map[bright]); 139 } 140 141 - static struct backlight_ops msi_backlight_ops = { 142 .get_brightness = bl_get, 143 .update_status = bl_set_status, 144 }; ··· 249 goto err_uninstall_notifier; 250 251 if (!acpi_video_backlight_support()) { 252 - backlight = backlight_device_register(DRV_NAME, 253 - NULL, NULL, &msi_backlight_ops); 254 - if (IS_ERR(backlight)) 255 goto err_free_input; 256 257 - backlight->props.max_brightness = ARRAY_SIZE(backlight_map) - 1; 258 err = bl_get(NULL); 259 if (err < 0) 260 goto err_free_backlight;
··· 138 return msi_wmi_set_block(0, backlight_map[bright]); 139 } 140 141 + static const struct backlight_ops msi_backlight_ops = { 142 .get_brightness = bl_get, 143 .update_status = bl_set_status, 144 }; ··· 249 goto err_uninstall_notifier; 250 251 if (!acpi_video_backlight_support()) { 252 + struct backlight_properties props; 253 + memset(&props, 0, sizeof(struct backlight_properties)); 254 + props.max_brightness = ARRAY_SIZE(backlight_map) - 1; 255 + backlight = backlight_device_register(DRV_NAME, NULL, NULL, 256 + &msi_backlight_ops, 257 + &props); 258 + if (IS_ERR(backlight)) { 259 + err = PTR_ERR(backlight); 260 goto err_free_input; 261 + } 262 263 err = bl_get(NULL); 264 if (err < 0) 265 goto err_free_backlight;
+15 -13
drivers/platform/x86/panasonic-laptop.c
··· 352 return acpi_pcc_write_sset(pcc, SINF_DC_CUR_BRIGHT, bright); 353 } 354 355 - static struct backlight_ops pcc_backlight_ops = { 356 .get_brightness = bl_get, 357 .update_status = bl_set_status, 358 }; ··· 600 601 static int acpi_pcc_hotkey_add(struct acpi_device *device) 602 { 603 struct pcc_acpi *pcc; 604 int num_sifr, result; 605 ··· 638 if (result) { 639 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 640 "Error installing keyinput handler\n")); 641 - goto out_sinf; 642 } 643 - 644 - /* initialize backlight */ 645 - pcc->backlight = backlight_device_register("panasonic", NULL, pcc, 646 - &pcc_backlight_ops); 647 - if (IS_ERR(pcc->backlight)) 648 - goto out_input; 649 650 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) { 651 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 652 "Couldn't retrieve BIOS data\n")); 653 - goto out_backlight; 654 } 655 656 /* read the initial brightness setting from the hardware */ 657 - pcc->backlight->props.max_brightness = 658 - pcc->sinf[SINF_AC_MAX_BRIGHT]; 659 pcc->backlight->props.brightness = pcc->sinf[SINF_AC_CUR_BRIGHT]; 660 661 /* read the initial sticky key mode from the hardware */ ··· 671 672 out_backlight: 673 backlight_device_unregister(pcc->backlight); 674 out_input: 675 input_unregister_device(pcc->input_dev); 676 /* no need to input_free_device() since core input API refcount and 677 * free()s the device */ 678 - out_sinf: 679 - kfree(pcc->sinf); 680 out_hotkey: 681 kfree(pcc); 682
··· 352 return acpi_pcc_write_sset(pcc, SINF_DC_CUR_BRIGHT, bright); 353 } 354 355 + static const struct backlight_ops pcc_backlight_ops = { 356 .get_brightness = bl_get, 357 .update_status = bl_set_status, 358 }; ··· 600 601 static int acpi_pcc_hotkey_add(struct acpi_device *device) 602 { 603 + struct backlight_properties props; 604 struct pcc_acpi *pcc; 605 int num_sifr, result; 606 ··· 637 if (result) { 638 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 639 "Error installing keyinput handler\n")); 640 + goto out_hotkey; 641 } 642 643 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) { 644 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 645 "Couldn't retrieve BIOS data\n")); 646 + goto out_input; 647 + } 648 + /* initialize backlight */ 649 + memset(&props, 0, sizeof(struct backlight_properties)); 650 + props.max_brightness = pcc->sinf[SINF_AC_MAX_BRIGHT]; 651 + pcc->backlight = backlight_device_register("panasonic", NULL, pcc, 652 + &pcc_backlight_ops, &props); 653 + if (IS_ERR(pcc->backlight)) { 654 + result = PTR_ERR(pcc->backlight); 655 + goto out_sinf; 656 } 657 658 /* read the initial brightness setting from the hardware */ 659 pcc->backlight->props.brightness = pcc->sinf[SINF_AC_CUR_BRIGHT]; 660 661 /* read the initial sticky key mode from the hardware */ ··· 669 670 out_backlight: 671 backlight_device_unregister(pcc->backlight); 672 + out_sinf: 673 + kfree(pcc->sinf); 674 out_input: 675 input_unregister_device(pcc->input_dev); 676 /* no need to input_free_device() since core input API refcount and 677 * free()s the device */ 678 out_hotkey: 679 kfree(pcc); 680
+5 -3
drivers/platform/x86/sony-laptop.c
··· 1291 "controlled by ACPI video driver\n"); 1292 } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", 1293 &handle))) { 1294 sony_backlight_device = backlight_device_register("sony", NULL, 1295 NULL, 1296 - &sony_backlight_ops); 1297 1298 if (IS_ERR(sony_backlight_device)) { 1299 printk(KERN_WARNING DRV_PFX "unable to register backlight device\n"); ··· 1306 sony_backlight_device->props.brightness = 1307 sony_backlight_get_brightness 1308 (sony_backlight_device); 1309 - sony_backlight_device->props.max_brightness = 1310 - SONY_MAX_BRIGHTNESS - 1; 1311 } 1312 1313 }
··· 1291 "controlled by ACPI video driver\n"); 1292 } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", 1293 &handle))) { 1294 + struct backlight_properties props; 1295 + memset(&props, 0, sizeof(struct backlight_properties)); 1296 + props.max_brightness = SONY_MAX_BRIGHTNESS - 1; 1297 sony_backlight_device = backlight_device_register("sony", NULL, 1298 NULL, 1299 + &sony_backlight_ops, 1300 + &props); 1301 1302 if (IS_ERR(sony_backlight_device)) { 1303 printk(KERN_WARNING DRV_PFX "unable to register backlight device\n"); ··· 1302 sony_backlight_device->props.brightness = 1303 sony_backlight_get_brightness 1304 (sony_backlight_device); 1305 } 1306 1307 }
+7 -5
drivers/platform/x86/thinkpad_acpi.c
··· 6170 6171 static int __init brightness_init(struct ibm_init_struct *iibm) 6172 { 6173 int b; 6174 unsigned long quirks; 6175 ··· 6260 printk(TPACPI_INFO 6261 "detected a 16-level brightness capable ThinkPad\n"); 6262 6263 - ibm_backlight_device = backlight_device_register( 6264 - TPACPI_BACKLIGHT_DEV_NAME, NULL, NULL, 6265 - &ibm_backlight_data); 6266 if (IS_ERR(ibm_backlight_device)) { 6267 int rc = PTR_ERR(ibm_backlight_device); 6268 ibm_backlight_device = NULL; ··· 6284 "or not on your ThinkPad\n", TPACPI_MAIL); 6285 } 6286 6287 - ibm_backlight_device->props.max_brightness = 6288 - (tp_features.bright_16levels)? 15 : 7; 6289 ibm_backlight_device->props.brightness = b & TP_EC_BACKLIGHT_LVLMSK; 6290 backlight_update_status(ibm_backlight_device); 6291
··· 6170 6171 static int __init brightness_init(struct ibm_init_struct *iibm) 6172 { 6173 + struct backlight_properties props; 6174 int b; 6175 unsigned long quirks; 6176 ··· 6259 printk(TPACPI_INFO 6260 "detected a 16-level brightness capable ThinkPad\n"); 6261 6262 + memset(&props, 0, sizeof(struct backlight_properties)); 6263 + props.max_brightness = (tp_features.bright_16levels) ? 15 : 7; 6264 + ibm_backlight_device = backlight_device_register(TPACPI_BACKLIGHT_DEV_NAME, 6265 + NULL, NULL, 6266 + &ibm_backlight_data, 6267 + &props); 6268 if (IS_ERR(ibm_backlight_device)) { 6269 int rc = PTR_ERR(ibm_backlight_device); 6270 ibm_backlight_device = NULL; ··· 6280 "or not on your ThinkPad\n", TPACPI_MAIL); 6281 } 6282 6283 ibm_backlight_device->props.brightness = b & TP_EC_BACKLIGHT_LVLMSK; 6284 backlight_update_status(ibm_backlight_device); 6285
+6 -4
drivers/platform/x86/toshiba_acpi.c
··· 924 u32 hci_result; 925 bool bt_present; 926 int ret = 0; 927 928 if (acpi_disabled) 929 return -ENODEV; ··· 975 } 976 } 977 978 toshiba_backlight_device = backlight_device_register("toshiba", 979 - &toshiba_acpi.p_dev->dev, 980 - NULL, 981 - &toshiba_backlight_data); 982 if (IS_ERR(toshiba_backlight_device)) { 983 ret = PTR_ERR(toshiba_backlight_device); 984 ··· 989 toshiba_acpi_exit(); 990 return ret; 991 } 992 - toshiba_backlight_device->props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1; 993 994 /* Register rfkill switch for Bluetooth */ 995 if (hci_get_bt_present(&bt_present) == HCI_SUCCESS && bt_present) {
··· 924 u32 hci_result; 925 bool bt_present; 926 int ret = 0; 927 + struct backlight_properties props; 928 929 if (acpi_disabled) 930 return -ENODEV; ··· 974 } 975 } 976 977 + props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1; 978 toshiba_backlight_device = backlight_device_register("toshiba", 979 + &toshiba_acpi.p_dev->dev, 980 + NULL, 981 + &toshiba_backlight_data, 982 + &props); 983 if (IS_ERR(toshiba_backlight_device)) { 984 ret = PTR_ERR(toshiba_backlight_device); 985 ··· 986 toshiba_acpi_exit(); 987 return ret; 988 } 989 990 /* Register rfkill switch for Bluetooth */ 991 if (hci_get_bt_present(&bt_present) == HCI_SUCCESS && bt_present) {
+5 -2
drivers/staging/samsung-laptop/samsung-laptop.c
··· 394 395 static int __init samsung_init(void) 396 { 397 struct sabi_retval sretval; 398 const char *testStr = "SECLINUX"; 399 void __iomem *memcheck; ··· 487 goto error_no_platform; 488 489 /* create a backlight device to talk to this one */ 490 backlight_device = backlight_device_register("samsung", &sdev->dev, 491 - NULL, &backlight_ops); 492 if (IS_ERR(backlight_device)) 493 goto error_no_backlight; 494 495 - backlight_device->props.max_brightness = MAX_BRIGHT; 496 backlight_device->props.brightness = read_brightness(); 497 backlight_device->props.power = FB_BLANK_UNBLANK; 498 backlight_update_status(backlight_device);
··· 394 395 static int __init samsung_init(void) 396 { 397 + struct backlight_properties props; 398 struct sabi_retval sretval; 399 const char *testStr = "SECLINUX"; 400 void __iomem *memcheck; ··· 486 goto error_no_platform; 487 488 /* create a backlight device to talk to this one */ 489 + memset(&props, 0, sizeof(struct backlight_properties)); 490 + props.max_brightness = MAX_BRIGHT; 491 backlight_device = backlight_device_register("samsung", &sdev->dev, 492 + NULL, &backlight_ops, 493 + &props); 494 if (IS_ERR(backlight_device)) 495 goto error_no_backlight; 496 497 backlight_device->props.brightness = read_brightness(); 498 backlight_device->props.power = FB_BLANK_UNBLANK; 499 backlight_update_status(backlight_device);
+4 -3
drivers/usb/misc/appledisplay.c
··· 202 static int appledisplay_probe(struct usb_interface *iface, 203 const struct usb_device_id *id) 204 { 205 struct appledisplay *pdata; 206 struct usb_device *udev = interface_to_usbdev(iface); 207 struct usb_host_interface *iface_desc; ··· 280 /* Register backlight device */ 281 snprintf(bl_name, sizeof(bl_name), "appledisplay%d", 282 atomic_inc_return(&count_displays) - 1); 283 pdata->bd = backlight_device_register(bl_name, NULL, pdata, 284 - &appledisplay_bl_data); 285 if (IS_ERR(pdata->bd)) { 286 dev_err(&iface->dev, "Backlight registration failed\n"); 287 retval = PTR_ERR(pdata->bd); 288 goto error; 289 } 290 - 291 - pdata->bd->props.max_brightness = 0xff; 292 293 /* Try to get brightness */ 294 brightness = appledisplay_bl_get_brightness(pdata->bd);
··· 202 static int appledisplay_probe(struct usb_interface *iface, 203 const struct usb_device_id *id) 204 { 205 + struct backlight_properties props; 206 struct appledisplay *pdata; 207 struct usb_device *udev = interface_to_usbdev(iface); 208 struct usb_host_interface *iface_desc; ··· 279 /* Register backlight device */ 280 snprintf(bl_name, sizeof(bl_name), "appledisplay%d", 281 atomic_inc_return(&count_displays) - 1); 282 + memset(&props, 0, sizeof(struct backlight_properties)); 283 + props.max_brightness = 0xff; 284 pdata->bd = backlight_device_register(bl_name, NULL, pdata, 285 + &appledisplay_bl_data, &props); 286 if (IS_ERR(pdata->bd)) { 287 dev_err(&iface->dev, "Backlight registration failed\n"); 288 retval = PTR_ERR(pdata->bd); 289 goto error; 290 } 291 292 /* Try to get brightness */ 293 brightness = appledisplay_bl_get_brightness(pdata->bd);
+5 -3
drivers/video/atmel_lcdfb.c
··· 117 118 static void init_backlight(struct atmel_lcdfb_info *sinfo) 119 { 120 struct backlight_device *bl; 121 122 sinfo->bl_power = FB_BLANK_UNBLANK; ··· 125 if (sinfo->backlight) 126 return; 127 128 - bl = backlight_device_register("backlight", &sinfo->pdev->dev, 129 - sinfo, &atmel_lcdc_bl_ops); 130 if (IS_ERR(bl)) { 131 dev_err(&sinfo->pdev->dev, "error %ld on backlight register\n", 132 PTR_ERR(bl)); ··· 138 139 bl->props.power = FB_BLANK_UNBLANK; 140 bl->props.fb_blank = FB_BLANK_UNBLANK; 141 - bl->props.max_brightness = 0xff; 142 bl->props.brightness = atmel_bl_get_brightness(bl); 143 } 144
··· 117 118 static void init_backlight(struct atmel_lcdfb_info *sinfo) 119 { 120 + struct backlight_properties props; 121 struct backlight_device *bl; 122 123 sinfo->bl_power = FB_BLANK_UNBLANK; ··· 124 if (sinfo->backlight) 125 return; 126 127 + memset(&props, 0, sizeof(struct backlight_properties)); 128 + props.max_brightness = 0xff; 129 + bl = backlight_device_register("backlight", &sinfo->pdev->dev, sinfo, 130 + &atmel_lcdc_bl_ops, &props); 131 if (IS_ERR(bl)) { 132 dev_err(&sinfo->pdev->dev, "error %ld on backlight register\n", 133 PTR_ERR(bl)); ··· 135 136 bl->props.power = FB_BLANK_UNBLANK; 137 bl->props.fb_blank = FB_BLANK_UNBLANK; 138 bl->props.brightness = atmel_bl_get_brightness(bl); 139 } 140
+5 -2
drivers/video/aty/aty128fb.c
··· 1802 1803 static void aty128_bl_init(struct aty128fb_par *par) 1804 { 1805 struct fb_info *info = pci_get_drvdata(par->pdev); 1806 struct backlight_device *bd; 1807 char name[12]; ··· 1818 1819 snprintf(name, sizeof(name), "aty128bl%d", info->node); 1820 1821 - bd = backlight_device_register(name, info->dev, par, &aty128_bl_data); 1822 if (IS_ERR(bd)) { 1823 info->bl_dev = NULL; 1824 printk(KERN_WARNING "aty128: Backlight registration failed\n"); ··· 1833 63 * FB_BACKLIGHT_MAX / MAX_LEVEL, 1834 219 * FB_BACKLIGHT_MAX / MAX_LEVEL); 1835 1836 - bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 1837 bd->props.brightness = bd->props.max_brightness; 1838 bd->props.power = FB_BLANK_UNBLANK; 1839 backlight_update_status(bd);
··· 1802 1803 static void aty128_bl_init(struct aty128fb_par *par) 1804 { 1805 + struct backlight_properties props; 1806 struct fb_info *info = pci_get_drvdata(par->pdev); 1807 struct backlight_device *bd; 1808 char name[12]; ··· 1817 1818 snprintf(name, sizeof(name), "aty128bl%d", info->node); 1819 1820 + memset(&props, 0, sizeof(struct backlight_properties)); 1821 + props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 1822 + bd = backlight_device_register(name, info->dev, par, &aty128_bl_data, 1823 + &props); 1824 if (IS_ERR(bd)) { 1825 info->bl_dev = NULL; 1826 printk(KERN_WARNING "aty128: Backlight registration failed\n"); ··· 1829 63 * FB_BACKLIGHT_MAX / MAX_LEVEL, 1830 219 * FB_BACKLIGHT_MAX / MAX_LEVEL); 1831 1832 bd->props.brightness = bd->props.max_brightness; 1833 bd->props.power = FB_BLANK_UNBLANK; 1834 backlight_update_status(bd);
+5 -2
drivers/video/aty/atyfb_base.c
··· 2232 2233 static void aty_bl_init(struct atyfb_par *par) 2234 { 2235 struct fb_info *info = pci_get_drvdata(par->pdev); 2236 struct backlight_device *bd; 2237 char name[12]; ··· 2244 2245 snprintf(name, sizeof(name), "atybl%d", info->node); 2246 2247 - bd = backlight_device_register(name, info->dev, par, &aty_bl_data); 2248 if (IS_ERR(bd)) { 2249 info->bl_dev = NULL; 2250 printk(KERN_WARNING "aty: Backlight registration failed\n"); ··· 2259 0x3F * FB_BACKLIGHT_MAX / MAX_LEVEL, 2260 0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL); 2261 2262 - bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 2263 bd->props.brightness = bd->props.max_brightness; 2264 bd->props.power = FB_BLANK_UNBLANK; 2265 backlight_update_status(bd);
··· 2232 2233 static void aty_bl_init(struct atyfb_par *par) 2234 { 2235 + struct backlight_properties props; 2236 struct fb_info *info = pci_get_drvdata(par->pdev); 2237 struct backlight_device *bd; 2238 char name[12]; ··· 2243 2244 snprintf(name, sizeof(name), "atybl%d", info->node); 2245 2246 + memset(&props, 0, sizeof(struct backlight_properties)); 2247 + props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 2248 + bd = backlight_device_register(name, info->dev, par, &aty_bl_data, 2249 + &props); 2250 if (IS_ERR(bd)) { 2251 info->bl_dev = NULL; 2252 printk(KERN_WARNING "aty: Backlight registration failed\n"); ··· 2255 0x3F * FB_BACKLIGHT_MAX / MAX_LEVEL, 2256 0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL); 2257 2258 bd->props.brightness = bd->props.max_brightness; 2259 bd->props.power = FB_BLANK_UNBLANK; 2260 backlight_update_status(bd);
+5 -2
drivers/video/aty/radeon_backlight.c
··· 134 135 void radeonfb_bl_init(struct radeonfb_info *rinfo) 136 { 137 struct backlight_device *bd; 138 struct radeon_bl_privdata *pdata; 139 char name[12]; ··· 156 157 snprintf(name, sizeof(name), "radeonbl%d", rinfo->info->node); 158 159 - bd = backlight_device_register(name, rinfo->info->dev, pdata, &radeon_bl_data); 160 if (IS_ERR(bd)) { 161 rinfo->info->bl_dev = NULL; 162 printk("radeonfb: Backlight registration failed\n"); ··· 189 63 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL, 190 217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL); 191 192 - bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 193 bd->props.brightness = bd->props.max_brightness; 194 bd->props.power = FB_BLANK_UNBLANK; 195 backlight_update_status(bd);
··· 134 135 void radeonfb_bl_init(struct radeonfb_info *rinfo) 136 { 137 + struct backlight_properties props; 138 struct backlight_device *bd; 139 struct radeon_bl_privdata *pdata; 140 char name[12]; ··· 155 156 snprintf(name, sizeof(name), "radeonbl%d", rinfo->info->node); 157 158 + memset(&props, 0, sizeof(struct backlight_properties)); 159 + props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 160 + bd = backlight_device_register(name, rinfo->info->dev, pdata, 161 + &radeon_bl_data, &props); 162 if (IS_ERR(bd)) { 163 rinfo->info->bl_dev = NULL; 164 printk("radeonfb: Backlight registration failed\n"); ··· 185 63 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL, 186 217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL); 187 188 bd->props.brightness = bd->props.max_brightness; 189 bd->props.power = FB_BLANK_UNBLANK; 190 backlight_update_status(bd);
+4 -2
drivers/video/backlight/88pm860x_bl.c
··· 187 struct pm860x_backlight_data *data; 188 struct backlight_device *bl; 189 struct resource *res; 190 unsigned char value; 191 char name[MFD_NAME_SIZE]; 192 int ret; ··· 224 return -EINVAL; 225 } 226 227 bl = backlight_device_register(name, &pdev->dev, data, 228 - &pm860x_backlight_ops); 229 if (IS_ERR(bl)) { 230 dev_err(&pdev->dev, "failed to register backlight\n"); 231 kfree(data); 232 return PTR_ERR(bl); 233 } 234 - bl->props.max_brightness = MAX_BRIGHTNESS; 235 bl->props.brightness = MAX_BRIGHTNESS; 236 237 platform_set_drvdata(pdev, bl);
··· 187 struct pm860x_backlight_data *data; 188 struct backlight_device *bl; 189 struct resource *res; 190 + struct backlight_properties props; 191 unsigned char value; 192 char name[MFD_NAME_SIZE]; 193 int ret; ··· 223 return -EINVAL; 224 } 225 226 + memset(&props, 0, sizeof(struct backlight_properties)); 227 + props.max_brightness = MAX_BRIGHTNESS; 228 bl = backlight_device_register(name, &pdev->dev, data, 229 + &pm860x_backlight_ops, &props); 230 if (IS_ERR(bl)) { 231 dev_err(&pdev->dev, "failed to register backlight\n"); 232 kfree(data); 233 return PTR_ERR(bl); 234 } 235 bl->props.brightness = MAX_BRIGHTNESS; 236 237 platform_set_drvdata(pdev, bl);
+7
drivers/video/backlight/Kconfig
··· 31 Say y here to support the LCD panels usually found on SHARP 32 corgi (C7x0) and spitz (Cxx00) models. 33 34 config LCD_LMS283GF05 35 tristate "Samsung LMS283GF05 LCD" 36 depends on LCD_CLASS_DEVICE && SPI_MASTER && GENERIC_GPIO
··· 31 Say y here to support the LCD panels usually found on SHARP 32 corgi (C7x0) and spitz (Cxx00) models. 33 34 + config LCD_L4F00242T03 35 + tristate "Epson L4F00242T03 LCD" 36 + depends on LCD_CLASS_DEVICE && SPI_MASTER && GENERIC_GPIO 37 + help 38 + SPI driver for Epson L4F00242T03. This provides basic support 39 + for init and powering the LCD up/down through a sysfs interface. 40 + 41 config LCD_LMS283GF05 42 tristate "Samsung LMS283GF05 LCD" 43 depends on LCD_CLASS_DEVICE && SPI_MASTER && GENERIC_GPIO
+1
drivers/video/backlight/Makefile
··· 3 obj-$(CONFIG_LCD_CLASS_DEVICE) += lcd.o 4 obj-$(CONFIG_LCD_CORGI) += corgi_lcd.o 5 obj-$(CONFIG_LCD_HP700) += jornada720_lcd.o 6 obj-$(CONFIG_LCD_LMS283GF05) += lms283gf05.o 7 obj-$(CONFIG_LCD_LTV350QV) += ltv350qv.o 8 obj-$(CONFIG_LCD_ILI9320) += ili9320.o
··· 3 obj-$(CONFIG_LCD_CLASS_DEVICE) += lcd.o 4 obj-$(CONFIG_LCD_CORGI) += corgi_lcd.o 5 obj-$(CONFIG_LCD_HP700) += jornada720_lcd.o 6 + obj-$(CONFIG_LCD_L4F00242T03) += l4f00242t03.o 7 obj-$(CONFIG_LCD_LMS283GF05) += lms283gf05.o 8 obj-$(CONFIG_LCD_LTV350QV) += ltv350qv.o 9 obj-$(CONFIG_LCD_ILI9320) += ili9320.o
+6 -5
drivers/video/backlight/adp5520_bl.c
··· 278 279 static int __devinit adp5520_bl_probe(struct platform_device *pdev) 280 { 281 struct backlight_device *bl; 282 struct adp5520_bl *data; 283 int ret = 0; ··· 301 302 mutex_init(&data->lock); 303 304 - bl = backlight_device_register(pdev->name, data->master, 305 - data, &adp5520_bl_ops); 306 if (IS_ERR(bl)) { 307 dev_err(&pdev->dev, "failed to register backlight\n"); 308 kfree(data); 309 return PTR_ERR(bl); 310 } 311 312 - bl->props.max_brightness = 313 - bl->props.brightness = ADP5020_MAX_BRIGHTNESS; 314 - 315 if (data->pdata->en_ambl_sens) 316 ret = sysfs_create_group(&bl->dev.kobj, 317 &adp5520_bl_attr_group);
··· 278 279 static int __devinit adp5520_bl_probe(struct platform_device *pdev) 280 { 281 + struct backlight_properties props; 282 struct backlight_device *bl; 283 struct adp5520_bl *data; 284 int ret = 0; ··· 300 301 mutex_init(&data->lock); 302 303 + memset(&props, 0, sizeof(struct backlight_properties)); 304 + props.max_brightness = ADP5020_MAX_BRIGHTNESS; 305 + bl = backlight_device_register(pdev->name, data->master, data, 306 + &adp5520_bl_ops, &props); 307 if (IS_ERR(bl)) { 308 dev_err(&pdev->dev, "failed to register backlight\n"); 309 kfree(data); 310 return PTR_ERR(bl); 311 } 312 313 + bl->props.brightness = ADP5020_MAX_BRIGHTNESS; 314 if (data->pdata->en_ambl_sens) 315 ret = sysfs_create_group(&bl->dev.kobj, 316 &adp5520_bl_attr_group);
+6 -4
drivers/video/backlight/adx_bl.c
··· 56 return brightness & 0xff; 57 } 58 59 - static int adx_backlight_check_fb(struct fb_info *fb) 60 { 61 return 1; 62 } ··· 70 71 static int __devinit adx_backlight_probe(struct platform_device *pdev) 72 { 73 struct backlight_device *bldev; 74 struct resource *res; 75 struct adxbl *bl; ··· 102 goto out; 103 } 104 105 - bldev = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, bl, 106 - &adx_backlight_ops); 107 if (!bldev) { 108 ret = -ENOMEM; 109 goto out; 110 } 111 112 - bldev->props.max_brightness = 0xff; 113 bldev->props.brightness = 0xff; 114 bldev->props.power = FB_BLANK_UNBLANK; 115
··· 56 return brightness & 0xff; 57 } 58 59 + static int adx_backlight_check_fb(struct backlight_device *bldev, struct fb_info *fb) 60 { 61 return 1; 62 } ··· 70 71 static int __devinit adx_backlight_probe(struct platform_device *pdev) 72 { 73 + struct backlight_properties props; 74 struct backlight_device *bldev; 75 struct resource *res; 76 struct adxbl *bl; ··· 101 goto out; 102 } 103 104 + memset(&props, 0, sizeof(struct backlight_properties)); 105 + props.max_brightness = 0xff; 106 + bldev = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, 107 + bl, &adx_backlight_ops, &props); 108 if (!bldev) { 109 ret = -ENOMEM; 110 goto out; 111 } 112 113 bldev->props.brightness = 0xff; 114 bldev->props.power = FB_BLANK_UNBLANK; 115
+5 -3
drivers/video/backlight/atmel-pwm-bl.c
··· 120 121 static int atmel_pwm_bl_probe(struct platform_device *pdev) 122 { 123 const struct atmel_pwm_bl_platform_data *pdata; 124 struct backlight_device *bldev; 125 struct atmel_pwm_bl *pwmbl; ··· 166 goto err_free_gpio; 167 } 168 169 - bldev = backlight_device_register("atmel-pwm-bl", 170 - &pdev->dev, pwmbl, &atmel_pwm_bl_ops); 171 if (IS_ERR(bldev)) { 172 retval = PTR_ERR(bldev); 173 goto err_free_gpio; ··· 181 182 /* Power up the backlight by default at middle intesity. */ 183 bldev->props.power = FB_BLANK_UNBLANK; 184 - bldev->props.max_brightness = pdata->pwm_duty_max - pdata->pwm_duty_min; 185 bldev->props.brightness = bldev->props.max_brightness / 2; 186 187 retval = atmel_pwm_bl_init_pwm(pwmbl);
··· 120 121 static int atmel_pwm_bl_probe(struct platform_device *pdev) 122 { 123 + struct backlight_properties props; 124 const struct atmel_pwm_bl_platform_data *pdata; 125 struct backlight_device *bldev; 126 struct atmel_pwm_bl *pwmbl; ··· 165 goto err_free_gpio; 166 } 167 168 + memset(&props, 0, sizeof(struct backlight_properties)); 169 + props.max_brightness = pdata->pwm_duty_max - pdata->pwm_duty_min; 170 + bldev = backlight_device_register("atmel-pwm-bl", &pdev->dev, pwmbl, 171 + &atmel_pwm_bl_ops, &props); 172 if (IS_ERR(bldev)) { 173 retval = PTR_ERR(bldev); 174 goto err_free_gpio; ··· 178 179 /* Power up the backlight by default at middle intesity. */ 180 bldev->props.power = FB_BLANK_UNBLANK; 181 bldev->props.brightness = bldev->props.max_brightness / 2; 182 183 retval = atmel_pwm_bl_init_pwm(pwmbl);
+8 -2
drivers/video/backlight/backlight.c
··· 38 mutex_lock(&bd->ops_lock); 39 if (bd->ops) 40 if (!bd->ops->check_fb || 41 - bd->ops->check_fb(evdata->info)) { 42 bd->props.fb_blank = *(int *)evdata->data; 43 if (bd->props.fb_blank == FB_BLANK_UNBLANK) 44 bd->props.state &= ~BL_CORE_FBBLANK; ··· 269 * ERR_PTR() or a pointer to the newly allocated device. 270 */ 271 struct backlight_device *backlight_device_register(const char *name, 272 - struct device *parent, void *devdata, const struct backlight_ops *ops) 273 { 274 struct backlight_device *new_bd; 275 int rc; ··· 289 new_bd->dev.release = bl_device_release; 290 dev_set_name(&new_bd->dev, name); 291 dev_set_drvdata(&new_bd->dev, devdata); 292 293 rc = device_register(&new_bd->dev); 294 if (rc) {
··· 38 mutex_lock(&bd->ops_lock); 39 if (bd->ops) 40 if (!bd->ops->check_fb || 41 + bd->ops->check_fb(bd, evdata->info)) { 42 bd->props.fb_blank = *(int *)evdata->data; 43 if (bd->props.fb_blank == FB_BLANK_UNBLANK) 44 bd->props.state &= ~BL_CORE_FBBLANK; ··· 269 * ERR_PTR() or a pointer to the newly allocated device. 270 */ 271 struct backlight_device *backlight_device_register(const char *name, 272 + struct device *parent, void *devdata, const struct backlight_ops *ops, 273 + const struct backlight_properties *props) 274 { 275 struct backlight_device *new_bd; 276 int rc; ··· 288 new_bd->dev.release = bl_device_release; 289 dev_set_name(&new_bd->dev, name); 290 dev_set_drvdata(&new_bd->dev, devdata); 291 + 292 + /* Set default properties */ 293 + if (props) 294 + memcpy(&new_bd->props, props, 295 + sizeof(struct backlight_properties)); 296 297 rc = device_register(&new_bd->dev); 298 if (rc) {
+5 -3
drivers/video/backlight/corgi_lcd.c
··· 533 534 static int __devinit corgi_lcd_probe(struct spi_device *spi) 535 { 536 struct corgi_lcd_platform_data *pdata = spi->dev.platform_data; 537 struct corgi_lcd *lcd; 538 int ret = 0; ··· 560 lcd->power = FB_BLANK_POWERDOWN; 561 lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA; 562 563 - lcd->bl_dev = backlight_device_register("corgi_bl", &spi->dev, 564 - lcd, &corgi_bl_ops); 565 if (IS_ERR(lcd->bl_dev)) { 566 ret = PTR_ERR(lcd->bl_dev); 567 goto err_unregister_lcd; 568 } 569 - lcd->bl_dev->props.max_brightness = pdata->max_intensity; 570 lcd->bl_dev->props.brightness = pdata->default_intensity; 571 lcd->bl_dev->props.power = FB_BLANK_UNBLANK; 572
··· 533 534 static int __devinit corgi_lcd_probe(struct spi_device *spi) 535 { 536 + struct backlight_properties props; 537 struct corgi_lcd_platform_data *pdata = spi->dev.platform_data; 538 struct corgi_lcd *lcd; 539 int ret = 0; ··· 559 lcd->power = FB_BLANK_POWERDOWN; 560 lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA; 561 562 + memset(&props, 0, sizeof(struct backlight_properties)); 563 + props.max_brightness = pdata->max_intensity; 564 + lcd->bl_dev = backlight_device_register("corgi_bl", &spi->dev, lcd, 565 + &corgi_bl_ops, &props); 566 if (IS_ERR(lcd->bl_dev)) { 567 ret = PTR_ERR(lcd->bl_dev); 568 goto err_unregister_lcd; 569 } 570 lcd->bl_dev->props.brightness = pdata->default_intensity; 571 lcd->bl_dev->props.power = FB_BLANK_UNBLANK; 572
+4 -4
drivers/video/backlight/cr_bllcd.c
··· 170 171 static int cr_backlight_probe(struct platform_device *pdev) 172 { 173 struct backlight_device *bdp; 174 struct lcd_device *ldp; 175 struct cr_panel *crp; ··· 191 return -ENODEV; 192 } 193 194 - bdp = backlight_device_register("cr-backlight", 195 - &pdev->dev, NULL, &cr_backlight_ops); 196 if (IS_ERR(bdp)) { 197 pci_dev_put(lpc_dev); 198 return PTR_ERR(bdp); ··· 222 crp->cr_lcd_device = ldp; 223 crp->cr_backlight_device->props.power = FB_BLANK_UNBLANK; 224 crp->cr_backlight_device->props.brightness = 0; 225 - crp->cr_backlight_device->props.max_brightness = 0; 226 cr_backlight_set_intensity(crp->cr_backlight_device); 227 - 228 cr_lcd_set_power(crp->cr_lcd_device, FB_BLANK_UNBLANK); 229 230 platform_set_drvdata(pdev, crp);
··· 170 171 static int cr_backlight_probe(struct platform_device *pdev) 172 { 173 + struct backlight_properties props; 174 struct backlight_device *bdp; 175 struct lcd_device *ldp; 176 struct cr_panel *crp; ··· 190 return -ENODEV; 191 } 192 193 + memset(&props, 0, sizeof(struct backlight_properties)); 194 + bdp = backlight_device_register("cr-backlight", &pdev->dev, NULL, 195 + &cr_backlight_ops, &props); 196 if (IS_ERR(bdp)) { 197 pci_dev_put(lpc_dev); 198 return PTR_ERR(bdp); ··· 220 crp->cr_lcd_device = ldp; 221 crp->cr_backlight_device->props.power = FB_BLANK_UNBLANK; 222 crp->cr_backlight_device->props.brightness = 0; 223 cr_backlight_set_intensity(crp->cr_backlight_device); 224 cr_lcd_set_power(crp->cr_lcd_device, FB_BLANK_UNBLANK); 225 226 platform_set_drvdata(pdev, crp);
+4 -3
drivers/video/backlight/da903x_bl.c
··· 105 struct da9034_backlight_pdata *pdata = pdev->dev.platform_data; 106 struct da903x_backlight_data *data; 107 struct backlight_device *bl; 108 int max_brightness; 109 110 data = kzalloc(sizeof(*data), GFP_KERNEL); ··· 135 da903x_write(data->da903x_dev, DA9034_WLED_CONTROL2, 136 DA9034_WLED_ISET(pdata->output_current)); 137 138 - bl = backlight_device_register(pdev->name, data->da903x_dev, 139 - data, &da903x_backlight_ops); 140 if (IS_ERR(bl)) { 141 dev_err(&pdev->dev, "failed to register backlight\n"); 142 kfree(data); 143 return PTR_ERR(bl); 144 } 145 146 - bl->props.max_brightness = max_brightness; 147 bl->props.brightness = max_brightness; 148 149 platform_set_drvdata(pdev, bl);
··· 105 struct da9034_backlight_pdata *pdata = pdev->dev.platform_data; 106 struct da903x_backlight_data *data; 107 struct backlight_device *bl; 108 + struct backlight_properties props; 109 int max_brightness; 110 111 data = kzalloc(sizeof(*data), GFP_KERNEL); ··· 134 da903x_write(data->da903x_dev, DA9034_WLED_CONTROL2, 135 DA9034_WLED_ISET(pdata->output_current)); 136 137 + props.max_brightness = max_brightness; 138 + bl = backlight_device_register(pdev->name, data->da903x_dev, data, 139 + &da903x_backlight_ops, &props); 140 if (IS_ERR(bl)) { 141 dev_err(&pdev->dev, "failed to register backlight\n"); 142 kfree(data); 143 return PTR_ERR(bl); 144 } 145 146 bl->props.brightness = max_brightness; 147 148 platform_set_drvdata(pdev, bl);
+5 -3
drivers/video/backlight/generic_bl.c
··· 78 79 static int genericbl_probe(struct platform_device *pdev) 80 { 81 struct generic_bl_info *machinfo = pdev->dev.platform_data; 82 const char *name = "generic-bl"; 83 struct backlight_device *bd; ··· 90 if (machinfo->name) 91 name = machinfo->name; 92 93 - bd = backlight_device_register (name, 94 - &pdev->dev, NULL, &genericbl_ops); 95 if (IS_ERR (bd)) 96 return PTR_ERR (bd); 97 98 platform_set_drvdata(pdev, bd); 99 100 - bd->props.max_brightness = machinfo->max_intensity; 101 bd->props.power = FB_BLANK_UNBLANK; 102 bd->props.brightness = machinfo->default_intensity; 103 backlight_update_status(bd);
··· 78 79 static int genericbl_probe(struct platform_device *pdev) 80 { 81 + struct backlight_properties props; 82 struct generic_bl_info *machinfo = pdev->dev.platform_data; 83 const char *name = "generic-bl"; 84 struct backlight_device *bd; ··· 89 if (machinfo->name) 90 name = machinfo->name; 91 92 + memset(&props, 0, sizeof(struct backlight_properties)); 93 + props.max_brightness = machinfo->max_intensity; 94 + bd = backlight_device_register(name, &pdev->dev, NULL, &genericbl_ops, 95 + &props); 96 if (IS_ERR (bd)) 97 return PTR_ERR (bd); 98 99 platform_set_drvdata(pdev, bd); 100 101 bd->props.power = FB_BLANK_UNBLANK; 102 bd->props.brightness = machinfo->default_intensity; 103 backlight_update_status(bd);
+5 -3
drivers/video/backlight/hp680_bl.c
··· 105 106 static int __devinit hp680bl_probe(struct platform_device *pdev) 107 { 108 struct backlight_device *bd; 109 110 - bd = backlight_device_register ("hp680-bl", &pdev->dev, NULL, 111 - &hp680bl_ops); 112 if (IS_ERR(bd)) 113 return PTR_ERR(bd); 114 115 platform_set_drvdata(pdev, bd); 116 117 - bd->props.max_brightness = HP680_MAX_INTENSITY; 118 bd->props.brightness = HP680_DEFAULT_INTENSITY; 119 hp680bl_send_intensity(bd); 120
··· 105 106 static int __devinit hp680bl_probe(struct platform_device *pdev) 107 { 108 + struct backlight_properties props; 109 struct backlight_device *bd; 110 111 + memset(&props, 0, sizeof(struct backlight_properties)); 112 + props.max_brightness = HP680_MAX_INTENSITY; 113 + bd = backlight_device_register("hp680-bl", &pdev->dev, NULL, 114 + &hp680bl_ops, &props); 115 if (IS_ERR(bd)) 116 return PTR_ERR(bd); 117 118 platform_set_drvdata(pdev, bd); 119 120 bd->props.brightness = HP680_DEFAULT_INTENSITY; 121 hp680bl_send_intensity(bd); 122
+5 -2
drivers/video/backlight/jornada720_bl.c
··· 101 102 static int jornada_bl_probe(struct platform_device *pdev) 103 { 104 int ret; 105 struct backlight_device *bd; 106 107 - bd = backlight_device_register(S1D_DEVICENAME, &pdev->dev, NULL, &jornada_bl_ops); 108 109 if (IS_ERR(bd)) { 110 ret = PTR_ERR(bd); ··· 121 /* note. make sure max brightness is set otherwise 122 you will get seemingly non-related errors when 123 trying to change brightness */ 124 - bd->props.max_brightness = BL_MAX_BRIGHT; 125 jornada_bl_update_status(bd); 126 127 platform_set_drvdata(pdev, bd);
··· 101 102 static int jornada_bl_probe(struct platform_device *pdev) 103 { 104 + struct backlight_properties props; 105 int ret; 106 struct backlight_device *bd; 107 108 + memset(&props, 0, sizeof(struct backlight_properties)); 109 + props.max_brightness = BL_MAX_BRIGHT; 110 + bd = backlight_device_register(S1D_DEVICENAME, &pdev->dev, NULL, 111 + &jornada_bl_ops, &props); 112 113 if (IS_ERR(bd)) { 114 ret = PTR_ERR(bd); ··· 117 /* note. make sure max brightness is set otherwise 118 you will get seemingly non-related errors when 119 trying to change brightness */ 120 jornada_bl_update_status(bd); 121 122 platform_set_drvdata(pdev, bd);
+6 -2
drivers/video/backlight/kb3886_bl.c
··· 141 142 static int kb3886bl_probe(struct platform_device *pdev) 143 { 144 struct kb3886bl_machinfo *machinfo = pdev->dev.platform_data; 145 146 bl_machinfo = machinfo; 147 if (!machinfo->limit_mask) 148 machinfo->limit_mask = -1; 149 150 kb3886_backlight_device = backlight_device_register("kb3886-bl", 151 - &pdev->dev, NULL, &kb3886bl_ops); 152 if (IS_ERR(kb3886_backlight_device)) 153 return PTR_ERR(kb3886_backlight_device); 154 155 platform_set_drvdata(pdev, kb3886_backlight_device); 156 157 - kb3886_backlight_device->props.max_brightness = machinfo->max_intensity; 158 kb3886_backlight_device->props.power = FB_BLANK_UNBLANK; 159 kb3886_backlight_device->props.brightness = machinfo->default_intensity; 160 backlight_update_status(kb3886_backlight_device);
··· 141 142 static int kb3886bl_probe(struct platform_device *pdev) 143 { 144 + struct backlight_properties props; 145 struct kb3886bl_machinfo *machinfo = pdev->dev.platform_data; 146 147 bl_machinfo = machinfo; 148 if (!machinfo->limit_mask) 149 machinfo->limit_mask = -1; 150 151 + memset(&props, 0, sizeof(struct backlight_properties)); 152 + props.max_brightness = machinfo->max_intensity; 153 kb3886_backlight_device = backlight_device_register("kb3886-bl", 154 + &pdev->dev, NULL, 155 + &kb3886bl_ops, 156 + &props); 157 if (IS_ERR(kb3886_backlight_device)) 158 return PTR_ERR(kb3886_backlight_device); 159 160 platform_set_drvdata(pdev, kb3886_backlight_device); 161 162 kb3886_backlight_device->props.power = FB_BLANK_UNBLANK; 163 kb3886_backlight_device->props.brightness = machinfo->default_intensity; 164 backlight_update_status(kb3886_backlight_device);
+257
drivers/video/backlight/l4f00242t03.c
···
··· 1 + /* 2 + * l4f00242t03.c -- support for Epson L4F00242T03 LCD 3 + * 4 + * Copyright 2007-2009 Freescale Semiconductor, Inc. All Rights Reserved. 5 + * 6 + * Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com> 7 + * Inspired by Marek Vasut work in l4f00242t03.c 8 + * 9 + * This program is free software; you can redistribute it and/or modify 10 + * it under the terms of the GNU General Public License version 2 as 11 + * published by the Free Software Foundation. 12 + */ 13 + 14 + #include <linux/device.h> 15 + #include <linux/kernel.h> 16 + #include <linux/delay.h> 17 + #include <linux/gpio.h> 18 + #include <linux/lcd.h> 19 + #include <linux/regulator/consumer.h> 20 + 21 + #include <linux/spi/spi.h> 22 + #include <linux/spi/l4f00242t03.h> 23 + 24 + struct l4f00242t03_priv { 25 + struct spi_device *spi; 26 + struct lcd_device *ld; 27 + int lcd_on:1; 28 + struct regulator *io_reg; 29 + struct regulator *core_reg; 30 + }; 31 + 32 + 33 + static void l4f00242t03_reset(unsigned int gpio) 34 + { 35 + pr_debug("l4f00242t03_reset.\n"); 36 + gpio_set_value(gpio, 1); 37 + mdelay(100); 38 + gpio_set_value(gpio, 0); 39 + mdelay(10); /* tRES >= 100us */ 40 + gpio_set_value(gpio, 1); 41 + mdelay(20); 42 + } 43 + 44 + #define param(x) ((x) | 0x100) 45 + 46 + static void l4f00242t03_lcd_init(struct spi_device *spi) 47 + { 48 + struct l4f00242t03_pdata *pdata = spi->dev.platform_data; 49 + struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev); 50 + const u16 cmd[] = { 0x36, param(0), 0x3A, param(0x60) }; 51 + 52 + dev_dbg(&spi->dev, "initializing LCD\n"); 53 + 54 + if (priv->io_reg) { 55 + regulator_set_voltage(priv->io_reg, 1800000, 1800000); 56 + regulator_enable(priv->io_reg); 57 + } 58 + 59 + if (priv->core_reg) { 60 + regulator_set_voltage(priv->core_reg, 2800000, 2800000); 61 + regulator_enable(priv->core_reg); 62 + } 63 + 64 + gpio_set_value(pdata->data_enable_gpio, 1); 65 + msleep(60); 66 + spi_write(spi, (const u8 *)cmd, ARRAY_SIZE(cmd) * sizeof(u16)); 67 + } 68 + 69 + static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power) 70 + { 71 + struct l4f00242t03_priv *priv = lcd_get_data(ld); 72 + struct spi_device *spi = priv->spi; 73 + 74 + const u16 slpout = 0x11; 75 + const u16 dison = 0x29; 76 + 77 + const u16 slpin = 0x10; 78 + const u16 disoff = 0x28; 79 + 80 + if (power) { 81 + if (priv->lcd_on) 82 + return 0; 83 + 84 + dev_dbg(&spi->dev, "turning on LCD\n"); 85 + 86 + spi_write(spi, (const u8 *)&slpout, sizeof(u16)); 87 + msleep(60); 88 + spi_write(spi, (const u8 *)&dison, sizeof(u16)); 89 + 90 + priv->lcd_on = 1; 91 + } else { 92 + if (!priv->lcd_on) 93 + return 0; 94 + 95 + dev_dbg(&spi->dev, "turning off LCD\n"); 96 + 97 + spi_write(spi, (const u8 *)&disoff, sizeof(u16)); 98 + msleep(60); 99 + spi_write(spi, (const u8 *)&slpin, sizeof(u16)); 100 + 101 + priv->lcd_on = 0; 102 + } 103 + 104 + return 0; 105 + } 106 + 107 + static struct lcd_ops l4f_ops = { 108 + .set_power = l4f00242t03_lcd_power_set, 109 + .get_power = NULL, 110 + }; 111 + 112 + static int __devinit l4f00242t03_probe(struct spi_device *spi) 113 + { 114 + struct l4f00242t03_priv *priv; 115 + struct l4f00242t03_pdata *pdata = spi->dev.platform_data; 116 + int ret; 117 + 118 + if (pdata == NULL) { 119 + dev_err(&spi->dev, "Uninitialized platform data.\n"); 120 + return -EINVAL; 121 + } 122 + 123 + priv = kzalloc(sizeof(struct l4f00242t03_priv), GFP_KERNEL); 124 + 125 + if (priv == NULL) { 126 + dev_err(&spi->dev, "No memory for this device.\n"); 127 + ret = -ENOMEM; 128 + goto err; 129 + } 130 + 131 + dev_set_drvdata(&spi->dev, priv); 132 + spi->bits_per_word = 9; 133 + spi_setup(spi); 134 + 135 + priv->spi = spi; 136 + 137 + ret = gpio_request(pdata->reset_gpio, "lcd l4f00242t03 reset"); 138 + if (ret) { 139 + dev_err(&spi->dev, 140 + "Unable to get the lcd l4f00242t03 reset gpio.\n"); 141 + return ret; 142 + } 143 + 144 + ret = gpio_direction_output(pdata->reset_gpio, 1); 145 + if (ret) 146 + goto err2; 147 + 148 + ret = gpio_request(pdata->data_enable_gpio, 149 + "lcd l4f00242t03 data enable"); 150 + if (ret) { 151 + dev_err(&spi->dev, 152 + "Unable to get the lcd l4f00242t03 data en gpio.\n"); 153 + return ret; 154 + } 155 + 156 + ret = gpio_direction_output(pdata->data_enable_gpio, 0); 157 + if (ret) 158 + goto err3; 159 + 160 + if (pdata->io_supply) { 161 + priv->io_reg = regulator_get(NULL, pdata->io_supply); 162 + 163 + if (IS_ERR(priv->io_reg)) { 164 + pr_err("%s: Unable to get the IO regulator\n", 165 + __func__); 166 + goto err3; 167 + } 168 + } 169 + 170 + if (pdata->core_supply) { 171 + priv->core_reg = regulator_get(NULL, pdata->core_supply); 172 + 173 + if (IS_ERR(priv->core_reg)) { 174 + pr_err("%s: Unable to get the core regulator\n", 175 + __func__); 176 + goto err4; 177 + } 178 + } 179 + 180 + priv->ld = lcd_device_register("l4f00242t03", 181 + &spi->dev, priv, &l4f_ops); 182 + if (IS_ERR(priv->ld)) { 183 + ret = PTR_ERR(priv->ld); 184 + goto err5; 185 + } 186 + 187 + /* Init the LCD */ 188 + l4f00242t03_reset(pdata->reset_gpio); 189 + l4f00242t03_lcd_init(spi); 190 + l4f00242t03_lcd_power_set(priv->ld, 1); 191 + 192 + dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n"); 193 + 194 + return 0; 195 + 196 + err5: 197 + if (priv->core_reg) 198 + regulator_put(priv->core_reg); 199 + err4: 200 + if (priv->io_reg) 201 + regulator_put(priv->io_reg); 202 + err3: 203 + gpio_free(pdata->data_enable_gpio); 204 + err2: 205 + gpio_free(pdata->reset_gpio); 206 + err: 207 + kfree(priv); 208 + 209 + return ret; 210 + } 211 + 212 + static int __devexit l4f00242t03_remove(struct spi_device *spi) 213 + { 214 + struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev); 215 + struct l4f00242t03_pdata *pdata = priv->spi->dev.platform_data; 216 + 217 + l4f00242t03_lcd_power_set(priv->ld, 0); 218 + lcd_device_unregister(priv->ld); 219 + 220 + gpio_free(pdata->data_enable_gpio); 221 + gpio_free(pdata->reset_gpio); 222 + 223 + if (priv->io_reg) 224 + regulator_put(priv->core_reg); 225 + if (priv->core_reg) 226 + regulator_put(priv->io_reg); 227 + 228 + kfree(priv); 229 + 230 + return 0; 231 + } 232 + 233 + static struct spi_driver l4f00242t03_driver = { 234 + .driver = { 235 + .name = "l4f00242t03", 236 + .owner = THIS_MODULE, 237 + }, 238 + .probe = l4f00242t03_probe, 239 + .remove = __devexit_p(l4f00242t03_remove), 240 + }; 241 + 242 + static __init int l4f00242t03_init(void) 243 + { 244 + return spi_register_driver(&l4f00242t03_driver); 245 + } 246 + 247 + static __exit void l4f00242t03_exit(void) 248 + { 249 + spi_unregister_driver(&l4f00242t03_driver); 250 + } 251 + 252 + module_init(l4f00242t03_init); 253 + module_exit(l4f00242t03_exit); 254 + 255 + MODULE_AUTHOR("Alberto Panizzo <maramaopercheseimorto@gmail.com>"); 256 + MODULE_DESCRIPTION("EPSON L4F00242T03 LCD"); 257 + MODULE_LICENSE("GPL v2");
+6 -2
drivers/video/backlight/locomolcd.c
··· 167 168 static int locomolcd_probe(struct locomo_dev *ldev) 169 { 170 unsigned long flags; 171 172 local_irq_save(flags); ··· 183 184 local_irq_restore(flags); 185 186 - locomolcd_bl_device = backlight_device_register("locomo-bl", &ldev->dev, NULL, &locomobl_data); 187 188 if (IS_ERR (locomolcd_bl_device)) 189 return PTR_ERR (locomolcd_bl_device); 190 191 /* Set up frontlight so that screen is readable */ 192 - locomolcd_bl_device->props.max_brightness = 4, 193 locomolcd_bl_device->props.brightness = 2; 194 locomolcd_set_intensity(locomolcd_bl_device); 195
··· 167 168 static int locomolcd_probe(struct locomo_dev *ldev) 169 { 170 + struct backlight_properties props; 171 unsigned long flags; 172 173 local_irq_save(flags); ··· 182 183 local_irq_restore(flags); 184 185 + memset(&props, 0, sizeof(struct backlight_properties)); 186 + props.max_brightness = 4; 187 + locomolcd_bl_device = backlight_device_register("locomo-bl", 188 + &ldev->dev, NULL, 189 + &locomobl_data, &props); 190 191 if (IS_ERR (locomolcd_bl_device)) 192 return PTR_ERR (locomolcd_bl_device); 193 194 /* Set up frontlight so that screen is readable */ 195 locomolcd_bl_device->props.brightness = 2; 196 locomolcd_set_intensity(locomolcd_bl_device); 197
+4 -2
drivers/video/backlight/max8925_bl.c
··· 104 struct max8925_backlight_pdata *pdata = NULL; 105 struct max8925_backlight_data *data; 106 struct backlight_device *bl; 107 struct resource *res; 108 char name[MAX8925_NAME_SIZE]; 109 unsigned char value; ··· 134 data->chip = chip; 135 data->current_brightness = 0; 136 137 bl = backlight_device_register(name, &pdev->dev, data, 138 - &max8925_backlight_ops); 139 if (IS_ERR(bl)) { 140 dev_err(&pdev->dev, "failed to register backlight\n"); 141 kfree(data); 142 return PTR_ERR(bl); 143 } 144 - bl->props.max_brightness = MAX_BRIGHTNESS; 145 bl->props.brightness = MAX_BRIGHTNESS; 146 147 platform_set_drvdata(pdev, bl);
··· 104 struct max8925_backlight_pdata *pdata = NULL; 105 struct max8925_backlight_data *data; 106 struct backlight_device *bl; 107 + struct backlight_properties props; 108 struct resource *res; 109 char name[MAX8925_NAME_SIZE]; 110 unsigned char value; ··· 133 data->chip = chip; 134 data->current_brightness = 0; 135 136 + memset(&props, 0, sizeof(struct backlight_properties)); 137 + props.max_brightness = MAX_BRIGHTNESS; 138 bl = backlight_device_register(name, &pdev->dev, data, 139 + &max8925_backlight_ops, &props); 140 if (IS_ERR(bl)) { 141 dev_err(&pdev->dev, "failed to register backlight\n"); 142 kfree(data); 143 return PTR_ERR(bl); 144 } 145 bl->props.brightness = MAX_BRIGHTNESS; 146 147 platform_set_drvdata(pdev, bl);
+52 -3
drivers/video/backlight/mbp_nvidia_bl.c
··· 139 static const struct dmi_system_id __initdata mbp_device_table[] = { 140 { 141 .callback = mbp_dmi_match, 142 .ident = "MacBookPro 3,1", 143 .matches = { 144 DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), ··· 295 296 static int __init mbp_init(void) 297 { 298 if (!dmi_check_system(mbp_device_table)) 299 return -ENODEV; 300 ··· 303 "Macbook Pro backlight")) 304 return -ENXIO; 305 306 - mbp_backlight_device = backlight_device_register("mbp_backlight", 307 - NULL, NULL, &driver_data->backlight_ops); 308 if (IS_ERR(mbp_backlight_device)) { 309 release_region(driver_data->iostart, driver_data->iolen); 310 return PTR_ERR(mbp_backlight_device); 311 } 312 313 - mbp_backlight_device->props.max_brightness = 15; 314 mbp_backlight_device->props.brightness = 315 driver_data->backlight_ops.get_brightness(mbp_backlight_device); 316 backlight_update_status(mbp_backlight_device);
··· 139 static const struct dmi_system_id __initdata mbp_device_table[] = { 140 { 141 .callback = mbp_dmi_match, 142 + .ident = "MacBook 1,1", 143 + .matches = { 144 + DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), 145 + DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"), 146 + }, 147 + .driver_data = (void *)&intel_chipset_data, 148 + }, 149 + { 150 + .callback = mbp_dmi_match, 151 + .ident = "MacBook 2,1", 152 + .matches = { 153 + DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), 154 + DMI_MATCH(DMI_PRODUCT_NAME, "MacBook2,1"), 155 + }, 156 + .driver_data = (void *)&intel_chipset_data, 157 + }, 158 + { 159 + .callback = mbp_dmi_match, 160 + .ident = "MacBook 3,1", 161 + .matches = { 162 + DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), 163 + DMI_MATCH(DMI_PRODUCT_NAME, "MacBook3,1"), 164 + }, 165 + .driver_data = (void *)&intel_chipset_data, 166 + }, 167 + { 168 + .callback = mbp_dmi_match, 169 + .ident = "MacBook 4,1", 170 + .matches = { 171 + DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), 172 + DMI_MATCH(DMI_PRODUCT_NAME, "MacBook4,1"), 173 + }, 174 + .driver_data = (void *)&intel_chipset_data, 175 + }, 176 + { 177 + .callback = mbp_dmi_match, 178 + .ident = "MacBook 4,2", 179 + .matches = { 180 + DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), 181 + DMI_MATCH(DMI_PRODUCT_NAME, "MacBook4,2"), 182 + }, 183 + .driver_data = (void *)&intel_chipset_data, 184 + }, 185 + { 186 + .callback = mbp_dmi_match, 187 .ident = "MacBookPro 3,1", 188 .matches = { 189 DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), ··· 250 251 static int __init mbp_init(void) 252 { 253 + struct backlight_properties props; 254 if (!dmi_check_system(mbp_device_table)) 255 return -ENODEV; 256 ··· 257 "Macbook Pro backlight")) 258 return -ENXIO; 259 260 + memset(&props, 0, sizeof(struct backlight_properties)); 261 + props.max_brightness = 15; 262 + mbp_backlight_device = backlight_device_register("mbp_backlight", NULL, 263 + NULL, 264 + &driver_data->backlight_ops, 265 + &props); 266 if (IS_ERR(mbp_backlight_device)) { 267 release_region(driver_data->iostart, driver_data->iolen); 268 return PTR_ERR(mbp_backlight_device); 269 } 270 271 mbp_backlight_device->props.brightness = 272 driver_data->backlight_ops.get_brightness(mbp_backlight_device); 273 backlight_update_status(mbp_backlight_device);
+5 -2
drivers/video/backlight/omap1_bl.c
··· 132 133 static int omapbl_probe(struct platform_device *pdev) 134 { 135 struct backlight_device *dev; 136 struct omap_backlight *bl; 137 struct omap_backlight_config *pdata = pdev->dev.platform_data; ··· 144 if (unlikely(!bl)) 145 return -ENOMEM; 146 147 - dev = backlight_device_register("omap-bl", &pdev->dev, bl, &omapbl_ops); 148 if (IS_ERR(dev)) { 149 kfree(bl); 150 return PTR_ERR(dev); ··· 164 omap_cfg_reg(PWL); /* Conflicts with UART3 */ 165 166 dev->props.fb_blank = FB_BLANK_UNBLANK; 167 - dev->props.max_brightness = OMAPBL_MAX_INTENSITY; 168 dev->props.brightness = pdata->default_intensity; 169 omapbl_update_status(dev); 170
··· 132 133 static int omapbl_probe(struct platform_device *pdev) 134 { 135 + struct backlight_properties props; 136 struct backlight_device *dev; 137 struct omap_backlight *bl; 138 struct omap_backlight_config *pdata = pdev->dev.platform_data; ··· 143 if (unlikely(!bl)) 144 return -ENOMEM; 145 146 + memset(&props, 0, sizeof(struct backlight_properties)); 147 + props.max_brightness = OMAPBL_MAX_INTENSITY; 148 + dev = backlight_device_register("omap-bl", &pdev->dev, bl, &omapbl_ops, 149 + &props); 150 if (IS_ERR(dev)) { 151 kfree(bl); 152 return PTR_ERR(dev); ··· 160 omap_cfg_reg(PWL); /* Conflicts with UART3 */ 161 162 dev->props.fb_blank = FB_BLANK_UNBLANK; 163 dev->props.brightness = pdata->default_intensity; 164 omapbl_update_status(dev); 165
+17 -6
drivers/video/backlight/progear_bl.c
··· 61 62 static int progearbl_probe(struct platform_device *pdev) 63 { 64 u8 temp; 65 struct backlight_device *progear_backlight_device; 66 67 pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, NULL); 68 if (!pmu_dev) { ··· 75 sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); 76 if (!sb_dev) { 77 printk("ALI 1533 SB not found.\n"); 78 - pci_dev_put(pmu_dev); 79 - return -ENODEV; 80 } 81 82 /* Set SB_MPS1 to enable brightness control. */ 83 pci_read_config_byte(sb_dev, SB_MPS1, &temp); 84 pci_write_config_byte(sb_dev, SB_MPS1, temp | 0x20); 85 86 progear_backlight_device = backlight_device_register("progear-bl", 87 &pdev->dev, NULL, 88 - &progearbl_ops); 89 - if (IS_ERR(progear_backlight_device)) 90 - return PTR_ERR(progear_backlight_device); 91 92 platform_set_drvdata(pdev, progear_backlight_device); 93 94 progear_backlight_device->props.power = FB_BLANK_UNBLANK; 95 progear_backlight_device->props.brightness = HW_LEVEL_MAX - HW_LEVEL_MIN; 96 - progear_backlight_device->props.max_brightness = HW_LEVEL_MAX - HW_LEVEL_MIN; 97 progearbl_set_intensity(progear_backlight_device); 98 99 return 0; 100 } 101 102 static int progearbl_remove(struct platform_device *pdev)
··· 61 62 static int progearbl_probe(struct platform_device *pdev) 63 { 64 + struct backlight_properties props; 65 u8 temp; 66 struct backlight_device *progear_backlight_device; 67 + int ret; 68 69 pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, NULL); 70 if (!pmu_dev) { ··· 73 sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); 74 if (!sb_dev) { 75 printk("ALI 1533 SB not found.\n"); 76 + ret = -ENODEV; 77 + goto put_pmu; 78 } 79 80 /* Set SB_MPS1 to enable brightness control. */ 81 pci_read_config_byte(sb_dev, SB_MPS1, &temp); 82 pci_write_config_byte(sb_dev, SB_MPS1, temp | 0x20); 83 84 + memset(&props, 0, sizeof(struct backlight_properties)); 85 + props.max_brightness = HW_LEVEL_MAX - HW_LEVEL_MIN; 86 progear_backlight_device = backlight_device_register("progear-bl", 87 &pdev->dev, NULL, 88 + &progearbl_ops, 89 + &props); 90 + if (IS_ERR(progear_backlight_device)) { 91 + ret = PTR_ERR(progear_backlight_device); 92 + goto put_sb; 93 + } 94 95 platform_set_drvdata(pdev, progear_backlight_device); 96 97 progear_backlight_device->props.power = FB_BLANK_UNBLANK; 98 progear_backlight_device->props.brightness = HW_LEVEL_MAX - HW_LEVEL_MIN; 99 progearbl_set_intensity(progear_backlight_device); 100 101 return 0; 102 + put_sb: 103 + pci_dev_put(sb_dev); 104 + put_pmu: 105 + pci_dev_put(pmu_dev); 106 + return ret; 107 } 108 109 static int progearbl_remove(struct platform_device *pdev)
+5 -3
drivers/video/backlight/pwm_bl.c
··· 65 66 static int pwm_backlight_probe(struct platform_device *pdev) 67 { 68 struct platform_pwm_backlight_data *data = pdev->dev.platform_data; 69 struct backlight_device *bl; 70 struct pwm_bl_data *pb; ··· 101 } else 102 dev_dbg(&pdev->dev, "got pwm for backlight\n"); 103 104 - bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, 105 - pb, &pwm_backlight_ops); 106 if (IS_ERR(bl)) { 107 dev_err(&pdev->dev, "failed to register backlight\n"); 108 ret = PTR_ERR(bl); 109 goto err_bl; 110 } 111 112 - bl->props.max_brightness = data->max_brightness; 113 bl->props.brightness = data->dft_brightness; 114 backlight_update_status(bl); 115
··· 65 66 static int pwm_backlight_probe(struct platform_device *pdev) 67 { 68 + struct backlight_properties props; 69 struct platform_pwm_backlight_data *data = pdev->dev.platform_data; 70 struct backlight_device *bl; 71 struct pwm_bl_data *pb; ··· 100 } else 101 dev_dbg(&pdev->dev, "got pwm for backlight\n"); 102 103 + memset(&props, 0, sizeof(struct backlight_properties)); 104 + props.max_brightness = data->max_brightness; 105 + bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, pb, 106 + &pwm_backlight_ops, &props); 107 if (IS_ERR(bl)) { 108 dev_err(&pdev->dev, "failed to register backlight\n"); 109 ret = PTR_ERR(bl); 110 goto err_bl; 111 } 112 113 bl->props.brightness = data->dft_brightness; 114 backlight_update_status(bl); 115
+5 -3
drivers/video/backlight/tosa_bl.c
··· 80 static int __devinit tosa_bl_probe(struct i2c_client *client, 81 const struct i2c_device_id *id) 82 { 83 struct tosa_bl_data *data = kzalloc(sizeof(struct tosa_bl_data), GFP_KERNEL); 84 int ret = 0; 85 if (!data) ··· 100 i2c_set_clientdata(client, data); 101 data->i2c = client; 102 103 - data->bl = backlight_device_register("tosa-bl", &client->dev, 104 - data, &bl_ops); 105 if (IS_ERR(data->bl)) { 106 ret = PTR_ERR(data->bl); 107 goto err_reg; 108 } 109 110 data->bl->props.brightness = 69; 111 - data->bl->props.max_brightness = 512 - 1; 112 data->bl->props.power = FB_BLANK_UNBLANK; 113 114 backlight_update_status(data->bl);
··· 80 static int __devinit tosa_bl_probe(struct i2c_client *client, 81 const struct i2c_device_id *id) 82 { 83 + struct backlight_properties props; 84 struct tosa_bl_data *data = kzalloc(sizeof(struct tosa_bl_data), GFP_KERNEL); 85 int ret = 0; 86 if (!data) ··· 99 i2c_set_clientdata(client, data); 100 data->i2c = client; 101 102 + memset(&props, 0, sizeof(struct backlight_properties)); 103 + props.max_brightness = 512 - 1; 104 + data->bl = backlight_device_register("tosa-bl", &client->dev, data, 105 + &bl_ops, &props); 106 if (IS_ERR(data->bl)) { 107 ret = PTR_ERR(data->bl); 108 goto err_reg; 109 } 110 111 data->bl->props.brightness = 69; 112 data->bl->props.power = FB_BLANK_UNBLANK; 113 114 backlight_update_status(data->bl);
+4 -3
drivers/video/backlight/wm831x_bl.c
··· 125 struct wm831x_backlight_pdata *pdata; 126 struct wm831x_backlight_data *data; 127 struct backlight_device *bl; 128 int ret, i, max_isel, isink_reg, dcdc_cfg; 129 130 /* We need platform data */ ··· 192 data->current_brightness = 0; 193 data->isink_reg = isink_reg; 194 195 - bl = backlight_device_register("wm831x", &pdev->dev, 196 - data, &wm831x_backlight_ops); 197 if (IS_ERR(bl)) { 198 dev_err(&pdev->dev, "failed to register backlight\n"); 199 kfree(data); 200 return PTR_ERR(bl); 201 } 202 203 - bl->props.max_brightness = max_isel; 204 bl->props.brightness = max_isel; 205 206 platform_set_drvdata(pdev, bl);
··· 125 struct wm831x_backlight_pdata *pdata; 126 struct wm831x_backlight_data *data; 127 struct backlight_device *bl; 128 + struct backlight_properties props; 129 int ret, i, max_isel, isink_reg, dcdc_cfg; 130 131 /* We need platform data */ ··· 191 data->current_brightness = 0; 192 data->isink_reg = isink_reg; 193 194 + props.max_brightness = max_isel; 195 + bl = backlight_device_register("wm831x", &pdev->dev, data, 196 + &wm831x_backlight_ops, &props); 197 if (IS_ERR(bl)) { 198 dev_err(&pdev->dev, "failed to register backlight\n"); 199 kfree(data); 200 return PTR_ERR(bl); 201 } 202 203 bl->props.brightness = max_isel; 204 205 platform_set_drvdata(pdev, bl);
+14 -5
drivers/video/bf54x-lq043fb.c
··· 433 return 0; 434 } 435 436 - static struct backlight_ops bfin_lq043fb_bl_ops = { 437 .get_brightness = bl_get_brightness, 438 }; 439 ··· 501 502 static int __devinit bfin_bf54x_probe(struct platform_device *pdev) 503 { 504 struct bfin_bf54xfb_info *info; 505 struct fb_info *fbinfo; 506 int ret; ··· 646 goto out8; 647 } 648 #ifndef NO_BL_SUPPORT 649 - bl_dev = 650 - backlight_device_register("bf54x-bl", NULL, NULL, 651 - &bfin_lq043fb_bl_ops); 652 - bl_dev->props.max_brightness = 255; 653 654 lcd_dev = lcd_device_register(DRIVER_NAME, &pdev->dev, NULL, &bfin_lcd_ops); 655 lcd_dev->props.max_contrast = 255, printk(KERN_INFO "Done.\n"); ··· 663 664 return 0; 665 666 out8: 667 free_irq(info->irq, info); 668 out7:
··· 433 return 0; 434 } 435 436 + static const struct backlight_ops bfin_lq043fb_bl_ops = { 437 .get_brightness = bl_get_brightness, 438 }; 439 ··· 501 502 static int __devinit bfin_bf54x_probe(struct platform_device *pdev) 503 { 504 + struct backlight_properties props; 505 struct bfin_bf54xfb_info *info; 506 struct fb_info *fbinfo; 507 int ret; ··· 645 goto out8; 646 } 647 #ifndef NO_BL_SUPPORT 648 + memset(&props, 0, sizeof(struct backlight_properties)); 649 + props.max_brightness = 255; 650 + bl_dev = backlight_device_register("bf54x-bl", NULL, NULL, 651 + &bfin_lq043fb_bl_ops, &props); 652 + if (IS_ERR(bl_dev)) { 653 + printk(KERN_ERR DRIVER_NAME 654 + ": unable to register backlight.\n"); 655 + ret = -EINVAL; 656 + goto out9; 657 + } 658 659 lcd_dev = lcd_device_register(DRIVER_NAME, &pdev->dev, NULL, &bfin_lcd_ops); 660 lcd_dev->props.max_contrast = 255, printk(KERN_INFO "Done.\n"); ··· 656 657 return 0; 658 659 + out9: 660 + unregister_framebuffer(fbinfo); 661 out8: 662 free_irq(info->irq, info); 663 out7:
+14 -5
drivers/video/bfin-t350mcqb-fb.c
··· 352 return 0; 353 } 354 355 - static struct backlight_ops bfin_lq043fb_bl_ops = { 356 .get_brightness = bl_get_brightness, 357 }; 358 ··· 419 420 static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev) 421 { 422 struct bfin_t350mcqbfb_info *info; 423 struct fb_info *fbinfo; 424 int ret; ··· 541 goto out8; 542 } 543 #ifndef NO_BL_SUPPORT 544 - bl_dev = 545 - backlight_device_register("bf52x-bl", NULL, NULL, 546 - &bfin_lq043fb_bl_ops); 547 - bl_dev->props.max_brightness = 255; 548 549 lcd_dev = lcd_device_register(DRIVER_NAME, NULL, &bfin_lcd_ops); 550 lcd_dev->props.max_contrast = 255, printk(KERN_INFO "Done.\n"); ··· 558 559 return 0; 560 561 out8: 562 free_irq(info->irq, info); 563 out7:
··· 352 return 0; 353 } 354 355 + static const struct backlight_ops bfin_lq043fb_bl_ops = { 356 .get_brightness = bl_get_brightness, 357 }; 358 ··· 419 420 static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev) 421 { 422 + struct backlight_properties props; 423 struct bfin_t350mcqbfb_info *info; 424 struct fb_info *fbinfo; 425 int ret; ··· 540 goto out8; 541 } 542 #ifndef NO_BL_SUPPORT 543 + memset(&props, 0, sizeof(struct backlight_properties)); 544 + props.max_brightness = 255; 545 + bl_dev = backlight_device_register("bf52x-bl", NULL, NULL, 546 + &bfin_lq043fb_bl_ops, &props); 547 + if (IS_ERR(bl_dev)) { 548 + printk(KERN_ERR DRIVER_NAME 549 + ": unable to register backlight.\n"); 550 + ret = -EINVAL; 551 + goto out9; 552 + } 553 554 lcd_dev = lcd_device_register(DRIVER_NAME, NULL, &bfin_lcd_ops); 555 lcd_dev->props.max_contrast = 255, printk(KERN_INFO "Done.\n"); ··· 551 552 return 0; 553 554 + out9: 555 + unregister_framebuffer(fbinfo); 556 out8: 557 free_irq(info->irq, info); 558 out7:
+5 -2
drivers/video/nvidia/nv_backlight.c
··· 94 95 void nvidia_bl_init(struct nvidia_par *par) 96 { 97 struct fb_info *info = pci_get_drvdata(par->pci_dev); 98 struct backlight_device *bd; 99 char name[12]; ··· 110 111 snprintf(name, sizeof(name), "nvidiabl%d", info->node); 112 113 - bd = backlight_device_register(name, info->dev, par, &nvidia_bl_ops); 114 if (IS_ERR(bd)) { 115 info->bl_dev = NULL; 116 printk(KERN_WARNING "nvidia: Backlight registration failed\n"); ··· 125 0x158 * FB_BACKLIGHT_MAX / MAX_LEVEL, 126 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); 127 128 - bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 129 bd->props.brightness = bd->props.max_brightness; 130 bd->props.power = FB_BLANK_UNBLANK; 131 backlight_update_status(bd);
··· 94 95 void nvidia_bl_init(struct nvidia_par *par) 96 { 97 + struct backlight_properties props; 98 struct fb_info *info = pci_get_drvdata(par->pci_dev); 99 struct backlight_device *bd; 100 char name[12]; ··· 109 110 snprintf(name, sizeof(name), "nvidiabl%d", info->node); 111 112 + memset(&props, 0, sizeof(struct backlight_properties)); 113 + props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 114 + bd = backlight_device_register(name, info->dev, par, &nvidia_bl_ops, 115 + &props); 116 if (IS_ERR(bd)) { 117 info->bl_dev = NULL; 118 printk(KERN_WARNING "nvidia: Backlight registration failed\n"); ··· 121 0x158 * FB_BACKLIGHT_MAX / MAX_LEVEL, 122 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); 123 124 bd->props.brightness = bd->props.max_brightness; 125 bd->props.power = FB_BLANK_UNBLANK; 126 backlight_update_status(bd);
+9 -6
drivers/video/omap2/displays/panel-taal.c
··· 486 487 static int taal_probe(struct omap_dss_device *dssdev) 488 { 489 struct taal_data *td; 490 struct backlight_device *bldev; 491 int r; ··· 521 522 /* if no platform set_backlight() defined, presume DSI backlight 523 * control */ 524 if (!dssdev->set_backlight) 525 td->use_dsi_bl = true; 526 527 bldev = backlight_device_register("taal", &dssdev->dev, dssdev, 528 - &taal_bl_ops); 529 if (IS_ERR(bldev)) { 530 r = PTR_ERR(bldev); 531 goto err2; ··· 540 541 bldev->props.fb_blank = FB_BLANK_UNBLANK; 542 bldev->props.power = FB_BLANK_UNBLANK; 543 - if (td->use_dsi_bl) { 544 - bldev->props.max_brightness = 255; 545 bldev->props.brightness = 255; 546 - } else { 547 - bldev->props.max_brightness = 127; 548 bldev->props.brightness = 127; 549 - } 550 551 taal_bl_update_status(bldev); 552
··· 486 487 static int taal_probe(struct omap_dss_device *dssdev) 488 { 489 + struct backlight_properties props; 490 struct taal_data *td; 491 struct backlight_device *bldev; 492 int r; ··· 520 521 /* if no platform set_backlight() defined, presume DSI backlight 522 * control */ 523 + memset(&props, 0, sizeof(struct backlight_properties)); 524 if (!dssdev->set_backlight) 525 td->use_dsi_bl = true; 526 527 + if (td->use_dsi_bl) 528 + props.max_brightness = 255; 529 + else 530 + props.max_brightness = 127; 531 bldev = backlight_device_register("taal", &dssdev->dev, dssdev, 532 + &taal_bl_ops, &props); 533 if (IS_ERR(bldev)) { 534 r = PTR_ERR(bldev); 535 goto err2; ··· 534 535 bldev->props.fb_blank = FB_BLANK_UNBLANK; 536 bldev->props.power = FB_BLANK_UNBLANK; 537 + if (td->use_dsi_bl) 538 bldev->props.brightness = 255; 539 + else 540 bldev->props.brightness = 127; 541 542 taal_bl_update_status(bldev); 543
+5 -2
drivers/video/riva/fbdev.c
··· 338 339 static void riva_bl_init(struct riva_par *par) 340 { 341 struct fb_info *info = pci_get_drvdata(par->pdev); 342 struct backlight_device *bd; 343 char name[12]; ··· 354 355 snprintf(name, sizeof(name), "rivabl%d", info->node); 356 357 - bd = backlight_device_register(name, info->dev, par, &riva_bl_ops); 358 if (IS_ERR(bd)) { 359 info->bl_dev = NULL; 360 printk(KERN_WARNING "riva: Backlight registration failed\n"); ··· 369 MIN_LEVEL * FB_BACKLIGHT_MAX / MAX_LEVEL, 370 FB_BACKLIGHT_MAX); 371 372 - bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 373 bd->props.brightness = bd->props.max_brightness; 374 bd->props.power = FB_BLANK_UNBLANK; 375 backlight_update_status(bd);
··· 338 339 static void riva_bl_init(struct riva_par *par) 340 { 341 + struct backlight_properties props; 342 struct fb_info *info = pci_get_drvdata(par->pdev); 343 struct backlight_device *bd; 344 char name[12]; ··· 353 354 snprintf(name, sizeof(name), "rivabl%d", info->node); 355 356 + memset(&props, 0, sizeof(struct backlight_properties)); 357 + props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 358 + bd = backlight_device_register(name, info->dev, par, &riva_bl_ops, 359 + &props); 360 if (IS_ERR(bd)) { 361 info->bl_dev = NULL; 362 printk(KERN_WARNING "riva: Backlight registration failed\n"); ··· 365 MIN_LEVEL * FB_BACKLIGHT_MAX / MAX_LEVEL, 366 FB_BACKLIGHT_MAX); 367 368 bd->props.brightness = bd->props.max_brightness; 369 bd->props.power = FB_BLANK_UNBLANK; 370 backlight_update_status(bd);
+6 -5
include/linux/backlight.h
··· 36 struct fb_info; 37 38 struct backlight_ops { 39 - const unsigned int options; 40 41 #define BL_CORE_SUSPENDRESUME (1 << 0) 42 43 /* Notify the backlight driver some property has changed */ 44 - int (* const update_status)(struct backlight_device *); 45 /* Return the current backlight brightness (accounting for power, 46 fb_blank etc.) */ 47 - int (* const get_brightness)(struct backlight_device *); 48 /* Check if given framebuffer device is the one bound to this backlight; 49 return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ 50 - int (* const check_fb)(struct fb_info *); 51 }; 52 53 /* This structure defines all the properties of a backlight */ ··· 103 } 104 105 extern struct backlight_device *backlight_device_register(const char *name, 106 - struct device *dev, void *devdata, const struct backlight_ops *ops); 107 extern void backlight_device_unregister(struct backlight_device *bd); 108 extern void backlight_force_update(struct backlight_device *bd, 109 enum backlight_update_reason reason);
··· 36 struct fb_info; 37 38 struct backlight_ops { 39 + unsigned int options; 40 41 #define BL_CORE_SUSPENDRESUME (1 << 0) 42 43 /* Notify the backlight driver some property has changed */ 44 + int (*update_status)(struct backlight_device *); 45 /* Return the current backlight brightness (accounting for power, 46 fb_blank etc.) */ 47 + int (*get_brightness)(struct backlight_device *); 48 /* Check if given framebuffer device is the one bound to this backlight; 49 return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ 50 + int (*check_fb)(struct backlight_device *, struct fb_info *); 51 }; 52 53 /* This structure defines all the properties of a backlight */ ··· 103 } 104 105 extern struct backlight_device *backlight_device_register(const char *name, 106 + struct device *dev, void *devdata, const struct backlight_ops *ops, 107 + const struct backlight_properties *props); 108 extern void backlight_device_unregister(struct backlight_device *bd); 109 extern void backlight_force_update(struct backlight_device *bd, 110 enum backlight_update_reason reason);
+31
include/linux/spi/l4f00242t03.h
···
··· 1 + /* 2 + * l4f00242t03.h -- Platform glue for Epson L4F00242T03 LCD 3 + * 4 + * Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com> 5 + * Based on Marek Vasut work in lms283gf05.h 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License version 2 as 9 + * published by the Free Software Foundation. 10 + * 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + * 16 + * You should have received a copy of the GNU General Public License 17 + * along with this program; if not, write to the Free Software 18 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 + */ 20 + 21 + #ifndef _INCLUDE_LINUX_SPI_L4F00242T03_H_ 22 + #define _INCLUDE_LINUX_SPI_L4F00242T03_H_ 23 + 24 + struct l4f00242t03_pdata { 25 + unsigned int reset_gpio; 26 + unsigned int data_enable_gpio; 27 + const char *io_supply; /* will be set to 1.8 V */ 28 + const char *core_supply; /* will be set to 2.8 V */ 29 + }; 30 + 31 + #endif /* _INCLUDE_LINUX_SPI_L4F00242T03_H_ */