Skip to content

Commit

Permalink
tle8888: do not invert output value in PP mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dron0gus committed Feb 13, 2020
1 parent 413839f commit 342c624
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions firmware/hw_layer/drivers/gpio/tle8888.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,14 @@ static int tle8888_update_output(struct tle8888_priv *chip)
uint32_t out_data = chip->o_state;

/* calculate briconfig0 */
uint32_t out_high = out_data & chip->o_pp_mask;
uint32_t out_low = out_data & chip->o_pp_mask;
for (i = 20; i < 24; i++) {
if (out_high & BIT(i)) {
/* enable high-side switch mode */
if (out_low & BIT(i)) {
/* low-side switch mode */
} else {
/* else enable high-side switch mode */
briconfig0 |= BIT((i - 20) * 2);
}
/* else low-side switch mode */
}
/* TODO: set freewheeling bits in briconfig0? */

Expand Down

0 comments on commit 342c624

Please sign in to comment.