2 * Nuvoton NPCM7xx General Purpose Input / Output (GPIO)
4 * Copyright 2020 Google LLC
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 #ifndef NPCM7XX_GPIO_H
16 #define NPCM7XX_GPIO_H
18 #include "exec/memory.h"
19 #include "hw/sysbus.h"
21 /* Number of pins managed by each controller. */
22 #define NPCM7XX_GPIO_NR_PINS (32)
25 * Number of registers in our device state structure. Don't change this without
26 * incrementing the version_id in the vmstate.
28 #define NPCM7XX_GPIO_NR_REGS (0x80 / sizeof(uint32_t))
30 typedef struct NPCM7xxGPIOState
{
33 /* Properties to be defined by the SoC */
42 qemu_irq output
[NPCM7XX_GPIO_NR_PINS
];
48 uint32_t regs
[NPCM7XX_GPIO_NR_REGS
];
51 #define TYPE_NPCM7XX_GPIO "npcm7xx-gpio"
52 #define NPCM7XX_GPIO(obj) \
53 OBJECT_CHECK(NPCM7xxGPIOState, (obj), TYPE_NPCM7XX_GPIO)
55 #endif /* NPCM7XX_GPIO_H */