Commit e0d97b04 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull backlight updates from Lee Jones:
 "New Drivers:
   - Texas Instruments LM3509 Backlight Driver

  Fix-ups:
   - Device Tree binding adaptions/conversions/creation
   - Drop i2c_device_id::driver_data where the value is unused
   - Make use of the new *_scoped() guard APIs
   - Decouple from fbdev by providing Backlight with its own
     BACKLIGHT_POWER_* constrains

  Bug Fixes:
   - Correctly assess return values (NULL vs IS_ERR())
   - Supply a bunch of MODULE_DESCRIPTIONs to silence modpost warnings"

* tag 'backlight-next-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: (23 commits)
  backlight: sky81452-backlight: Use backlight power constants
  backlight: rave-sp-backlight: Use backlight power constants
  backlight: pwm-backlight: Use backlight power constants
  backlight: pcf50633-backlight: Use backlight power constants
  backlight: pandora-backlight: Use backlight power constants
  backlight: mp3309c: Use backlight power constants
  backlight: lm3533-backlight: Use backlight power constants
  backlight: led-backlight: Use backlight power constants
  backlight: ktd253-backlight: Use backlight power constants
  backlight: kb3886-bl: Use backlight power constants
  backlight: journada_bl: Use backlight power constants
  backlight: ipaq-micro-backlight: Use backlight power constants
  backlight: gpio-backlight: Use backlight power constants
  backlight: corgi-lcd: Use backlight power constants
  backlight: ams369fb06: Use backlight power constants
  backlight: aat2870-backlight: Use blacklight power constants
  backlight: Add BACKLIGHT_POWER_ constants for power states
  backlight: lm3509_bl: Fix early returns in for_each_child_of_node()
  backlight: Drop explicit initialization of struct i2c_device_id::driver_data to 0
  backlight: Add missing MODULE_DESCRIPTION() macros
  ...
parents 1200af3a 1df5aa37
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -3,10 +3,11 @@ Date: April 2005
KernelVersion:	2.6.12
Contact:	Richard Purdie <rpurdie@rpsys.net>
Description:
		Control BACKLIGHT power, values are FB_BLANK_* from fb.h
		Control BACKLIGHT power, values are compatible with
		FB_BLANK_* from fb.h

		 - FB_BLANK_UNBLANK (0)   : power on.
		 - FB_BLANK_POWERDOWN (4) : power off
		 - 0 (FB_BLANK_UNBLANK)   : power on.
		 - 4 (FB_BLANK_POWERDOWN) : power off
Users:		HAL

What:		/sys/class/backlight/<backlight>/brightness
+136 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/backlight/ti,lm3509.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TI LM3509 High Efficiency Boost for White LED's and/or OLED Displays

maintainers:
  - Patrick Gansterer <paroga@paroga.com>

description:
  The LM3509 current mode boost converter offers two separate outputs.
  https://www.ti.com/product/LM3509

properties:
  compatible:
    const: ti,lm3509

  reg:
    maxItems: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

  reset-gpios:
    maxItems: 1

  ti,brightness-rate-of-change-us:
    description: Brightness Rate of Change in microseconds.
    enum: [51, 13000, 26000, 52000]

  ti,oled-mode:
    description: Enable OLED mode.
    type: boolean

patternProperties:
  "^led@[01]$":
    type: object
    description: Properties for a string of connected LEDs.
    $ref: common.yaml#

    properties:
      reg:
        description:
          The control register that is used to program the two current sinks.
          The LM3509 has two registers (BMAIN and BSUB) and are represented
          as 0 or 1 in this property. The two current sinks can be controlled
          independently with both registers, or register BMAIN can be
          configured to control both sinks with the led-sources property.
        minimum: 0
        maximum: 1

      label: true

      led-sources:
        minItems: 1
        maxItems: 2
        items:
          minimum: 0
          maximum: 1

      default-brightness:
        minimum: 0
        maximum: 31
        default: 18

      max-brightness:
        minimum: 0
        maximum: 31
        default: 31

    required:
      - reg

    additionalProperties: false

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        backlight@36 {
            compatible = "ti,lm3509";
            reg = <0x36>;
            reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;

            ti,oled-mode;
            ti,brightness-rate-of-change-us = <52000>;

            #address-cells = <1>;
            #size-cells = <0>;

            led@0 {
                reg = <0>;
                led-sources = <0 1>;
                label = "lcd-backlight";
                default-brightness = <12>;
                max-brightness = <31>;
            };
        };
    };
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        backlight@36 {
            compatible = "ti,lm3509";
            reg = <0x36>;

            #address-cells = <1>;
            #size-cells = <0>;

            led@0 {
                reg = <0>;
                default-brightness = <12>;
            };

            led@1 {
                reg = <1>;
                default-brightness = <15>;
            };
        };
    };
+7 −0
Original line number Diff line number Diff line
@@ -373,6 +373,13 @@ config BACKLIGHT_AAT2870
	  If you have a AnalogicTech AAT2870 say Y to enable the
	  backlight driver.

config BACKLIGHT_LM3509
	tristate "Backlight Driver for LM3509"
	depends on I2C
	select REGMAP_I2C
	help
	  This supports TI LM3509 Backlight Driver

config BACKLIGHT_LM3630A
	tristate "Backlight Driver for LM3630A"
	depends on I2C && PWM
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ obj-$(CONFIG_BACKLIGHT_IPAQ_MICRO) += ipaq_micro_bl.o
obj-$(CONFIG_BACKLIGHT_KTD253)		+= ktd253-backlight.o
obj-$(CONFIG_BACKLIGHT_KTD2801)		+= ktd2801-backlight.o
obj-$(CONFIG_BACKLIGHT_KTZ8866)		+= ktz8866.o
obj-$(CONFIG_BACKLIGHT_LM3509)		+= lm3509_bl.o
obj-$(CONFIG_BACKLIGHT_LM3533)		+= lm3533_bl.o
obj-$(CONFIG_BACKLIGHT_LM3630A)		+= lm3630a_bl.o
obj-$(CONFIG_BACKLIGHT_LM3639)		+= lm3639_bl.o
+2 −2
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ static int aat2870_bl_probe(struct platform_device *pdev)
		bd->props.max_brightness = 255;

	aat2870_bl->brightness = 0;
	bd->props.power = FB_BLANK_UNBLANK;
	bd->props.power = BACKLIGHT_POWER_ON;
	bd->props.brightness = bd->props.max_brightness;

	ret = aat2870_bl_update_status(bd);
@@ -176,7 +176,7 @@ static void aat2870_bl_remove(struct platform_device *pdev)
	struct aat2870_bl_driver_data *aat2870_bl = platform_get_drvdata(pdev);
	struct backlight_device *bd = aat2870_bl->bd;

	bd->props.power = FB_BLANK_POWERDOWN;
	bd->props.power = BACKLIGHT_POWER_OFF;
	bd->props.brightness = 0;
	backlight_update_status(bd);
}
Loading