xref: /openbmc/qemu/include/hw/i2c/arm_sbcon_i2c.h (revision ad9e5aa2)
1 /*
2  * ARM SBCon two-wire serial bus interface (I2C bitbang)
3  *   a.k.a.
4  * ARM Versatile I2C controller
5  *
6  * Copyright (c) 2006-2007 CodeSourcery.
7  * Copyright (c) 2012 Oskar Andero <oskar.andero@gmail.com>
8  * Copyright (C) 2020 Philippe Mathieu-Daudé <f4bug@amsat.org>
9  *
10  * SPDX-License-Identifier: GPL-2.0-or-later
11  */
12 #ifndef HW_I2C_ARM_SBCON_H
13 #define HW_I2C_ARM_SBCON_H
14 
15 #include "hw/sysbus.h"
16 #include "hw/i2c/bitbang_i2c.h"
17 
18 #define TYPE_VERSATILE_I2C "versatile_i2c"
19 #define TYPE_ARM_SBCON_I2C TYPE_VERSATILE_I2C
20 
21 #define ARM_SBCON_I2C(obj) \
22     OBJECT_CHECK(ArmSbconI2CState, (obj), TYPE_ARM_SBCON_I2C)
23 
24 typedef struct ArmSbconI2CState {
25     /*< private >*/
26     SysBusDevice parent_obj;
27     /*< public >*/
28 
29     MemoryRegion iomem;
30     bitbang_i2c_interface bitbang;
31     int out;
32     int in;
33 } ArmSbconI2CState;
34 
35 #endif /* HW_I2C_ARM_SBCON_H */
36