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: 129763 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1245785lja; Tue, 27 Feb 2018 02:52:11 -0800 (PST) X-Google-Smtp-Source: AG47ELudoOummcsAzf2h10InTun3J35dAVS2BC5rymbVXitIvFHiXdTR9L6RR94yyE4FwynV+R7p X-Received: by 10.13.227.195 with SMTP id m186mr8668364ywe.64.1519728731130; Tue, 27 Feb 2018 02:52:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519728731; cv=none; d=google.com; s=arc-20160816; b=A70ObR64jSMYb7GiN7L35LULHqEKq3sF4r6eAklbZw0jSk/ZIyJAZH1HF+ec+WPGrd CwerRATbifh5pDcBSKtA1kyjkbJinXQ4TWssEBm47k2ZoAfoNfo4DSJVYxNVx8jmv5ik f8dPCfaoGS8ESAXxFZ89tKRBZgEXAC0IynX7pIgM/K82gLCWpBs0txU6AoXcRy40ZaDG f+VgLkVw4I42c0kLmKUKgEWd3XcO2h8W+a5/TpYA3zlR7kb9jbnuycO06R2O1jNh4w0D EWfK75OUI2Bt1Rx2r+CRn/+7a+x6yx6wPlzBz0hxOzSAbl24n+YlNOSu/i8/wYUHfJN/ ssBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=bxR4RkALHrAoI9FSOR6VpD83INuPRfeIwUlXBxL+XuI=; b=U468hZEMzSFk3mIJJtttdKXHAKQQami9CgyQmE8nfeM9KTK6unGlYlIP8QcJjS2mzb z/wmSQ6swedOFLkzC7ZEcijlS+wQ7NjFf9sDINUTpnPmXWMVYLz7ZsvV2iKrus0Mg/C3 L2yUopmA1YawHUbhxG54wgxgUJMSvAYdoHwgZUXGUFnDY9kc2bIS31XXXpSZPojVvQk0 Au7Z6XlLv5En3qJHg9HuAmMs/OOp/pty3sGp5OUO7zQITijvs9elHYlyR/EXb0RtBwiQ Z0/olL1MpKPxWPelZ6tfR+LM14oQgBCoWwyPX2C73zG/O1VJD2/VPSXA0UgeUiS5g4sM vXEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=X07j9Q7J; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g5si1080824ywg.250.2018.02.27.02.52.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 27 Feb 2018 02:52:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=X07j9Q7J; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqcri-0008KE-Hv for patch@linaro.org; Tue, 27 Feb 2018 05:52:10 -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-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_M?= =?utf-8?q?athieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.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. Reviewed-by: Peter Maydell Signed-off-by: Linus Walleij --- hw/i2c/i2c-ddc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.14.3 Reviewed-by: Philippe Mathieu-Daudé 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)