Commit 0a8d6c9c authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull backlight updates from Lee Jones:
 "New Functionality:
   - Add lots of Device Tree bindings / support
   - Turn off LED strings when display is blank
   - Switch I2C drivers from .probe_new() to .probe()
   - Remove superfluous NULL checks
   - Only obtain PWM information once and do it in .probe()

  Fix-ups:
   - Ensure locks are obtained and held when required"

* tag 'backlight-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
  backlight: led_bl: Take led_access lock when required
  video: backlight: lp855x: Get PWM for PWM mode during probe
  dt-bindings: backlight: lp855x: Convert to YAML and modernize
  dt-bindings: backlight: pwm: Make power-supply not required
  backlight: pwm_bl: Remove unneeded checks for valid GPIOs
  backlight: Switch i2c drivers back to use .probe()
  backlight: lm3630a: Turn off both led strings when display is blank
  dt-bindings: leds: backlight: ktz8866: Add reg property and update example
parents c156d4af a33677b9
Loading
Loading
Loading
Loading
+19 −10
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@ properties:
  compatible:
    const: kinetic,ktz8866

  reg:
    maxItems: 1

  vddpos-supply:
    description: positive boost supply regulator.

@@ -54,6 +57,7 @@ properties:

required:
  - compatible
  - reg
  - vddpos-supply
  - vddneg-supply
  - enable-gpios
@@ -64,9 +68,13 @@ examples:
  - |
    #include <dt-bindings/gpio/gpio.h>

    backlight {
        compatible = "kinetic,ktz8866";
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        backlight@11 {
            compatible = "kinetic,ktz8866";
            reg = <0x11>;
            vddpos-supply = <&bl_vddpos_5p5>;
            vddneg-supply = <&bl_vddneg_5p5>;
            enable-gpios = <&tlmm 139 GPIO_ACTIVE_HIGH>;
@@ -75,3 +83,4 @@ examples:
            kinetic,led-enable-ramp-delay-ms = <1>;
            kinetic,enable-lcd-bias;
        };
    };
+149 −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/lp855x-backlight.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments LP855X backlight controllers

maintainers:
  - Artur Weber <aweber.kernel@gmail.com>

properties:
  compatible:
    enum:
      - ti,lp8550
      - ti,lp8551
      - ti,lp8552
      - ti,lp8553
      - ti,lp8555
      - ti,lp8556
      - ti,lp8557

  reg:
    maxItems: 1

  dev-ctrl:
    $ref: /schemas/types.yaml#/definitions/uint8
    description:
      Value of device control register. This is a device-specific value.

  bl-name:
    $ref: /schemas/types.yaml#/definitions/string
    description: Backlight device name.

  init-brt:
    $ref: /schemas/types.yaml#/definitions/uint8
    description: Initial value of backlight brightness.

  power-supply:
    description: Regulator which controls the 3V rail.

  enable-supply:
    description: Regulator which controls the EN/VDDIO input.

  pwms:
    maxItems: 1
    description: |
      PWM channel to use for controlling the backlight; setting this
      enables the PWM-based backlight control mode.

  pwm-names: true

  pwm-period:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      PWM period value. Deprecated; set the period value in the pwms
      property instead.
    deprecated: true

patternProperties:
  "^rom-[0-9a-f]{2}h$":
    type: object
    description: Nodes containing the values of configuration registers.
    additionalProperties: false
    properties:
      rom-addr:
        $ref: /schemas/types.yaml#/definitions/uint8
        description: Register address of ROM area to be updated.

      rom-val:
        $ref: /schemas/types.yaml#/definitions/uint8
        description: Value to write to the ROM register.

required:
  - compatible
  - reg
  - dev-ctrl

unevaluatedProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        backlight@2c {
            compatible = "ti,lp8555";
            reg = <0x2c>;

            dev-ctrl = /bits/ 8 <0x00>;

            pwms = <&pwm 0 10000>;
            pwm-names = "lp8555";

            /* 4V OV, 4 output LED0 string enabled */
            rom-14h {
              rom-addr = /bits/ 8 <0x14>;
              rom-val = /bits/ 8 <0xcf>;
            };

            /* Heavy smoothing, 24ms ramp time step */
            rom-15h {
              rom-addr = /bits/ 8 <0x15>;
              rom-val = /bits/ 8 <0xc7>;
            };

            /* 4 output LED1 string enabled */
            rom-19h {
              rom-addr = /bits/ 8 <0x19>;
              rom-val = /bits/ 8 <0x0f>;
            };
        };
    };
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        backlight@2c {
            compatible = "ti,lp8556";
            reg = <0x2c>;

            bl-name = "lcd-bl";
            dev-ctrl = /bits/ 8 <0x85>;
            init-brt = /bits/ 8 <0x10>;
        };
      };
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        backlight@2c {
            compatible = "ti,lp8557";
            reg = <0x2c>;
            enable-supply = <&backlight_vddio>;
            power-supply = <&backlight_vdd>;

            dev-ctrl = /bits/ 8 <0x41>;
            init-brt = /bits/ 8 <0x0a>;

            /* 4V OV, 4 output LED string enabled */
            rom-14h {
              rom-addr = /bits/ 8 <0x14>;
              rom-val = /bits/ 8 <0xcf>;
            };
        };
    };
+0 −72
Original line number Diff line number Diff line
lp855x bindings

Required properties:
  - compatible: "ti,lp8550", "ti,lp8551", "ti,lp8552", "ti,lp8553",
                "ti,lp8555", "ti,lp8556", "ti,lp8557"
  - reg: I2C slave address (u8)
  - dev-ctrl: Value of DEVICE CONTROL register (u8). It depends on the device.

Optional properties:
  - bl-name: Backlight device name (string)
  - init-brt: Initial value of backlight brightness (u8)
  - pwm-period: PWM period value. Set only PWM input mode used (u32)
  - rom-addr: Register address of ROM area to be updated (u8)
  - rom-val: Register value to be updated (u8)
  - power-supply: Regulator which controls the 3V rail
  - enable-supply: Regulator which controls the EN/VDDIO input

Example:

	/* LP8555 */
	backlight@2c {
		compatible = "ti,lp8555";
		reg = <0x2c>;

		dev-ctrl = /bits/ 8 <0x00>;
		pwm-period = <10000>;

		/* 4V OV, 4 output LED0 string enabled */
		rom_14h {
			rom-addr = /bits/ 8 <0x14>;
			rom-val = /bits/ 8 <0xcf>;
		};

		/* Heavy smoothing, 24ms ramp time step */
		rom_15h {
			rom-addr = /bits/ 8 <0x15>;
			rom-val = /bits/ 8 <0xc7>;
		};

		/* 4 output LED1 string enabled */
		rom_19h {
			rom-addr = /bits/ 8 <0x19>;
			rom-val = /bits/ 8 <0x0f>;
		};
	};

	/* LP8556 */
	backlight@2c {
		compatible = "ti,lp8556";
		reg = <0x2c>;

		bl-name = "lcd-bl";
		dev-ctrl = /bits/ 8 <0x85>;
		init-brt = /bits/ 8 <0x10>;
	};

	/* LP8557 */
	backlight@2c {
		compatible = "ti,lp8557";
		reg = <0x2c>;
		enable-supply = <&backlight_vddio>;
		power-supply = <&backlight_vdd>;

		dev-ctrl = /bits/ 8 <0x41>;
		init-brt = /bits/ 8 <0x0a>;

		/* 4V OV, 4 output LED string enabled */
		rom_14h {
			rom-addr = /bits/ 8 <0x14>;
			rom-val = /bits/ 8 <0xcf>;
		};
	};
+0 −1
Original line number Diff line number Diff line
@@ -68,7 +68,6 @@ dependencies:
required:
  - compatible
  - pwms
  - power-supply

additionalProperties: false

+2 −2
Original line number Diff line number Diff line
@@ -803,7 +803,7 @@ static struct i2c_driver adp8860_driver = {
		.name	= KBUILD_MODNAME,
		.pm	= &adp8860_i2c_pm_ops,
	},
	.probe_new = adp8860_probe,
	.probe = adp8860_probe,
	.remove = adp8860_remove,
	.id_table = adp8860_id,
};
Loading