Skip to content

Commit

Permalink
Merge tag 'backlight-next-6.3' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Linus Torvalds committed Feb 23, 2023
2 parents c2c23dc + ad614f8 commit 025cf4d
Show file tree
Hide file tree
Showing 17 changed files with 339 additions and 542 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/backlight/kinetic,ktz8866.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Kinetic Technologies KTZ8866 backlight

maintainers:
- Jianhua Lu <lujianhua000@gmail.com>

description: |
The Kinetic Technologies KTZ8866 is a high efficiency 6-channels-current-sinks
led backlight with dual lcd bias power.
https://www.kinet-ic.com/ktz8866/
allOf:
- $ref: common.yaml#

properties:
compatible:
const: kinetic,ktz8866

vddpos-supply:
description: positive boost supply regulator.

vddneg-supply:
description: negative boost supply regulator.

enable-gpios:
description: GPIO to use to enable/disable the backlight (HWEN pin).
maxItems: 1

current-num-sinks:
description: number of the LED current sinks' channels.
enum: [1, 2, 3, 4, 5, 6]

kinetic,current-ramp-delay-ms:
description: |
LED current ramping delay time in milliseconds, note that the
case 1 will be mapped to 1μs.
enum: [1, 2, 4, 8, 16, 32, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640]

kinetic,led-enable-ramp-delay-ms:
description: |
LED on/off ramping delay time in milliseconds, note that the case 0 will be
mapped to 512μs because ktz8866 can't ramp faster than it.
enum: [0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384]

kinetic,enable-lcd-bias:
description: Set if we want to output bias power supply for LCD.
type: boolean

required:
- compatible
- vddpos-supply
- vddneg-supply
- enable-gpios

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/gpio/gpio.h>
backlight {
compatible = "kinetic,ktz8866";
vddpos-supply = <&bl_vddpos_5p5>;
vddneg-supply = <&bl_vddneg_5p5>;
enable-gpios = <&tlmm 139 GPIO_ACTIVE_HIGH>;
current-num-sinks = <5>;
kinetic,current-ramp-delay-ms = <128>;
kinetic,led-enable-ramp-delay-ms = <1>;
kinetic,enable-lcd-bias;
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ properties:
compatible:
enum:
- qcom,pm8941-wled
- qcom,pmi8950-wled
- qcom,pmi8994-wled
- qcom,pmi8998-wled
- qcom,pm660l-wled
Expand Down
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -11572,6 +11572,12 @@ M: John Hawley <warthog9@eaglescrag.net>
S: Maintained
F: tools/testing/ktest

KTZ8866 BACKLIGHT DRIVER
M: Jianhua Lu <lujianhua000@gmail.com>
S: Maintained
F: Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml
F: drivers/video/backlight/ktz8866.c

L3MDEV
M: David Ahern <dsahern@kernel.org>
L: netdev@vger.kernel.org
Expand Down
22 changes: 8 additions & 14 deletions drivers/video/backlight/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,6 @@ config LCD_PLATFORM
This driver provides a platform-device registered LCD power
control interface.

config LCD_TOSA
tristate "Sharp SL-6000 LCD Driver"
depends on I2C && SPI && MACH_TOSA
help
If you have an Sharp SL-6000 Zaurus say Y to enable a driver
for its LCD.

config LCD_HP700
tristate "HP Jornada 700 series LCD Driver"
depends on SA1100_JORNADA720_SSP && !PREEMPTION
Expand Down Expand Up @@ -190,6 +183,14 @@ config BACKLIGHT_KTD253
which is a 1-wire GPIO-controlled backlight found in some mobile
phones.

config BACKLIGHT_KTZ8866
tristate "Backlight Driver for Kinetic KTZ8866"
depends on I2C
select REGMAP_I2C
help
Say Y to enable the backlight driver for the Kinetic KTZ8866
found in Xiaomi Mi Pad 5 series.

config BACKLIGHT_LM3533
tristate "Backlight Driver for LM3533"
depends on MFD_LM3533
Expand Down Expand Up @@ -288,13 +289,6 @@ config BACKLIGHT_APPLE
If you have an Intel-based Apple say Y to enable a driver for its
backlight.

config BACKLIGHT_TOSA
tristate "Sharp SL-6000 Backlight Driver"
depends on I2C && MACH_TOSA && LCD_TOSA
help
If you have an Sharp SL-6000 Zaurus say Y to enable a driver
for its backlight

config BACKLIGHT_QCOM_WLED
tristate "Qualcomm PMIC WLED Driver"
select REGMAP
Expand Down
3 changes: 1 addition & 2 deletions drivers/video/backlight/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ obj-$(CONFIG_LCD_LTV350QV) += ltv350qv.o
obj-$(CONFIG_LCD_OTM3225A) += otm3225a.o
obj-$(CONFIG_LCD_PLATFORM) += platform_lcd.o
obj-$(CONFIG_LCD_TDO24M) += tdo24m.o
obj-$(CONFIG_LCD_TOSA) += tosa_lcd.o
obj-$(CONFIG_LCD_VGG2432A4) += vgg2432a4.o

obj-$(CONFIG_BACKLIGHT_88PM860X) += 88pm860x_bl.o
Expand All @@ -36,6 +35,7 @@ obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o
obj-$(CONFIG_BACKLIGHT_HP700) += jornada720_bl.o
obj-$(CONFIG_BACKLIGHT_IPAQ_MICRO) += ipaq_micro_bl.o
obj-$(CONFIG_BACKLIGHT_KTD253) += ktd253-backlight.o
obj-$(CONFIG_BACKLIGHT_KTZ8866) += ktz8866.o
obj-$(CONFIG_BACKLIGHT_LM3533) += lm3533_bl.o
obj-$(CONFIG_BACKLIGHT_LM3630A) += lm3630a_bl.o
obj-$(CONFIG_BACKLIGHT_LM3639) += lm3639_bl.o
Expand All @@ -53,7 +53,6 @@ obj-$(CONFIG_BACKLIGHT_QCOM_WLED) += qcom-wled.o
obj-$(CONFIG_BACKLIGHT_RT4831) += rt4831-backlight.o
obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o
obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o
obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o
obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o
obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o
obj-$(CONFIG_BACKLIGHT_ARCXCNN) += arcxcnn_bl.o
Expand Down
7 changes: 1 addition & 6 deletions drivers/video/backlight/aat2870_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static int aat2870_bl_update_status(struct backlight_device *bd)
struct aat2870_bl_driver_data *aat2870_bl = bl_get_data(bd);
struct aat2870_data *aat2870 =
dev_get_drvdata(aat2870_bl->pdev->dev.parent);
int brightness = bd->props.brightness;
int brightness = backlight_get_brightness(bd);
int ret;

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

if ((bd->props.power != FB_BLANK_UNBLANK) ||
(bd->props.state & BL_CORE_FBBLANK) ||
(bd->props.state & BL_CORE_SUSPENDED))
brightness = 0;

ret = aat2870->write(aat2870, AAT2870_BLM,
(u8)aat2870_brightness(aat2870_bl, brightness));
if (ret < 0)
Expand Down
5 changes: 1 addition & 4 deletions drivers/video/backlight/arcxcnn_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,9 @@ static int arcxcnn_set_brightness(struct arcxcnn *lp, u32 brightness)
static int arcxcnn_bl_update_status(struct backlight_device *bl)
{
struct arcxcnn *lp = bl_get_data(bl);
u32 brightness = bl->props.brightness;
u32 brightness = backlight_get_brightness(bl);
int ret;

if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
brightness = 0;

ret = arcxcnn_set_brightness(lp, brightness);
if (ret)
return ret;
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/backlight/backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ EXPORT_SYMBOL(backlight_device_get_by_type);
*
* This function looks up a backlight device by its name. It obtains a reference
* on the backlight device and it is the caller's responsibility to drop the
* reference by calling backlight_put().
* reference by calling put_device().
*
* Returns:
* A pointer to the backlight device if found, otherwise NULL.
Expand Down
7 changes: 1 addition & 6 deletions drivers/video/backlight/ipaq_micro_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,12 @@
static int micro_bl_update_status(struct backlight_device *bd)
{
struct ipaq_micro *micro = dev_get_drvdata(&bd->dev);
int intensity = bd->props.brightness;
int intensity = backlight_get_brightness(bd);
struct ipaq_micro_msg msg = {
.id = MSG_BACKLIGHT,
.tx_len = 3,
};

if (bd->props.power != FB_BLANK_UNBLANK)
intensity = 0;
if (bd->props.state & (BL_CORE_FBBLANK | BL_CORE_SUSPENDED))
intensity = 0;

/*
* Message format:
* Byte 0: backlight instance (usually 1)
Expand Down
9 changes: 3 additions & 6 deletions drivers/video/backlight/ktd253-backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,9 @@ static int ktd253_backlight_probe(struct platform_device *pdev)
}

ktd253->gpiod = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
if (IS_ERR(ktd253->gpiod)) {
ret = PTR_ERR(ktd253->gpiod);
if (ret != -EPROBE_DEFER)
dev_err(dev, "gpio line missing or invalid.\n");
return ret;
}
if (IS_ERR(ktd253->gpiod))
return dev_err_probe(dev, PTR_ERR(ktd253->gpiod),
"gpio line missing or invalid.\n");
gpiod_set_consumer_name(ktd253->gpiod, dev_name(dev));
/* Bring backlight to a known off state */
msleep(KTD253_T_OFF_MS);
Expand Down
Loading

0 comments on commit 025cf4d

Please sign in to comment.