5 comments:
Patch Set #6, Line 11: protectoin
protection
Patch Set #6, Line 11: The process would be
Format this as a list?
The process would be:
1. write to GPIO ...
2. write to GPIO ...
Patch Set #6, Line 151: realtek_mst_i2c_spi_toggle_gpio_88_strap
realtek_mst_i2c_spi_toggle_write_protect_gpio
ret |= realtek_mst_i2c_spi_write_register(fd, 0xF4, 0x9F);
ret |= realtek_mst_i2c_spi_write_register(fd, 0xF5, GPIO_CONFIG_ADDRESS >> 8);
ret |= realtek_mst_i2c_spi_write_register(fd, 0xF4, GPIO_CONFIG_ADDRESS & 0xFF);
Maybe turn these groups of three register writes into an auxiliary function?
static int realtek_mst_i2c_spi_select_indexed_register(uint16_t address)
{
int ret = 0;
ret |= realtek_mst_i2c_spi_write_register(fd, 0xF4, 0x9F);
ret |= realtek_mst_i2c_spi_write_register(fd, 0xF5, address >> 8);
ret |= realtek_mst_i2c_spi_write_register(fd, 0xF4, address & 0xFF);
return ret;
}
Feel free to rename it for accuracy. It's not specific to GPIO, since `realtek_mst_i2c_spi_enter_isp_mode` also does the same thing with another register. Feel free to do it in a follow-up.
Patch Set #6, Line 182: (toggle ? 0x01 : 0x00)
This can be simplified as follows:
!!toggle
To view, visit change 46089. To unsubscribe, or for help writing mail filters, visit settings.