static int broadwell_gpio_direction_input(struct udevice *dev, unsigned offset) { struct broadwell_bank_priv *priv = dev_get_priv(dev); struct pch_lp_gpio_regs *regs = priv->regs; setio_32(®s->config[priv->offset + offset], CONFA_DIR_INPUT); return 0; }
/* * Enable GPIO SMI events - it would be good to put this in the GPIO driver * but it would need a new driver operation. */ int enable_alt_smi(struct udevice *pch, u32 mask) { struct pch_lp_gpio_regs *regs; u32 gpiobase; int ret; ret = pch_get_gpio_base(pch, &gpiobase); if (ret) { debug("%s: invalid GPIOBASE address (%08x)\n", __func__, gpiobase); return -EINVAL; } regs = (struct pch_lp_gpio_regs *)gpiobase; setio_32(regs->alt_gpi_smi_en, mask); return 0; }