diff --git a/core/embed/io/backlight/stm32/backlight_pin.c b/core/embed/io/backlight/stm32/backlight_pin.c
new file mode 100644
index 0000000000..1006c75f94
--- /dev/null
+++ b/core/embed/io/backlight/stm32/backlight_pin.c
@@ -0,0 +1,103 @@
+/*
+ * This file is part of the Trezor project, https://trezor.io/
+ *
+ * Copyright (c) SatoshiLabs
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#include
+
+#include
+#include
+
+typedef struct {
+ // Set if driver is initialized
+ bool initialized;
+ // Current backlight level in range 0-255
+ int current_level;
+
+} backlight_driver_t;
+
+static backlight_driver_t g_backlight_driver = {
+ .initialized = false,
+};
+
+static void backlight_on(void) {
+ GPIO_InitTypeDef GPIO_InitStructure = {0};
+ GPIO_InitStructure.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStructure.Pull = GPIO_PULLUP;
+ GPIO_InitStructure.Pin = BACKLIGHT_PIN_PIN;
+ GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(BACKLIGHT_PIN_PORT, &GPIO_InitStructure);
+}
+
+static void backlight_off(void) {
+ GPIO_InitTypeDef GPIO_InitStructure = {0};
+ GPIO_InitStructure.Mode = GPIO_MODE_ANALOG;
+ GPIO_InitStructure.Pull = GPIO_NOPULL;
+ GPIO_InitStructure.Pin = BACKLIGHT_PIN_PIN;
+ GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(BACKLIGHT_PIN_PORT, &GPIO_InitStructure);
+}
+
+void backlight_init(backlight_action_t action) {
+ backlight_driver_t *drv = &g_backlight_driver;
+
+ if (drv->initialized) {
+ return;
+ }
+
+ BACKLIGHT_PIN_CLK_ENABLE();
+
+ if (action == BACKLIGHT_RESET) {
+ backlight_off();
+ };
+
+ drv->initialized = true;
+}
+
+void backlight_deinit(backlight_action_t action) {
+ backlight_driver_t *drv = &g_backlight_driver;
+ if (!drv->initialized) {
+ return;
+ }
+
+ if (action == BACKLIGHT_RESET) {
+ backlight_off();
+ }
+}
+
+int backlight_set(int val) {
+ backlight_driver_t *drv = &g_backlight_driver;
+ if (!drv->initialized) {
+ return 0;
+ }
+
+ if (val > 0) {
+ backlight_on();
+ } else {
+ backlight_off();
+ }
+ drv->current_level = val;
+ return val;
+}
+
+int backlight_get(void) {
+ backlight_driver_t *drv = &g_backlight_driver;
+ if (!drv->initialized) {
+ return 0;
+ }
+ return drv->current_level;
+}
diff --git a/core/embed/io/display/ltdc_dsi/display_driver.c b/core/embed/io/display/ltdc_dsi/display_driver.c
index cae61eda25..b07dea958c 100644
--- a/core/embed/io/display/ltdc_dsi/display_driver.c
+++ b/core/embed/io/display/ltdc_dsi/display_driver.c
@@ -356,16 +356,6 @@ bool display_init(display_content_mode_t mode) {
systick_delay_ms(120);
#endif
-#ifdef DISPLAY_BACKLIGHT_PIN
- DISPLAY_BACKLIGHT_CLK_ENABLE();
- /* Configure LCD Backlight Pin */
- GPIO_InitStructure.Mode = GPIO_MODE_INPUT;
- GPIO_InitStructure.Pull = GPIO_PULLUP;
- GPIO_InitStructure.Pin = DISPLAY_BACKLIGHT_PIN;
- GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW;
- HAL_GPIO_Init(DISPLAY_BACKLIGHT_PORT, &GPIO_InitStructure);
-#endif
-
#ifdef USE_BACKLIGHT
backlight_init(BACKLIGHT_RESET);
#endif
diff --git a/core/embed/models/D002/boards/stm32u5g9j-dk.h b/core/embed/models/D002/boards/stm32u5g9j-dk.h
index 32ee4cb03d..3d5857db10 100644
--- a/core/embed/models/D002/boards/stm32u5g9j-dk.h
+++ b/core/embed/models/D002/boards/stm32u5g9j-dk.h
@@ -9,9 +9,10 @@
#define DISPLAY_RESET_PIN GPIO_PIN_5
#define DISPLAY_RESET_PORT GPIOD
#define DISPLAY_RESET_CLK_ENA __HAL_RCC_GPIOD_CLK_ENABLE
-#define DISPLAY_BACKLIGHT_PIN GPIO_PIN_6
-#define DISPLAY_BACKLIGHT_PORT GPIOI
-#define DISPLAY_BACKLIGHT_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
+
+#define BACKLIGHT_PIN_PIN GPIO_PIN_6
+#define BACKLIGHT_PIN_PORT GPIOI
+#define BACKLIGHT_PIN_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define I2C_COUNT 1
#define I2C_INSTANCE_0 I2C5
diff --git a/core/site_scons/models/D002/discovery2.py b/core/site_scons/models/D002/discovery2.py
index 51265b7e5d..1a1bc8ea33 100644
--- a/core/site_scons/models/D002/discovery2.py
+++ b/core/site_scons/models/D002/discovery2.py
@@ -48,6 +48,11 @@ def configure(
]
paths += ["embed/io/display/inc"]
+ features_available.append("backlight")
+ defines += [("USE_BACKLIGHT", "1")]
+ sources += ["embed/io/backlight/stm32/backlight_pin.c"]
+ paths += ["embed/io/backlight/inc"]
+
if "input" in features_wanted:
sources += ["embed/io/i2c_bus/stm32u5/i2c_bus.c"]
sources += ["embed/io/touch/sitronix/sitronix.c"]