xref: /openbmc/qemu/include/hw/i2c/arm_sbcon_i2c.h (revision 92518611acef9c44b215a784c71c5766e3ca6fac)
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 
13 #ifndef HW_I2C_ARM_SBCON_I2C_H
14 #define HW_I2C_ARM_SBCON_I2C_H
15 
16 #include "hw/sysbus.h"
17 #include "hw/i2c/bitbang_i2c.h"
18 #include "qom/object.h"
19 
20 #define TYPE_VERSATILE_I2C "versatile_i2c"
21 #define TYPE_ARM_SBCON_I2C TYPE_VERSATILE_I2C
22 
23 typedef struct ArmSbconI2CState ArmSbconI2CState;
24 DECLARE_INSTANCE_CHECKER(ArmSbconI2CState, ARM_SBCON_I2C, TYPE_ARM_SBCON_I2C)
25 
26 struct ArmSbconI2CState {
27     /*< private >*/
28     SysBusDevice parent_obj;
29     /*< public >*/
30 
31     MemoryRegion iomem;
32     bitbang_i2c_interface bitbang;
33     int out;
34     int in;
35 };
36 
37 #endif /* HW_I2C_ARM_SBCON_I2C_H */
38