i2c-ddc.c (95a9457fd44ad97c518858a4e1586a5498f9773c) i2c-ddc.c (4f67d30b5e74e060b8dbe10528829b47345cd6e8)
1/* A simple I2C slave for returning monitor EDID data via DDC.
2 *
3 * Copyright (c) 2011 Linaro Limited
4 * Written by Peter Maydell
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.

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

102
103static void i2c_ddc_class_init(ObjectClass *oc, void *data)
104{
105 DeviceClass *dc = DEVICE_CLASS(oc);
106 I2CSlaveClass *isc = I2C_SLAVE_CLASS(oc);
107
108 dc->reset = i2c_ddc_reset;
109 dc->vmsd = &vmstate_i2c_ddc;
1/* A simple I2C slave for returning monitor EDID data via DDC.
2 *
3 * Copyright (c) 2011 Linaro Limited
4 * Written by Peter Maydell
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.

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

102
103static void i2c_ddc_class_init(ObjectClass *oc, void *data)
104{
105 DeviceClass *dc = DEVICE_CLASS(oc);
106 I2CSlaveClass *isc = I2C_SLAVE_CLASS(oc);
107
108 dc->reset = i2c_ddc_reset;
109 dc->vmsd = &vmstate_i2c_ddc;
110 dc->props = i2c_ddc_properties;
110 device_class_set_props(dc, i2c_ddc_properties);
111 isc->event = i2c_ddc_event;
112 isc->recv = i2c_ddc_rx;
113 isc->send = i2c_ddc_tx;
114}
115
116static TypeInfo i2c_ddc_info = {
117 .name = TYPE_I2CDDC,
118 .parent = TYPE_I2C_SLAVE,
119 .instance_size = sizeof(I2CDDCState),
120 .instance_init = i2c_ddc_init,
121 .class_init = i2c_ddc_class_init
122};
123
124static void ddc_register_devices(void)
125{
126 type_register_static(&i2c_ddc_info);
127}
128
129type_init(ddc_register_devices);
111 isc->event = i2c_ddc_event;
112 isc->recv = i2c_ddc_rx;
113 isc->send = i2c_ddc_tx;
114}
115
116static TypeInfo i2c_ddc_info = {
117 .name = TYPE_I2CDDC,
118 .parent = TYPE_I2C_SLAVE,
119 .instance_size = sizeof(I2CDDCState),
120 .instance_init = i2c_ddc_init,
121 .class_init = i2c_ddc_class_init
122};
123
124static void ddc_register_devices(void)
125{
126 type_register_static(&i2c_ddc_info);
127}
128
129type_init(ddc_register_devices);