From 14c482ddcea91bbacf95aaabdbb6f2e664fb80e7 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Wed, 5 Jun 2024 15:20:27 +0300 Subject: [PATCH] bdk: display: remove max77620 gpio 7 enable It is actually not used at all. So do not configure it to save power. --- bdk/display/di.c | 18 ++++++------------ bdk/soc/hw_init.c | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/bdk/display/di.c b/bdk/display/di.c index 4de7e7a..6965343 100644 --- a/bdk/display/di.c +++ b/bdk/display/di.c @@ -373,13 +373,10 @@ void display_init() // Get Chip ID. bool tegra_t210 = hw_get_chip_id() == GP_HIDREV_MAJOR_T210; - // Enable LCD DVDD. + // Enable DSI AVDD. max7762x_regulator_set_voltage(REGULATOR_LDO0, 1200000); max7762x_regulator_enable(REGULATOR_LDO0, true); - if (tegra_t210) - max77620_config_gpio(7, MAX77620_GPIO_OUTPUT_ENABLE); // T210: LD0 -> GPIO7 -> LCD. - // Enable Display Interface specific clocks. CLOCK(CLK_RST_CONTROLLER_RST_DEV_H_CLR) = BIT(CLK_H_MIPI_CAL) | BIT(CLK_H_DSI); CLOCK(CLK_RST_CONTROLLER_CLK_ENB_H_SET) = BIT(CLK_H_MIPI_CAL) | BIT(CLK_H_DSI); @@ -791,6 +788,10 @@ skip_panel_deinit: { gpio_write(GPIO_PORT_I, GPIO_PIN_1, GPIO_LOW); // LCD AVDD -5.4V disable. gpio_write(GPIO_PORT_I, GPIO_PIN_0, GPIO_LOW); // LCD AVDD +5.4V disable. + + // Make sure LCD PWM backlight pin is in PWM0 mode. + gpio_config(GPIO_PORT_V, GPIO_PIN_0, GPIO_MODE_SPIO); // Backlight PWM. + PINMUX_AUX(PINMUX_AUX_LCD_BL_PWM) = PINMUX_TRISTATE | PINMUX_PULL_DOWN | 1; // Set PWM0 mode. } usleep(10000); @@ -805,14 +806,7 @@ skip_panel_deinit: DSI_PAD_CONTROL_VS1_PDIO_CLK | DSI_PAD_CONTROL_VS1_PDIO(0xF); DSI(_DSIREG(DSI_POWER_CONTROL)) = 0; - // Switch LCD PWM backlight pin to special function mode and enable PWM0 mode. - if (!_nx_aula) - { - gpio_config(GPIO_PORT_V, GPIO_PIN_0, GPIO_MODE_SPIO); // Backlight PWM. - PINMUX_AUX(PINMUX_AUX_LCD_BL_PWM) = PINMUX_TRISTATE | PINMUX_PULL_DOWN | 1; // Set PWM0 mode. - } - - // Disable LCD DVDD. + // Disable DSI AVDD. max7762x_regulator_enable(REGULATOR_LDO0, false); } diff --git a/bdk/soc/hw_init.c b/bdk/soc/hw_init.c index f3caa61..7135d6a 100644 --- a/bdk/soc/hw_init.c +++ b/bdk/soc/hw_init.c @@ -300,7 +300,7 @@ static void _config_regulators(bool tegra_t210, bool nx_hoag) gpio_write(GPIO_PORT_E, GPIO_PIN_4, GPIO_LOW); sd_power_cycle_time_start = get_tmr_ms(); - // Disable LCD DVDD to make sure it's in a reset state. + // Disable DSI AVDD to make sure it's in a reset state. max7762x_regulator_enable(REGULATOR_LDO0, false); i2c_send_byte(I2C_5, MAX77620_I2C_ADDR, MAX77620_REG_CNFGBBC, MAX77620_CNFGBBC_RESISTOR_1K);