4 * Copyright 2017-2021 IBM Corp.
6 * Andrew Jeffery <andrew@aj.id.au>
8 * SPDX-License-Identifier: GPL-2.0-or-later
11 #ifndef HW_ADC_ASPEED_ADC_H
12 #define HW_ADC_ASPEED_ADC_H
14 #include "hw/sysbus.h"
16 #define TYPE_ASPEED_ADC "aspeed.adc"
17 #define TYPE_ASPEED_2400_ADC TYPE_ASPEED_ADC "-ast2400"
18 #define TYPE_ASPEED_2500_ADC TYPE_ASPEED_ADC "-ast2500"
19 #define TYPE_ASPEED_2600_ADC TYPE_ASPEED_ADC "-ast2600"
20 #define TYPE_ASPEED_1030_ADC TYPE_ASPEED_ADC "-ast1030"
21 OBJECT_DECLARE_TYPE(AspeedADCState
, AspeedADCClass
, ASPEED_ADC
)
23 #define TYPE_ASPEED_ADC_ENGINE "aspeed.adc.engine"
24 OBJECT_DECLARE_SIMPLE_TYPE(AspeedADCEngineState
, ASPEED_ADC_ENGINE
)
26 #define ASPEED_ADC_NR_CHANNELS 16
27 #define ASPEED_ADC_NR_REGS (0xD0 >> 2)
29 struct AspeedADCEngineState
{
37 uint32_t regs
[ASPEED_ADC_NR_REGS
];
40 struct AspeedADCState
{
47 AspeedADCEngineState engines
[2];
50 struct AspeedADCClass
{
51 SysBusDeviceClass parent_class
;
56 #endif /* HW_ADC_ASPEED_ADC_H */