if (bl->props.power != BACKLIGHT_POWER_ON)
brightness = 0; if (bl->props.state & BL_CORE_FBBLANK)
brightness = 0; if (bl->props.state & BL_CORE_SUSPENDED)
brightness = 0;
if ((unsignedint)brightness > MAX_USER_VALUE)
brightness = MAX_USER_VALUE;
if (brightness == 0) { if (priv->old_state == PANDORABL_WAS_OFF) goto done;
/* first disable PWM0 output, then clock */
twl_i2c_read_u8(TWL4030_MODULE_INTBR, &r, TWL_INTBR_GPBR1);
r &= ~PWM0_ENABLE;
twl_i2c_write_u8(TWL4030_MODULE_INTBR, r, TWL_INTBR_GPBR1);
r &= ~PWM0_CLK_ENABLE;
twl_i2c_write_u8(TWL4030_MODULE_INTBR, r, TWL_INTBR_GPBR1);
goto done;
}
if (priv->old_state == PANDORABL_WAS_OFF) { /* * set PWM duty cycle to max. TPS61161 seems to use this * to calibrate it's PWM sensitivity when it starts.
*/
twl_i2c_write_u8(TWL_MODULE_PWM, MAX_VALUE, TWL_PWM0_OFF);
/* first enable clock, then PWM0 out */
twl_i2c_read_u8(TWL4030_MODULE_INTBR, &r, TWL_INTBR_GPBR1);
r &= ~PWM0_ENABLE;
r |= PWM0_CLK_ENABLE;
twl_i2c_write_u8(TWL4030_MODULE_INTBR, r, TWL_INTBR_GPBR1);
r |= PWM0_ENABLE;
twl_i2c_write_u8(TWL4030_MODULE_INTBR, r, TWL_INTBR_GPBR1);
/* * TI made it very easy to enable digital control, so easy that * it often triggers unintentionally and disabes PWM control, * so wait until 1 wire mode detection window ends.
*/
usleep_range(2000, 10000);
}
/* enable PWM function in pin mux */
twl_i2c_read_u8(TWL4030_MODULE_INTBR, &r, TWL_INTBR_PMBR1);
r &= ~TWL_PMBR1_PWM0_MUXMASK;
r |= TWL_PMBR1_PWM0;
twl_i2c_write_u8(TWL4030_MODULE_INTBR, r, TWL_INTBR_PMBR1);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.