Commit 839a2b28 authored by Linus Walleij's avatar Linus Walleij Committed by Peter Maydell
Browse files

hw/i2c-ddc: Do not fail writes



The tx function of the DDC I2C slave emulation was returning 1
on all writes resulting in NACK in the I2C bus. Changing it to
0 makes the DDC I2C work fine with bit-banged I2C such as the
versatile I2C.

I guess it was not affecting whatever I2C controller this was
used with until now, but with the Versatile I2C it surely
does not work.

Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Message-id: 20180227104903.21353-4-linus.walleij@linaro.org
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent aa88d7ad
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -259,12 +259,12 @@ static int i2c_ddc_tx(I2CSlave *i2c, uint8_t data)
        s->reg = data;
        s->firstbyte = false;
        DPRINTF("[EDID] Written new pointer: %u\n", data);
        return 1;
        return 0;
    }

    /* Ignore all writes */
    s->reg++;
    return 1;
    return 0;
}

static void i2c_ddc_init(Object *obj)