Skip to content

Commit 2fb7eb3

Browse files
committed
Merge tag 'backlight-next-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight
Pull backlight updates from Lee Jones: - Improve handling of LCD power states and interactions with the fbdev subsystem - Introduce new LCD_POWER_ constants to decouple the LCD subsystem from fbdev - Update several drivers to use the new LCD_POWER_ constants - Clarify the semantics of the lcd_ops.controls_device callback - Remove unnecessary includes and dependencies - Remove unused notifier functionality - Simplify code with scoped for-each loops - Fix module autoloading for the ktz8866 driver - Update device tree bindings to yaml format - Minor cleanups and improvements in various drivers * tag 'backlight-next-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: (33 commits) MAINTAINERS: Use Daniel Thompson's korg address for Backlight work dt-bindings: backlight: Convert zii,rave-sp-backlight.txt to yaml backlight: Remove notifier backlight: ktz8866: Fix module autoloading backlight: 88pm860x_bl: Simplify with scoped for each OF child loop backlight: lcd: Do not include <linux/fb.h> in lcd header backlight: lcd: Remove struct fb_videomode from set_mode callback backlight: lcd: Replace check_fb with controls_device HID: picoLCD: Replace check_fb in favor of struct fb_info.lcd_dev fbdev: omap: Use lcd power constants fbdev: imxfb: Use lcd power constants fbdev: imxfb: Replace check_fb in favor of struct fb_info.lcd_dev fbdev: clps711x-fb: Use lcd power constants fbdev: clps711x-fb: Replace check_fb in favor of struct fb_info.lcd_dev backlight: tdo24m: Use lcd power constants backlight: platform_lcd: Use lcd power constants backlight: platform_lcd: Remove match_fb from struct plat_lcd_data backlight: platform_lcd: Remove include statement for <linux/backlight.h> backlight: otm3225a: Use lcd power constants backlight: ltv350qv: Use lcd power constants ...
2 parents 93251bd + 3adec6f commit 2fb7eb3

28 files changed

+221
-247
lines changed

Documentation/devicetree/bindings/leds/backlight/zii,rave-sp-backlight.txt

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/leds/backlight/zii,rave-sp-backlight.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Zodiac Inflight Innovations RAVE Supervisory Processor Backlight
8+
9+
maintainers:
10+
- Frank Li <[email protected]>
11+
12+
description:
13+
RAVE SP backlight device is a "MFD cell" device corresponding to
14+
backlight functionality of RAVE Supervisory Processor. It is expected
15+
that its Device Tree node is specified as a child of the node
16+
corresponding to the parent RAVE SP device (as documented in
17+
Documentation/devicetree/bindings/mfd/zii,rave-sp.yaml)
18+
19+
properties:
20+
compatible:
21+
const: zii,rave-sp-backlight
22+
23+
required:
24+
- compatible
25+
26+
allOf:
27+
- $ref: common.yaml
28+
29+
unevaluatedProperties: false
30+
31+
examples:
32+
- |
33+
backlight {
34+
compatible = "zii,rave-sp-backlight";
35+
};
36+

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3812,7 +3812,7 @@ F: drivers/net/wireless/broadcom/b43legacy/
38123812

38133813
BACKLIGHT CLASS/SUBSYSTEM
38143814
M: Lee Jones <[email protected]>
3815-
M: Daniel Thompson <daniel.thompson@linaro.org>
3815+
M: Daniel Thompson <danielt@kernel.org>
38163816
M: Jingoo Han <[email protected]>
38173817
38183818
S: Maintained

drivers/hid/hid-picolcd_fb.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,10 @@ int picolcd_init_framebuffer(struct picolcd_data *data)
497497
#endif
498498
#endif
499499

500+
#ifdef CONFIG_HID_PICOLCD_LCD
501+
info->lcd_dev = data->lcd;
502+
#endif
503+
500504
fbdata = info->par;
501505
spin_lock_init(&fbdata->lock);
502506
fbdata->picolcd = data;

drivers/hid/hid-picolcd_lcd.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,9 @@ static int picolcd_set_contrast(struct lcd_device *ldev, int contrast)
4141
return 0;
4242
}
4343

44-
static int picolcd_check_lcd_fb(struct lcd_device *ldev, struct fb_info *fb)
45-
{
46-
return fb && fb == picolcd_fbinfo((struct picolcd_data *)lcd_get_data(ldev));
47-
}
48-
4944
static const struct lcd_ops picolcd_lcdops = {
5045
.get_contrast = picolcd_get_contrast,
5146
.set_contrast = picolcd_set_contrast,
52-
.check_fb = picolcd_check_lcd_fb,
5347
};
5448

5549
int picolcd_init_lcd(struct picolcd_data *data, struct hid_report *report)

drivers/video/backlight/88pm860x_bl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,22 +151,21 @@ static int pm860x_backlight_dt_init(struct platform_device *pdev,
151151
struct pm860x_backlight_data *data,
152152
char *name)
153153
{
154-
struct device_node *nproot, *np;
154+
struct device_node *nproot;
155155
int iset = 0;
156156

157157
nproot = of_get_child_by_name(pdev->dev.parent->of_node, "backlights");
158158
if (!nproot) {
159159
dev_err(&pdev->dev, "failed to find backlights node\n");
160160
return -ENODEV;
161161
}
162-
for_each_child_of_node(nproot, np) {
162+
for_each_child_of_node_scoped(nproot, np) {
163163
if (of_node_name_eq(np, name)) {
164164
of_property_read_u32(np, "marvell,88pm860x-iset",
165165
&iset);
166166
data->iset = PM8606_WLED_CURRENT(iset);
167167
of_property_read_u32(np, "marvell,88pm860x-pwm",
168168
&data->pwm);
169-
of_node_put(np);
170169
break;
171170
}
172171
}

drivers/video/backlight/backlight.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565

6666
static struct list_head backlight_dev_list;
6767
static struct mutex backlight_dev_list_mutex;
68-
static struct blocking_notifier_head backlight_notifier;
6968

7069
static const char *const backlight_types[] = {
7170
[BACKLIGHT_RAW] = "raw",
@@ -467,9 +466,6 @@ struct backlight_device *backlight_device_register(const char *name,
467466
list_add(&new_bd->entry, &backlight_dev_list);
468467
mutex_unlock(&backlight_dev_list_mutex);
469468

470-
blocking_notifier_call_chain(&backlight_notifier,
471-
BACKLIGHT_REGISTERED, new_bd);
472-
473469
return new_bd;
474470
}
475471
EXPORT_SYMBOL(backlight_device_register);
@@ -539,9 +535,6 @@ void backlight_device_unregister(struct backlight_device *bd)
539535
mutex_unlock(&pmac_backlight_mutex);
540536
#endif
541537

542-
blocking_notifier_call_chain(&backlight_notifier,
543-
BACKLIGHT_UNREGISTERED, bd);
544-
545538
mutex_lock(&bd->ops_lock);
546539
bd->ops = NULL;
547540
mutex_unlock(&bd->ops_lock);
@@ -566,40 +559,6 @@ static int devm_backlight_device_match(struct device *dev, void *res,
566559
return *r == data;
567560
}
568561

569-
/**
570-
* backlight_register_notifier - get notified of backlight (un)registration
571-
* @nb: notifier block with the notifier to call on backlight (un)registration
572-
*
573-
* Register a notifier to get notified when backlight devices get registered
574-
* or unregistered.
575-
*
576-
* RETURNS:
577-
*
578-
* 0 on success, otherwise a negative error code
579-
*/
580-
int backlight_register_notifier(struct notifier_block *nb)
581-
{
582-
return blocking_notifier_chain_register(&backlight_notifier, nb);
583-
}
584-
EXPORT_SYMBOL(backlight_register_notifier);
585-
586-
/**
587-
* backlight_unregister_notifier - unregister a backlight notifier
588-
* @nb: notifier block to unregister
589-
*
590-
* Register a notifier to get notified when backlight devices get registered
591-
* or unregistered.
592-
*
593-
* RETURNS:
594-
*
595-
* 0 on success, otherwise a negative error code
596-
*/
597-
int backlight_unregister_notifier(struct notifier_block *nb)
598-
{
599-
return blocking_notifier_chain_unregister(&backlight_notifier, nb);
600-
}
601-
EXPORT_SYMBOL(backlight_unregister_notifier);
602-
603562
/**
604563
* devm_backlight_device_register - register a new backlight device
605564
* @dev: the device to register
@@ -767,7 +726,6 @@ static int __init backlight_class_init(void)
767726

768727
INIT_LIST_HEAD(&backlight_dev_list);
769728
mutex_init(&backlight_dev_list_mutex);
770-
BLOCKING_INIT_NOTIFIER_HEAD(&backlight_notifier);
771729

772730
return 0;
773731
}

drivers/video/backlight/corgi_lcd.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
#include <linux/init.h>
1818
#include <linux/delay.h>
1919
#include <linux/gpio/consumer.h>
20-
#include <linux/fb.h>
2120
#include <linux/lcd.h>
2221
#include <linux/spi/spi.h>
2322
#include <linux/spi/corgi_lcd.h>
2423
#include <linux/slab.h>
2524
#include <asm/mach/sharpsl_param.h>
2625

27-
#define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL)
26+
#define POWER_IS_ON(pwr) ((pwr) <= LCD_POWER_REDUCED)
2827

2928
/* Register Addresses */
3029
#define RESCTL_ADRS 0x00
@@ -332,12 +331,12 @@ static void corgi_lcd_power_off(struct corgi_lcd *lcd)
332331
POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_OFF);
333332
}
334333

335-
static int corgi_lcd_set_mode(struct lcd_device *ld, struct fb_videomode *m)
334+
static int corgi_lcd_set_mode(struct lcd_device *ld, u32 xres, u32 yres)
336335
{
337336
struct corgi_lcd *lcd = lcd_get_data(ld);
338337
int mode = CORGI_LCD_MODE_QVGA;
339338

340-
if (m->xres == 640 || m->xres == 480)
339+
if (xres == 640 || xres == 480)
341340
mode = CORGI_LCD_MODE_VGA;
342341

343342
if (lcd->mode == mode)
@@ -455,7 +454,7 @@ static int corgi_lcd_suspend(struct device *dev)
455454

456455
corgibl_flags |= CORGIBL_SUSPENDED;
457456
corgi_bl_set_intensity(lcd, 0);
458-
corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_POWERDOWN);
457+
corgi_lcd_set_power(lcd->lcd_dev, LCD_POWER_OFF);
459458
return 0;
460459
}
461460

@@ -464,7 +463,7 @@ static int corgi_lcd_resume(struct device *dev)
464463
struct corgi_lcd *lcd = dev_get_drvdata(dev);
465464

466465
corgibl_flags &= ~CORGIBL_SUSPENDED;
467-
corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_UNBLANK);
466+
corgi_lcd_set_power(lcd->lcd_dev, LCD_POWER_ON);
468467
backlight_update_status(lcd->bl_dev);
469468
return 0;
470469
}
@@ -513,7 +512,7 @@ static int corgi_lcd_probe(struct spi_device *spi)
513512
if (IS_ERR(lcd->lcd_dev))
514513
return PTR_ERR(lcd->lcd_dev);
515514

516-
lcd->power = FB_BLANK_POWERDOWN;
515+
lcd->power = LCD_POWER_OFF;
517516
lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA;
518517

519518
memset(&props, 0, sizeof(struct backlight_properties));
@@ -535,7 +534,7 @@ static int corgi_lcd_probe(struct spi_device *spi)
535534
lcd->kick_battery = pdata->kick_battery;
536535

537536
spi_set_drvdata(spi, lcd);
538-
corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_UNBLANK);
537+
corgi_lcd_set_power(lcd->lcd_dev, LCD_POWER_ON);
539538
backlight_update_status(lcd->bl_dev);
540539

541540
lcd->limit_mask = pdata->limit_mask;
@@ -550,7 +549,7 @@ static void corgi_lcd_remove(struct spi_device *spi)
550549
lcd->bl_dev->props.power = BACKLIGHT_POWER_ON;
551550
lcd->bl_dev->props.brightness = 0;
552551
backlight_update_status(lcd->bl_dev);
553-
corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_POWERDOWN);
552+
corgi_lcd_set_power(lcd->lcd_dev, LCD_POWER_OFF);
554553
}
555554

556555
static struct spi_driver corgi_lcd_driver = {

drivers/video/backlight/hx8357.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ static int hx8369_lcd_init(struct lcd_device *lcdev)
532532
return 0;
533533
}
534534

535-
#define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL)
535+
#define POWER_IS_ON(pwr) ((pwr) <= LCD_POWER_REDUCED)
536536

537537
static int hx8357_set_power(struct lcd_device *lcdev, int power)
538538
{

drivers/video/backlight/ili922x.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
* memory is cyclically updated over the RGB interface.
99
*/
1010

11-
#include <linux/fb.h>
1211
#include <linux/delay.h>
1312
#include <linux/errno.h>
1413
#include <linux/init.h>
@@ -119,7 +118,7 @@
119118

120119
#define CMD_BUFSIZE 16
121120

122-
#define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL)
121+
#define POWER_IS_ON(pwr) ((pwr) <= LCD_POWER_REDUCED)
123122

124123
#define set_tx_byte(b) (tx_invert ? ~(b) : b)
125124

@@ -513,7 +512,7 @@ static int ili922x_probe(struct spi_device *spi)
513512

514513
ili922x_display_init(spi);
515514

516-
ili->power = FB_BLANK_POWERDOWN;
515+
ili->power = LCD_POWER_OFF;
517516

518517
lcd = devm_lcd_device_register(&spi->dev, "ili922xlcd", &spi->dev, ili,
519518
&ili922x_ops);
@@ -525,7 +524,7 @@ static int ili922x_probe(struct spi_device *spi)
525524
ili->ld = lcd;
526525
spi_set_drvdata(spi, ili);
527526

528-
ili922x_lcd_power(ili, FB_BLANK_UNBLANK);
527+
ili922x_lcd_power(ili, LCD_POWER_ON);
529528

530529
return 0;
531530
}

drivers/video/backlight/ili9320.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#include <linux/delay.h>
1212
#include <linux/err.h>
13-
#include <linux/fb.h>
1413
#include <linux/init.h>
1514
#include <linux/lcd.h>
1615
#include <linux/module.h>
@@ -121,7 +120,7 @@ static inline int ili9320_power_off(struct ili9320 *lcd)
121120
return 0;
122121
}
123122

124-
#define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL)
123+
#define POWER_IS_ON(pwr) ((pwr) <= LCD_POWER_REDUCED)
125124

126125
static int ili9320_power(struct ili9320 *lcd, int power)
127126
{
@@ -223,7 +222,7 @@ int ili9320_probe_spi(struct spi_device *spi,
223222

224223
ili->dev = dev;
225224
ili->client = client;
226-
ili->power = FB_BLANK_POWERDOWN;
225+
ili->power = LCD_POWER_OFF;
227226
ili->platdata = cfg;
228227

229228
spi_set_drvdata(spi, ili);
@@ -241,7 +240,7 @@ int ili9320_probe_spi(struct spi_device *spi,
241240

242241
dev_info(dev, "initialising %s\n", client->name);
243242

244-
ret = ili9320_power(ili, FB_BLANK_UNBLANK);
243+
ret = ili9320_power(ili, LCD_POWER_ON);
245244
if (ret != 0) {
246245
dev_err(dev, "failed to set lcd power state\n");
247246
return ret;
@@ -253,7 +252,7 @@ EXPORT_SYMBOL_GPL(ili9320_probe_spi);
253252

254253
void ili9320_remove(struct ili9320 *ili)
255254
{
256-
ili9320_power(ili, FB_BLANK_POWERDOWN);
255+
ili9320_power(ili, LCD_POWER_OFF);
257256
}
258257
EXPORT_SYMBOL_GPL(ili9320_remove);
259258

@@ -262,7 +261,7 @@ int ili9320_suspend(struct ili9320 *lcd)
262261
{
263262
int ret;
264263

265-
ret = ili9320_power(lcd, FB_BLANK_POWERDOWN);
264+
ret = ili9320_power(lcd, LCD_POWER_OFF);
266265

267266
if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP) {
268267
ili9320_write(lcd, ILI9320_POWER1, lcd->power1 |
@@ -282,15 +281,15 @@ int ili9320_resume(struct ili9320 *lcd)
282281
if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP)
283282
ili9320_write(lcd, ILI9320_POWER1, 0x00);
284283

285-
return ili9320_power(lcd, FB_BLANK_UNBLANK);
284+
return ili9320_power(lcd, LCD_POWER_ON);
286285
}
287286
EXPORT_SYMBOL_GPL(ili9320_resume);
288287
#endif
289288

290289
/* Power down all displays on reboot, poweroff or halt */
291290
void ili9320_shutdown(struct ili9320 *lcd)
292291
{
293-
ili9320_power(lcd, FB_BLANK_POWERDOWN);
292+
ili9320_power(lcd, LCD_POWER_OFF);
294293
}
295294
EXPORT_SYMBOL_GPL(ili9320_shutdown);
296295

0 commit comments

Comments
 (0)