bcm2835_i2c.c (db596ae19040574e41d086e78469014191d7d7fc) bcm2835_i2c.c (e3d0814368d00e7985c31edf5d0cfce45972d4be)
1/*
2 * Broadcom Serial Controller (BSC)
3 *
4 * Copyright (c) 2024 Rayhan Faizel <rayhan.faizel@gmail.com>
5 *
6 * SPDX-License-Identifier: MIT
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy

--- 248 unchanged lines hidden (view full) ---

257 VMSTATE_END_OF_LIST()
258 }
259};
260
261static void bcm2835_i2c_class_init(ObjectClass *klass, void *data)
262{
263 DeviceClass *dc = DEVICE_CLASS(klass);
264
1/*
2 * Broadcom Serial Controller (BSC)
3 *
4 * Copyright (c) 2024 Rayhan Faizel <rayhan.faizel@gmail.com>
5 *
6 * SPDX-License-Identifier: MIT
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy

--- 248 unchanged lines hidden (view full) ---

257 VMSTATE_END_OF_LIST()
258 }
259};
260
261static void bcm2835_i2c_class_init(ObjectClass *klass, void *data)
262{
263 DeviceClass *dc = DEVICE_CLASS(klass);
264
265 dc->reset = bcm2835_i2c_reset;
265 device_class_set_legacy_reset(dc, bcm2835_i2c_reset);
266 dc->realize = bcm2835_i2c_realize;
267 dc->vmsd = &vmstate_bcm2835_i2c;
268}
269
270static const TypeInfo bcm2835_i2c_info = {
271 .name = TYPE_BCM2835_I2C,
272 .parent = TYPE_SYS_BUS_DEVICE,
273 .instance_size = sizeof(BCM2835I2CState),
274 .class_init = bcm2835_i2c_class_init,
275};
276
277static void bcm2835_i2c_register_types(void)
278{
279 type_register_static(&bcm2835_i2c_info);
280}
281
282type_init(bcm2835_i2c_register_types)
266 dc->realize = bcm2835_i2c_realize;
267 dc->vmsd = &vmstate_bcm2835_i2c;
268}
269
270static const TypeInfo bcm2835_i2c_info = {
271 .name = TYPE_BCM2835_I2C,
272 .parent = TYPE_SYS_BUS_DEVICE,
273 .instance_size = sizeof(BCM2835I2CState),
274 .class_init = bcm2835_i2c_class_init,
275};
276
277static void bcm2835_i2c_register_types(void)
278{
279 type_register_static(&bcm2835_i2c_info);
280}
281
282type_init(bcm2835_i2c_register_types)