From patchwork Tue Feb 27 10:49:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10244769 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 85FCA60208 for ; Tue, 27 Feb 2018 10:52:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BA67201B0 for ; Tue, 27 Feb 2018 10:52:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 705FF203B9; Tue, 27 Feb 2018 10:52:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2467F201B0 for ; Tue, 27 Feb 2018 10:52:50 +0000 (UTC) Received: from localhost ([::1]:36183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqcsL-0000b7-9k for patchwork-qemu-devel@patchwork.kernel.org; Tue, 27 Feb 2018 05:52:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqcot-0006Jv-RH for qemu-devel@nongnu.org; Tue, 27 Feb 2018 05:49:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqcot-0004CM-4z for qemu-devel@nongnu.org; Tue, 27 Feb 2018 05:49:15 -0500 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:44427) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eqcos-0004Bo-Um for qemu-devel@nongnu.org; Tue, 27 Feb 2018 05:49:15 -0500 Received: by mail-lf0-x242.google.com with SMTP id v9so26819224lfa.11 for ; Tue, 27 Feb 2018 02:49:14 -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:in-reply-to:references; bh=bxR4RkALHrAoI9FSOR6VpD83INuPRfeIwUlXBxL+XuI=; b=X07j9Q7JdSnozjw3f2TG9EkF3ccQkouGFqQe/o6Ba/PdFNiDj46gIq3WNT3oVPMbU5 03HUdZrGr1rU0KiNfEyUKhDf6hG5Y3H5U3P3IcACyDiycrdhVAhJ6A9qJMb6kTpYVOoa f6Z67gJrYvkUr+WbweB2vVbzMt84OPzyz7D+8= 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:in-reply-to :references; bh=bxR4RkALHrAoI9FSOR6VpD83INuPRfeIwUlXBxL+XuI=; b=DpUDTZOE7g0D5wVlakeO7xczke7TsPsrFIXuoxi0pVevcreFS5ieLvlxdCRhlSJ00A qryaURkHR5zXxkSldSJKFm5mkoZAmUssyjy+GxDceBdZVmE9xuGk5QPdHYnathEfVw7M /ZWm8ApR3GYUJtjor6xxq6iseVzHo8k/hb2g6TSD8ju4vACELULBVVe2TOvqzaOPOCk6 pPfCe/ICSLRo8kqXyn7PM9Gud1gTcq8dFn+muA718X4Cbe7FxUfGNpqb6JNUsuM5Zekh B0y1VBWBJ1kaNDVKiAq8AQL7uhYDD7MRDHxK4XR6xJGpFIybc+pe//QmPYZsgbQbemSG Jw4w== X-Gm-Message-State: APf1xPBHcRidzvFRw8VakeA6U8+j4oLexMm4PCZgDzkT3Fqzhqcnwju1 3tnUrNmsy8TzX4THnvMbTuHh3DHyda4= X-Google-Smtp-Source: AG47ELuMDzrpDK8W3bcSuo0WK+qPIl3bCkGjYAxNsg16pMplh9dwnEm/QcM3pw2C+Sj7/o+u53KmTw== X-Received: by 10.25.42.143 with SMTP id q15mr9742333lfq.84.1519728553405; Tue, 27 Feb 2018 02:49:13 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 74sm2484148ljq.32.2018.02.27.02.49.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2018 02:49:12 -0800 (PST) From: Linus Walleij To: qemu-devel@nongnu.org, Peter Maydell Date: Tue, 27 Feb 2018 11:49:01 +0100 Message-Id: <20180227104903.21353-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180227104903.21353-1-linus.walleij@linaro.org> References: <20180227104903.21353-1-linus.walleij@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::242 Subject: [Qemu-devel] [PATCH 3/5] 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: Corey Minyard , Linus Walleij , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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: Peter Maydell Signed-off-by: Linus Walleij Reviewed-by: Philippe Mathieu-Daudé --- 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)