/* Writes to the IOCON register of the mcp23xxx. 
IOCON is the only register that is not 16 bits wide on 16-pin devices; instead, it is mirrored in two adjacent memory locations. Because the underlying  */
static int write_iocon(const struct device *dev, uint8_t value)
/* Writes to the IOCON register of the mcp23xxx. 
IOCON is the only register that is not 16 bits wide on 16-pin devices; instead, it is mirrored in two adjacent memory locations. Because the underlying  */
static int write_iocon(const struct device *dev, uint8_t value)
{
	struct mcp23xxx_drv_data *drv_data = dev->data;
	uint16_t extended_value = value | (value << 8);
	int ret = write_port_regs(dev, REG_IOCON, extended_value);
	if (ret == 0) {
		drv_data->reg_cache.iocon = extended_value;
	}
	return ret;
}