Backlight debug
下面是背光驱动芯片原理图:
1. Set the VSYS output from 8606.
The 8606 is controlled though i2c bus. The i2c address is 0x20, it's really not sure about the chip because the address can be changed. Sometimes is 0x22. It works at last , I read the register value out of the chip. And so that can make sure the value is right.
2. Set the V_buck2 and V_buck3 .
the v_buck2 is the VDDIO =1.8v, and the v_buck3 is the I2C bus pull-up power source. So I think they all need to be set.
3. Set the lm3535.
At first , the chip should be reset. We use the GPIO58 to reset the lm3535.
Then need set 2 control regs , 0x10 and 0x20. And the brightness is conrtolled by the group A, 0xA0.
int lm3535_initchip(void)
{
//set v_buck3 = 1.8v
sanremo_write(0x26, 0x64);
//set VDDIO = 1.8v
sanremo_write(0x25, 0x24);
//set vsys
portofino_write(0x15, 0x02);
portofino_write(0x16, 0x10);
portofino_write(0x00, 0x0f);
portofino_write(0x10, 0x0e);
//reset lm3535
writel(0xd0c1,0xd401e2fc);//config gpio58 to fun1(gpio use)
gpio_direction_output(mfp_to_gpio(MFP_PIN_GPIO58),1);//LCD BACKLIGHT CONTROL
Delay(10000);
// set the lm3535 regs
lm3535_write(LM3535_DIOD_EN, 0x3f);
lm3535_write(LM3535_CONFIG, 0x0c);
return 0;
}
4. the brightness setting as follows.
void lm3535_brightness_setting(u8 val)
{
AddMessage((UINT8_T*) ("lm3535 set brightness !\0"));
lm3535_write(LM3535_A_LUM, val&0x7f);
}