switch (led->id) { case DA9030_ID_LED_1: case DA9030_ID_LED_2: case DA9030_ID_LED_3: case DA9030_ID_LED_4: case DA9030_ID_LED_PC:
offset = DA9030_LED_OFFSET(led->id);
val = led->flags & ~0x87;
val |= value ? 0x80 : 0; /* EN bit */
val |= (0x7 - (value >> 5)) & 0x7; /* PWM<2:0> */
ret = da903x_write(led->master, DA9030_LED1_CONTROL + offset,
val); break; case DA9030_ID_VIBRA:
val = led->flags & ~0x80;
val |= value ? 0x80 : 0; /* EN bit */
ret = da903x_write(led->master, DA9030_MISC_CONTROL_A, val); break; case DA9034_ID_LED_1: case DA9034_ID_LED_2:
offset = DA9034_LED_OFFSET(led->id);
val = (value * 0x5f / LED_FULL) & 0x7f;
val |= (led->flags & DA9034_LED_RAMP) ? 0x80 : 0;
ret = da903x_write(led->master, DA9034_LED1_CONTROL + offset,
val); break; case DA9034_ID_VIBRA:
val = value & 0xfe;
ret = da903x_write(led->master, DA9034_VIBRA, val); break;
}
if (!((id >= DA9030_ID_LED_1 && id <= DA9030_ID_VIBRA) ||
(id >= DA9034_ID_LED_1 && id <= DA9034_ID_VIBRA))) {
dev_err(&pdev->dev, "invalid LED ID (%d) specified\n", id); return -EINVAL;
}
led = devm_kzalloc(&pdev->dev, sizeof(struct da903x_led), GFP_KERNEL); if (!led) return -ENOMEM;
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.