/* Reads the value of the pins from pcf857x respectively from a connected device.  */
static int pcf857x_process_input(const struct device *dev, gpio_port_value_t *value)
/* Reads the value of the pins from pcf857x respectively from a connected device.  */
static int pcf857x_process_input(const struct device *dev, gpio_port_value_t *value)
{
	const struct pcf857x_drv_cfg *drv_cfg = dev->config;
	struct pcf857x_drv_data *drv_data = dev->data;
	int rc = 0;
	uint8_t rx_buf[2] = {0};
	rc = i2c_read_dt(&drv_cfg->i2c, rx_buf, drv_data->num_bytes);
	if (rc != 0) {
		LOG_ERR("%s: failed to read from device: %d", dev->name, rc);
		return -EIO;
	}
	if (value) {
		*value = sys_get_le16(rx_buf);
	}
	drv_data->input_port_last = sys_get_le16(rx_buf);
	return rc;
}