Lines Matching +full:ddc +full:- +full:i2c
1 /* A simple I2C slave for returning monitor EDID data via DDC.
22 #include "hw/i2c/i2c.h"
23 #include "hw/qdev-properties.h"
25 #include "hw/display/i2c-ddc.h"
33 qemu_log("i2c-ddc: " fmt , ## __VA_ARGS__); \
41 s->firstbyte = false; in i2c_ddc_reset()
42 s->reg = 0; in i2c_ddc_reset()
45 static int i2c_ddc_event(I2CSlave *i2c, enum i2c_event event) in i2c_ddc_event() argument
47 I2CDDCState *s = I2CDDC(i2c); in i2c_ddc_event()
50 s->firstbyte = true; in i2c_ddc_event()
56 static uint8_t i2c_ddc_rx(I2CSlave *i2c) in i2c_ddc_rx() argument
58 I2CDDCState *s = I2CDDC(i2c); in i2c_ddc_rx()
61 value = s->edid_blob[s->reg % sizeof(s->edid_blob)]; in i2c_ddc_rx()
62 s->reg++; in i2c_ddc_rx()
66 static int i2c_ddc_tx(I2CSlave *i2c, uint8_t data) in i2c_ddc_tx() argument
68 I2CDDCState *s = I2CDDC(i2c); in i2c_ddc_tx()
69 if (s->firstbyte) { in i2c_ddc_tx()
70 s->reg = data; in i2c_ddc_tx()
71 s->firstbyte = false; in i2c_ddc_tx()
77 s->reg++; in i2c_ddc_tx()
85 qemu_edid_generate(s->edid_blob, sizeof(s->edid_blob), &s->edid_info); in i2c_ddc_init()
109 dc->vmsd = &vmstate_i2c_ddc; in i2c_ddc_class_init()
111 isc->event = i2c_ddc_event; in i2c_ddc_class_init()
112 isc->recv = i2c_ddc_rx; in i2c_ddc_class_init()
113 isc->send = i2c_ddc_tx; in i2c_ddc_class_init()