sifive_pwm.c (d328fef93ae757a0dd65ed786a4086e27952eef3) | sifive_pwm.c (e3d0814368d00e7985c31edf5d0cfce45972d4be) |
---|---|
1/* 2 * SiFive PWM 3 * 4 * Copyright (c) 2020 Western Digital 5 * 6 * Author: Alistair Francis <alistair.francis@wdc.com> 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy --- 432 unchanged lines hidden (view full) --- 441 timer_init_ns(&s->timer[3], QEMU_CLOCK_VIRTUAL, 442 sifive_pwm_interrupt_3, s); 443} 444 445static void sifive_pwm_class_init(ObjectClass *klass, void *data) 446{ 447 DeviceClass *dc = DEVICE_CLASS(klass); 448 | 1/* 2 * SiFive PWM 3 * 4 * Copyright (c) 2020 Western Digital 5 * 6 * Author: Alistair Francis <alistair.francis@wdc.com> 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy --- 432 unchanged lines hidden (view full) --- 441 timer_init_ns(&s->timer[3], QEMU_CLOCK_VIRTUAL, 442 sifive_pwm_interrupt_3, s); 443} 444 445static void sifive_pwm_class_init(ObjectClass *klass, void *data) 446{ 447 DeviceClass *dc = DEVICE_CLASS(klass); 448 |
449 dc->reset = sifive_pwm_reset; | 449 device_class_set_legacy_reset(dc, sifive_pwm_reset); |
450 device_class_set_props(dc, sifive_pwm_properties); 451 dc->vmsd = &vmstate_sifive_pwm; 452 dc->realize = sifive_pwm_realize; 453} 454 455static const TypeInfo sifive_pwm_info = { 456 .name = TYPE_SIFIVE_PWM, 457 .parent = TYPE_SYS_BUS_DEVICE, 458 .instance_size = sizeof(SiFivePwmState), 459 .instance_init = sifive_pwm_init, 460 .class_init = sifive_pwm_class_init, 461}; 462 463static void sifive_pwm_register_types(void) 464{ 465 type_register_static(&sifive_pwm_info); 466} 467 468type_init(sifive_pwm_register_types) | 450 device_class_set_props(dc, sifive_pwm_properties); 451 dc->vmsd = &vmstate_sifive_pwm; 452 dc->realize = sifive_pwm_realize; 453} 454 455static const TypeInfo sifive_pwm_info = { 456 .name = TYPE_SIFIVE_PWM, 457 .parent = TYPE_SYS_BUS_DEVICE, 458 .instance_size = sizeof(SiFivePwmState), 459 .instance_init = sifive_pwm_init, 460 .class_init = sifive_pwm_class_init, 461}; 462 463static void sifive_pwm_register_types(void) 464{ 465 type_register_static(&sifive_pwm_info); 466} 467 468type_init(sifive_pwm_register_types) |