From patchwork Wed Jul 24 13:59:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11056847 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 7E50E138D for ; Wed, 24 Jul 2019 14:01:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DE7128617 for ; Wed, 24 Jul 2019 14:01:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 611FC28882; Wed, 24 Jul 2019 14:01:09 +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,UNPARSEABLE_RELAY 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 8577A28868 for ; Wed, 24 Jul 2019 14:01:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C0966E562; Wed, 24 Jul 2019 14:01:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3663C6E55D; Wed, 24 Jul 2019 14:01:05 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id EE3BB260454 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v5 03/24] drm/exynos: Provide ddc symlink in connector's sysfs Date: Wed, 24 Jul 2019 15:59:25 +0200 Message-Id: <6fea36724e29e0a6629a19a821727043e730a1e5.1563960855.git.andrzej.p@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: 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: amd-gfx@lists.freedesktop.org, Sam Ravnborg , Neil Armstrong , David Airlie , Douglas Anderson , Thierry Reding , Laurent Pinchart , kernel@collabora.com, linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Vincent Abriou , Krzysztof Kozlowski , Jonathan Hunter , Maxime Ripard , Chen-Yu Tsai , Kukjin Kim , NXP Linux Team , Dave Airlie , intel-gfx@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-tegra@vger.kernel.org, Jonas Karlman , linux-arm-msm@vger.kernel.org, Alexios Zavras , Mamta Shukla , linux-mediatek@lists.infradead.org, Jyri Sarha , Rodrigo Vivi , Matthias Brugger , Thomas Gleixner , Sean Paul , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org, Jernej Skrabec , Tomi Valkeinen , Thomas Zimmermann , Seung-Woo Kim , linux-kernel@vger.kernel.org, Todor Tomov , Kyungmin Park , Huang Rui , Alex Deucher , Shawn Guo , =?utf-8?q?Christian_K=C3=B6nig?= , Gerd Hoffmann MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Switch to using the ddc provided by the generic connector. Signed-off-by: Andrzej Pietrasiewicz --- drivers/gpu/drm/exynos/exynos_hdmi.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index bc1565f1822a..dda94de4afe0 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -125,7 +125,6 @@ struct hdmi_context { void __iomem *regs; void __iomem *regs_hdmiphy; struct i2c_client *hdmiphy_port; - struct i2c_adapter *ddc_adpt; struct gpio_desc *hpd_gpio; int irq; struct regmap *pmureg; @@ -871,10 +870,10 @@ static int hdmi_get_modes(struct drm_connector *connector) struct edid *edid; int ret; - if (!hdata->ddc_adpt) + if (!connector->ddc) return -ENODEV; - edid = drm_get_edid(connector, hdata->ddc_adpt); + edid = drm_get_edid(connector, connector->ddc); if (!edid) return -ENODEV; @@ -940,8 +939,10 @@ static int hdmi_create_connector(struct drm_encoder *encoder) connector->interlace_allowed = true; connector->polled = DRM_CONNECTOR_POLL_HPD; - ret = drm_connector_init(hdata->drm_dev, connector, - &hdmi_connector_funcs, DRM_MODE_CONNECTOR_HDMIA); + ret = drm_connector_init_with_ddc(hdata->drm_dev, connector, + &hdmi_connector_funcs, + DRM_MODE_CONNECTOR_HDMIA, + connector->ddc); if (ret) { DRM_DEV_ERROR(hdata->dev, "Failed to initialize connector with drm\n"); @@ -1892,7 +1893,7 @@ static int hdmi_get_ddc_adapter(struct hdmi_context *hdata) return -EPROBE_DEFER; } - hdata->ddc_adpt = adpt; + hdata->connector.ddc = adpt; return 0; } @@ -2044,7 +2045,7 @@ static int hdmi_probe(struct platform_device *pdev) if (hdata->regs_hdmiphy) iounmap(hdata->regs_hdmiphy); err_ddc: - put_device(&hdata->ddc_adpt->dev); + put_device(&hdata->connector.ddc->dev); return ret; } @@ -2071,7 +2072,7 @@ static int hdmi_remove(struct platform_device *pdev) if (hdata->regs_hdmiphy) iounmap(hdata->regs_hdmiphy); - put_device(&hdata->ddc_adpt->dev); + put_device(&hdata->connector.ddc->dev); mutex_destroy(&hdata->mutex);