Skip to content

Commit 025cf4d

Browse files
committed
Merge tag 'backlight-next-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight
Pull backlight updates from Lee Jones: "New Drivers: - Add support for Kinetic KTZ8866 Backlight Removed Drivers: - Toshiba Sharp SL-6000 LCD and Backlight Fix-ups: - Provide some profiling optimisations with respect to pwm_get_state() and pwm_apply_state() - Make use of the dev_err_probe() API - Provide some Device Tree documentation additions / adaptions - Drop fall-back legacy PWM probing support - Convert over to new I2C probing API - Fix incorrect documentation - Make use of backlight_get_brightness() API Bug Fixes: - Fix disabling backlight on i.MX6 when inverted PWMs are used" * tag 'backlight-next-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: ktz8866: Convert to i2c's .probe_new() backlight: ktz8866: Add support for Kinetic KTZ8866 backlight dt-bindings: leds: backlight: Add Kinetic KTZ8866 backlight backlight: pwm_bl: Don't rely on a disabled PWM emiting inactive state backlight: pwm_bl: Configure pwm only once per backlight toggle backlight: Remove pxa tosa support backlight: aat2870: Use backlight helper backlight: ipaq_micro: Use backlight helper backlight: arcxcnn: Use backlight helper backlight: sky81452: Fix sky81452_bl_platform_data kernel-doc backlight: pwm_bl: Drop support for legacy PWM probing dt-bindings: backlight: qcom-wled: Add PMI8950 compatible backlight: ktd253: Switch to use dev_err_probe() helper backlight: backlight: Fix doc for backlight_device_get_by_name
2 parents c2c23dc + ad614f8 commit 025cf4d

File tree

17 files changed

+339
-542
lines changed

17 files changed

+339
-542
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/leds/backlight/kinetic,ktz8866.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Kinetic Technologies KTZ8866 backlight
8+
9+
maintainers:
10+
- Jianhua Lu <[email protected]>
11+
12+
description: |
13+
The Kinetic Technologies KTZ8866 is a high efficiency 6-channels-current-sinks
14+
led backlight with dual lcd bias power.
15+
https://www.kinet-ic.com/ktz8866/
16+
17+
allOf:
18+
- $ref: common.yaml#
19+
20+
properties:
21+
compatible:
22+
const: kinetic,ktz8866
23+
24+
vddpos-supply:
25+
description: positive boost supply regulator.
26+
27+
vddneg-supply:
28+
description: negative boost supply regulator.
29+
30+
enable-gpios:
31+
description: GPIO to use to enable/disable the backlight (HWEN pin).
32+
maxItems: 1
33+
34+
current-num-sinks:
35+
description: number of the LED current sinks' channels.
36+
enum: [1, 2, 3, 4, 5, 6]
37+
38+
kinetic,current-ramp-delay-ms:
39+
description: |
40+
LED current ramping delay time in milliseconds, note that the
41+
case 1 will be mapped to 1μs.
42+
enum: [1, 2, 4, 8, 16, 32, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640]
43+
44+
kinetic,led-enable-ramp-delay-ms:
45+
description: |
46+
LED on/off ramping delay time in milliseconds, note that the case 0 will be
47+
mapped to 512μs because ktz8866 can't ramp faster than it.
48+
enum: [0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384]
49+
50+
kinetic,enable-lcd-bias:
51+
description: Set if we want to output bias power supply for LCD.
52+
type: boolean
53+
54+
required:
55+
- compatible
56+
- vddpos-supply
57+
- vddneg-supply
58+
- enable-gpios
59+
60+
unevaluatedProperties: false
61+
62+
examples:
63+
- |
64+
#include <dt-bindings/gpio/gpio.h>
65+
66+
backlight {
67+
compatible = "kinetic,ktz8866";
68+
69+
vddpos-supply = <&bl_vddpos_5p5>;
70+
vddneg-supply = <&bl_vddneg_5p5>;
71+
enable-gpios = <&tlmm 139 GPIO_ACTIVE_HIGH>;
72+
current-num-sinks = <5>;
73+
kinetic,current-ramp-delay-ms = <128>;
74+
kinetic,led-enable-ramp-delay-ms = <1>;
75+
kinetic,enable-lcd-bias;
76+
};

Documentation/devicetree/bindings/leds/backlight/qcom-wled.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ properties:
1919
compatible:
2020
enum:
2121
- qcom,pm8941-wled
22+
- qcom,pmi8950-wled
2223
- qcom,pmi8994-wled
2324
- qcom,pmi8998-wled
2425
- qcom,pm660l-wled

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11572,6 +11572,12 @@ M: John Hawley <[email protected]>
1157211572
S: Maintained
1157311573
F: tools/testing/ktest
1157411574

11575+
KTZ8866 BACKLIGHT DRIVER
11576+
M: Jianhua Lu <[email protected]>
11577+
S: Maintained
11578+
F: Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml
11579+
F: drivers/video/backlight/ktz8866.c
11580+
1157511581
L3MDEV
1157611582
M: David Ahern <[email protected]>
1157711583

drivers/video/backlight/Kconfig

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,6 @@ config LCD_PLATFORM
9090
This driver provides a platform-device registered LCD power
9191
control interface.
9292

93-
config LCD_TOSA
94-
tristate "Sharp SL-6000 LCD Driver"
95-
depends on I2C && SPI && MACH_TOSA
96-
help
97-
If you have an Sharp SL-6000 Zaurus say Y to enable a driver
98-
for its LCD.
99-
10093
config LCD_HP700
10194
tristate "HP Jornada 700 series LCD Driver"
10295
depends on SA1100_JORNADA720_SSP && !PREEMPTION
@@ -190,6 +183,14 @@ config BACKLIGHT_KTD253
190183
which is a 1-wire GPIO-controlled backlight found in some mobile
191184
phones.
192185

186+
config BACKLIGHT_KTZ8866
187+
tristate "Backlight Driver for Kinetic KTZ8866"
188+
depends on I2C
189+
select REGMAP_I2C
190+
help
191+
Say Y to enable the backlight driver for the Kinetic KTZ8866
192+
found in Xiaomi Mi Pad 5 series.
193+
193194
config BACKLIGHT_LM3533
194195
tristate "Backlight Driver for LM3533"
195196
depends on MFD_LM3533
@@ -288,13 +289,6 @@ config BACKLIGHT_APPLE
288289
If you have an Intel-based Apple say Y to enable a driver for its
289290
backlight.
290291

291-
config BACKLIGHT_TOSA
292-
tristate "Sharp SL-6000 Backlight Driver"
293-
depends on I2C && MACH_TOSA && LCD_TOSA
294-
help
295-
If you have an Sharp SL-6000 Zaurus say Y to enable a driver
296-
for its backlight
297-
298292
config BACKLIGHT_QCOM_WLED
299293
tristate "Qualcomm PMIC WLED Driver"
300294
select REGMAP

drivers/video/backlight/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ obj-$(CONFIG_LCD_LTV350QV) += ltv350qv.o
1515
obj-$(CONFIG_LCD_OTM3225A) += otm3225a.o
1616
obj-$(CONFIG_LCD_PLATFORM) += platform_lcd.o
1717
obj-$(CONFIG_LCD_TDO24M) += tdo24m.o
18-
obj-$(CONFIG_LCD_TOSA) += tosa_lcd.o
1918
obj-$(CONFIG_LCD_VGG2432A4) += vgg2432a4.o
2019

2120
obj-$(CONFIG_BACKLIGHT_88PM860X) += 88pm860x_bl.o
@@ -36,6 +35,7 @@ obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o
3635
obj-$(CONFIG_BACKLIGHT_HP700) += jornada720_bl.o
3736
obj-$(CONFIG_BACKLIGHT_IPAQ_MICRO) += ipaq_micro_bl.o
3837
obj-$(CONFIG_BACKLIGHT_KTD253) += ktd253-backlight.o
38+
obj-$(CONFIG_BACKLIGHT_KTZ8866) += ktz8866.o
3939
obj-$(CONFIG_BACKLIGHT_LM3533) += lm3533_bl.o
4040
obj-$(CONFIG_BACKLIGHT_LM3630A) += lm3630a_bl.o
4141
obj-$(CONFIG_BACKLIGHT_LM3639) += lm3639_bl.o
@@ -53,7 +53,6 @@ obj-$(CONFIG_BACKLIGHT_QCOM_WLED) += qcom-wled.o
5353
obj-$(CONFIG_BACKLIGHT_RT4831) += rt4831-backlight.o
5454
obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o
5555
obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o
56-
obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o
5756
obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o
5857
obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o
5958
obj-$(CONFIG_BACKLIGHT_ARCXCNN) += arcxcnn_bl.o

drivers/video/backlight/aat2870_bl.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static int aat2870_bl_update_status(struct backlight_device *bd)
5959
struct aat2870_bl_driver_data *aat2870_bl = bl_get_data(bd);
6060
struct aat2870_data *aat2870 =
6161
dev_get_drvdata(aat2870_bl->pdev->dev.parent);
62-
int brightness = bd->props.brightness;
62+
int brightness = backlight_get_brightness(bd);
6363
int ret;
6464

6565
if ((brightness < 0) || (bd->props.max_brightness < brightness)) {
@@ -70,11 +70,6 @@ static int aat2870_bl_update_status(struct backlight_device *bd)
7070
dev_dbg(&bd->dev, "brightness=%d, power=%d, state=%d\n",
7171
bd->props.brightness, bd->props.power, bd->props.state);
7272

73-
if ((bd->props.power != FB_BLANK_UNBLANK) ||
74-
(bd->props.state & BL_CORE_FBBLANK) ||
75-
(bd->props.state & BL_CORE_SUSPENDED))
76-
brightness = 0;
77-
7873
ret = aat2870->write(aat2870, AAT2870_BLM,
7974
(u8)aat2870_brightness(aat2870_bl, brightness));
8075
if (ret < 0)

drivers/video/backlight/arcxcnn_bl.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,9 @@ static int arcxcnn_set_brightness(struct arcxcnn *lp, u32 brightness)
130130
static int arcxcnn_bl_update_status(struct backlight_device *bl)
131131
{
132132
struct arcxcnn *lp = bl_get_data(bl);
133-
u32 brightness = bl->props.brightness;
133+
u32 brightness = backlight_get_brightness(bl);
134134
int ret;
135135

136-
if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
137-
brightness = 0;
138-
139136
ret = arcxcnn_set_brightness(lp, brightness);
140137
if (ret)
141138
return ret;

drivers/video/backlight/backlight.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ EXPORT_SYMBOL(backlight_device_get_by_type);
501501
*
502502
* This function looks up a backlight device by its name. It obtains a reference
503503
* on the backlight device and it is the caller's responsibility to drop the
504-
* reference by calling backlight_put().
504+
* reference by calling put_device().
505505
*
506506
* Returns:
507507
* A pointer to the backlight device if found, otherwise NULL.

drivers/video/backlight/ipaq_micro_bl.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,12 @@
1616
static int micro_bl_update_status(struct backlight_device *bd)
1717
{
1818
struct ipaq_micro *micro = dev_get_drvdata(&bd->dev);
19-
int intensity = bd->props.brightness;
19+
int intensity = backlight_get_brightness(bd);
2020
struct ipaq_micro_msg msg = {
2121
.id = MSG_BACKLIGHT,
2222
.tx_len = 3,
2323
};
2424

25-
if (bd->props.power != FB_BLANK_UNBLANK)
26-
intensity = 0;
27-
if (bd->props.state & (BL_CORE_FBBLANK | BL_CORE_SUSPENDED))
28-
intensity = 0;
29-
3025
/*
3126
* Message format:
3227
* Byte 0: backlight instance (usually 1)

drivers/video/backlight/ktd253-backlight.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,9 @@ static int ktd253_backlight_probe(struct platform_device *pdev)
173173
}
174174

175175
ktd253->gpiod = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
176-
if (IS_ERR(ktd253->gpiod)) {
177-
ret = PTR_ERR(ktd253->gpiod);
178-
if (ret != -EPROBE_DEFER)
179-
dev_err(dev, "gpio line missing or invalid.\n");
180-
return ret;
181-
}
176+
if (IS_ERR(ktd253->gpiod))
177+
return dev_err_probe(dev, PTR_ERR(ktd253->gpiod),
178+
"gpio line missing or invalid.\n");
182179
gpiod_set_consumer_name(ktd253->gpiod, dev_name(dev));
183180
/* Bring backlight to a known off state */
184181
msleep(KTD253_T_OFF_MS);

0 commit comments

Comments
 (0)