From patchwork Wed Jul 24 13:59:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11056885 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 5B28B112C for ; Wed, 24 Jul 2019 14:02:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4969B28796 for ; Wed, 24 Jul 2019 14:02:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D33D2881E; Wed, 24 Jul 2019 14:02:21 +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=unavailable 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 E7C7B287A0 for ; Wed, 24 Jul 2019 14:02:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F9256E575; Wed, 24 Jul 2019 14:02:19 +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 [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id CC9A26E56A; Wed, 24 Jul 2019 14:02:17 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id BC4BC26CFD5 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v5 08/24] drm/mediatek: Provide ddc symlink in hdmi connector sysfs directory Date: Wed, 24 Jul 2019 15:59:30 +0200 Message-Id: <5dbf162d824f9b6909b2a203aa050ccab05ae155.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: Sam Ravnborg , Neil Armstrong , David Airlie , Douglas Anderson , Thierry Reding , Laurent Pinchart , Armijn Hemel , 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, 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, Enrico Weigelt , Jernej Skrabec , amd-gfx@lists.freedesktop.org, Tomi Valkeinen , Thomas Zimmermann , Seung-Woo Kim , linux-kernel@vger.kernel.org, Todor Tomov , Kyungmin Park , Huang Rui , Greg Kroah-Hartman , 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 Use the ddc pointer provided by the generic connector. Signed-off-by: Andrzej Pietrasiewicz --- drivers/gpu/drm/mediatek/mtk_hdmi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index ce91b61364eb..cc4ab8b070a4 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -150,7 +150,6 @@ struct mtk_hdmi { struct device *dev; struct phy *phy; struct device *cec_dev; - struct i2c_adapter *ddc_adpt; struct clk *clk[MTK_HDMI_CLK_COUNT]; struct drm_display_mode mode; bool dvi_mode; @@ -1217,10 +1216,10 @@ static int mtk_hdmi_conn_get_modes(struct drm_connector *conn) struct edid *edid; int ret; - if (!hdmi->ddc_adpt) + if (!conn->ddc) return -ENODEV; - edid = drm_get_edid(conn, hdmi->ddc_adpt); + edid = drm_get_edid(conn, conn->ddc); if (!edid) return -ENODEV; @@ -1299,9 +1298,10 @@ static int mtk_hdmi_bridge_attach(struct drm_bridge *bridge) struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge); int ret; - ret = drm_connector_init(bridge->encoder->dev, &hdmi->conn, - &mtk_hdmi_connector_funcs, - DRM_MODE_CONNECTOR_HDMIA); + ret = drm_connector_init_with_ddc(bridge->encoder->dev, &hdmi->conn, + &mtk_hdmi_connector_funcs, + DRM_MODE_CONNECTOR_HDMIA, + hdmi->conn.ddc); if (ret) { dev_err(hdmi->dev, "Failed to initialize connector: %d\n", ret); return ret; @@ -1513,9 +1513,9 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, } of_node_put(remote); - hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np); + hdmi->conn.ddc = of_find_i2c_adapter_by_node(i2c_np); of_node_put(i2c_np); - if (!hdmi->ddc_adpt) { + if (!hdmi->conn.ddc) { dev_err(dev, "Failed to get ddc i2c adapter by node\n"); return -EINVAL; }