* [PATCH v2 0/6] backlight: aw99706: Add Awinic AW99703 support
@ 2026-12-05 0:51 Luka Panio
2026-12-05 0:51 ` [PATCH v2 1/6] dt-bindings: leds: backlight: aw99706: Use standard led-max-microamp Luka Panio
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Luka Panio @ 2026-12-05 0:51 UTC (permalink / raw)
To: lee, danielt, jingoohan1
Cc: pavel, robh, krzk+dt, conor+dt, deller, griffin, junjie.cao,
mitltlatltl, andreas, dri-devel, linux-leds, devicetree,
linux-fbdev, linux-kernel, Luka Panio
The Awinic AW99703 is a 3-channel WLED driver with an integrated boost
converter and 11-bit brightness control over I2C, used for the panel
backlight of the Nexphone (QCM6490).
As suggested on v1, this version adds the AW99703 to the existing aw99706
driver instead of adding a new one. The two chips share the programming
model but have different register maps, so the driver is first converted
to per-chip data. Following the binding review, the AW99703 binding uses
the standard led-sources and led-max-microamp properties, and the
AW99706 binding gains led-max-microamp as well, with the vendor
awinic,iled-max-microamp property deprecated but still read.
Patch 3 is a fix for the existing driver: the chip ID was read before
HWEN was asserted.
Andreas, your Kobo Clara 2e series [1] adds a separate aw99703 driver
and binding for the same chip. Hopefully we can settle on 1 driver,
please test this driver and let me know if it works for you, or you
have any other ideas.
[1] https://lore.kernel.org/all/20261202-bl-aw99703-upstr-v2-0-cc41570c0404@kemnade.info/
Changes in v2:
- Add AW99703 support to the aw99706 driver instead of a new driver
- Drop the ramp, transition and mapping properties; use led-sources and
led-max-microamp
- Add led-max-microamp to the AW99706 binding, deprecate
awinic,iled-max-microamp and keep reading it as a fallback
- Read the brightness properties into u32 variables
- Assert HWEN before reading the chip ID and drop it again on probe failure
- Add optional vin-supply and label
Luka Panio (6):
dt-bindings: leds: backlight: aw99706: Use standard led-max-microamp
dt-bindings: leds: backlight: Add Awinic AW99703 backlight
backlight: aw99706: Enable the chip before reading its ID
backlight: aw99706: Introduce per-chip data
backlight: aw99706: Support the led-max-microamp property
backlight: aw99706: Add AW99703 support
.../leds/backlight/awinic,aw99703.yaml | 118 +++++
.../leds/backlight/awinic,aw99706.yaml | 10 +-
MAINTAINERS | 2 +
drivers/video/backlight/Kconfig | 6 +-
drivers/video/backlight/aw99706.c | 434 ++++++++++++++----
5 files changed, 488 insertions(+), 82 deletions(-)
create mode 100644 Documentation/devicetree/bindings/leds/backlight/awinic,aw99703.yaml
base-commit: 29beb21c21ada7207692b2d69fc58dcd15dab6e9
--
2.55.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/6] dt-bindings: leds: backlight: aw99706: Use standard led-max-microamp
2026-12-05 0:51 [PATCH v2 0/6] backlight: aw99706: Add Awinic AW99703 support Luka Panio
@ 2026-12-05 0:51 ` Luka Panio
2026-12-05 0:51 ` [PATCH v2 2/6] dt-bindings: leds: backlight: Add Awinic AW99703 backlight Luka Panio
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Luka Panio @ 2026-12-05 0:51 UTC (permalink / raw)
To: lee, danielt, jingoohan1
Cc: pavel, robh, krzk+dt, conor+dt, deller, griffin, junjie.cao,
mitltlatltl, andreas, dri-devel, linux-leds, devicetree,
linux-fbdev, linux-kernel, Luka Panio
Replace awinic,iled-max-microamp with generic led-max-microamp.
awinic,iled-max-microamp is kep as deprecated for existing device trees.
Signed-off-by: Luka Panio <lukapanio@gmail.com>
---
.../bindings/leds/backlight/awinic,aw99706.yaml | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/leds/backlight/awinic,aw99706.yaml b/Documentation/devicetree/bindings/leds/backlight/awinic,aw99706.yaml
index 60eae50ff742..0690e0e0de65 100644
--- a/Documentation/devicetree/bindings/leds/backlight/awinic,aw99706.yaml
+++ b/Documentation/devicetree/bindings/leds/backlight/awinic,aw99706.yaml
@@ -45,12 +45,20 @@ properties:
enum: [ 1500000, 2000000, 2500000, 3000000 ]
default: 3000000
+ led-max-microamp:
+ description: Maximum LED current setting in uA.
+ minimum: 5000
+ maximum: 50000
+ multipleOf: 500
+ default: 20000
+
awinic,iled-max-microamp:
description: Maximum LED current setting in uA.
minimum: 5000
maximum: 50000
multipleOf: 500
default: 20000
+ deprecated: true
awinic,uvlo-thres-microvolt:
description: UVLO(Under Voltage Lock Out) in uV.
@@ -93,7 +101,7 @@ examples:
awinic,sw-freq-hz = <750000>;
awinic,sw-ilmt-microamp = <3000000>;
awinic,uvlo-thres-microvolt = <2200000>;
- awinic,iled-max-microamp = <20000>;
+ led-max-microamp = <20000>;
awinic,ramp-ctl = <2>;
};
};
--
2.55.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/6] dt-bindings: leds: backlight: Add Awinic AW99703 backlight
2026-12-05 0:51 [PATCH v2 0/6] backlight: aw99706: Add Awinic AW99703 support Luka Panio
2026-12-05 0:51 ` [PATCH v2 1/6] dt-bindings: leds: backlight: aw99706: Use standard led-max-microamp Luka Panio
@ 2026-12-05 0:51 ` Luka Panio
2026-12-05 0:51 ` [PATCH v2 3/6] backlight: aw99706: Enable the chip before reading its ID Luka Panio
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Luka Panio @ 2026-12-05 0:51 UTC (permalink / raw)
To: lee, danielt, jingoohan1
Cc: pavel, robh, krzk+dt, conor+dt, deller, griffin, junjie.cao,
mitltlatltl, andreas, dri-devel, linux-leds, devicetree,
linux-fbdev, linux-kernel, Luka Panio
The Awinic AW99703 is a 3-channel WLED driver with an integrated boost
converter and 11-bit brightness control over I2C, optionally combined
with a PWM input.
Signed-off-by: Luka Panio <lukapanio@gmail.com>
---
.../leds/backlight/awinic,aw99703.yaml | 118 ++++++++++++++++++
MAINTAINERS | 2 +
2 files changed, 120 insertions(+)
create mode 100644 Documentation/devicetree/bindings/leds/backlight/awinic,aw99703.yaml
diff --git a/Documentation/devicetree/bindings/leds/backlight/awinic,aw99703.yaml b/Documentation/devicetree/bindings/leds/backlight/awinic,aw99703.yaml
new file mode 100644
index 000000000000..a08da356542c
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/backlight/awinic,aw99703.yaml
@@ -0,0 +1,118 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/backlight/awinic,aw99703.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Awinic AW99703 3-channel WLED Backlight Driver
+
+maintainers:
+ - Luka Panio <lukapanio@gmail.com>
+
+description:
+ The AW99703 is a 3-channel WLED driver with an integrated boost converter
+ and 11-bit brightness control over I2C, optionally combined with a PWM
+ input.
+
+allOf:
+ - $ref: common.yaml#
+
+properties:
+ compatible:
+ const: awinic,aw99703
+
+ reg:
+ maxItems: 1
+
+ enable-gpios:
+ description: GPIO connected to the HWEN pin.
+ maxItems: 1
+
+ vin-supply:
+ description: Regulator supplying the VIN pin.
+
+ label:
+ description:
+ Name of the backlight device, e.g. to tell several AW99703 on one board
+ apart.
+
+ led-sources:
+ description: |
+ LED strings connected to the device:
+ 0 - LED1
+ 1 - LED2
+ 2 - LED3
+ minItems: 1
+ maxItems: 3
+ items:
+ maximum: 2
+ default: [0, 1, 2]
+
+ led-max-microamp:
+ description:
+ Full-scale current of each enabled LED string. All strings share the
+ same setting.
+ minimum: 4800
+ maximum: 29600
+ multipleOf: 800
+ default: 20000
+
+ awinic,ovp-microvolt:
+ description: Boost over-voltage protection threshold.
+ enum: [17500000, 24000000, 31000000, 38000000, 41500000]
+ default: 38000000
+
+ awinic,ocp-microamp:
+ description: Boost over-current protection threshold.
+ enum: [900000, 1800000, 2700000, 3400000]
+ default: 2700000
+
+ awinic,sw-freq-hz:
+ description: Boost switching frequency.
+ enum: [500000, 1000000]
+ default: 1000000
+
+ awinic,inductor-nanohenry:
+ description: Value of the boost inductor fitted on the board.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [4700, 10000]
+ default: 4700
+
+ awinic,pwm-input:
+ description:
+ The PWM input pin is connected and its duty cycle is combined with the
+ brightness set over I2C.
+ type: boolean
+
+ default-brightness:
+ maximum: 2047
+
+ max-brightness:
+ maximum: 2047
+
+required:
+ - compatible
+ - reg
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ backlight@36 {
+ compatible = "awinic,aw99703";
+ reg = <0x36>;
+ enable-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
+ vin-supply = <&vreg_bl>;
+ label = "lcd-backlight";
+ led-sources = <0 1>;
+ led-max-microamp = <20000>;
+ awinic,ocp-microamp = <3400000>;
+ awinic,inductor-nanohenry = <10000>;
+ };
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index bb36b126e531..e46fc60bc623 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4605,7 +4605,9 @@ F: sound/hda/codecs/side-codecs/aw88399*
AWINIC AW99706 WLED BACKLIGHT DRIVER
M: Junjie Cao <junjie.cao@linux.dev>
+R: Luka Panio <lukapanio@gmail.com>
S: Maintained
+F: Documentation/devicetree/bindings/leds/backlight/awinic,aw99703.yaml
F: Documentation/devicetree/bindings/leds/backlight/awinic,aw99706.yaml
F: drivers/video/backlight/aw99706.c
--
2.55.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 3/6] backlight: aw99706: Enable the chip before reading its ID
2026-12-05 0:51 [PATCH v2 0/6] backlight: aw99706: Add Awinic AW99703 support Luka Panio
2026-12-05 0:51 ` [PATCH v2 1/6] dt-bindings: leds: backlight: aw99706: Use standard led-max-microamp Luka Panio
2026-12-05 0:51 ` [PATCH v2 2/6] dt-bindings: leds: backlight: Add Awinic AW99703 backlight Luka Panio
@ 2026-12-05 0:51 ` Luka Panio
2026-12-05 0:51 ` [PATCH v2 4/6] backlight: aw99706: Introduce per-chip data Luka Panio
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Luka Panio @ 2026-12-05 0:51 UTC (permalink / raw)
To: lee, danielt, jingoohan1
Cc: pavel, robh, krzk+dt, conor+dt, deller, griffin, junjie.cao,
mitltlatltl, andreas, dri-devel, linux-leds, devicetree,
linux-fbdev, linux-kernel, Luka Panio
The chip ID is read before the HWEN GPIO is requested, so the check only
passes if the chip was already enabled, e.g. by the bootloader. Request
and assert HWEN first, and de-assert it again if probe fails afterwards
so the chip is not left powered.
Fixes: 147b38a5ad06 ("backlight: aw99706: Add support for Awinic AW99706 backlight")
Signed-off-by: Luka Panio <lukapanio@gmail.com>
---
drivers/video/backlight/aw99706.c | 33 ++++++++++++++++++++-----------
1 file changed, 22 insertions(+), 11 deletions(-)
diff --git a/drivers/video/backlight/aw99706.c b/drivers/video/backlight/aw99706.c
index 43f82c83f91a..c6b0d0122ad6 100644
--- a/drivers/video/backlight/aw99706.c
+++ b/drivers/video/backlight/aw99706.c
@@ -389,11 +389,6 @@ static int aw99706_probe(struct i2c_client *client)
return dev_err_probe(dev, PTR_ERR(aw->regmap),
"Failed to init regmap\n");
- ret = aw99706_chip_id_read(aw);
- if (ret != AW99706_ID)
- return dev_err_probe(dev, -ENODEV,
- "Unknown chip id 0x%02x\n", ret);
-
aw99706_dt_parse(aw, &props);
aw->hwen_gpio = devm_gpiod_get(aw->dev, "enable", GPIOD_OUT_LOW);
@@ -401,23 +396,39 @@ static int aw99706_probe(struct i2c_client *client)
return dev_err_probe(dev, PTR_ERR(aw->hwen_gpio),
"Failed to get enable gpio\n");
+ gpiod_set_value_cansleep(aw->hwen_gpio, 1);
+
+ ret = aw99706_chip_id_read(aw);
+ if (ret != AW99706_ID) {
+ ret = dev_err_probe(dev, -ENODEV, "Unknown chip id 0x%02x\n",
+ ret);
+ goto err_power_off;
+ }
+
ret = aw99706_hw_init(aw);
- if (ret < 0)
- return dev_err_probe(dev, ret,
- "Failed to initialize the chip\n");
+ if (ret < 0) {
+ dev_err_probe(dev, ret, "Failed to initialize the chip\n");
+ goto err_power_off;
+ }
props.type = BACKLIGHT_RAW;
props.scale = BACKLIGHT_SCALE_LINEAR;
bl_dev = devm_backlight_device_register(dev, "aw99706-backlight", dev,
aw, &aw99706_bl_ops, &props);
- if (IS_ERR(bl_dev))
- return dev_err_probe(dev, PTR_ERR(bl_dev),
- "Failed to register backlight!\n");
+ if (IS_ERR(bl_dev)) {
+ ret = dev_err_probe(dev, PTR_ERR(bl_dev),
+ "Failed to register backlight!\n");
+ goto err_power_off;
+ }
aw->bl_dev = bl_dev;
return 0;
+
+err_power_off:
+ gpiod_set_value_cansleep(aw->hwen_gpio, 0);
+ return ret;
}
static void aw99706_remove(struct i2c_client *client)
--
2.55.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 4/6] backlight: aw99706: Introduce per-chip data
2026-12-05 0:51 [PATCH v2 0/6] backlight: aw99706: Add Awinic AW99703 support Luka Panio
` (2 preceding siblings ...)
2026-12-05 0:51 ` [PATCH v2 3/6] backlight: aw99706: Enable the chip before reading its ID Luka Panio
@ 2026-12-05 0:51 ` Luka Panio
2026-12-05 0:51 ` [PATCH v2 5/6] backlight: aw99706: Support the led-max-microamp property Luka Panio
2026-12-05 0:51 ` [PATCH v2 6/6] backlight: aw99706: Add AW99703 support Luka Panio
5 siblings, 0 replies; 7+ messages in thread
From: Luka Panio @ 2026-12-05 0:51 UTC (permalink / raw)
To: lee, danielt, jingoohan1
Cc: pavel, robh, krzk+dt, conor+dt, deller, griffin, junjie.cao,
mitltlatltl, andreas, dri-devel, linux-leds, devicetree,
linux-fbdev, linux-kernel, Luka Panio
Move the chip specific details (register map, DT properties, chip ID,
brightness and enable register layout, maximum brightness) into a chip
data structure selected by the match tables. This prepares the driver
to support other Awinic backlight controllers with a different register
layout.
Signed-off-by: Luka Panio <lukapanio@gmail.com>
---
drivers/video/backlight/aw99706.c | 205 ++++++++++++++++++++----------
1 file changed, 140 insertions(+), 65 deletions(-)
diff --git a/drivers/video/backlight/aw99706.c b/drivers/video/backlight/aw99706.c
index c6b0d0122ad6..db12ee1c979d 100644
--- a/drivers/video/backlight/aw99706.c
+++ b/drivers/video/backlight/aw99706.c
@@ -10,7 +10,6 @@
*/
#include <linux/backlight.h>
-#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
@@ -36,10 +35,8 @@
#define AW99706_CFG3_REG 0x03
#define AW99706_CFG4_REG 0x04
-#define AW99706_BRT_MSB_MASK GENMASK(3, 0)
#define AW99706_CFG5_REG 0x05
-#define AW99706_BRT_LSB_MASK GENMASK(7, 0)
#define AW99706_CFG6_REG 0x06
#define AW99706_RAMP_CTL_MASK GENMASK(7, 6)
@@ -83,6 +80,9 @@ struct aw99706_dt_prop {
int (*lookup)(const struct aw99706_dt_prop *prop, u32 dt_val, u8 *val);
const u32 * const lookup_tbl;
u8 tbl_size;
+ u32 min;
+ u32 max;
+ u32 step;
u8 reg;
u8 mask;
u32 def_val;
@@ -109,56 +109,63 @@ static int aw99706_dt_property_lookup(const struct aw99706_dt_prop *prop,
return i == prop->tbl_size ? -EINVAL : 0;
}
-#define MIN_ILED_MAX 5000
-#define MAX_ILED_MAX 50000
-#define STEP_ILED_MAX 500
-
-static int
-aw99706_dt_property_iled_max_convert(const struct aw99706_dt_prop *prop,
+static int aw99706_dt_property_range(const struct aw99706_dt_prop *prop,
u32 dt_val, u8 *val)
{
- if (dt_val > MAX_ILED_MAX || dt_val < MIN_ILED_MAX)
+ if (dt_val > prop->max || dt_val < prop->min)
return -EINVAL;
- if ((dt_val - MIN_ILED_MAX) % STEP_ILED_MAX)
+ if ((dt_val - prop->min) % prop->step)
return -EINVAL;
- *val = (dt_val - MIN_ILED_MAX) / STEP_ILED_MAX;
+ *val = (dt_val - prop->min) / prop->step;
return 0;
}
static const struct aw99706_dt_prop aw99706_dt_props[] = {
{
- "awinic,dim-mode", aw99706_dt_property_lookup,
- NULL, 0,
- AW99706_CFG0_REG, AW99706_DIM_MODE_MASK, 1,
+ .name = "awinic,dim-mode",
+ .lookup = aw99706_dt_property_lookup,
+ .reg = AW99706_CFG0_REG, .mask = AW99706_DIM_MODE_MASK,
+ .def_val = 1,
},
{
- "awinic,sw-freq-hz", aw99706_dt_property_lookup,
- aw99706_sw_freq_tbl, ARRAY_SIZE(aw99706_sw_freq_tbl),
- AW99706_CFG1_REG, AW99706_SW_FREQ_MASK, 750000,
+ .name = "awinic,sw-freq-hz",
+ .lookup = aw99706_dt_property_lookup,
+ .lookup_tbl = aw99706_sw_freq_tbl,
+ .tbl_size = ARRAY_SIZE(aw99706_sw_freq_tbl),
+ .reg = AW99706_CFG1_REG, .mask = AW99706_SW_FREQ_MASK,
+ .def_val = 750000,
},
{
- "awinic,sw-ilmt-microamp", aw99706_dt_property_lookup,
- aw99706_sw_ilmt_tbl, ARRAY_SIZE(aw99706_sw_ilmt_tbl),
- AW99706_CFG1_REG, AW99706_SW_ILMT_MASK, 3000000,
+ .name = "awinic,sw-ilmt-microamp",
+ .lookup = aw99706_dt_property_lookup,
+ .lookup_tbl = aw99706_sw_ilmt_tbl,
+ .tbl_size = ARRAY_SIZE(aw99706_sw_ilmt_tbl),
+ .reg = AW99706_CFG1_REG, .mask = AW99706_SW_ILMT_MASK,
+ .def_val = 3000000,
},
{
- "awinic,iled-max-microamp", aw99706_dt_property_iled_max_convert,
- NULL, 0,
- AW99706_CFG2_REG, AW99706_ILED_MAX_MASK, 20000,
-
+ .name = "awinic,iled-max-microamp",
+ .lookup = aw99706_dt_property_range,
+ .min = 5000, .max = 50000, .step = 500,
+ .reg = AW99706_CFG2_REG, .mask = AW99706_ILED_MAX_MASK,
+ .def_val = 20000,
},
{
- "awinic,uvlo-thres-microvolt", aw99706_dt_property_lookup,
- aw99706_ulvo_thres_tbl, ARRAY_SIZE(aw99706_ulvo_thres_tbl),
- AW99706_CFG2_REG, AW99706_UVLOSEL_MASK, 2200000,
+ .name = "awinic,uvlo-thres-microvolt",
+ .lookup = aw99706_dt_property_lookup,
+ .lookup_tbl = aw99706_ulvo_thres_tbl,
+ .tbl_size = ARRAY_SIZE(aw99706_ulvo_thres_tbl),
+ .reg = AW99706_CFG2_REG, .mask = AW99706_UVLOSEL_MASK,
+ .def_val = 2200000,
},
{
- "awinic,ramp-ctl", aw99706_dt_property_lookup,
- NULL, 0,
- AW99706_CFG6_REG, AW99706_RAMP_CTL_MASK, 2,
+ .name = "awinic,ramp-ctl",
+ .lookup = aw99706_dt_property_lookup,
+ .reg = AW99706_CFG6_REG, .mask = AW99706_RAMP_CTL_MASK,
+ .def_val = 2,
}
};
@@ -168,13 +175,34 @@ struct reg_init_data {
u8 val;
};
+#define AW99706_MAX_INIT_REGS 8
+
+struct aw99706_chip_data {
+ const char *bl_name;
+ const struct regmap_config *regmap_config;
+ const struct aw99706_dt_prop *dt_props;
+ u8 num_dt_props;
+ u8 id_reg;
+ u8 id;
+ u32 max_brightness;
+ u8 brt_msb_reg;
+ u8 brt_lsb_reg;
+ u8 brt_lsb_bits;
+ bool brt_lsb_first;
+ u8 en_reg;
+ u8 en_mask;
+ u8 en_val;
+};
+
struct aw99706_device {
struct i2c_client *client;
struct device *dev;
+ const struct aw99706_chip_data *chip;
struct regmap *regmap;
struct backlight_device *bl_dev;
struct gpio_desc *hwen_gpio;
- struct reg_init_data init_tbl[ARRAY_SIZE(aw99706_dt_props)];
+ struct reg_init_data init_tbl[AW99706_MAX_INIT_REGS];
+ unsigned int num_init;
bool bl_enable;
};
@@ -239,16 +267,29 @@ static inline int aw99706_i2c_update_bits(struct aw99706_device *aw, u8 reg,
return regmap_update_bits(aw->regmap, reg, mask, val);
}
+static void aw99706_add_init(struct aw99706_device *aw, u8 reg, u8 mask,
+ u8 val)
+{
+ if (WARN_ON(aw->num_init >= ARRAY_SIZE(aw->init_tbl)))
+ return;
+
+ aw->init_tbl[aw->num_init].reg = reg;
+ aw->init_tbl[aw->num_init].mask = mask;
+ aw->init_tbl[aw->num_init].val = val;
+ aw->num_init++;
+}
+
static void aw99706_dt_parse(struct aw99706_device *aw,
struct backlight_properties *bl_props)
{
+ const struct aw99706_chip_data *chip = aw->chip;
const struct aw99706_dt_prop *prop;
- u32 dt_val;
+ u32 dt_val, max_brt, brt;
int ret, i;
u8 val;
- for (i = 0; i < ARRAY_SIZE(aw99706_dt_props); i++) {
- prop = &aw99706_dt_props[i];
+ for (i = 0; i < chip->num_dt_props; i++) {
+ prop = &chip->dt_props[i];
ret = device_property_read_u32(aw->dev, prop->name, &dt_val);
if (ret < 0)
dt_val = prop->def_val;
@@ -260,23 +301,23 @@ static void aw99706_dt_parse(struct aw99706_device *aw,
prop->lookup(prop, prop->def_val, &val);
}
- aw->init_tbl[i].reg = prop->reg;
- aw->init_tbl[i].mask = prop->mask;
- aw->init_tbl[i].val = val << __ffs(prop->mask);
+ aw99706_add_init(aw, prop->reg, prop->mask,
+ val << __ffs(prop->mask));
}
- bl_props->brightness = AW99706_MAX_BRT_LVL >> 1;
- bl_props->max_brightness = AW99706_MAX_BRT_LVL;
- device_property_read_u32(aw->dev, "default-brightness",
- &bl_props->brightness);
- device_property_read_u32(aw->dev, "max-brightness",
- &bl_props->max_brightness);
+ brt = chip->max_brightness >> 1;
+ max_brt = chip->max_brightness;
+ device_property_read_u32(aw->dev, "default-brightness", &brt);
+ device_property_read_u32(aw->dev, "max-brightness", &max_brt);
+
+ if (max_brt > chip->max_brightness)
+ max_brt = chip->max_brightness;
- if (bl_props->max_brightness > AW99706_MAX_BRT_LVL)
- bl_props->max_brightness = AW99706_MAX_BRT_LVL;
+ if (brt > max_brt)
+ brt = max_brt;
- if (bl_props->brightness > bl_props->max_brightness)
- bl_props->brightness = bl_props->max_brightness;
+ bl_props->brightness = brt;
+ bl_props->max_brightness = max_brt;
}
static int aw99706_hw_init(struct aw99706_device *aw)
@@ -285,7 +326,7 @@ static int aw99706_hw_init(struct aw99706_device *aw)
gpiod_set_value_cansleep(aw->hwen_gpio, 1);
- for (i = 0; i < ARRAY_SIZE(aw->init_tbl); i++) {
+ for (i = 0; i < aw->num_init; i++) {
ret = aw99706_i2c_update_bits(aw, aw->init_tbl[i].reg,
aw->init_tbl[i].mask,
aw->init_tbl[i].val);
@@ -300,30 +341,45 @@ static int aw99706_hw_init(struct aw99706_device *aw)
static int aw99706_bl_enable(struct aw99706_device *aw, bool en)
{
+ const struct aw99706_chip_data *chip = aw->chip;
int ret;
- u8 val;
- val = FIELD_PREP(AW99706_BACKLIGHT_EN_MASK, en);
- ret = aw99706_i2c_update_bits(aw, AW99706_CFGD_REG,
- AW99706_BACKLIGHT_EN_MASK, val);
+ ret = aw99706_i2c_update_bits(aw, chip->en_reg, chip->en_mask,
+ en ? chip->en_val : 0);
if (ret)
dev_err(aw->dev, "Failed to enable backlight!\n");
return ret;
}
-static int aw99706_update_brightness(struct aw99706_device *aw, u32 brt_lvl)
+static int aw99706_write_brightness(struct aw99706_device *aw, u32 brt_lvl)
{
- bool bl_enable_now = !!brt_lvl;
+ const struct aw99706_chip_data *chip = aw->chip;
+ u8 lsb = brt_lvl & GENMASK(chip->brt_lsb_bits - 1, 0);
+ u8 msb = brt_lvl >> chip->brt_lsb_bits;
int ret;
- ret = aw99706_i2c_write(aw, AW99706_CFG4_REG,
- (brt_lvl >> 8) & AW99706_BRT_MSB_MASK);
+ if (chip->brt_lsb_first) {
+ ret = aw99706_i2c_write(aw, chip->brt_lsb_reg, lsb);
+ if (ret < 0)
+ return ret;
+
+ return aw99706_i2c_write(aw, chip->brt_msb_reg, msb);
+ }
+
+ ret = aw99706_i2c_write(aw, chip->brt_msb_reg, msb);
if (ret < 0)
return ret;
- ret = aw99706_i2c_write(aw, AW99706_CFG5_REG,
- brt_lvl & AW99706_BRT_LSB_MASK);
+ return aw99706_i2c_write(aw, chip->brt_lsb_reg, lsb);
+}
+
+static int aw99706_update_brightness(struct aw99706_device *aw, u32 brt_lvl)
+{
+ bool bl_enable_now = !!brt_lvl;
+ int ret;
+
+ ret = aw99706_write_brightness(aw, brt_lvl);
if (ret < 0)
return ret;
@@ -361,7 +417,7 @@ static int aw99706_chip_id_read(struct aw99706_device *aw)
int ret;
unsigned int val;
- ret = aw99706_i2c_read(aw, AW99706_CHIPID_REG, &val);
+ ret = aw99706_i2c_read(aw, aw->chip->id_reg, &val);
if (ret < 0)
return ret;
@@ -382,9 +438,12 @@ static int aw99706_probe(struct i2c_client *client)
aw->client = client;
aw->dev = dev;
+ aw->chip = i2c_get_match_data(client);
+ if (!aw->chip)
+ return -ENODEV;
i2c_set_clientdata(client, aw);
- aw->regmap = devm_regmap_init_i2c(client, &aw99706_regmap_config);
+ aw->regmap = devm_regmap_init_i2c(client, aw->chip->regmap_config);
if (IS_ERR(aw->regmap))
return dev_err_probe(dev, PTR_ERR(aw->regmap),
"Failed to init regmap\n");
@@ -399,7 +458,7 @@ static int aw99706_probe(struct i2c_client *client)
gpiod_set_value_cansleep(aw->hwen_gpio, 1);
ret = aw99706_chip_id_read(aw);
- if (ret != AW99706_ID) {
+ if (ret != aw->chip->id) {
ret = dev_err_probe(dev, -ENODEV, "Unknown chip id 0x%02x\n",
ret);
goto err_power_off;
@@ -414,7 +473,7 @@ static int aw99706_probe(struct i2c_client *client)
props.type = BACKLIGHT_RAW;
props.scale = BACKLIGHT_SCALE_LINEAR;
- bl_dev = devm_backlight_device_register(dev, "aw99706-backlight", dev,
+ bl_dev = devm_backlight_device_register(dev, aw->chip->bl_name, dev,
aw, &aw99706_bl_ops, &props);
if (IS_ERR(bl_dev)) {
ret = dev_err_probe(dev, PTR_ERR(bl_dev),
@@ -458,14 +517,30 @@ static int aw99706_resume(struct device *dev)
static DEFINE_SIMPLE_DEV_PM_OPS(aw99706_pm_ops, aw99706_suspend, aw99706_resume);
+static const struct aw99706_chip_data aw99706_chip = {
+ .bl_name = "aw99706-backlight",
+ .regmap_config = &aw99706_regmap_config,
+ .dt_props = aw99706_dt_props,
+ .num_dt_props = ARRAY_SIZE(aw99706_dt_props),
+ .id_reg = AW99706_CHIPID_REG,
+ .id = AW99706_ID,
+ .max_brightness = AW99706_MAX_BRT_LVL,
+ .brt_msb_reg = AW99706_CFG4_REG,
+ .brt_lsb_reg = AW99706_CFG5_REG,
+ .brt_lsb_bits = 8,
+ .en_reg = AW99706_CFGD_REG,
+ .en_mask = AW99706_BACKLIGHT_EN_MASK,
+ .en_val = AW99706_BACKLIGHT_EN_MASK,
+};
+
static const struct i2c_device_id aw99706_ids[] = {
- { .name = "aw99706" },
+ { .name = "aw99706", .driver_data = (kernel_ulong_t)&aw99706_chip },
{ }
};
MODULE_DEVICE_TABLE(i2c, aw99706_ids);
static const struct of_device_id aw99706_match_table[] = {
- { .compatible = "awinic,aw99706", },
+ { .compatible = "awinic,aw99706", .data = &aw99706_chip },
{ }
};
MODULE_DEVICE_TABLE(of, aw99706_match_table);
--
2.55.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 5/6] backlight: aw99706: Support the led-max-microamp property
2026-12-05 0:51 [PATCH v2 0/6] backlight: aw99706: Add Awinic AW99703 support Luka Panio
` (3 preceding siblings ...)
2026-12-05 0:51 ` [PATCH v2 4/6] backlight: aw99706: Introduce per-chip data Luka Panio
@ 2026-12-05 0:51 ` Luka Panio
2026-12-05 0:51 ` [PATCH v2 6/6] backlight: aw99706: Add AW99703 support Luka Panio
5 siblings, 0 replies; 7+ messages in thread
From: Luka Panio @ 2026-12-05 0:51 UTC (permalink / raw)
To: lee, danielt, jingoohan1
Cc: pavel, robh, krzk+dt, conor+dt, deller, griffin, junjie.cao,
mitltlatltl, andreas, dri-devel, linux-leds, devicetree,
linux-fbdev, linux-kernel, Luka Panio
Signed-off-by: Luka Panio <lukapanio@gmail.com>
---
drivers/video/backlight/aw99706.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/video/backlight/aw99706.c b/drivers/video/backlight/aw99706.c
index db12ee1c979d..5e0f8ccd3c88 100644
--- a/drivers/video/backlight/aw99706.c
+++ b/drivers/video/backlight/aw99706.c
@@ -77,6 +77,7 @@ static const u32 aw99706_ulvo_thres_tbl[] = {
struct aw99706_dt_prop {
const char * const name;
+ const char * const legacy_name;
int (*lookup)(const struct aw99706_dt_prop *prop, u32 dt_val, u8 *val);
const u32 * const lookup_tbl;
u8 tbl_size;
@@ -147,7 +148,8 @@ static const struct aw99706_dt_prop aw99706_dt_props[] = {
.def_val = 3000000,
},
{
- .name = "awinic,iled-max-microamp",
+ .name = "led-max-microamp",
+ .legacy_name = "awinic,iled-max-microamp",
.lookup = aw99706_dt_property_range,
.min = 5000, .max = 50000, .step = 500,
.reg = AW99706_CFG2_REG, .mask = AW99706_ILED_MAX_MASK,
@@ -291,6 +293,10 @@ static void aw99706_dt_parse(struct aw99706_device *aw,
for (i = 0; i < chip->num_dt_props; i++) {
prop = &chip->dt_props[i];
ret = device_property_read_u32(aw->dev, prop->name, &dt_val);
+ if (ret < 0 && prop->legacy_name)
+ ret = device_property_read_u32(aw->dev,
+ prop->legacy_name,
+ &dt_val);
if (ret < 0)
dt_val = prop->def_val;
--
2.55.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 6/6] backlight: aw99706: Add AW99703 support
2026-12-05 0:51 [PATCH v2 0/6] backlight: aw99706: Add Awinic AW99703 support Luka Panio
` (4 preceding siblings ...)
2026-12-05 0:51 ` [PATCH v2 5/6] backlight: aw99706: Support the led-max-microamp property Luka Panio
@ 2026-12-05 0:51 ` Luka Panio
5 siblings, 0 replies; 7+ messages in thread
From: Luka Panio @ 2026-12-05 0:51 UTC (permalink / raw)
To: lee, danielt, jingoohan1
Cc: pavel, robh, krzk+dt, conor+dt, deller, griffin, junjie.cao,
mitltlatltl, andreas, dri-devel, linux-leds, devicetree,
linux-fbdev, linux-kernel, Luka Panio
The Awinic AW99703 is a 3-channel WLED driver with an integrated boost
converter and 11-bit brightness control over I2C. It follows the same
programming model as the AW99706 but with a different register layout,
so add it as another chip variant.
Register values follow the AW99703 datasheet (V1.6).
Signed-off-by: Luka Panio <lukapanio@gmail.com>
---
drivers/video/backlight/Kconfig | 6 +-
drivers/video/backlight/aw99706.c | 194 +++++++++++++++++++++++++++++-
2 files changed, 193 insertions(+), 7 deletions(-)
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index dbf4ca23a9b6..894e593cef6c 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -157,12 +157,12 @@ config BACKLIGHT_ATMEL_LCDC
in unless the board's description says it's wired that way.
config BACKLIGHT_AW99706
- tristate "Backlight Driver for Awinic AW99706"
+ tristate "Backlight Driver for Awinic AW99706 and AW99703"
depends on I2C
select REGMAP_I2C
help
- If you have a LCD backlight connected to the WLED output of AW99706
- WLED output, say Y here to enable this driver.
+ If you have a LCD backlight connected to the WLED output of an
+ Awinic AW99706 or AW99703, say Y here to enable this driver.
config BACKLIGHT_EP93XX
tristate "Cirrus EP93xx Backlight Driver"
diff --git a/drivers/video/backlight/aw99706.c b/drivers/video/backlight/aw99706.c
index 5e0f8ccd3c88..f898df0d4ed1 100644
--- a/drivers/video/backlight/aw99706.c
+++ b/drivers/video/backlight/aw99706.c
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: GPL-2.0
/*
- * aw99706 - Backlight driver for the AWINIC AW99706
+ * aw99706 - Backlight driver for the AWINIC AW99706 and AW99703
*
* Copyright (C) 2025 Junjie Cao <caojunjie650@gmail.com>
* Copyright (C) 2025 Pengyu Luo <mitltlatltl@gmail.com>
+ * Copyright (C) 2026 Luka Panio <lukapanio@gmail.com>
*
* Based on vendor driver:
* Copyright (c) 2023 AWINIC Technology CO., LTD
@@ -16,6 +17,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
#define AW99706_MAX_BRT_LVL 4095
#define AW99706_REG_MAX 0x1F
@@ -57,6 +59,33 @@
#define AW99706_MTPLDOSEL_REG 0x1E
#define AW99706_MTPRUN_REG 0x1F
+#define AW99703_MAX_BRT_LVL 2047
+#define AW99703_ID 0x03
+#define AW99703_HWEN_DELAY_US 3500
+
+#define AW99703_ID_REG 0x00
+#define AW99703_SFTRST_REG 0x01
+#define AW99703_MODE_REG 0x02
+#define AW99703_PDIS_MASK BIT(4)
+#define AW99703_MAP_LINEAR_MASK BIT(2)
+#define AW99703_WORKMODE_MASK GENMASK(1, 0)
+#define AW99703_WORKMODE_BACKLIGHT 1
+#define AW99703_LEDCUR_REG 0x03
+#define AW99703_BLFS_MASK GENMASK(7, 3)
+#define AW99703_CHANNEL_MASK GENMASK(2, 0)
+#define AW99703_BSTCTR1_REG 0x04
+#define AW99703_SW_FREQ_MASK BIT(5)
+#define AW99703_OVPSEL_MASK GENMASK(4, 2)
+#define AW99703_OCPSEL_MASK GENMASK(1, 0)
+#define AW99703_BSTCTR2_REG 0x05
+#define AW99703_IDCTSEL_MASK BIT(6)
+#define AW99703_LEDLSB_REG 0x06
+#define AW99703_LEDMSB_REG 0x07
+#define AW99703_AFLOW_REG 0x0D
+#define AW99703_FLAGS2_REG 0x0F
+#define AW99703_FLAGS3_REG 0x11
+#define AW99703_REG_MAX 0x69
+
#define RESV U32_MAX
/* Boost switching frequency table, in Hz */
@@ -75,6 +104,20 @@ static const u32 aw99706_ulvo_thres_tbl[] = {
2200000, 5000000
};
+/* AW99703 boost switching frequency table, in Hz */
+static const u32 aw99703_sw_freq_tbl[] = { 500000, 1000000 };
+
+/* AW99703 boost over-voltage protection table, in uV (1xx = 41.5 V) */
+static const u32 aw99703_ovp_tbl[] = {
+ 17500000, 24000000, 31000000, 38000000, 41500000, RESV, RESV, RESV
+};
+
+/* AW99703 boost over-current protection table, in uA */
+static const u32 aw99703_ocp_tbl[] = { 900000, 1800000, 2700000, 3400000 };
+
+/* AW99703 boost inductor table, in nH */
+static const u32 aw99703_inductor_tbl[] = { 4700, 10000 };
+
struct aw99706_dt_prop {
const char * const name;
const char * const legacy_name;
@@ -171,6 +214,48 @@ static const struct aw99706_dt_prop aw99706_dt_props[] = {
}
};
+static const struct aw99706_dt_prop aw99703_dt_props[] = {
+ {
+ .name = "awinic,sw-freq-hz",
+ .lookup = aw99706_dt_property_lookup,
+ .lookup_tbl = aw99703_sw_freq_tbl,
+ .tbl_size = ARRAY_SIZE(aw99703_sw_freq_tbl),
+ .reg = AW99703_BSTCTR1_REG, .mask = AW99703_SW_FREQ_MASK,
+ .def_val = 1000000,
+ },
+ {
+ .name = "awinic,ovp-microvolt",
+ .lookup = aw99706_dt_property_lookup,
+ .lookup_tbl = aw99703_ovp_tbl,
+ .tbl_size = ARRAY_SIZE(aw99703_ovp_tbl),
+ .reg = AW99703_BSTCTR1_REG, .mask = AW99703_OVPSEL_MASK,
+ .def_val = 38000000,
+ },
+ {
+ .name = "awinic,ocp-microamp",
+ .lookup = aw99706_dt_property_lookup,
+ .lookup_tbl = aw99703_ocp_tbl,
+ .tbl_size = ARRAY_SIZE(aw99703_ocp_tbl),
+ .reg = AW99703_BSTCTR1_REG, .mask = AW99703_OCPSEL_MASK,
+ .def_val = 2700000,
+ },
+ {
+ .name = "awinic,inductor-nanohenry",
+ .lookup = aw99706_dt_property_lookup,
+ .lookup_tbl = aw99703_inductor_tbl,
+ .tbl_size = ARRAY_SIZE(aw99703_inductor_tbl),
+ .reg = AW99703_BSTCTR2_REG, .mask = AW99703_IDCTSEL_MASK,
+ .def_val = 4700,
+ },
+ {
+ .name = "led-max-microamp",
+ .lookup = aw99706_dt_property_range,
+ .min = 4800, .max = 29600, .step = 800,
+ .reg = AW99703_LEDCUR_REG, .mask = AW99703_BLFS_MASK,
+ .def_val = 20000,
+ },
+};
+
struct reg_init_data {
u8 reg;
u8 mask;
@@ -179,14 +264,18 @@ struct reg_init_data {
#define AW99706_MAX_INIT_REGS 8
+struct aw99706_device;
+
struct aw99706_chip_data {
const char *bl_name;
+ void (*dt_parse_extra)(struct aw99706_device *aw);
const struct regmap_config *regmap_config;
const struct aw99706_dt_prop *dt_props;
u8 num_dt_props;
u8 id_reg;
u8 id;
u32 max_brightness;
+ unsigned int hwen_delay_us;
u8 brt_msb_reg;
u8 brt_lsb_reg;
u8 brt_lsb_bits;
@@ -311,6 +400,9 @@ static void aw99706_dt_parse(struct aw99706_device *aw,
val << __ffs(prop->mask));
}
+ if (chip->dt_parse_extra)
+ chip->dt_parse_extra(aw);
+
brt = chip->max_brightness >> 1;
max_brt = chip->max_brightness;
device_property_read_u32(aw->dev, "default-brightness", &brt);
@@ -326,6 +418,38 @@ static void aw99706_dt_parse(struct aw99706_device *aw,
bl_props->max_brightness = max_brt;
}
+static void aw99703_dt_parse_extra(struct aw99706_device *aw)
+{
+ u32 sources[3];
+ u8 channels = 0;
+ int count, i;
+
+ count = device_property_count_u32(aw->dev, "led-sources");
+ if (count > 0 && count <= ARRAY_SIZE(sources) &&
+ !device_property_read_u32_array(aw->dev, "led-sources", sources,
+ count)) {
+ for (i = 0; i < count; i++) {
+ if (sources[i] > 2) {
+ dev_warn(aw->dev, "invalid led-sources, enabling all strings\n");
+ channels = 0;
+ break;
+ }
+ channels |= BIT(sources[i]);
+ }
+ }
+ if (!channels)
+ channels = AW99703_CHANNEL_MASK;
+
+ aw99706_add_init(aw, AW99703_LEDCUR_REG, AW99703_CHANNEL_MASK, channels);
+
+ aw99706_add_init(aw, AW99703_MODE_REG, AW99703_PDIS_MASK,
+ device_property_read_bool(aw->dev, "awinic,pwm-input") ?
+ 0 : AW99703_PDIS_MASK);
+
+ aw99706_add_init(aw, AW99703_MODE_REG, AW99703_MAP_LINEAR_MASK,
+ AW99703_MAP_LINEAR_MASK);
+}
+
static int aw99706_hw_init(struct aw99706_device *aw)
{
int ret, i;
@@ -410,6 +534,36 @@ static const struct backlight_ops aw99706_bl_ops = {
.update_status = aw99706_bl_update_status,
};
+static bool aw99703_readable_reg(struct device *dev, unsigned int reg)
+{
+ switch (reg) {
+ case AW99703_ID_REG:
+ case AW99703_MODE_REG ... AW99703_FLAGS2_REG:
+ case AW99703_FLAGS3_REG:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static bool aw99703_writeable_reg(struct device *dev, unsigned int reg)
+{
+ switch (reg) {
+ case AW99703_SFTRST_REG ... AW99703_AFLOW_REG:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static const struct regmap_config aw99703_regmap_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+ .max_register = AW99703_REG_MAX,
+ .writeable_reg = aw99703_writeable_reg,
+ .readable_reg = aw99703_readable_reg,
+};
+
static const struct regmap_config aw99706_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
@@ -436,6 +590,7 @@ static int aw99706_probe(struct i2c_client *client)
struct aw99706_device *aw;
struct backlight_device *bl_dev;
struct backlight_properties props = {};
+ const char *name;
int ret = 0;
aw = devm_kzalloc_obj(dev, *aw);
@@ -456,12 +611,19 @@ static int aw99706_probe(struct i2c_client *client)
aw99706_dt_parse(aw, &props);
- aw->hwen_gpio = devm_gpiod_get(aw->dev, "enable", GPIOD_OUT_LOW);
+ ret = devm_regulator_get_enable_optional(dev, "vin");
+ if (ret < 0 && ret != -ENODEV)
+ return dev_err_probe(dev, ret, "Failed to enable vin supply\n");
+
+ aw->hwen_gpio = devm_gpiod_get_optional(aw->dev, "enable",
+ GPIOD_OUT_LOW);
if (IS_ERR(aw->hwen_gpio))
return dev_err_probe(dev, PTR_ERR(aw->hwen_gpio),
"Failed to get enable gpio\n");
gpiod_set_value_cansleep(aw->hwen_gpio, 1);
+ if (aw->hwen_gpio && aw->chip->hwen_delay_us)
+ fsleep(aw->chip->hwen_delay_us);
ret = aw99706_chip_id_read(aw);
if (ret != aw->chip->id) {
@@ -479,7 +641,10 @@ static int aw99706_probe(struct i2c_client *client)
props.type = BACKLIGHT_RAW;
props.scale = BACKLIGHT_SCALE_LINEAR;
- bl_dev = devm_backlight_device_register(dev, aw->chip->bl_name, dev,
+ if (device_property_read_string(dev, "label", &name))
+ name = aw->chip->bl_name;
+
+ bl_dev = devm_backlight_device_register(dev, name, dev,
aw, &aw99706_bl_ops, &props);
if (IS_ERR(bl_dev)) {
ret = dev_err_probe(dev, PTR_ERR(bl_dev),
@@ -539,13 +704,34 @@ static const struct aw99706_chip_data aw99706_chip = {
.en_val = AW99706_BACKLIGHT_EN_MASK,
};
+static const struct aw99706_chip_data aw99703_chip = {
+ .bl_name = "aw99703-backlight",
+ .dt_parse_extra = aw99703_dt_parse_extra,
+ .regmap_config = &aw99703_regmap_config,
+ .dt_props = aw99703_dt_props,
+ .num_dt_props = ARRAY_SIZE(aw99703_dt_props),
+ .id_reg = AW99703_ID_REG,
+ .id = AW99703_ID,
+ .max_brightness = AW99703_MAX_BRT_LVL,
+ .hwen_delay_us = AW99703_HWEN_DELAY_US,
+ .brt_msb_reg = AW99703_LEDMSB_REG,
+ .brt_lsb_reg = AW99703_LEDLSB_REG,
+ .brt_lsb_bits = 3,
+ .brt_lsb_first = true,
+ .en_reg = AW99703_MODE_REG,
+ .en_mask = AW99703_WORKMODE_MASK,
+ .en_val = AW99703_WORKMODE_BACKLIGHT,
+};
+
static const struct i2c_device_id aw99706_ids[] = {
+ { .name = "aw99703", .driver_data = (kernel_ulong_t)&aw99703_chip },
{ .name = "aw99706", .driver_data = (kernel_ulong_t)&aw99706_chip },
{ }
};
MODULE_DEVICE_TABLE(i2c, aw99706_ids);
static const struct of_device_id aw99706_match_table[] = {
+ { .compatible = "awinic,aw99703", .data = &aw99703_chip },
{ .compatible = "awinic,aw99706", .data = &aw99706_chip },
{ }
};
@@ -565,4 +751,4 @@ static struct i2c_driver aw99706_i2c_driver = {
module_i2c_driver(aw99706_i2c_driver);
MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("BackLight driver for aw99706");
+MODULE_DESCRIPTION("BackLight driver for aw99706 and aw99703");
--
2.55.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-12-05 0:51 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05 0:51 [PATCH v2 0/6] backlight: aw99706: Add Awinic AW99703 support Luka Panio
2026-12-05 0:51 ` [PATCH v2 1/6] dt-bindings: leds: backlight: aw99706: Use standard led-max-microamp Luka Panio
2026-12-05 0:51 ` [PATCH v2 2/6] dt-bindings: leds: backlight: Add Awinic AW99703 backlight Luka Panio
2026-12-05 0:51 ` [PATCH v2 3/6] backlight: aw99706: Enable the chip before reading its ID Luka Panio
2026-12-05 0:51 ` [PATCH v2 4/6] backlight: aw99706: Introduce per-chip data Luka Panio
2026-12-05 0:51 ` [PATCH v2 5/6] backlight: aw99706: Support the led-max-microamp property Luka Panio
2026-12-05 0:51 ` [PATCH v2 6/6] backlight: aw99706: Add AW99703 support Luka Panio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox