From patchwork Fri Jun 28 16:01:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022893 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 2D86817D2 for ; Fri, 28 Jun 2019 16:04:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AA2C2882A for ; Fri, 28 Jun 2019 16:04:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B5352886F; Fri, 28 Jun 2019 16:04:35 +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 9F6262886B for ; Fri, 28 Jun 2019 16:04:34 +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=tZefUNUu9aQ3lBmbp3f/cCaub1NmFBmyErErY+BQg2I=; b=jNdK2gSURLlhmdldwMhJqsyDCe LpJiXN6ZEwwkbHQtVLMm2io7E+JLDcsfDIkx7vjk9V1lyn8PH1GP34o+2nCpBneVIkhQ1CGvZhp9X olKIqrIMGE+6YZSlJsWXYe10aJyObiA8RqALovMrvtLNm2/M4re/coUAIgXLUMUDP0NCRnHIkjYHC j3OhcpwfSUYqxgs2Gf04CCJ15aULofaXikmifUnvGvXrTrdy9TvbJBqmWhVmGy9QDRUff4CVRkdB/ e0GHvQM5JaEr1viWGkvmy9mI4i/swaCTYMJnA1CsKxzRpXjovQUp3QdG0nh2weIz0iEShl1OyDVos ZNXQ0OAw==; 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 1hgtMV-0007Im-HK; Fri, 28 Jun 2019 16:04:31 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgtMQ-0007EQ-5U; Fri, 28 Jun 2019 16:04:27 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 110AC27FD65 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 01/22] drm: Include ddc adapter pointer in struct drm_connector Date: Fri, 28 Jun 2019 18:01:15 +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_090426_481426_7769C64A X-CRM114-Status: GOOD ( 13.95 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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, Jernej Skrabec , 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 Add generic code which creates symbolic links in sysfs, pointing to ddc interface used by a particular video output. For example: ls -l /sys/class/drm/card0-HDMI-A-1/ddc lrwxrwxrwx 1 root root 0 Jun 24 10:42 /sys/class/drm/card0-HDMI-A-1/ddc \ -> ../../../../soc/13880000.i2c/i2c-2 This makes it easy for user to associate a display with its ddc adapter and use e.g. ddcutil to control the chosen monitor. This patch adds an i2c_adapter pointer to struct drm_connector. Particular drivers can then use it instead of using their own private instance. If a connector contains a ddc, then create a symbolic link in sysfs. Signed-off-by: Andrzej Pietrasiewicz Acked-by: Daniel Vetter Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/drm_sysfs.c | 7 +++++++ include/drm/drm_connector.h | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index ad10810bc972..26d359b39785 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -294,6 +294,9 @@ int drm_sysfs_connector_add(struct drm_connector *connector) /* Let userspace know we have a new connector */ drm_sysfs_hotplug_event(dev); + if (connector->ddc) + return sysfs_create_link(&connector->kdev->kobj, + &connector->ddc->dev.kobj, "ddc"); return 0; } @@ -301,6 +304,10 @@ void drm_sysfs_connector_remove(struct drm_connector *connector) { if (!connector->kdev) return; + + if (connector->ddc) + sysfs_remove_link(&connector->kdev->kobj, "ddc"); + DRM_DEBUG("removing \"%s\" from sysfs\n", connector->name); diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index ca745d9feaf5..1ad3d1d54ba7 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -23,6 +23,7 @@ #ifndef __DRM_CONNECTOR_H__ #define __DRM_CONNECTOR_H__ +#include #include #include #include @@ -1308,6 +1309,16 @@ struct drm_connector { * [0]: progressive, [1]: interlaced */ int audio_latency[2]; + + /** + * @ddc: associated ddc adapter. + * A connector usually has its associated ddc adapter. If a driver uses + * this field, then an appropriate symbolic link is created in connector + * sysfs directory to make it easy for the user to tell which i2c + * adapter is for a particular display. + */ + struct i2c_adapter *ddc; + /** * @null_edid_counter: track sinks that give us all zeros for the EDID. * Needed to workaround some HW bugs where we get all 0s From patchwork Fri Jun 28 16:01:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022903 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 447CE112C for ; Fri, 28 Jun 2019 16:04:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 322162886A for ; Fri, 28 Jun 2019 16:04:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24FC828812; Fri, 28 Jun 2019 16:04:45 +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 D044C28806 for ; Fri, 28 Jun 2019 16:04:44 +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=i9Hpzc1cBTNh1StdvtWZmxmhq5EvK0viYnlOHKdGgJE=; b=DgJPxMuirI7BuhsqXUB/Y5aD9M PBiIL+IEPdAv5udTbFQ2Nm251AzXCA0GTlT+V570Qp3hab/BjuA54Hp/hKvJFa2+rtvq5uszLJdtf Ug5ri2q5kIw3/+fkrMYRib2od4WrFyN34n/XLVxfQivr7Tmq5gy5W+XKJQecQ6+6l+tT/WzuZWhju PyCeuuVmhiHRSrZf7TL9TJ937FHSsJXVhn1yb/IelCD3KQvCzUNWumKe1gGhMKf/DT8AAs+J+E5IL DjAy2CfBMYNRZXATh3sHJnktOomGFvAXtcmCxv4s67KgPQ4yxd16POm4p/ImEYT6AGCH7pM71hs8+ RQ0E8QMg==; 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 1hgtMg-0007TE-Qq; Fri, 28 Jun 2019 16:04:42 +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 1hgtMb-0007N5-20; Fri, 28 Jun 2019 16:04:38 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 9083C280AB5 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 02/22] drm/exynos: Provide ddc symlink in connector's sysfs Date: Fri, 28 Jun 2019 18:01:16 +0200 Message-Id: <3f7bbe3420bbd30a21c771b7c9c24d9a23c85000.1561735433.git.andrzej.p@collabora.com> 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_090437_382896_E9AFD16F X-CRM114-Status: GOOD ( 13.41 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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 , Jani Nikula , 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 Switch to using the ddc provided by the generic connector. Signed-off-by: Andrzej Pietrasiewicz --- drivers/gpu/drm/exynos/exynos_hdmi.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 894a99793633..6816e37861b7 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -126,7 +126,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; @@ -872,10 +871,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; @@ -1893,7 +1892,7 @@ static int hdmi_get_ddc_adapter(struct hdmi_context *hdata) return -EPROBE_DEFER; } - hdata->ddc_adpt = adpt; + hdata->connector.ddc = adpt; return 0; } @@ -2045,7 +2044,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; } @@ -2072,7 +2071,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); From patchwork Fri Jun 28 16:01:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022907 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 A664514BB for ; Fri, 28 Jun 2019 16:04:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94B6F28846 for ; Fri, 28 Jun 2019 16:04:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 880CC28868; Fri, 28 Jun 2019 16:04:55 +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 2F45528846 for ; Fri, 28 Jun 2019 16:04:55 +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=hfisEg54hQ08y2Jj0/EDoEZUwxBGqzDxJWP5SDlHLrY=; b=hH/tpRci4qH+kqDuND8w9rulNy eb4013EtE7TJUcQZVnFK1vFC+BXyfQX77UXqtRhQakPEASWKFd51nzM91VTGf34yc1uNYIT3wb44J RCDm9tqXeiqwKWJGQ8mH8ojMXelQfoNg1V7NCV+rd6vCFSCqXv4eHq6H2CpDrIcYtKmNx4ohxVRbK kyERHT6nx/hZloP9rtvngSpSKukYQQk0OAFPykp2+8iNtq+R8Fyzr1pVwpPAa108XeZRFyUb5eL+C 7AZIbUz75abCUwdlTrYvZKLr0SD9+6IpCbbxIUGIkOB+mVbc3MIKI8oY6l0DbqabWPRsVMdgBcBaN 2jMCBsng==; 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 1hgtMr-0007ZF-C2; Fri, 28 Jun 2019 16:04:53 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgtMl-0007Wl-Vl; Fri, 28 Jun 2019 16:04:49 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id D0079288F94 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 03/22] drm: rockchip: Provide ddc symlink in rk3066_hdmi sysfs directory Date: Fri, 28 Jun 2019 18:01:17 +0200 Message-Id: <7277b8bc964610ee8eb77b379d3ace679cdb5b3f.1561735433.git.andrzej.p@collabora.com> 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_090448_309159_6F85FE78 X-CRM114-Status: GOOD ( 14.70 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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 , Alexios Zavras , Mamta Shukla , linux-mediatek@lists.infradead.org, Matthias Brugger , Daniel Vetter , Thomas Gleixner , Sean Paul , linux-arm-kernel@lists.infradead.org, Enrico Weigelt , 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/rockchip/rk3066_hdmi.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c index 85fc5f01f761..1f3e630ecdab 100644 --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c @@ -49,7 +49,6 @@ struct rk3066_hdmi { struct drm_encoder encoder; struct rk3066_hdmi_i2c *i2c; - struct i2c_adapter *ddc; unsigned int tmdsclk; @@ -470,10 +469,10 @@ static int rk3066_hdmi_connector_get_modes(struct drm_connector *connector) struct edid *edid; int ret = 0; - if (!hdmi->ddc) + if (!connector->ddc) return 0; - edid = drm_get_edid(connector, hdmi->ddc); + edid = drm_get_edid(connector, connector->ddc); if (edid) { hdmi->hdmi_data.sink_is_hdmi = drm_detect_hdmi_monitor(edid); drm_connector_update_edid_property(connector, edid); @@ -789,10 +788,10 @@ static int rk3066_hdmi_bind(struct device *dev, struct device *master, /* internal hclk = hdmi_hclk / 25 */ hdmi_writeb(hdmi, HDMI_INTERNAL_CLK_DIVIDER, 25); - hdmi->ddc = rk3066_hdmi_i2c_adapter(hdmi); - if (IS_ERR(hdmi->ddc)) { - ret = PTR_ERR(hdmi->ddc); - hdmi->ddc = NULL; + hdmi->connector.ddc = rk3066_hdmi_i2c_adapter(hdmi); + if (IS_ERR(hdmi->connector.ddc)) { + ret = PTR_ERR(hdmi->connector.ddc); + hdmi->connector.ddc = NULL; goto err_disable_hclk; } @@ -824,7 +823,7 @@ static int rk3066_hdmi_bind(struct device *dev, struct device *master, hdmi->connector.funcs->destroy(&hdmi->connector); hdmi->encoder.funcs->destroy(&hdmi->encoder); err_disable_i2c: - i2c_put_adapter(hdmi->ddc); + i2c_put_adapter(hdmi->connector.ddc); err_disable_hclk: clk_disable_unprepare(hdmi->hclk); @@ -839,7 +838,7 @@ static void rk3066_hdmi_unbind(struct device *dev, struct device *master, hdmi->connector.funcs->destroy(&hdmi->connector); hdmi->encoder.funcs->destroy(&hdmi->encoder); - i2c_put_adapter(hdmi->ddc); + i2c_put_adapter(hdmi->connector.ddc); clk_disable_unprepare(hdmi->hclk); } From patchwork Fri Jun 28 16:01:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022911 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 61BEF14BB for ; Fri, 28 Jun 2019 16:05:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F48E286B2 for ; Fri, 28 Jun 2019 16:05:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41CAD28857; Fri, 28 Jun 2019 16:05: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,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 AEC832871C for ; Fri, 28 Jun 2019 16:05:06 +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=drvzdERtDLh49vtLDHu539tceFwIGWCSkH+/TY8oAU4=; b=cKeYIXbXUdyFbkrRlM7bJSMQO+ DeGPH5HEwzvg4mnwQuz/+XeNRa+bGCZrU0wc8aqUUrMXVzhusuvb4UCYv4E8/MzLqQ12Gke2ylBUz tMaQBwEdPoUPZOohldzqLuzXTGmbj+cBjBV4EpWtj05E9h/uP98CB242fIE25Q62RaSJVLRlIUa+w x8Agh0ZQ9PinogjUdrxWdZvwNiYccP8yZYp1TtxfMbwo2jCOtmHpVQnkZ+F1+TSFhMc1VMuXuIc2x 1m7iDZjep1GSmoUBd2m07bbu3HppVMI3nJ1pQm6EdOFugC3Sa5kwbrlkJ/u0IQFeZqWyv8SQ4zU5i EgQO/9pQ==; 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 1hgtN1-0007qa-QZ; Fri, 28 Jun 2019 16:05:04 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgtMw-0007cI-S3; Fri, 28 Jun 2019 16:05:00 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id B9EB728944C From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 04/22] drm: rockchip: Provide ddc symlink in inno_hdmi sysfs directory Date: Fri, 28 Jun 2019 18:01:18 +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_090459_178745_F5879F89 X-CRM114-Status: GOOD ( 14.51 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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 , Alexios Zavras , 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 , Greg Kroah-Hartman , 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/rockchip/inno_hdmi.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index f8ca98d294d0..d64b119c2649 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -59,7 +59,6 @@ struct inno_hdmi { struct drm_encoder encoder; struct inno_hdmi_i2c *i2c; - struct i2c_adapter *ddc; unsigned int tmds_rate; @@ -552,10 +551,10 @@ static int inno_hdmi_connector_get_modes(struct drm_connector *connector) struct edid *edid; int ret = 0; - if (!hdmi->ddc) + if (!hdmi->connector.ddc) return 0; - edid = drm_get_edid(connector, hdmi->ddc); + edid = drm_get_edid(connector, hdmi->connector.ddc); if (edid) { hdmi->hdmi_data.sink_is_hdmi = drm_detect_hdmi_monitor(edid); hdmi->hdmi_data.sink_has_audio = drm_detect_monitor_audio(edid); @@ -850,10 +849,10 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, inno_hdmi_reset(hdmi); - hdmi->ddc = inno_hdmi_i2c_adapter(hdmi); - if (IS_ERR(hdmi->ddc)) { - ret = PTR_ERR(hdmi->ddc); - hdmi->ddc = NULL; + hdmi->connector.ddc = inno_hdmi_i2c_adapter(hdmi); + if (IS_ERR(hdmi->connector.ddc)) { + ret = PTR_ERR(hdmi->connector.ddc); + hdmi->connector.ddc = NULL; goto err_disable_clk; } @@ -886,7 +885,7 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, hdmi->connector.funcs->destroy(&hdmi->connector); hdmi->encoder.funcs->destroy(&hdmi->encoder); err_put_adapter: - i2c_put_adapter(hdmi->ddc); + i2c_put_adapter(hdmi->connector.ddc); err_disable_clk: clk_disable_unprepare(hdmi->pclk); return ret; @@ -900,7 +899,7 @@ static void inno_hdmi_unbind(struct device *dev, struct device *master, hdmi->connector.funcs->destroy(&hdmi->connector); hdmi->encoder.funcs->destroy(&hdmi->encoder); - i2c_put_adapter(hdmi->ddc); + i2c_put_adapter(hdmi->connector.ddc); clk_disable_unprepare(hdmi->pclk); } From patchwork Fri Jun 28 16:01:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022915 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 36D51112C for ; Fri, 28 Jun 2019 16:05:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 264AB2871C for ; Fri, 28 Jun 2019 16:05:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 182F428852; Fri, 28 Jun 2019 16:05:17 +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 D1DE12871C for ; Fri, 28 Jun 2019 16:05:16 +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=0qGWxZKsZCrdOiWxC+kJa73GwNhYoI+9q2YOdvWckrU=; b=eHzVRM0Hnj3Fpo1HCLPVb42+9M KKEhIw947WNa8+L2KIxqqOaGyRGLnTrdBWaYbxb1Vv8eGxRHLUZ2e3skXK5wk9UIh1/ucm7ZjCAkG g5/ruHDws2szatfIS/+V6KQ+p37U+/XLhBtIql/t+EKCQ+QEp5gCGB0QNOZ0VSC1KTN+JqQlxNiIR tPz8Yb0inKGWD0MhI1FKNIyWLEw29lPuRap0cQ/4EZz+oEs8hXh9Z2m9/394DMSXt4S4F+P22ZM9L w+kcT2/kFE9wacGSKkiE+m/pYbYmNKHQoBURAO5967Fz53+ccL5n0AXv1sn32DLTwEa6YGfZ6jInN IHdXoyug==; 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 1hgtNC-0000UH-9G; Fri, 28 Jun 2019 16:05:14 +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 1hgtN7-0008Vr-VA; Fri, 28 Jun 2019 16:05:11 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id C4143289CE4 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 05/22] drm/msm/hdmi: Provide ddc symlink in hdmi connector sysfs directory Date: Fri, 28 Jun 2019 18:01:19 +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_090510_154295_5D54E98E X-CRM114-Status: GOOD ( 11.28 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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, Enrico Weigelt , 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/msm/hdmi/hdmi_connector.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c index 07b4cb877d82..4979e3362687 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c @@ -461,6 +461,7 @@ struct drm_connector *msm_hdmi_connector_init(struct hdmi *hdmi) connector->doublescan_allowed = 0; drm_connector_attach_encoder(connector, hdmi->encoder); + connector->ddc = hdmi->i2c; return connector; } From patchwork Fri Jun 28 16:01:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022919 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 1FDAF14BB for ; Fri, 28 Jun 2019 16:05:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E6BB283A8 for ; Fri, 28 Jun 2019 16:05:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0182F28714; Fri, 28 Jun 2019 16:05:27 +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 A5C8B283A8 for ; Fri, 28 Jun 2019 16:05:27 +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=0/nd2Um2L1FKi3CtnuartIctX99hw6Tc5pNd0ExSYXs=; b=V++1mfUK17Avhro+y+7VmgkFBi 8m/qGrUKPQuf08yf/+EjpbYkk4xD1G86qZHt3jfi/WSz26+akmDfiWwxg0GCzKaWc3ZghNOid13PX r1m0RLUsxYXraPko8sCie3ztX5A3NYX/bt2meOerdC+4ShIzXMBAiFPNZDK28bJfGU4Audvmfnx/h Oi+E+3duGXEmBbwc+v7xsxN4HO/5iz1TpfavrdqgQWyajUcO3AcdQk+FhDhBszeY26qCPnJOBgRpi RK61LmSdPffgJyks0xIFLeOXyM7aqJ72UZEBMbFjFWZdZgLiOc8/uqiI2UupG/sIYCwAw8PEC+EVa oFxDtmvQ==; 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 1hgtNN-0000ab-UZ; Fri, 28 Jun 2019 16:05:25 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgtNI-0000YL-RI; Fri, 28 Jun 2019 16:05:22 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id AEAAC289CE5 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 06/22] drm/sun4i: hdmi: Provide ddc symlink in sun4i hdmi connector sysfs directory Date: Fri, 28 Jun 2019 18:01:20 +0200 Message-Id: <4fa046adb68a57c0ee63f5d31da8af2ed8de2c57.1561735433.git.andrzej.p@collabora.com> 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_090521_152917_70DAAE90 X-CRM114-Status: GOOD ( 14.84 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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 , Jani Nikula , linux-arm-msm@vger.kernel.org, Sascha Hauer , Maarten Lankhorst , Jyri Sarha , Inki Dae , Alexios Zavras , 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/sun4i/sun4i_hdmi.h | 1 - drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi.h b/drivers/gpu/drm/sun4i/sun4i_hdmi.h index 7ad3f06c127e..1649273b1493 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi.h +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi.h @@ -265,7 +265,6 @@ struct sun4i_hdmi { struct clk *tmds_clk; struct i2c_adapter *i2c; - struct i2c_adapter *ddc_i2c; /* Regmap fields for I2C adapter */ struct regmap_field *field_ddc_en; diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c index 9c3f99339b82..250bec00dc35 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c @@ -213,7 +213,7 @@ static int sun4i_hdmi_get_modes(struct drm_connector *connector) struct edid *edid; int ret; - edid = drm_get_edid(connector, hdmi->ddc_i2c ?: hdmi->i2c); + edid = drm_get_edid(connector, connector->ddc ?: hdmi->i2c); if (!edid) return 0; @@ -598,11 +598,11 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master, goto err_disable_mod_clk; } - hdmi->ddc_i2c = sun4i_hdmi_get_ddc(dev); - if (IS_ERR(hdmi->ddc_i2c)) { - ret = PTR_ERR(hdmi->ddc_i2c); + hdmi->connector.ddc = sun4i_hdmi_get_ddc(dev); + if (IS_ERR(hdmi->connector.ddc)) { + ret = PTR_ERR(hdmi->connector.ddc); if (ret == -ENODEV) - hdmi->ddc_i2c = NULL; + hdmi->connector.ddc = NULL; else goto err_del_i2c_adapter; } @@ -663,7 +663,7 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master, cec_delete_adapter(hdmi->cec_adap); drm_encoder_cleanup(&hdmi->encoder); err_put_ddc_i2c: - i2c_put_adapter(hdmi->ddc_i2c); + i2c_put_adapter(hdmi->connector.ddc); err_del_i2c_adapter: i2c_del_adapter(hdmi->i2c); err_disable_mod_clk: @@ -684,7 +684,7 @@ static void sun4i_hdmi_unbind(struct device *dev, struct device *master, drm_connector_cleanup(&hdmi->connector); drm_encoder_cleanup(&hdmi->encoder); i2c_del_adapter(hdmi->i2c); - i2c_put_adapter(hdmi->ddc_i2c); + i2c_put_adapter(hdmi->connector.ddc); clk_disable_unprepare(hdmi->mod_clk); clk_disable_unprepare(hdmi->bus_clk); } From patchwork Fri Jun 28 16:01:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022923 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 C5698112C for ; Fri, 28 Jun 2019 16:05:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3F9A286B1 for ; Fri, 28 Jun 2019 16:05:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7352286B3; Fri, 28 Jun 2019 16:05:37 +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 5EAA9286B2 for ; Fri, 28 Jun 2019 16:05:37 +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=4dAOn9uy3So1V4PF5Fm/f4kIcotABEMwzw4dhgXx0qQ=; b=QY0inD/Q2DEzvPB//GF1J88pgH SR4wt9zD29HWUN19dstJ/FZbpoVnXHwjouZni+QRjlejOjwIWlDtQcSxybVROy4Hwrf+b4w8K2Skb KkKyEhAJScRenMRFI5aHyUyC9HSInKB8Ig/I43e1DQWow7CXJsAoc9R9c10JhG/iCBQ97hvDTbFlG fvNW2++XpsSccfUwWOWNm0uA41/aYkcLU0Lp6CXcollBe43bMs644ijGtd6VqCrI3W+dnSdEnFACh ax0k6qqmQF6oAeryjDuIdhcPVIoH/6WiEW7Fn9u8v2SLzTr9d/tJosbrz6Bjxj6+HbMVWw5gz3KQ4 B8xuCzdg==; 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 1hgtNX-0000gK-EV; Fri, 28 Jun 2019 16:05:35 +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 1hgtNT-0000e1-N8; Fri, 28 Jun 2019 16:05:33 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id A22CA289CE8 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 07/22] drm/mediatek: Provide ddc symlink in hdmi connector sysfs directory Date: Fri, 28 Jun 2019 18:01:21 +0200 Message-Id: <0dd014de0ff9cc5098a1b5145b4e65afe9726982.1561735433.git.andrzej.p@collabora.com> 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_090532_017367_66F2954E X-CRM114-Status: GOOD ( 13.15 ) 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/mediatek/mtk_hdmi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index 5d6a9f094df5..6c5321dcc4b8 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -146,7 +146,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; @@ -1213,10 +1212,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; @@ -1509,9 +1508,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; } 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"); From patchwork Fri Jun 28 16:01:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022931 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 D4628112C for ; Fri, 28 Jun 2019 16:06:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C15E928740 for ; Fri, 28 Jun 2019 16:06:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B499F28763; Fri, 28 Jun 2019 16:06:14 +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 6595A28740 for ; Fri, 28 Jun 2019 16:06:14 +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=6bY6xROW1Wf1ZPm1vd/uCwitcJNHCbLtHrUOZ3dfhYU=; b=JO8MVORtG2IoeS/dhVMF8G5K1S UMHPjO3a7Q+x2sa2QahqCbaiSdABL4OVZa5ZlETYpRbCOGL9DXv/fB34rGt3MBopqpPbqlWr7wIAS TX27i+uUq9Qk8BuWNj/2lxyXJKlzW98xRxaaZsHeE6WtVnG4X9USpvLB3Rw0bgG5jvYKmxNoNaphJ bDjsCAR5ISkvYbGcOEmxgDXr3+QQWxbAtkDp9a4nBWxDRmrg2jpOXPiFz5nkeQxUpXw47u4e4Rtfy UA/47xkeeDFiq1SfMzgxlh34im7pyKsu56ZHBKlGUImgdG65CET6SF2vXnxNS8+8+7S68JlJpeW0/ mmR94pHQ==; 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 1hgtO7-000195-WA; Fri, 28 Jun 2019 16:06:12 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgtNr-0000te-27; Fri, 28 Jun 2019 16:05:57 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id D51B8289CEA From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 09/22] drm/imx: imx-ldb: Provide ddc symlink in connector's sysfs Date: Fri, 28 Jun 2019 18:01:23 +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_090556_149477_3D48F6F9 X-CRM114-Status: GOOD ( 14.33 ) 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 , Liviu Dudau , 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 , linux-rockchip@lists.infradead.org, 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 , Greg Kroah-Hartman , 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/imx/imx-ldb.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c index 383733302280..44fdb264339e 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -55,7 +55,6 @@ struct imx_ldb_channel { struct drm_bridge *bridge; struct device_node *child; - struct i2c_adapter *ddc; int chno; void *edid; int edid_len; @@ -131,8 +130,8 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector) return num_modes; } - if (!imx_ldb_ch->edid && imx_ldb_ch->ddc) - imx_ldb_ch->edid = drm_get_edid(connector, imx_ldb_ch->ddc); + if (!imx_ldb_ch->edid && connector->ddc) + imx_ldb_ch->edid = drm_get_edid(connector, connector->ddc); if (imx_ldb_ch->edid) { drm_connector_update_edid_property(connector, @@ -550,15 +549,15 @@ static int imx_ldb_panel_ddc(struct device *dev, ddc_node = of_parse_phandle(child, "ddc-i2c-bus", 0); if (ddc_node) { - channel->ddc = of_find_i2c_adapter_by_node(ddc_node); + channel->connector.ddc = of_find_i2c_adapter_by_node(ddc_node); of_node_put(ddc_node); - if (!channel->ddc) { + if (!channel->connector.ddc) { dev_warn(dev, "failed to get ddc i2c adapter\n"); return -EPROBE_DEFER; } } - if (!channel->ddc) { + if (!channel->connector.ddc) { /* if no DDC available, fallback to hardcoded EDID */ dev_dbg(dev, "no ddc available\n"); @@ -725,7 +724,7 @@ static void imx_ldb_unbind(struct device *dev, struct device *master, drm_panel_detach(channel->panel); kfree(channel->edid); - i2c_put_adapter(channel->ddc); + i2c_put_adapter(channel->connector.ddc); } } From patchwork Fri Jun 28 16:01:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022935 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 61A2D112C for ; Fri, 28 Jun 2019 16:06:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51113286B8 for ; Fri, 28 Jun 2019 16:06:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4458A28763; Fri, 28 Jun 2019 16:06:19 +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 00E19286B8 for ; Fri, 28 Jun 2019 16:06:19 +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=Eqkk86a1JLmjIVp1Y5J2c/9A3ueLLgxna/qJiOwOhj8=; b=Fc9JbSfC7LvR3ZfNlEkJaAs5NJ 1MsCQr/NplTRxJ5+uEhSIMDlziqehbEhpkXrioEM/tcsm2rLsKzmfRmAEp5dvlnslhLLHdxvw7Zjg T8IURQCCMccuTb1ijFIvOLGUJZ5uxqL3X3PZQIa8TgF/7OEV+k9Z331hsLL6x0rSDlBVmYZcbWnZO +4oLJzRkme4/hQ95LEMadVM5dqR21Ydh8bcqRCxtxNNmHrAmllVOP3kjRJIfFaUGbK/S8+/9U9N1O OraAIiKryVb5LETx2pd0MNl7mXL2O29q87siBaiiIvKqOOQTCcgi8hY+y7I/5uNTlyjbtORijUzdL DqVjIGwQ==; 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 1hgtOC-0001DL-OZ; Fri, 28 Jun 2019 16:06:16 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgtO2-00014t-5t; Fri, 28 Jun 2019 16:06:08 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 8C68F289CEE From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 10/22] drm/imx: imx-tve: Provide ddc symlink in connector's sysfs Date: Fri, 28 Jun 2019 18:01:24 +0200 Message-Id: <00f93c3b30db9f531f4ed846ce95384af30a6c6d.1561735433.git.andrzej.p@collabora.com> 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_090606_651813_B70AB078 X-CRM114-Status: GOOD ( 14.30 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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 , Jani Nikula , 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/imx/imx-tve.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c index e725af8a0025..b8bee4e1f169 100644 --- a/drivers/gpu/drm/imx/imx-tve.c +++ b/drivers/gpu/drm/imx/imx-tve.c @@ -109,7 +109,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; @@ -218,14 +217,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); @@ -551,7 +549,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); } From patchwork Fri Jun 28 16:01: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: 11022939 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 578EC76 for ; Fri, 28 Jun 2019 16:06:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44C3C286B8 for ; Fri, 28 Jun 2019 16:06:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33D2628746; Fri, 28 Jun 2019 16:06:26 +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 CF4C2286B8 for ; Fri, 28 Jun 2019 16:06:25 +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=lQLbi89dF/kd46iiT4AEGjh8HMoh5P17/OpI3sX9ePg=; b=fNZnu1TMvDnANNmf/NmQ0ihXie a4e5tM4YBBowGpIUqr8EL3LHej+xsWR7hAdaFdaSUwaP4uz+P86ajzlfNUcLvmzI2TsWpRWFq2chZ dltMiA1a7RFewozhrtBBmByKeey63uDrYTGxf/vhM9qyk/5vJY3/ijD6qZsNEJXSpbRlmSGdMOr5y P8PyGoBaM9tXiWJ0wGCcNQ4eFEoijmR/DNKyWt/DIiMD2kHH1xZDM1qbedMD9osECekwG/TF12YA6 wPaJV3I/mg9diPnRw4cNf3FdjTLSzAiX13NN6lj0Nz6n8AlqpEx9U//zNnfvPkjIGzo3RlhIYs5c9 lLYOzrxA==; 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 1hgtOJ-0001JR-CV; Fri, 28 Jun 2019 16:06:23 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgtOC-0001CH-Id; Fri, 28 Jun 2019 16:06:18 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 7144F289CEB From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 11/22] drm/vc4: Provide ddc symlink in connector sysfs directory Date: Fri, 28 Jun 2019 18:01:25 +0200 Message-Id: <980ef1af2d03820f2f55f42547664ed08f75e3e7.1561735433.git.andrzej.p@collabora.com> 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_090616_899252_59D7FF55 X-CRM114-Status: GOOD ( 13.53 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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/vc4/vc4_hdmi.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 87ad0879edf3..b46df3aa1798 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -75,7 +75,6 @@ struct vc4_hdmi { struct vc4_hdmi_audio audio; - struct i2c_adapter *ddc; void __iomem *hdmicore_regs; void __iomem *hd_regs; int hpd_gpio; @@ -206,7 +205,7 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) return connector_status_disconnected; } - if (drm_probe_ddc(vc4->hdmi->ddc)) + if (drm_probe_ddc(connector->ddc)) return connector_status_connected; if (HDMI_READ(VC4_HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED) @@ -232,7 +231,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) int ret = 0; struct edid *edid; - edid = drm_get_edid(connector, vc4->hdmi->ddc); + edid = drm_get_edid(connector, connector->ddc); cec_s_phys_addr_from_edid(vc4->hdmi->cec_adap, edid); if (!edid) return -ENODEV; @@ -1287,6 +1286,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) struct vc4_hdmi *hdmi; struct vc4_hdmi_encoder *vc4_hdmi_encoder; struct device_node *ddc_node; + struct i2c_adapter *ddc; u32 value; int ret; @@ -1334,9 +1334,9 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) return -ENODEV; } - hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node); + ddc = of_find_i2c_adapter_by_node(ddc_node); of_node_put(ddc_node); - if (!hdmi->ddc) { + if (ddc) { DRM_DEBUG("Failed to get ddc i2c adapter by node\n"); return -EPROBE_DEFER; } @@ -1396,6 +1396,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) ret = PTR_ERR(hdmi->connector); goto err_destroy_encoder; } + hdmi->connector->ddc = ddc; #ifdef CONFIG_DRM_VC4_HDMI_CEC hdmi->cec_adap = cec_allocate_adapter(&vc4_hdmi_cec_adap_ops, vc4, "vc4", @@ -1448,7 +1449,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) clk_disable_unprepare(hdmi->hsm_clock); pm_runtime_disable(dev); err_put_i2c: - put_device(&hdmi->ddc->dev); + put_device(&ddc->dev); return ret; } @@ -1459,6 +1460,7 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, struct drm_device *drm = dev_get_drvdata(master); struct vc4_dev *vc4 = drm->dev_private; struct vc4_hdmi *hdmi = vc4->hdmi; + struct i2c_adapter *ddc = hdmi->connector->ddc; cec_unregister_adapter(hdmi->cec_adap); vc4_hdmi_connector_destroy(hdmi->connector); @@ -1467,7 +1469,7 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, clk_disable_unprepare(hdmi->hsm_clock); pm_runtime_disable(dev); - put_device(&hdmi->ddc->dev); + put_device(&ddc->dev); vc4->hdmi = NULL; } From patchwork Fri Jun 28 16:01:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022943 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 29E94112C for ; Fri, 28 Jun 2019 16:06:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16BED286B8 for ; Fri, 28 Jun 2019 16:06:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09C6A28746; Fri, 28 Jun 2019 16:06:34 +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 B25F6286B8 for ; Fri, 28 Jun 2019 16:06:33 +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=zdn0iQYZ9ZG9talc+2p7H4Bv6Lxf9TNeJiNylegZMao=; b=ZSuB4ab2pAh+ILOE3Yes2c+7ug FIi+6Y7agwbUcRmi4Pi5sDhCKrhhkdlcez8uhwuLW5ECId5ILz2ZzztYYRf1ILi8g5iUQWybuD+Bd BPb68L6/XFSNqFFEM0h9vjL3H/lSC9+4+L25ghAyqHE9P5Fcl+bL/SjUlAahES4YmD4LBV5pVJzPO dZB7+2HwV2VOSMVo5Kmr//EnmXfaXRpf9rWXzin9710mdp9FsbE17cSLWkABSDyzNfcFEJVLwkBAx zsuTzSvLTjhgfoAnkbU+q+zocT+CDwGDIusZly82hx7Ant3MHmZcoiMOTuDpKoGy7HOPor5VwG2Ut kJxx+nRA==; 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 1hgtOR-0001Qb-VA; Fri, 28 Jun 2019 16:06:31 +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 1hgtON-0001Nh-FU; Fri, 28 Jun 2019 16:06:28 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 55103289CEF From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 12/22] drm: zte: Provide ddc symlink in hdmi connector sysfs directory Date: Fri, 28 Jun 2019 18:01:26 +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_090627_778359_2F5F7CE1 X-CRM114-Status: GOOD ( 14.20 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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, Rodrigo Vivi , 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/zte/zx_hdmi.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/zte/zx_hdmi.c b/drivers/gpu/drm/zte/zx_hdmi.c index bfe918b27c5c..862a855ea14a 100644 --- a/drivers/gpu/drm/zte/zx_hdmi.c +++ b/drivers/gpu/drm/zte/zx_hdmi.c @@ -29,15 +29,11 @@ #define ZX_HDMI_INFOFRAME_SIZE 31 #define DDC_SEGMENT_ADDR 0x30 -struct zx_hdmi_i2c { - struct i2c_adapter adap; - struct mutex lock; -}; - struct zx_hdmi { struct drm_connector connector; struct drm_encoder encoder; - struct zx_hdmi_i2c *ddc; + /* protects ddc access */ + struct mutex ddc_lock; struct device *dev; struct drm_device *drm; void __iomem *mmio; @@ -264,7 +260,7 @@ static int zx_hdmi_connector_get_modes(struct drm_connector *connector) struct edid *edid; int ret; - edid = drm_get_edid(connector, &hdmi->ddc->adap); + edid = drm_get_edid(connector, connector->ddc); if (!edid) return 0; @@ -562,10 +558,9 @@ static int zx_hdmi_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) { struct zx_hdmi *hdmi = i2c_get_adapdata(adap); - struct zx_hdmi_i2c *ddc = hdmi->ddc; int i, ret = 0; - mutex_lock(&ddc->lock); + mutex_lock(&hdmi->ddc_lock); /* Enable DDC master access */ hdmi_writeb_mask(hdmi, TPI_DDC_MASTER_EN, HW_DDC_MASTER, HW_DDC_MASTER); @@ -590,7 +585,7 @@ static int zx_hdmi_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, /* Disable DDC master access */ hdmi_writeb_mask(hdmi, TPI_DDC_MASTER_EN, HW_DDC_MASTER, 0); - mutex_unlock(&ddc->lock); + mutex_unlock(&hdmi->ddc_lock); return ret; } @@ -608,17 +603,15 @@ static const struct i2c_algorithm zx_hdmi_algorithm = { static int zx_hdmi_ddc_register(struct zx_hdmi *hdmi) { struct i2c_adapter *adap; - struct zx_hdmi_i2c *ddc; int ret; - ddc = devm_kzalloc(hdmi->dev, sizeof(*ddc), GFP_KERNEL); - if (!ddc) + adap = devm_kzalloc(hdmi->dev, sizeof(*adap), GFP_KERNEL); + if (!adap) return -ENOMEM; - hdmi->ddc = ddc; - mutex_init(&ddc->lock); + hdmi->connector.ddc = adap; + mutex_init(&hdmi->ddc_lock); - adap = &ddc->adap; adap->owner = THIS_MODULE; adap->class = I2C_CLASS_DDC; adap->dev.parent = hdmi->dev; From patchwork Fri Jun 28 16:01:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022947 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 70BF2112C for ; Fri, 28 Jun 2019 16:06:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F7AB286B8 for ; Fri, 28 Jun 2019 16:06:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5126228746; Fri, 28 Jun 2019 16:06:45 +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 06812286B8 for ; Fri, 28 Jun 2019 16:06:45 +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=xVRQ5DaXNIrKY0UI220YZeG7KeYW+VcAOKM9fRrZTAY=; b=TJ+W5t7FZfINLIGpHAHqi13YPl uDlWa9xfTvSR/5CZlZnVjtRt9+hee/s/mfkkYkbenrJFLypnNrXpKrpqKbGtjkgEL0wFbUzBodveU jREparGhLT5nHuVXTn02Mf4XR8hEeEWFaVTkkJUO6s5ye5bkNFF3Dt+2BvrIGoVg7Wxy+qOX77lUH GUakp1FXrcMWpSZ4iVg+Md3XKXD04ovYTscrm6zlyEvHmIC3WJticPhjkHmISbiYHDw1oL16WfMk8 8frXUKEZzw38dOX20N8t/Cx8qyeiQWbPPYA4FAfvTF9AqgVQiYQ6zE/3uZe6FuD3xoobliy5opkve mNNZm1Wg==; 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 1hgtOd-0001W3-6O; Fri, 28 Jun 2019 16:06:43 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgtOY-0001Ta-Pg; Fri, 28 Jun 2019 16:06:40 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 5C436289CF0 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 13/22] drm: zte: Provide ddc symlink in vga connector sysfs directory Date: Fri, 28 Jun 2019 18:01:27 +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_090639_090067_53D78891 X-CRM114-Status: GOOD ( 14.64 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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 , Jani Nikula , linux-arm-msm@vger.kernel.org, Sascha Hauer , Maarten Lankhorst , Jyri Sarha , Inki Dae , Alexios Zavras , 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/zte/zx_vga.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/zte/zx_vga.c b/drivers/gpu/drm/zte/zx_vga.c index 1634a08707fb..a3a4d6982888 100644 --- a/drivers/gpu/drm/zte/zx_vga.c +++ b/drivers/gpu/drm/zte/zx_vga.c @@ -23,15 +23,11 @@ struct zx_vga_pwrctrl { u32 mask; }; -struct zx_vga_i2c { - struct i2c_adapter adap; - struct mutex lock; -}; - struct zx_vga { struct drm_connector connector; struct drm_encoder encoder; - struct zx_vga_i2c *ddc; + /* protects ddc access */ + struct mutex ddc_lock; struct device *dev; void __iomem *mmio; struct clk *i2c_wclk; @@ -86,7 +82,7 @@ static int zx_vga_connector_get_modes(struct drm_connector *connector) */ zx_writel(vga->mmio + VGA_AUTO_DETECT_SEL, 0); - edid = drm_get_edid(connector, &vga->ddc->adap); + edid = drm_get_edid(connector, connector->ddc); if (!edid) { /* * If EDID reading fails, we set the device state into @@ -282,11 +278,10 @@ static int zx_vga_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) { struct zx_vga *vga = i2c_get_adapdata(adap); - struct zx_vga_i2c *ddc = vga->ddc; int ret = 0; int i; - mutex_lock(&ddc->lock); + mutex_lock(&vga->ddc_lock); for (i = 0; i < num; i++) { if (msgs[i].flags & I2C_M_RD) @@ -301,7 +296,7 @@ static int zx_vga_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, if (!ret) ret = num; - mutex_unlock(&ddc->lock); + mutex_unlock(&vga->ddc_lock); return ret; } @@ -320,17 +315,15 @@ static int zx_vga_ddc_register(struct zx_vga *vga) { struct device *dev = vga->dev; struct i2c_adapter *adap; - struct zx_vga_i2c *ddc; int ret; - ddc = devm_kzalloc(dev, sizeof(*ddc), GFP_KERNEL); - if (!ddc) + adap = devm_kzalloc(dev, sizeof(*adap), GFP_KERNEL); + if (!adap) return -ENOMEM; - vga->ddc = ddc; - mutex_init(&ddc->lock); + vga->connector.ddc = adap; + mutex_init(&vga->ddc_lock); - adap = &ddc->adap; adap->owner = THIS_MODULE; adap->class = I2C_CLASS_DDC; adap->dev.parent = dev; From patchwork Fri Jun 28 16:01:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022951 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 7080276 for ; Fri, 28 Jun 2019 16:06:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F801286B8 for ; Fri, 28 Jun 2019 16:06:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52E7A28746; Fri, 28 Jun 2019 16:06:55 +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 13358286B8 for ; Fri, 28 Jun 2019 16:06:55 +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=cv+zrJ2HZtiITfZB3VGPGLFgL+ZY1GZ+b8RMMy1ubnk=; b=CWBPk5uSqOZkhhNWLYKuP4DKMz FxmGq4yl2E68WIHI9qBXES5aCSU0U2VfS/14AH7PSke7n0FuERfDVTGsihqW1VSYGJDEu9nJykT0h laxa0pdqUhZhdOYW/DZ9Hg+YIF7sNbk0oWC01Q7JUWF+Ij0hNDuN+cJY1OPEeBwO+mX4xgu8QiEd7 G5DiVZRu4dutzRjpH5zVmIXR2qvZpBBqNdwZvmO0KjS4rrI5j7rdN/33DhfRItZMEzISivP7sbopq DXYZp+nUMNBLwF8y+KCDQKAQuf4nOKnchA/oq8vjnNIN3WRnOyFU+2t72JkVuShsDfqZYEXan0L2K jfYLmG3Q==; 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 1hgtOn-0001b8-88; Fri, 28 Jun 2019 16:06:53 +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 1hgtOj-0001Yq-D1; Fri, 28 Jun 2019 16:06:50 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 51B34289CF1 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 14/22] drm/tilcdc: Provide ddc symlink in connector sysfs directory Date: Fri, 28 Jun 2019 18:01:28 +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_090649_573057_6032EB8D X-CRM114-Status: GOOD ( 10.86 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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 , Alexios Zavras , 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/tilcdc/tilcdc_tfp410.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c index 62d014c20988..c373edb95666 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c @@ -219,6 +219,7 @@ static struct drm_connector *tfp410_connector_create(struct drm_device *dev, tfp410_connector->mod = mod; connector = &tfp410_connector->base; + connector->ddc = mod->i2c; drm_connector_init(dev, connector, &tfp410_connector_funcs, DRM_MODE_CONNECTOR_DVID); From patchwork Fri Jun 28 16:01:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022955 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 33282112C for ; Fri, 28 Jun 2019 16:07:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22DDC286B8 for ; Fri, 28 Jun 2019 16:07:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 155C228746; Fri, 28 Jun 2019 16:07:06 +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 CB070286B8 for ; Fri, 28 Jun 2019 16:07:05 +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=0QEH5zMFykZPFcDbsobzKS3W06hV+72Z9/NkMU97y8A=; b=n4lnqfQDhFho7IRRwOXVT6F1av DSEbaPFcTQrvLvI4tDWYZs3k8uA8SqDmq5RBuSh6XFb4AXCoQsz6uje06kPt2Bl6RMHO6FQju+ccp y2lCfbcrrLw+pEm03bqdJ3d0coXoFqkA6LjTB6FXQnYn7ZdLUBVzGOH+5rLsa+N2Or9KQxsVlCWrV Pn23Rqnr+zTsiCKiO/0NdYebJzEe+UZUwiS839MI9zWHgzJkfNFhJb5PxSXK07YEtpcMztYmoFxpH NSIICXEog3tzpba1EnfXjJVw0jiqgHGAXUXnELxv+mm8A/klSJLiB5uGwt6XXTVNySuy1X5Vzgnyv xpAMNujQ==; 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 1hgtOx-0001gi-WE; Fri, 28 Jun 2019 16:07:04 +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 1hgtOu-0001e0-CZ; Fri, 28 Jun 2019 16:07:01 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 40F94289CF4 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 15/22] drm: sti: Provide ddc symlink in hdmi connector sysfs directory Date: Fri, 28 Jun 2019 18:01:29 +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_090700_566853_E10E23D3 X-CRM114-Status: GOOD ( 11.43 ) 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, Liviu Dudau , 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 , Alexios Zavras , 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/sti/sti_hdmi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index f03d617edc4c..c5e6c33ff2cd 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -1288,6 +1288,7 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data) &sti_hdmi_connector_funcs, DRM_MODE_CONNECTOR_HDMIA); drm_connector_helper_add(drm_connector, &sti_hdmi_connector_helper_funcs); + drm_connector->ddc = hdmi->ddc_adapt; /* initialise property */ sti_hdmi_connector_init_property(drm_dev, drm_connector); From patchwork Fri Jun 28 16:01: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: 11022959 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 CA9E276 for ; Fri, 28 Jun 2019 16:07:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7DE228740 for ; Fri, 28 Jun 2019 16:07:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A84B628763; Fri, 28 Jun 2019 16:07:17 +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 6876528740 for ; Fri, 28 Jun 2019 16:07:17 +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=88gD6CvwgvuUzUgpGM5jCR4DcZ9szW2N1Mr07xZ3N8k=; b=DXEoVhLLu7NpW3YfAvC0htMmkT ZJt7SJpNe+Gwr2wfEcScozdzpTnim7xWjfGLxFXViFfkCI7beYqgzgNgJ3qiaxrFaDK5npU7u4sze 9l/C63bBMID9tXpw5YYkzUXHvOtpOFPqHlGwtMBfhj8Mo3NRcrZx45YOg/rJdh6xUVTCFyn8jyE9A QwIn+gjR5J4yKlL3PrabmDZazwONF/71WYIy/ClnXpibp0TzVO0kojnHQC/af4sNb8UGn2KlzbMv1 36Ik/1BOGkRxJEt5xyE9HpPIoDCc8snRZMru3XWHv64rvwg7F1SJ+BGobNT/eyr/o51JmCAPiNns1 G+M3EZWg==; 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 1hgtP9-0001mx-Hf; Fri, 28 Jun 2019 16:07:15 +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 1hgtP5-0001kd-A3; Fri, 28 Jun 2019 16:07:12 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 3082B289CF3 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 16/22] drm/mgag200: Provide ddc symlink in connector sysfs directory Date: Fri, 28 Jun 2019 18:01:30 +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_090711_479788_0636DA0A X-CRM114-Status: GOOD ( 11.23 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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 , Alexios Zavras , Mamta Shukla , linux-mediatek@lists.infradead.org, Rodrigo Vivi , 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/mgag200/mgag200_mode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index a25054015e8c..a22dbecd4d35 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -1712,6 +1712,7 @@ static struct drm_connector *mga_vga_init(struct drm_device *dev) drm_connector_register(connector); mga_connector->i2c = mgag200_i2c_create(dev); + connector->ddc = &mga_connector->i2c->adapter; if (!mga_connector->i2c) DRM_ERROR("failed to add ddc bus\n"); From patchwork Fri Jun 28 16:01:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022963 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 00C86112C for ; Fri, 28 Jun 2019 16:07:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E258D28763 for ; Fri, 28 Jun 2019 16:07:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3BC72876C; Fri, 28 Jun 2019 16:07:28 +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 9632B28763 for ; Fri, 28 Jun 2019 16:07:28 +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=QrkKk3p5nJiGp82ymc1JWlQ197BSucBuoLbqP2r2wBo=; b=dhp8IQDzZVpbr/fVS/hVyj3A7p F68P7qhEZfbjiMtbhfoyhNg9gbqQlQfwlxT3iXtAZ74rvtbvvl4kMls/jb5Dfyn5VL+3BrxqQQJV7 jVNsNLyv9d8Nn2jnvzXlvcQ7Wmy0UwGnMCrfvjeevgtRhJAptdx2IdthtoSLvbDcW0j4oHEVMsXoE uxtvVU29mftQmvMMjMCMjTo5nExguaymQxjuLkkzL9DwD2cRrmDIhyVpUm4KReJ2QlWmggGDn5pOu vs96wMyQ/1HUfg0JGCEcfYHr3Pfpc1BF2k3dcpjewpxb9e2gZ4x4LDwdxXjHcbNlAi+am+Y1igNvG 7ckLgJag==; 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 1hgtPK-0001sT-MP; Fri, 28 Jun 2019 16:07:26 +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 1hgtPG-0001py-Ae; Fri, 28 Jun 2019 16:07:23 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 40EC0289CF8 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 17/22] drm/ast: Provide ddc symlink in connector sysfs directory Date: Fri, 28 Jun 2019 18:01:31 +0200 Message-Id: <933656a2069cab7723bfbd066d7fd6fc73ea23cb.1561735433.git.andrzej.p@collabora.com> 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_090722_494579_53025711 X-CRM114-Status: GOOD ( 11.54 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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, Rodrigo Vivi , 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/ast/ast_mode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index ffccbef962a4..155c3487a1a7 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -905,6 +905,7 @@ static int ast_connector_init(struct drm_device *dev) drm_connector_attach_encoder(connector, encoder); ast_connector->i2c = ast_i2c_create(dev); + connector->ddc = &ast_connector->i2c->adapter; if (!ast_connector->i2c) DRM_ERROR("failed to add ddc bus for connector\n"); From patchwork Fri Jun 28 16:01:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022967 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 5CE3476 for ; Fri, 28 Jun 2019 16:07:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49C2C28763 for ; Fri, 28 Jun 2019 16:07:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39E572876C; Fri, 28 Jun 2019 16:07:41 +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 4093C28763 for ; Fri, 28 Jun 2019 16:07:40 +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=fB9AI98u7mWYPWry9Z6n6N6A/Wx6ObhPrKCWm488HZQ=; b=NhG070H8YUnZU7DK6kjipYQEAJ bxmUcPNIlKa4ig8gMpMRTVWGccT5uBHKhduwLqCF3lMTw3XVf8fJZzdcegV2c+Sg7XVdOOsPZUGku vuX9wmwOYfr/IMjPC+GPcjnNKFdbM1aBVISNuDPV4HGkNASw7L6BHyXS5rbuQUSbG/2Uddpb79jbS 98F0XnUF5WOR9L1tgaJlOxrmJklEBWlEuCzjP0Mxo+nI/pV6BzeiYum0lsnlDdXifNaLSUnkWqrk8 +zw0zfZHs4/7O0HH10nzoOgMUYvki7dJjyomoIIBWSNsYn1vlsZWz/fgda2CF80zJGR1OXfP+JlF8 COm7vFrQ==; 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 1hgtPW-0001yA-4A; Fri, 28 Jun 2019 16:07:38 +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 1hgtPR-0001vk-Ab; Fri, 28 Jun 2019 16:07:34 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 37875289CFB From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 18/22] drm/bridge: dumb-vga-dac: Provide ddc symlink in connector sysfs directory Date: Fri, 28 Jun 2019 18:01:32 +0200 Message-Id: <33d98ef0c2a6e402515dc3ed5d100959dcb3233c.1561735433.git.andrzej.p@collabora.com> 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_090733_624904_D26DA32E X-CRM114-Status: GOOD ( 14.81 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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, Enrico Weigelt , 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/bridge/dumb-vga-dac.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/bridge/dumb-vga-dac.c b/drivers/gpu/drm/bridge/dumb-vga-dac.c index d32885b906ae..b4cc3238400a 100644 --- a/drivers/gpu/drm/bridge/dumb-vga-dac.c +++ b/drivers/gpu/drm/bridge/dumb-vga-dac.c @@ -20,7 +20,6 @@ struct dumb_vga { struct drm_bridge bridge; struct drm_connector connector; - struct i2c_adapter *ddc; struct regulator *vdd; }; @@ -42,10 +41,10 @@ static int dumb_vga_get_modes(struct drm_connector *connector) struct edid *edid; int ret; - if (IS_ERR(vga->ddc)) + if (IS_ERR(vga->connector.ddc)) goto fallback; - edid = drm_get_edid(connector, vga->ddc); + edid = drm_get_edid(connector, vga->connector.ddc); if (!edid) { DRM_INFO("EDID readout failed, falling back to standard modes\n"); goto fallback; @@ -84,7 +83,7 @@ dumb_vga_connector_detect(struct drm_connector *connector, bool force) * wire the DDC pins, or the I2C bus might not be working at * all. */ - if (!IS_ERR(vga->ddc) && drm_probe_ddc(vga->ddc)) + if (!IS_ERR(vga->connector.ddc) && drm_probe_ddc(vga->connector.ddc)) return connector_status_connected; return connector_status_unknown; @@ -190,14 +189,14 @@ static int dumb_vga_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "No vdd regulator found: %d\n", ret); } - vga->ddc = dumb_vga_retrieve_ddc(&pdev->dev); - if (IS_ERR(vga->ddc)) { - if (PTR_ERR(vga->ddc) == -ENODEV) { + vga->connector.ddc = dumb_vga_retrieve_ddc(&pdev->dev); + if (IS_ERR(vga->connector.ddc)) { + if (PTR_ERR(vga->connector.ddc) == -ENODEV) { dev_dbg(&pdev->dev, "No i2c bus specified. Disabling EDID readout\n"); } else { dev_err(&pdev->dev, "Couldn't retrieve i2c bus\n"); - return PTR_ERR(vga->ddc); + return PTR_ERR(vga->connector.ddc); } } @@ -216,8 +215,8 @@ static int dumb_vga_remove(struct platform_device *pdev) drm_bridge_remove(&vga->bridge); - if (!IS_ERR(vga->ddc)) - i2c_put_adapter(vga->ddc); + if (!IS_ERR(vga->connector.ddc)) + i2c_put_adapter(vga->connector.ddc); return 0; } From patchwork Fri Jun 28 16:01: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: 11022971 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 B2962112C for ; Fri, 28 Jun 2019 16:07:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F39628765 for ; Fri, 28 Jun 2019 16:07:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91CC12877F; Fri, 28 Jun 2019 16:07:50 +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 2528928765 for ; Fri, 28 Jun 2019 16:07:50 +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=u6q9GR6nEHkFL0GJszJO6Rb/sT/F9xbHQNq8w2u6FMA=; b=jBMrwcIzAqGI0aKIfgxVSbZvbB MMu7s9kc1E33eKnTcb4DFvLU+3fFzWNigjTKun3Eo5INXQExy/MDr++nqMYYBnKpkQFLjL39KUP6/ EZjp/gSI/Hc0Hp1HyeIARKbjW88K2LekFt2H/tjIgSRqGgyF1uNc0voNj4R6F2A3eLdvnkPtIUNEP zBgTgXr5KpuEDSOxJQahABrClN3wravyXNGRNxgLF26WNqTvOGBTxLv4n1rN5pqmtjV2gfpZlQfGW tSMWu1Y6lb0oJ0V1V8xYplUExy1aKUL3j1FzBp6+AXE+t0YIIfJ4tNLA/p5NVohnCz45xvTix/mml Vr0b0aQQ==; 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 1hgtPg-00023g-Db; Fri, 28 Jun 2019 16:07:48 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgtPc-00020m-DA; Fri, 28 Jun 2019 16:07:46 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 37A8A289CFC From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 19/22] drm/bridge: dw-hdmi: Provide ddc symlink in connector sysfs directory Date: Fri, 28 Jun 2019 18:01:33 +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_090744_712963_09B9B427 X-CRM114-Status: GOOD ( 18.10 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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, Rodrigo Vivi , Matthias Brugger , Daniel Vetter , Thomas Gleixner , Sean Paul , linux-arm-kernel@lists.infradead.org, Enrico Weigelt , Jernej Skrabec , 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/bridge/synopsys/dw-hdmi.c | 40 +++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index c6490949d9db..0b9c9f2619da 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -161,7 +161,6 @@ struct dw_hdmi { struct drm_display_mode previous_mode; - struct i2c_adapter *ddc; void __iomem *regs; bool sink_is_hdmi; bool sink_has_audio; @@ -1118,7 +1117,7 @@ static bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi) return false; /* Disable if no DDC bus */ - if (!hdmi->ddc) + if (!hdmi->connector.ddc) return false; /* Disable if SCDC is not supported, or if an HF-VSDB block is absent */ @@ -1156,10 +1155,11 @@ void dw_hdmi_set_high_tmds_clock_ratio(struct dw_hdmi *hdmi) /* Control for TMDS Bit Period/TMDS Clock-Period Ratio */ if (dw_hdmi_support_scdc(hdmi)) { + struct i2c_adapter *ddc = hdmi->connector.ddc; if (mtmdsclock > HDMI14_MAX_TMDSCLK) - drm_scdc_set_high_tmds_clock_ratio(hdmi->ddc, 1); + drm_scdc_set_high_tmds_clock_ratio(ddc, 1); else - drm_scdc_set_high_tmds_clock_ratio(hdmi->ddc, 0); + drm_scdc_set_high_tmds_clock_ratio(ddc, 0); } } EXPORT_SYMBOL_GPL(dw_hdmi_set_high_tmds_clock_ratio); @@ -1750,6 +1750,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, if (dw_hdmi_support_scdc(hdmi)) { if (vmode->mtmdsclock > HDMI14_MAX_TMDSCLK || hdmi_info->scdc.scrambling.low_rates) { + struct i2c_adapter *ddc = hdmi->connector.ddc; /* * HDMI2.0 Specifies the following procedure: * After the Source Device has determined that @@ -1759,13 +1760,12 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, * Source Devices compliant shall set the * Source Version = 1. */ - drm_scdc_readb(hdmi->ddc, SCDC_SINK_VERSION, - &bytes); - drm_scdc_writeb(hdmi->ddc, SCDC_SOURCE_VERSION, + drm_scdc_readb(ddc, SCDC_SINK_VERSION, &bytes); + drm_scdc_writeb(ddc, SCDC_SOURCE_VERSION, min_t(u8, bytes, SCDC_MIN_SOURCE_VERSION)); /* Enabled Scrambling in the Sink */ - drm_scdc_set_scrambling(hdmi->ddc, 1); + drm_scdc_set_scrambling(hdmi->connector.ddc, 1); /* * To activate the scrambler feature, you must ensure @@ -1781,7 +1781,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, hdmi_writeb(hdmi, 0, HDMI_FC_SCRAMBLER_CTRL); hdmi_writeb(hdmi, (u8)~HDMI_MC_SWRSTZ_TMDSSWRST_REQ, HDMI_MC_SWRSTZ); - drm_scdc_set_scrambling(hdmi->ddc, 0); + drm_scdc_set_scrambling(hdmi->connector.ddc, 0); } } @@ -2127,10 +2127,10 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector) struct edid *edid; int ret = 0; - if (!hdmi->ddc) + if (!hdmi->connector.ddc) return 0; - edid = drm_get_edid(connector, hdmi->ddc); + edid = drm_get_edid(connector, hdmi->connector.ddc); if (edid) { dev_dbg(hdmi->dev, "got edid: width[%d] x height[%d]\n", edid->width_cm, edid->height_cm); @@ -2548,9 +2548,9 @@ __dw_hdmi_probe(struct platform_device *pdev, ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0); if (ddc_node) { - hdmi->ddc = of_get_i2c_adapter_by_node(ddc_node); + hdmi->connector.ddc = of_get_i2c_adapter_by_node(ddc_node); of_node_put(ddc_node); - if (!hdmi->ddc) { + if (!hdmi->connector.ddc) { dev_dbg(hdmi->dev, "failed to read ddc node\n"); return ERR_PTR(-EPROBE_DEFER); } @@ -2689,7 +2689,7 @@ __dw_hdmi_probe(struct platform_device *pdev, hdmi_init_clk_regenerator(hdmi); /* If DDC bus is not specified, try to register HDMI I2C bus */ - if (!hdmi->ddc) { + if (!hdmi->connector.ddc) { /* Look for (optional) stuff related to unwedging */ hdmi->pinctrl = devm_pinctrl_get(dev); if (!IS_ERR(hdmi->pinctrl)) { @@ -2708,9 +2708,9 @@ __dw_hdmi_probe(struct platform_device *pdev, } } - hdmi->ddc = dw_hdmi_i2c_adapter(hdmi); - if (IS_ERR(hdmi->ddc)) - hdmi->ddc = NULL; + hdmi->connector.ddc = dw_hdmi_i2c_adapter(hdmi); + if (IS_ERR(hdmi->connector.ddc)) + hdmi->connector.ddc = NULL; } hdmi->bridge.driver_private = hdmi; @@ -2776,7 +2776,7 @@ __dw_hdmi_probe(struct platform_device *pdev, err_iahb: if (hdmi->i2c) { i2c_del_adapter(&hdmi->i2c->adap); - hdmi->ddc = NULL; + hdmi->connector.ddc = NULL; } if (hdmi->cec_notifier) @@ -2788,7 +2788,7 @@ __dw_hdmi_probe(struct platform_device *pdev, err_isfr: clk_disable_unprepare(hdmi->isfr_clk); err_res: - i2c_put_adapter(hdmi->ddc); + i2c_put_adapter(hdmi->connector.ddc); return ERR_PTR(ret); } @@ -2814,7 +2814,7 @@ static void __dw_hdmi_remove(struct dw_hdmi *hdmi) if (hdmi->i2c) i2c_del_adapter(&hdmi->i2c->adap); else - i2c_put_adapter(hdmi->ddc); + i2c_put_adapter(hdmi->connector.ddc); } /* ----------------------------------------------------------------------------- From patchwork Fri Jun 28 16:01:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022975 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 14F0F76 for ; Fri, 28 Jun 2019 16:08:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00B9E2876C for ; Fri, 28 Jun 2019 16:08:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E77E8287BE; Fri, 28 Jun 2019 16:08:02 +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 986572876C for ; Fri, 28 Jun 2019 16:08:02 +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=4iY2241b+VDzSoJ/f1N4kTE0GL4ijehn9DhqWltfQXs=; b=JDAMGQqXlTerri+ZTb8lTb1oPY HGlFUWXXevqIxWzi/Td0e2p6gMSBTW4X38EnAwJ7UzlGwpdJFGu9MoCa6HE5hGSQDNupkUyVmezgA ZZmAl2U/HOLrIDsn3vod3yJuthEAUyGyxhJa8fbi5uy7/2KqS0w214Ml4me6/qVwQPMNldrTiydyn fUgLDgFXfpEmDDqqSTjjtsIgHAvFAkvkcJKAtN3L4H7WRyIVEy44Me0QdN3nT3ZE9bpqiibwWvApp 3SLAORTZAEvwJ8FbHHBucafWXhEspPwECFvPtXGVZTtmM3c0nyaHc0TboLY3j9MMHPqWj1R6YwO7S Xx9QQ+uw==; 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 1hgtPs-00029F-N5; Fri, 28 Jun 2019 16:08:00 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgtPn-00026E-94; Fri, 28 Jun 2019 16:07:56 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 2996D289CFE From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 20/22] drm/bridge: ti-tfp410: Provide ddc symlink in connector sysfs directory Date: Fri, 28 Jun 2019 18:01:34 +0200 Message-Id: <890f701b0722295ef2f03c89e14271ee11487743.1561735433.git.andrzej.p@collabora.com> 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_090755_583875_963CDC9A X-CRM114-Status: GOOD ( 14.48 ) 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 , Allison Randal , 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/bridge/ti-tfp410.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index dbf35c7bc85e..e55358f0a5ba 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -26,7 +26,6 @@ struct tfp410 { unsigned int connector_type; u32 bus_format; - struct i2c_adapter *ddc; struct gpio_desc *hpd; int hpd_irq; struct delayed_work hpd_work; @@ -55,10 +54,10 @@ static int tfp410_get_modes(struct drm_connector *connector) struct edid *edid; int ret; - if (!dvi->ddc) + if (!dvi->connector.ddc) goto fallback; - edid = drm_get_edid(connector, dvi->ddc); + edid = drm_get_edid(connector, dvi->connector.ddc); if (!edid) { DRM_INFO("EDID read failed. Fallback to standard modes\n"); goto fallback; @@ -98,8 +97,8 @@ tfp410_connector_detect(struct drm_connector *connector, bool force) return connector_status_disconnected; } - if (dvi->ddc) { - if (drm_probe_ddc(dvi->ddc)) + if (dvi->connector.ddc) { + if (drm_probe_ddc(dvi->connector.ddc)) return connector_status_connected; else return connector_status_disconnected; @@ -297,8 +296,8 @@ static int tfp410_get_connector_properties(struct tfp410 *dvi) if (!ddc_phandle) goto fail; - dvi->ddc = of_get_i2c_adapter_by_node(ddc_phandle); - if (dvi->ddc) + dvi->connector.ddc = of_get_i2c_adapter_by_node(ddc_phandle); + if (dvi->connector.ddc) dev_info(dvi->dev, "Connector's ddc i2c bus found\n"); else ret = -EPROBE_DEFER; @@ -367,7 +366,7 @@ static int tfp410_init(struct device *dev, bool i2c) return 0; fail: - i2c_put_adapter(dvi->ddc); + i2c_put_adapter(dvi->connector.ddc); if (dvi->hpd) gpiod_put(dvi->hpd); return ret; @@ -382,8 +381,8 @@ static int tfp410_fini(struct device *dev) drm_bridge_remove(&dvi->bridge); - if (dvi->ddc) - i2c_put_adapter(dvi->ddc); + if (dvi->connector.ddc) + i2c_put_adapter(dvi->connector.ddc); if (dvi->hpd) gpiod_put(dvi->hpd); From patchwork Fri Jun 28 16:01:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022979 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 573CB76 for ; Fri, 28 Jun 2019 16:08:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 455C728763 for ; Fri, 28 Jun 2019 16:08:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37EDD2876C; Fri, 28 Jun 2019 16:08:13 +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 B541C28763 for ; Fri, 28 Jun 2019 16:08:12 +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=XYf0z2nudlfymEzEv7kSMHURLEq6sXaD0ocXYX8OC5M=; b=gkfe9orj6Hiz0RAx14PVSrEAd/ RvDdCPRvxgE1WsFxx+0EuAG4aN/d8df5sCpCkXyQWC1GGii23ARFuj7A6V2P4F1lm55OxrL9WXU3Z 4kvtp71i/8BlClBbQPNnJb6zC3upaMHNUDcHCQbMlAeyJ+3C0pErXqGIoxXQHlVnIW7LU8oPUzZH7 E6mLN0mjP/ziLz9ZBhFinx05ZRhc5uKpi8aBz8uBL1jRtpnAQRXoohA9Tj/cunkTde3TyE85hPq0I JnyKYMo3dIhuTgKVCyxifiVasH0OiptdzTrwrZ4+ZVG06sUwLXPFLCwNSdYDZy1k1Q8J2w1Oy4sym DRp3o/eQ==; 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 1hgtQ2-0002FC-Ul; Fri, 28 Jun 2019 16:08:10 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgtPy-0002CR-BO; Fri, 28 Jun 2019 16:08:08 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 3282E289CF7 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 21/22] drm/amdgpu: Provide ddc symlink in connector sysfs directory Date: Fri, 28 Jun 2019 18:01:35 +0200 Message-Id: <5e355b8bec8fb3907566a741db8cc3e356246a32.1561735433.git.andrzej.p@collabora.com> 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_090806_656310_367BF6A7 X-CRM114-Status: GOOD ( 11.76 ) 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 , Liviu Dudau , 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 , linux-rockchip@lists.infradead.org, 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 , Alexios Zavras , 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 --- .../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 70 ++++++++++++++----- 1 file changed, 51 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c index 73b2ede773d3..5f8a7e3818b9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c @@ -1573,11 +1573,15 @@ amdgpu_connector_add(struct amdgpu_device *adev, goto failed; amdgpu_connector->con_priv = amdgpu_dig_connector; if (i2c_bus->valid) { - amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); - if (amdgpu_connector->ddc_bus) + struct amdgpu_connector *acn = amdgpu_connector; + + acn->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); + if (acn->ddc_bus) { has_aux = true; - else + connector->ddc = &acn->ddc_bus->adapter; + } else { DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + } } switch (connector_type) { case DRM_MODE_CONNECTOR_VGA: @@ -1662,9 +1666,13 @@ amdgpu_connector_add(struct amdgpu_device *adev, drm_connector_init(dev, &amdgpu_connector->base, &amdgpu_connector_vga_funcs, connector_type); drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_vga_helper_funcs); if (i2c_bus->valid) { - amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); - if (!amdgpu_connector->ddc_bus) + struct amdgpu_connector *acn = amdgpu_connector; + + acn->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); + if (!acn->ddc_bus) DRM_ERROR("VGA: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = &acn->ddc_bus->adapter; } amdgpu_connector->dac_load_detect = true; drm_object_attach_property(&amdgpu_connector->base.base, @@ -1682,9 +1690,13 @@ amdgpu_connector_add(struct amdgpu_device *adev, drm_connector_init(dev, &amdgpu_connector->base, &amdgpu_connector_vga_funcs, connector_type); drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_vga_helper_funcs); if (i2c_bus->valid) { - amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); - if (!amdgpu_connector->ddc_bus) + struct amdgpu_connector *acn = amdgpu_connector; + + acn->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); + if (!acn->ddc_bus) DRM_ERROR("DVIA: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = &acn->ddc_bus->adapter; } amdgpu_connector->dac_load_detect = true; drm_object_attach_property(&amdgpu_connector->base.base, @@ -1707,9 +1719,13 @@ amdgpu_connector_add(struct amdgpu_device *adev, drm_connector_init(dev, &amdgpu_connector->base, &amdgpu_connector_dvi_funcs, connector_type); drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_dvi_helper_funcs); if (i2c_bus->valid) { - amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); - if (!amdgpu_connector->ddc_bus) + struct amdgpu_connector *acn = amdgpu_connector; + + acn->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); + if (!acn->ddc_bus) DRM_ERROR("DVI: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = &acn->ddc_bus->adapter; } subpixel_order = SubPixelHorizontalRGB; drm_object_attach_property(&amdgpu_connector->base.base, @@ -1757,9 +1773,13 @@ amdgpu_connector_add(struct amdgpu_device *adev, drm_connector_init(dev, &amdgpu_connector->base, &amdgpu_connector_dvi_funcs, connector_type); drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_dvi_helper_funcs); if (i2c_bus->valid) { - amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); - if (!amdgpu_connector->ddc_bus) + struct amdgpu_connector *acn = amdgpu_connector; + + acn->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); + if (!acn->ddc_bus) DRM_ERROR("HDMI: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = &acn->ddc_bus->adapter; } drm_object_attach_property(&amdgpu_connector->base.base, adev->mode_info.coherent_mode_property, @@ -1799,11 +1819,15 @@ amdgpu_connector_add(struct amdgpu_device *adev, drm_connector_init(dev, &amdgpu_connector->base, &amdgpu_connector_dp_funcs, connector_type); drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_dp_helper_funcs); if (i2c_bus->valid) { - amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); - if (amdgpu_connector->ddc_bus) + struct amdgpu_connector *acn = amdgpu_connector; + + acn->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); + if (acn->ddc_bus) { has_aux = true; - else + connector->ddc = &acn->ddc_bus->adapter; + } else { DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + } } subpixel_order = SubPixelHorizontalRGB; drm_object_attach_property(&amdgpu_connector->base.base, @@ -1841,11 +1865,15 @@ amdgpu_connector_add(struct amdgpu_device *adev, drm_connector_init(dev, &amdgpu_connector->base, &amdgpu_connector_edp_funcs, connector_type); drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_dp_helper_funcs); if (i2c_bus->valid) { - amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); - if (amdgpu_connector->ddc_bus) + struct amdgpu_connector *acn = amdgpu_connector; + + acn->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); + if (acn->ddc_bus) { has_aux = true; - else + connector->ddc = &acn->ddc_bus->adapter; + } else { DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + } } drm_object_attach_property(&amdgpu_connector->base.base, dev->mode_config.scaling_mode_property, @@ -1862,9 +1890,13 @@ amdgpu_connector_add(struct amdgpu_device *adev, drm_connector_init(dev, &amdgpu_connector->base, &amdgpu_connector_lvds_funcs, connector_type); drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_lvds_helper_funcs); if (i2c_bus->valid) { - amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); - if (!amdgpu_connector->ddc_bus) + struct amdgpu_connector *acn = amdgpu_connector; + + acn->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); + if (!acn->ddc_bus) DRM_ERROR("LVDS: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = &acn->ddc_bus->adapter; } drm_object_attach_property(&amdgpu_connector->base.base, dev->mode_config.scaling_mode_property, From patchwork Fri Jun 28 16:01:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11022983 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 A3A25112C for ; Fri, 28 Jun 2019 16:08:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90D3528763 for ; Fri, 28 Jun 2019 16:08:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 835A82876C; Fri, 28 Jun 2019 16:08:26 +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 ED3C328763 for ; Fri, 28 Jun 2019 16:08:25 +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=mu6uJVQEu6FTai+dvdl0lCed3DOcOYZDQYLKdDIFMME=; b=rW9992EswOJ2FFaC2nm3x60Xr2 97RFf6pbfwAjV234Mn9NCNSqWfmsS5rGz+tCUvhjT2m5CnVTjDTRkdUGCNRJBnsMh6i2kbexZnJ2e 4zZ0t5xzu3U3HPZtA3g0yRcAoVH5Kg1GxBZDCHVtXqxfhqqAJ5RrqXpwi5ZqmhIWMIQnkmMX0631e 8EZ9aKgycb24biwTsP/4PsNQzePjplaEHrEtN8qMtRk7zzdLCAhb0GEZZZ74EcLaQ5tLhsqyca2L+ bbb44E8HJ+M+aVwIudLEaWR8dkSoQn/X5WaNgulEpFapaLJICie3f4jsqNjZM1onpeX2/4V1B5ph9 5ciPobNA==; 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 1hgtQG-0002Ll-5G; Fri, 28 Jun 2019 16:08:24 +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 1hgtQA-0002Ih-Hg; Fri, 28 Jun 2019 16:08:20 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 59BCF28957D From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 22/22] drm/radeon: Provide ddc symlink in connector sysfs directory Date: Fri, 28 Jun 2019 18:01:36 +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_090818_844398_834F7A2D X-CRM114-Status: GOOD ( 12.62 ) 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 , 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 , linux-rockchip@lists.infradead.org, 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, Rodrigo Vivi , 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/radeon/radeon_connectors.c | 82 +++++++++++++++++----- 1 file changed, 63 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index c60d1a44d22a..a876e51d275a 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -1946,11 +1946,15 @@ radeon_add_atom_connector(struct drm_device *dev, radeon_dig_connector->igp_lane_info = igp_lane_info; radeon_connector->con_priv = radeon_dig_connector; if (i2c_bus->valid) { - radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); - if (radeon_connector->ddc_bus) + struct radeon_connector *rcn = radeon_connector; + + rcn->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); + if (rcn->ddc_bus) { has_aux = true; - else + connector->ddc = &rcn->ddc_bus->adapter; + } else { DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + } } switch (connector_type) { case DRM_MODE_CONNECTOR_VGA: @@ -2045,9 +2049,13 @@ radeon_add_atom_connector(struct drm_device *dev, drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs); if (i2c_bus->valid) { - radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); - if (!radeon_connector->ddc_bus) + struct radeon_connector *rcn = radeon_connector; + + rcn->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); + if (!rcn->ddc_bus) DRM_ERROR("VGA: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = &rcn->ddc_bus->adapter; } radeon_connector->dac_load_detect = true; drm_object_attach_property(&radeon_connector->base.base, @@ -2070,9 +2078,13 @@ radeon_add_atom_connector(struct drm_device *dev, drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs); if (i2c_bus->valid) { - radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); - if (!radeon_connector->ddc_bus) + struct radeon_connector *rcn = radeon_connector; + + rcn->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); + if (!rcn->ddc_bus) DRM_ERROR("DVIA: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = &rcn->ddc_bus->adapter; } radeon_connector->dac_load_detect = true; drm_object_attach_property(&radeon_connector->base.base, @@ -2101,9 +2113,13 @@ radeon_add_atom_connector(struct drm_device *dev, drm_connector_init(dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type); drm_connector_helper_add(&radeon_connector->base, &radeon_dvi_connector_helper_funcs); if (i2c_bus->valid) { - radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); - if (!radeon_connector->ddc_bus) + struct radeon_connector *rcn = radeon_connector; + + rcn->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); + if (!rcn->ddc_bus) DRM_ERROR("DVI: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = &rcn->ddc_bus->adapter; } subpixel_order = SubPixelHorizontalRGB; drm_object_attach_property(&radeon_connector->base.base, @@ -2158,9 +2174,13 @@ radeon_add_atom_connector(struct drm_device *dev, drm_connector_init(dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type); drm_connector_helper_add(&radeon_connector->base, &radeon_dvi_connector_helper_funcs); if (i2c_bus->valid) { - radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); - if (!radeon_connector->ddc_bus) + struct radeon_connector *rcn = radeon_connector; + + rcn->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); + if (!rcn->ddc_bus) DRM_ERROR("HDMI: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = &rcn->ddc_bus->adapter; } drm_object_attach_property(&radeon_connector->base.base, rdev->mode_info.coherent_mode_property, @@ -2208,11 +2228,15 @@ radeon_add_atom_connector(struct drm_device *dev, drm_connector_init(dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type); drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs); if (i2c_bus->valid) { - radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); - if (radeon_connector->ddc_bus) + struct radeon_connector *rcn = radeon_connector; + + rcn->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); + if (rcn->ddc_bus) { has_aux = true; - else + connector->ddc = &rcn->ddc_bus->adapter; + } else { DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + } } subpixel_order = SubPixelHorizontalRGB; drm_object_attach_property(&radeon_connector->base.base, @@ -2258,11 +2282,15 @@ radeon_add_atom_connector(struct drm_device *dev, drm_connector_init(dev, &radeon_connector->base, &radeon_edp_connector_funcs, connector_type); drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs); if (i2c_bus->valid) { - radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); - if (radeon_connector->ddc_bus) + struct radeon_connector *rcn = radeon_connector; + + rcn->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); + if (rcn->ddc_bus) { has_aux = true; - else + connector->ddc = &rcn->ddc_bus->adapter; + } else { DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + } } drm_object_attach_property(&radeon_connector->base.base, dev->mode_config.scaling_mode_property, @@ -2297,9 +2325,13 @@ radeon_add_atom_connector(struct drm_device *dev, drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); drm_connector_helper_add(&radeon_connector->base, &radeon_lvds_connector_helper_funcs); if (i2c_bus->valid) { - radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); - if (!radeon_connector->ddc_bus) + struct radeon_connector *rcn = radeon_connector; + + rcn->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); + if (!rcn->ddc_bus) DRM_ERROR("LVDS: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = &rcn->ddc_bus->adapter; } drm_object_attach_property(&radeon_connector->base.base, dev->mode_config.scaling_mode_property, @@ -2384,6 +2416,9 @@ radeon_add_legacy_connector(struct drm_device *dev, radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); if (!radeon_connector->ddc_bus) DRM_ERROR("VGA: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = + &radeon_connector->ddc_bus->adapter; } radeon_connector->dac_load_detect = true; drm_object_attach_property(&radeon_connector->base.base, @@ -2401,6 +2436,9 @@ radeon_add_legacy_connector(struct drm_device *dev, radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); if (!radeon_connector->ddc_bus) DRM_ERROR("DVIA: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = + &radeon_connector->ddc_bus->adapter; } radeon_connector->dac_load_detect = true; drm_object_attach_property(&radeon_connector->base.base, @@ -2419,6 +2457,9 @@ radeon_add_legacy_connector(struct drm_device *dev, radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); if (!radeon_connector->ddc_bus) DRM_ERROR("DVI: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = + &radeon_connector->ddc_bus->adapter; } if (connector_type == DRM_MODE_CONNECTOR_DVII) { radeon_connector->dac_load_detect = true; @@ -2464,6 +2505,9 @@ radeon_add_legacy_connector(struct drm_device *dev, radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); if (!radeon_connector->ddc_bus) DRM_ERROR("LVDS: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); + else + connector->ddc = + &radeon_connector->ddc_bus->adapter; } drm_object_attach_property(&radeon_connector->base.base, dev->mode_config.scaling_mode_property,