From patchwork Thu Jul 18 21:41:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 11049583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA54113B1 for ; Thu, 18 Jul 2019 21:41:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B37552888A for ; Thu, 18 Jul 2019 21:41:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5E262888E; Thu, 18 Jul 2019 21:41:53 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 565772888A for ; Thu, 18 Jul 2019 21:41:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 026F96E37F; Thu, 18 Jul 2019 21:41:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3BE356E37F for ; Thu, 18 Jul 2019 21:41:50 +0000 (UTC) Received: by mail-pf1-x444.google.com with SMTP id p184so13194374pfp.7 for ; Thu, 18 Jul 2019 14:41:50 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=WXkPzSZf/fna3v9Du6552FbVJUMqyGEVvH1pVYvIMY4=; b=YKh4l6+p8GYu+FmJBTlMLl78MtkS6jMxRQBeEgZExwxlUUJ6XHEXrpFnMjrdpkGkGu N4abpVH3qVL2Rbk0Zhb8hVQ2efQLGa8ZggslsOjRld0FO/aJRW+EOMi5sK1y1uknZ0+x aMb0KeYGIvurQ/0Iir3BE0mgsa8RbxFv61xbhlpm0ZMBb3bRfmCUA+2JXHKX8Srk6oQN LEI5G6hKe2oeQY4XdAY39KObjHgz9e6nqxnJ1BDVOc4CRXo6UdzDncqRmeokG87ifRXo Awzz738akEThuEagd3f/Pi3rgVl+2bYq0+spGnxohy/vV1COhpJ7msiEYWNbrqzOpM1U bBhg== X-Gm-Message-State: APjAAAVyNhLjXGMWWJ64K7nDvHiyq301pC92BkT3AFlO6QCe1ZyDgjjF fzKYLFk7kVN0M6VigaaLX+NETA== X-Google-Smtp-Source: APXvYqyHVzz82WKLnz3eIxpxYsyXxPYr1dGo2TBVXXV3yFi26z+3ibdtZ3ZK/+C5B+QnidGKJlAWOQ== X-Received: by 2002:a63:f456:: with SMTP id p22mr23401451pgk.45.1563486109760; Thu, 18 Jul 2019 14:41:49 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id e17sm16860239pgm.21.2019.07.18.14.41.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jul 2019 14:41:49 -0700 (PDT) From: Matthias Kaehlcke To: Andrzej Hajda , Laurent Pinchart , David Airlie , Daniel Vetter Subject: [PATCH] drm/bridge: dw-hdmi: Refuse DDC/CI transfers on the internal I2C controller Date: Thu, 18 Jul 2019 14:41:35 -0700 Message-Id: <20190718214135.79445-1-mka@chromium.org> X-Mailer: git-send-email 2.22.0.657.g960e92d24f-goog MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WXkPzSZf/fna3v9Du6552FbVJUMqyGEVvH1pVYvIMY4=; b=V5STNS/qoo+hoVZ84al1gz5fifOhZXi5TNLkAQyzXqvCHDez69Q42Gc1XWjzaNNbwG N7LT6lGx8NtDTUhplToKtR5wwYE6ctQpODx/wBZoo5gu5HBfYvoV6pcDfJt2GkeMitc3 NQse+pSPY+bAuwZMPQRQ1+RWkkLvdMU80lmc4= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Neil Armstrong , Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Matthias Kaehlcke Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The DDC/CI protocol involves sending a multi-byte request to the display via I2C, which is typically followed by a multi-byte response. The internal I2C controller only allows single byte reads/writes or reads of 8 sequential bytes, hence DDC/CI is not supported when the internal I2C controller is used. The I2C transfers complete without errors, however the data in the response is garbage. Abort transfers to/from slave address 0x37 (DDC) with -EOPNOTSUPP, to make it evident that the communication is failing. Signed-off-by: Matthias Kaehlcke --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 045b1b13fd0e..e49402ebd56f 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -35,6 +35,7 @@ #include +#define DDC_I2C_ADDR 0x37 #define DDC_SEGMENT_ADDR 0x30 #define HDMI_EDID_LEN 512 @@ -322,6 +323,13 @@ static int dw_hdmi_i2c_xfer(struct i2c_adapter *adap, u8 addr = msgs[0].addr; int i, ret = 0; + if (addr == DDC_I2C_ADDR) + /* + * The internal I2C controller does not support the multi-byte + * read and write operations needed for DDC/VCP. + */ + return -EOPNOTSUPP; + dev_dbg(hdmi->dev, "xfer: num: %d, addr: %#x\n", num, addr); for (i = 0; i < num; i++) {