[PATCH v6 081/102] x86: Add a generic Intel GPIO driver
Simon Glass
sjg at chromium.org
Thu Jan 30 03:16:48 CET 2020
Hi Wolfgang,
On Fri, 13 Dec 2019 at 01:49, Wolfgang Wallner
<wolfgang.wallner at br-automation.com> wrote:
>
> 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));
> > +
I see you have sent patches for these, thank you,
Regards,
Simon
More information about the U-Boot
mailing list