Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / hw / gpio / pca9554.h
blob54bfc4c4c7a026e887a2421190549d3ad79745b2
1 /*
2 * PCA9554 I/O port
4 * Copyright (c) 2023, IBM Corporation.
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8 #ifndef PCA9554_H
9 #define PCA9554_H
11 #include "hw/i2c/i2c.h"
12 #include "qom/object.h"
14 #define TYPE_PCA9554 "pca9554"
15 typedef struct PCA9554State PCA9554State;
16 DECLARE_INSTANCE_CHECKER(PCA9554State, PCA9554,
17 TYPE_PCA9554)
19 #define PCA9554_NR_REGS 4
20 #define PCA9554_PIN_COUNT 8
22 struct PCA9554State {
23 /*< private >*/
24 I2CSlave i2c;
25 /*< public >*/
27 uint8_t len;
28 uint8_t pointer;
30 uint8_t regs[PCA9554_NR_REGS];
31 qemu_irq gpio_out[PCA9554_PIN_COUNT];
32 uint8_t ext_state[PCA9554_PIN_COUNT];
33 char *description; /* For debugging purpose only */
36 #endif