gma: actually enable/disable backlight with new backlight control

In order to enable or disable the backlight on platforms with the new
backlight control, both enable bits in the PWM register and the
PP_CONTROL register need to bet set. Currently, the code only sets one
or the other.

Also, reverse the order in the disable case so that PWM gets disabled
after the backlight enable bit in PP_CONTROL.

Tested successfully on Clevo L141CU (CML).

Change-Id: Ib3827e744e86a9d29e09da3c5fd44d226f0b41b5
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/48770
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Michael Niewöhner 2020-12-20 15:44:13 +01:00 committed by Nico Huber
parent dde0630af4
commit 994971af45
1 changed files with 8 additions and 8 deletions

View File

@ -428,11 +428,11 @@ is
Registers.Set_Mask
(Register => BLC (Panel).CTL,
Mask => BXT_BLC_PWM_CTL_ENABLE);
else
Registers.Set_Mask
(Register => PP (Panel).CONTROL,
Mask => PCH_PP_CONTROL_BACKLIGHT_ENABLE);
end if;
Registers.Set_Mask
(Register => PP (Panel).CONTROL,
Mask => PCH_PP_CONTROL_BACKLIGHT_ENABLE);
end Backlight_On;
procedure Backlight_Off (Panel : Panel_Control) is
@ -443,14 +443,14 @@ is
pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
Registers.Unset_Mask
(Register => PP (Panel).CONTROL,
Mask => PCH_PP_CONTROL_BACKLIGHT_ENABLE);
if Config.Has_New_Backlight_Control then
Registers.Unset_Mask
(Register => BLC (Panel).CTL,
Mask => BXT_BLC_PWM_CTL_ENABLE);
else
Registers.Unset_Mask
(Register => PP (Panel).CONTROL,
Mask => PCH_PP_CONTROL_BACKLIGHT_ENABLE);
end if;
end Backlight_Off;