Backlight for v7.1

* Skyworks SKY81452:
     * Check the return value of `devm_gpiod_get_optional()` in `sky81452_bl_parse_dt()` to properly
       handle GPIO acquisition errors
 
   * Apple Backlight:
     * Convert the Apple Backlight ACPI driver to a proper platform driver, aligning with current ACPI
       binding practices
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmnl4KAACgkQUa+KL4f8
 d2ERrA/+LQ+DSgUGb93Sl6o68yPc1lx1bsUHSYmyfZssTXHR08YSq3dMBgi6nT99
 GJDEENhC5Df8WTf4GkX7rSiWTyJN4EoSKPs8Kp93bpqYHEXMFUo3e7qOatJAT1tM
 IHOCtrO/X2Hvq6mH6RhxPpOnDJD6OzThtsN0xcxIiK3nCfcvZeZlLlGytjv2XGGG
 Fs2lv0P5J0VhcrKv15cObuZLkOB7hzYQy4Bp47wqvpKK3NV/I2typN6n+ALciCcu
 RtxAoxI2fXV4FrkPabogCYUbhPwtAlfAgbf2TNCPkRatbxA5rSwLzCjvz7dDWnU2
 YHeObxHV46woolmL3Z3O9KpzzGB6UzaNRgIhb8PCTT+QsfvQQTcoU0rklYfy32sH
 Y7nl5uMxa9O52JOFZEKG82wy4yHlUqqwi1SJ/og6yDNI0FLs0tNYS07N/5nKZGfz
 nZEN6hqzgSPdX44fL0mXhiDT8bF76fgz8HdHs3SK+o1CyC6nbMfQ6ytvbkiH3am7
 NBJnGYg6l3EJOO8wyDeNQQpf7mB1l0h/o+pJPJpQyZMAw0WGOEMSMT7EmF5SFgt0
 /Uu7fWBqFG6Jv6cpzrD2M5EmqUCaCQyDkahnF0nZg3CaIQyW0pgStBUmAcpeVJx6
 28rqSj7Krrkut6CJOXsfTTLGvsNmUC/UdFMs8xrOfcTU7POvwgo=
 =Cbwz
 -----END PGP SIGNATURE-----

Merge tag 'backlight-next-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight

Pull backlight updates from Lee Jones:
 "Apple Backlight:
   - Convert the Apple Backlight ACPI driver to a proper platform
     driver, aligning with current ACPI binding practices

  Skyworks SKY81452:
   - Check the return value of `devm_gpiod_get_optional()`
     to properly handle GPIO acquisition errors"

* tag 'backlight-next-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
  backlight: apple_bl: Convert to a platform driver
  backlight: sky81452-backlight: Check return value of devm_gpiod_get_optional() in sky81452_bl_parse_dt()
This commit is contained in:
Linus Torvalds 2026-04-20 11:49:38 -07:00
commit b69e478512
2 changed files with 14 additions and 10 deletions

View File

@ -24,6 +24,7 @@
#include <linux/pci.h>
#include <linux/acpi.h>
#include <linux/atomic.h>
#include <linux/platform_device.h>
#include <acpi/video.h>
static struct backlight_device *apple_backlight_device;
@ -134,7 +135,7 @@ static const struct hw_data nvidia_chipset_data = {
.set_brightness = nvidia_chipset_set_brightness,
};
static int apple_bl_add(struct acpi_device *dev)
static int apple_bl_probe(struct platform_device *pdev)
{
struct backlight_properties props;
struct pci_dev *host;
@ -193,7 +194,7 @@ static int apple_bl_add(struct acpi_device *dev)
return 0;
}
static void apple_bl_remove(struct acpi_device *dev)
static void apple_bl_remove(struct platform_device *pdev)
{
backlight_device_unregister(apple_backlight_device);
@ -206,12 +207,12 @@ static const struct acpi_device_id apple_bl_ids[] = {
{"", 0},
};
static struct acpi_driver apple_bl_driver = {
.name = "Apple backlight",
.ids = apple_bl_ids,
.ops = {
.add = apple_bl_add,
.remove = apple_bl_remove,
static struct platform_driver apple_bl_driver = {
.probe = apple_bl_probe,
.remove = apple_bl_remove,
.driver = {
.name = "Apple backlight",
.acpi_match_table = apple_bl_ids,
},
};
@ -224,12 +225,12 @@ static int __init apple_bl_init(void)
if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
return -ENODEV;
return acpi_bus_register_driver(&apple_bl_driver);
return platform_driver_register(&apple_bl_driver);
}
static void __exit apple_bl_exit(void)
{
acpi_bus_unregister_driver(&apple_bl_driver);
platform_driver_unregister(&apple_bl_driver);
}
module_init(apple_bl_init);

View File

@ -202,6 +202,9 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
pdata->dpwm_mode = of_property_read_bool(np, "skyworks,dpwm-mode");
pdata->phase_shift = of_property_read_bool(np, "skyworks,phase-shift");
pdata->gpiod_enable = devm_gpiod_get_optional(dev, NULL, GPIOD_OUT_HIGH);
if (IS_ERR(pdata->gpiod_enable))
return dev_err_cast_probe(dev, pdata->gpiod_enable,
"failed to get gpio\n");
ret = of_property_count_u32_elems(np, "led-sources");
if (ret < 0) {