
13 Dec
2019
13 Dec
'19
9:49 a.m.
Hi Simon, Bin,
+static int intel_gpio_direction_output(struct udevice *dev, uint offset,
int value)
+{
- struct udevice *pinctrl = dev_get_parent(dev);
- uint config_offset = intel_pinctrl_get_config_reg_addr(pinctrl, offset);
- pcr_clrsetbits32(dev, config_offset,
I think we should pass 'pinctrl' instead of 'dev' here. As far as I understand the code the function pcr_clrsetbits32 expects a pinctrl device with a p2sb parent.
PAD_CFG0_MODE_MASK | PAD_CFG0_RX_STATE |
PAD_CFG0_TX_DISABLE,
We also need to clear the bit PAD_CFG0_TX_STATE here. Otherwise if a gpio is set to high once it can never be set to low again.
PAD_CFG0_MODE_GPIO | PAD_CFG0_RX_DISABLE |
(value ? PAD_CFG0_TX_STATE : 0));
- return 0;
+}
regards, Wolfgang