From patchwork Sun Aug 4 20:16:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074859 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 A661617E5 for ; Sun, 4 Aug 2019 20:17:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 981A8287A0 for ; Sun, 4 Aug 2019 20:17:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 896C7287E2; Sun, 4 Aug 2019 20:17:05 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E93F28827 for ; Sun, 4 Aug 2019 20:17:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726656AbfHDURD (ORCPT ); Sun, 4 Aug 2019 16:17:03 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:46078 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726346AbfHDURD (ORCPT ); Sun, 4 Aug 2019 16:17:03 -0400 Received: by mail-lf1-f66.google.com with SMTP id u10so17589880lfm.12; Sun, 04 Aug 2019 13:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XKQ+KJdp8Wv4Lgd7meexm5skjc2BjgchimNFn7JqqdA=; b=EMDl7m7xtcbiDX6T4zT9T9Oup48SB92u6hjZvbuUDysrvQ2LKT045bww+uGPRJ/wGS Xx9dvfCti+h8c3UbT9/vPUIBcFzKt/YnuegL1QMuENQBV1IDlbyEjCcBPVarMC4LPjqX 2wJ/ko+exxrT8tGNbUyBXLEa3NdBap2PBiUUsZszcYc1q4mfZqrxZ1V3oXBda0LvlPu1 nAk6RBnwnq/4JPkevOBldmHhgFYKce/qePV0wDsZ4RcHAs8Kx/0/yWesR12likoYCkG7 qN1LiIhpYBG1MXL6JIwlhuDKzdtU9xdeprPv16WXN39mw2pQ6uz/KDJoZ0lPydP2x26B eZMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=XKQ+KJdp8Wv4Lgd7meexm5skjc2BjgchimNFn7JqqdA=; b=JJC1+G7SHWkIgtYaDNu+ORoXr+6fSbPhAZ1uajPgWJaxMugHAYrmo7ru79Gz5yUejl mIqQbAsV9NddA4cikmgxEu5k0iwQlVJhU0lvJtp1Hd612VLvsXsVOSXHpHgxsmbY9UBg RRiES3cGralzk/WAakVK41At9+yDlVtAi6hhObkTfPvI3OscX1wtV8Nj/GKtdnvQFdi2 +eSXZ1sqgcNU56dgcPTKb/BWr5gR3uRbh3CwHzWsrd1J+7KkdCsxpTsECyV/39bPeoSu PL1fVIO9BEYG6VccLIa390nIXyfYxpSEUyK0bg/OmfGzl3QCdt985jyoUDmUA883wR0V Mkew== X-Gm-Message-State: APjAAAW3vZI/94BE12xao6eNcyzmNohytCx8GORI8/jY2im/Riz7i3jc fIJLBwODYLbFybslKBAI8WA= X-Google-Smtp-Source: APXvYqyao7EZANem5EL9cjm0IVmoUZr8fWYB9FLYhw/F/m5O3hktZo8Fs57Jvrx6gfI76gcjrnUKZw== X-Received: by 2002:a19:c711:: with SMTP id x17mr69469503lff.147.1564949821600; Sun, 04 Aug 2019 13:17:01 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.16.59 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:01 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 01/16] drm/bridge: tc358767: fix opencoded use of drm_panel_* Date: Sun, 4 Aug 2019 22:16:22 +0200 Message-Id: <20190804201637.1240-2-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace open coded version with call to drm_panel_get_modes(). Signed-off-by: Sam Ravnborg Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Reviewed-by: Philipp Zabel --- drivers/gpu/drm/bridge/tc358767.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 42f03a985ac0..cebc8e620820 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1312,7 +1312,7 @@ static int tc_connector_get_modes(struct drm_connector *connector) { struct tc_data *tc = connector_to_tc(connector); struct edid *edid; - unsigned int count; + int count; int ret; ret = tc_get_display_props(tc); @@ -1321,11 +1321,9 @@ static int tc_connector_get_modes(struct drm_connector *connector) return 0; } - if (tc->panel && tc->panel->funcs && tc->panel->funcs->get_modes) { - count = tc->panel->funcs->get_modes(tc->panel); - if (count > 0) - return count; - } + count = drm_panel_get_modes(tc->panel); + if (count > 0) + return count; edid = drm_get_edid(connector, &tc->aux.ddc); From patchwork Sun Aug 4 20:16:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074865 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 977E5184E for ; Sun, 4 Aug 2019 20:17:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84A2E287A0 for ; Sun, 4 Aug 2019 20:17:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7088F28803; Sun, 4 Aug 2019 20:17:08 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1041F287A0 for ; Sun, 4 Aug 2019 20:17:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726666AbfHDURH (ORCPT ); Sun, 4 Aug 2019 16:17:07 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:41428 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726346AbfHDURH (ORCPT ); Sun, 4 Aug 2019 16:17:07 -0400 Received: by mail-lf1-f68.google.com with SMTP id 62so51485846lfa.8; Sun, 04 Aug 2019 13:17:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZQy9HfEbGA1ab0VIPAqW/5LFlvvMfM3YtKt25w5akQg=; b=kU2m0+RBLUeqJOTqmN7wdIW5oOoJZk4mOVt8g2Pj9LBw8owAvIqfINDwzOdJ8fG3vY TmasVFXMgD9rbalVp2CRfKLF2xAY6JU4RpR/URtcsWX5hO4W1AcMMyl7KxM0EwKntN+X s0PmeKEE1zCtIcWZZbPwdxjRU5nYL6lOJnt+7SVLtKXAqsl18OyMoAewTdWmVuRodIhM KERP/ppypDVfWGQGYyvXKM9f9XAJghQ8AgeG2s18H4kOr9xhKEUbFmFZ5sLSnbcTPPgg zbfqIEc3h652BTSzj7i7m2PWJWdp865ZGwAZPpyW4xSJXt92fzG/ahvoGyE7oIx+IrkH t9mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZQy9HfEbGA1ab0VIPAqW/5LFlvvMfM3YtKt25w5akQg=; b=dHjlE4RearSkQ0dOo0ZF65v+acXvSIvyAt10ksKrhW94dFa28jlednFYYQkHcllvjx QUtY3LOkku1Ls656b6SZrKPoF/268Jre3qG0pruQvmt8gNbluaVmtn5yRERfRcoIUWOp bnvbscdJQreLfgd0Wkr1zubmoI3QBdvMW4BG0zCk/6fphsKvLt5oxJAnrOW57p/2+Hco EH+S5hPcd/oO4td3sCJoi/cmeEPYYe3f3HfDYACJK5qg2zVZ+LqgJ+0sXqY0agLz/E0x KIw0ZG8cPlqaaszWFdI66UCHsOcOVHo19zHbS/dwZlq9DIzcSA8FP7UGQayTWQAylRPm 0kJw== X-Gm-Message-State: APjAAAVnT6v7GmXMvCo+mJbfAO1fVMFCBMSFFD0Ig8pY3yOo+vr32AWH gf0h9+TD5ilKlgh1HajFiB8= X-Google-Smtp-Source: APXvYqxrxJ6f5gcwOvxklU9HO4h4OF+p5nSRTWaf0Mi726mZOEO7tha0ZCSglPRdKYDVM/d5m/f2qg== X-Received: by 2002:a05:6512:146:: with SMTP id m6mr5406980lfo.90.1564949824886; Sun, 04 Aug 2019 13:17:04 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.02 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:04 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 02/16] drm/exynos: fix opencoded use of drm_panel_* Date: Sun, 4 Aug 2019 22:16:23 +0200 Message-Id: <20190804201637.1240-3-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drm_panel_attach() will check if there is a controller already attached - drop the check in the driver. Use drm_panel_get_modes() so the driver no longer uses the function pointer. Signed-off-by: Sam Ravnborg Cc: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org --- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c index 3cebb19ec1c4..5479ff71cbc6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c @@ -43,7 +43,7 @@ exynos_dpi_detect(struct drm_connector *connector, bool force) { struct exynos_dpi *ctx = connector_to_dpi(connector); - if (ctx->panel && !ctx->panel->connector) + if (ctx->panel) drm_panel_attach(ctx->panel, &ctx->connector); return connector_status_connected; @@ -85,7 +85,7 @@ static int exynos_dpi_get_modes(struct drm_connector *connector) } if (ctx->panel) - return ctx->panel->funcs->get_modes(ctx->panel); + return drm_panel_get_modes(ctx->panel); return 0; } From patchwork Sun Aug 4 20:16:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074871 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 13E7A17E5 for ; Sun, 4 Aug 2019 20:17:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03EF8287A0 for ; Sun, 4 Aug 2019 20:17:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBC1828803; Sun, 4 Aug 2019 20:17:11 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EB27287A0 for ; Sun, 4 Aug 2019 20:17:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726686AbfHDURL (ORCPT ); Sun, 4 Aug 2019 16:17:11 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:42889 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726346AbfHDURL (ORCPT ); Sun, 4 Aug 2019 16:17:11 -0400 Received: by mail-lj1-f193.google.com with SMTP id t28so77424754lje.9; Sun, 04 Aug 2019 13:17:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1TEXaZ1KpdAoiO85boEPTBxnq8MPM5bbeG78Znsg1kk=; b=UY9E/BN/VsoWEhEtkdN8SUZ6JHfj/MBgZgo1KwFNcuBN2pN7TOGU5AbsZbBMQBBMp/ +KPl14S0+PYrY1NlQyBlfArZikLv53LGe2G/hMahk+c88DAkGoN1qgt0F0pIFL6MlC69 Lcg7RTaWFBAx4PfmCtkLgYHY73b8PSgMP9+nEJT1uYEv3otLP4iBzlNGlEbAcG98zDQZ E6yypKdyIS1mOqIB1qbZbUit/9wBYgZ6PRdzJSzvLpvas00dvht3i0+tzIDnbOuyzH3p RAn2m/o5JiW0VANG9Eoc7to6esERy5lprBeYjTpFb798pyI2UJNt8Ef9POkUjSlMe9BK Z98A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=1TEXaZ1KpdAoiO85boEPTBxnq8MPM5bbeG78Znsg1kk=; b=jWyHxpddpmMmDeYz4O9wM+DwQWiovQhIlbxyj0E9ZaJ1L7Cj69o7mPGtqZvRaxQDz2 9OfNRL2RLNEcFo8hZsevOemfRtcgUtn8yZ7vgbnm1DQ/5Dgplz0zGBrsKqiLXSYIxm8G Z6uKNyUEMFPHPaWg2QLgyVsKimgp7l4QL0wl/4zqCRQD1ZV4roJapWhimJRl/PKHxXcu ErWAB0IxzWX/XenruWYm2IFqEjiKop9BYVrcJOF6rISTOXGsHzf50dXdZNB7GBi8OwrK shjJ534928QxTGRxHdrx2Rm3S1HTjQ8Z5m8tIoh7V1Ks+pn+rWjx2NSpTaW4uvQ/tz2v MHmw== X-Gm-Message-State: APjAAAXnj0GaPfDPra/ezq5AisOdJWqwQM89ma/gLhZUVoDfC/UEhHpx dj/EZQNH7vjo5aI/a397j7o= X-Google-Smtp-Source: APXvYqyX2DV4pg4STFder0QLYZxjB3cRp7z66cR5BIB23ZVo0ZMYOEKaRseLqKMG0kPOviSdCK01aQ== X-Received: by 2002:a2e:3211:: with SMTP id y17mr38833847ljy.86.1564949828875; Sun, 04 Aug 2019 13:17:08 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.06 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:08 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 03/16] drm/exynos: fix opencoded use of drm_panel_* Date: Sun, 4 Aug 2019 22:16:24 +0200 Message-Id: <20190804201637.1240-4-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Call via drm_panel_get_modes(). Signed-off-by: Sam Ravnborg Cc: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 6926cee91b36..36b02b456d9c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1460,7 +1460,7 @@ static int exynos_dsi_get_modes(struct drm_connector *connector) struct exynos_dsi *dsi = connector_to_dsi(connector); if (dsi->panel) - return dsi->panel->funcs->get_modes(dsi->panel); + return drm_panel_get_modes(dsi->panel); return 0; } From patchwork Sun Aug 4 20:16:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074875 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 348E31395 for ; Sun, 4 Aug 2019 20:17:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25D05287A0 for ; Sun, 4 Aug 2019 20:17:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18D6F28803; Sun, 4 Aug 2019 20:17:16 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0002287A0 for ; Sun, 4 Aug 2019 20:17:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726693AbfHDURP (ORCPT ); Sun, 4 Aug 2019 16:17:15 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44575 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726346AbfHDURP (ORCPT ); Sun, 4 Aug 2019 16:17:15 -0400 Received: by mail-lj1-f193.google.com with SMTP id k18so77399444ljc.11; Sun, 04 Aug 2019 13:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OqhXxXwy9Hr3xWItmkC0WnCOZqEhN5kTgjtJyN6Z+CY=; b=NLLRFWKzJmEIu9OTOt7Ai8tctMWnGdjeyEFU+bfOuWd3AgIJwVV5bg33IJmsvBZup+ JybThz+nVWyyLhyxpWRvRVqVGJqJtDYU59QsXSfu+zCyvbOcabGJOut4KqbsMVWxIH4Z tW+Tv7tICzEJDkmjcIBJSlRM1z6IOKUpkGKIAU/4Ybs703WZbR3nNjvMr3m+CkOHkc17 Rb4XRehU55J1G+MqL6y4FTAHHomaoEOikxlyWWWJtnnFAqOmZ710XFHX0eWXQQL7lRT1 f/jZm/vh9FmhUey+YmveVXZdx/reIWL8VTKKHRLpUUQZGISW6Eyybhr/rBDd1ODzkPPO 8Y7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OqhXxXwy9Hr3xWItmkC0WnCOZqEhN5kTgjtJyN6Z+CY=; b=hPnK8hMSEBmU5fOtMX0xrh4+xa+9yQcJPoYnhV+sYgG9nFmgGpxLZf+1yRftLdLUlc QqLm7m9aKB/6MhmKC5y6thlgTtmWqL/vhvILjBGPJhE+YSqmHX9Aig6j3mb3B5cW1wgr cwdhHxnqh/27hJQZ8OqdMLxwRNAciSNAV1TxwUWcV7NgcGvP9JYn4QTK9L6S7u28r72P QXfdP2vpQ1qbU3WzBdAh1qPqQxVbwL67adW33O8wr98cSoDvpmLYie5Aqo6WwOn6K8X1 MVA2gB58L7TxF+1REKMAATIk7AjrQtokOnM+M6eTXSn4oFONk2q1heTIZIrwI9Fswpaj kfxw== X-Gm-Message-State: APjAAAWwbXVk7RVuI2+fzyTzpySH+0ms5GsU5HZji8tj+urBBgS1nTSD it+FffqTsdXIGxXcMkUMRUI= X-Google-Smtp-Source: APXvYqwr7YURU5x5uQX4eMotoB3lQEWzubIKRtOF0qGU+ymuvCnRLcgiy7sxe5BsFuWKIZGt+qJn3A== X-Received: by 2002:a2e:86c3:: with SMTP id n3mr35048878ljj.129.1564949832447; Sun, 04 Aug 2019 13:17:12 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.10 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:11 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 04/16] drm/imx: fix opencoded use of drm_panel_* Date: Sun, 4 Aug 2019 22:16:25 +0200 Message-Id: <20190804201637.1240-5-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the drm_panel_get_modes() function to get the modes. This patch leave one test for the function pointer: panel->funcs->get_modes This is used to check if the panel may have any modes. There is no direct replacement. We may be able to just check that drm_panel_get_modes() return > 0, but as this is not the same functionality it is left for later. Signed-off-by: Sam Ravnborg Cc: Philipp Zabel Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: linux-arm-kernel@lists.infradead.org Acked-by: Philipp Zabel --- drivers/gpu/drm/imx/imx-ldb.c | 11 ++++------- drivers/gpu/drm/imx/parallel-display.c | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c index db461b6a257f..695f307f36b2 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -124,14 +124,11 @@ static void imx_ldb_ch_set_bus_format(struct imx_ldb_channel *imx_ldb_ch, static int imx_ldb_connector_get_modes(struct drm_connector *connector) { struct imx_ldb_channel *imx_ldb_ch = con_to_imx_ldb_ch(connector); - int num_modes = 0; + int num_modes; - if (imx_ldb_ch->panel && imx_ldb_ch->panel->funcs && - imx_ldb_ch->panel->funcs->get_modes) { - num_modes = imx_ldb_ch->panel->funcs->get_modes(imx_ldb_ch->panel); - if (num_modes > 0) - return num_modes; - } + num_modes = drm_panel_get_modes(imx_ldb_ch->panel); + if (num_modes > 0) + return num_modes; if (!imx_ldb_ch->edid && imx_ldb_ch->ddc) imx_ldb_ch->edid = drm_get_edid(connector, imx_ldb_ch->ddc); diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c index 2e51b2fade75..e7ce17503ae1 100644 --- a/drivers/gpu/drm/imx/parallel-display.c +++ b/drivers/gpu/drm/imx/parallel-display.c @@ -47,14 +47,11 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector) { struct imx_parallel_display *imxpd = con_to_imxpd(connector); struct device_node *np = imxpd->dev->of_node; - int num_modes = 0; + int num_modes; - if (imxpd->panel && imxpd->panel->funcs && - imxpd->panel->funcs->get_modes) { - num_modes = imxpd->panel->funcs->get_modes(imxpd->panel); - if (num_modes > 0) - return num_modes; - } + num_modes = drm_panel_get_modes(imxpd->panel); + if (num_modes > 0) + return num_modes; if (imxpd->edid) { drm_connector_update_edid_property(connector, imxpd->edid); From patchwork Sun Aug 4 20:16:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074879 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 8A21817E5 for ; Sun, 4 Aug 2019 20:17:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A190287A0 for ; Sun, 4 Aug 2019 20:17:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DCA928803; Sun, 4 Aug 2019 20:17:18 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12341287E2 for ; Sun, 4 Aug 2019 20:17:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726696AbfHDURR (ORCPT ); Sun, 4 Aug 2019 16:17:17 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:45811 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726346AbfHDURR (ORCPT ); Sun, 4 Aug 2019 16:17:17 -0400 Received: by mail-lj1-f195.google.com with SMTP id m23so77345306lje.12; Sun, 04 Aug 2019 13:17:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WgVzWcgmLIPnyZKomZGLKI2l35SfEezC0RuGRG5g/EI=; b=Brv6b6OXXGcKeKH38lJ761HH0YTn5I9O/tREug6fGjyWJ+NCJsVZQvPQM7DlX+nsR6 WA6HO+Rv7vxjU15u7L1NOWrHWicKyXbrTATlAAXAD8yRFsCg2XGn4VI2lwGp8s6DpiMn E+QAS5oYqtk6XgBCtudTDF/nIQ0Muy9Gmk0WQyu31aBZVKM5gvbZmkz16wMGlkqAX8tT wSS/p1pcWPPdgD67sqBEd7oUFfCCBGs7Y8NUSBCmu45zwvTYB7/dsrGKfXnKQEvSnQFP hjVSneDQ7YRnHrxMyOpJIf7d8FN3ltIdMphdq4MyGP2KAGXagMIV58euOaKS9DGq1EgA VMKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=WgVzWcgmLIPnyZKomZGLKI2l35SfEezC0RuGRG5g/EI=; b=n/rzj2fAH5FZn3mrEvLgBXdeKxg+RLhw+gVdvtOwJ9cn39uRDJWvFDNzHQk0/o26N7 oU2JNmb0BKVDB3cYiKd3jjpR3Kub/scvABUbg1n66si+0jjxFpFyOmwkC2FkY+gSBnxN bbK4MWdbDLN7oZr8JIfgV/eftHRu6NJ5cfjHQ1p3Qr6aPjNzFqVPKzZPdQZUnl6nXoCv xhiHJ7H3YGg3+HpB2UuRDiz0tkSAjv6h4lawPslVmKEQQrLi/pPUDn1hsokcuwTd7iQ2 5bI9JyFWz34+SwZAwRZ3Rqx0+6i3qwKGtaqL2vD9dxEf/3hVz5Csu4gTqGAmgivcrUny lK8w== X-Gm-Message-State: APjAAAUXjNNeEbxjPkkr6hRja5hgrO1SGvlJiFJ+Kwt/2l1KumirTRai UqDm4kZvJGPdut+dlsaqZGs= X-Google-Smtp-Source: APXvYqwud3tPWGlx2rT6WRxi5qtgEVcIyAyTabZz4LeIPtVV4R4zHjIsHNXrxj2gWB7phumt4Zx9PQ== X-Received: by 2002:a2e:854d:: with SMTP id u13mr78583687ljj.236.1564949835418; Sun, 04 Aug 2019 13:17:15 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.13 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:14 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 05/16] drm/fsl-dcu: fix opencoded use of drm_panel_* Date: Sun, 4 Aug 2019 22:16:26 +0200 Message-Id: <20190804201637.1240-6-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use drm_panel_get_modes() to access modes. This has a nice side effect to simplify the code. Signed-off-by: Sam Ravnborg Cc: Stefan Agner Cc: Alison Wang Acked-by: Stefan Agner --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c index 279d83eaffc0..a92fd6c70b09 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c @@ -65,17 +65,9 @@ static const struct drm_connector_funcs fsl_dcu_drm_connector_funcs = { static int fsl_dcu_drm_connector_get_modes(struct drm_connector *connector) { struct fsl_dcu_drm_connector *fsl_connector; - int (*get_modes)(struct drm_panel *panel); - int num_modes = 0; fsl_connector = to_fsl_dcu_connector(connector); - if (fsl_connector->panel && fsl_connector->panel->funcs && - fsl_connector->panel->funcs->get_modes) { - get_modes = fsl_connector->panel->funcs->get_modes; - num_modes = get_modes(fsl_connector->panel); - } - - return num_modes; + return drm_panel_get_modes(fsl_connector->panel); } static int fsl_dcu_drm_connector_mode_valid(struct drm_connector *connector, From patchwork Sun Aug 4 20:16:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074885 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 2922814E5 for ; Sun, 4 Aug 2019 20:17:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A523287E2 for ; Sun, 4 Aug 2019 20:17:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E0722882C; Sun, 4 Aug 2019 20:17:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3026287E2 for ; Sun, 4 Aug 2019 20:17:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726709AbfHDURU (ORCPT ); Sun, 4 Aug 2019 16:17:20 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44581 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726346AbfHDURU (ORCPT ); Sun, 4 Aug 2019 16:17:20 -0400 Received: by mail-lj1-f193.google.com with SMTP id k18so77399571ljc.11; Sun, 04 Aug 2019 13:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yel48h0qo2wbp0mM+rNqpesYnmUiIUwuFRYEGRdGqyc=; b=RhcmWOYNugg3RhzTq+cei+ZzJ5PbMDYuydezLvh4SzkEdVGuUstINi6mF3JdxqSgHE vt/tTDGSa1SEDKK2uctzf8Q7x2lA/At+dJJvONXAfw1PG5quso6A1CYppTRQmjq2Mztz 8+QesDo5Y3z8q6FOM3FS99qDTyn9eq0bJZAAqangO3/ERv+ON6doIPb4/KiuSEd+wtXi tJ+Td+ky5MuQfpIn1AOxC7vWgtQI6QRzHg+odjRtEyUsSQvmNFrXrQU7NFPkrkmguzMt nJHPyyRqYLsguHOCJz+yVza9xugy775zludTZthdBmnpUbY+21C3bNWQ8WuAZTw3PPVj S+AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=yel48h0qo2wbp0mM+rNqpesYnmUiIUwuFRYEGRdGqyc=; b=Wu+jlhTscL7OYutWpxhc80R3M1+8v63f0pcTk/3ZWeNidFSxWtMijCKytrbxKYRwpL AYw1LvAZs2aX5Xh89a/Eu+usn+WueluNSt6D2uhs2A5CawhOGEVJjhru66yASgz0woZz ahsbg0iukaYbuZ8bNTmIoKhmXzbUUvR4LtBjdJijAY81u+euR0yCjnfzjGFKbjuO5QQb 5hWCEo+eZlvXbFEEidWDiiPhU7c2D9jLRG2zY4uiM8D/z3aaHJU4DNIUI2Fsrstaa7Pw 426JGJJOhpRQXNtvHf1gOXSv6MnBx+blgha8f4IxQ0JXo6HKGbv8EoCMvsy/UoLvcctp 4YNg== X-Gm-Message-State: APjAAAXWR63rFrWpIjAFckIkWp27sWSkuUfPBDW8HwRMopdR9RbU0hTO RK8ONz0nrzd031u/nfHCd9M= X-Google-Smtp-Source: APXvYqxdGxd0F02kFmQDzjnepawHElytfS6OgwAwlzDKWRLVxKsqajzgR4P7dB62VuLk5D8PL5TcOg== X-Received: by 2002:a2e:88d3:: with SMTP id a19mr29864312ljk.32.1564949838298; Sun, 04 Aug 2019 13:17:18 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.16 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:17 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 06/16] drm/msm: fix opencoded use of drm_panel_* Date: Sun, 4 Aug 2019 22:16:27 +0200 Message-Id: <20190804201637.1240-7-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the function drm_panel_get_modes(). Signed-off-by: Sam Ravnborg Cc: Alexios Zavras Cc: Thomas Gleixner Cc: Allison Randal Cc: Sam Ravnborg Cc: Enrico Weigelt --- drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c index ecef4f5b9f26..0e21252fd1d6 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c @@ -55,7 +55,7 @@ static int mdp4_lvds_connector_get_modes(struct drm_connector *connector) if (panel) { drm_panel_attach(panel, connector); - ret = panel->funcs->get_modes(panel); + ret = drm_panel_get_modes(panel); drm_panel_detach(panel); } From patchwork Sun Aug 4 20:16:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074899 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 3446517E5 for ; Sun, 4 Aug 2019 20:17:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23B12287A0 for ; Sun, 4 Aug 2019 20:17:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1742428803; Sun, 4 Aug 2019 20:17:32 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32F6E287A0 for ; Sun, 4 Aug 2019 20:17:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726743AbfHDURX (ORCPT ); Sun, 4 Aug 2019 16:17:23 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:35919 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbfHDURX (ORCPT ); Sun, 4 Aug 2019 16:17:23 -0400 Received: by mail-lf1-f67.google.com with SMTP id j17so2330024lfp.3; Sun, 04 Aug 2019 13:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OxHLOBnK1lNWSIGtczNLCozsQ3QtlSsdUZb5LP3kT0Y=; b=gAaQXpYAm1KYEI8rTb/OJS5eorTrd92AMU7Pgi3cS8X6yqya7FjBl9kj9ebkyM+BQ/ kG4QjvdGy6WXSKN7R/ZQNoAxeSgQCgA1VuMB+nBFs6rk8efjjkFyzh2SrNKwlNtKxRv2 iqFdb18qXUBYcmOjBQMer7IjewoVURBwU1mO6clB1CjpoYwMbL0dpBv5c5OlKDDciWGs +6s7JssXa+Tp4Fw6Xv9rE4h/pvUSUTj+AGdJZ0Y1bIflrUTi9w/c11SxgFj2XGUzbSor Ih7r/DdnsvWE0Xa5m0vqrhXL8QpXxKHJ2L7jKQ5/4zZoKB6An4mvQ34TzIHSV8u5sEtD kaxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OxHLOBnK1lNWSIGtczNLCozsQ3QtlSsdUZb5LP3kT0Y=; b=YeDsGaDcHa1TyMyThPeLZuFfUB/ePpkzufG9yF66vWL89Kq3g7hZw+hzbCV0POBaLb rRHgxiUZ3lwiTGZ+fYcYkV/we92pPtgdmVHF6/tDQ9ayOA2H6huhnl1gYpzggm3Q05tI XEE0pOFmyTBchXP1EdCyxdLb9ToUD2rSQan6x6lhiUkQyhQXbShUYGQgb4sXEJl7AA5P 6O/kUCAkyf98bssNX9mawmO4Ijzv2nMICyKAnmpXbSJjdLAQbzMVwt8FwhFU0InW9T02 ZcKOF1tkFuwNyVvl9sOc7JghnkTgpOI0N8RVWHGQ6gv53oeMi8bvoCsqt8c188X4d7ov dZXg== X-Gm-Message-State: APjAAAUH3kBefuViWWdNc5TnAueiQfuNWSiFQMONtgq+Y+wp9sVrpvuI jURRdR83M841OhTRZqyeMIE= X-Google-Smtp-Source: APXvYqz3M5CTobM4ucLU8BcfTgw1LTrA2m/uc+fEekEh6iImfAPIvEukRCN6dkkcG2PkH6QhUumtFg== X-Received: by 2002:ac2:4242:: with SMTP id m2mr7496505lfl.121.1564949841198; Sun, 04 Aug 2019 13:17:21 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:20 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 07/16] drm/mxsfb: fix opencoded use of drm_panel_* Date: Sun, 4 Aug 2019 22:16:28 +0200 Message-Id: <20190804201637.1240-8-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the drm_panel_get_modes() function. Signed-off-by: Sam Ravnborg Cc: Marek Vasut Cc: Stefan Agner Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: linux-arm-kernel@lists.infradead.org Acked-by: Stefan Agner --- drivers/gpu/drm/mxsfb/mxsfb_out.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mxsfb/mxsfb_out.c b/drivers/gpu/drm/mxsfb/mxsfb_out.c index 231d016c6f47..be36f4d6cc96 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_out.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_out.c @@ -30,7 +30,7 @@ static int mxsfb_panel_get_modes(struct drm_connector *connector) drm_connector_to_mxsfb_drm_private(connector); if (mxsfb->panel) - return mxsfb->panel->funcs->get_modes(mxsfb->panel); + return drm_panel_get_modes(mxsfb->panel); return 0; } From patchwork Sun Aug 4 20:16:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074893 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 CEEA314E5 for ; Sun, 4 Aug 2019 20:17:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF961287E2 for ; Sun, 4 Aug 2019 20:17:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B30F02882A; Sun, 4 Aug 2019 20:17:30 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52CB2287E2 for ; Sun, 4 Aug 2019 20:17:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726757AbfHDUR0 (ORCPT ); Sun, 4 Aug 2019 16:17:26 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:34414 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbfHDUR0 (ORCPT ); Sun, 4 Aug 2019 16:17:26 -0400 Received: by mail-lf1-f68.google.com with SMTP id b29so49115817lfq.1; Sun, 04 Aug 2019 13:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s4/lZRelptHc104CnII3uRWlwirvAGTIUK7NUlarcVo=; b=hWmKbfmQQIVJxZRPfrherAkt3SNEI7zhPoih2CPXgPp9jEQCRH+yG/dl/c4qYD3qd5 BQI3l70sYIQvQDJ9NIAS65Ozt5RyiuzKOYLtizitbR4GCGx+pB+ZedWJqT2vpMYOCLTp B5ECOtlrzZvDWx8KKENhQ9ldmy5PzoDHXyDkM7hz673pvh90w4XxURDWocdf0c8Y137Z SALN0A2sGAt6p2c2hcNPXagGlykyVJPMLdz2sy5ITY0lYhMstc5IOEAz5RiiBgYmiBvA 10rXPPBW/fAA2pN/XyW63cSzbrBUTCCPu9UWF0Xyu2c4EqeaYded+97H70L3wbNH98Wb 2yyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=s4/lZRelptHc104CnII3uRWlwirvAGTIUK7NUlarcVo=; b=ChMdXxlOr1b+GsWmKfUMVQ63+fni9hbB0y6gJsDZ8kre+jItwW4LFKdN38IXaD9cro +1g0NbjZKOYUCFdMbEd9TcJvYJD0jwnsq54eJCNuwhRaZbU2NeioIQE/BUs9m12YDQI1 FkpCx17YLphngajC+vX65waKXVDsnLdVk2kPeUGg27COEw55mLPtrmL6KGEa76jkfDRW 8FHRo99E3Am4iDtyBF0AXAHuCmdoSOW6pnzAMdK00Jk5ZhzHUmnyGmGW3GKJVcL9kRzY z/Xjijb1ck0DXpiPs1O1b7EkUnTnNvuoaATtwbbc5JbznghfnPF2z/foRo21XhOMAAv+ FY+g== X-Gm-Message-State: APjAAAWffAM6m8X/8DD5khFkj4KvrD3DekpWwQrw+kMCLfuWlcwT9o9w s45DjkO5eib92suXCYg6WWE= X-Google-Smtp-Source: APXvYqxkQf3a/qXtHlYJbVGarQ0L/TPLy9TUhSmBsSYBja6fNZHhdSSpkgaaQyEfjze7v8D/ne+SQQ== X-Received: by 2002:a19:6d02:: with SMTP id i2mr4308705lfc.191.1564949844127; Sun, 04 Aug 2019 13:17:24 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:23 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 08/16] drm/sti: fix opencoded use of drm_panel_* Date: Sun, 4 Aug 2019 22:16:29 +0200 Message-Id: <20190804201637.1240-9-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the drm_panel_(enable|disable|get_modes) functions. Signed-off-by: Sam Ravnborg Cc: Benjamin Gaignard Cc: Vincent Abriou --- drivers/gpu/drm/sti/sti_dvo.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c index 9e6d5d8b7030..e55870190bf5 100644 --- a/drivers/gpu/drm/sti/sti_dvo.c +++ b/drivers/gpu/drm/sti/sti_dvo.c @@ -221,8 +221,7 @@ static void sti_dvo_disable(struct drm_bridge *bridge) writel(0x00000000, dvo->regs + DVO_DOF_CFG); - if (dvo->panel) - dvo->panel->funcs->disable(dvo->panel); + drm_panel_disable(dvo->panel); /* Disable/unprepare dvo clock */ clk_disable_unprepare(dvo->clk_pix); @@ -262,8 +261,7 @@ static void sti_dvo_pre_enable(struct drm_bridge *bridge) if (clk_prepare_enable(dvo->clk)) DRM_ERROR("Failed to prepare/enable dvo clk\n"); - if (dvo->panel) - dvo->panel->funcs->enable(dvo->panel); + drm_panel_enable(dvo->panel); /* Set LUT */ writel(config->lowbyte, dvo->regs + DVO_LUT_PROG_LOW); @@ -340,7 +338,7 @@ static int sti_dvo_connector_get_modes(struct drm_connector *connector) struct sti_dvo *dvo = dvo_connector->dvo; if (dvo->panel) - return dvo->panel->funcs->get_modes(dvo->panel); + return drm_panel_get_modes(dvo->panel); return 0; } From patchwork Sun Aug 4 20:16:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074895 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 2E34B17E5 for ; Sun, 4 Aug 2019 20:17:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F03E287E2 for ; Sun, 4 Aug 2019 20:17:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 129BA28827; Sun, 4 Aug 2019 20:17:31 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7228028803 for ; Sun, 4 Aug 2019 20:17:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726687AbfHDUR3 (ORCPT ); Sun, 4 Aug 2019 16:17:29 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:41439 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbfHDUR3 (ORCPT ); Sun, 4 Aug 2019 16:17:29 -0400 Received: by mail-lf1-f68.google.com with SMTP id 62so51486151lfa.8; Sun, 04 Aug 2019 13:17:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wk6pfousIAMCDI6Uyo+lM1td1MgXZzePdo2c6E2Onic=; b=tOCty/gZdEJZyOP/LNSmnWRovYxXff7HblVK8JBUwNKGrmTZ+mYA0XLKKLgk4z4yh/ fBO9mOHvoad0V1tr1vvpw8D9YeCxA6tK5vJcEFMZJnwPoPsbHn+HSREVKkWjPSp9hJxn 6O+7mFpQuChXeq8lCOSF1rKrQa9RJOuWSEaLRkkGuFO5ra4yL2+dKAYsbR4/XMyVHkWy Z1ut/fRIY+7glcUvkTmq+AArGP1m25gmupSXINZcKexEnrAEP9Y2L6S8eT5ly7N5HAK1 H6xR/uxZns5l6A8wH2ZL1OO1aRJCaRQSPfhd90PwVcC82louRVZsNLqZAULk7h65wV5X uqYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wk6pfousIAMCDI6Uyo+lM1td1MgXZzePdo2c6E2Onic=; b=ewpZfJOkBSCQjr3zQRXrKOnV+mw+0l4C1b8EC4imI7JWmmuuEonmU6oWIndY1oDZUp lvXth7Z3If8Wo9BhcYWt0mZe67yPKc7i3qhQ834B4AIwjNS/A5R1+cJr0Wfhd5394Cwq reCyiufyWC8t6F1ET0hTQIFE7+cOI4bZZ9sVXv5Zj1rikEEt1lgU8PWjzdchyYHFVfW/ m7a07GsW7iWjRQxt/+Dn8xd+pqmfRCLf7OkeWbXyX2aPo+PxtEUndvOtSk97V3KcoprE tYDYT8o5WR7lUxflBBk1+YoWglH8Fgj8p6HU5VqnRg4ivNif0rbM8pu+nrGv2NWeAQ3u MYHw== X-Gm-Message-State: APjAAAVFdvJF9ABZK67b2DIOZDbHuzzcK3L5uXuHPENN8x5t8n3ECujy +bigkb3S+cR50ZQYUQ1ArxE= X-Google-Smtp-Source: APXvYqyLrFVeZI/lzYw2iRoU+pX5u/EBCoveXbxfKssjwJUGzKx1R2K/aZs1vIVE+lwZRLrksTI4Hg== X-Received: by 2002:ac2:5dc3:: with SMTP id x3mr30142069lfq.168.1564949846990; Sun, 04 Aug 2019 13:17:26 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.25 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:26 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 09/16] drm/tegra: fix opencoded use of drm_panel_* Date: Sun, 4 Aug 2019 22:16:30 +0200 Message-Id: <20190804201637.1240-10-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the drm_panel_get_modes function. Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Jonathan Hunter Cc: linux-tegra@vger.kernel.org --- drivers/gpu/drm/tegra/output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c index 274cb955e2e1..52b8396ec2dc 100644 --- a/drivers/gpu/drm/tegra/output.c +++ b/drivers/gpu/drm/tegra/output.c @@ -23,7 +23,7 @@ int tegra_output_connector_get_modes(struct drm_connector *connector) * ignore any other means of obtaining a mode. */ if (output->panel) { - err = output->panel->funcs->get_modes(output->panel); + err = drm_panel_get_modes(output->panel); if (err > 0) return err; } From patchwork Sun Aug 4 20:16:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074903 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 DEFDA1395 for ; Sun, 4 Aug 2019 20:17:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0890287A0 for ; Sun, 4 Aug 2019 20:17:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C39E228827; Sun, 4 Aug 2019 20:17: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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50466287A0 for ; Sun, 4 Aug 2019 20:17:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726764AbfHDURc (ORCPT ); Sun, 4 Aug 2019 16:17:32 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:45071 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726761AbfHDURc (ORCPT ); Sun, 4 Aug 2019 16:17:32 -0400 Received: by mail-lf1-f66.google.com with SMTP id u10so17590234lfm.12; Sun, 04 Aug 2019 13:17:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=shoyTDJcoi5HvA8suEJ+ePhtLRmu1CfLIIIm8v7PNNs=; b=TT0liCbgGg0E/gJCenrGbe3V7qxESoHcLYR9Fqum61d5epYgpLiaYRYFfKL92Pr3ih 8qYhDSumrhQUVMEQzIyzfC1SGb+fphtyBPbjIx90BYEUkYkHRusp/zv3xYTe4Q5JntxV tPvq1numLSzbK1j6IgLi22GioQ71kzagFKwDFQTjXRdiZQgt2p+E4RM5HcLdsKTlmHBc xcIoztstMzYcu0dtXtODbAIM4OsypFfHT2H5Sbqg70r2FfpBM/xvUiRRgTp1cQZhCVPM 63T3SG4pNSJFLmpPNWxgt7AqRvsoRkBsILlP/FwlXKZdsAnovbJMjKhi+vrEpjsIAHnh ymFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=shoyTDJcoi5HvA8suEJ+ePhtLRmu1CfLIIIm8v7PNNs=; b=U9+pcDg4GTOd0ock0ee2FVovF9qkPkkBRKRMk9/x/hirKl7OOSvpUMbi8SohJdYgIX Qe28il04w5qUhfoFWej4DCzlIkNfJe9l7mIGkUqm09XX08ZIb1cITLQbnxwbmXbhf6bd CcmDXaznlt6LRd7/BS3ypZ76YmHa02w+nVgRburBTw2TJczsKygqrmXtz3XurZmu0fKC kJ7/BIz6QJ1JiMxvAtDfGdGcMtdDCciZPwoG22rT8O89UKSP4LgGt3kmVARr3GVG58fx hoTO1LuCsH8m8R/CR1QsJKmz4nBhSJAiuxZLFAMVjsxWsXmVICPumS4MQpRwUGYXkfJo xY+Q== X-Gm-Message-State: APjAAAX2aOE017Vy/rLnU7bADhv72msvXdkeVmg/8IP1LnyFmK8nJ37q GV197/IJNMU1WKBgZ22x+OGxNvrhYeL0Ew== X-Google-Smtp-Source: APXvYqzl1MkkA4C89bp42Rzz6UlZz/8K8R5A5+jNjhZrXPItPaaVvFQmywl+F1LIRSh1rcVqQi6CzA== X-Received: by 2002:ac2:5c1d:: with SMTP id r29mr18089640lfp.72.1564949849567; Sun, 04 Aug 2019 13:17:29 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.27 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:29 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 10/16] drm/panel: ili9322: move bus_flags to get_modes() Date: Sun, 4 Aug 2019 22:16:31 +0200 Message-Id: <20190804201637.1240-11-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To prepare the driver to receive drm_connector only in the get_modes() callback, move bus_flags handling to ili9322_get_modes(). Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Sam Ravnborg Acked-by: Linus Walleij --- drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 34 +++++++++----------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c index 53dd1e128795..3c58f63adbf7 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c @@ -349,7 +349,6 @@ static const struct regmap_config ili9322_regmap_config = { static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili) { - struct drm_connector *connector = panel->connector; u8 reg; int ret; int i; @@ -407,23 +406,11 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili) * Polarity and inverted color order for RGB input. * None of this applies in the BT.656 mode. */ - if (ili->conf->dclk_active_high) { + reg = 0; + if (ili->conf->dclk_active_high) reg = ILI9322_POL_DCLK; - connector->display_info.bus_flags |= - DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE; - } else { - reg = 0; - connector->display_info.bus_flags |= - DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE; - } - if (ili->conf->de_active_high) { + if (ili->conf->de_active_high) reg |= ILI9322_POL_DE; - connector->display_info.bus_flags |= - DRM_BUS_FLAG_DE_HIGH; - } else { - connector->display_info.bus_flags |= - DRM_BUS_FLAG_DE_LOW; - } if (ili->conf->hsync_active_high) reg |= ILI9322_POL_HSYNC; if (ili->conf->vsync_active_high) @@ -659,9 +646,20 @@ static int ili9322_get_modes(struct drm_panel *panel) struct drm_connector *connector = panel->connector; struct ili9322 *ili = panel_to_ili9322(panel); struct drm_display_mode *mode; + struct drm_display_info *info; + + info = &connector->display_info; + info->width_mm = ili->conf->width_mm; + info->height_mm = ili->conf->height_mm; + if (ili->conf->dclk_active_high) + info->bus_flags |= DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE; + else + info->bus_flags |= DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE; - connector->display_info.width_mm = ili->conf->width_mm; - connector->display_info.height_mm = ili->conf->height_mm; + if (ili->conf->de_active_high) + info->bus_flags |= DRM_BUS_FLAG_DE_HIGH; + else + info->bus_flags |= DRM_BUS_FLAG_DE_LOW; switch (ili->input) { case ILI9322_INPUT_SRGB_DUMMY_320X240: From patchwork Sun Aug 4 20:16:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074909 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 03D071395 for ; Sun, 4 Aug 2019 20:17:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8EC3287E2 for ; Sun, 4 Aug 2019 20:17:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB1DB28827; Sun, 4 Aug 2019 20:17:38 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D054287E2 for ; Sun, 4 Aug 2019 20:17:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726767AbfHDURg (ORCPT ); Sun, 4 Aug 2019 16:17:36 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:42648 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbfHDURg (ORCPT ); Sun, 4 Aug 2019 16:17:36 -0400 Received: by mail-lf1-f67.google.com with SMTP id s19so56360952lfb.9; Sun, 04 Aug 2019 13:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zmDbQLWBPvdGtXiOhDaz/7hniPxt2/VRvQ2x7qHXkvc=; b=s4IADMOVf42u/6pqR78DZ9tNZGLzQlKpBIxSAXOvRnryRasEKiiKhE/sD9hrmH7nBj JFJsiv5xTkl/5pz0rv6qPLrZCwTDZf76EG7w8vGPr1gJbZwrC4zoo9p4n/Hm3IoVNHqI 2bdtyQxrCXrwR0e2w3jKP0lcbaM+wwjULdRjn08W4mHfuSaraJHdkDagW9NDw8nBLypm ZWAI5gRs6Pm/E0kZDsBChhztPTxMo5J4a1bOBoMBQ51NlUnvfNDDB4FaD8s9Z9hCGTVU UBiSl3rDoJ72Lg4KsXLS6c0WqjHuSkzHl1QmJN+QM5bKEMv66d1DVQipSbeY5aPhJzYN Fg5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zmDbQLWBPvdGtXiOhDaz/7hniPxt2/VRvQ2x7qHXkvc=; b=kv/2/uOwwmjml4oM9Bol6gwjBofnDu5X5+3G/l5jC/fVpEW7srcPZDvAWSUcxPvMNK wTw0Ei2Tq0s/CcqcgtMTjh+xoa8yYfNDRfn3k4n0lI160aCMasGDsn77eDptb8uIzxGW K4TwAtC3R6s+D/6lYm+w4LEBzRVTNoh/XfEreKBAYl9kY7XO9F5P5qxaG8RztTBBOlXd JCbkt7dPrYeDSMmm1YoFw3LurTRlMQMoQ485j4rcSrqEiuJpE7cklj4iHqTNO4bIi3r+ 4IwO+T5JbosdAzMsF+1MhG7EfMNF7l8yS2rDUt+6r2Z/vFOT9cBvPONad9UePEby8PlT ZRKQ== X-Gm-Message-State: APjAAAXnDG5w31j5q9BfvEHLmItX1Fdg9NTIcaWxJETRp4AUn5fAz+Jm NUTxn0j3AUoZwVXiMNfy+Vs= X-Google-Smtp-Source: APXvYqwXoeBAY2sI3ofQs6dNYkdTExTgHsLqUwkyioR39Y08/hYP6aps6+rfkCuVvgbQUKdUpdZ9Dw== X-Received: by 2002:a19:8c08:: with SMTP id o8mr68661177lfd.57.1564949852351; Sun, 04 Aug 2019 13:17:32 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.30 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:31 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 11/16] drm/panel: move drm_panel functions to .c file Date: Sun, 4 Aug 2019 22:16:32 +0200 Message-Id: <20190804201637.1240-12-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move inline functions from include/drm/drm_panel.h to drm_panel.c. This is in preparation for follow-up patches that will add extra logic to the functions. As they are no longer static inline, EXPORT them. Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Sam Ravnborg Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Sean Paul Cc: David Airlie Cc: Daniel Vetter Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/drm_panel.c | 96 +++++++++++++++++++++++++++++++++++ include/drm/drm_panel.h | 99 +++---------------------------------- 2 files changed, 104 insertions(+), 91 deletions(-) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index dbd5b873e8f2..9946b8d9bacc 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -54,6 +54,102 @@ void drm_panel_init(struct drm_panel *panel) } EXPORT_SYMBOL(drm_panel_init); +/** + * drm_panel_prepare - power on a panel + * @panel: DRM panel + * + * Calling this function will enable power and deassert any reset signals to + * the panel. After this has completed it is possible to communicate with any + * integrated circuitry via a command bus. + * + * Return: 0 on success or a negative error code on failure. + */ +int drm_panel_prepare(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->prepare) + return panel->funcs->prepare(panel); + + return panel ? -ENOSYS : -EINVAL; +} +EXPORT_SYMBOL(drm_panel_prepare); + +/** + * drm_panel_enable - enable a panel + * @panel: DRM panel + * + * Calling this function will cause the panel display drivers to be turned on + * and the backlight to be enabled. Content will be visible on screen after + * this call completes. + * + * Return: 0 on success or a negative error code on failure. + */ +int drm_panel_enable(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->enable) + return panel->funcs->enable(panel); + + return panel ? -ENOSYS : -EINVAL; +} +EXPORT_SYMBOL(drm_panel_enable); + +/** + * drm_panel_disable - disable a panel + * @panel: DRM panel + * + * This will typically turn off the panel's backlight or disable the display + * drivers. For smart panels it should still be possible to communicate with + * the integrated circuitry via any command bus after this call. + * + * Return: 0 on success or a negative error code on failure. + */ +int drm_panel_disable(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->disable) + return panel->funcs->disable(panel); + + return panel ? -ENOSYS : -EINVAL; +} +EXPORT_SYMBOL(drm_panel_disable); + +/** + * drm_panel_unprepare - power off a panel + * @panel: DRM panel + * + * Calling this function will completely power off a panel (assert the panel's + * reset, turn off power supplies, ...). After this function has completed, it + * is usually no longer possible to communicate with the panel until another + * call to drm_panel_prepare(). + * + * Return: 0 on success or a negative error code on failure. + */ +int drm_panel_unprepare(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->unprepare) + return panel->funcs->unprepare(panel); + + return panel ? -ENOSYS : -EINVAL; +} +EXPORT_SYMBOL(drm_panel_unprepare); + +/** + * drm_panel_get_modes - probe the available display modes of a panel + * @panel: DRM panel + * + * The modes probed from the panel are automatically added to the connector + * that the panel is attached to. + * + * Return: The number of modes available from the panel on success or a + * negative error code on failure. + */ +int drm_panel_get_modes(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->get_modes) + return panel->funcs->get_modes(panel); + + return panel ? -ENOSYS : -EINVAL; +} +EXPORT_SYMBOL(drm_panel_get_modes); + /** * drm_panel_add - add a panel to the global registry * @panel: panel to add diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 26377836141c..053d611656b9 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -97,97 +97,6 @@ struct drm_panel { struct list_head list; }; -/** - * drm_disable_unprepare - power off a panel - * @panel: DRM panel - * - * Calling this function will completely power off a panel (assert the panel's - * reset, turn off power supplies, ...). After this function has completed, it - * is usually no longer possible to communicate with the panel until another - * call to drm_panel_prepare(). - * - * Return: 0 on success or a negative error code on failure. - */ -static inline int drm_panel_unprepare(struct drm_panel *panel) -{ - if (panel && panel->funcs && panel->funcs->unprepare) - return panel->funcs->unprepare(panel); - - return panel ? -ENOSYS : -EINVAL; -} - -/** - * drm_panel_disable - disable a panel - * @panel: DRM panel - * - * This will typically turn off the panel's backlight or disable the display - * drivers. For smart panels it should still be possible to communicate with - * the integrated circuitry via any command bus after this call. - * - * Return: 0 on success or a negative error code on failure. - */ -static inline int drm_panel_disable(struct drm_panel *panel) -{ - if (panel && panel->funcs && panel->funcs->disable) - return panel->funcs->disable(panel); - - return panel ? -ENOSYS : -EINVAL; -} - -/** - * drm_panel_prepare - power on a panel - * @panel: DRM panel - * - * Calling this function will enable power and deassert any reset signals to - * the panel. After this has completed it is possible to communicate with any - * integrated circuitry via a command bus. - * - * Return: 0 on success or a negative error code on failure. - */ -static inline int drm_panel_prepare(struct drm_panel *panel) -{ - if (panel && panel->funcs && panel->funcs->prepare) - return panel->funcs->prepare(panel); - - return panel ? -ENOSYS : -EINVAL; -} - -/** - * drm_panel_enable - enable a panel - * @panel: DRM panel - * - * Calling this function will cause the panel display drivers to be turned on - * and the backlight to be enabled. Content will be visible on screen after - * this call completes. - * - * Return: 0 on success or a negative error code on failure. - */ -static inline int drm_panel_enable(struct drm_panel *panel) -{ - if (panel && panel->funcs && panel->funcs->enable) - return panel->funcs->enable(panel); - - return panel ? -ENOSYS : -EINVAL; -} - -/** - * drm_panel_get_modes - probe the available display modes of a panel - * @panel: DRM panel - * - * The modes probed from the panel are automatically added to the connector - * that the panel is attached to. - * - * Return: The number of modes available from the panel on success or a - * negative error code on failure. - */ -static inline int drm_panel_get_modes(struct drm_panel *panel) -{ - if (panel && panel->funcs && panel->funcs->get_modes) - return panel->funcs->get_modes(panel); - - return panel ? -ENOSYS : -EINVAL; -} - void drm_panel_init(struct drm_panel *panel); int drm_panel_add(struct drm_panel *panel); @@ -196,6 +105,14 @@ void drm_panel_remove(struct drm_panel *panel); int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector); int drm_panel_detach(struct drm_panel *panel); +int drm_panel_prepare(struct drm_panel *panel); +int drm_panel_unprepare(struct drm_panel *panel); + +int drm_panel_enable(struct drm_panel *panel); +int drm_panel_disable(struct drm_panel *panel); + +int drm_panel_get_modes(struct drm_panel *panel); + #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL) struct drm_panel *of_drm_find_panel(const struct device_node *np); #else From patchwork Sun Aug 4 20:16:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074911 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 3708817E5 for ; Sun, 4 Aug 2019 20:17:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 265D9287A0 for ; Sun, 4 Aug 2019 20:17:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 198B328803; Sun, 4 Aug 2019 20:17:39 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D939287A0 for ; Sun, 4 Aug 2019 20:17:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726770AbfHDURi (ORCPT ); Sun, 4 Aug 2019 16:17:38 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:34424 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbfHDURh (ORCPT ); Sun, 4 Aug 2019 16:17:37 -0400 Received: by mail-lj1-f195.google.com with SMTP id p17so77443410ljg.1; Sun, 04 Aug 2019 13:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TFw8aj8TVKqYV1qdWp7H7PSv0EjnAL5XrV9yT7wyYzI=; b=rwd7igj5BUr8/KxH5fDWHXDr9Bb3jwowv9EXwDKoBAF6i6RKSOD2641bxv40d1HHKN 90PRk5+MErpunsqUa+ibcmpfyC1UfMifTvwajUbZ8ZqHuCMYFJKBBAjwFBo2W68OzUai G53Jvo1D5DDJzo+gKXvmakpxb/DH5/PhMw8aEahnixPu/po32d3aI+NDSSadM47kTbM/ lqjP4OcW0y9Bk1NfPNwspN6J3RHQ7WY7F72jJQW2++3tGl6ZnUz3D5o0HtacBnaewCu6 3kXeiK7YR5BoUUssAQyLfTo21VXL0dOrPgDks3dsZ86AAQ5AoD6rN4Cu2hcIz7NKG/Ie NLxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TFw8aj8TVKqYV1qdWp7H7PSv0EjnAL5XrV9yT7wyYzI=; b=SivAnziYJhBT8b6yxv5ceYqWVuF/MFbHFHumLqS2uN2q2qEJYDfVIyHOHOpxr3m0hq +yEDKf9bFfMV6Z+LMM3+C4MgkQoVmMwi+GvVS+LTfVJomcmrfdwende083t9Q0/JnThL DMfzkdlzVJp9FoPft1EkMLAo6t4TWTEpJOOp2Y843OdSZiqH2NzM5wjvyC8x1Xt3czOk fi52f4S7305IFmr1QKLsoo0r725GkajMiWGp//+1dHv35qpMlxwgDaYTjS3/CL9wW0If j5Zv9fvG9Ltiwkii7dfXxzRqAJU5smaKHdk4op7G6F0qzj/tTuD2wfHSXooiLlUidwFJ 9h7w== X-Gm-Message-State: APjAAAUfael3Pi68OSl3vsj+XMPltU3QIgAHVnzkoG6l1VP2gRgg6njG OwSmgpaQHOfACPNpHaOLfxU= X-Google-Smtp-Source: APXvYqyoAufw1JJb+gisc/+GrH+nZNn6Oe74hLjpr94kfXr5VFnqYqHplX0Q3NQsQ1CxOz1UwLnarA== X-Received: by 2002:a2e:b0ea:: with SMTP id h10mr31006790ljl.50.1564949855034; Sun, 04 Aug 2019 13:17:35 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:34 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 12/16] drm/panel: use inline comments in drm_panel.h Date: Sun, 4 Aug 2019 22:16:33 +0200 Message-Id: <20190804201637.1240-13-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Inline comments provide better space for additional comments. Comments was slightly edited to follow the normal style, but no change to actual content. Used the opportuniy to change the order in drm_panel_funcs to follow the order they will be used by a panel. Signed-off-by: Sam Ravnborg Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Sean Paul Cc: Thierry Reding Cc: Sam Ravnborg Cc: David Airlie Cc: Daniel Vetter Reviewed-by: Laurent Pinchart --- include/drm/drm_panel.h | 82 +++++++++++++++++++++++++++++++++-------- 1 file changed, 66 insertions(+), 16 deletions(-) diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 053d611656b9..5e62deea49ba 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -36,14 +36,6 @@ struct display_timing; /** * struct drm_panel_funcs - perform operations on a given panel - * @disable: disable panel (turn off back light, etc.) - * @unprepare: turn off panel - * @prepare: turn on panel and perform set up - * @enable: enable panel (turn on back light, etc.) - * @get_modes: add modes to the connector that the panel is attached to and - * return the number of modes added - * @get_timings: copy display timings into the provided array and return - * the number of display timings available * * The .prepare() function is typically called before the display controller * starts to transmit video data. Panel drivers can use this to turn the panel @@ -69,31 +61,89 @@ struct display_timing; * the panel. This is the job of the .unprepare() function. */ struct drm_panel_funcs { - int (*disable)(struct drm_panel *panel); - int (*unprepare)(struct drm_panel *panel); + /** + * @prepare: + * + * Turn on panel and perform set up. + */ int (*prepare)(struct drm_panel *panel); + + /** + * @enable: + * + * Enable panel (turn on back light, etc.). + */ int (*enable)(struct drm_panel *panel); + + /** + * @disable: + * + * Disable panel (turn off back light, etc.). + */ + int (*disable)(struct drm_panel *panel); + + /** + * @unprepare: + * + * Turn off panel. + */ + int (*unprepare)(struct drm_panel *panel); + + /** + * @get_modes: + * + * Add modes to the connector that the panel is attached to and + * return the number of modes added. + */ int (*get_modes)(struct drm_panel *panel); + + /** + * @get_timings: + * + * Copy display timings into the provided array and return + * the number of display timings available. + */ int (*get_timings)(struct drm_panel *panel, unsigned int num_timings, struct display_timing *timings); }; /** * struct drm_panel - DRM panel object - * @drm: DRM device owning the panel - * @connector: DRM connector that the panel is attached to - * @dev: parent device of the panel - * @link: link from panel device (supplier) to DRM device (consumer) - * @funcs: operations that can be performed on the panel - * @list: panel entry in registry */ struct drm_panel { + /** + * @drm: + * + * DRM device owning the panel. + */ struct drm_device *drm; + + /** + * @connector: + * + * DRM connector that the panel is attached to. + */ struct drm_connector *connector; + + /** + * @dev: + * + * Parent device of the panel. + */ struct device *dev; + /** + * @funcs: + * + * Operations that can be performed on the panel. + */ const struct drm_panel_funcs *funcs; + /** + * @list: + * + * Panel entry in registry. + */ struct list_head list; }; From patchwork Sun Aug 4 20:16:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074915 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 79D511395 for ; Sun, 4 Aug 2019 20:17:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A74C287A0 for ; Sun, 4 Aug 2019 20:17:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DD1528803; Sun, 4 Aug 2019 20:17: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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D06EE287A0 for ; Sun, 4 Aug 2019 20:17:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726774AbfHDURk (ORCPT ); Sun, 4 Aug 2019 16:17:40 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:41004 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbfHDURk (ORCPT ); Sun, 4 Aug 2019 16:17:40 -0400 Received: by mail-lj1-f195.google.com with SMTP id d24so77414415ljg.8; Sun, 04 Aug 2019 13:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6MTU39yk5XE3/teu/iygu6ssiL/liUAav6Pm3DHBCYk=; b=ZA+/n3H1+MtW9kTQsOeyUTYBdS4nVqs91zmpewRJFA3g7GvGQHLzWjAjOA2KjxXx06 We5wixz1fYGGRfl4QVFNMFUlpsCTWlYYKqEvsenMNEn+umCLTk9CVcDwep5AWL3nMklw BE0U06HBU0suEpm4nBPoJDfJhOJ3w9QwKz6jigew0xkksRe9L00eDSnEM71EoDfCTUPg 7nrulAhNbAbTHY+edA4Z3Svw2nUDmxkVdABuSiEuGp6HMhZXFqmRCr1nFitHbmU1UlYG Zy65eNXTqN6bZkutzJV1YvC+78T9mG4fIKkroPYupOV3oH41jdymZWNkxjqAGh2S3boz c+IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=6MTU39yk5XE3/teu/iygu6ssiL/liUAav6Pm3DHBCYk=; b=j049xFF6c9P4JAGfPjBKwj1leOmWZSXFrR9/zJ8MpVzzNZjL8bDBSJcMkMAVG9AdhA 0qHd577Mf8CbUIDsdwrYTKH4rQ+DOgHlhpNb9ogV14Ne+XHxXuUhFADTwCvAEaLdRKMq 4iaWb+Jf/soRB3GTLoyP1Ay7GEhC230C8QOLR34FjhLjZdb/S9CoJEp/ulq2jN+C4Jen GKojuMD7D6HJOlcMp0mAxwDyGIUqcfCczIsnAXS7fu+n1hWBfcZGQke0M57eiPQ6xG1K MEU5BsSwOS2dZyJ8vt0i3JAHHm22q/UZSyuNGBA8nNa5N9BNNwnznCbuKcLx/TZnoI+H Gl/w== X-Gm-Message-State: APjAAAWasMQmbDXIQk718LP+1I5rKt2Cp/8dNW2pB6sCJjBUkAOl16QE xc0JQtOPvyaoXD/Yv6GaKqI= X-Google-Smtp-Source: APXvYqx8atks2YbWr9RifkxwlrpCrnQ0MuWxB3GhHudkPh8VHtkqm1B+XsEC8X6Ec2DIcd1SBSKPlQ== X-Received: by 2002:a2e:9a58:: with SMTP id k24mr76690634ljj.165.1564949857549; Sun, 04 Aug 2019 13:17:37 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.35 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:37 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 13/16] drm/panel: drop return code from drm_panel_detach() Date: Sun, 4 Aug 2019 22:16:34 +0200 Message-Id: <20190804201637.1240-14-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are no errors that can be reported by this function, so drop the return code. Fix the only bridge driver that checked the return result. Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Sam Ravnborg Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Sean Paul Cc: David Airlie Cc: Daniel Vetter Cc: Laurent Pinchart Cc: Andrzej Hajda Cc: Gwan-gyeong Mun Cc: Thomas Gleixner Cc: Linus Walleij Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 3 +-- drivers/gpu/drm/drm_panel.c | 6 +----- include/drm/drm_panel.h | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index f2f7f69d6cc3..22885dceaa17 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1780,8 +1780,7 @@ void analogix_dp_unbind(struct analogix_dp_device *dp) if (dp->plat_data->panel) { if (drm_panel_unprepare(dp->plat_data->panel)) DRM_ERROR("failed to turnoff the panel\n"); - if (drm_panel_detach(dp->plat_data->panel)) - DRM_ERROR("failed to detach the panel\n"); + drm_panel_detach(dp->plat_data->panel); } drm_dp_aux_unregister(&dp->aux); diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index 9946b8d9bacc..da19d5b4a2f4 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -219,15 +219,11 @@ EXPORT_SYMBOL(drm_panel_attach); * * This function should not be called by the panel device itself. It * is only for the drm device that called drm_panel_attach(). - * - * Return: 0 on success or a negative error code on failure. */ -int drm_panel_detach(struct drm_panel *panel) +void drm_panel_detach(struct drm_panel *panel) { panel->connector = NULL; panel->drm = NULL; - - return 0; } EXPORT_SYMBOL(drm_panel_detach); diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 5e62deea49ba..624bd15ecfab 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -153,7 +153,7 @@ int drm_panel_add(struct drm_panel *panel); void drm_panel_remove(struct drm_panel *panel); int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector); -int drm_panel_detach(struct drm_panel *panel); +void drm_panel_detach(struct drm_panel *panel); int drm_panel_prepare(struct drm_panel *panel); int drm_panel_unprepare(struct drm_panel *panel); From patchwork Sun Aug 4 20:16:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074919 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 0F06D14E5 for ; Sun, 4 Aug 2019 20:17:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F37B3287A0 for ; Sun, 4 Aug 2019 20:17:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E637528803; Sun, 4 Aug 2019 20:17:43 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CC32287A0 for ; Sun, 4 Aug 2019 20:17:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726779AbfHDURn (ORCPT ); Sun, 4 Aug 2019 16:17:43 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:43227 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbfHDURm (ORCPT ); Sun, 4 Aug 2019 16:17:42 -0400 Received: by mail-lj1-f196.google.com with SMTP id y17so52880882ljk.10; Sun, 04 Aug 2019 13:17:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hrCo/4/IXJ1Yj7iZxjXNzvDGpEFw4E2sYzii2ko4Lpc=; b=H21lvLH6tpUmdeSL+ZX13j4skteYo8F27F85lXg12JKWPkHdL9eQI/B0aLzSqteuZF JyDo1GkMya2KG2lCA+5ozRHKZoM8bI0aMUsUg5BtlHAYP91P4BmM0zzLa4mWzMlSnA7I qyT/LzC1eJL/P11buVSMfZh7ZhWipjYNxIRhgMf4ylvnGbNNefyfl7yHxVBGN2ZHpQ22 gUEEURWNc9F1uLD9qoAxlTK9z2PhqI2SkEfqyfuaRea3WQ1BR88k6Hn6mhvY6MQmx/oD Xi16syJcz/Ah5wLJDfB/ZZj2FJP5FKD8/fQopj0w00bxP4/2GIq+x6Nwr2fkLDpTy4ym dl6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=hrCo/4/IXJ1Yj7iZxjXNzvDGpEFw4E2sYzii2ko4Lpc=; b=Xw3ifewX3pEwXtplEt07ZbUDgOZCrZoHvoH36RBmtn0aJYJaLLJ4LNKRS7pbDn3yll N3pDoDjZpHumOv24Zo/lIDq+jGsbscRF3n6k27HFlUg5jJBNyLbT5u6LmiutNpWR41pW eE14aIMv7JOE6NFNbRd1sdtU/dQUs9rMgn8QHy9bj7D/qtWYFH7ErJPzyT1ean0qetXS 9UfDmFmav7yU3pAvtGISImEj1wVbd9lGjJvXgYehQ4gpTjiFW/zoC+2ZzawvcyIwx5f8 BWmH8WmV35l8/I175GnzgQitKcOqDlLLTAiAkluDsbpOT9xqXAzdaedr6ACZXgiTdT8G RW+A== X-Gm-Message-State: APjAAAVdI8f2NqZv+yvA6JJ52BjzkRqYOFJIsFcktY042IGgpClLXmN/ 0hTz2IKycJfcd8gekO0hZmE= X-Google-Smtp-Source: APXvYqyTjMcUeH7cKtM9ez8brS0M2L7PogMF1Pn26x5fiPtQY2s/TzFZyoXXnejWHprywDHCWV88IA== X-Received: by 2002:a2e:9213:: with SMTP id k19mr73854900ljg.237.1564949860364; Sun, 04 Aug 2019 13:17:40 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.38 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:39 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 14/16] drm/panel: call prepare/enable only once Date: Sun, 4 Aug 2019 22:16:35 +0200 Message-Id: <20190804201637.1240-15-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Many panel drivers duplicate logic to prevent prepare to be called for a panel that is already prepared. Likewise for enable. Implement this logic in drm_panel so the individual drivers no longer needs this. A panel is considered prepared/enabled only if the prepare/enable call succeeds. For disable/unprepare it is unconditionally considered disabled/unprepared. This allows calls to prepare/enable again, even if there were some issue disabling a regulator or similar during disable/unprepare. Signed-off-by: Sam Ravnborg Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Sean Paul Cc: Thierry Reding Cc: Sam Ravnborg Cc: David Airlie Cc: Daniel Vetter Acked-by: Laurent Pinchart --- drivers/gpu/drm/drm_panel.c | 66 ++++++++++++++++++++++++++++++------- include/drm/drm_panel.h | 21 ++++++++++++ 2 files changed, 75 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index da19d5b4a2f4..0853764040de 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -66,10 +66,21 @@ EXPORT_SYMBOL(drm_panel_init); */ int drm_panel_prepare(struct drm_panel *panel) { - if (panel && panel->funcs && panel->funcs->prepare) - return panel->funcs->prepare(panel); + int ret = -ENOSYS; - return panel ? -ENOSYS : -EINVAL; + if (!panel) + return -EINVAL; + + if (panel->prepared) + return 0; + + if (panel->funcs && panel->funcs->prepare) + ret = panel->funcs->prepare(panel); + + if (ret >= 0) + panel->prepared = true; + + return ret; } EXPORT_SYMBOL(drm_panel_prepare); @@ -85,10 +96,21 @@ EXPORT_SYMBOL(drm_panel_prepare); */ int drm_panel_enable(struct drm_panel *panel) { - if (panel && panel->funcs && panel->funcs->enable) - return panel->funcs->enable(panel); + int ret = -ENOSYS; - return panel ? -ENOSYS : -EINVAL; + if (!panel) + return -EINVAL; + + if (panel->enabled) + return 0; + + if (panel->funcs && panel->funcs->enable) + ret = panel->funcs->enable(panel); + + if (ret >= 0) + panel->enabled = true; + + return ret; } EXPORT_SYMBOL(drm_panel_enable); @@ -104,10 +126,20 @@ EXPORT_SYMBOL(drm_panel_enable); */ int drm_panel_disable(struct drm_panel *panel) { - if (panel && panel->funcs && panel->funcs->disable) - return panel->funcs->disable(panel); + int ret = -ENOSYS; - return panel ? -ENOSYS : -EINVAL; + if (!panel) + return -EINVAL; + + if (!panel->enabled) + return 0; + + if (panel->funcs && panel->funcs->disable) + ret = panel->funcs->disable(panel); + + panel->enabled = false; + + return ret; } EXPORT_SYMBOL(drm_panel_disable); @@ -124,10 +156,20 @@ EXPORT_SYMBOL(drm_panel_disable); */ int drm_panel_unprepare(struct drm_panel *panel) { - if (panel && panel->funcs && panel->funcs->unprepare) - return panel->funcs->unprepare(panel); + int ret = -ENOSYS; - return panel ? -ENOSYS : -EINVAL; + if (!panel) + return -EINVAL; + + if (!panel->prepared) + return 0; + + if (panel->funcs && panel->funcs->unprepare) + ret = panel->funcs->unprepare(panel); + + panel->prepared = false; + + return ret; } EXPORT_SYMBOL(drm_panel_unprepare); diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 624bd15ecfab..7493500fc9bd 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -65,6 +65,9 @@ struct drm_panel_funcs { * @prepare: * * Turn on panel and perform set up. + * When the panel is successfully prepared the prepare() function + * will not be called again until the panel has been unprepared. + * */ int (*prepare)(struct drm_panel *panel); @@ -72,6 +75,8 @@ struct drm_panel_funcs { * @enable: * * Enable panel (turn on back light, etc.). + * When the panel is successfully enabled the enable() function + * will not be called again until the panel has been disabled. */ int (*enable)(struct drm_panel *panel); @@ -79,6 +84,7 @@ struct drm_panel_funcs { * @disable: * * Disable panel (turn off back light, etc.). + * If the panel is already disabled the disable() function is not called. */ int (*disable)(struct drm_panel *panel); @@ -86,6 +92,7 @@ struct drm_panel_funcs { * @unprepare: * * Turn off panel. + * If the panel is already unprepared the unprepare() function is not called. */ int (*unprepare)(struct drm_panel *panel); @@ -145,6 +152,20 @@ struct drm_panel { * Panel entry in registry. */ struct list_head list; + + /** + * @prepared: + * + * Set to true when the panel is successfully prepared. + */ + bool prepared; + + /** + * @enabled: + * + * Set to true when the panel is successfully enabled. + */ + bool enabled; }; void drm_panel_init(struct drm_panel *panel); From patchwork Sun Aug 4 20:16:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074923 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 2AFB51395 for ; Sun, 4 Aug 2019 20:17:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BCA2287E2 for ; Sun, 4 Aug 2019 20:17:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FB632882A; Sun, 4 Aug 2019 20:17:47 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71D53287E2 for ; Sun, 4 Aug 2019 20:17:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726781AbfHDURq (ORCPT ); Sun, 4 Aug 2019 16:17:46 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:33024 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbfHDURq (ORCPT ); Sun, 4 Aug 2019 16:17:46 -0400 Received: by mail-lf1-f66.google.com with SMTP id x3so56460025lfc.0; Sun, 04 Aug 2019 13:17:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aobqP46odx3tunBAtyyrec00lPA6Ep/KC6NYpNeo17U=; b=SFyUwEVzQiN+6Jh9U4W+Ou+eODKjyMW+KpMuYRXjME46CmaH8aJsl/dRMIn9p2zWZO G8C9gUmunvvNAfQnltvpwvvr6SZKIBTXon/9pdHoYF2OEAzg4X0T7udsIbCPJZOJcMaK bF7VAH94hYH9HecpdWX9NjSM2fOUXMY4DPHYOXKH4dCA1oQVpxwV9gghaBGzSrUJGnCf gnWSfFzy8l0vUQExN4iXCesBUcBGkrx41lBJ9v6i6fEVRhrOLfUtHJOvNoWinLnBY6Yd cJ8A0XDKQ6zvW2868e4DsxOCHxTkdTI4F7DukDhV0NOo+sRz6pV/i5BymdeavxXTvWwJ XOag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=aobqP46odx3tunBAtyyrec00lPA6Ep/KC6NYpNeo17U=; b=a7aM14LeH9YEAA602efTyPr3IsbCMz0P2vLgP3qsDS84BrttSl3boynELeOJgPlFv2 N8JUQqf5Kal6eCblvxualxLO6ZXkE1TTNowN10p12mHFwvUp6bhDrOsYf+Nku7XjCyD6 d7D7sJdPbD0bR0UrqNy/Pp3+npQGo24X59+byHbdJ2aaohkBWd4FpU5i3X5JhauPj7rI zTBHAlRQMW8O+bVDYXM92BSzcoRD0FyCyizDRFFiQv9MT49p2FOxxwDLaNpOjHZB9ZG1 +djx6LsdH5hbEBhITj7TFp6PpJriD3lOOvBJqsIlv47wlwkg/dBd91VPp5saV7K9P5ms L5vA== X-Gm-Message-State: APjAAAVgs0wSmpoQpxOFttPhZ8ZKbHWc9v5HglRR/rojSM5QXoOwL2dr ixVN8P0X3+9JWh7e5vUFwvs= X-Google-Smtp-Source: APXvYqzTqaOH/E4yWYEObO2R5wACA7U9nuaIZddLKnxycMIdLIM6Ra7WWa7AU5/RHuBYEwNpuEELQA== X-Received: by 2002:ac2:4289:: with SMTP id m9mr5299981lfh.49.1564949863271; Sun, 04 Aug 2019 13:17:43 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:42 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 15/16] drm/panel: add backlight support Date: Sun, 4 Aug 2019 22:16:36 +0200 Message-Id: <20190804201637.1240-16-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Panels often supports backlight as specified in a device tree. Update the drm_panel infrastructure to support this to simplify the drivers. With this the panel driver just needs to add the following to the probe() function: err = drm_panel_of_backlight(panel); if (err) return err; Then drm_panel will handle all the rest. Signed-off-by: Sam Ravnborg Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Sean Paul Cc: Thierry Reding Cc: Sam Ravnborg Cc: David Airlie Cc: Daniel Vetter --- drivers/gpu/drm/drm_panel.c | 41 +++++++++++++++++++++++++++++++++++++ include/drm/drm_panel.h | 23 +++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index 0853764040de..d8139674b883 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -21,6 +21,7 @@ * DEALINGS IN THE SOFTWARE. */ +#include #include #include @@ -110,6 +111,7 @@ int drm_panel_enable(struct drm_panel *panel) if (ret >= 0) panel->enabled = true; + backlight_enable(panel->backlight); return ret; } EXPORT_SYMBOL(drm_panel_enable); @@ -134,6 +136,8 @@ int drm_panel_disable(struct drm_panel *panel) if (!panel->enabled) return 0; + backlight_disable(panel->backlight); + if (panel->funcs && panel->funcs->disable) ret = panel->funcs->disable(panel); @@ -308,6 +312,43 @@ struct drm_panel *of_drm_find_panel(const struct device_node *np) EXPORT_SYMBOL(of_drm_find_panel); #endif +#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE +/** + * drm_panel_of_backlight - use backlight device node for backlight + * @panel: DRM panel + * + * Use this function to enable backlight handling if your panel + * uses device tree and has a backlight handle. + * + * When panel is enabled backlight will be enabled after a + * successfull call to &drm_panel_funcs.enable() + * + * When panel is disabled backlight will be disabled before the + * call to &drm_panel_funcs.disable(). + * + * A typical implementation for a panel driver supporting device tree + * will call this function and then backlight just works. + * + * Return: 0 on success or a negative error code on failure. + */ +int drm_panel_of_backlight(struct drm_panel *panel) +{ + struct backlight_device *backlight; + + if (!panel || !panel->dev) + return -EINVAL; + + backlight = devm_of_find_backlight(panel->dev); + + if (IS_ERR(backlight)) + return PTR_ERR(backlight); + + panel->backlight = backlight; + return 0; +} +EXPORT_SYMBOL(drm_panel_of_backlight); +#endif + MODULE_AUTHOR("Thierry Reding "); MODULE_DESCRIPTION("DRM panel infrastructure"); MODULE_LICENSE("GPL and additional rights"); diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 7493500fc9bd..31349c2393b7 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -28,6 +28,7 @@ #include #include +struct backlight_device; struct device_node; struct drm_connector; struct drm_device; @@ -59,6 +60,10 @@ struct display_timing; * * To save power when no video data is transmitted, a driver can power down * the panel. This is the job of the .unprepare() function. + * + * Backlight can be handled automatically if configured using + * drm_panel_of_backlight(). Then the driver do not need to implement the + * functionality to enable/disable backlight. */ struct drm_panel_funcs { /** @@ -139,6 +144,15 @@ struct drm_panel { */ struct device *dev; + /** + * @backlight: + * + * Backlight device, used to turn on backlight after + * the call to enable(), and to turn off + * backlight before call to disable(). + */ + struct backlight_device *backlight; + /** * @funcs: * @@ -193,4 +207,13 @@ static inline struct drm_panel *of_drm_find_panel(const struct device_node *np) } #endif +#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) && defined(CONFIG_DRM_PANEL) +int drm_panel_of_backlight(struct drm_panel *panel); +#else +static inline int drm_panel_of_backlight(struct drm_panel *panel) +{ + return -EINVAL; +} +#endif + #endif From patchwork Sun Aug 4 20:16:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11074927 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 440B3746 for ; Sun, 4 Aug 2019 20:17:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3635B287A0 for ; Sun, 4 Aug 2019 20:17:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2973C28827; Sun, 4 Aug 2019 20:17: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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D8EC287A0 for ; Sun, 4 Aug 2019 20:17:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726656AbfHDURt (ORCPT ); Sun, 4 Aug 2019 16:17:49 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44597 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbfHDURt (ORCPT ); Sun, 4 Aug 2019 16:17:49 -0400 Received: by mail-lj1-f193.google.com with SMTP id k18so77400066ljc.11; Sun, 04 Aug 2019 13:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=58L2c6AoPRdtw97mukFPxD0pdo2vv2X7JQRJbq8/vUE=; b=iWaSTn6msFtanMS3ltawVoyI/akm3SIk334RyboYedy/nyCR1hjYvRVV5qxkjjz0/H HqXXvHotINKZ0MV5HIpyWLnyZtxGL/1hGgmFIEEI7UdhvUfg75bpnhgOJWt5N8zKgrdm iOXfl/+wIB5SpvjXO1jqzazjXb4JocnXkPI+PCSJkpOFvrS+MIjtXrKGdq9eXuHzZGgb +cj5IV6oh60Itbyl7Tn5K5BhmHxd4/gcjJnW0V2KehXKtOWe4oIYhKGzrUlEdTmqAkt/ 88lPYDyYgqhmfZxkZeRgCPjyUrPVFHA+tyGQMdVbBGoApF+gML1pHYItNM5NHOyvti76 MsBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=58L2c6AoPRdtw97mukFPxD0pdo2vv2X7JQRJbq8/vUE=; b=XkL1oyTDVR6Z5oXGE04FMqYI0KXKoXVhToQKmem8qvWIqWQQXOUleqtx+Pz0m3KZk5 waVIsA7vN7f996l0FgB6s/JGfp1Z80BVmNlQC9NaBDz3bLajLhjcPVPeVvVxaW5S177S hBftMWnpcsGAh4PSTkVYfH+HNHHiLeNQCMR1eZSjcosgKGNiU5F7uo3hiQGSAo6IB3QV 0mvv6GjZEP81S1mat1oPLMBqFIIolHBNOzzjl0Xb0prFZc+97NlxK4kOlGImi9+LML4t uf+9BlmBgLKzTFqafjRurUGZWu4qnNjSmRu32F5ZIf3NxXqqbf6YuMFR4NpeKNxMcUlp XnOA== X-Gm-Message-State: APjAAAWgJN/jckTlWyaV0HCMCX5pmPQznuCKtnxd3piVS6ArL6Y/Vgiq 5tZSPTQtTW7pzC9QINholJ4= X-Google-Smtp-Source: APXvYqwd3qng5VMg9Mb2Vmyn/6Orka9Dj+RSr/HOVzJm2eC00ZYEFloJNhEpBCBt7pNnr0htBnzZ8A== X-Received: by 2002:a2e:834e:: with SMTP id l14mr30558098ljh.158.1564949866148; Sun, 04 Aug 2019 13:17:46 -0700 (PDT) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id p87sm16540794ljp.50.2019.08.04.13.17.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 13:17:45 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding Cc: Alexios Zavras , Alison Wang , Allison Randal , Andrzej Hajda , Benjamin Gaignard , Daniel Vetter , David Airlie , Enrico Weigelt , Fabio Estevam , Gwan-gyeong Mun , Inki Dae , Jernej Skrabec , Jonas Karlman , Jonathan Hunter , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Laurent Pinchart , Laurent Pinchart , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Marek Vasut , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sam Ravnborg , Sascha Hauer , Sean Paul , Seung-Woo Kim , Shawn Guo , Stefan Agner , Thomas Gleixner , Vincent Abriou Subject: [PATCH v1 16/16] drm/panel: simple: use drm_panel infrastructure Date: Sun, 4 Aug 2019 22:16:37 +0200 Message-Id: <20190804201637.1240-17-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org> References: <20190804201637.1240-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use drm_panel infrastrucute: - drm_panel has guards for calling disable/enable twice - drm_panel has backlight support To use the drm_panel infrastructure use the drm_panel_* variants for prepare/enable/disable/unprepare. Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Sam Ravnborg Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/panel/panel-simple.c | 73 +++++----------------------- 1 file changed, 11 insertions(+), 62 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index bff7578f84dd..c7eed34f2c9c 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -21,7 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -#include #include #include #include @@ -98,13 +97,10 @@ struct panel_desc { struct panel_simple { struct drm_panel base; - bool prepared; - bool enabled; bool no_hpd; const struct panel_desc *desc; - struct backlight_device *backlight; struct regulator *supply; struct i2c_adapter *ddc; @@ -232,20 +228,9 @@ static int panel_simple_disable(struct drm_panel *panel) { struct panel_simple *p = to_panel_simple(panel); - if (!p->enabled) - return 0; - - if (p->backlight) { - p->backlight->props.power = FB_BLANK_POWERDOWN; - p->backlight->props.state |= BL_CORE_FBBLANK; - backlight_update_status(p->backlight); - } - if (p->desc->delay.disable) msleep(p->desc->delay.disable); - p->enabled = false; - return 0; } @@ -253,9 +238,6 @@ static int panel_simple_unprepare(struct drm_panel *panel) { struct panel_simple *p = to_panel_simple(panel); - if (!p->prepared) - return 0; - gpiod_set_value_cansleep(p->enable_gpio, 0); regulator_disable(p->supply); @@ -263,8 +245,6 @@ static int panel_simple_unprepare(struct drm_panel *panel) if (p->desc->delay.unprepare) msleep(p->desc->delay.unprepare); - p->prepared = false; - return 0; } @@ -274,9 +254,6 @@ static int panel_simple_prepare(struct drm_panel *panel) unsigned int delay; int err; - if (p->prepared) - return 0; - err = regulator_enable(p->supply); if (err < 0) { dev_err(panel->dev, "failed to enable supply: %d\n", err); @@ -291,8 +268,6 @@ static int panel_simple_prepare(struct drm_panel *panel) if (delay) msleep(delay); - p->prepared = true; - return 0; } @@ -300,20 +275,9 @@ static int panel_simple_enable(struct drm_panel *panel) { struct panel_simple *p = to_panel_simple(panel); - if (p->enabled) - return 0; - if (p->desc->delay.enable) msleep(p->desc->delay.enable); - if (p->backlight) { - p->backlight->props.state &= ~BL_CORE_FBBLANK; - p->backlight->props.power = FB_BLANK_UNBLANK; - backlight_update_status(p->backlight); - } - - p->enabled = true; - return 0; } @@ -413,7 +377,7 @@ static void panel_simple_parse_panel_timing_node(struct device *dev, static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) { - struct device_node *backlight, *ddc; + struct device_node *ddc; struct panel_simple *panel; struct display_timing dt; int err; @@ -422,8 +386,6 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) if (!panel) return -ENOMEM; - panel->enabled = false; - panel->prepared = false; panel->desc = desc; panel->no_hpd = of_property_read_bool(dev->of_node, "no-hpd"); @@ -441,24 +403,13 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) return err; } - backlight = of_parse_phandle(dev->of_node, "backlight", 0); - if (backlight) { - panel->backlight = of_find_backlight_by_node(backlight); - of_node_put(backlight); - - if (!panel->backlight) - return -EPROBE_DEFER; - } - ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0); if (ddc) { panel->ddc = of_find_i2c_adapter_by_node(ddc); of_node_put(ddc); - if (!panel->ddc) { - err = -EPROBE_DEFER; - goto free_backlight; - } + if (!panel->ddc) + return -EPROBE_DEFER; } if (!of_get_display_timing(dev->of_node, "panel-timing", &dt)) @@ -468,6 +419,10 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) panel->base.dev = dev; panel->base.funcs = &panel_simple_funcs; + err = drm_panel_of_backlight(&panel->base); + if (err) + goto free_ddc; + err = drm_panel_add(&panel->base); if (err < 0) goto free_ddc; @@ -479,9 +434,6 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) free_ddc: if (panel->ddc) put_device(&panel->ddc->dev); -free_backlight: - if (panel->backlight) - put_device(&panel->backlight->dev); return err; } @@ -492,15 +444,12 @@ static int panel_simple_remove(struct device *dev) drm_panel_remove(&panel->base); - panel_simple_disable(&panel->base); - panel_simple_unprepare(&panel->base); + drm_panel_disable(&panel->base); + drm_panel_unprepare(&panel->base); if (panel->ddc) put_device(&panel->ddc->dev); - if (panel->backlight) - put_device(&panel->backlight->dev); - return 0; } @@ -508,8 +457,8 @@ static void panel_simple_shutdown(struct device *dev) { struct panel_simple *panel = dev_get_drvdata(dev); - panel_simple_disable(&panel->base); - panel_simple_unprepare(&panel->base); + drm_panel_disable(&panel->base); + drm_panel_unprepare(&panel->base); } static const struct drm_display_mode ampire_am_480272h3tmqw_t01h_mode = {