Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6bf0d2c authored by Harald Welte's avatar Harald Welte Committed by Linus Torvalds
Browse files

viafb: cosmetic cleanup of function integrated_lvds_enable()



A humble attempt to simplify the coding style to improve readability

Signed-off-by: default avatarHarald Welte <HaraldWelte@viatech.com>
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Joseph Chan <JosephChan@via.com.tw>
Cc: Scott Fang <ScottFang@viatech.com.cn>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4562aea7
Loading
Loading
Loading
Loading
+14 −26
Original line number Diff line number Diff line
@@ -1134,45 +1134,33 @@ static void integrated_lvds_enable(struct lvds_setting_information
			    *plvds_setting_info,
			    struct lvds_chip_information *plvds_chip_info)
{
	bool turn_on_first_powersequence = false;
	bool turn_on_second_powersequence = false;

	DEBUG_MSG(KERN_INFO "integrated_lvds_enable, out_interface:%d\n",
		  plvds_chip_info->output_interface);
	if (plvds_setting_info->lcd_mode == LCD_SPWG)
		viafb_write_reg_mask(CRD2, VIACR, 0x00, BIT0 + BIT1);
	else
		viafb_write_reg_mask(CRD2, VIACR, 0x03, BIT0 + BIT1);
	if (INTERFACE_LVDS0LVDS1 == plvds_chip_info->output_interface)
		turn_on_first_powersequence = true;
	if (INTERFACE_LVDS0 == plvds_chip_info->output_interface)
		turn_on_first_powersequence = true;
	if (INTERFACE_LVDS1 == plvds_chip_info->output_interface)
		turn_on_second_powersequence = true;

	if (turn_on_second_powersequence) {
		/* Use second power sequence control: */

		/* Use hardware control power sequence. */
		viafb_write_reg_mask(CRD3, VIACR, 0, BIT0);

		/* Turn on back light. */
		viafb_write_reg_mask(CRD3, VIACR, 0, BIT6 + BIT7);

		/* Turn on hardware power sequence. */
		viafb_write_reg_mask(CRD4, VIACR, 0x02, BIT1);
	}
	if (turn_on_first_powersequence) {
	switch (plvds_chip_info->output_interface) {
	case INTERFACE_LVDS0LVDS1:
	case INTERFACE_LVDS0:
		/* Use first power sequence control: */

		/* Use hardware control power sequence. */
		viafb_write_reg_mask(CR91, VIACR, 0, BIT0);

		/* Turn on back light. */
		viafb_write_reg_mask(CR91, VIACR, 0, BIT6 + BIT7);

		/* Turn on hardware power sequence. */
		viafb_write_reg_mask(CR6A, VIACR, 0x08, BIT3);
		break;
	case INTERFACE_LVDS1:
		/* Use second power sequence control: */
		/* Use hardware control power sequence. */
		viafb_write_reg_mask(CRD3, VIACR, 0, BIT0);
		/* Turn on back light. */
		viafb_write_reg_mask(CRD3, VIACR, 0, BIT6 + BIT7);
		/* Turn on hardware power sequence. */
		viafb_write_reg_mask(CRD4, VIACR, 0x02, BIT1);
		break;
	}

	/* Turn DFP High/Low pad on. */