qemu/include/hw/usb/imx-usb-phy.h
Eduardo Habkost db1015e92e Move QOM typedefs and add missing includes
Some typedefs and macros are defined after the type check macros.
This makes it difficult to automatically replace their
definitions with OBJECT_DECLARE_TYPE.

Patch generated using:

 $ ./scripts/codeconverter/converter.py -i \
   --pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]')

which will split "typdef struct { ... } TypedefName"
declarations.

Followed by:

 $ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \
    $(git grep -l '' -- '*.[ch]')

which will:
- move the typedefs and #defines above the type check macros
- add missing #include "qom/object.h" lines if necessary

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20200831210740.126168-9-ehabkost@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20200831210740.126168-10-ehabkost@redhat.com>
Message-Id: <20200831210740.126168-11-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-09 09:26:43 -04:00

56 lines
1.1 KiB
C

#ifndef IMX_USB_PHY_H
#define IMX_USB_PHY_H
#include "hw/sysbus.h"
#include "qemu/bitops.h"
#include "qom/object.h"
enum IMXUsbPhyRegisters {
USBPHY_PWD,
USBPHY_PWD_SET,
USBPHY_PWD_CLR,
USBPHY_PWD_TOG,
USBPHY_TX,
USBPHY_TX_SET,
USBPHY_TX_CLR,
USBPHY_TX_TOG,
USBPHY_RX,
USBPHY_RX_SET,
USBPHY_RX_CLR,
USBPHY_RX_TOG,
USBPHY_CTRL,
USBPHY_CTRL_SET,
USBPHY_CTRL_CLR,
USBPHY_CTRL_TOG,
USBPHY_STATUS,
USBPHY_DEBUG = 0x14,
USBPHY_DEBUG_SET,
USBPHY_DEBUG_CLR,
USBPHY_DEBUG_TOG,
USBPHY_DEBUG0_STATUS,
USBPHY_DEBUG1 = 0x1c,
USBPHY_DEBUG1_SET,
USBPHY_DEBUG1_CLR,
USBPHY_DEBUG1_TOG,
USBPHY_VERSION,
USBPHY_MAX
};
#define USBPHY_CTRL_SFTRST BIT(31)
#define TYPE_IMX_USBPHY "imx.usbphy"
typedef struct IMXUSBPHYState IMXUSBPHYState;
#define IMX_USBPHY(obj) OBJECT_CHECK(IMXUSBPHYState, (obj), TYPE_IMX_USBPHY)
struct IMXUSBPHYState {
/* <private> */
SysBusDevice parent_obj;
/* <public> */
MemoryRegion iomem;
uint32_t usbphy[USBPHY_MAX];
};
#endif /* IMX_USB_PHY_H */