ec/kontron/kempld: Reflow long lines
Change-Id: Ia5ad0715b742427dffa6c0c507269d904fe19bcb Signed-off-by: Maxim Polyakov <max.senia.poliak@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/45372 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
parent
aa99830c06
commit
7b27f4b62f
3 changed files with 11 additions and 16 deletions
|
@ -43,13 +43,11 @@ void kempld_enable_uart_for_console(void)
|
|||
switch (CONFIG_UART_FOR_CONSOLE) {
|
||||
case 0:
|
||||
kempld_write8(KEMPLD_UART_0,
|
||||
KEMPLD_UART_ENABLE |
|
||||
KEMPLD_UART_3F8 << KEMPLD_UART_IO_SHIFT);
|
||||
KEMPLD_UART_ENABLE | KEMPLD_UART_3F8 << KEMPLD_UART_IO_SHIFT);
|
||||
break;
|
||||
case 1:
|
||||
kempld_write8(KEMPLD_UART_1,
|
||||
KEMPLD_UART_ENABLE |
|
||||
KEMPLD_UART_2F8 << KEMPLD_UART_IO_SHIFT);
|
||||
KEMPLD_UART_ENABLE | KEMPLD_UART_2F8 << KEMPLD_UART_IO_SHIFT);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -16,21 +16,20 @@ static void kempld_uart_read_resources(struct device *dev)
|
|||
struct resource *const res_io = new_resource(dev, 0);
|
||||
struct resource *const res_irq = new_resource(dev, 1);
|
||||
const unsigned int uart = dev->path.generic.subid;
|
||||
|
||||
if (!config || !res_io || !res_irq || uart >= KEMPLD_NUM_UARTS)
|
||||
return;
|
||||
|
||||
const enum kempld_uart_io io = config->uart[uart].io;
|
||||
if (io >= ARRAY_SIZE(io_addr)) {
|
||||
printk(BIOS_ERR, "KEMPLD: Bad io value '%d' for UART#%u\n.",
|
||||
io, uart);
|
||||
printk(BIOS_ERR, "KEMPLD: Bad io value '%d' for UART#%u\n.", io, uart);
|
||||
dev->enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const int irq = config->uart[uart].irq;
|
||||
if (irq >= 16) {
|
||||
printk(BIOS_ERR, "KEMPLD: Bad irq value '%d' for UART#%u\n.",
|
||||
irq, uart);
|
||||
printk(BIOS_ERR, "KEMPLD: Bad irq value '%d' for UART#%u\n.", irq, uart);
|
||||
dev->enabled = false;
|
||||
return;
|
||||
}
|
||||
|
@ -49,9 +48,10 @@ static void kempld_uart_read_resources(struct device *dev)
|
|||
|
||||
const uint8_t reg = uart ? KEMPLD_UART_1 : KEMPLD_UART_0;
|
||||
const uint8_t val = kempld_read8(reg);
|
||||
kempld_write8(reg, (val & ~(KEMPLD_UART_IO_MASK | KEMPLD_UART_IRQ_MASK))
|
||||
| io << KEMPLD_UART_IO_SHIFT
|
||||
| irq << KEMPLD_UART_IRQ_SHIFT);
|
||||
kempld_write8(reg,
|
||||
(val & ~(KEMPLD_UART_IO_MASK | KEMPLD_UART_IRQ_MASK)) |
|
||||
io << KEMPLD_UART_IO_SHIFT |
|
||||
irq << KEMPLD_UART_IRQ_SHIFT);
|
||||
|
||||
kempld_release_mutex();
|
||||
}
|
||||
|
@ -90,9 +90,7 @@ static void kempld_enable_dev(struct device *const dev)
|
|||
}
|
||||
/* Fall through. */
|
||||
default:
|
||||
printk(BIOS_WARNING,
|
||||
"KEMPLD: Spurious device %s.\n",
|
||||
dev_path(dev));
|
||||
printk(BIOS_WARNING, "KEMPLD: Spurious device %s.\n", dev_path(dev));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -151,8 +151,7 @@ static int kempld_i2c_process(struct kempld_i2c_data *const i2c)
|
|||
i2c->state = STATE_ADDR;
|
||||
return 0;
|
||||
}
|
||||
i2c->state = (msg->flags & I2C_M_RD)
|
||||
? STATE_READ : STATE_WRITE;
|
||||
i2c->state = (msg->flags & I2C_M_RD) ? STATE_READ : STATE_WRITE;
|
||||
} else {
|
||||
i2c->state = STATE_DONE;
|
||||
kempld_write8(KEMPLD_I2C_CMD, I2C_CMD_STOP);
|
||||
|
|
Loading…
Reference in a new issue