diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/acpi/acpi_lpss.c | 4 | ||||
| -rw-r--r-- | drivers/acpi/button.c | 5 | ||||
| -rw-r--r-- | drivers/acpi/utils.c | 16 | ||||
| -rw-r--r-- | drivers/acpi/video_detect.c | 8 | ||||
| -rw-r--r-- | drivers/extcon/extcon-axp288.c | 9 | ||||
| -rw-r--r-- | drivers/gpio/gpio-merrifield.c | 18 |
6 files changed, 43 insertions, 17 deletions
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index 1e2a10a06b9d..cf768608437e 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c | |||
| @@ -1142,8 +1142,8 @@ static struct dev_pm_domain acpi_lpss_pm_domain = { | |||
| 1142 | .thaw_noirq = acpi_subsys_thaw_noirq, | 1142 | .thaw_noirq = acpi_subsys_thaw_noirq, |
| 1143 | .poweroff = acpi_subsys_suspend, | 1143 | .poweroff = acpi_subsys_suspend, |
| 1144 | .poweroff_late = acpi_lpss_suspend_late, | 1144 | .poweroff_late = acpi_lpss_suspend_late, |
| 1145 | .poweroff_noirq = acpi_subsys_suspend_noirq, | 1145 | .poweroff_noirq = acpi_lpss_suspend_noirq, |
| 1146 | .restore_noirq = acpi_subsys_resume_noirq, | 1146 | .restore_noirq = acpi_lpss_resume_noirq, |
| 1147 | .restore_early = acpi_lpss_resume_early, | 1147 | .restore_early = acpi_lpss_resume_early, |
| 1148 | #endif | 1148 | #endif |
| 1149 | .runtime_suspend = acpi_lpss_runtime_suspend, | 1149 | .runtime_suspend = acpi_lpss_runtime_suspend, |
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index a19ff3977ac4..623998a8d722 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
| @@ -456,8 +456,11 @@ static int acpi_button_resume(struct device *dev) | |||
| 456 | struct acpi_button *button = acpi_driver_data(device); | 456 | struct acpi_button *button = acpi_driver_data(device); |
| 457 | 457 | ||
| 458 | button->suspended = false; | 458 | button->suspended = false; |
| 459 | if (button->type == ACPI_BUTTON_TYPE_LID && button->input->users) | 459 | if (button->type == ACPI_BUTTON_TYPE_LID && button->input->users) { |
| 460 | button->last_state = !!acpi_lid_evaluate_state(device); | ||
| 461 | button->last_time = ktime_get(); | ||
| 460 | acpi_lid_initialize_state(device); | 462 | acpi_lid_initialize_state(device); |
| 463 | } | ||
| 461 | return 0; | 464 | return 0; |
| 462 | } | 465 | } |
| 463 | #endif | 466 | #endif |
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index c4b06cc075f9..89363b245489 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
| @@ -739,6 +739,7 @@ EXPORT_SYMBOL(acpi_dev_found); | |||
| 739 | 739 | ||
| 740 | struct acpi_dev_match_info { | 740 | struct acpi_dev_match_info { |
| 741 | const char *dev_name; | 741 | const char *dev_name; |
| 742 | struct acpi_device *adev; | ||
| 742 | struct acpi_device_id hid[2]; | 743 | struct acpi_device_id hid[2]; |
| 743 | const char *uid; | 744 | const char *uid; |
| 744 | s64 hrv; | 745 | s64 hrv; |
| @@ -759,6 +760,7 @@ static int acpi_dev_match_cb(struct device *dev, void *data) | |||
| 759 | return 0; | 760 | return 0; |
| 760 | 761 | ||
| 761 | match->dev_name = acpi_dev_name(adev); | 762 | match->dev_name = acpi_dev_name(adev); |
| 763 | match->adev = adev; | ||
| 762 | 764 | ||
| 763 | if (match->hrv == -1) | 765 | if (match->hrv == -1) |
| 764 | return 1; | 766 | return 1; |
| @@ -806,18 +808,20 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) | |||
| 806 | EXPORT_SYMBOL(acpi_dev_present); | 808 | EXPORT_SYMBOL(acpi_dev_present); |
| 807 | 809 | ||
| 808 | /** | 810 | /** |
| 809 | * acpi_dev_get_first_match_name - Return name of first match of ACPI device | 811 | * acpi_dev_get_first_match_dev - Return the first match of ACPI device |
| 810 | * @hid: Hardware ID of the device. | 812 | * @hid: Hardware ID of the device. |
| 811 | * @uid: Unique ID of the device, pass NULL to not check _UID | 813 | * @uid: Unique ID of the device, pass NULL to not check _UID |
| 812 | * @hrv: Hardware Revision of the device, pass -1 to not check _HRV | 814 | * @hrv: Hardware Revision of the device, pass -1 to not check _HRV |
| 813 | * | 815 | * |
| 814 | * Return device name if a matching device was present | 816 | * Return the first match of ACPI device if a matching device was present |
| 815 | * at the moment of invocation, or NULL otherwise. | 817 | * at the moment of invocation, or NULL otherwise. |
| 816 | * | 818 | * |
| 819 | * The caller is responsible to call put_device() on the returned device. | ||
| 820 | * | ||
| 817 | * See additional information in acpi_dev_present() as well. | 821 | * See additional information in acpi_dev_present() as well. |
| 818 | */ | 822 | */ |
| 819 | const char * | 823 | struct acpi_device * |
| 820 | acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) | 824 | acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv) |
| 821 | { | 825 | { |
| 822 | struct acpi_dev_match_info match = {}; | 826 | struct acpi_dev_match_info match = {}; |
| 823 | struct device *dev; | 827 | struct device *dev; |
| @@ -827,9 +831,9 @@ acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) | |||
| 827 | match.hrv = hrv; | 831 | match.hrv = hrv; |
| 828 | 832 | ||
| 829 | dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); | 833 | dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); |
| 830 | return dev ? match.dev_name : NULL; | 834 | return dev ? match.adev : NULL; |
| 831 | } | 835 | } |
| 832 | EXPORT_SYMBOL(acpi_dev_get_first_match_name); | 836 | EXPORT_SYMBOL(acpi_dev_get_first_match_dev); |
| 833 | 837 | ||
| 834 | /* | 838 | /* |
| 835 | * acpi_backlight= handling, this is done here rather then in video_detect.c | 839 | * acpi_backlight= handling, this is done here rather then in video_detect.c |
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index cc2888930fe9..31014c7d3793 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c | |||
| @@ -141,6 +141,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { | |||
| 141 | DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"), | 141 | DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"), |
| 142 | }, | 142 | }, |
| 143 | }, | 143 | }, |
| 144 | { | ||
| 145 | .callback = video_detect_force_vendor, | ||
| 146 | .ident = "Sony VPCEH3U1E", | ||
| 147 | .matches = { | ||
| 148 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
| 149 | DMI_MATCH(DMI_PRODUCT_NAME, "VPCEH3U1E"), | ||
| 150 | }, | ||
| 151 | }, | ||
| 144 | 152 | ||
| 145 | /* | 153 | /* |
| 146 | * These models have a working acpi_video backlight control, and using | 154 | * These models have a working acpi_video backlight control, and using |
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c index a983708b77a6..50f9402fb325 100644 --- a/drivers/extcon/extcon-axp288.c +++ b/drivers/extcon/extcon-axp288.c | |||
| @@ -333,7 +333,7 @@ static int axp288_extcon_probe(struct platform_device *pdev) | |||
| 333 | struct axp288_extcon_info *info; | 333 | struct axp288_extcon_info *info; |
| 334 | struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); | 334 | struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); |
| 335 | struct device *dev = &pdev->dev; | 335 | struct device *dev = &pdev->dev; |
| 336 | const char *name; | 336 | struct acpi_device *adev; |
| 337 | int ret, i, pirq; | 337 | int ret, i, pirq; |
| 338 | 338 | ||
| 339 | info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); | 339 | info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); |
| @@ -357,9 +357,10 @@ static int axp288_extcon_probe(struct platform_device *pdev) | |||
| 357 | if (ret) | 357 | if (ret) |
| 358 | return ret; | 358 | return ret; |
| 359 | 359 | ||
| 360 | name = acpi_dev_get_first_match_name("INT3496", NULL, -1); | 360 | adev = acpi_dev_get_first_match_dev("INT3496", NULL, -1); |
| 361 | if (name) { | 361 | if (adev) { |
| 362 | info->id_extcon = extcon_get_extcon_dev(name); | 362 | info->id_extcon = extcon_get_extcon_dev(acpi_dev_name(adev)); |
| 363 | put_device(&adev->dev); | ||
| 363 | if (!info->id_extcon) | 364 | if (!info->id_extcon) |
| 364 | return -EPROBE_DEFER; | 365 | return -EPROBE_DEFER; |
| 365 | 366 | ||
diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c index 7c659fdaa6d5..3302125e5265 100644 --- a/drivers/gpio/gpio-merrifield.c +++ b/drivers/gpio/gpio-merrifield.c | |||
| @@ -377,10 +377,20 @@ static void mrfld_irq_init_hw(struct mrfld_gpio *priv) | |||
| 377 | } | 377 | } |
| 378 | } | 378 | } |
| 379 | 379 | ||
| 380 | static const char *mrfld_gpio_get_pinctrl_dev_name(void) | 380 | static const char *mrfld_gpio_get_pinctrl_dev_name(struct mrfld_gpio *priv) |
| 381 | { | 381 | { |
| 382 | const char *dev_name = acpi_dev_get_first_match_name("INTC1002", NULL, -1); | 382 | struct acpi_device *adev; |
| 383 | return dev_name ? dev_name : "pinctrl-merrifield"; | 383 | const char *name; |
| 384 | |||
| 385 | adev = acpi_dev_get_first_match_dev("INTC1002", NULL, -1); | ||
| 386 | if (adev) { | ||
| 387 | name = devm_kstrdup(priv->dev, acpi_dev_name(adev), GFP_KERNEL); | ||
| 388 | acpi_dev_put(adev); | ||
| 389 | } else { | ||
| 390 | name = "pinctrl-merrifield"; | ||
| 391 | } | ||
| 392 | |||
| 393 | return name; | ||
| 384 | } | 394 | } |
| 385 | 395 | ||
| 386 | static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 396 | static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
| @@ -441,7 +451,7 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id | |||
| 441 | return retval; | 451 | return retval; |
| 442 | } | 452 | } |
| 443 | 453 | ||
| 444 | pinctrl_dev_name = mrfld_gpio_get_pinctrl_dev_name(); | 454 | pinctrl_dev_name = mrfld_gpio_get_pinctrl_dev_name(priv); |
| 445 | for (i = 0; i < ARRAY_SIZE(mrfld_gpio_ranges); i++) { | 455 | for (i = 0; i < ARRAY_SIZE(mrfld_gpio_ranges); i++) { |
| 446 | range = &mrfld_gpio_ranges[i]; | 456 | range = &mrfld_gpio_ranges[i]; |
| 447 | retval = gpiochip_add_pin_range(&priv->chip, | 457 | retval = gpiochip_add_pin_range(&priv->chip, |
