From patchwork Wed Jul 24 13:59:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11056901 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 A03CE746 for ; Wed, 24 Jul 2019 14:03:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FC782873E for ; Wed, 24 Jul 2019 14:03:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82C5A28617; Wed, 24 Jul 2019 14:03:07 +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 35383287A0 for ; Wed, 24 Jul 2019 14:03:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC4066E568; Wed, 24 Jul 2019 14:03:05 +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 33FEB6E568; Wed, 24 Jul 2019 14:03:04 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 85290263BB0 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v5 11/24] drm/imx: imx-tve: Provide ddc symlink in connector's sysfs Date: Wed, 24 Jul 2019 15:59:33 +0200 Message-Id: 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 , kernel@collabora.com, linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Oleksandr Andrushchenko , 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 , Allison Randal , 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 , 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/imx/imx-tve.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c index 649515868f86..e25df9bba393 100644 --- a/drivers/gpu/drm/imx/imx-tve.c +++ b/drivers/gpu/drm/imx/imx-tve.c @@ -111,7 +111,6 @@ struct imx_tve { struct regmap *regmap; struct regulator *dac_reg; - struct i2c_adapter *ddc; struct clk *clk; struct clk *di_sel_clk; struct clk_hw clk_hw_di; @@ -220,14 +219,13 @@ static int tve_setup_vga(struct imx_tve *tve) static int imx_tve_connector_get_modes(struct drm_connector *connector) { - struct imx_tve *tve = con_to_tve(connector); struct edid *edid; int ret = 0; - if (!tve->ddc) + if (!connector->ddc) return 0; - edid = drm_get_edid(connector, tve->ddc); + edid = drm_get_edid(connector, connector->ddc); if (edid) { drm_connector_update_edid_property(connector, edid); ret = drm_add_edid_modes(connector, edid); @@ -484,8 +482,10 @@ static int imx_tve_register(struct drm_device *drm, struct imx_tve *tve) drm_connector_helper_add(&tve->connector, &imx_tve_connector_helper_funcs); - drm_connector_init(drm, &tve->connector, &imx_tve_connector_funcs, - DRM_MODE_CONNECTOR_VGA); + drm_connector_init_with_ddc(drm, &tve->connector, + &imx_tve_connector_funcs, + DRM_MODE_CONNECTOR_VGA, + tve->connector.ddc); drm_connector_attach_encoder(&tve->connector, &tve->encoder); @@ -553,7 +553,7 @@ static int imx_tve_bind(struct device *dev, struct device *master, void *data) ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0); if (ddc_node) { - tve->ddc = of_find_i2c_adapter_by_node(ddc_node); + tve->connector.ddc = of_find_i2c_adapter_by_node(ddc_node); of_node_put(ddc_node); }