/* Write to the port registers of certain register function.  */
static int write_port_regs(const struct device *dev, uint8_t reg, uint8_t *cache, uint8_t value)
/* Write to the port registers of certain register function.  */
static int write_port_regs(const struct device *dev, uint8_t reg, uint8_t *cache, uint8_t value)
{
	const struct gpio_fxl6408_config *const config = dev->config;
	int ret = 0;
	if (*cache != value) {
		ret = i2c_reg_write_byte_dt(&config->i2c, reg, value);
		if (ret != 0) {
			LOG_ERR("error writing to register 0x%X (%d)",
				reg, ret);
			return ret;
		}
		*cache = value;
		LOG_DBG("Write: REG[0x%X] = 0x%X", reg, *cache);
	}
	return ret;
}