From patchwork Sat Feb 17 14:00:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 874748 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="dOU9yWni"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zkBZL4xY3z9ryQ for ; Sun, 18 Feb 2018 01:03:53 +1100 (AEDT) Received: from localhost ([::1]:53157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en35g-0005nW-Kb for incoming@patchwork.ozlabs.org; Sat, 17 Feb 2018 09:03:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en34w-0005mi-Qf for qemu-devel@nongnu.org; Sat, 17 Feb 2018 09:03:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1en34s-0003nM-W8 for qemu-devel@nongnu.org; Sat, 17 Feb 2018 09:03:02 -0500 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:41499) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1en34s-0003mv-Ot for qemu-devel@nongnu.org; Sat, 17 Feb 2018 09:02:58 -0500 Received: by mail-lf0-x243.google.com with SMTP id f136so7584084lff.8 for ; Sat, 17 Feb 2018 06:02:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=8g3VeqEBLLwqmfKajkLXAjgCGS5xAsK+XOXYyEJ1460=; b=dOU9yWnir0EXOfz7y+eTCzB69MQ8/P36ZIFoRc627FHtQ1pOoMW6GEmXp5j4/8mMTV x8qCxqNqtHpdhZcOB0bcY+6kE/bFtxDB6Q2+sWhfBuQZL1HVdxQrMNRk/+UJ2pHytlsg kOO1HnMB6mmp/VVoSLmlvVJBa/IY4Q1La58KM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8g3VeqEBLLwqmfKajkLXAjgCGS5xAsK+XOXYyEJ1460=; b=ZDpHCDDX/yzWeaowFTvik3VK8Yg28ap7qhO0tGfFxPY5ybTxA7IDyXHk8ByU16sae7 jKiS32722+0qCdEbyRGC8C0lfUhqPTLk9desTrKKwbFJXAQcur6zc53rM3wg80T+8Vgk +dzsKor5ApNrJbUqt6cVIK/7oS+Sc8uwtcKX0C//cOfwSJreX4TiwhzTDmpGs+NWeG+c iVmZXf9iOFKw+LDP/KkAPCs8yldazMicVPQeNQt15C/PlUC3YyPgJ7Vxg6amLFLumHvL kSHkU/83Ns49CRyEYRU7uzI4X2zy1NMuilyVHwKs7oo5Wo2kiyXDIWHCdBEHxKl5r72r QrVw== X-Gm-Message-State: APf1xPDBqaRlUXOnYWT004U/VJ9y2n7CEbrVFJsd+cC8d73qxavJb3Tz uZV1UbWFNr2vMnDK1+NN7u3Sag7c8uo= X-Google-Smtp-Source: AH8x227wIEcil4E69vmS+W/RjhYq3GG4c10Tkg/rKaxMEqHAVV9j8IFc5PDNgQkXnWOfynGPIGbilA== X-Received: by 10.25.74.205 with SMTP id x196mr6647950lfa.46.1518876176796; Sat, 17 Feb 2018 06:02:56 -0800 (PST) Received: from localhost.localdomain (c-cb7471d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.116.203]) by smtp.gmail.com with ESMTPSA id w204sm122054lff.29.2018.02.17.06.02.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Feb 2018 06:02:55 -0800 (PST) From: Linus Walleij To: qemu-devel@nongnu.org Date: Sat, 17 Feb 2018 15:00:49 +0100 Message-Id: <20180217140051.22731-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: [Qemu-devel] [PATCH 1/3] hw/i2c-ddc: Do not fail writes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij , qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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. Signed-off-by: Linus Walleij Reviewed-by: Peter Maydell --- hw/i2c/i2c-ddc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i2c/i2c-ddc.c b/hw/i2c/i2c-ddc.c index 199dac9e41c1..bec0c91e2dd0 100644 --- a/hw/i2c/i2c-ddc.c +++ b/hw/i2c/i2c-ddc.c @@ -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)