CTRL_EN = (1<<0),
};
+#define TYPE_MILKYMIST_AC97 "milkymist-ac97"
+#define MILKYMIST_AC97(obj) \
+ OBJECT_CHECK(MilkymistAC97State, (obj), TYPE_MILKYMIST_AC97)
+
struct MilkymistAC97State {
- SysBusDevice busdev;
+ SysBusDevice parent_obj;
+
MemoryRegion regs_region;
QEMUSoundCard card;
static void milkymist_ac97_reset(DeviceState *d)
{
- MilkymistAC97State *s = container_of(d, MilkymistAC97State, busdev.qdev);
+ MilkymistAC97State *s = MILKYMIST_AC97(d);
int i;
for (i = 0; i < R_MAX; i++) {
static int milkymist_ac97_init(SysBusDevice *dev)
{
- MilkymistAC97State *s = FROM_SYSBUS(typeof(*s), dev);
+ MilkymistAC97State *s = MILKYMIST_AC97(dev);
struct audsettings as;
sysbus_init_irq(dev, &s->crrequest_irq);
}
static const TypeInfo milkymist_ac97_info = {
- .name = "milkymist-ac97",
+ .name = TYPE_MILKYMIST_AC97,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(MilkymistAC97State),
.class_init = milkymist_ac97_class_init,