From patchwork Fri Nov 3 03:11:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nhan Ngoc. Nguyen" X-Patchwork-Id: 117849 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2929989qgn; Thu, 2 Nov 2017 20:11:15 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TFR40DGaGo/SqRyUSMTtHgnqvzAHQcUSbSPT1OZqRsawtMO2OmUPEr4Ty6eg5DHrA0hq71 X-Received: by 10.98.61.85 with SMTP id k82mr6130651pfa.84.1509678675754; Thu, 02 Nov 2017 20:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509678675; cv=none; d=google.com; s=arc-20160816; b=X0O4ke/OFYAb46/JE6KQ3KptOkwgf9BCAackHd+4BlWruMI0W9e69iV+dqKIgaTCQy y50E7l1m3pUH0cEQgJciyAWIZ/ilRDG1dKi16a3iTOT+MOkwx7nhMX/tZwuA75eGeBKr 0tSWRINzsEIOEGLkIzALpKm79UKGhAcpRI9d7C5em4yTYfwQzgEJ3y50kIznEvAVbRgW t1WUacvp0C/jrVvavMc3MTe5U5GObuPqqWxjUcu7bKEa2Lq0PKb2tucVs7yecpTrGH8F 3kcGDyT02ItzmlRXioUZ0+nk3yC7kn/19jz6cPu0jJ0+AnYyRSqckfjShdszPOR2TMHt JT6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=X5qPfylmRcmskCqOHibUdo7QpogaWHhdeDg7WNk8z1g=; b=YkpQ/RpTXW9HlRT46oGWgATS6Gtz7jXcWfKkfrHo+gFpR91uILN9D6ioSntPAG+g+N HTOijgfYifP3wBCvsf/DPfCAEj+hckPXEgjDQ+AP6/tshPXZyaIzZUHeDG1Z4Q7qTPeh Zv5qhfI1+aOJTYHt7tNfAuTxByaIQn7vfdnSr+kHnj3y+3nwdQgAsDmR3FEN03fQPAJg ViWVEChzjI3Dr2cdeDdvgcHRwWr1itgblUnggc8ebAJnuDM5svk+7RMB7z02OXFQP/n6 DsEliESbVbFsrdG2BlD/cR0bLhg3aXDYH87Puefj4SoEXntl5Pvi77Wzq9+k0ay7HwcS fZIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@renesasgroup.onmicrosoft.com header.s=selector1-renesas-com header.b=i3/6jhc9; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8si3684416pli.74.2017.11.02.20.11.15; Thu, 02 Nov 2017 20:11:15 -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=@renesasgroup.onmicrosoft.com header.s=selector1-renesas-com header.b=i3/6jhc9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934726AbdKCDLO (ORCPT + 9 others); Thu, 2 Nov 2017 23:11:14 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:11765 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934725AbdKCDLN (ORCPT ); Thu, 2 Nov 2017 23:11:13 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 03 Nov 2017 12:11:12 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 6FCB554111; Fri, 3 Nov 2017 12:11:12 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.44,336,1505746800"; d="scan'208";a="261197363" Received: from mail-hk2apc01lp0213.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.213]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 03 Nov 2017 12:11:11 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=X5qPfylmRcmskCqOHibUdo7QpogaWHhdeDg7WNk8z1g=; b=i3/6jhc90Kgs1D5T7GXVlIyCKw5SlQVhK9csA87otHU5GmchCzvUwlvbnkGg59AZpDHAgAkdjOyaRaOte337smoQNQ9HA6202FPZxLk8U23urkJtWDqyb1oPE0FK3tpP82r3baort2GBIwHZN4u1Da4JoShgU1VtF0Ugrgsb/dw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nhan.nguyen.yb@renesas.com; Received: from RVC-LT-408230.rvc.renesas.com (210.245.28.11) by KL1PR0601MB1335.apcprd06.prod.outlook.com (2a01:111:e400:7910::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Fri, 3 Nov 2017 03:11:07 +0000 From: Nhan Nguyen To: gregkh@linuxfoundation.org Cc: toru.oishi.zj@renesas.com, John Stultz , David Airlie , Archit Taneja , Wolfram Sang , Lars-Peter Clausen , Laurent Pinchart , dri-devel@lists.freedesktop.org, stable@vger.kernel.org, Thong Ho , Nhan Nguyen Subject: [PATCH 4.9.y 2/3] drm/bridge: adv7511: Reuse __adv7511_power_on/off() when probing EDID Date: Fri, 3 Nov 2017 10:11:31 +0700 Message-Id: <20171103031131.14024-1-nhan.nguyen.yb@renesas.com> X-Mailer: git-send-email 2.9.3.windows.1 MIME-Version: 1.0 X-Originating-IP: [210.245.28.11] X-ClientProxiedBy: HK2PR02CA0200.apcprd02.prod.outlook.com (2603:1096:201:20::12) To KL1PR0601MB1335.apcprd06.prod.outlook.com (2a01:111:e400:7910::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f8e6a62-4026-4417-cbe9-08d522688753 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603199); SRVR:KL1PR0601MB1335; X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1335; 3:+0P+TYmO0Fho10+rw28PbYAM98wmLoRE80ru+EeXjTal2/5m+cNxtL7e4vi35E7+YH7b9IB9kBgn7q1WScctRooTygkZlnLncIAOkqkSCbeSs3NGPLhCNpuJBNsLtXCprhWVShFM4FTtxUTymIAY4hVgm+DKL77eLkHp+W0iymh7IhjlKH7Lw1dcW6d6J3G4JMX5D56GXHvhSYCQNz8HEHL2YUrS02vhtXpmekNrFWwu5wg/zm8VOTxkQMdX9bp3; 25:kaucE3CWRbg3YB1KPpPMDJLK8P+p3AQmMidxJ0jiYsUVA240UJ64S9tKtXKm6JaPte6Mp7/pZeH5PX0Fot/iCVIjb+ynjYgVJ1rURFYjCM5DX0pjzG+e/04KUyLMLKG+lajqDIykQp2qO0Rh+/CwR0bgWy1d/oB4oRLkio6kO+ivbrZ3bSSUdoO+cEnh5AdoGIHfJtnHtEVbqYFpM+0gPKRJifZmVhKdRDK+mbGe8Rz/gYgj3hwIYwJUbBACtmpTf/LQmCj9kqsaz6CDyJai28ZiuBG4de/jqpSx1wpFm/BAo1zKCXRXWFjmkgk0jqhQ/gJMoqs3+hWXyP+wSzj5TQ==; 31:9fyTGIIF49rYE4+aD7zWIe4npJk0NrAzXcPuszcgGz/wkATMf/5mPGEOq5Dp/YDwyxMvPLaMQOcTqZOqC3K6eP7j+G03rAxjN33UJ8dhM6k5oWf2EpXFl479sFw/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ispam-Report-Test: UriScan:(9452136761055)(217544274631240); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(3231021)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:KL1PR0601MB1335; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:KL1PR0601MB1335; X-Forefront-PRVS: 0480A51D4A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(979002)(6009001)(39860400002)(346002)(376002)(199003)(189002)(16526018)(36756003)(15760500003)(50986999)(2351001)(6916009)(33646002)(2906002)(5660300001)(103116003)(4326008)(105586002)(106356001)(3846002)(101416001)(1076002)(2361001)(6666003)(6116002)(6486002)(107886003)(6306002)(53936002)(68736007)(8676002)(81166006)(25786009)(8936002)(81156014)(7736002)(305945005)(5003940100001)(478600001)(575784001)(966005)(189998001)(50226002)(66066001)(47776003)(54906003)(16586007)(48376002)(50466002)(86362001)(97736004)(316002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR0601MB1335; H:RVC-LT-408230.rvc.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1335; 23:VGCP0ou+XtkXg/t2GY0tZDKPpY6D8JW74iQgKIVRz0AqUzIQIc83+b4j3KGDuCInQv+81hxLUVnfKQD3znVd1Ff5ahVXOCt5b+7ddbTQ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DiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1335; 20:KLiE9eBdynt6Uwt2MxVOtlxREHuhZEhcGaunBVeO/B46n95kPvEmo5AFHx4iNe0kBqRUa7i+9XnZ7gDbwZlR4mDF+KBTPnaWBnmF7mG06i7wXR8TQctv/2TFveQ8dfM8N267myfitmuftP+q5Z63r0LOiWTz1Qoq3bn9nGOf5VE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2017 03:11:07.5308 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f8e6a62-4026-4417-cbe9-08d522688753 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB1335 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: John Stultz commit 4226d9b127cf4758ba0e07931b3f0d59f1b1a50c upstream. Thus this patch changes the EDID probing logic so that we re-use the __adv7511_power_on/off() calls instead of duplciating logic. This does change behavior slightly as it adds the HPD signal pulse to the EDID probe path, but Archit has had a patch to add HPD signal pulse to the EDID probe path before, so this should address the cases where that helped. Another difference is that regcache_mark_dirty() is also called in the power off path once EDID is probed. Cc: David Airlie Cc: Archit Taneja Cc: Wolfram Sang Cc: Lars-Peter Clausen Cc: Laurent Pinchart Cc: dri-devel@lists.freedesktop.org Cc: stable@vger.kernel.org Reviewed-by: Laurent Pinchart Tested-by: Laurent Pinchart Signed-off-by: John Stultz Signed-off-by: Archit Taneja Signed-off-by: Thong Ho Signed-off-by: Nhan Nguyen Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-6-git-send-email-john.stultz@linaro.org --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) -- 2.7.4 diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index 545ceff..17b9e98 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -573,24 +573,13 @@ static int adv7511_get_modes(struct adv7511 *adv7511, unsigned int count; /* Reading the EDID only works if the device is powered */ - if (!adv7511->powered) { - regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER, - ADV7511_POWER_POWER_DOWN, 0); - if (adv7511->i2c_main->irq) { - regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(0), - ADV7511_INT0_EDID_READY); - regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(1), - ADV7511_INT1_DDC_ERROR); - } - adv7511->current_edid_segment = -1; - } + if (!adv7511->powered) + __adv7511_power_on(adv7511); edid = drm_do_get_edid(connector, adv7511_get_edid_block, adv7511); if (!adv7511->powered) - regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER, - ADV7511_POWER_POWER_DOWN, - ADV7511_POWER_POWER_DOWN); + __adv7511_power_off(adv7511); kfree(adv7511->edid); adv7511->edid = edid;