driver/ioexpander/pcal6408.c: Format with clang-format
BRANCH=none
TEST=none
* we don't have to read it via i2c transaction every time.
* Default value of interrupt mask register is 0xff.
*/
-uint8_t pcal6408_int_mask[] = {
- [0 ... (CONFIG_IO_EXPANDER_PORT_COUNT - 1)] = 0xff };
-
+uint8_t pcal6408_int_mask[] = { [0 ...(CONFIG_IO_EXPANDER_PORT_COUNT - 1)] =
+ 0xff };
static int pcal6408_read(int ioex, int reg, int *data)
{
int rv;
struct ioexpander_config_t *ioex_p = &ioex_config[ioex];
- rv = i2c_read8(ioex_p->i2c_host_port, ioex_p->i2c_addr_flags,
- reg, data);
+ rv = i2c_read8(ioex_p->i2c_host_port, ioex_p->i2c_addr_flags, reg,
+ data);
return rv;
}
@@ -44,8 +43,8 @@ static int pcal6408_write(int ioex, int reg, int data)
int rv;
struct ioexpander_config_t *ioex_p = &ioex_config[ioex];
- rv = i2c_write8(ioex_p->i2c_host_port, ioex_p->i2c_addr_flags,
- reg, data);
+ rv = i2c_write8(ioex_p->i2c_host_port, ioex_p->i2c_addr_flags, reg,
+ data);
return rv;
}
@@ -56,8 +55,7 @@ static int pcal6408_ioex_check_is_valid(int port, int mask)
return EC_ERROR_INVAL;
if (mask & ~PCAL6408_VALID_GPIO_MASK) {
- CPRINTF("GPIO%02d is not support in PCAL6408\n",
- __fls(mask));
+ CPRINTF("GPIO%02d is not support in PCAL6408\n", __fls(mask));
return EC_ERROR_INVAL;
}
@@ -185,7 +183,6 @@ static int pcal6408_ioex_set_flags_by_mask(int ioex, int port, int mask,
return EC_ERROR_INVAL;
}
-
if ((flags & (GPIO_INT_F_RISING | GPIO_INT_F_FALLING)) &&
!(flags & GPIO_INPUT)) {
CPRINTF("Interrupt pin must be GPIO_INPUT.\n");
@@ -335,9 +332,7 @@ int pcal6408_ioex_event_handler(int ioex)
return EC_SUCCESS;
for (i = 0, g = ioex_list; i < ioex_ih_count; i++, g++) {
-
- if (ioex == g->ioex && 0 == g->port &&
- (int_status & g->mask)) {
+ if (ioex == g->ioex && 0 == g->port && (int_status & g->mask)) {
ioex_irq_handlers[i](i + IOEX_SIGNAL_START);
int_status &= ~g->mask;
if (!int_status)
