From patchwork Fri Jun 28 16:01:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022927 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 A12DD112C for ; Fri, 28 Jun 2019 16:05:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FD0928685 for ; Fri, 28 Jun 2019 16:05:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83438286B2; Fri, 28 Jun 2019 16:05:49 +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,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 29AD128685 for ; Fri, 28 Jun 2019 16:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=xD/xCxC73eMAvBfjmmQ+pJ4qpqnOV6Sr0zI2wxbJ228=; b=jwjXuOv+4hYyILwnft80u27YfN I6+yBY/O0YNDGL1VSjzGoTbMtAyX8Zo9Ywvg2rVc2m7isl7iniuRZDBc8wkGJEk3UZoLhL50HEvTK 3Xz9Wiw5L1GVZPbO+snAbXy4MZyIvQkzzHy1zcqCmo0MPhkrLP9Jb3tS1Cy7iUKFe0febbag4Oki3 cZ9zW7Tpg8tZXez+Apv9BLplE0JI4DA9A/H9n5lYhOKTDdo1gy74w1E+0UqwTMOiIM0v74HYGE3/k go54by1/+SOkAiCpUT28Mhg1BzMPw0cN+A+xMOPrc+auNMVwRZuBzSoCq/kOl7/SU81Te7ePpxDB8 aaVlybLQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hgtNj-0000mO-Aq; Fri, 28 Jun 2019 16:05:47 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgtNe-0000kA-Li; Fri, 28 Jun 2019 16:05:44 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 95DA0289CE6 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 08/22] drm/tegra: Provide ddc symlink in output connector sysfs directory Date: Fri, 28 Jun 2019 18:01:22 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: <3fb19371-db7d-f9dc-31a7-1ccd126f6784@collabora.com> In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190628_090542_973339_582764F0 X-CRM114-Status: GOOD ( 14.79 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Y.C. Chen" , =?utf-8?q?Heiko_St=C3=BCbner?= , Sam Ravnborg , Neil Armstrong , Maxime Ripard , linux-rockchip@lists.infradead.org, Douglas Anderson , Andrzej Hajda , Thierry Reding , Laurent Pinchart , Benjamin Gaignard , kernel@collabora.com, Fabio Estevam , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , "David \(ChunMing\) Zhou" , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , Oleksandr Andrushchenko , Vincent Abriou , Rob Clark , Krzysztof Kozlowski , Jonathan Hunter , David Airlie , Chen-Yu Tsai , Kukjin Kim , NXP Linux Team , CK Hu , Dave Airlie , freedreno@lists.freedesktop.org, linux-tegra@vger.kernel.org, Pengutronix Kernel Team , Jonas Karlman , linux-arm-msm@vger.kernel.org, Sascha Hauer , Maarten Lankhorst , Jyri Sarha , Inki Dae , Mamta Shukla , linux-mediatek@lists.infradead.org, Matthias Brugger , Daniel Vetter , Thomas Gleixner , Sean Paul , linux-arm-kernel@lists.infradead.org, amd-gfx@lists.freedesktop.org, Tomi Valkeinen , Eric Anholt , Thomas Zimmermann , Seung-Woo Kim , Sandy Huang , linux-kernel@vger.kernel.org, Todor Tomov , Kyungmin Park , Huang Rui , Philipp Zabel , Alex Deucher , Shawn Guo , =?utf-8?q?Christian_K=C3=B6nig?= , Gerd Hoffmann MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use the ddc pointer provided by the generic connector. Signed-off-by: Andrzej Pietrasiewicz --- drivers/gpu/drm/tegra/drm.h | 1 - drivers/gpu/drm/tegra/output.c | 12 ++++++------ drivers/gpu/drm/tegra/sor.c | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h index 86daa19fcf24..9bf72bcd3ec1 100644 --- a/drivers/gpu/drm/tegra/drm.h +++ b/drivers/gpu/drm/tegra/drm.h @@ -120,7 +120,6 @@ struct tegra_output { struct device *dev; struct drm_panel *panel; - struct i2c_adapter *ddc; const struct edid *edid; struct cec_notifier *cec; unsigned int hpd_irq; diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c index 274cb955e2e1..0b5037a29c63 100644 --- a/drivers/gpu/drm/tegra/output.c +++ b/drivers/gpu/drm/tegra/output.c @@ -30,8 +30,8 @@ int tegra_output_connector_get_modes(struct drm_connector *connector) if (output->edid) edid = kmemdup(output->edid, sizeof(*edid), GFP_KERNEL); - else if (output->ddc) - edid = drm_get_edid(connector, output->ddc); + else if (connector->ddc) + edid = drm_get_edid(connector, connector->ddc); cec_notifier_set_phys_addr_from_edid(output->cec, edid); drm_connector_update_edid_property(connector, edid); @@ -111,8 +111,8 @@ int tegra_output_probe(struct tegra_output *output) ddc = of_parse_phandle(output->of_node, "nvidia,ddc-i2c-bus", 0); if (ddc) { - output->ddc = of_find_i2c_adapter_by_node(ddc); - if (!output->ddc) { + output->connector.ddc = of_find_i2c_adapter_by_node(ddc); + if (!output->connector.ddc) { err = -EPROBE_DEFER; of_node_put(ddc); return err; @@ -174,8 +174,8 @@ void tegra_output_remove(struct tegra_output *output) if (output->hpd_gpio) free_irq(output->hpd_irq, output); - if (output->ddc) - put_device(&output->ddc->dev); + if (output->connector.ddc) + put_device(&output->connector.ddc->dev); } int tegra_output_init(struct drm_device *drm, struct tegra_output *output) diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 4ffe3794e6d3..77e61f98de07 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -2311,7 +2311,7 @@ static void tegra_sor_hdmi_disable_scrambling(struct tegra_sor *sor) static void tegra_sor_hdmi_scdc_disable(struct tegra_sor *sor) { - struct i2c_adapter *ddc = sor->output.ddc; + struct i2c_adapter *ddc = sor->output.connector.ddc; drm_scdc_set_high_tmds_clock_ratio(ddc, false); drm_scdc_set_scrambling(ddc, false); @@ -2339,7 +2339,7 @@ static void tegra_sor_hdmi_enable_scrambling(struct tegra_sor *sor) static void tegra_sor_hdmi_scdc_enable(struct tegra_sor *sor) { - struct i2c_adapter *ddc = sor->output.ddc; + struct i2c_adapter *ddc = sor->output.connector.ddc; drm_scdc_set_high_tmds_clock_ratio(ddc, true); drm_scdc_set_scrambling(ddc, true); @@ -2350,7 +2350,7 @@ static void tegra_sor_hdmi_scdc_enable(struct tegra_sor *sor) static void tegra_sor_hdmi_scdc_work(struct work_struct *work) { struct tegra_sor *sor = container_of(work, struct tegra_sor, scdc.work); - struct i2c_adapter *ddc = sor->output.ddc; + struct i2c_adapter *ddc = sor->output.connector.ddc; if (!drm_scdc_get_scrambling_status(ddc)) { DRM_DEBUG_KMS("SCDC not scrambled\n");