summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-10-01 12:46:26 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-10-01 12:46:26 -0700
commitd3479214c05dbd07bc56f8823e7bd8719fcd39a9 (patch)
tree360e7f51d62161a5109e5e45e14de3a85e1dc839
parentb386ef6286ace3b7546e641c2243f8d3d4dd3f28 (diff)
parentba3b29a639fe5173033914db6ee58d8d9bb86aba (diff)
Merge tag 'backlight-next-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight
Pull backlight updates from Lee Jones: "This set is comprised of a couple of small but important fixes and a number of clean-up and refactoring patches. The fixes correct an EPROM address for the LP8556 and improve memory allocation safety in the LED backlight driver. The remainder of the set is made up of refactoring work to the mp3309c driver and a series of patches to make a number of drivers more self-contained by including their own dependencies. Improvements & Fixes: - Correct the EPROM start address for the LP8556 to align with the device's datasheet. - Use devm_kcalloc() in the LED backlight driver for safer array allocation with overflow protection. Cleanups & Refactoring - Drop an unnecessary call to pwm_apply_args() in the mp3309c driver. - Modernize struct initialization in the mp3309c driver by using a compound literal instead of memset. - Make numerous drivers self-contained by including necessary headers directly rather than relying on transitive includes from the core backlight header" * tag 'backlight-next-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: rt4831: Include <linux/mod_devicetable.h> backlight: rave-sp: Include <linux/of.h> and <linux/mod_devicetable.h> backlight: led_bl: Include <linux/of.h> backlight: ktd2801: Include <linux/mod_devicetable.h> backlight: jornada720: Include <linux/io.h> backlight: da9052_bl: Include <linux/mod_devicetable.h> backlight: as3711_bl: Include <linux/of.h> backlight: apple_dwi_bl: Include <linux/mod_devicetable.h> backlight: Include <linux/of.h> video: backlight: lp855x_bl: Set correct EPROM start for LP8556 backlight: led_bl: Use devm_kcalloc() for array space allocation backlight: mp3309c: Initialize backlight properties without memset backlight: mp3309c: Drop pwm_apply_args()
-rw-r--r--drivers/video/backlight/apple_dwi_bl.c1
-rw-r--r--drivers/video/backlight/as3711_bl.c1
-rw-r--r--drivers/video/backlight/backlight.c1
-rw-r--r--drivers/video/backlight/da9052_bl.c1
-rw-r--r--drivers/video/backlight/jornada720_bl.c1
-rw-r--r--drivers/video/backlight/ktd2801-backlight.c1
-rw-r--r--drivers/video/backlight/led_bl.c5
-rw-r--r--drivers/video/backlight/lp855x_bl.c2
-rw-r--r--drivers/video/backlight/mp3309c.c14
-rw-r--r--drivers/video/backlight/rave-sp-backlight.c2
-rw-r--r--drivers/video/backlight/rt4831-backlight.c1
11 files changed, 20 insertions, 10 deletions
diff --git a/drivers/video/backlight/apple_dwi_bl.c b/drivers/video/backlight/apple_dwi_bl.c
index 93bd744972d6..ed8bf13d3f51 100644
--- a/drivers/video/backlight/apple_dwi_bl.c
+++ b/drivers/video/backlight/apple_dwi_bl.c
@@ -9,6 +9,7 @@
#include <linux/bitfield.h>
#include <linux/device.h>
#include <linux/io.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
diff --git a/drivers/video/backlight/as3711_bl.c b/drivers/video/backlight/as3711_bl.c
index 9f89eb19894e..753160bbc3e7 100644
--- a/drivers/video/backlight/as3711_bl.c
+++ b/drivers/video/backlight/as3711_bl.c
@@ -13,6 +13,7 @@
#include <linux/kernel.h>
#include <linux/mfd/as3711.h>
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/slab.h>
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index 9dc93c5e480b..1e9b7e85d99a 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -16,6 +16,7 @@
#include <linux/ctype.h>
#include <linux/err.h>
#include <linux/slab.h>
+#include <linux/of.h>
#ifdef CONFIG_PMAC_BACKLIGHT
#include <asm/backlight.h>
diff --git a/drivers/video/backlight/da9052_bl.c b/drivers/video/backlight/da9052_bl.c
index f41523d78121..2493138febfa 100644
--- a/drivers/video/backlight/da9052_bl.c
+++ b/drivers/video/backlight/da9052_bl.c
@@ -9,6 +9,7 @@
#include <linux/backlight.h>
#include <linux/delay.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
diff --git a/drivers/video/backlight/jornada720_bl.c b/drivers/video/backlight/jornada720_bl.c
index e28d2c071798..bbb65fdaddc7 100644
--- a/drivers/video/backlight/jornada720_bl.c
+++ b/drivers/video/backlight/jornada720_bl.c
@@ -7,6 +7,7 @@
#include <linux/backlight.h>
#include <linux/device.h>
+#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
diff --git a/drivers/video/backlight/ktd2801-backlight.c b/drivers/video/backlight/ktd2801-backlight.c
index 0489b0615ceb..17eac1b3bce4 100644
--- a/drivers/video/backlight/ktd2801-backlight.c
+++ b/drivers/video/backlight/ktd2801-backlight.c
@@ -6,6 +6,7 @@
#include <linux/backlight.h>
#include <linux/gpio/consumer.h>
#include <linux/leds-expresswire.h>
+#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/property.h>
diff --git a/drivers/video/backlight/led_bl.c b/drivers/video/backlight/led_bl.c
index d2db157b2c29..efc5e380669a 100644
--- a/drivers/video/backlight/led_bl.c
+++ b/drivers/video/backlight/led_bl.c
@@ -9,6 +9,7 @@
#include <linux/backlight.h>
#include <linux/leds.h>
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/platform_device.h>
struct led_bl_data {
@@ -89,7 +90,7 @@ static int led_bl_get_leds(struct device *dev,
return -EINVAL;
}
- leds = devm_kzalloc(dev, sizeof(struct led_classdev *) * nb_leds,
+ leds = devm_kcalloc(dev, nb_leds, sizeof(struct led_classdev *),
GFP_KERNEL);
if (!leds)
return -ENOMEM;
@@ -137,7 +138,7 @@ static int led_bl_parse_levels(struct device *dev,
unsigned int db;
u32 *levels = NULL;
- levels = devm_kzalloc(dev, sizeof(u32) * num_levels,
+ levels = devm_kcalloc(dev, num_levels, sizeof(u32),
GFP_KERNEL);
if (!levels)
return -ENOMEM;
diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
index 7075bfab59c4..d191560ce285 100644
--- a/drivers/video/backlight/lp855x_bl.c
+++ b/drivers/video/backlight/lp855x_bl.c
@@ -22,7 +22,7 @@
#define LP855X_DEVICE_CTRL 0x01
#define LP855X_EEPROM_START 0xA0
#define LP855X_EEPROM_END 0xA7
-#define LP8556_EPROM_START 0xA0
+#define LP8556_EPROM_START 0x98
#define LP8556_EPROM_END 0xAF
/* LP8555/7 Registers */
diff --git a/drivers/video/backlight/mp3309c.c b/drivers/video/backlight/mp3309c.c
index 372058e26129..9337110ce6e5 100644
--- a/drivers/video/backlight/mp3309c.c
+++ b/drivers/video/backlight/mp3309c.c
@@ -222,7 +222,6 @@ static int mp3309c_parse_fwnode(struct mp3309c_chip *chip,
if (IS_ERR(chip->pwmd))
return dev_err_probe(dev, PTR_ERR(chip->pwmd), "error getting pwm data\n");
pdata->dimming_mode = DIMMING_PWM;
- pwm_apply_args(chip->pwmd);
}
/*
@@ -353,12 +352,13 @@ static int mp3309c_probe(struct i2c_client *client)
chip->pdata = pdata;
/* Backlight properties */
- memset(&props, 0, sizeof(struct backlight_properties));
- props.brightness = pdata->default_brightness;
- props.max_brightness = pdata->max_brightness;
- props.scale = BACKLIGHT_SCALE_LINEAR;
- props.type = BACKLIGHT_RAW;
- props.power = BACKLIGHT_POWER_ON;
+ props = (typeof(props)){
+ .brightness = pdata->default_brightness,
+ .max_brightness = pdata->max_brightness,
+ .scale = BACKLIGHT_SCALE_LINEAR,
+ .type = BACKLIGHT_RAW,
+ .power = BACKLIGHT_POWER_ON,
+ };
chip->bl = devm_backlight_device_register(dev, "mp3309c", dev, chip,
&mp3309c_bl_ops, &props);
if (IS_ERR(chip->bl))
diff --git a/drivers/video/backlight/rave-sp-backlight.c b/drivers/video/backlight/rave-sp-backlight.c
index e708a060a6e4..bfe01b9b9174 100644
--- a/drivers/video/backlight/rave-sp-backlight.c
+++ b/drivers/video/backlight/rave-sp-backlight.c
@@ -9,8 +9,10 @@
#include <linux/backlight.h>
#include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/mfd/rave-sp.h>
+#include <linux/of.h>
#include <linux/platform_device.h>
#define RAVE_SP_BACKLIGHT_LCD_EN BIT(7)
diff --git a/drivers/video/backlight/rt4831-backlight.c b/drivers/video/backlight/rt4831-backlight.c
index 7ead75929a43..26214519bfce 100644
--- a/drivers/video/backlight/rt4831-backlight.c
+++ b/drivers/video/backlight/rt4831-backlight.c
@@ -4,6 +4,7 @@
#include <linux/backlight.h>
#include <linux/bitops.h>
#include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/property.h>