/* I2C write (16 Bit) to device using a mask.  */
int fdc2x1x_reg_write_mask(const struct device *dev, uint8_t reg_addr, uint16_t mask, uint16_t data)
/* I2C write (16 Bit) to device using a mask.  */
int fdc2x1x_reg_write_mask(const struct device *dev, uint8_t reg_addr, uint16_t mask, uint16_t data)
{
	int ret;
	uint16_t tmp;
	ret = fdc2x1x_reg_read(dev, reg_addr, &tmp);
	if (ret) {
		return ret;
	}
	LOG_DBG("read [0x%x] = 0x%x", reg_addr, tmp);
	LOG_DBG("mask: 0x%x", mask);
	tmp &= ~mask;
	tmp |= data;
	return fdc2x1x_reg_write(dev, reg_addr, tmp);
}