From patchwork Tue Jan 17 00:52:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 91593 Delivered-To: patches@linaro.org Received: by 10.140.20.99 with SMTP id 90csp267301qgi; Mon, 16 Jan 2017 16:53:00 -0800 (PST) X-Received: by 10.98.25.21 with SMTP id 21mr19111113pfz.46.1484614380093; Mon, 16 Jan 2017 16:53:00 -0800 (PST) Return-Path: Received: from mail-pg0-x229.google.com (mail-pg0-x229.google.com. [2607:f8b0:400e:c05::229]) by mx.google.com with ESMTPS id j62si23082109pgc.184.2017.01.16.16.53.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jan 2017 16:53:00 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::229 as permitted sender) client-ip=2607:f8b0:400e:c05::229; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::229 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-pg0-x229.google.com with SMTP id 204so19524670pge.0 for ; Mon, 16 Jan 2017 16:53:00 -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=6JyJ5RgoqRftK18waEcWXUupxdBK5DGZKck8m/LVYmQ=; b=S4PngVFTXr8LKjmMtvHPqBkfBrWWxYEvsQdq9mInyfRTd9bM0UrRLwH4c+OgfXbUOr viLn5x7lwEYGbOHvK/xxQf39A/JXkGF4Py35cARC7A5Cf+oKk+BTyKfqQ486GN5dg7I1 vqNPkXNYpLwv64zk4JzqhR0aC0Q1l5TkYILcQ= 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=6JyJ5RgoqRftK18waEcWXUupxdBK5DGZKck8m/LVYmQ=; b=bULebtHGdHHMCC9vYyZYYARZB4QwY7OfYlfFKlztw0sHGbxZxYNJHxuHQ/F6qbAZAg a85wPbVOYtr5KV0duNZHK7VTvUx9kS/OkrExUgW39FC3Ob/xyGNg3JbDZiDc73z8/e2P WrYhAfKU4TlFl3xpYVHxf9t0eVZ0ND2v46YDwHVqkSbt0O2vrKtR0IkYUNKZRti1FuZf hXfc0xah1DSby7WBlFn9Lf3p0bWIoK+3cxEA7IgEynfWRcZbJUfJmUEgSt7uySDOxEmK z+XHHmafh+wwIdZCv2eTXLY2OGb0caImaisNtRAuW08zi8/fqhxtCdLMXipvfQpwx33+ +Z8Q== X-Gm-Message-State: AIkVDXKkKEpTsldvYttpW1a0mGrvSOuQx18yatvjuzFBbVsY0uDaMEkC3PD7UrPIyxfew0NRTs0= X-Received: by 10.98.131.136 with SMTP id h130mr37407691pfe.4.1484614379631; Mon, 16 Jan 2017 16:52:59 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id q19sm50220516pfl.21.2017.01.16.16.52.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 16:52:59 -0800 (PST) From: John Stultz To: lkml Cc: Archit Taneja , David Airlie , Wolfram Sang , Lars-Peter Clausen , Laurent Pinchart , dri-devel@lists.freedesktop.org, John Stultz Subject: [PATCH 3/6] drm/bridge: adv7511: Enable HPD interrupts to support hotplug and improve monitor detection Date: Mon, 16 Jan 2017 16:52:49 -0800 Message-Id: <1484614372-15342-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484614372-15342-1-git-send-email-john.stultz@linaro.org> References: <1484614372-15342-1-git-send-email-john.stultz@linaro.org> From: Archit Taneja On some adv7511 implementations, we can get some spurious disconnect signals which can cause monitor probing to fail. This patch enables HPD (hot plug detect) interrupt support which allows the monitor to be properly re-initialized when the spurious disconnect signal goes away. This also enables proper hotplug support. Cc: David Airlie Cc: Archit Taneja Cc: Wolfram Sang Cc: Lars-Peter Clausen Cc: Laurent Pinchart Cc: dri-devel@lists.freedesktop.org Acked-by: Laurent Pinchart Tested-by: Laurent Pinchart Originally-by: Archit Taneja [jstultz: Added proper commit message] Signed-off-by: John Stultz --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index 7b2b5af..405e460 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -338,7 +338,7 @@ static void adv7511_power_on(struct adv7511 *adv7511) * Still, let's be safe and stick to the documentation. */ regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(0), - ADV7511_INT0_EDID_READY); + ADV7511_INT0_EDID_READY | ADV7511_INT0_HPD); regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(1), ADV7511_INT1_DDC_ERROR); } @@ -846,6 +846,10 @@ static int adv7511_bridge_attach(struct drm_bridge *bridge) if (adv->type == ADV7533) ret = adv7533_attach_dsi(adv); + if (adv->i2c_main->irq) + regmap_write(adv->regmap, ADV7511_REG_INT_ENABLE(0), + ADV7511_INT0_HPD); + return ret; }