/* * 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; }
static int broadwell_gpio_ofdata_to_platdata(struct udevice *dev) { struct broadwell_bank_platdata *plat = dev_get_platdata(dev); u32 gpiobase; int bank; int ret; ret = pch_get_gpio_base(dev->parent, &gpiobase); if (ret) return ret; bank = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "reg", -1); if (bank == -1) { debug("%s: Invalid bank number %d\n", __func__, bank); return -EINVAL; } plat->bank = bank; plat->base_addr = gpiobase; plat->bank_name = fdt_getprop(gd->fdt_blob, dev->of_offset, "bank-name", NULL); return 0; }
static int gpio_ich6_ofdata_to_platdata(struct udevice *dev) { struct ich6_bank_platdata *plat = dev_get_platdata(dev); u32 gpiobase; int offset; int ret; ret = pch_get_gpio_base(dev->parent, &gpiobase); if (ret) return ret; offset = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "reg", -1); if (offset == -1) { debug("%s: Invalid register offset %d\n", __func__, offset); return -EINVAL; } plat->offset = offset; plat->base_addr = gpiobase + offset; plat->bank_name = fdt_getprop(gd->fdt_blob, dev->of_offset, "bank-name", NULL); return 0; }