* [PATCH 0/2] backlight: add support for Silergy SY7758
@ 2026-05-10 17:08 Alexandre Hamamdjian via B4 Relay
2026-05-10 17:08 ` [PATCH 1/2] dt-bindings: leds: backlight: add " Alexandre Hamamdjian via B4 Relay
2026-05-10 17:08 ` [PATCH 2/2] backlight: sy7758: add Silergy SY7758 backlight driver Alexandre Hamamdjian via B4 Relay
0 siblings, 2 replies; 3+ messages in thread
From: Alexandre Hamamdjian via B4 Relay @ 2026-05-10 17:08 UTC (permalink / raw)
To: Philippe Simons, Lee Jones, Daniel Thompson, Jingoo Han,
Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Helge Deller
Cc: dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev,
Alexandre Hamamdjian
The Silergy SY7758 is an I2C-controlled multi-channel LED backlight
driver used to drive the edge-lit LED strings of LCD panels. It is
present on the Ayaneo Pocket DS handheld, where it drives the panel
backlight, and is required before the panel can be lit.
This series adds the device tree binding for the new "silergy,sy7758"
compatible and the matching driver. The driver registers a backlight
class device with a 12-bit linear brightness range and programs the
chip's mode and current configuration registers on the first non-zero
brightness update.
The Ayaneo Pocket DS device tree, posted as a separate series, depends
on the binding introduced here to describe its panel backlight.
Signed-off-by: Alexandre Hamamdjian <azkali.limited@gmail.com>
---
Alexandre Hamamdjian (2):
dt-bindings: leds: backlight: add Silergy SY7758
backlight: sy7758: add Silergy SY7758 backlight driver
.../bindings/leds/backlight/silergy,sy7758.yaml | 47 ++++++
MAINTAINERS | 7 +
drivers/video/backlight/Kconfig | 14 ++
drivers/video/backlight/Makefile | 1 +
drivers/video/backlight/sy7758.c | 169 +++++++++++++++++++++
5 files changed, 238 insertions(+)
---
base-commit: e98d21c170b01ddef366f023bbfcf6b31509fa83
change-id: 20260510-sy7758-e46d85fd0876
Best regards,
--
Alexandre Hamamdjian <azkali.limited@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] dt-bindings: leds: backlight: add Silergy SY7758
2026-05-10 17:08 [PATCH 0/2] backlight: add support for Silergy SY7758 Alexandre Hamamdjian via B4 Relay
@ 2026-05-10 17:08 ` Alexandre Hamamdjian via B4 Relay
2026-05-10 17:08 ` [PATCH 2/2] backlight: sy7758: add Silergy SY7758 backlight driver Alexandre Hamamdjian via B4 Relay
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Hamamdjian via B4 Relay @ 2026-05-10 17:08 UTC (permalink / raw)
To: Philippe Simons, Lee Jones, Daniel Thompson, Jingoo Han,
Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Helge Deller
Cc: dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev,
Alexandre Hamamdjian
From: Alexandre Hamamdjian <azkali.limited@gmail.com>
The Silergy SY7758 is an I2C-controlled multi-channel LED backlight
driver typically used to drive the edge-lit LED strings of LCD panels
in handheld and embedded devices. Brightness is programmed as a 12-bit
linear value through two 8-bit registers.
Document the binding for the new compatible "silergy,sy7758" so it can
be referenced by board device trees and the matching driver, and add a
MAINTAINERS entry covering both the binding and the upcoming driver.
Co-developed-by: Philippe Simons <simons.philippe@gmail.com>
Signed-off-by: Philippe Simons <simons.philippe@gmail.com>
Signed-off-by: Alexandre Hamamdjian <azkali.limited@gmail.com>
---
.../bindings/leds/backlight/silergy,sy7758.yaml | 47 ++++++++++++++++++++++
MAINTAINERS | 7 ++++
2 files changed, 54 insertions(+)
diff --git a/Documentation/devicetree/bindings/leds/backlight/silergy,sy7758.yaml b/Documentation/devicetree/bindings/leds/backlight/silergy,sy7758.yaml
new file mode 100644
index 000000000000..408029e19e2e
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/backlight/silergy,sy7758.yaml
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/backlight/silergy,sy7758.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Silergy SY7758 I2C LED backlight controller
+
+maintainers:
+ - Alexandre Hamamdjian <azkali.limited@gmail.com>
+ - Philippe Simons <simons.philippe@gmail.com>
+
+description:
+ The Silergy SY7758 is an I2C-controlled multi-channel LED backlight
+ driver typically used to drive the edge-lit LED strings of LCD panels
+ in handheld and embedded devices. Brightness is programmed as a 12-bit
+ linear value through two 8-bit registers.
+
+allOf:
+ - $ref: common.yaml#
+
+properties:
+ compatible:
+ const: silergy,sy7758
+
+ reg:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ backlight@36 {
+ compatible = "silergy,sy7758";
+ reg = <0x36>;
+ max-brightness = <4080>;
+ default-brightness = <1500>;
+ };
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index f877e5aaf2c7..9c132394ca41 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -24561,6 +24561,13 @@ S: Maintained
F: drivers/input/touchscreen/silead.c
F: drivers/platform/x86/touchscreen_dmi.c
+SILERGY SY7758 BACKLIGHT DRIVER
+M: Alexandre Hamamdjian <azkali.limited@gmail.com>
+M: Philippe Simons <simons.philippe@gmail.com>
+S: Maintained
+F: Documentation/devicetree/bindings/leds/backlight/silergy,sy7758.yaml
+F: drivers/video/backlight/sy7758.c
+
SILICON LABS WIRELESS DRIVERS (for WFxxx series)
M: Jérôme Pouiller <jerome.pouiller@silabs.com>
L: linux-wireless@vger.kernel.org
--
2.54.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] backlight: sy7758: add Silergy SY7758 backlight driver
2026-05-10 17:08 [PATCH 0/2] backlight: add support for Silergy SY7758 Alexandre Hamamdjian via B4 Relay
2026-05-10 17:08 ` [PATCH 1/2] dt-bindings: leds: backlight: add " Alexandre Hamamdjian via B4 Relay
@ 2026-05-10 17:08 ` Alexandre Hamamdjian via B4 Relay
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Hamamdjian via B4 Relay @ 2026-05-10 17:08 UTC (permalink / raw)
To: Philippe Simons, Lee Jones, Daniel Thompson, Jingoo Han,
Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Helge Deller
Cc: dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev,
Alexandre Hamamdjian
From: Alexandre Hamamdjian <azkali.limited@gmail.com>
Add a driver for the Silergy SY7758 I2C-controlled multi-channel LED
backlight controller. The chip drives the edge-lit LED strings of LCD
panels in handheld and embedded devices, and is for example present on
the Ayaneo Pocket DS handheld where it drives the panel backlight.
The driver registers a backlight class device with a 12-bit linear
brightness range. On the first non-zero update, the chip's mode and
current configuration registers are programmed; subsequent brightness
updates only rewrite the two brightness registers. A mutex serialises
concurrent updates against the deferred init path.
Co-developed-by: Philippe Simons <simons.philippe@gmail.com>
Signed-off-by: Philippe Simons <simons.philippe@gmail.com>
Signed-off-by: Alexandre Hamamdjian <azkali.limited@gmail.com>
---
drivers/video/backlight/Kconfig | 14 ++++
drivers/video/backlight/Makefile | 1 +
drivers/video/backlight/sy7758.c | 169 +++++++++++++++++++++++++++++++++++++++
3 files changed, 184 insertions(+)
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index a7a3fbaf7c29..c529d2861525 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -461,6 +461,20 @@ config BACKLIGHT_SKY81452
To compile this driver as a module, choose M here: the module will
be called sky81452-backlight
+config BACKLIGHT_SY7758
+ tristate "Backlight Driver for Silergy SY7758"
+ depends on I2C
+ select REGMAP_I2C
+ help
+ This enables support for the Silergy SY7758 I2C-controlled
+ multi-channel LED backlight driver, commonly used to drive the
+ edge-lit LED strings of LCD panels in handheld and embedded
+ devices. The driver exposes a 12-bit linear brightness control
+ through the standard backlight class.
+
+ To compile this driver as a module, choose M here: the module
+ will be called sy7758.
+
config BACKLIGHT_TPS65217
tristate "TPS65217 Backlight"
depends on MFD_TPS65217
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index 794820a98ed4..00d3e379b297 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -57,6 +57,7 @@ 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_SY7758) += sy7758.o
obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o
obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o
obj-$(CONFIG_BACKLIGHT_ARCXCNN) += arcxcnn_bl.o
diff --git a/drivers/video/backlight/sy7758.c b/drivers/video/backlight/sy7758.c
new file mode 100644
index 000000000000..6a318bd62030
--- /dev/null
+++ b/drivers/video/backlight/sy7758.c
@@ -0,0 +1,169 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Backlight driver for the Silergy sy7758
+ *
+ * Copyright (C) 2025 Kancy Joe <kancy2333@outlook.com>
+ */
+
+#include <linux/backlight.h>
+#include <linux/err.h>
+#include <linux/gpio/consumer.h>
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/regmap.h>
+
+#define DEFAULT_BRIGHTNESS 1500
+#define MAX_BRIGHTNESS 4080
+#define REG_MAX 0xa9
+
+#define BL_BRT_L 0x10
+#define BL_BRT_H 0x11
+
+static DEFINE_MUTEX(sy7758_update_backlight_mutex);
+
+struct sy7758 {
+ struct i2c_client *client;
+ struct regmap *regmap;
+ bool led_on;
+};
+
+static void sy7758_init(struct sy7758 *sydev);
+
+static const struct regmap_config sy7758_regmap_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+ .max_register = REG_MAX,
+};
+
+static int sy7758_write(struct sy7758 *sydev, unsigned int reg,
+ unsigned int val)
+{
+ return regmap_write(sydev->regmap, reg, val);
+}
+
+static int sy7758_backlight_update_status(struct backlight_device *backlight_dev)
+{
+ struct sy7758 *sydev = bl_get_data(backlight_dev);
+ unsigned int brightness = backlight_get_brightness(backlight_dev);
+
+ mutex_lock(&sy7758_update_backlight_mutex);
+
+ if (!sydev->led_on && brightness > 0) {
+ sy7758_init(sydev);
+ sydev->led_on = true;
+ } else if (brightness == 0) {
+ sydev->led_on = false;
+ }
+
+ sy7758_write(sydev, BL_BRT_L, brightness & 0xf0);
+
+ sy7758_write(sydev, BL_BRT_H, (brightness >> 8) & 0xf);
+
+ mutex_unlock(&sy7758_update_backlight_mutex);
+ return 0;
+}
+
+static const struct backlight_ops sy7758_backlight_ops = {
+ .options = BL_CORE_SUSPENDRESUME,
+ .update_status = sy7758_backlight_update_status,
+};
+
+static void sy7758_init(struct sy7758 *sydev)
+{
+ sy7758_write(sydev, 0x01, 0x85);
+ sy7758_write(sydev, 0x10, 0x00);
+ sy7758_write(sydev, 0x11, 0x00);
+ sy7758_write(sydev, 0xa5, 0x64);
+ sy7758_write(sydev, 0xa0, 0x55);
+ sy7758_write(sydev, 0xa1, 0x9a);
+ sy7758_write(sydev, 0xa9, 0x80);
+ sy7758_write(sydev, 0xa2, 0x28);
+
+ usleep_range(10000, 11000);
+
+ sy7758_write(sydev, 0x10, 0x40);
+ sy7758_write(sydev, 0x11, 0x01);
+ // Max brightness
+ // 0x10: 0xf0 Low
+ // 0x11: 0x0f High
+
+ // Min brightness
+ // 0x10: 0x10 Low
+ // 0x11: 0x00 High
+ sydev->led_on = true;
+}
+
+static int sy7758_probe(struct i2c_client *client)
+{
+ struct backlight_device *backlight_dev;
+ struct backlight_properties props;
+ struct sy7758 *sydev;
+
+ sydev = devm_kzalloc(&client->dev, sizeof(*sydev), GFP_KERNEL);
+ if (!sydev)
+ return -ENOMEM;
+
+ sydev->client = client;
+ sydev->regmap = devm_regmap_init_i2c(client, &sy7758_regmap_config);
+ if (IS_ERR(sydev->regmap))
+ return dev_err_probe(&client->dev, PTR_ERR(sydev->regmap),
+ "failed to init regmap\n");
+
+ memset(&props, 0, sizeof(props));
+ props.type = BACKLIGHT_RAW;
+ props.max_brightness = MAX_BRIGHTNESS;
+ props.brightness = DEFAULT_BRIGHTNESS;
+ props.scale = BACKLIGHT_SCALE_LINEAR;
+
+ backlight_dev = devm_backlight_device_register(&client->dev, "sy7758-backlight",
+ &client->dev, sydev, &sy7758_backlight_ops, &props);
+ if (IS_ERR(backlight_dev))
+ return dev_err_probe(&client->dev, PTR_ERR(backlight_dev),
+ "failed to register backlight device\n");
+
+ sy7758_init(sydev);
+
+ i2c_set_clientdata(client, backlight_dev);
+ backlight_update_status(backlight_dev);
+
+ return 0;
+}
+
+static void sy7758_remove(struct i2c_client *client)
+{
+ struct backlight_device *backlight_dev = i2c_get_clientdata(client);
+
+ backlight_dev->props.brightness = 0;
+ backlight_update_status(backlight_dev);
+}
+
+static const struct i2c_device_id sy7758_ids[] = {
+ { "sy7758" },
+ {}
+};
+MODULE_DEVICE_TABLE(i2c, sy7758_ids);
+
+static const struct of_device_id sy7758_match_table[] = {
+ {
+ .compatible = "silergy,sy7758",
+ },
+ {},
+};
+MODULE_DEVICE_TABLE(of, sy7758_match_table);
+
+static struct i2c_driver sy7758_driver = {
+ .driver = {
+ .name = "sy7758",
+ .of_match_table = sy7758_match_table,
+ },
+ .probe = sy7758_probe,
+ .remove = sy7758_remove,
+ .id_table = sy7758_ids,
+};
+
+module_i2c_driver(sy7758_driver);
+
+MODULE_DESCRIPTION("Silergy sy7758 Backlight Driver");
+MODULE_AUTHOR("Kancy Joe <kancy2333@outlook.com>");
+MODULE_LICENSE("GPL");
--
2.54.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-10 17:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-10 17:08 [PATCH 0/2] backlight: add support for Silergy SY7758 Alexandre Hamamdjian via B4 Relay
2026-05-10 17:08 ` [PATCH 1/2] dt-bindings: leds: backlight: add " Alexandre Hamamdjian via B4 Relay
2026-05-10 17:08 ` [PATCH 2/2] backlight: sy7758: add Silergy SY7758 backlight driver Alexandre Hamamdjian via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox