Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86

Pull x86 platform updates from Matthew Garrett:
"Nothing amazing here, almost entirely cleanups and minor bugfixes and
one bit of hardware enablement in the amilo-rfkill driver"

* 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86:
platform/x86: panasonic-laptop: reuse module_acpi_driver
samsung-laptop: fix config build error
platform: x86: remove unnecessary platform_set_drvdata()
amilo-rfkill: Enable using amilo-rfkill with the FSC Amilo L1310.
wmi: parse_wdg() should return kernel error codes
hp_wmi: Fix unregister order in hp_wmi_rfkill_setup()
platform: replace strict_strto*() with kstrto*()
x86: irst: use module_acpi_driver to simplify the code
x86: smartconnect: use module_acpi_driver to simplify the code
platform samsung-q10: use ACPI instead of direct EC calls
thinkpad_acpi: add the ability setting TPACPI_LED_NONE by quirk
thinkpad_acpi: return -NODEV while operating uninitialized LEDs

+66 -114
+2 -1
drivers/platform/x86/Kconfig
··· 732 732 tristate "Samsung Laptop driver" 733 733 depends on X86 734 734 depends on RFKILL || RFKILL = n 735 + depends on ACPI_VIDEO || ACPI_VIDEO = n 735 736 depends on BACKLIGHT_CLASS_DEVICE 736 737 select LEDS_CLASS 737 738 select NEW_LEDS ··· 765 764 766 765 config SAMSUNG_Q10 767 766 tristate "Samsung Q10 Extras" 768 - depends on SERIO_I8042 767 + depends on ACPI 769 768 select BACKLIGHT_CLASS_DEVICE 770 769 ---help--- 771 770 This driver provides support for backlight control on Samsung Q10
+7
drivers/platform/x86/amilo-rfkill.c
··· 85 85 { 86 86 .matches = { 87 87 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 88 + DMI_MATCH(DMI_BOARD_NAME, "AMILO L1310"), 89 + }, 90 + .driver_data = (void *)&amilo_a1655_rfkill_ops 91 + }, 92 + { 93 + .matches = { 94 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 88 95 DMI_MATCH(DMI_BOARD_NAME, "AMILO M7440"), 89 96 }, 90 97 .driver_data = (void *)&amilo_m7440_rfkill_ops
+1 -1
drivers/platform/x86/classmate-laptop.c
··· 590 590 inputdev = dev_get_drvdata(&acpi->dev); 591 591 accel = dev_get_drvdata(&inputdev->dev); 592 592 593 - r = strict_strtoul(buf, 0, &sensitivity); 593 + r = kstrtoul(buf, 0, &sensitivity); 594 594 if (r) 595 595 return r; 596 596
+4 -3
drivers/platform/x86/compal-laptop.c
··· 425 425 struct compal_data *data = dev_get_drvdata(dev); 426 426 long val; 427 427 int err; 428 - err = strict_strtol(buf, 10, &val); 428 + 429 + err = kstrtol(buf, 10, &val); 429 430 if (err) 430 431 return err; 431 432 if (val < 0) ··· 464 463 struct compal_data *data = dev_get_drvdata(dev); 465 464 long val; 466 465 int err; 467 - err = strict_strtol(buf, 10, &val); 466 + 467 + err = kstrtol(buf, 10, &val); 468 468 if (err) 469 469 return err; 470 470 if (val < 0 || val > 255) ··· 1083 1081 hwmon_device_unregister(data->hwmon_dev); 1084 1082 power_supply_unregister(&data->psy); 1085 1083 1086 - platform_set_drvdata(pdev, NULL); 1087 1084 kfree(data); 1088 1085 1089 1086 sysfs_remove_group(&pdev->dev.kobj, &compal_attribute_group);
+8 -8
drivers/platform/x86/hp-wmi.c
··· 725 725 (void *) HPWMI_WWAN); 726 726 if (!wwan_rfkill) { 727 727 err = -ENOMEM; 728 - goto register_gps_error; 728 + goto register_bluetooth_error; 729 729 } 730 730 rfkill_init_sw_state(wwan_rfkill, 731 731 hp_wmi_get_sw_state(HPWMI_WWAN)); ··· 733 733 hp_wmi_get_hw_state(HPWMI_WWAN)); 734 734 err = rfkill_register(wwan_rfkill); 735 735 if (err) 736 - goto register_wwan_err; 736 + goto register_wwan_error; 737 737 } 738 738 739 739 if (wireless & 0x8) { ··· 743 743 (void *) HPWMI_GPS); 744 744 if (!gps_rfkill) { 745 745 err = -ENOMEM; 746 - goto register_bluetooth_error; 746 + goto register_wwan_error; 747 747 } 748 748 rfkill_init_sw_state(gps_rfkill, 749 749 hp_wmi_get_sw_state(HPWMI_GPS)); ··· 755 755 } 756 756 757 757 return 0; 758 - register_wwan_err: 759 - rfkill_destroy(wwan_rfkill); 760 - wwan_rfkill = NULL; 761 - if (gps_rfkill) 762 - rfkill_unregister(gps_rfkill); 763 758 register_gps_error: 764 759 rfkill_destroy(gps_rfkill); 765 760 gps_rfkill = NULL; 766 761 if (bluetooth_rfkill) 767 762 rfkill_unregister(bluetooth_rfkill); 763 + register_wwan_error: 764 + rfkill_destroy(wwan_rfkill); 765 + wwan_rfkill = NULL; 766 + if (gps_rfkill) 767 + rfkill_unregister(gps_rfkill); 768 768 register_bluetooth_error: 769 769 rfkill_destroy(bluetooth_rfkill); 770 770 bluetooth_rfkill = NULL;
+1 -12
drivers/platform/x86/intel-rst.c
··· 193 193 }, 194 194 }; 195 195 196 - static int irst_init(void) 197 - { 198 - return acpi_bus_register_driver(&irst_driver); 199 - } 200 - 201 - static void irst_exit(void) 202 - { 203 - acpi_bus_unregister_driver(&irst_driver); 204 - } 205 - 206 - module_init(irst_init); 207 - module_exit(irst_exit); 196 + module_acpi_driver(irst_driver); 208 197 209 198 MODULE_DEVICE_TABLE(acpi, irst_ids);
+1 -12
drivers/platform/x86/intel-smartconnect.c
··· 74 74 }, 75 75 }; 76 76 77 - static int smartconnect_init(void) 78 - { 79 - return acpi_bus_register_driver(&smartconnect_driver); 80 - } 81 - 82 - static void smartconnect_exit(void) 83 - { 84 - acpi_bus_unregister_driver(&smartconnect_driver); 85 - } 86 - 87 - module_init(smartconnect_init); 88 - module_exit(smartconnect_exit); 77 + module_acpi_driver(smartconnect_driver); 89 78 90 79 MODULE_DEVICE_TABLE(acpi, smartconnect_ids);
-1
drivers/platform/x86/intel_mid_powerbtn.c
··· 128 128 129 129 free_irq(irq, input); 130 130 input_unregister_device(input); 131 - platform_set_drvdata(pdev, NULL); 132 131 133 132 return 0; 134 133 }
-1
drivers/platform/x86/intel_mid_thermal.c
··· 542 542 } 543 543 544 544 kfree(pinfo); 545 - platform_set_drvdata(pdev, NULL); 546 545 547 546 /* Stop the ADC */ 548 547 return configure_adc(0);
+1 -24
drivers/platform/x86/panasonic-laptop.c
··· 643 643 return result; 644 644 } 645 645 646 - static int __init acpi_pcc_init(void) 647 - { 648 - int result = 0; 649 - 650 - if (acpi_disabled) 651 - return -ENODEV; 652 - 653 - result = acpi_bus_register_driver(&acpi_pcc_driver); 654 - if (result < 0) { 655 - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 656 - "Error registering hotkey driver\n")); 657 - return -ENODEV; 658 - } 659 - 660 - return 0; 661 - } 662 - 663 646 static int acpi_pcc_hotkey_remove(struct acpi_device *device) 664 647 { 665 648 struct pcc_acpi *pcc = acpi_driver_data(device); ··· 662 679 return 0; 663 680 } 664 681 665 - static void __exit acpi_pcc_exit(void) 666 - { 667 - acpi_bus_unregister_driver(&acpi_pcc_driver); 668 - } 669 - 670 - module_init(acpi_pcc_init); 671 - module_exit(acpi_pcc_exit); 682 + module_acpi_driver(acpi_pcc_driver);
+21 -44
drivers/platform/x86/samsung-q10.c
··· 14 14 #include <linux/init.h> 15 15 #include <linux/platform_device.h> 16 16 #include <linux/backlight.h> 17 - #include <linux/i8042.h> 18 17 #include <linux/dmi.h> 18 + #include <acpi/acpi_drivers.h> 19 19 20 - #define SAMSUNGQ10_BL_MAX_INTENSITY 255 21 - #define SAMSUNGQ10_BL_DEFAULT_INTENSITY 185 20 + #define SAMSUNGQ10_BL_MAX_INTENSITY 7 22 21 23 - #define SAMSUNGQ10_BL_8042_CMD 0xbe 24 - #define SAMSUNGQ10_BL_8042_DATA { 0x89, 0x91 } 25 - 26 - static int samsungq10_bl_brightness; 22 + static acpi_handle ec_handle; 27 23 28 24 static bool force; 29 25 module_param(force, bool, 0); ··· 29 33 static int samsungq10_bl_set_intensity(struct backlight_device *bd) 30 34 { 31 35 32 - int brightness = bd->props.brightness; 33 - unsigned char c[3] = SAMSUNGQ10_BL_8042_DATA; 36 + acpi_status status; 37 + int i; 34 38 35 - c[2] = (unsigned char)brightness; 36 - i8042_lock_chip(); 37 - i8042_command(c, (0x30 << 8) | SAMSUNGQ10_BL_8042_CMD); 38 - i8042_unlock_chip(); 39 - samsungq10_bl_brightness = brightness; 39 + for (i = 0; i < SAMSUNGQ10_BL_MAX_INTENSITY; i++) { 40 + status = acpi_evaluate_object(ec_handle, "_Q63", NULL, NULL); 41 + if (ACPI_FAILURE(status)) 42 + return -EIO; 43 + } 44 + for (i = 0; i < bd->props.brightness; i++) { 45 + status = acpi_evaluate_object(ec_handle, "_Q64", NULL, NULL); 46 + if (ACPI_FAILURE(status)) 47 + return -EIO; 48 + } 40 49 41 50 return 0; 42 51 } 43 52 44 53 static int samsungq10_bl_get_intensity(struct backlight_device *bd) 45 54 { 46 - return samsungq10_bl_brightness; 55 + return bd->props.brightness; 47 56 } 48 57 49 58 static const struct backlight_ops samsungq10_bl_ops = { 50 59 .get_brightness = samsungq10_bl_get_intensity, 51 60 .update_status = samsungq10_bl_set_intensity, 52 61 }; 53 - 54 - #ifdef CONFIG_PM_SLEEP 55 - static int samsungq10_suspend(struct device *dev) 56 - { 57 - return 0; 58 - } 59 - 60 - static int samsungq10_resume(struct device *dev) 61 - { 62 - 63 - struct backlight_device *bd = dev_get_drvdata(dev); 64 - 65 - samsungq10_bl_set_intensity(bd); 66 - return 0; 67 - } 68 - #else 69 - #define samsungq10_suspend NULL 70 - #define samsungq10_resume NULL 71 - #endif 72 - 73 - static SIMPLE_DEV_PM_OPS(samsungq10_pm_ops, 74 - samsungq10_suspend, samsungq10_resume); 75 62 76 63 static int samsungq10_probe(struct platform_device *pdev) 77 64 { ··· 72 93 73 94 platform_set_drvdata(pdev, bd); 74 95 75 - bd->props.brightness = SAMSUNGQ10_BL_DEFAULT_INTENSITY; 76 - samsungq10_bl_set_intensity(bd); 77 - 78 96 return 0; 79 97 } 80 98 ··· 79 103 { 80 104 81 105 struct backlight_device *bd = platform_get_drvdata(pdev); 82 - 83 - bd->props.brightness = SAMSUNGQ10_BL_DEFAULT_INTENSITY; 84 - samsungq10_bl_set_intensity(bd); 85 106 86 107 backlight_device_unregister(bd); 87 108 ··· 89 116 .driver = { 90 117 .name = KBUILD_MODNAME, 91 118 .owner = THIS_MODULE, 92 - .pm = &samsungq10_pm_ops, 93 119 }, 94 120 .probe = samsungq10_probe, 95 121 .remove = samsungq10_remove, ··· 142 170 static int __init samsungq10_init(void) 143 171 { 144 172 if (!force && !dmi_check_system(samsungq10_dmi_table)) 173 + return -ENODEV; 174 + 175 + ec_handle = ec_get_handle(); 176 + 177 + if (!ec_handle) 145 178 return -ENODEV; 146 179 147 180 samsungq10_device = platform_create_bundle(&samsungq10_driver,
+18 -5
drivers/platform/x86/thinkpad_acpi.c
··· 369 369 struct led_classdev led_classdev; 370 370 struct work_struct work; 371 371 enum led_status_t new_state; 372 - unsigned int led; 372 + int led; 373 373 }; 374 374 375 375 /* brightness level capabilities */ ··· 5296 5296 5297 5297 led_supported = led_init_detect_mode(); 5298 5298 5299 + if (led_supported != TPACPI_LED_NONE) { 5300 + useful_leds = tpacpi_check_quirks(led_useful_qtable, 5301 + ARRAY_SIZE(led_useful_qtable)); 5302 + 5303 + if (!useful_leds) { 5304 + led_handle = NULL; 5305 + led_supported = TPACPI_LED_NONE; 5306 + } 5307 + } 5308 + 5299 5309 vdbg_printk(TPACPI_DBG_INIT, "LED commands are %s, mode %d\n", 5300 5310 str_supported(led_supported), led_supported); 5301 5311 ··· 5319 5309 return -ENOMEM; 5320 5310 } 5321 5311 5322 - useful_leds = tpacpi_check_quirks(led_useful_qtable, 5323 - ARRAY_SIZE(led_useful_qtable)); 5324 - 5325 5312 for (i = 0; i < TPACPI_LED_NUMLEDS; i++) { 5313 + tpacpi_leds[i].led = -1; 5314 + 5326 5315 if (!tpacpi_is_led_restricted(i) && 5327 5316 test_bit(i, &useful_leds)) { 5328 5317 rc = tpacpi_init_led(i); ··· 5379 5370 return -ENODEV; 5380 5371 5381 5372 while ((cmd = next_cmd(&buf))) { 5382 - if (sscanf(cmd, "%d", &led) != 1 || led < 0 || led > 15) 5373 + if (sscanf(cmd, "%d", &led) != 1) 5383 5374 return -EINVAL; 5375 + 5376 + if (led < 0 || led > (TPACPI_LED_NUMLEDS - 1) || 5377 + tpacpi_leds[led].led < 0) 5378 + return -ENODEV; 5384 5379 5385 5380 if (strstr(cmd, "off")) { 5386 5381 s = TPACPI_LED_OFF;
+2 -2
drivers/platform/x86/wmi.c
··· 780 780 /* 781 781 * Parse the _WDG method for the GUID data blocks 782 782 */ 783 - static acpi_status parse_wdg(acpi_handle handle) 783 + static int parse_wdg(acpi_handle handle) 784 784 { 785 785 struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL}; 786 786 union acpi_object *obj; ··· 812 812 813 813 wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL); 814 814 if (!wblock) 815 - return AE_NO_MEMORY; 815 + return -ENOMEM; 816 816 817 817 wblock->handle = handle; 818 818 wblock->gblock = gblock[i];