From patchwork Fri Oct 6 11:17:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 115050 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp1668548qgn; Fri, 6 Oct 2017 04:19:54 -0700 (PDT) X-Google-Smtp-Source: AOwi7QA9oXFJUIYT+9NtmBT03vBOQmCegG9adzDbKmokevteJIHsGkQc6yV2EscQ404J/87eTanN X-Received: by 10.98.103.72 with SMTP id b69mr484727pfc.251.1507288794502; Fri, 06 Oct 2017 04:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507288794; cv=none; d=google.com; s=arc-20160816; b=bGI9i1YZUt9SDtOjFCKmfMQ2PNc44IlPU2MrJaI7Ha4GY+eevotQbLZf+ttngFrdG/ J7sjUiCSbd3layQLI3w4K9z2mReIhQxk8YiViVpo+7NVYTT1zMMb9sK79P314ds0pHS6 WaRlOnBedVqyFL0YLtAPQ2fo2VUdpeuOpznv/VBCjW5D+3gEiyGXSt0DbvMghwTmxH5x P17JkoZvyXBIBia/JtmjghCqrFkPvLCNVDADyCj+dkDnQ5UeKkSoesWc3Qdef74pXoUQ jzaA1hTM/PUE4uIAY8pvsiE+7ytOGBkKuv6YzvXXdtPUlTW/jyf8lXUtgLT+hyzi+8GB Wd7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:dkim-signature :dkim-signature:cc:from:dkim-signature:arc-authentication-results; bh=IkBoPdtlmFppboUA19bWkF8DndPpJ4OWmuBPOnXrlq8=; b=rwurYEsocsLJh0ixpCzdt1m3DeRIfvh+zI/i+mBmVeIQxPNxtLOAOxr+McMxucWmW6 lWnlAT73uRxx4clLe94nUC3fdKN3txJiDMiYAZzqsg3370GiPX46roDBfv4DcHz7Wijj TmFX7iZfDJGE66LXOZ/f3m/8gFo4/fg1ydwHIWy6vjaNovUbI8olRIoBuNYiqnIKWG+r +kCTPmK3I+5vmqslPS0wei9iG4HkqTuzn3HCHCfnfIEUnWkP0wAQXtciH0jgLZ54bxXt 67jEdXIRx0/jROeh6Yv6NHpU8hD6uAAyXusruz6Y4gvlJ6Vo5zdtF8xZ6Mb0fysI4hFW PITQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=ULMmTwZn; dkim=fail header.i=@verizon.com header.s=corp header.b=X6JSKI8G; dkim=fail header.i=@verizon.com header.s=corp header.b=X6JSKI8G; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d13si954507pgu.126.2017.10.06.04.19.54; Fri, 06 Oct 2017 04:19:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=ULMmTwZn; dkim=fail header.i=@verizon.com header.s=corp header.b=X6JSKI8G; dkim=fail header.i=@verizon.com header.s=corp header.b=X6JSKI8G; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752130AbdJFLTx (ORCPT + 8 others); Fri, 6 Oct 2017 07:19:53 -0400 Received: from omzsmtpe03.verizonbusiness.com ([199.249.25.208]:55116 "EHLO omzsmtpe03.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752101AbdJFLTp (ORCPT ); Fri, 6 Oct 2017 07:19:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1507288785; x=1538824785; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=HvEFi48AuxWMxVO8DT+4pvMUXPUEls1A05kr8ziK95I=; b=ULMmTwZnxA/9WnFtA9AKHz+O/8jcZpU/VhLwSfJcFkLM6lsSH9AKLmx8 bG5GLVMd2DvQQO18GmSQsG6c63+AU68kgFa7evJ5K2uikk/lL83Ykq8/q hPVHpFzJJEvsJ2zmzV8oL85qiE4sX6MSbX2QdvaZE0ZcsOvZK8doKEyrt 0=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe03.verizonbusiness.com with ESMTP; 06 Oct 2017 11:19:36 +0000 From: "Levin, Alexander (Sasha Levin)" Cc: John Stultz , Archit Taneja , "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Oct 2017 11:19:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1507288752; x=1538824752; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=HvEFi48AuxWMxVO8DT+4pvMUXPUEls1A05kr8ziK95I=; b=X6JSKI8Gak1aBkGftEws12iJS/IhRtJ4w9i2TE+nk9K+PUvPcA1N61QA jQ/VeZS8eUkxZ+fBk6XZeNbwng9E8mwqeC0S9kWGrXiYDXqlWWijENug/ B0q20IC82uRzaCL/NbOGo+1RwiXtr8ou9l7kgVj9RbfxqmSzCsAB91U4n A=; Received: from surveyor.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.83]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Oct 2017 07:19:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1507288752; x=1538824752; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=HvEFi48AuxWMxVO8DT+4pvMUXPUEls1A05kr8ziK95I=; b=X6JSKI8Gak1aBkGftEws12iJS/IhRtJ4w9i2TE+nk9K+PUvPcA1N61QA jQ/VeZS8eUkxZ+fBk6XZeNbwng9E8mwqeC0S9kWGrXiYDXqlWWijENug/ B0q20IC82uRzaCL/NbOGo+1RwiXtr8ou9l7kgVj9RbfxqmSzCsAB91U4n A=; X-Host: surveyor.tdc.vzwcorp.com Received: from ohtwi1exh001.uswin.ad.vzwcorp.com ([10.144.218.43]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 06 Oct 2017 11:19:12 +0000 Received: from tbwexch16apd.uswin.ad.vzwcorp.com (153.114.162.40) by OHTWI1EXH001.uswin.ad.vzwcorp.com (10.144.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 6 Oct 2017 07:19:12 -0400 Received: from OMZP1LUMXCA13.uswin.ad.vzwcorp.com (144.8.22.188) by tbwexch16apd.uswin.ad.vzwcorp.com (153.114.162.40) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 6 Oct 2017 07:19:11 -0400 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA13.uswin.ad.vzwcorp.com (144.8.22.188) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 6 Oct 2017 06:19:11 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Fri, 6 Oct 2017 06:19:11 -0500 To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" Subject: [added to the v4.1 stable tree] drm/bridge: adv7511: Re-write the i2c address before EDID probing Thread-Topic: [added to the v4.1 stable tree] drm/bridge: adv7511: Re-write the i2c address before EDID probing Thread-Index: AQHTPpS55tXcaXx+cEe632eXjQDtQQ== Date: Fri, 6 Oct 2017 11:17:40 +0000 Message-ID: <20171006111704.25872-82-alexander.levin@verizon.com> References: <20171006111704.25872-1-alexander.levin@verizon.com> In-Reply-To: <20171006111704.25872-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: John Stultz This patch has been added to the v4.1 stable tree. If you have any objections, please let us know. -- 2.11.0 =============== [ Upstream commit 3587c856675c45809010c2cee5b21096f6e8e938 ] I've found that by just turning the chip on and off via the POWER_DOWN register, I end up getting i2c_transfer errors on HiKey. Investigating further, it turns out that some of the register state in hardware is getting lost, as the device registers are reset when the chip is powered down. Thus this patch simply re-writes the i2c address to the ADV7511_REG_EDID_I2C_ADDR register to ensure its properly set before we try to read the EDID data. Cc: David Airlie Cc: Archit Taneja Cc: Wolfram Sang Cc: Lars-Peter Clausen Cc: Laurent Pinchart Cc: dri-devel@lists.freedesktop.org Reviewed-by: Laurent Pinchart Tested-by: Laurent Pinchart Signed-off-by: John Stultz Signed-off-by: Archit Taneja Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-7-git-send-email-john.stultz@linaro.org Signed-off-by: Sasha Levin --- drivers/gpu/drm/i2c/adv7511.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i2c/adv7511.c b/drivers/gpu/drm/i2c/adv7511.c index 4361c9ac0d37..bfdbfc431e07 100644 --- a/drivers/gpu/drm/i2c/adv7511.c +++ b/drivers/gpu/drm/i2c/adv7511.c @@ -48,6 +48,10 @@ struct adv7511 { struct gpio_desc *gpio_pd; }; +static const int edid_i2c_addr = 0x7e; +static const int packet_i2c_addr = 0x70; +static const int cec_i2c_addr = 0x78; + static struct adv7511 *encoder_to_adv7511(struct drm_encoder *encoder) { return to_encoder_slave(encoder)->slave_priv; @@ -583,6 +587,9 @@ static int adv7511_get_modes(struct drm_encoder *encoder, ADV7511_INT1_DDC_ERROR); } adv7511->current_edid_segment = -1; + /* Reset the EDID_I2C_ADDR register as it might be cleared */ + regmap_write(adv7511->regmap, ADV7511_REG_EDID_I2C_ADDR, + edid_i2c_addr); } edid = drm_do_get_edid(connector, adv7511_get_edid_block, adv7511); @@ -858,10 +865,6 @@ static int adv7511_parse_dt(struct device_node *np, return 0; } -static const int edid_i2c_addr = 0x7e; -static const int packet_i2c_addr = 0x70; -static const int cec_i2c_addr = 0x78; - static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct adv7511_link_config link_config;