/* This function reads a value from the connected device.  */
static int pcf857x_port_get_raw(const struct device *dev, gpio_port_value_t *value)
/* This function reads a value from the connected device.  */
static int pcf857x_port_get_raw(const struct device *dev, gpio_port_value_t *value)
{
	struct pcf857x_drv_data *drv_data = dev->data;
	int rc;
	if (k_is_in_isr()) {
		return -EWOULDBLOCK;
	}
	if ((~drv_data->pins_cfg.configured_as_outputs & (uint16_t)*value) != (uint16_t)*value) {
		LOG_ERR("Pin(s) is/are configured as output which should be input.");
		return -EOPNOTSUPP;
	}
	k_sem_take(&drv_data->lock, K_FOREVER);
	rc = pcf857x_process_input(dev, value);
	k_sem_give(&drv_data->lock);
	return rc;
}