/* Writes registers of the mcp23xxx. 
On the mcp23x08 one 8 bit port will be written. On the mcp23x17 two 8 bit ports will be written. */
static int write_port_regs(const struct device *dev, uint8_t reg, uint16_t value)
/* Writes registers of the mcp23xxx. 
On the mcp23x08 one 8 bit port will be written. On the mcp23x17 two 8 bit ports will be written. */
static int write_port_regs(const struct device *dev, uint8_t reg, uint16_t value)
{
	const struct mcp23xxx_config *config = dev->config;
	if (config->ngpios == 16U) {
		reg *= 2;
	}
	return config->write_fn(dev, reg, value);
}