Modify the Screen Backlight Driver

Modify the Copied Driver File

Here, we use the aw9364 backlight driver as an example:

Initialization

In the aw9364_init function, the control pin LCD_BACKLIGHT_CONTROL_PIN is initialized as a GPIO output, and it is set to low (turn off the backlight).

Set Backlight Brightness

In the callback function backligt_set, the brightness percentage passed from the upper layer is converted (based on the brightness levels supported by the backlight IC) and then passed to the sif_aw9364_set_backlight function to set the brightness.

Read Backlight Brightness

In the callback function backligt_get, the brightness is returned using the variable aw9364_bl, as this backlight chip does not support reading the brightness level.