From patchwork Mon Dec 2 19:32:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269689 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DFCDF109A for ; Mon, 2 Dec 2019 19:34:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B210A20661 for ; Mon, 2 Dec 2019 19:34:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fZu+I0MX"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="h7uMpYQX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B210A20661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=co44Y/QDLUWiWCCmMN70ldczC7VA8nGOvy7qE4iretk=; b=fZu+I0MXngR8lq pMir9D8N3h3KbJ4HIPAwkakD5t8qjIFu+Y7SMhAaCX3x7awTU41u1jhLNes4O5ozoZirzrd2U9zXM QjRU2CgC2aeTjkvAFGTRjRHeBJ2KdYR2Npykn1tZ1GTThI4POfHORxAMwn0Asr26Bj+URwC4+YnO4 KGNgZfo+B2fk2C/YCNIdNmQiSCCKOwFRVGG5BYcwWT+Vqfb5D5kRsZ/0jpJkOILVbTTo902C7mr0D BfRICadtUGg3bKcP4niW5AHLejApnZBYQ4B3r1pMFhhDnqp5SNKpl+s6oRpsJK1FJwXC3cZ0LZ9gJ SNJiknwC3O6/h9ZyxlKQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrSX-0008HQ-UM; Mon, 02 Dec 2019 19:34:13 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRT-0007JM-7l; Mon, 02 Dec 2019 19:33:09 +0000 Received: by mail-lj1-x242.google.com with SMTP id e10so829215ljj.6; Mon, 02 Dec 2019 11:33:07 -0800 (PST) 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=LGOgtva2q0s1MxBZFBlNQnZLc92S/tb/mTErWAKqBVc=; b=h7uMpYQXU8nqH68TzydRnhCOy45ksFGq28L6tPaxa9aEiPfo5jSOpVakkWN+0K9IK7 1qclRlZSneydfgb76u5Ne20nNLk1wsQj7Cj3Z64NUtI+I5OintjAleMXZo4ugNCWp8cR TIJ2NPk5BEhgyBCMlG9HktzmqwwZDSKf95YjiSNXJqGur69kbxDYG6cpihUCHnCAnA9c FwdPExbDCZ0VRivGRZ3sHk6QYNEYi4Xtmw7nn9Oqqkg5edr6javNtcxYL2hagI7YMyrp K4DxbC0F1zZ4WICEWZPbLWQ4xrh18gufaVK0s5f6vAXNDlFps/DBo/4ma1VXmzNRXKkX YoYw== 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=LGOgtva2q0s1MxBZFBlNQnZLc92S/tb/mTErWAKqBVc=; b=nNyT46MtBnmZAk0yw5hfxCCDObLfBfBMnG4uxun0f/Bxc266uU0l7azeytn1MntNsT H7rZVo6q0VxDP0o/jy7a2V7FtEXf3trbm90lxyr+Pg3iSzFCQGgzrsRY4yChQkMksdvR XwM5a96AiaftEk8BD8NF97pyY2f9niFJrAm/KlXVkLSEWo61tVnEuc8bQSfM7gpxU8f+ ZGcHFwhoZHkC/1Ixu8mHek/C2yYlASVI58uZ36x9lL+jWZjH2ZdX8/zB39pni+YvEfaS MyQ0gdxcF3xD3vXNNDYI7Ary0ITz7X2vaIPDzHKguouNSnr8wWRDCxeWZG2/JVYLfauZ oKEQ== X-Gm-Message-State: APjAAAUhAdYcEkPgL7fDSIaILxEYwvCwIZWB6GQotp/j6NUpB6M8+G+S DLZT7lvOv3eXB7VhWwTiTy0= X-Google-Smtp-Source: APXvYqxqWDVM+ppo9LUJvIL0zSPxHW/xwhiU6h6G2FvCLak5I1Hn77t5p5FArs7DmDjbO05gcgebKA== X-Received: by 2002:a2e:9ac4:: with SMTP id p4mr219541ljj.207.1575315185572; Mon, 02 Dec 2019 11:33:05 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:04 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 01/26] drm/drm_panel: no error when no callback Date: Mon, 2 Dec 2019 20:32:05 +0100 Message-Id: <20191202193230.21310-2-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113307_485762_499ADD05 X-CRM114-Status: UNSURE ( 9.86 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org The callbacks in drm_panel_funcs are optional, so do not return an error just because no callback is assigned. Signed-off-by: Sam Ravnborg Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thierry Reding Cc: Sam Ravnborg Cc: David Airlie Cc: Daniel Vetter Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/drm_panel.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index ed7985c0535a..2d59cdd05e50 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -151,10 +151,13 @@ EXPORT_SYMBOL(drm_panel_detach); */ int drm_panel_prepare(struct drm_panel *panel) { - if (panel && panel->funcs && panel->funcs->prepare) + if (!panel) + return -EINVAL; + + if (panel->funcs && panel->funcs->prepare) return panel->funcs->prepare(panel); - return panel ? -ENOSYS : -EINVAL; + return 0; } EXPORT_SYMBOL(drm_panel_prepare); @@ -171,10 +174,13 @@ EXPORT_SYMBOL(drm_panel_prepare); */ int drm_panel_unprepare(struct drm_panel *panel) { - if (panel && panel->funcs && panel->funcs->unprepare) + if (!panel) + return -EINVAL; + + if (panel->funcs && panel->funcs->unprepare) return panel->funcs->unprepare(panel); - return panel ? -ENOSYS : -EINVAL; + return 0; } EXPORT_SYMBOL(drm_panel_unprepare); @@ -190,10 +196,13 @@ EXPORT_SYMBOL(drm_panel_unprepare); */ int drm_panel_enable(struct drm_panel *panel) { - if (panel && panel->funcs && panel->funcs->enable) + if (!panel) + return -EINVAL; + + if (panel->funcs && panel->funcs->enable) return panel->funcs->enable(panel); - return panel ? -ENOSYS : -EINVAL; + return 0; } EXPORT_SYMBOL(drm_panel_enable); @@ -209,10 +218,13 @@ EXPORT_SYMBOL(drm_panel_enable); */ int drm_panel_disable(struct drm_panel *panel) { - if (panel && panel->funcs && panel->funcs->disable) + if (!panel) + return -EINVAL; + + if (panel->funcs && panel->funcs->disable) return panel->funcs->disable(panel); - return panel ? -ENOSYS : -EINVAL; + return 0; } EXPORT_SYMBOL(drm_panel_disable); @@ -228,10 +240,13 @@ EXPORT_SYMBOL(drm_panel_disable); */ int drm_panel_get_modes(struct drm_panel *panel) { - if (panel && panel->funcs && panel->funcs->get_modes) + if (!panel) + return -EINVAL; + + if (panel->funcs && panel->funcs->get_modes) return panel->funcs->get_modes(panel); - return panel ? -ENOSYS : -EINVAL; + return 0; } EXPORT_SYMBOL(drm_panel_get_modes); From patchwork Mon Dec 2 19:32:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269695 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD4DF109A for ; Mon, 2 Dec 2019 19:34:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8361620661 for ; Mon, 2 Dec 2019 19:34:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ar/ok5fk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="P7qfmJB7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8361620661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/1m2wOeZDGpNoEZXziAFVXIs1RkcvEXB8KYdDpTDRnc=; b=ar/ok5fkJZycZD V4Ge6bbSom2GuH0qPOFZwSkmG2q+vjsBKFg9gKHpgmXB8aYtLRSnUIVzeC42BlOwHw+1yVvjnam6X qsLmGTA47IIPNIMcNBhl2X5jLpb9vwMyPs++eE/jTc3ll/9VB5tbEpiRMdji3P1d1qz4K3DZkvX3F yOFK2ZstAlnsfFunCQhIvoZ7ZAtEQ2Wvc1N2Sj1vPrvTKpQCcJnQgFWHG+Ls0hxRP2K1DUN6j8K62 9b0PRaLBU46aUw8EsfTOOQGQ4vJ5kTSX7W5C652mJFWM5z+mYyhEXNT+UH2A8QbXn835xDtzaoF7V 9aSzkuoBiC3q01NzJb4g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrT5-0000MB-0I; Mon, 02 Dec 2019 19:34:47 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRV-0007Lj-Mq; Mon, 02 Dec 2019 19:33:12 +0000 Received: by mail-lj1-x243.google.com with SMTP id 21so875049ljr.0; Mon, 02 Dec 2019 11:33:09 -0800 (PST) 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=kQQWTzPxFOvUW0DGcl4YpgZWZHH+8BFvj48Hp2FKfa8=; b=P7qfmJB7gvDRX9cK4SwTcYkfCK+h7HfN6dil8iCxOUJpUAmm2axESYkmf6IUXBX3Uq WcmlNpE+pVguPwT3omJfvN4fWDZrMuwuXEfiWzGRCml/b3t3ZWCkG9cu3t157dFuaOZ4 knqGQ/aw7yV6rIykXAsY3sKhFeY0GXLkogBkJISKrtaz0Sg96uheXMKaETsEE+NqE9IT ZdhniU0NKn8/PWLne5hKZW5BgXUi5yRzYPX6+vg4Ld9cFLnyLSViVJjpseH9TI5H5NnG s3acjDx6kOTjbCM4IaA1oKdjgaptx3ddRgMYzaOgdb/V3KEUtBt6imN+MtGr+WV3pNPE w16g== 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=kQQWTzPxFOvUW0DGcl4YpgZWZHH+8BFvj48Hp2FKfa8=; b=b2sAHMCejc+s7ALPh2HzQif3SrSO+HH42Hnmn+I9nqQN2ZshTaFe4dIo5bPA5CH2pe RYZddf+yPCcQtk1COlDz1VgJJsSO9UejNnY8Vkdv3We0oDjZDgGqAPMNiBgLv2SpaM1K H+mzS0hF4oq+136MQky4hhWp4DB4bE3Fq7SDoXIOwbriiv1nKuSDeZD2B3ql5kzYvD48 dQEV8zBORQCxTM/HpP4qAiWoqD9O4Sllegi68aoi7uM0kLp12vq++aJXZ4cTrLdDyq5M GexmGcO0nBWw3CNLisx8mM0vW2diI2DdvcYJop8Qc61Wt9JGI0V+V+4mNvH8q8YljPOq NaFw== X-Gm-Message-State: APjAAAW3khTzM4ZV4gmSWqhoiGaZ3ailrGwEyKkD6VMIBeRQkgtpV9k8 eA/TjcI/aWhbAkFnCY39bFicq4LiCeeGQg== X-Google-Smtp-Source: APXvYqwYpJfjizEaD5IBDV4xc3cEeqEstQeeKZaXT9Z/vSBZFIXZ28HzUNDZprk6Zlxob1NmomY5yg== X-Received: by 2002:a2e:7202:: with SMTP id n2mr243436ljc.194.1575315187338; Mon, 02 Dec 2019 11:33:07 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:06 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 02/26] drm/panel: add backlight support Date: Mon, 2 Dec 2019 20:32:06 +0100 Message-Id: <20191202193230.21310-3-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113309_795112_8FAAF8FD X-CRM114-Status: GOOD ( 19.78 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , Maxime Ripard , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org 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. v2: - Drop test of CONFIG_DRM_PANEL in header-file (Laurent) - do not enable backlight if ->enable() returns an error 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 | 49 +++++++++++++++++++++++++++++++++++-- include/drm/drm_panel.h | 23 +++++++++++++++++ 2 files changed, 70 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index 2d59cdd05e50..35609c90e467 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 @@ -196,13 +197,18 @@ EXPORT_SYMBOL(drm_panel_unprepare); */ int drm_panel_enable(struct drm_panel *panel) { + int ret = 0; + if (!panel) return -EINVAL; if (panel->funcs && panel->funcs->enable) - return panel->funcs->enable(panel); + ret = panel->funcs->enable(panel); - return 0; + if (ret >= 0) + backlight_enable(panel->backlight); + + return ret; } EXPORT_SYMBOL(drm_panel_enable); @@ -221,6 +227,8 @@ int drm_panel_disable(struct drm_panel *panel) if (!panel) return -EINVAL; + backlight_disable(panel->backlight); + if (panel->funcs && panel->funcs->disable) return panel->funcs->disable(panel); @@ -289,6 +297,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 ce8da64022b4..d30c98567384 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 { /** @@ -132,6 +137,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: * @@ -183,4 +197,13 @@ static inline struct drm_panel *of_drm_find_panel(const struct device_node *np) } #endif +#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) +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 Mon Dec 2 19:32:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269703 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B3BA13A4 for ; Mon, 2 Dec 2019 19:35:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6AE6120661 for ; Mon, 2 Dec 2019 19:35:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fGgESZm3"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EgYXvkPF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AE6120661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bdfjBRyS+oV6UNWceB7w3bk0bpXOl1VbzsZ40CICm4g=; b=fGgESZm3BHkKPz 0G6bE+HP5vIFzxQlm8Grn6bV6I1Mywzjzqy05ImuEWp4zgKCbDw3ODjfcfqgP9M6LlDFESNiwQF8D a06RJNvF7bAMMx42b1PMLirwJ0aEwCHg+d3hkTsgwbFsLO7uQ9CIUzNdvB4LEdcN4acCBQkEvsUQE 7Apa+LtMHWhU3kkEvjNU6pbVYo9YCwdo/u855W6ivXwbo5980RMdKOS7bgZomMy5GeMcEQA/OVQb5 1q83HDOwglIib0QhjnCdRJpPiXEudJKHwgHnp7aCSfLpEqawhihHYTNBri2tm3mRvy+87cShRgs6a kAG8TcKLxQCFOAsmKTeg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrTI-0000dT-Ja; Mon, 02 Dec 2019 19:35:00 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRY-0007OA-Au; Mon, 02 Dec 2019 19:33:14 +0000 Received: by mail-lf1-x142.google.com with SMTP id b15so790270lfc.4; Mon, 02 Dec 2019 11:33:11 -0800 (PST) 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=V7Sk0vtzr45wZ8IS1NkDSiSilaqDlsnOxAQYOrMwYkQ=; b=EgYXvkPFPix9mbJArMrY8NeAkHpQ9d4jaCKh0z+eSI2RmTfxI6tH0nxQoT6w+sfmnc fEtWvBZZpb/e0PdKql1qA648r08sAQTI7p2ddc2eh7wyiuAkat9URK0IBltoqyZR1HrI 2KYqXQ6I4wfNDDRDfRQx1XAA9+rZyRAOBAcGnrcvpdMy1FIKVzTaq3NQs0tQtVOBd13a AlUvXyOntqtmiTqGA/9lTfjOA9eBIqXjLki2aaZnLSK0VMZiXajnqwTmh8DW9W2HgIMK O9MnTorcTW8e095CaKaVXszFUwz1gLMc2cA+nfXuOn523h4SJyoz4OjTmZcynePZ5Cmv +OyQ== 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=V7Sk0vtzr45wZ8IS1NkDSiSilaqDlsnOxAQYOrMwYkQ=; b=H6WH6pTRfmzzeLWwEAHhWrBBmB5griU0k3f6HfS+Db4sUNFjPAIGPKjET3ZhwPFnsa M3Gls9e/4BayTM+OTZu+yF82GX+znnNde6irlkejGcNeiCU/N9apu+TNvIayqLVmuySk FP9ZIUD5xvQ9vlztsDGjJCn4XsszqrEdClvK6l50o86MaQCFrqA7nG+ZGXSMKAKr/qRp qUrwUxtoWrXKesPm0YdNBEiZYC2vZs1BTR6I7O7cGptjBB5XnjeaJSmyJx4ty9nfpNGo XN9MAD2jfLdB8qLqi2ao2jNVV+0Xk9NKErt42MS2VwRRRzHuqOx5wu+udmZMuaXw3qSA HL3Q== X-Gm-Message-State: APjAAAX2yhEe2keqZCoBdz3dMWh8Paqj7fJ7rds/yW/sCkIxLktFytFw cYKwv4sPlDxNeQueUG+GJ24= X-Google-Smtp-Source: APXvYqyFg/v6//X8iyL25Oa8adNguLHzFky+6g9PTX8HCXsO+nj0VFmTRx6UWZsUGh8DbeL+sZm8kg== X-Received: by 2002:ac2:5388:: with SMTP id g8mr410915lfh.43.1575315189008; Mon, 02 Dec 2019 11:33:09 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:08 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 03/26] drm/panel: simple: use drm_panel backlight support Date: Mon, 2 Dec 2019 20:32:07 +0100 Message-Id: <20191202193230.21310-4-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113312_520601_F6D60C21 X-CRM114-Status: GOOD ( 13.85 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:142 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Use drm_panel infrastructure for backlight. Replace direct calls with drm_panel_*() calls to utilize the drm_panel support. Signed-off-by: Sam Ravnborg cc: Laurent Pinchart Cc: Thierry Reding Cc: Sam Ravnborg Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/panel/panel-simple.c | 50 ++++++---------------------- 1 file changed, 11 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 72f69709f349..a5df6d6dd455 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 @@ -105,7 +104,6 @@ struct panel_simple { const struct panel_desc *desc; - struct backlight_device *backlight; struct regulator *supply; struct i2c_adapter *ddc; @@ -236,12 +234,6 @@ static int panel_simple_disable(struct drm_panel *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); @@ -307,12 +299,6 @@ static int panel_simple_enable(struct drm_panel *panel) 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; @@ -414,9 +400,9 @@ 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 panel_simple *panel; struct display_timing dt; + struct device_node *ddc; int err; panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL); @@ -442,24 +428,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 +443,10 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) drm_panel_init(&panel->base, dev, &panel_simple_funcs, desc->connector_type); + 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 +458,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; } @@ -491,16 +467,12 @@ static int panel_simple_remove(struct device *dev) struct panel_simple *panel = dev_get_drvdata(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 +480,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 = { From patchwork Mon Dec 2 19:32:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269701 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EA903109A for ; Mon, 2 Dec 2019 19:34:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C543B20661 for ; Mon, 2 Dec 2019 19:34:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="u5r7NG5T"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Xc6+bsYY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C543B20661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IJvSLPJRCqfGA9SWJBBX51gAZ4i+PWLgttzw6CwvOjw=; b=u5r7NG5T23v+cC Rt2yoPVyKIbWG9/2CliFB1Bi7xhapPHQCE17B3ER6lpJ0xPUKHvgjzhbQMLkhRBpXQLjJ02AkCDkp oG0P1FcxWo5nHUVw3ifgppODA8sz+2uM8KGDDkOc5S8vEIUgn3bmhzBDEhCwtSp8RC4cZ4SHWPgpg Zx2UCAubgnySZ5GjTuO49fBiaRFb3qBP14HhxQ6kP6exUBwS6gohzWQyQWuRKilU+kRDLnjJaJBpw tia0FhMxg9C+YN3XSB7Rk2wUi8HkOTnp+02N5PbbNQnEnWWzYSUseyHUII/eokbsh7LL2LwGP8zSk K4GXepDO0U9bBXlrQ9rw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrTD-0000UT-I7; Mon, 02 Dec 2019 19:34:55 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRY-0007QQ-Ti; Mon, 02 Dec 2019 19:33:16 +0000 Received: by mail-lf1-x142.google.com with SMTP id y5so777673lfy.7; Mon, 02 Dec 2019 11:33:12 -0800 (PST) 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=pufhdufTBZ4mSzYNhIa1SU1Zolx0dEUNyE9ky7d08jw=; b=Xc6+bsYYLAQi0yIiEPOOsVDOPaXWqYmWsAGZ6RV2VEhV9pVuYL3BsbW3SnM25cmwS0 AsFNImSjUufwoeD5cU+LBWRxqTjiJH101E6dTd3gVzgmMmtK58WMi8tmDd+mVB21AmMC 26jmrpI4LIUFW0dI+ZsdH8Q1mmDOZStyy22dGfVi5SFBwBXnx+9b+4YGdwabSu5izF+q g2z+T9DJKp1MlZMjk0NZ8IU8ALfdq3ChwuVCiDhpkJSFWVd6XkgBm3fIsgaiReytTE46 +rc+yBbEdFNNpEPaDtJ8Zfjhx9UiBauYue5/xd2TiCqtdq8EX05A4ejtJKNoE5aJJhTM /THA== 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=pufhdufTBZ4mSzYNhIa1SU1Zolx0dEUNyE9ky7d08jw=; b=DLdsW0DA7NvXT7VXIJ4UOHvpplHxZe8pZsp9tD0LGbKWU9PRCazh85jvnS4KR6L1zK Wa1jRBSUI8ezHdYvNBGMSDH82HbyXZqr9t5Vs1Qeq3wXendynyKEtT37Cx4q58c2pqsl DR2+BlYaS3quHTC1ZvHxG7fW0iEPJuJcSETblrkUjGdsV/L96NSzxBWFk0aRfDL7KarV X0TemYsznbFxfX8vrQmRC5/APQBMwN6manSEDuEeuNFEjnD7OKsoy9crwj0FuAZUXkH1 ekYXfh/kf0EV08fYeBk3qazNFtFLHOQrAs3+bo011qIvpXAD4cpHZQd9R27ooM/FOyLG Vrbw== X-Gm-Message-State: APjAAAUD+Xbk+uy18AgBfTc3dIVc828ABN4dELX9DZeFQVeV/Y1yD296 vXxbeP2wxIKOcLs/BLD64DQ= X-Google-Smtp-Source: APXvYqzrv6BigKOuGAiecc+JD92dfDaiQ3Shj7lT0vkeRMJRgmrSt0RVk2kjEFu87HKmvnxxHrbwUw== X-Received: by 2002:ac2:52a5:: with SMTP id r5mr427632lfm.19.1575315190884; Mon, 02 Dec 2019 11:33:10 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:10 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 04/26] drm: get drm_bridge_panel connector via helper Date: Mon, 2 Dec 2019 20:32:08 +0100 Message-Id: <20191202193230.21310-5-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113313_137268_277FC001 X-CRM114-Status: GOOD ( 13.57 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:142 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Laurent Pinchart , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Jonas Karlman , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Jernej Skrabec , Purism Kernel Team , Eric Anholt , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org The drm_connector created by drm_panel_bridge was accessed via drm_panel.connector. Avoid the detour around drm_panel by providing a simple get method. This avoids direct access to the connector field in drm_panel in the two users. Update pl111 and tve200 to use the new helper. Signed-off-by: Sam Ravnborg Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Cc: Eric Anholt Cc: Linus Walleij Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Daniel Vetter Reviewed-by: Laurent Pinchart Reviewed-by: Linus Walleij --- drivers/gpu/drm/bridge/panel.c | 16 ++++++++++++++++ drivers/gpu/drm/pl111/pl111_drv.c | 2 +- drivers/gpu/drm/tve200/tve200_drv.c | 2 +- include/drm/drm_bridge.h | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index f4e293e7cf64..c5e27b81588a 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -289,3 +289,19 @@ struct drm_bridge *devm_drm_panel_bridge_add_typed(struct device *dev, return bridge; } EXPORT_SYMBOL(devm_drm_panel_bridge_add_typed); + +/** + * drm_panel_bridge_connector - return pointer to connector + * + * drm_panel_bridge creates the connector. + * This function gives external access to the connector. + * + * Returns: Pointer to drm_conneector + */ +struct drm_connector *drm_panel_bridge_connector(struct drm_bridge *bridge) +{ + struct panel_bridge * panel_bridge; + panel_bridge = drm_bridge_to_panel_bridge(bridge); + + return &panel_bridge->connector; +} diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c index 63dfcda04147..aa8aa8d9e405 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -166,7 +166,7 @@ static int pl111_modeset_init(struct drm_device *dev) priv->bridge = bridge; if (panel) { priv->panel = panel; - priv->connector = panel->connector; + priv->connector = drm_panel_bridge_connector(bridge); } ret = pl111_display_init(dev); diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c index 954b09c948eb..00ba9e5ce130 100644 --- a/drivers/gpu/drm/tve200/tve200_drv.c +++ b/drivers/gpu/drm/tve200/tve200_drv.c @@ -110,7 +110,7 @@ static int tve200_modeset_init(struct drm_device *dev) } priv->panel = panel; - priv->connector = panel->connector; + priv->connector = drm_panel_bridge_connector(bridge); priv->bridge = bridge; dev_info(dev->dev, "attached to panel %s\n", diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index c0a2286a81e9..9a4902accfe5 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -438,6 +438,7 @@ struct drm_bridge *devm_drm_panel_bridge_add(struct device *dev, struct drm_bridge *devm_drm_panel_bridge_add_typed(struct device *dev, struct drm_panel *panel, u32 connector_type); +struct drm_connector *drm_panel_bridge_connector(struct drm_bridge *bridge); #endif #endif From patchwork Mon Dec 2 19:32:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269721 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 128B5109A for ; Mon, 2 Dec 2019 19:35:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DB72320659 for ; Mon, 2 Dec 2019 19:35:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kFf1+REc"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TO/IXOjY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB72320659 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XIBdKCcz4bAqg9HPOk7Bk9aqgpDaTHvSZlsZKmzn2rk=; b=kFf1+REcXz7S/n aOjEtaQJLNEiWZiafm+AQMAsP/2rJPSdxKqx1nsWUo1mQYb7dlmARd6mn63HQ2CPUGx5JmXJlwau5 T9bT+ox8FHt28+mzrwj8lmHAPlhkaXPBEWAlB65UJuXZ+jcLfN5bnapyzOE+NMc0IlgswINjADJ3q 8advt0c9VXxkFZDd7X0XuYBsyQLDIAE/OGE9WAXzLWmnyzVSds++RfGQCI3xPDhqtQDj2hBGQp/m7 V5XXibgGCnNuRf2tR9+RxhCW6bN8/4iWsdA/wtJV4zL+9F2Qp1QUCwiOujQdOODxg1+YEebkfcBMP oRE47sxswGf1liHQIaeg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrU5-0001Pt-VW; Mon, 02 Dec 2019 19:35:50 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRb-0007TA-JS; Mon, 02 Dec 2019 19:33:22 +0000 Received: by mail-lf1-x144.google.com with SMTP id b15so790473lfc.4; Mon, 02 Dec 2019 11:33:15 -0800 (PST) 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=IGvO+0xUXURYlKsBh3J5hHpZK9r2fHSXOrcSPvha2C8=; b=TO/IXOjYwQKoCBMO3dJFcbPjRiNPctl7a7IYgNjrIkhuV0VSV+C5S7enpnOYTnAHI0 JI7sLNslAiB+7xJ/t625LnyF+ZOPz8FyvjTgVsT31DrGFHzxN2y/MGxb4ClZ+DSFY7jW Mc1kgMv3FH/LSEjCTjwCYwa/HVAvZpCFWsjyug7t8GPV4spY4whe6+fLTYFTvsyaDSF8 2aOeWjfPH+FLe5w6F3IdD4e4u68mrERFtFfPJXVHzDDecZg+acLEjGMdYuWGbbk4u9+9 iPt8452h8L024dLJl/cDNzof82VqBn+S5Oloh1izEorSiwt6IKWiQkXhYRaEH8vggWO/ gD4Q== 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=IGvO+0xUXURYlKsBh3J5hHpZK9r2fHSXOrcSPvha2C8=; b=OWy3Ha7Oc8m2sL6DgHeUQ0+yI4KcVXkramfW5SV/tjlKWk6kkkhZDAGBung78iCxE1 QrZjVk0J8kVKw+gR/2z4YoDb28YGJfdyfvfUPeyQPn+rhb1bxWyjdw55tqQ0rnS/5KOI D6YePfWGqUpszbEq2JF1KrE1wj3AacVJ+vFJZ3/alJqlVuoeSmAYitg7nE3KHBMU5qiH SThmGEaODvkQGng9C8XEr6q4JyCWcQ4XMqhwnvizkq9gaWEq3eZa/kAq4nRleNKKXzok ToogAqCPiIb5h7PICYGSUYjnNcDLNZUdA9wY/BSQsoQ1bQep0vhDSZK7SKlV4ixRREGB 7YLg== X-Gm-Message-State: APjAAAWkZ5NKkZSFgiHEybBpMRkq0R2ICJtOTvicZxc8WvVdBiNoNJ9y 39KYd++dKbHMLvdQtBEh5hc= X-Google-Smtp-Source: APXvYqwiyN3Ni8kOwAwaSHEtmfm8NSqTfI1JTrh4rqOYqDc6DJG7i0EoIz6D11uM67yv7f3L1uwJnQ== X-Received: by 2002:a19:74a:: with SMTP id 71mr400767lfh.127.1575315193565; Mon, 02 Dec 2019 11:33:13 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:12 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 05/26] drm/panel: add drm_connector argument to get_modes() Date: Mon, 2 Dec 2019 20:32:09 +0100 Message-Id: <20191202193230.21310-6-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113315_942051_21F66A30 X-CRM114-Status: GOOD ( 14.39 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:144 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, Stefan Mavrodiev , linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , Robert Chiras , =?utf-8?q?Guido_G=C3=BCnther?= , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Today the bridge creates the drm_connector, but that is planned to be moved to the display drivers. To facilitate this, update drm_panel_funcs.get_modes() to take drm_connector as an argument. All panel drivers implementing get_modes() are updated. Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Laurent Pinchart Cc: Sam Ravnborg Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Daniel Vetter Cc: Linus Walleij Cc: Jagan Teki Cc: Stefan Mavrodiev Cc: Robert Chiras Cc: "Guido Günther" Cc: Purism Kernel Team Reviewed-by: Laurent Pinchart Reviewed-by: Linus Walleij --- drivers/gpu/drm/drm_panel.c | 2 +- drivers/gpu/drm/panel/panel-arm-versatile.c | 4 +-- .../drm/panel/panel-feiyang-fy07024di26a30d.c | 4 +-- drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 5 ++-- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 8 +++--- drivers/gpu/drm/panel/panel-innolux-p079zca.c | 13 +++++---- .../gpu/drm/panel/panel-jdi-lt070me05000.c | 9 ++++--- .../drm/panel/panel-kingdisplay-kd097d04.c | 11 ++++---- drivers/gpu/drm/panel/panel-lg-lb035q02.c | 4 +-- drivers/gpu/drm/panel/panel-lg-lg4573.c | 8 +++--- drivers/gpu/drm/panel/panel-lvds.c | 4 +-- drivers/gpu/drm/panel/panel-nec-nl8048hl11.c | 4 +-- drivers/gpu/drm/panel/panel-novatek-nt39016.c | 4 +-- .../drm/panel/panel-olimex-lcd-olinuxino.c | 4 +-- .../gpu/drm/panel/panel-orisetech-otm8009a.c | 9 ++++--- .../drm/panel/panel-osd-osd101t2587-53ts.c | 9 ++++--- .../drm/panel/panel-panasonic-vvx10f034n00.c | 9 ++++--- .../drm/panel/panel-raspberrypi-touchscreen.c | 4 +-- drivers/gpu/drm/panel/panel-raydium-rm67191.c | 6 ++--- drivers/gpu/drm/panel/panel-raydium-rm68200.c | 9 ++++--- .../drm/panel/panel-rocktech-jh057n00900.c | 9 ++++--- drivers/gpu/drm/panel/panel-ronbo-rb070d30.c | 10 +++---- drivers/gpu/drm/panel/panel-samsung-ld9040.c | 4 +-- drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 4 +-- drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 4 +-- .../gpu/drm/panel/panel-samsung-s6e63j0x03.c | 4 +-- drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 4 +-- drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c | 4 +-- drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 9 ++++--- .../gpu/drm/panel/panel-sharp-lq101r1sx01.c | 9 ++++--- .../gpu/drm/panel/panel-sharp-ls037v7dw01.c | 4 +-- .../gpu/drm/panel/panel-sharp-ls043t1le01.c | 9 ++++--- drivers/gpu/drm/panel/panel-simple.c | 27 ++++++++++--------- drivers/gpu/drm/panel/panel-sitronix-st7701.c | 9 ++++--- .../gpu/drm/panel/panel-sitronix-st7789v.c | 8 +++--- drivers/gpu/drm/panel/panel-sony-acx565akm.c | 4 +-- drivers/gpu/drm/panel/panel-tpo-td028ttec1.c | 4 +-- drivers/gpu/drm/panel/panel-tpo-td043mtea1.c | 4 +-- drivers/gpu/drm/panel/panel-tpo-tpg110.c | 4 +-- drivers/gpu/drm/panel/panel-truly-nt35597.c | 4 +-- include/drm/drm_panel.h | 3 ++- 41 files changed, 141 insertions(+), 130 deletions(-) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index 35609c90e467..9927e28d93e6 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -252,7 +252,7 @@ int drm_panel_get_modes(struct drm_panel *panel) return -EINVAL; if (panel->funcs && panel->funcs->get_modes) - return panel->funcs->get_modes(panel); + return panel->funcs->get_modes(panel, panel->connector); return 0; } diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c b/drivers/gpu/drm/panel/panel-arm-versatile.c index a0574dc03e16..41aa91f60979 100644 --- a/drivers/gpu/drm/panel/panel-arm-versatile.c +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c @@ -260,9 +260,9 @@ static int versatile_panel_enable(struct drm_panel *panel) return 0; } -static int versatile_panel_get_modes(struct drm_panel *panel) +static int versatile_panel_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct versatile_panel *vpanel = to_versatile_panel(panel); struct drm_display_mode *mode; diff --git a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c index 98f184b81187..37d6b7390954 100644 --- a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c +++ b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c @@ -162,9 +162,9 @@ static const struct drm_display_mode feiyang_default_mode = { .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, }; -static int feiyang_get_modes(struct drm_panel *panel) +static int feiyang_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct feiyang *ctx = panel_to_feiyang(panel); struct drm_display_mode *mode; diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c index 24955bec1958..8fd4c0521841 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c @@ -641,9 +641,9 @@ static const struct drm_display_mode itu_r_bt_656_720_mode = { .flags = 0, }; -static int ili9322_get_modes(struct drm_panel *panel) +static int ili9322_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct ili9322 *ili = panel_to_ili9322(panel); struct drm_display_mode *mode; struct drm_display_info *info; @@ -655,7 +655,6 @@ static int ili9322_get_modes(struct drm_panel *panel) info->bus_flags |= DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE; else info->bus_flags |= DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE; - if (ili->conf->de_active_high) info->bus_flags |= DRM_BUS_FLAG_DE_HIGH; else diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index e8789e460a16..1c67a668d6bf 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -387,9 +387,9 @@ static const struct drm_display_mode bananapi_default_mode = { .vtotal = 1280 + 10 + 10 + 20, }; -static int ili9881c_get_modes(struct drm_panel *panel) +static int ili9881c_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct ili9881c *ctx = panel_to_ili9881c(panel); struct drm_display_mode *mode; @@ -407,8 +407,8 @@ static int ili9881c_get_modes(struct drm_panel *panel) mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; drm_mode_probed_add(connector, mode); - panel->connector->display_info.width_mm = 62; - panel->connector->display_info.height_mm = 110; + connector->display_info.width_mm = 62; + connector->display_info.height_mm = 110; return 1; } diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c index 83df1ac4211f..facf1bab2532 100644 --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c @@ -403,7 +403,8 @@ static const struct panel_desc innolux_p097pfg_panel_desc = { .sleep_mode_delay = 100, /* T15 */ }; -static int innolux_panel_get_modes(struct drm_panel *panel) +static int innolux_panel_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct innolux_panel *innolux = to_innolux_panel(panel); const struct drm_display_mode *m = innolux->desc->mode; @@ -418,13 +419,11 @@ static int innolux_panel_get_modes(struct drm_panel *panel) drm_mode_set_name(mode); - drm_mode_probed_add(panel->connector, mode); + drm_mode_probed_add(connector, mode); - panel->connector->display_info.width_mm = - innolux->desc->size.width; - panel->connector->display_info.height_mm = - innolux->desc->size.height; - panel->connector->display_info.bpc = innolux->desc->bpc; + connector->display_info.width_mm = innolux->desc->size.width; + connector->display_info.height_mm = innolux->desc->size.height; + connector->display_info.bpc = innolux->desc->bpc; return 1; } diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c index 56364a93f0b8..e6b650a64fdb 100644 --- a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c @@ -300,7 +300,8 @@ static const struct drm_display_mode default_mode = { .flags = 0, }; -static int jdi_panel_get_modes(struct drm_panel *panel) +static int jdi_panel_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct drm_display_mode *mode; struct jdi_panel *jdi = to_jdi_panel(panel); @@ -316,10 +317,10 @@ static int jdi_panel_get_modes(struct drm_panel *panel) drm_mode_set_name(mode); - drm_mode_probed_add(panel->connector, mode); + drm_mode_probed_add(connector, mode); - panel->connector->display_info.width_mm = 95; - panel->connector->display_info.height_mm = 151; + connector->display_info.width_mm = 95; + connector->display_info.height_mm = 151; return 1; } diff --git a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c index 45f96556ec8c..e6f53d56daf9 100644 --- a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c +++ b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c @@ -333,7 +333,8 @@ static const struct drm_display_mode default_mode = { .vrefresh = 60, }; -static int kingdisplay_panel_get_modes(struct drm_panel *panel) +static int kingdisplay_panel_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct drm_display_mode *mode; @@ -347,11 +348,11 @@ static int kingdisplay_panel_get_modes(struct drm_panel *panel) drm_mode_set_name(mode); - drm_mode_probed_add(panel->connector, mode); + drm_mode_probed_add(connector, mode); - panel->connector->display_info.width_mm = 147; - panel->connector->display_info.height_mm = 196; - panel->connector->display_info.bpc = 8; + connector->display_info.width_mm = 147; + connector->display_info.height_mm = 196; + connector->display_info.bpc = 8; return 1; } diff --git a/drivers/gpu/drm/panel/panel-lg-lb035q02.c b/drivers/gpu/drm/panel/panel-lg-lb035q02.c index 7a1385e834f0..7a3bd4d80c79 100644 --- a/drivers/gpu/drm/panel/panel-lg-lb035q02.c +++ b/drivers/gpu/drm/panel/panel-lg-lb035q02.c @@ -141,9 +141,9 @@ static const struct drm_display_mode lb035q02_mode = { .height_mm = 53, }; -static int lb035q02_get_modes(struct drm_panel *panel) +static int lb035q02_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct drm_display_mode *mode; mode = drm_mode_duplicate(panel->drm, &lb035q02_mode); diff --git a/drivers/gpu/drm/panel/panel-lg-lg4573.c b/drivers/gpu/drm/panel/panel-lg-lg4573.c index db4865a4c2b9..fc6572b4e2f9 100644 --- a/drivers/gpu/drm/panel/panel-lg-lg4573.c +++ b/drivers/gpu/drm/panel/panel-lg-lg4573.c @@ -209,9 +209,9 @@ static const struct drm_display_mode default_mode = { .vrefresh = 60, }; -static int lg4573_get_modes(struct drm_panel *panel) +static int lg4573_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct drm_display_mode *mode; mode = drm_mode_duplicate(panel->drm, &default_mode); @@ -227,8 +227,8 @@ static int lg4573_get_modes(struct drm_panel *panel) mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; drm_mode_probed_add(connector, mode); - panel->connector->display_info.width_mm = 61; - panel->connector->display_info.height_mm = 103; + connector->display_info.width_mm = 61; + connector->display_info.height_mm = 103; return 1; } diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c index 2405f26e5d31..f6d58a60e514 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -106,10 +106,10 @@ static int panel_lvds_enable(struct drm_panel *panel) return 0; } -static int panel_lvds_get_modes(struct drm_panel *panel) +static int panel_lvds_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct panel_lvds *lvds = to_panel_lvds(panel); - struct drm_connector *connector = lvds->panel.connector; struct drm_display_mode *mode; mode = drm_mode_create(lvds->panel.drm); diff --git a/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c b/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c index fd593532ab23..a6ccdb09aace 100644 --- a/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c +++ b/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c @@ -123,9 +123,9 @@ static const struct drm_display_mode nl8048_mode = { .height_mm = 53, }; -static int nl8048_get_modes(struct drm_panel *panel) +static int nl8048_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct drm_display_mode *mode; mode = drm_mode_duplicate(panel->drm, &nl8048_mode); diff --git a/drivers/gpu/drm/panel/panel-novatek-nt39016.c b/drivers/gpu/drm/panel/panel-novatek-nt39016.c index 60ccedce530c..91ea49c05611 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt39016.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt39016.c @@ -206,11 +206,11 @@ static int nt39016_disable(struct drm_panel *drm_panel) return 0; } -static int nt39016_get_modes(struct drm_panel *drm_panel) +static int nt39016_get_modes(struct drm_panel *drm_panel, + struct drm_connector *connector) { struct nt39016 *panel = to_nt39016(drm_panel); const struct nt39016_panel_info *panel_info = panel->panel_info; - struct drm_connector *connector = drm_panel->connector; struct drm_display_mode *mode; mode = drm_mode_duplicate(drm_panel->drm, &panel_info->display_mode); diff --git a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c b/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c index 8738ef1b66dc..2b7e0dfebc5e 100644 --- a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c +++ b/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c @@ -141,10 +141,10 @@ static int lcd_olinuxino_enable(struct drm_panel *panel) return 0; } -static int lcd_olinuxino_get_modes(struct drm_panel *panel) +static int lcd_olinuxino_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct lcd_olinuxino *lcd = to_lcd_olinuxino(panel); - struct drm_connector *connector = lcd->panel.connector; struct lcd_olinuxino_info *lcd_info = &lcd->eeprom.info; struct drm_device *drm = lcd->panel.drm; struct lcd_olinuxino_mode *lcd_mode; diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c index bf1f928b215f..4e1606c79072 100644 --- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c +++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c @@ -349,7 +349,8 @@ static int otm8009a_enable(struct drm_panel *panel) return 0; } -static int otm8009a_get_modes(struct drm_panel *panel) +static int otm8009a_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct drm_display_mode *mode; @@ -364,10 +365,10 @@ static int otm8009a_get_modes(struct drm_panel *panel) drm_mode_set_name(mode); mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; - drm_mode_probed_add(panel->connector, mode); + drm_mode_probed_add(connector, mode); - panel->connector->display_info.width_mm = mode->width_mm; - panel->connector->display_info.height_mm = mode->height_mm; + connector->display_info.width_mm = mode->width_mm; + connector->display_info.height_mm = mode->height_mm; return 1; } diff --git a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c b/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c index 2b40913899d8..b3e010288c10 100644 --- a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c +++ b/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c @@ -112,7 +112,8 @@ static const struct drm_display_mode default_mode_osd101t2587 = { .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, }; -static int osd101t2587_panel_get_modes(struct drm_panel *panel) +static int osd101t2587_panel_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct osd101t2587_panel *osd101t2587 = ti_osd_panel(panel); struct drm_display_mode *mode; @@ -128,10 +129,10 @@ static int osd101t2587_panel_get_modes(struct drm_panel *panel) drm_mode_set_name(mode); - drm_mode_probed_add(panel->connector, mode); + drm_mode_probed_add(connector, mode); - panel->connector->display_info.width_mm = 217; - panel->connector->display_info.height_mm = 136; + connector->display_info.width_mm = 217; + connector->display_info.height_mm = 136; return 1; } diff --git a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c index 664605071d34..19a6eb4637c8 100644 --- a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +++ b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c @@ -166,7 +166,8 @@ static const struct drm_display_mode default_mode = { .vrefresh = 60, }; -static int wuxga_nt_panel_get_modes(struct drm_panel *panel) +static int wuxga_nt_panel_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct drm_display_mode *mode; @@ -180,10 +181,10 @@ static int wuxga_nt_panel_get_modes(struct drm_panel *panel) drm_mode_set_name(mode); - drm_mode_probed_add(panel->connector, mode); + drm_mode_probed_add(connector, mode); - panel->connector->display_info.width_mm = 217; - panel->connector->display_info.height_mm = 136; + connector->display_info.width_mm = 217; + connector->display_info.height_mm = 136; return 1; } diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c index 09824e92fc78..732b7111395e 100644 --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c @@ -311,9 +311,9 @@ static int rpi_touchscreen_enable(struct drm_panel *panel) return 0; } -static int rpi_touchscreen_get_modes(struct drm_panel *panel) +static int rpi_touchscreen_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct drm_device *drm = panel->drm; unsigned int i, num = 0; static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; diff --git a/drivers/gpu/drm/panel/panel-raydium-rm67191.c b/drivers/gpu/drm/panel/panel-raydium-rm67191.c index fd67fc6185c4..123bb68cfcb7 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm67191.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm67191.c @@ -436,9 +436,9 @@ static int rad_panel_disable(struct drm_panel *panel) return 0; } -static int rad_panel_get_modes(struct drm_panel *panel) +static int rad_panel_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct drm_display_mode *mode; mode = drm_mode_duplicate(panel->drm, &default_mode); @@ -451,7 +451,7 @@ static int rad_panel_get_modes(struct drm_panel *panel) drm_mode_set_name(mode); mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; - drm_mode_probed_add(panel->connector, mode); + drm_mode_probed_add(connector, mode); connector->display_info.width_mm = mode->width_mm; connector->display_info.height_mm = mode->height_mm; diff --git a/drivers/gpu/drm/panel/panel-raydium-rm68200.c b/drivers/gpu/drm/panel/panel-raydium-rm68200.c index 994e855721f4..66fa975308ec 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm68200.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm68200.c @@ -335,7 +335,8 @@ static int rm68200_enable(struct drm_panel *panel) return 0; } -static int rm68200_get_modes(struct drm_panel *panel) +static int rm68200_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct drm_display_mode *mode; @@ -350,10 +351,10 @@ static int rm68200_get_modes(struct drm_panel *panel) drm_mode_set_name(mode); mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; - drm_mode_probed_add(panel->connector, mode); + drm_mode_probed_add(connector, mode); - panel->connector->display_info.width_mm = mode->width_mm; - panel->connector->display_info.height_mm = mode->height_mm; + connector->display_info.width_mm = mode->width_mm; + connector->display_info.height_mm = mode->height_mm; return 1; } diff --git a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c index 31234b79d3b1..b2d61cab3cad 100644 --- a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c +++ b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c @@ -230,7 +230,8 @@ static const struct drm_display_mode default_mode = { .height_mm = 130, }; -static int jh057n_get_modes(struct drm_panel *panel) +static int jh057n_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct jh057n *ctx = panel_to_jh057n(panel); struct drm_display_mode *mode; @@ -246,9 +247,9 @@ static int jh057n_get_modes(struct drm_panel *panel) drm_mode_set_name(mode); mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; - panel->connector->display_info.width_mm = mode->width_mm; - panel->connector->display_info.height_mm = mode->height_mm; - drm_mode_probed_add(panel->connector, mode); + connector->display_info.width_mm = mode->width_mm; + connector->display_info.height_mm = mode->height_mm; + drm_mode_probed_add(connector, mode); return 1; } diff --git a/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c b/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c index 170a5cda21b9..57a462ce221e 100644 --- a/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c +++ b/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c @@ -120,9 +120,9 @@ static const struct drm_display_mode default_mode = { .height_mm = 85, }; -static int rb070d30_panel_get_modes(struct drm_panel *panel) +static int rb070d30_panel_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct rb070d30_panel *ctx = panel_to_rb070d30_panel(panel); struct drm_display_mode *mode; static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; @@ -140,9 +140,9 @@ static int rb070d30_panel_get_modes(struct drm_panel *panel) mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; drm_mode_probed_add(connector, mode); - panel->connector->display_info.bpc = 8; - panel->connector->display_info.width_mm = mode->width_mm; - panel->connector->display_info.height_mm = mode->height_mm; + connector->display_info.bpc = 8; + connector->display_info.width_mm = mode->width_mm; + connector->display_info.height_mm = mode->height_mm; drm_display_info_set_bus_formats(&connector->display_info, &bus_format, 1); diff --git a/drivers/gpu/drm/panel/panel-samsung-ld9040.c b/drivers/gpu/drm/panel/panel-samsung-ld9040.c index 250809ba37c7..3c52f15f7a1c 100644 --- a/drivers/gpu/drm/panel/panel-samsung-ld9040.c +++ b/drivers/gpu/drm/panel/panel-samsung-ld9040.c @@ -261,9 +261,9 @@ static int ld9040_enable(struct drm_panel *panel) return 0; } -static int ld9040_get_modes(struct drm_panel *panel) +static int ld9040_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct ld9040 *ctx = panel_to_ld9040(panel); struct drm_display_mode *mode; diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c index e3a0397e953e..71939ab757b1 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c @@ -143,9 +143,9 @@ static int s6d16d0_disable(struct drm_panel *panel) return 0; } -static int s6d16d0_get_modes(struct drm_panel *panel) +static int s6d16d0_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct drm_display_mode *mode; mode = drm_mode_duplicate(panel->drm, &samsung_s6d16d0_mode); diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c index 938ab72c5540..8e0236ba6145 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c @@ -645,9 +645,9 @@ static const struct s6e3ha2_panel_desc samsung_s6e3hf2 = { .type = HF2_TYPE, }; -static int s6e3ha2_get_modes(struct drm_panel *panel) +static int s6e3ha2_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel); struct drm_display_mode *mode; diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c index a60635e9226d..c939d5bde4f0 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c @@ -400,9 +400,9 @@ static int s6e63j0x03_enable(struct drm_panel *panel) return 0; } -static int s6e63j0x03_get_modes(struct drm_panel *panel) +static int s6e63j0x03_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct drm_display_mode *mode; mode = drm_mode_duplicate(panel->drm, &default_mode); diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c index ba01af0b14fd..1d099092e754 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c @@ -362,9 +362,9 @@ static int s6e63m0_enable(struct drm_panel *panel) return 0; } -static int s6e63m0_get_modes(struct drm_panel *panel) +static int s6e63m0_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct drm_display_mode *mode; mode = drm_mode_duplicate(panel->drm, &default_mode); diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c b/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c index dbced6501204..8a028d2bd0d6 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c @@ -920,9 +920,9 @@ static int s6e8aa0_enable(struct drm_panel *panel) return 0; } -static int s6e8aa0_get_modes(struct drm_panel *panel) +static int s6e8aa0_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct s6e8aa0 *ctx = panel_to_s6e8aa0(panel); struct drm_display_mode *mode; diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c index b3619ba443bd..b878930b17e4 100644 --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c @@ -56,9 +56,9 @@ static inline struct seiko_panel *to_seiko_panel(struct drm_panel *panel) return container_of(panel, struct seiko_panel, base); } -static int seiko_panel_get_fixed_modes(struct seiko_panel *panel) +static int seiko_panel_get_fixed_modes(struct seiko_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->base.connector; struct drm_device *drm = panel->base.drm; struct drm_display_mode *mode; unsigned int i, num = 0; @@ -208,12 +208,13 @@ static int seiko_panel_enable(struct drm_panel *panel) return 0; } -static int seiko_panel_get_modes(struct drm_panel *panel) +static int seiko_panel_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct seiko_panel *p = to_seiko_panel(panel); /* add hard-coded panel modes */ - return seiko_panel_get_fixed_modes(p); + return seiko_panel_get_fixed_modes(p, connector); } static int seiko_panel_get_timings(struct drm_panel *panel, diff --git a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c index 5e136c3ba185..e797b700661a 100644 --- a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c +++ b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c @@ -278,7 +278,8 @@ static const struct drm_display_mode default_mode = { .vrefresh = 60, }; -static int sharp_panel_get_modes(struct drm_panel *panel) +static int sharp_panel_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct drm_display_mode *mode; @@ -292,10 +293,10 @@ static int sharp_panel_get_modes(struct drm_panel *panel) drm_mode_set_name(mode); - drm_mode_probed_add(panel->connector, mode); + drm_mode_probed_add(connector, mode); - panel->connector->display_info.width_mm = 217; - panel->connector->display_info.height_mm = 136; + connector->display_info.width_mm = 217; + connector->display_info.height_mm = 136; return 1; } diff --git a/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c b/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c index eeab7998c7de..7103a945f0e8 100644 --- a/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c +++ b/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c @@ -100,9 +100,9 @@ static const struct drm_display_mode ls037v7dw01_mode = { .height_mm = 75, }; -static int ls037v7dw01_get_modes(struct drm_panel *panel) +static int ls037v7dw01_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct drm_display_mode *mode; mode = drm_mode_duplicate(panel->drm, &ls037v7dw01_mode); diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c index b963ba4ab589..85ae6cffdbfb 100644 --- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c +++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c @@ -210,7 +210,8 @@ static const struct drm_display_mode default_mode = { .vrefresh = 60, }; -static int sharp_nt_panel_get_modes(struct drm_panel *panel) +static int sharp_nt_panel_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct drm_display_mode *mode; @@ -224,10 +225,10 @@ static int sharp_nt_panel_get_modes(struct drm_panel *panel) drm_mode_set_name(mode); - drm_mode_probed_add(panel->connector, mode); + drm_mode_probed_add(connector, mode); - panel->connector->display_info.width_mm = 54; - panel->connector->display_info.height_mm = 95; + connector->display_info.width_mm = 54; + connector->display_info.height_mm = 95; return 1; } diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index a5df6d6dd455..d6299fe6d276 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -117,9 +117,9 @@ static inline struct panel_simple *to_panel_simple(struct drm_panel *panel) return container_of(panel, struct panel_simple, base); } -static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel) +static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->base.connector; struct drm_device *drm = panel->base.drm; struct drm_display_mode *mode; unsigned int i, num = 0; @@ -150,9 +150,9 @@ static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel) return num; } -static unsigned int panel_simple_get_display_modes(struct panel_simple *panel) +static unsigned int panel_simple_get_display_modes(struct panel_simple *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->base.connector; struct drm_device *drm = panel->base.drm; struct drm_display_mode *mode; unsigned int i, num = 0; @@ -181,9 +181,9 @@ static unsigned int panel_simple_get_display_modes(struct panel_simple *panel) return num; } -static int panel_simple_get_non_edid_modes(struct panel_simple *panel) +static int panel_simple_get_non_edid_modes(struct panel_simple *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->base.connector; struct drm_device *drm = panel->base.drm; struct drm_display_mode *mode; bool has_override = panel->override_mode.type; @@ -204,7 +204,7 @@ static int panel_simple_get_non_edid_modes(struct panel_simple *panel) /* Only add timings if override was not there or failed to validate */ if (num == 0 && panel->desc->num_timings) - num = panel_simple_get_timings_modes(panel); + num = panel_simple_get_timings_modes(panel, connector); /* * Only add fixed modes if timings/override added no mode. @@ -214,7 +214,7 @@ static int panel_simple_get_non_edid_modes(struct panel_simple *panel) */ WARN_ON(panel->desc->num_timings && panel->desc->num_modes); if (num == 0) - num = panel_simple_get_display_modes(panel); + num = panel_simple_get_display_modes(panel, connector); connector->display_info.bpc = panel->desc->bpc; connector->display_info.width_mm = panel->desc->size.width; @@ -304,23 +304,24 @@ static int panel_simple_enable(struct drm_panel *panel) return 0; } -static int panel_simple_get_modes(struct drm_panel *panel) +static int panel_simple_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct panel_simple *p = to_panel_simple(panel); int num = 0; /* probe EDID if a DDC bus is available */ if (p->ddc) { - struct edid *edid = drm_get_edid(panel->connector, p->ddc); - drm_connector_update_edid_property(panel->connector, edid); + struct edid *edid = drm_get_edid(connector, p->ddc); + drm_connector_update_edid_property(connector, edid); if (edid) { - num += drm_add_edid_modes(panel->connector, edid); + num += drm_add_edid_modes(connector, edid); kfree(edid); } } /* add hard-coded panel modes */ - num += panel_simple_get_non_edid_modes(p); + num += panel_simple_get_non_edid_modes(p, connector); return num; } diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c index ee3f23f45755..3ed3b1d6d82d 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c @@ -264,7 +264,8 @@ static int st7701_unprepare(struct drm_panel *panel) return 0; } -static int st7701_get_modes(struct drm_panel *panel) +static int st7701_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { struct st7701 *st7701 = panel_to_st7701(panel); const struct drm_display_mode *desc_mode = st7701->desc->mode; @@ -280,10 +281,10 @@ static int st7701_get_modes(struct drm_panel *panel) } drm_mode_set_name(mode); - drm_mode_probed_add(panel->connector, mode); + drm_mode_probed_add(connector, mode); - panel->connector->display_info.width_mm = desc_mode->width_mm; - panel->connector->display_info.height_mm = desc_mode->height_mm; + connector->display_info.width_mm = desc_mode->width_mm; + connector->display_info.height_mm = desc_mode->height_mm; return 1; } diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index 108a85bb6667..836b01331505 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -170,9 +170,9 @@ static const struct drm_display_mode default_mode = { .vrefresh = 60, }; -static int st7789v_get_modes(struct drm_panel *panel) +static int st7789v_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct drm_display_mode *mode; mode = drm_mode_duplicate(panel->drm, &default_mode); @@ -188,8 +188,8 @@ static int st7789v_get_modes(struct drm_panel *panel) mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; drm_mode_probed_add(connector, mode); - panel->connector->display_info.width_mm = 61; - panel->connector->display_info.height_mm = 103; + connector->display_info.width_mm = 61; + connector->display_info.height_mm = 103; return 1; } diff --git a/drivers/gpu/drm/panel/panel-sony-acx565akm.c b/drivers/gpu/drm/panel/panel-sony-acx565akm.c index d6387d8f88a3..841dc73c443d 100644 --- a/drivers/gpu/drm/panel/panel-sony-acx565akm.c +++ b/drivers/gpu/drm/panel/panel-sony-acx565akm.c @@ -521,9 +521,9 @@ static const struct drm_display_mode acx565akm_mode = { .height_mm = 46, }; -static int acx565akm_get_modes(struct drm_panel *panel) +static int acx565akm_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct drm_display_mode *mode; mode = drm_mode_duplicate(panel->drm, &acx565akm_mode); diff --git a/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c b/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c index c44d6a65c0aa..5230176bd8e6 100644 --- a/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c +++ b/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c @@ -287,9 +287,9 @@ static const struct drm_display_mode td028ttec1_mode = { .height_mm = 58, }; -static int td028ttec1_get_modes(struct drm_panel *panel) +static int td028ttec1_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct drm_display_mode *mode; mode = drm_mode_duplicate(panel->drm, &td028ttec1_mode); diff --git a/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c b/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c index 621b65feec07..716f8ed1cc45 100644 --- a/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c +++ b/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c @@ -346,9 +346,9 @@ static const struct drm_display_mode td043mtea1_mode = { .height_mm = 56, }; -static int td043mtea1_get_modes(struct drm_panel *panel) +static int td043mtea1_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct drm_display_mode *mode; mode = drm_mode_duplicate(panel->drm, &td043mtea1_mode); diff --git a/drivers/gpu/drm/panel/panel-tpo-tpg110.c b/drivers/gpu/drm/panel/panel-tpo-tpg110.c index 1a5418ae2ccf..e74cd9d418cf 100644 --- a/drivers/gpu/drm/panel/panel-tpo-tpg110.c +++ b/drivers/gpu/drm/panel/panel-tpo-tpg110.c @@ -384,9 +384,9 @@ static int tpg110_enable(struct drm_panel *panel) * presents the mode that is configured for the system under use, * and which is detected by reading the registers of the display. */ -static int tpg110_get_modes(struct drm_panel *panel) +static int tpg110_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct tpg110 *tpg = to_tpg110(panel); struct drm_display_mode *mode; diff --git a/drivers/gpu/drm/panel/panel-truly-nt35597.c b/drivers/gpu/drm/panel/panel-truly-nt35597.c index 0feea2456e14..012ca62bf30e 100644 --- a/drivers/gpu/drm/panel/panel-truly-nt35597.c +++ b/drivers/gpu/drm/panel/panel-truly-nt35597.c @@ -454,9 +454,9 @@ static int truly_nt35597_enable(struct drm_panel *panel) return 0; } -static int truly_nt35597_get_modes(struct drm_panel *panel) +static int truly_nt35597_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { - struct drm_connector *connector = panel->connector; struct truly_nt35597 *ctx = panel_to_ctx(panel); struct drm_display_mode *mode; const struct nt35597_config *config; diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index d30c98567384..a5f7199807f2 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -100,7 +100,8 @@ struct drm_panel_funcs { * 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); + int (*get_modes)(struct drm_panel *panel, + struct drm_connector *connector); /** * @get_timings: From patchwork Mon Dec 2 19:32:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269727 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C971109A for ; Mon, 2 Dec 2019 19:36:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4260120659 for ; Mon, 2 Dec 2019 19:36:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="t/GFLrqR"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZPj1vC8/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4260120659 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uyKjMXDCF1HI1fHDMpWPcIBbtmjYb1bhU+FQTaUj7I8=; b=t/GFLrqRkEpZxF +JCKkTD7RvOr6HYSJ8KNrngyikQAZMHiMVumMro/JxQuSQdmYdKShyJYJLMIYJGACXDIESPhilRQv FyBrF4U4+UfG8eKY+HohZbXGzzx4JFz6Nfp4LIO2J+FkXe9/PpJoy6bC2SoiYN+Gs67GkLyFLDkz3 N25WrUrqI8TEpWbO6bI12i4CFsG63aFSQxHu5cerW7jZNnIf4Cu1bpdQbkuHBeN7BMRsJNkbdhvV1 E8sPCx9BY910ImEnUHFR3yrBRfa1o1vxD6WkeEOLCEEdAW4gsKT/LF8N3Y/J5G1rRJ06yooNWAcyG 2EY8yM8YwPLQWmUeLljA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrUh-0003Bf-6o; Mon, 02 Dec 2019 19:36:27 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRe-0007Vu-9H; Mon, 02 Dec 2019 19:33:23 +0000 Received: by mail-lf1-x144.google.com with SMTP id r15so806989lff.2; Mon, 02 Dec 2019 11:33:18 -0800 (PST) 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=v+UQDVW7Nk1FnYiIy3c2tfMh21o0tA2iyRXPvzxc0iY=; b=ZPj1vC8/103b8p2Ft5WPQIyrVoTUrNFdhYjve98KoYK6jO2LprLApOyZLqG7P8KPA8 9w12aTnMrwutrpoPXmI7iWvFUsuN793QRqdAxVOojeaeL4WWzcyA6CSl42RcDZcO++Uv ucxufGhvsk5CguWNr25kfu1SdtNLwdbabe1koqC1v29zPbydNyQsY2jZEz8LCU7avzh/ lgC7bOL/4kaBaMjX9XT6buTIdd33avlEjvRJAB0iZD6BE901dsUlFa64CKAJwqtJw7ix 9AVOGtlntIM9A3rknDQJax0w36S54swLo9qzNKAwChfpuBu/g7IZCN8KeCUwFeEYWQQv CYvQ== 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=v+UQDVW7Nk1FnYiIy3c2tfMh21o0tA2iyRXPvzxc0iY=; b=mvTGIm74DKq0QgO9ZUMeYUI5VvbZP1Ym5jPK+9FObccv2HFJNGQjsVF4XlgvQNZq90 Bm9q0PMA5gCoE2TAVTAnx+3l3umL7lq77uF9s6v59uyJf16mp9qKVYai3DYcwuWA8+iS SbIi2WxRd8WQn3Cs/Nq4cplEJT1ex4XPmJMFXH8R6TKu9uQojCeqw1VywTYIRmUBWXqJ xXs8VMqFYRlhWWn+VbKr0hrac/2T3aCSvbXhKOUztFBCsRD9TL8vIckkBNrmVHMQfMaS jjSK4ElVx2ETzwtdQaS4Q5OVVM/RRgIoVKcYIg7+niJJdMHULgL+LRdwgR1bn/Jf7pt2 DNhg== X-Gm-Message-State: APjAAAWb6x6PLtC59AWozac9I4YvxfR9mjYgTwWrD2L1PtAsBqzc0l8j kyZFNncynkTNrrys6XV327s= X-Google-Smtp-Source: APXvYqymcSltMOuegjJ4eCugmshySy71+q0B7Aqn6cbmrLfSCCePD/3k2tE6E6ppLwnt545Rz45WDA== X-Received: by 2002:a19:c205:: with SMTP id l5mr386926lfc.159.1575315196531; Mon, 02 Dec 2019 11:33:16 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:15 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 06/26] drm/panel: decouple connector from drm_panel Date: Mon, 2 Dec 2019 20:32:10 +0100 Message-Id: <20191202193230.21310-7-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113318_721665_2B03AEA7 X-CRM114-Status: GOOD ( 19.55 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:144 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hariprasad Kelam , =?utf-8?q?Heiko_St=C3=BCb?= =?utf-8?q?ner?= , Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Laurent Pinchart , Benjamin Gaignard , Sam Ravnborg , Marek Vasut , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , Fabio Estevam , Allison Randal , Krzysztof Kozlowski , Jonathan Hunter , Vasily Khoruzhick , linux-rockchip@lists.infradead.org, Chen-Yu Tsai , Tomi Valkeinen , Matthias Brugger , Jagan Teki , CK Hu , Philipp Zabel , NXP Linux Team , Rob Clark , Jitao Shi , Pengutronix Kernel Team , Jonas Karlman , Sascha Hauer , Alison Wang , Maarten Lankhorst , Brian Masney , Maxime Ripard , Inki Dae , Alexios Zavras , linux-mediatek@lists.infradead.org, Abhinav Kumar , Vincent Abriou , linux-tegra@vger.kernel.org, Thomas Gleixner , Sean Paul , linux-arm-kernel@lists.infradead.org, Jernej Skrabec , Purism Kernel Team , Kieran Bingham , Seung-Woo Kim , Sandy Huang , linux-renesas-soc@vger.kernel.org, Shayenne Moura , Kyungmin Park , Boris Brezillon , Torsten Duwe , Kukjin Kim , Daniel Vetter , Sean Paul , Icenowy Zheng , Shawn Guo Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org To facilitate that connector creation will be moved to display drivers, decouple the drm_connector from drm_panel. Add a connector argument to drm_panel_get_modes() All users of drm_panel_get_modes() already had the connector available, so updating users was trivial. With this patch drm_panel no longer keep a copy of the drm_connector. Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Laurent Pinchart Cc: Sam Ravnborg Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Jonas Karlman Cc: Jernej Skrabec Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Daniel Vetter Cc: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: Stefan Agner Cc: Alison Wang Cc: Philipp Zabel Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: CK Hu Cc: Matthias Brugger Cc: Marek Vasut Cc: Tomi Valkeinen Cc: Kieran Bingham Cc: Sandy Huang Cc: "Heiko Stübner" Cc: Benjamin Gaignard Cc: Vincent Abriou Cc: Chen-Yu Tsai Cc: Jonathan Hunter Cc: Torsten Duwe Cc: Vasily Khoruzhick Cc: Icenowy Zheng Cc: Sean Paul Cc: Linus Walleij Cc: Boris Brezillon Cc: Hariprasad Kelam Cc: Alexios Zavras Cc: Brian Masney Cc: Rob Clark Cc: Thomas Gleixner Cc: Allison Randal Cc: Shayenne Moura Cc: Abhinav Kumar Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-renesas-soc@vger.kernel.org Cc: linux-rockchip@lists.infradead.org Cc: linux-tegra@vger.kernel.org Reviewed-by: Laurent Pinchart Reviewed-by: Linus Walleij --- drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 2 +- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 +- drivers/gpu/drm/bridge/panel.c | 2 +- drivers/gpu/drm/bridge/parade-ps8622.c | 2 +- drivers/gpu/drm/bridge/tc358764.c | 2 +- drivers/gpu/drm/bridge/tc358767.c | 2 +- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 2 +- drivers/gpu/drm/drm_panel.c | 10 +++++----- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 2 +- drivers/gpu/drm/imx/imx-ldb.c | 2 +- drivers/gpu/drm/imx/parallel-display.c | 2 +- drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c | 2 +- drivers/gpu/drm/msm/dsi/dsi_manager.c | 2 +- drivers/gpu/drm/mxsfb/mxsfb_out.c | 2 +- drivers/gpu/drm/omapdrm/omap_connector.c | 3 ++- drivers/gpu/drm/rcar-du/rcar_lvds.c | 2 +- drivers/gpu/drm/rockchip/rockchip_lvds.c | 2 +- drivers/gpu/drm/sti/sti_dvo.c | 2 +- drivers/gpu/drm/sun4i/sun4i_lvds.c | 2 +- drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 +- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +- drivers/gpu/drm/tegra/output.c | 2 +- include/drm/drm_panel.h | 9 +-------- 26 files changed, 31 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c index b4f3a923a52a..9917ce0d86a0 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c @@ -493,7 +493,7 @@ static int anx6345_get_modes(struct drm_connector *connector) mutex_unlock(&anx6345->lock); if (!num_modes && anx6345->panel) - num_modes += drm_panel_get_modes(anx6345->panel); + num_modes += drm_panel_get_modes(anx6345->panel, connector); return num_modes; } diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index bb411fe52ae8..6effe532f820 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1111,7 +1111,7 @@ static int analogix_dp_get_modes(struct drm_connector *connector) int ret, num_modes = 0; if (dp->plat_data->panel) { - num_modes += drm_panel_get_modes(dp->plat_data->panel); + num_modes += drm_panel_get_modes(dp->plat_data->panel, connector); } else { ret = analogix_dp_prepare_panel(dp, true, false); if (ret) { diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index c5e27b81588a..65cbd4a283fb 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -37,7 +37,7 @@ static int panel_bridge_connector_get_modes(struct drm_connector *connector) struct panel_bridge *panel_bridge = drm_connector_to_panel_bridge(connector); - return drm_panel_get_modes(panel_bridge->panel); + return drm_panel_get_modes(panel_bridge->panel, connector); } static const struct drm_connector_helper_funcs diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c index b7a72dfdcac3..10c47c008b40 100644 --- a/drivers/gpu/drm/bridge/parade-ps8622.c +++ b/drivers/gpu/drm/bridge/parade-ps8622.c @@ -461,7 +461,7 @@ static int ps8622_get_modes(struct drm_connector *connector) ps8622 = connector_to_ps8622(connector); - return drm_panel_get_modes(ps8622->panel); + return drm_panel_get_modes(ps8622->panel, connector); } static const struct drm_connector_helper_funcs ps8622_connector_helper_funcs = { diff --git a/drivers/gpu/drm/bridge/tc358764.c b/drivers/gpu/drm/bridge/tc358764.c index db298f550a5a..96207fcfde19 100644 --- a/drivers/gpu/drm/bridge/tc358764.c +++ b/drivers/gpu/drm/bridge/tc358764.c @@ -282,7 +282,7 @@ static int tc358764_get_modes(struct drm_connector *connector) { struct tc358764 *ctx = connector_to_tc358764(connector); - return drm_panel_get_modes(ctx->panel); + return drm_panel_get_modes(ctx->panel, connector); } static const diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 8029478ffebb..3709e5ace724 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1346,7 +1346,7 @@ static int tc_connector_get_modes(struct drm_connector *connector) return 0; } - count = drm_panel_get_modes(tc->panel); + count = drm_panel_get_modes(tc->panel, connector); if (count > 0) return count; diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 43abf01ebd4c..9a2dd986afa5 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -206,7 +206,7 @@ static int ti_sn_bridge_connector_get_modes(struct drm_connector *connector) { struct ti_sn_bridge *pdata = connector_to_ti_sn_bridge(connector); - return drm_panel_get_modes(pdata->panel); + return drm_panel_get_modes(pdata->panel, connector); } static enum drm_mode_status diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index 9927e28d93e6..fd428b6d25b0 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -113,10 +113,9 @@ EXPORT_SYMBOL(drm_panel_remove); */ int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector) { - if (panel->connector) + if (panel->drm) return -EBUSY; - panel->connector = connector; panel->drm = connector->dev; return 0; @@ -135,7 +134,6 @@ EXPORT_SYMBOL(drm_panel_attach); */ void drm_panel_detach(struct drm_panel *panel) { - panel->connector = NULL; panel->drm = NULL; } EXPORT_SYMBOL(drm_panel_detach); @@ -239,6 +237,7 @@ EXPORT_SYMBOL(drm_panel_disable); /** * drm_panel_get_modes - probe the available display modes of a panel * @panel: DRM panel + * @connector: DRM connector * * The modes probed from the panel are automatically added to the connector * that the panel is attached to. @@ -246,13 +245,14 @@ EXPORT_SYMBOL(drm_panel_disable); * 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) +int drm_panel_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { if (!panel) return -EINVAL; if (panel->funcs && panel->funcs->get_modes) - return panel->funcs->get_modes(panel, panel->connector); + return panel->funcs->get_modes(panel, connector); return 0; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c index 5479ff71cbc6..43fa0f26c052 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c @@ -85,7 +85,7 @@ static int exynos_dpi_get_modes(struct drm_connector *connector) } if (ctx->panel) - return drm_panel_get_modes(ctx->panel); + return drm_panel_get_modes(ctx->panel, connector); return 0; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index ceb370864cc4..d14d3f25d344 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1461,7 +1461,7 @@ static int exynos_dsi_get_modes(struct drm_connector *connector) struct exynos_dsi *dsi = connector_to_dsi(connector); if (dsi->panel) - return drm_panel_get_modes(dsi->panel); + return drm_panel_get_modes(dsi->panel, connector); return 0; } 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 82c972e9c024..9598ee3cc4d2 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c @@ -68,7 +68,7 @@ static int fsl_dcu_drm_connector_get_modes(struct drm_connector *connector) struct fsl_dcu_drm_connector *fsl_connector; fsl_connector = to_fsl_dcu_connector(connector); - return drm_panel_get_modes(fsl_connector->panel); + return drm_panel_get_modes(fsl_connector->panel, connector); } static int fsl_dcu_drm_connector_mode_valid(struct drm_connector *connector, diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c index 208069faf183..8cb2665b2c74 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -127,7 +127,7 @@ 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; - num_modes = drm_panel_get_modes(imx_ldb_ch->panel); + num_modes = drm_panel_get_modes(imx_ldb_ch->panel, connector); if (num_modes > 0) return num_modes; diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c index 35518e5de356..3dca424059f7 100644 --- a/drivers/gpu/drm/imx/parallel-display.c +++ b/drivers/gpu/drm/imx/parallel-display.c @@ -50,7 +50,7 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector) struct device_node *np = imxpd->dev->of_node; int num_modes; - num_modes = drm_panel_get_modes(imxpd->panel); + num_modes = drm_panel_get_modes(imxpd->panel, connector); if (num_modes > 0) return num_modes; diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index e9931bbbe846..3b5e016d16c4 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -821,7 +821,7 @@ static int mtk_dsi_connector_get_modes(struct drm_connector *connector) { struct mtk_dsi *dsi = connector_to_dsi(connector); - return drm_panel_get_modes(dsi->panel); + return drm_panel_get_modes(dsi->panel, connector); } static const struct drm_encoder_helper_funcs mtk_dsi_encoder_helper_funcs = { 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 31abd2352f3e..c7df71e2fafc 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c @@ -53,7 +53,7 @@ static int mdp4_lvds_connector_get_modes(struct drm_connector *connector) if (panel) { drm_panel_attach(panel, connector); - ret = drm_panel_get_modes(panel); + ret = drm_panel_get_modes(panel, connector); drm_panel_detach(panel); } diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 271aa7bbca92..0fc29f1be8cc 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -329,7 +329,7 @@ static int dsi_mgr_connector_get_modes(struct drm_connector *connector) * attached to the drm_panel. */ drm_panel_attach(panel, connector); - num = drm_panel_get_modes(panel); + num = drm_panel_get_modes(panel, connector); if (!num) return 0; diff --git a/drivers/gpu/drm/mxsfb/mxsfb_out.c b/drivers/gpu/drm/mxsfb/mxsfb_out.c index 4eb94744c526..9eca1605d11d 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_out.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_out.c @@ -31,7 +31,7 @@ static int mxsfb_panel_get_modes(struct drm_connector *connector) drm_connector_to_mxsfb_drm_private(connector); if (mxsfb->panel) - return drm_panel_get_modes(mxsfb->panel); + return drm_panel_get_modes(mxsfb->panel, connector); return 0; } diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c index 5b8799c69f68..94cded387174 100644 --- a/drivers/gpu/drm/omapdrm/omap_connector.c +++ b/drivers/gpu/drm/omapdrm/omap_connector.c @@ -229,7 +229,8 @@ static int omap_connector_get_modes(struct drm_connector *connector) * operation to the panel API. */ if (omap_connector->output->panel) - return drm_panel_get_modes(omap_connector->output->panel); + return drm_panel_get_modes(omap_connector->output->panel, + connector); /* * We can't retrieve modes, which can happen for instance for a DVI or diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c index 8c6c172bbf2e..2cf44b91853c 100644 --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c @@ -91,7 +91,7 @@ static int rcar_lvds_connector_get_modes(struct drm_connector *connector) { struct rcar_lvds *lvds = connector_to_rcar_lvds(connector); - return drm_panel_get_modes(lvds->panel); + return drm_panel_get_modes(lvds->panel, connector); } static int rcar_lvds_connector_atomic_check(struct drm_connector *connector, diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c index 8a4c9af0ba73..325811d2e26e 100644 --- a/drivers/gpu/drm/rockchip/rockchip_lvds.c +++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c @@ -201,7 +201,7 @@ static int rockchip_lvds_connector_get_modes(struct drm_connector *connector) struct rockchip_lvds *lvds = connector_to_lvds(connector); struct drm_panel *panel = lvds->panel; - return drm_panel_get_modes(panel); + return drm_panel_get_modes(panel, connector); } static const diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c index 68289b0b063a..df2ee86cd4c1 100644 --- a/drivers/gpu/drm/sti/sti_dvo.c +++ b/drivers/gpu/drm/sti/sti_dvo.c @@ -339,7 +339,7 @@ static int sti_dvo_connector_get_modes(struct drm_connector *connector) struct sti_dvo *dvo = dvo_connector->dvo; if (dvo->panel) - return drm_panel_get_modes(dvo->panel); + return drm_panel_get_modes(dvo->panel, connector); return 0; } diff --git a/drivers/gpu/drm/sun4i/sun4i_lvds.c b/drivers/gpu/drm/sun4i/sun4i_lvds.c index 25ab2ef6d545..65b7a8739666 100644 --- a/drivers/gpu/drm/sun4i/sun4i_lvds.c +++ b/drivers/gpu/drm/sun4i/sun4i_lvds.c @@ -43,7 +43,7 @@ static int sun4i_lvds_get_modes(struct drm_connector *connector) struct sun4i_lvds *lvds = drm_connector_to_sun4i_lvds(connector); - return drm_panel_get_modes(lvds->panel); + return drm_panel_get_modes(lvds->panel, connector); } static struct drm_connector_helper_funcs sun4i_lvds_con_helper_funcs = { diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c index e74b9eddca01..b27f16af50f5 100644 --- a/drivers/gpu/drm/sun4i/sun4i_rgb.c +++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c @@ -47,7 +47,7 @@ static int sun4i_rgb_get_modes(struct drm_connector *connector) struct sun4i_rgb *rgb = drm_connector_to_sun4i_rgb(connector); - return drm_panel_get_modes(rgb->panel); + return drm_panel_get_modes(rgb->panel, connector); } /* diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index c958ca9bae63..4e8f634cc2db 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -795,7 +795,7 @@ static int sun6i_dsi_get_modes(struct drm_connector *connector) { struct sun6i_dsi *dsi = connector_to_sun6i_dsi(connector); - return drm_panel_get_modes(dsi->panel); + return drm_panel_get_modes(dsi->panel, connector); } static struct drm_connector_helper_funcs sun6i_dsi_connector_helper_funcs = { diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c index 5bdbf9ffcda1..4948373d8c75 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 = drm_panel_get_modes(output->panel); + err = drm_panel_get_modes(output->panel, connector); if (err > 0) return err; } diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index a5f7199807f2..4fd61cb9eb93 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -124,13 +124,6 @@ struct drm_panel { */ struct drm_device *drm; - /** - * @connector: - * - * DRM connector that the panel is attached to. - */ - struct drm_connector *connector; - /** * @dev: * @@ -187,7 +180,7 @@ 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); +int drm_panel_get_modes(struct drm_panel *panel, struct drm_connector *connector); #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL) struct drm_panel *of_drm_find_panel(const struct device_node *np); From patchwork Mon Dec 2 19:32:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269731 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E6CFE109A for ; Mon, 2 Dec 2019 19:36:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD94B20661 for ; Mon, 2 Dec 2019 19:36:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kpqDULUO"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kYgunyP2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD94B20661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0o7lJ8XVSpgmH+B8HdpOt+pwSJXQs6nXSVo4m8lCOPQ=; b=kpqDULUO4sD15w eP982Z/QAzAwAsj1Quc/mcrwSaQmEEggsQpgIs/GvD/PFBNP6NaKSd0TJC2aPTeKVpAeFFopSZ9Nc GGFa8t88AcY33c0csoguMAVFeIq02+Z1tJM1K5rhXqKRElxTrk/tHY7VtV6cStTLi6tBe7cmhZfoQ k7fDQRiPiCvwkmsjiq52zWwyXZzWSfR/K/tYa5fRlPgNFYdXm/LE9PU0cWOVV7nIjZ0ZSJpiW0gBs XJVmh5RHjIX/Cx+BR76ZeptOCzt5f9NBcUBLjk11vzSuYctXtbW4VabkYwfMg3TicKt91J9BRz/g6 cuqQL5IMjwNQjqTDc22Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrUx-0003RW-63; Mon, 02 Dec 2019 19:36:43 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRg-0007Xc-K9; Mon, 02 Dec 2019 19:33:25 +0000 Received: by mail-lf1-x141.google.com with SMTP id r15so807070lff.2; Mon, 02 Dec 2019 11:33:20 -0800 (PST) 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=bDB+ry94KK7oIL0OpHG93ZpwaWVw2/vv2p+DvmVNoo8=; b=kYgunyP2i9Ayet6lMKznMH5w9Pw1O3NwrHR40KkICtQXJ3n05r24HPZlE8IzGRf5a0 ZG4Tl1j433To0AdI3WsdBWEf3ixsvYYMLiMNuYRUGjVr1ZEoLW9kIXxObCZXvo0LBV3I uyYZwhH9eUe9ip5HifF3lUn6zJtOb5aRrpxrz+zHWhri4kqYBP+iEdsJ40go/mhOhemc ODCOjP6ah+7Ejf44pkVobctv8DtFUcklLHvQP8JicNshzMziVHkryicGKhTNG/O2wwwl ZRBNKeT34tVwDMKtPegTjSWzBNwEQbBzUvZ2JtPBuY5wTFhGtLRrXB0z7FtxsIZFhvkO 4hDw== 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=bDB+ry94KK7oIL0OpHG93ZpwaWVw2/vv2p+DvmVNoo8=; b=GCzkuGOHmafr1jGtHjCcmwKh7EgvzBp60xP7O9xANEC6rP8PjQcmuqJg2f8xkqO/ID 9LlZbhs5JFYjoZyibkHTKAV/389mSZcS7G4yGUKQIKDFkhF0aAW5fX3yeV47VdMDHUR7 N4fs/I9ogrq+/9PgoJIb3VIyYE1wQzGJgUF2Bm4GH2wfb2rhf2ZIBcIUdD2vBjtWhbVz 4vSXgN2E9M1O1ohfNd41/tV66J0wA8xoLbU9QBFoYCUXvPVCFkF+BphY6NDE6QjykOdD ZXjWU3ybuzUuSEQW5Nu//GTcct4RVi5b6ZltxpFrrznujgito4wbup8/8xzKcf2t9K0U 4ftw== X-Gm-Message-State: APjAAAUCQ5VaTygpJb3fniyH9YdIkBQ+2WDyOSDbPttQY6/hxwS4kcZf WvvVC6R7/VWxTcvtqpn9VBI= X-Google-Smtp-Source: APXvYqzTYsasNQayRM2nLXydOk+hJmtyoXsoit7N2AFCfkwcqCook4x6ElJIboXFRkeIVoP8hTsVxw== X-Received: by 2002:ac2:54b4:: with SMTP id w20mr427722lfk.67.1575315198474; Mon, 02 Dec 2019 11:33:18 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:17 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 07/26] drm/panel: remove get_timings Date: Mon, 2 Dec 2019 20:32:11 +0100 Message-Id: <20191202193230.21310-8-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113320_690788_3ADBC693 X-CRM114-Status: GOOD ( 10.81 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:141 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Laurent Pinchart , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org There was no users - so remove it. The callback was implemented in two drivers - deleted. Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Laurent Pinchart Cc: Sam Ravnborg Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Daniel Vetter Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 18 ------------------ drivers/gpu/drm/panel/panel-simple.c | 18 ------------------ include/drm/drm_panel.h | 9 --------- 3 files changed, 45 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c index b878930b17e4..3bcba64235c4 100644 --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c @@ -217,30 +217,12 @@ static int seiko_panel_get_modes(struct drm_panel *panel, return seiko_panel_get_fixed_modes(p, connector); } -static int seiko_panel_get_timings(struct drm_panel *panel, - unsigned int num_timings, - struct display_timing *timings) -{ - struct seiko_panel *p = to_seiko_panel(panel); - unsigned int i; - - if (p->desc->num_timings < num_timings) - num_timings = p->desc->num_timings; - - if (timings) - for (i = 0; i < num_timings; i++) - timings[i] = p->desc->timings[i]; - - return p->desc->num_timings; -} - static const struct drm_panel_funcs seiko_panel_funcs = { .disable = seiko_panel_disable, .unprepare = seiko_panel_unprepare, .prepare = seiko_panel_prepare, .enable = seiko_panel_enable, .get_modes = seiko_panel_get_modes, - .get_timings = seiko_panel_get_timings, }; static int seiko_panel_probe(struct device *dev, diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index d6299fe6d276..e225791a6fb2 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -326,30 +326,12 @@ static int panel_simple_get_modes(struct drm_panel *panel, return num; } -static int panel_simple_get_timings(struct drm_panel *panel, - unsigned int num_timings, - struct display_timing *timings) -{ - struct panel_simple *p = to_panel_simple(panel); - unsigned int i; - - if (p->desc->num_timings < num_timings) - num_timings = p->desc->num_timings; - - if (timings) - for (i = 0; i < num_timings; i++) - timings[i] = p->desc->timings[i]; - - return p->desc->num_timings; -} - static const struct drm_panel_funcs panel_simple_funcs = { .disable = panel_simple_disable, .unprepare = panel_simple_unprepare, .prepare = panel_simple_prepare, .enable = panel_simple_enable, .get_modes = panel_simple_get_modes, - .get_timings = panel_simple_get_timings, }; #define PANEL_SIMPLE_BOUNDS_CHECK(to_check, bounds, field) \ diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 4fd61cb9eb93..c4e82b9ce586 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -102,15 +102,6 @@ struct drm_panel_funcs { */ int (*get_modes)(struct drm_panel *panel, struct drm_connector *connector); - - /** - * @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); }; /** From patchwork Mon Dec 2 19:32:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269745 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C677C13A4 for ; Mon, 2 Dec 2019 19:37:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78F5320661 for ; Mon, 2 Dec 2019 19:37:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hEJLaOjM"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Df/jOSR/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78F5320661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3Ej2dhDZx4OnhGDl0kRgyhizg0QSFwQOXCani7+fcnw=; b=hEJLaOjMSMadX7 2CM4cOeUHiLo1SWLJeT/pr5g44Kx2lGhyr5KXgT7X88mKTysh7HPXhwNRChPPLdReAI3QnzBim553 M8GILNU0EUz3RoMwcUlBsv3aHtmzaF8JOuVhI5+3+mZrFn0qz6V/yBJopuWYHijFL4VwASYZedS4k HdK5Njckm1f1MJop7VYE6vdqkc12i4LU3plBkpORhU647h4HfxjQ8vT20o7NRgl+xUu8vjm/aDArv fCyzEtLI1DD8Oj5x5WkNWFWrY4NabcUjh4iFskc6+Uv8ToWrYNN0PGAmULSn8mFx3gUPmWVyBixge hPp8eB2Hn+EFyHxLrF6Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrVm-00047S-D8; Mon, 02 Dec 2019 19:37:34 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRi-0007ZG-GK; Mon, 02 Dec 2019 19:33:28 +0000 Received: by mail-lf1-x143.google.com with SMTP id r15so807189lff.2; Mon, 02 Dec 2019 11:33:22 -0800 (PST) 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=cUTzFjSkhPvKIjHfgaW+3dU8qPyEiQhg7QrWSOQxxds=; b=Df/jOSR//JLom2FDd30mlnq/8HoMnWExK6b816JtVTPBGkgbXdYEoeAQmCCo+D6DLu 1AMxozEK7QuZrJqR5eVFnls1AMqjaOBX0Q4QtPqrag2W5Xgp4hN+8Q9WkUki8XJj7/sw HU7pnWG5BBaX+7ks5qve6g7fqfqqmc7MjI7CG9tJ8j3Ybe31ZIvcmh+PmHG4UZM0SKfK 3+WSGvJSMavONUEdR3zTF1+WM+3sDHVC0xbpgvHEGWLlQIDKknEKExjjtrYLDDpdfZpP eQkM/1oz6hk9ULniCqGzTQEC5ftExv1LuiyngDFjllSXlFE0uttBr84gU8Ww79tWxERK DtNg== 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=cUTzFjSkhPvKIjHfgaW+3dU8qPyEiQhg7QrWSOQxxds=; b=YN+cL3S94T+vH6t8pOatc2lTC9k583Av+rlPWwQcF7zQMdLwadEw5ClAaEkcrLMpfB fIzzavenap6yylKtgSE7YyIn6Xlkx59Uet8AxffNGOi5tHLf65S9vQObsBOSM1WqwA6b 5e2gn29TutomtIJRD6XCPQ7f/wBl7CiY8MrXVQckhfN1m2pfw8FRjCKLvFp6iqH5tsbO wyYFQ+m1/aCKN6JodxRyfoD8nTsaSf9335Eykfqjrf7w2G4SeZU1odOWW4tgEUCYx/wB 4IaJLjkBYRbBEDF5KO6bqEoeV5rvzr9OU9q7E+rykDKJ9dDk1LIJRYB32Rsaq6ZpWJQs MhAg== X-Gm-Message-State: APjAAAW/QoNoZZcuTDCTkzhjXW+nJgTt1VuiIrME2CTcATaIoEsa/k0G NDuBbex/lI2x3A4dMTMeDFo= X-Google-Smtp-Source: APXvYqxDivsLTGqUy8E+4QLYOaFwLc0lTC7gki6WbsjLScE0NDfvyPcXclehez7O6GIVOJ4HKvmt5w== X-Received: by 2002:a19:8a41:: with SMTP id m62mr458601lfd.66.1575315200494; Mon, 02 Dec 2019 11:33:20 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:19 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 08/26] drm/panel: drop drm_device from drm_panel Date: Mon, 2 Dec 2019 20:32:12 +0100 Message-Id: <20191202193230.21310-9-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113322_754157_2A1EE7F9 X-CRM114-Status: GOOD ( 15.83 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:143 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Laurent Pinchart , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, Stefan Mavrodiev , linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , Robert Chiras , =?utf-8?q?Guido_G=C3=BCnther?= , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org The panel drivers used drm_panel.drm for two purposes: 1) Argument to drm_mode_duplicate() 2) drm->dev was used in error messages The first usage is replaced with drm_connector.dev - drm_connector is already connected to a drm_device and we have a valid connector The second usage is replaced with drm_panel.dev - this makes drivers more consistent in their dev argument used for dev_err() and friends With these replacements there are no more uses of drm_panel.drm, so it is removed from struct drm_panel. With this change drm_panel_attach() and drm_panel_detach() no logner has any use as they are empty functions. Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Laurent Pinchart Cc: Sam Ravnborg Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Daniel Vetter Cc: Linus Walleij Cc: Jagan Teki Cc: Stefan Mavrodiev Cc: Robert Chiras Cc: "Guido Günther" Cc: Purism Kernel Team Reviewed-by: Laurent Pinchart Reviewed-by: Linus Walleij --- drivers/gpu/drm/drm_panel.c | 6 ------ drivers/gpu/drm/panel/panel-arm-versatile.c | 2 +- .../gpu/drm/panel/panel-feiyang-fy07024di26a30d.c | 2 +- drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 15 ++++++++------- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 2 +- drivers/gpu/drm/panel/panel-innolux-p079zca.c | 6 +++--- drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 2 +- .../gpu/drm/panel/panel-kingdisplay-kd097d04.c | 6 +++--- drivers/gpu/drm/panel/panel-lg-lb035q02.c | 2 +- drivers/gpu/drm/panel/panel-lg-lg4573.c | 4 ++-- drivers/gpu/drm/panel/panel-lvds.c | 2 +- drivers/gpu/drm/panel/panel-nec-nl8048hl11.c | 2 +- drivers/gpu/drm/panel/panel-novatek-nt39016.c | 2 +- .../gpu/drm/panel/panel-olimex-lcd-olinuxino.c | 5 ++--- drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 2 +- .../gpu/drm/panel/panel-osd-osd101t2587-53ts.c | 4 ++-- .../gpu/drm/panel/panel-panasonic-vvx10f034n00.c | 4 ++-- .../gpu/drm/panel/panel-raspberrypi-touchscreen.c | 5 ++--- drivers/gpu/drm/panel/panel-raydium-rm67191.c | 2 +- drivers/gpu/drm/panel/panel-raydium-rm68200.c | 2 +- .../gpu/drm/panel/panel-rocktech-jh057n00900.c | 2 +- drivers/gpu/drm/panel/panel-ronbo-rb070d30.c | 2 +- drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 2 +- drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 2 +- drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c | 2 +- drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 2 +- drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 9 ++++----- drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c | 4 ++-- drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c | 2 +- drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 4 ++-- drivers/gpu/drm/panel/panel-simple.c | 15 ++++++--------- drivers/gpu/drm/panel/panel-sitronix-st7701.c | 2 +- drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 4 ++-- drivers/gpu/drm/panel/panel-sony-acx565akm.c | 2 +- drivers/gpu/drm/panel/panel-tpo-td028ttec1.c | 2 +- drivers/gpu/drm/panel/panel-tpo-td043mtea1.c | 2 +- drivers/gpu/drm/panel/panel-tpo-tpg110.c | 2 +- include/drm/drm_panel.h | 7 ------- 38 files changed, 63 insertions(+), 81 deletions(-) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index fd428b6d25b0..eab79366bf1a 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -113,11 +113,6 @@ EXPORT_SYMBOL(drm_panel_remove); */ int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector) { - if (panel->drm) - return -EBUSY; - - panel->drm = connector->dev; - return 0; } EXPORT_SYMBOL(drm_panel_attach); @@ -134,7 +129,6 @@ EXPORT_SYMBOL(drm_panel_attach); */ void drm_panel_detach(struct drm_panel *panel) { - panel->drm = NULL; } EXPORT_SYMBOL(drm_panel_detach); diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c b/drivers/gpu/drm/panel/panel-arm-versatile.c index 41aa91f60979..41444a73c980 100644 --- a/drivers/gpu/drm/panel/panel-arm-versatile.c +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c @@ -270,7 +270,7 @@ static int versatile_panel_get_modes(struct drm_panel *panel, connector->display_info.height_mm = vpanel->panel_type->height_mm; connector->display_info.bus_flags = vpanel->panel_type->bus_flags; - mode = drm_mode_duplicate(panel->drm, &vpanel->panel_type->mode); + mode = drm_mode_duplicate(connector->dev, &vpanel->panel_type->mode); drm_mode_set_name(mode); mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; diff --git a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c index 37d6b7390954..0157d1844e3e 100644 --- a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c +++ b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c @@ -168,7 +168,7 @@ static int feiyang_get_modes(struct drm_panel *panel, struct feiyang *ctx = panel_to_feiyang(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &feiyang_default_mode); + mode = drm_mode_duplicate(connector->dev, &feiyang_default_mode); if (!mode) { DRM_DEV_ERROR(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n", feiyang_default_mode.hdisplay, diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c index 8fd4c0521841..5717135c9278 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c @@ -645,6 +645,7 @@ static int ili9322_get_modes(struct drm_panel *panel, struct drm_connector *connector) { struct ili9322 *ili = panel_to_ili9322(panel); + struct drm_device *drm = connector->dev; struct drm_display_mode *mode; struct drm_display_info *info; @@ -662,26 +663,26 @@ static int ili9322_get_modes(struct drm_panel *panel, switch (ili->input) { case ILI9322_INPUT_SRGB_DUMMY_320X240: - mode = drm_mode_duplicate(panel->drm, &srgb_320x240_mode); + mode = drm_mode_duplicate(drm, &srgb_320x240_mode); break; case ILI9322_INPUT_SRGB_DUMMY_360X240: - mode = drm_mode_duplicate(panel->drm, &srgb_360x240_mode); + mode = drm_mode_duplicate(drm, &srgb_360x240_mode); break; case ILI9322_INPUT_PRGB_THROUGH: case ILI9322_INPUT_PRGB_ALIGNED: - mode = drm_mode_duplicate(panel->drm, &prgb_320x240_mode); + mode = drm_mode_duplicate(drm, &prgb_320x240_mode); break; case ILI9322_INPUT_YUV_640X320_YCBCR: - mode = drm_mode_duplicate(panel->drm, &yuv_640x320_mode); + mode = drm_mode_duplicate(drm, &yuv_640x320_mode); break; case ILI9322_INPUT_YUV_720X360_YCBCR: - mode = drm_mode_duplicate(panel->drm, &yuv_720x360_mode); + mode = drm_mode_duplicate(drm, &yuv_720x360_mode); break; case ILI9322_INPUT_ITU_R_BT656_720X360_YCBCR: - mode = drm_mode_duplicate(panel->drm, &itu_r_bt_656_720_mode); + mode = drm_mode_duplicate(drm, &itu_r_bt_656_720_mode); break; case ILI9322_INPUT_ITU_R_BT656_640X320_YCBCR: - mode = drm_mode_duplicate(panel->drm, &itu_r_bt_656_640_mode); + mode = drm_mode_duplicate(drm, &itu_r_bt_656_640_mode); break; default: mode = NULL; diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index 1c67a668d6bf..31e5a4e67750 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -393,7 +393,7 @@ static int ili9881c_get_modes(struct drm_panel *panel, struct ili9881c *ctx = panel_to_ili9881c(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &bananapi_default_mode); + mode = drm_mode_duplicate(connector->dev, &bananapi_default_mode); if (!mode) { dev_err(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n", bananapi_default_mode.hdisplay, diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c index facf1bab2532..b9de37a8a0c5 100644 --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c @@ -211,7 +211,7 @@ static int innolux_panel_enable(struct drm_panel *panel) ret = backlight_enable(innolux->backlight); if (ret) { - DRM_DEV_ERROR(panel->drm->dev, + DRM_DEV_ERROR(panel->dev, "Failed to enable backlight %d\n", ret); return ret; } @@ -410,9 +410,9 @@ static int innolux_panel_get_modes(struct drm_panel *panel, const struct drm_display_mode *m = innolux->desc->mode; struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, m); + mode = drm_mode_duplicate(connector->dev, m); if (!mode) { - DRM_DEV_ERROR(panel->drm->dev, "failed to add mode %ux%ux@%u\n", + DRM_DEV_ERROR(panel->dev, "failed to add mode %ux%ux@%u\n", m->hdisplay, m->vdisplay, m->vrefresh); return -ENOMEM; } diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c index e6b650a64fdb..4bfd8c877c8e 100644 --- a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c @@ -307,7 +307,7 @@ static int jdi_panel_get_modes(struct drm_panel *panel, struct jdi_panel *jdi = to_jdi_panel(panel); struct device *dev = &jdi->dsi->dev; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { dev_err(dev, "failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c index e6f53d56daf9..353ee6caa01c 100644 --- a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c +++ b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c @@ -310,7 +310,7 @@ static int kingdisplay_panel_enable(struct drm_panel *panel) ret = backlight_enable(kingdisplay->backlight); if (ret) { - DRM_DEV_ERROR(panel->drm->dev, + DRM_DEV_ERROR(panel->dev, "Failed to enable backlight %d\n", ret); return ret; } @@ -338,9 +338,9 @@ static int kingdisplay_panel_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { - DRM_DEV_ERROR(panel->drm->dev, "failed to add mode %ux%ux@%u\n", + DRM_DEV_ERROR(panel->dev, "failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, default_mode.vrefresh); return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-lg-lb035q02.c b/drivers/gpu/drm/panel/panel-lg-lb035q02.c index 7a3bd4d80c79..e90efeaba4ad 100644 --- a/drivers/gpu/drm/panel/panel-lg-lb035q02.c +++ b/drivers/gpu/drm/panel/panel-lg-lb035q02.c @@ -146,7 +146,7 @@ static int lb035q02_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &lb035q02_mode); + mode = drm_mode_duplicate(connector->dev, &lb035q02_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-lg-lg4573.c b/drivers/gpu/drm/panel/panel-lg-lg4573.c index fc6572b4e2f9..20235ff0bbc4 100644 --- a/drivers/gpu/drm/panel/panel-lg-lg4573.c +++ b/drivers/gpu/drm/panel/panel-lg-lg4573.c @@ -214,9 +214,9 @@ static int lg4573_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { - dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", + dev_err(panel->dev, "failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, default_mode.vrefresh); return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c index f6d58a60e514..5e40b674bb15 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -112,7 +112,7 @@ static int panel_lvds_get_modes(struct drm_panel *panel, struct panel_lvds *lvds = to_panel_lvds(panel); struct drm_display_mode *mode; - mode = drm_mode_create(lvds->panel.drm); + mode = drm_mode_create(connector->dev); if (!mode) return 0; diff --git a/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c b/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c index a6ccdb09aace..c4f83f6384e1 100644 --- a/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c +++ b/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c @@ -128,7 +128,7 @@ static int nl8048_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &nl8048_mode); + mode = drm_mode_duplicate(connector->dev, &nl8048_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-novatek-nt39016.c b/drivers/gpu/drm/panel/panel-novatek-nt39016.c index 91ea49c05611..a470810f7dbe 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt39016.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt39016.c @@ -213,7 +213,7 @@ static int nt39016_get_modes(struct drm_panel *drm_panel, const struct nt39016_panel_info *panel_info = panel->panel_info; struct drm_display_mode *mode; - mode = drm_mode_duplicate(drm_panel->drm, &panel_info->display_mode); + mode = drm_mode_duplicate(connector->dev, &panel_info->display_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c b/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c index 2b7e0dfebc5e..e553e584399b 100644 --- a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c +++ b/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c @@ -146,7 +146,6 @@ static int lcd_olinuxino_get_modes(struct drm_panel *panel, { struct lcd_olinuxino *lcd = to_lcd_olinuxino(panel); struct lcd_olinuxino_info *lcd_info = &lcd->eeprom.info; - struct drm_device *drm = lcd->panel.drm; struct lcd_olinuxino_mode *lcd_mode; struct drm_display_mode *mode; u32 i, num = 0; @@ -155,9 +154,9 @@ static int lcd_olinuxino_get_modes(struct drm_panel *panel, lcd_mode = (struct lcd_olinuxino_mode *) &lcd->eeprom.reserved[i * sizeof(*lcd_mode)]; - mode = drm_mode_create(drm); + mode = drm_mode_create(connector->dev); if (!mode) { - dev_err(drm->dev, "failed to add mode %ux%u@%u\n", + dev_err(panel->dev, "failed to add mode %ux%u@%u\n", lcd_mode->hactive, lcd_mode->vactive, lcd_mode->refresh); diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c index 4e1606c79072..bb0c992171e8 100644 --- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c +++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c @@ -354,7 +354,7 @@ static int otm8009a_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { DRM_ERROR("failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c b/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c index b3e010288c10..2734b4835dfa 100644 --- a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c +++ b/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c @@ -118,9 +118,9 @@ static int osd101t2587_panel_get_modes(struct drm_panel *panel, struct osd101t2587_panel *osd101t2587 = ti_osd_panel(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, osd101t2587->default_mode); + mode = drm_mode_duplicate(connector->dev, osd101t2587->default_mode); if (!mode) { - dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", + dev_err(panel->dev, "failed to add mode %ux%ux@%u\n", osd101t2587->default_mode->hdisplay, osd101t2587->default_mode->vdisplay, osd101t2587->default_mode->vrefresh); diff --git a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c index 19a6eb4637c8..579ac0d86ea4 100644 --- a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +++ b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c @@ -171,9 +171,9 @@ static int wuxga_nt_panel_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { - dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", + dev_err(panel->dev, "failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, default_mode.vrefresh); return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c index 732b7111395e..7d8bc12a3008 100644 --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c @@ -314,7 +314,6 @@ static int rpi_touchscreen_enable(struct drm_panel *panel) static int rpi_touchscreen_get_modes(struct drm_panel *panel, struct drm_connector *connector) { - struct drm_device *drm = panel->drm; unsigned int i, num = 0; static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; @@ -322,9 +321,9 @@ static int rpi_touchscreen_get_modes(struct drm_panel *panel, const struct drm_display_mode *m = &rpi_touchscreen_modes[i]; struct drm_display_mode *mode; - mode = drm_mode_duplicate(drm, m); + mode = drm_mode_duplicate(connector->dev, m); if (!mode) { - dev_err(drm->dev, "failed to add mode %ux%u@%u\n", + dev_err(panel->dev, "failed to add mode %ux%u@%u\n", m->hdisplay, m->vdisplay, m->vrefresh); continue; } diff --git a/drivers/gpu/drm/panel/panel-raydium-rm67191.c b/drivers/gpu/drm/panel/panel-raydium-rm67191.c index 123bb68cfcb7..313637d53d28 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm67191.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm67191.c @@ -441,7 +441,7 @@ static int rad_panel_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { DRM_DEV_ERROR(panel->dev, "failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-raydium-rm68200.c b/drivers/gpu/drm/panel/panel-raydium-rm68200.c index 66fa975308ec..d6a03328e594 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm68200.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm68200.c @@ -340,7 +340,7 @@ static int rm68200_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { DRM_ERROR("failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c index b2d61cab3cad..3a4f1c0fce86 100644 --- a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c +++ b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c @@ -236,7 +236,7 @@ static int jh057n_get_modes(struct drm_panel *panel, struct jh057n *ctx = panel_to_jh057n(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { DRM_DEV_ERROR(ctx->dev, "Failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c b/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c index 57a462ce221e..746a3a221100 100644 --- a/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c +++ b/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c @@ -127,7 +127,7 @@ static int rb070d30_panel_get_modes(struct drm_panel *panel, struct drm_display_mode *mode; static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { DRM_DEV_ERROR(&ctx->dsi->dev, "Failed to add mode " DRM_MODE_FMT "\n", diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c index 71939ab757b1..2150043dcf6b 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c @@ -148,7 +148,7 @@ static int s6d16d0_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &samsung_s6d16d0_mode); + mode = drm_mode_duplicate(connector->dev, &samsung_s6d16d0_mode); if (!mode) { DRM_ERROR("bad mode or failed to add mode\n"); return -EINVAL; diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c index 8e0236ba6145..36ebd5a4ac7b 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c @@ -651,7 +651,7 @@ static int s6e3ha2_get_modes(struct drm_panel *panel, struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, ctx->desc->mode); + mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); if (!mode) { DRM_ERROR("failed to add mode %ux%ux@%u\n", ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c index c939d5bde4f0..a3570e0a90a8 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c @@ -405,7 +405,7 @@ static int s6e63j0x03_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { DRM_ERROR("failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c index 1d099092e754..a5f76eb4fa25 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c @@ -367,7 +367,7 @@ static int s6e63m0_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { DRM_ERROR("failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c index 3bcba64235c4..4b345a242b3f 100644 --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c @@ -59,7 +59,6 @@ static inline struct seiko_panel *to_seiko_panel(struct drm_panel *panel) static int seiko_panel_get_fixed_modes(struct seiko_panel *panel, struct drm_connector *connector) { - struct drm_device *drm = panel->base.drm; struct drm_display_mode *mode; unsigned int i, num = 0; @@ -71,9 +70,9 @@ static int seiko_panel_get_fixed_modes(struct seiko_panel *panel, struct videomode vm; videomode_from_timing(dt, &vm); - mode = drm_mode_create(drm); + mode = drm_mode_create(connector->dev); if (!mode) { - dev_err(drm->dev, "failed to add mode %ux%u\n", + dev_err(panel->base.dev, "failed to add mode %ux%u\n", dt->hactive.typ, dt->vactive.typ); continue; } @@ -92,9 +91,9 @@ static int seiko_panel_get_fixed_modes(struct seiko_panel *panel, for (i = 0; i < panel->desc->num_modes; i++) { const struct drm_display_mode *m = &panel->desc->modes[i]; - mode = drm_mode_duplicate(drm, m); + mode = drm_mode_duplicate(connector->dev, m); if (!mode) { - dev_err(drm->dev, "failed to add mode %ux%u@%u\n", + dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n", m->hdisplay, m->vdisplay, m->vrefresh); continue; } diff --git a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c index e797b700661a..17d406f49c3d 100644 --- a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c +++ b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c @@ -283,9 +283,9 @@ static int sharp_panel_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { - dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", + dev_err(panel->dev, "failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, default_mode.vrefresh); return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c b/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c index 7103a945f0e8..1cf3f02435c1 100644 --- a/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c +++ b/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c @@ -105,7 +105,7 @@ static int ls037v7dw01_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &ls037v7dw01_mode); + mode = drm_mode_duplicate(connector->dev, &ls037v7dw01_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c index 85ae6cffdbfb..7995cf5a9fc4 100644 --- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c +++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c @@ -215,9 +215,9 @@ static int sharp_nt_panel_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { - dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", + dev_err(panel->dev, "failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, default_mode.vrefresh); return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index e225791a6fb2..73e00288c00c 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -120,7 +120,6 @@ static inline struct panel_simple *to_panel_simple(struct drm_panel *panel) static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel, struct drm_connector *connector) { - struct drm_device *drm = panel->base.drm; struct drm_display_mode *mode; unsigned int i, num = 0; @@ -129,9 +128,9 @@ static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel, struct videomode vm; videomode_from_timing(dt, &vm); - mode = drm_mode_create(drm); + mode = drm_mode_create(connector->dev); if (!mode) { - dev_err(drm->dev, "failed to add mode %ux%u\n", + dev_err(panel->base.dev, "failed to add mode %ux%u\n", dt->hactive.typ, dt->vactive.typ); continue; } @@ -153,16 +152,15 @@ static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel, static unsigned int panel_simple_get_display_modes(struct panel_simple *panel, struct drm_connector *connector) { - struct drm_device *drm = panel->base.drm; struct drm_display_mode *mode; unsigned int i, num = 0; for (i = 0; i < panel->desc->num_modes; i++) { const struct drm_display_mode *m = &panel->desc->modes[i]; - mode = drm_mode_duplicate(drm, m); + mode = drm_mode_duplicate(connector->dev, m); if (!mode) { - dev_err(drm->dev, "failed to add mode %ux%u@%u\n", + dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n", m->hdisplay, m->vdisplay, m->vrefresh); continue; } @@ -184,7 +182,6 @@ static unsigned int panel_simple_get_display_modes(struct panel_simple *panel, static int panel_simple_get_non_edid_modes(struct panel_simple *panel, struct drm_connector *connector) { - struct drm_device *drm = panel->base.drm; struct drm_display_mode *mode; bool has_override = panel->override_mode.type; unsigned int num = 0; @@ -193,12 +190,12 @@ static int panel_simple_get_non_edid_modes(struct panel_simple *panel, return 0; if (has_override) { - mode = drm_mode_duplicate(drm, &panel->override_mode); + mode = drm_mode_duplicate(connector->dev, &panel->override_mode); if (mode) { drm_mode_probed_add(connector, mode); num = 1; } else { - dev_err(drm->dev, "failed to add override mode\n"); + dev_err(panel->base.dev, "failed to add override mode\n"); } } diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c index 3ed3b1d6d82d..c08a865a2a93 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c @@ -271,7 +271,7 @@ static int st7701_get_modes(struct drm_panel *panel, const struct drm_display_mode *desc_mode = st7701->desc->mode; struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, desc_mode); + mode = drm_mode_duplicate(connector->dev, desc_mode); if (!mode) { DRM_DEV_ERROR(&st7701->dsi->dev, "failed to add mode %ux%ux@%u\n", diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index 836b01331505..ebefe2f4c26b 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -175,9 +175,9 @@ static int st7789v_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { - dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", + dev_err(panel->dev, "failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, default_mode.vrefresh); return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-sony-acx565akm.c b/drivers/gpu/drm/panel/panel-sony-acx565akm.c index 841dc73c443d..5c4b6f6e5c2d 100644 --- a/drivers/gpu/drm/panel/panel-sony-acx565akm.c +++ b/drivers/gpu/drm/panel/panel-sony-acx565akm.c @@ -526,7 +526,7 @@ static int acx565akm_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &acx565akm_mode); + mode = drm_mode_duplicate(connector->dev, &acx565akm_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c b/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c index 5230176bd8e6..37252590b541 100644 --- a/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c +++ b/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c @@ -292,7 +292,7 @@ static int td028ttec1_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &td028ttec1_mode); + mode = drm_mode_duplicate(connector->dev, &td028ttec1_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c b/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c index 716f8ed1cc45..75f1f1f1b6de 100644 --- a/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c +++ b/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c @@ -351,7 +351,7 @@ static int td043mtea1_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &td043mtea1_mode); + mode = drm_mode_duplicate(connector->dev, &td043mtea1_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-tpo-tpg110.c b/drivers/gpu/drm/panel/panel-tpo-tpg110.c index e74cd9d418cf..bee213ea1a42 100644 --- a/drivers/gpu/drm/panel/panel-tpo-tpg110.c +++ b/drivers/gpu/drm/panel/panel-tpo-tpg110.c @@ -394,7 +394,7 @@ static int tpg110_get_modes(struct drm_panel *panel, connector->display_info.height_mm = tpg->height; connector->display_info.bus_flags = tpg->panel_mode->bus_flags; - mode = drm_mode_duplicate(panel->drm, &tpg->panel_mode->mode); + mode = drm_mode_duplicate(connector->dev, &tpg->panel_mode->mode); drm_mode_set_name(mode); mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index c4e82b9ce586..95e941c31c3b 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -108,13 +108,6 @@ struct drm_panel_funcs { * struct drm_panel - DRM panel object */ struct drm_panel { - /** - * @drm: - * - * DRM device owning the panel. - */ - struct drm_device *drm; - /** * @dev: * From patchwork Mon Dec 2 19:32:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269747 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 21F36109A for ; Mon, 2 Dec 2019 19:37:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F3E9320661 for ; Mon, 2 Dec 2019 19:37:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YfyXzLju"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eLSVwBKz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3E9320661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CNqL/1LZnGKpXuKv1EK3DXVK0Fc9q0/fQhLznrusqy4=; b=YfyXzLjuQjWYBG adct/aFFDQ8T9Kopm6QMdhuEkE4awoFaDKomUsHE9QPA2dVLW70/DO9W/honrZMDpBWg1R4R++ko3 67z9P3eTmglmozrzYq8uebw7VTRdsVHnUkxvrps6hVoemcMw9MBFOAv/MaodEy4lDANofCUqsVcMb a0DOY2P7m9eNPOhQlW9K5lInRKzOYxn/Fh6vC9SOgYptsdCDREQqkOa+KluLRV5VGpAR9nUIUT6Kw 7cXDp8X/0JYkq9WGQ4Bo34YfW/DUXuS3ntq+0TYJBYDU/iY8x+gleO8pcGYpxECmqQXrwiHLFZm3D WriQAoDJf0dHmHL4m6dg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrVs-0004C2-Sy; Mon, 02 Dec 2019 19:37:40 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRk-0007ap-55; Mon, 02 Dec 2019 19:33:28 +0000 Received: by mail-lj1-x243.google.com with SMTP id h23so806070ljc.8; Mon, 02 Dec 2019 11:33:23 -0800 (PST) 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=2Y1mqiAE5RcwUiFVegDkD/kI5NKO3CN9zEHEAS4n6tI=; b=eLSVwBKzRfmXzJ69INKynMpE4N+QQ7C9joHALFYJRJTjHtsbtAjm27xqORSgSJupcp S0nGdqqVn2kkSardiQERm/a90jeAPPwGzVanVoD35JhitHcJH53uxrfd7S2Zi58vhbzD FUorU2ibBmatCrIxrMQB+K6o40M7+/0VcP3JSzDRyM1/xNcRLTV/gvQg2ucde6SD5EbP KLhChZtOknbLmrQ7u8kIrf6AmS0NqVBWY/0VOEMtArY1WWLoUolWQKGFBK/eWf8pcYxE TmnkPIOHMXGihWqlXSE1d4uJJhE7omNjuBNqZznXzaSsMk2nsVlWG+zqWOJ3mzb1lva1 xjvw== 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=2Y1mqiAE5RcwUiFVegDkD/kI5NKO3CN9zEHEAS4n6tI=; b=ehxjSyJ3/rRFCTFHW5vmMyZgsyt+KRB7iZXGYMx7Y/BZjI/vjxwFg+OywtD+Y6wjj1 +j734jmajWLoiYxXHZfKhgFpubT6cNSlojIA2rvsOUhF3Mhi0+dyv4ByJjjdpSN+rHde TKDqExaoTNonprfciYJWG8HV9G27sOFxkh0mPZCRRTZe7WlWiEnBpKYyS1Mex3DWU/Sa AO6isaNBdaVvN4fGwuY5FrwZYtW0RNI9dg4maf7YV9L4DemqcWUdHq8Ymxu47u3HGM8k sGxs20OH2LfRCkuuDXnJVxIIoWd+BlGM6/AZW2UJCDkX7Oa9P0rEq7b57SagGIz8qO59 lBQA== X-Gm-Message-State: APjAAAXUJgGZUm9vhQvo10n3GfT4oHxCtNM27wSKRzyoA0uhbo8f7CY4 MGikg+7PIS9Sq4eeF7aQEdo= X-Google-Smtp-Source: APXvYqxkxVmRA7p6+jFuEl6sc6enaU4TOldkVPnjP/5gpD+fwCWFbaI2otg2zdXHDExHl1Fmyas7wg== X-Received: by 2002:a2e:81c7:: with SMTP id s7mr265078ljg.3.1575315202212; Mon, 02 Dec 2019 11:33:22 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:21 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 09/26] drm/panel: feiyang-fy07024di26a30d: use drm_panel backlight support Date: Mon, 2 Dec 2019 20:32:13 +0100 Message-Id: <20191202193230.21310-10-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113325_757800_2CC3FC35 X-CRM114-Status: GOOD ( 12.12 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Cc: Jagan Teki Cc: Thierry Reding Cc: Sam Ravnborg --- drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c index 0157d1844e3e..95b789ab9d29 100644 --- a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c +++ b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c @@ -9,7 +9,6 @@ #include #include -#include #include #include #include @@ -22,7 +21,6 @@ struct feiyang { struct drm_panel panel; struct mipi_dsi_device *dsi; - struct backlight_device *backlight; struct regulator *dvdd; struct regulator *avdd; struct gpio_desc *reset; @@ -102,7 +100,6 @@ static int feiyang_enable(struct drm_panel *panel) msleep(200); mipi_dsi_dcs_set_display_on(ctx->dsi); - backlight_enable(ctx->backlight); return 0; } @@ -111,7 +108,6 @@ static int feiyang_disable(struct drm_panel *panel) { struct feiyang *ctx = panel_to_feiyang(panel); - backlight_disable(ctx->backlight); return mipi_dsi_dcs_set_display_off(ctx->dsi); } @@ -225,9 +221,9 @@ static int feiyang_dsi_probe(struct mipi_dsi_device *dsi) return PTR_ERR(ctx->reset); } - ctx->backlight = devm_of_find_backlight(&dsi->dev); - if (IS_ERR(ctx->backlight)) - return PTR_ERR(ctx->backlight); + ret = drm_panel_of_backlight(&ctx->panel); + if (ret) + return ret; ret = drm_panel_add(&ctx->panel); if (ret < 0) From patchwork Mon Dec 2 19:32:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269749 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13C5413A4 for ; Mon, 2 Dec 2019 19:37:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E328420661 for ; Mon, 2 Dec 2019 19:37:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RWc9aXDN"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="frMI18ND" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E328420661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EsZ+n1/UkuslRZWBafWThQ34GgvPlV9CWyaN532tzf8=; b=RWc9aXDNrpvUqD y0dVoCzjF4cAD0FMx/GRs3OV92voZCBsehdNFB1hS/N0yEW4EIOUds692UxaQjKZ7ZYC3Z8ltiJDE NljOeZXWXTBpg7oBdcY9aOSiO0BapcgzYP0HCt8HN1rp06KEz3Z5CMiYGNgcbCrmiU1/yz8Kc/HcY IWdSQv7qw4fs5Xj+TCsPVYuBkCkMXrM6RCMNmrkFO/hPTcY2d+fWQroBwRti5oWSjQzXKz3J0hAYQ IjLTT9I37hoiX3l542wGVHQn7lFBdgNTGMalbALSpjwgMaK9IJIRmwYryqH2CdgPlpYa+FPXqj40g J4Tb/Ov6JH2ajA1UrMPg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrVx-0004FL-1Q; Mon, 02 Dec 2019 19:37:45 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRl-0007bp-9B; Mon, 02 Dec 2019 19:33:30 +0000 Received: by mail-lj1-x242.google.com with SMTP id m6so868476ljc.1; Mon, 02 Dec 2019 11:33:25 -0800 (PST) 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=SZWMV+Yn1n2qxRJClXssw0x9jjzxt8p36cqP16qYlFw=; b=frMI18ND0CrGpRVoz0OF84/PH36Owh77oBXHkdHxFAhthah1O0rNVYydhRQb7d6viP BCk+dD/GzECwi/F2n2DqleQS893D3L2lqkpbbYK95/S/TIv4XagcmzI9eAo5q4uRuQg0 xzhWOqXqvMgPDG5cYICG3bapo4zCav/4T+Idmji0shD088h5xUCqyDVlZ+zxlkn8tIGx a9ZHWmSRGNggrqIV3w7Q/5tL1+kql/xXrReYl5u34OrzQgWnRXjkGuFAd0M1X2aHk0B+ eG8VKd22Sio2oqOYiybikcVPNtv+psbbAuVYKAjE7br9TYNcnyCgpNhutdtXJUOxwbc8 CkPA== 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=SZWMV+Yn1n2qxRJClXssw0x9jjzxt8p36cqP16qYlFw=; b=D8Hg6h71oRvC3CeJ2WiLBv1hckaTF84NeEpRC4t2U+wVYyDzujdzMt1k2fyXb/neur hsTyQVq09nnUhsO0jfafKjoyW+9QqxVHenQ1us5QLiYg7wzO6juuKWCWnPDQFL3VC/Mj dUPCpV5cIibp5e4Ln6YQMgaaeK/AI2yZQjKys4d5UNP1su7DftO7Gr8P1BZQejdahu5A gXexPT1Bgd3UpSbk58sMziiQa6R+CBXPFhb5kquooscQFQr/MdL1WsE4C5X98xgH0FYr z8HOE7xHgLPbtSFbD8+HLvlK0tWK1nd0HmJBa03Ve+WES5V7JZILgwVozibRQ82S4dw4 cIjA== X-Gm-Message-State: APjAAAWIsHUlnH14yAesb1QvZ+LtSZ064RfNnHn9iWjSkRCb+fyBtwnn HZQ3qgwdrkf4w1rxRjjnPcs= X-Google-Smtp-Source: APXvYqyXXdCnUTLi1SoZH1pKdgl0Vb/3Bp3QBgnJto+WVAY2jbGBVOdB3Q4OelNXtyNkSlqln2bYfQ== X-Received: by 2002:a2e:89c6:: with SMTP id c6mr264410ljk.113.1575315203864; Mon, 02 Dec 2019 11:33:23 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:23 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 10/26] drm/panel: ilitek-ili9881c: use drm_panel backlight support Date: Mon, 2 Dec 2019 20:32:14 +0100 Message-Id: <20191202193230.21310-11-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113326_195737_EDD6DF41 X-CRM114-Status: GOOD ( 13.07 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Sam Ravnborg --- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index 31e5a4e67750..f54077c216a3 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -3,7 +3,6 @@ * Copyright (C) 2017-2018, Bootlin */ -#include #include #include #include @@ -25,7 +24,6 @@ struct ili9881c { struct drm_panel panel; struct mipi_dsi_device *dsi; - struct backlight_device *backlight; struct regulator *power; struct gpio_desc *reset; }; @@ -348,7 +346,6 @@ static int ili9881c_enable(struct drm_panel *panel) msleep(120); mipi_dsi_dcs_set_display_on(ctx->dsi); - backlight_enable(ctx->backlight); return 0; } @@ -357,7 +354,6 @@ static int ili9881c_disable(struct drm_panel *panel) { struct ili9881c *ctx = panel_to_ili9881c(panel); - backlight_disable(ctx->backlight); return mipi_dsi_dcs_set_display_off(ctx->dsi); } @@ -423,7 +419,6 @@ static const struct drm_panel_funcs ili9881c_funcs = { static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) { - struct device_node *np; struct ili9881c *ctx; int ret; @@ -448,14 +443,9 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) return PTR_ERR(ctx->reset); } - np = of_parse_phandle(dsi->dev.of_node, "backlight", 0); - if (np) { - ctx->backlight = of_find_backlight_by_node(np); - of_node_put(np); - - if (!ctx->backlight) - return -EPROBE_DEFER; - } + ret = drm_panel_of_backlight(&ctx->panel); + if (ret) + return ret; ret = drm_panel_add(&ctx->panel); if (ret < 0) @@ -475,9 +465,6 @@ static int ili9881c_dsi_remove(struct mipi_dsi_device *dsi) mipi_dsi_detach(dsi); drm_panel_remove(&ctx->panel); - if (ctx->backlight) - put_device(&ctx->backlight->dev); - return 0; } From patchwork Mon Dec 2 19:32:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269753 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC6B8109A for ; Mon, 2 Dec 2019 19:38:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B99EA20661 for ; Mon, 2 Dec 2019 19:38:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Yzt+x4gx"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qLmPiWAo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B99EA20661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bIiISQmDU+BQcPYJxipbWJCut7YUImZqFxkuix98TA8=; b=Yzt+x4gxac5bFU JTqwaD31ufFdWfGiqQDCG820oHnGoV0dauhIGru6Gbane0AglOb9PrTk11RKx8e1aLbcDChPoaUqP m/kyYc3X6ZwLHMs235JkIQGvbSWAUiqsJmgqG4LySfKX4C97oLuX5poO324QjbYkvB5BIv0ALV3lM +0OJMAPQl0yQGUs5Xunn127u9geE22nZPIAX2RBD4BFmcHQHFG0npxDJrZWQnPXCPcv2s1hGxVEbP LS6JhQ4waG/NvQL8wyjyDPPyMw78UOh9U0aBIx34UulRied6jyDLltsTP+pExOtUkf/F4sS14jf1/ 24UtWHrDu6gawwpdO/nQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrWK-0004bW-Uy; Mon, 02 Dec 2019 19:38:08 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRo-0007dk-Jc; Mon, 02 Dec 2019 19:33:31 +0000 Received: by mail-lj1-x241.google.com with SMTP id e28so799483ljo.9; Mon, 02 Dec 2019 11:33:28 -0800 (PST) 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=Cxn0Dcc3ud33ZBWmj1R8mFjw49Jkrh1PBlMx23F/Da8=; b=qLmPiWAobxUJw64smnCCOogyLzv7N8HXUOD52nBOHcR1TbPQWz2CjYMaJeV9hZxMFp IhWr7KlnrQcRyiWqkQcP/lO7bfilF2ldyM2yoCfL+Q7ZsS9U15XSasotNs3SmwowTNHD X88J9ufOwalKfq2JTZrtLQn19ZukH2S+PVaIi/Rjvl1vT+JwcieCQUGRUXkOXySRQm6g JEsBt9jRS2lKLzVVxfkEWHko76+T+y2P5ZsWwY1QfVcXWBsQB7ZQfBD18vTommfNs6/h lZJSs9I6X9WB28WLqTUZhd9cw1wIcWJ151gIqbrWpe7y3D5gdKBHo+L/0QP6i0MFFOyd OTXg== 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=Cxn0Dcc3ud33ZBWmj1R8mFjw49Jkrh1PBlMx23F/Da8=; b=QITDI+xXq3c1mjulzmYuSEcZvtAX7LqSpvRoavLi+3u3gWRZ+UwLZbPW3Q68JR8p1D DV2EDqQ6AryWhvnYGiM9dSOir9WbqKCabe+qcGlbMjRMaZKc/yECujBkbfacWBpRoHit D8DfSqiRZ7Y1qEsrKPRL18VV3bq4KxaVO+m3HFCU6cYS4Lzu+wvYewhg+BEpVKV0IyfS 5v5++Y+9LML9ONr5lIiW5SVfDXRDNX0r75+3+HYljaQot8FvK0XuqAPf1/q2KdS+OKiX 7GwjUHTddXEYwtxAfNVHYgRiv99Pq149FboyGBh4e9wSynlMO/daYnid/bguM9kj/F1n gpHw== X-Gm-Message-State: APjAAAX1fr4RR0Pqv3ftwSE4A5uDZdP2/+AAPfEgldfOHiqv07aVrVW0 Lvj1PRnFaAnnFHnyM+EPz0Y= X-Google-Smtp-Source: APXvYqz/FMOrR16VQIW0JGwmevwl6PeUROPkg5uiylseK6QdXCQ6GjK97RCcja1bW2oF1wD3BFSBmw== X-Received: by 2002:a05:651c:1064:: with SMTP id y4mr271748ljm.168.1575315205934; Mon, 02 Dec 2019 11:33:25 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:25 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 11/26] drm/panel: innolux-p079zca: use drm_panel backlight support Date: Mon, 2 Dec 2019 20:32:15 +0100 Message-Id: <20191202193230.21310-12-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113328_714223_8C6C52D1 X-CRM114-Status: GOOD ( 12.28 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Sam Ravnborg --- drivers/gpu/drm/panel/panel-innolux-p079zca.c | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c index b9de37a8a0c5..7419f1f0acee 100644 --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c @@ -3,7 +3,6 @@ * Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd */ -#include #include #include #include @@ -52,7 +51,6 @@ struct innolux_panel { struct mipi_dsi_device *link; const struct panel_desc *desc; - struct backlight_device *backlight; struct regulator_bulk_data *supplies; struct gpio_desc *enable_gpio; @@ -72,8 +70,6 @@ static int innolux_panel_disable(struct drm_panel *panel) if (!innolux->enabled) return 0; - backlight_disable(innolux->backlight); - innolux->enabled = false; return 0; @@ -204,18 +200,10 @@ static int innolux_panel_prepare(struct drm_panel *panel) static int innolux_panel_enable(struct drm_panel *panel) { struct innolux_panel *innolux = to_innolux_panel(panel); - int ret; if (innolux->enabled) return 0; - ret = backlight_enable(innolux->backlight); - if (ret) { - DRM_DEV_ERROR(panel->dev, - "Failed to enable backlight %d\n", ret); - return ret; - } - innolux->enabled = true; return 0; @@ -482,13 +470,13 @@ static int innolux_panel_add(struct mipi_dsi_device *dsi, innolux->enable_gpio = NULL; } - innolux->backlight = devm_of_find_backlight(dev); - if (IS_ERR(innolux->backlight)) - return PTR_ERR(innolux->backlight); - drm_panel_init(&innolux->base, dev, &innolux_panel_funcs, DRM_MODE_CONNECTOR_DSI); + err = drm_panel_of_backlight(&innolux->base); + if (err) + return err; + err = drm_panel_add(&innolux->base); if (err < 0) return err; @@ -526,12 +514,12 @@ static int innolux_panel_remove(struct mipi_dsi_device *dsi) struct innolux_panel *innolux = mipi_dsi_get_drvdata(dsi); int err; - err = innolux_panel_unprepare(&innolux->base); + err = drm_panel_unprepare(&innolux->base); if (err < 0) DRM_DEV_ERROR(&dsi->dev, "failed to unprepare panel: %d\n", err); - err = innolux_panel_disable(&innolux->base); + err = drm_panel_disable(&innolux->base); if (err < 0) DRM_DEV_ERROR(&dsi->dev, "failed to disable panel: %d\n", err); @@ -549,8 +537,8 @@ static void innolux_panel_shutdown(struct mipi_dsi_device *dsi) { struct innolux_panel *innolux = mipi_dsi_get_drvdata(dsi); - innolux_panel_unprepare(&innolux->base); - innolux_panel_disable(&innolux->base); + drm_panel_unprepare(&innolux->base); + drm_panel_disable(&innolux->base); } static struct mipi_dsi_driver innolux_panel_driver = { From patchwork Mon Dec 2 19:32:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269763 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B223913A4 for ; Mon, 2 Dec 2019 19:39:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F7E020661 for ; Mon, 2 Dec 2019 19:39:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ovxhgy6v"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sddcI5js" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F7E020661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CQzi+zhyKETRwZm7fWjGO21qodqJjYBLEPP+SVKbiiU=; b=ovxhgy6v0PEx7V /HeC5ejXKjWBrupj3Poel10iF04AnRYP01rJdL+gjZ9HI0X1pH78TwJrlayl/jHFg1Aj1fSU/XU0I 2ByFq4+NSLOeeMozDocWdd0v2LkIaSQSFW1TpdSj8A5w5kfPsECqvL3bZQm/MTMeukeSL8/zNsmLR a7kr4O9J3yWByMR+nlvXtlVxXZ1vnxxbckWVV/RBcpb2JmZm7FWav3RlzQs1zjeYkzHv153vDUZdC c+8e6bZM0+MmCLjz8q2PzMcnS+3r8kb1XYqoWuvh+3WmM70wR5pdIuVAu4zXZ4kDQwpKYcOmoR6j5 V8qrPCWK0x9OPs9ccn/Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrXB-0005Pb-V5; Mon, 02 Dec 2019 19:39:01 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRp-0007eZ-KN; Mon, 02 Dec 2019 19:33:35 +0000 Received: by mail-lj1-x241.google.com with SMTP id s22so826294ljs.7; Mon, 02 Dec 2019 11:33:29 -0800 (PST) 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=ziacaDT5ojzWXLyawunTmtP2RY8dGuryn8kq/1BtKS0=; b=sddcI5jsaMfWn/78NbEh1ItFa3htles17a7S2GxuBnfw8EGrqWdQq7HkZHjqJsWvut VDGhwKNOs1pB6+2hSoNc2Fy2/J9jzTBQrmOb5sEwxK9MZJN+ydX4fCPg+t7aD1qKpkjo yysZG995mtrjjGPHCESf/q/8KceeZ5wnp6IMEmhZzcCag438p650Fn3bpikZtooCDOPP Ua3HwNS8A6DCrNhqO/b40VgQYJiJLttWNgb6bEX7jsLZ7tLx1hu5f50E51pgUTHh2gFL bVk46NLX3t5W/tDxiZ9YYAY8yqZxCBR7u8spRmvuAKL7fBjVd+US3HBR9HtQpkxcj63h pSIQ== 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=ziacaDT5ojzWXLyawunTmtP2RY8dGuryn8kq/1BtKS0=; b=eomW6Xb3qVt/m80v+YyA1rAJdbf75ptoJKiWagkYierkLa08ZdmY4KGS6InPQ7ywu0 lg/7X9ktaV5D2KQxcKwEpPQwvzwcQfg7yIdI4pTPW2yGRcZxWVBmX9gl9Or1GxrKDl7o fOnbmP2i3B5aO/167dLDU4x9c/wzu1VS7Ou4hAW6dmPGDdu8zne4QlhbPer0tywuEEdp AbAYako3Ri1gEiI7lHeFMQ3IK1D6JiODuSlJPrx1cIVbNSQDFD8YPFoA/QaBEGoeHH7Y 87K7RrLll03dd5/36qrBBOO2uI9IASJf3s4tGjUI+aRqeuUJ/gnye0JEzhqNaa2qUjx2 MeLA== X-Gm-Message-State: APjAAAXrufXRfhUSl9aXosMzmZWzNldBI4pnanRDxyGPeo1XeC4gG345 uOWhocWK16agtTnc3KDKLUA= X-Google-Smtp-Source: APXvYqwu5DjS+1a3b7ZBEWBw4hcW7WJdhp41DTTVhmMuxsDxpn8LvqwTqvwr8F6v3F4KQxwRHBv+sg== X-Received: by 2002:a2e:9110:: with SMTP id m16mr278458ljg.140.1575315208043; Mon, 02 Dec 2019 11:33:28 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:27 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 12/26] drm/panel: kingdisplay-kd097d04: use drm_panel backlight support Date: Mon, 2 Dec 2019 20:32:16 +0100 Message-Id: <20191202193230.21310-13-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113330_327869_D7C77225 X-CRM114-Status: GOOD ( 12.61 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Sam Ravnborg --- .../drm/panel/panel-kingdisplay-kd097d04.c | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c index 353ee6caa01c..bac1a2a06c92 100644 --- a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c +++ b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c @@ -3,7 +3,6 @@ * Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd */ -#include #include #include #include @@ -23,7 +22,6 @@ struct kingdisplay_panel { struct drm_panel base; struct mipi_dsi_device *link; - struct backlight_device *backlight; struct regulator *supply; struct gpio_desc *enable_gpio; @@ -191,8 +189,6 @@ static int kingdisplay_panel_disable(struct drm_panel *panel) if (!kingdisplay->enabled) return 0; - backlight_disable(kingdisplay->backlight); - err = mipi_dsi_dcs_set_display_off(kingdisplay->link); if (err < 0) DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n", @@ -303,18 +299,10 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel) static int kingdisplay_panel_enable(struct drm_panel *panel) { struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel); - int ret; if (kingdisplay->enabled) return 0; - ret = backlight_enable(kingdisplay->backlight); - if (ret) { - DRM_DEV_ERROR(panel->dev, - "Failed to enable backlight %d\n", ret); - return ret; - } - kingdisplay->enabled = true; return 0; @@ -388,13 +376,13 @@ static int kingdisplay_panel_add(struct kingdisplay_panel *kingdisplay) kingdisplay->enable_gpio = NULL; } - kingdisplay->backlight = devm_of_find_backlight(dev); - if (IS_ERR(kingdisplay->backlight)) - return PTR_ERR(kingdisplay->backlight); - drm_panel_init(&kingdisplay->base, &kingdisplay->link->dev, &kingdisplay_panel_funcs, DRM_MODE_CONNECTOR_DSI); + err = drm_panel_of_backlight(&kingdisplay->base); + if (err) + return err; + return drm_panel_add(&kingdisplay->base); } @@ -432,12 +420,12 @@ static int kingdisplay_panel_remove(struct mipi_dsi_device *dsi) struct kingdisplay_panel *kingdisplay = mipi_dsi_get_drvdata(dsi); int err; - err = kingdisplay_panel_unprepare(&kingdisplay->base); + err = drm_panel_unprepare(&kingdisplay->base); if (err < 0) DRM_DEV_ERROR(&dsi->dev, "failed to unprepare panel: %d\n", err); - err = kingdisplay_panel_disable(&kingdisplay->base); + err = drm_panel_disable(&kingdisplay->base); if (err < 0) DRM_DEV_ERROR(&dsi->dev, "failed to disable panel: %d\n", err); @@ -455,8 +443,8 @@ static void kingdisplay_panel_shutdown(struct mipi_dsi_device *dsi) { struct kingdisplay_panel *kingdisplay = mipi_dsi_get_drvdata(dsi); - kingdisplay_panel_unprepare(&kingdisplay->base); - kingdisplay_panel_disable(&kingdisplay->base); + drm_panel_unprepare(&kingdisplay->base); + drm_panel_disable(&kingdisplay->base); } static struct mipi_dsi_driver kingdisplay_panel_driver = { From patchwork Mon Dec 2 19:32:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269779 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E822A13A4 for ; Mon, 2 Dec 2019 19:39:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C561520661 for ; Mon, 2 Dec 2019 19:39:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BZlMe7Co"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lnMtfHUc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C561520661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OC8DV+yWAaGmAcQQHKz7dfYFvMEx/AHY3kDGix+Vo50=; b=BZlMe7CoqD/87W Cq8oG985SaGu1/C8cvDxPAh4xVm5fEBFUcgrqYtY5L5kJM4Hl8EmGy4OvH836S6NJyMG5XZ99suFo zHFq5BPk2dXBEtF133LZzHFNi+7tpP0XvOS2/m4VOoAYd++Ie6NSvBXJ+NpO2qvS524jhd8GIP9R7 JEjgH3Qnxxj4ncJjyRSlSbBwmOQMgeUUI781EEp+wM4dB9F6wQNcOxvhLllNjxUxHWD0UVa8QJ6bT 3FkucFGFUZOTlApU8KWMCDsu8KMI5tBAb2fahPbixfR+hEv+UycE0u6m7O4t9LUBSK2+uR24+7/2c Wb1Zo+q4SccwuwxJHLOQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrXw-0006FB-Iz; Mon, 02 Dec 2019 19:39:48 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRr-0007gL-Gf; Mon, 02 Dec 2019 19:33:37 +0000 Received: by mail-lj1-x243.google.com with SMTP id h23so806539ljc.8; Mon, 02 Dec 2019 11:33:31 -0800 (PST) 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=R0f42CF+zwCz/GYqQyt+Coe4IA7I6q2AFYs8+413zO0=; b=lnMtfHUcqZMMTnJ9gMhihKsg3Z/0eU6Y56rSI1jYsRkXy2EkvUclqmRZIEdI6SSSls wPP140xvr7sa1QlrV1iWDGiJ2sjuOkm5L3jQ7FOprQIYggBuzus2yGc1yji7zTj2Nl/O cAGOkgbft8rYkYZO8jIVy0IlYiloAfroxD7cWixqmRgTvqmKArka4CvLU0mzj499zQx8 FJXuUfypTKn7fF2KJwWXlBTvu/WBeYYZxkGmc2iVRMKkGl5lbRPz/4sYiwtyYzLrQxsq B9WctI7d/M9bU3H43w9MGzdywkaqP47fHiAPW0Iet8HaUHiDfVL5BPF4qETjJfe8WPzZ LLog== 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=R0f42CF+zwCz/GYqQyt+Coe4IA7I6q2AFYs8+413zO0=; b=gw8a3e9TzbYUMgaKYoRKBVFy1VddDJTFauc3yUfINke1ptBnheR3WaZNhlqZZsuj27 9fB45IrTd7LCFuw7vOKQK6zP5U3n6lq+jO6J1WD9sEhrVrJbdV7Ub06HWidFY00yDamN MV4jzNy/HFQ3jSHMhvPSzBYAyuWdw9OO18iLpZ2uhPO1DJoWDumuOMxjfQl0Cpnm22MK Pdj3HEYJvW5nOt7NE2No8OLRuSbaX3jjd5pnbY7US9xLjl6bu/k8lw+2GmgdLvJBoBgm b8mHFkqMoJea596IU5d5zd935tAuRjfxacFP+sfN4JCuNd7limIBZhjPM3hd7daKYyhk BLaQ== X-Gm-Message-State: APjAAAUERETn2XZP+NpNRavih8Wy40T+PzLGi9xz5UUBWGM1usxYeEeu ndTwNSNLyl8ggAoO7r2jAP4= X-Google-Smtp-Source: APXvYqwxAoUwLTLEkQUfJnM7DgssO8M84iKQHSB7L3N4qws7EummnIVscFtc8tlydjwAe0u9VpqMAA== X-Received: by 2002:a2e:b61a:: with SMTP id r26mr271701ljn.72.1575315209849; Mon, 02 Dec 2019 11:33:29 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:29 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 13/26] drm/panel: lvds: use drm_panel backlight support Date: Mon, 2 Dec 2019 20:32:17 +0100 Message-Id: <20191202193230.21310-14-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113331_796590_296AA254 X-CRM114-Status: GOOD ( 12.70 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Sam Ravnborg Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/panel/panel-lvds.c | 40 ++++-------------------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c index 5e40b674bb15..5ce3f4a2b7a1 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -8,7 +8,6 @@ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) */ -#include #include #include #include @@ -34,7 +33,6 @@ struct panel_lvds { unsigned int bus_format; bool data_mirror; - struct backlight_device *backlight; struct regulator *supply; struct gpio_desc *enable_gpio; @@ -46,19 +44,6 @@ static inline struct panel_lvds *to_panel_lvds(struct drm_panel *panel) return container_of(panel, struct panel_lvds, panel); } -static int panel_lvds_disable(struct drm_panel *panel) -{ - struct panel_lvds *lvds = to_panel_lvds(panel); - - if (lvds->backlight) { - lvds->backlight->props.power = FB_BLANK_POWERDOWN; - lvds->backlight->props.state |= BL_CORE_FBBLANK; - backlight_update_status(lvds->backlight); - } - - return 0; -} - static int panel_lvds_unprepare(struct drm_panel *panel) { struct panel_lvds *lvds = to_panel_lvds(panel); @@ -93,19 +78,6 @@ static int panel_lvds_prepare(struct drm_panel *panel) return 0; } -static int panel_lvds_enable(struct drm_panel *panel) -{ - struct panel_lvds *lvds = to_panel_lvds(panel); - - if (lvds->backlight) { - lvds->backlight->props.state &= ~BL_CORE_FBBLANK; - lvds->backlight->props.power = FB_BLANK_UNBLANK; - backlight_update_status(lvds->backlight); - } - - return 0; -} - static int panel_lvds_get_modes(struct drm_panel *panel, struct drm_connector *connector) { @@ -132,10 +104,8 @@ static int panel_lvds_get_modes(struct drm_panel *panel, } static const struct drm_panel_funcs panel_lvds_funcs = { - .disable = panel_lvds_disable, .unprepare = panel_lvds_unprepare, .prepare = panel_lvds_prepare, - .enable = panel_lvds_enable, .get_modes = panel_lvds_get_modes, }; @@ -242,10 +212,6 @@ static int panel_lvds_probe(struct platform_device *pdev) return ret; } - lvds->backlight = devm_of_find_backlight(lvds->dev); - if (IS_ERR(lvds->backlight)) - return PTR_ERR(lvds->backlight); - /* * TODO: Handle all power supplies specified in the DT node in a generic * way for panels that don't care about power supply ordering. LVDS @@ -257,6 +223,10 @@ static int panel_lvds_probe(struct platform_device *pdev) drm_panel_init(&lvds->panel, lvds->dev, &panel_lvds_funcs, DRM_MODE_CONNECTOR_LVDS); + ret = drm_panel_of_backlight(&lvds->panel); + if (ret) + return ret; + ret = drm_panel_add(&lvds->panel); if (ret < 0) return ret; @@ -271,7 +241,7 @@ static int panel_lvds_remove(struct platform_device *pdev) drm_panel_remove(&lvds->panel); - panel_lvds_disable(&lvds->panel); + drm_panel_disable(&lvds->panel); return 0; } From patchwork Mon Dec 2 19:32:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269791 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6AEA9109A for ; Mon, 2 Dec 2019 19:40:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4809020661 for ; Mon, 2 Dec 2019 19:40:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SToZJ7C6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FxrKOZXv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4809020661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HWDGPReT+KpARVmhsFJYZJoaLT3zRgxy4I9ZLWZbnwg=; b=SToZJ7C6a+e/ab NlmG5wf7VZUeWn7Y8+F6ivJrbjSkZTm2RPMuJSFTpm5cEUS4AYGI5kfwVr7uzeJ7AFfiDdlR4dnTw Mra5lWUGz0uQJMlJUzcPgn7iFnaOJ0J9rk/OFi8aYS0owipLZ6csgSW86kcm+l3/qaM8Qt1x+tzT0 F7UDkn5wdywHv1OPimWUOGz4kRlGA6GUQiiHI4/Whp/kCwrcCQTYABB9S4nGm6AXHVOTjdUlXFElp xfIBIILasMaKcWN2IVAZfyKC4H5Q6sqCD6eoC8Ix0SqB/PuEn8Lnsdu0TARXZofpIaPiWh9tv+QEP a8jDe/pdOQuy4Ml6qxmQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrYy-0008OM-Qg; Mon, 02 Dec 2019 19:40:52 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRt-0007hl-AP; Mon, 02 Dec 2019 19:33:39 +0000 Received: by mail-lj1-x241.google.com with SMTP id m6so868913ljc.1; Mon, 02 Dec 2019 11:33:33 -0800 (PST) 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=+5RYUpfQaHxKRkMXMkrP8oHu/MU7hdMpYDFxNzucUWs=; b=FxrKOZXvIF29xM5J+pbmyhXLfeQ1nklAk2wjlXyurWeQsWf2xXMKDXqzoBzjlf8k4h sPXZBUKfoTu2+QPSuB1Mun/NjlwEGG6y4s2LuJC2ikplHxAIxTxYdo0/pT+lQxVE/Dqe Q+qDzTGbtGOUWoFMzbsYsrXtMhBrHPAbakZ4oo4+KxLNrE9+Vhsr57kf756kruBBfiwo fnvVT2HrnRTkdac8TGx+bWQLxc5opFap8I718aRsVi5UBY2ky009OO8SgyF0Ws/zpy+y t4dIPeOh16FHiRVp976VpPmmC4FK7tfYfhZNi1xoQOGrwALJKP5AAjb0a2R93fuuE4wZ p52g== 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=+5RYUpfQaHxKRkMXMkrP8oHu/MU7hdMpYDFxNzucUWs=; b=VLX/da3eSf7kVFpfeivAVk/nYz+9lX6KBleiYOsInZGxi0dUBYMBxJUrU9BOsuZJci lZVLCZvX3Mmp/KRR9kDp527PrYLIR/DJoKRXp6Js6dKW9vRn/dou1yLWRWEUxgyyYWiH GEDXHp449X3zKK5ReW1IgVvcnd61SiHEuglq7oWZOjnCj3RZlZtXS15tZRsbcgJNdsWA uSWqGRaY61oBNePaCLomYNPgUX0Gu0sDQ/3yQXFRtwFmOF15/dnb/g1hytsWT6QZfL2n 8EZVvlwuKvFHK+n7Wt18Ajba1eqLjnDfJhM2aNCqhohz4IbfIMPPxN0D/Y27S5IaChBX YssA== X-Gm-Message-State: APjAAAUQBHeniLDrzOBctRt+a7lTt09MhY5Q20znNPuL17uF1JxZhF8W nTxIOYmCQAuM+aiWT+c+hjc= X-Google-Smtp-Source: APXvYqw6xZ1V1bDQy1s46yIVtGq4D/aLE8LZc7NwSI+fkDGgYQgqenzANQAALXlLLg5Wahg+qt2cSA== X-Received: by 2002:a2e:3a15:: with SMTP id h21mr266843lja.256.1575315211669; Mon, 02 Dec 2019 11:33:31 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:31 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 14/26] drm/panel: olimex-lcd-olinuxino: use drm_panel backlight support Date: Mon, 2 Dec 2019 20:32:18 +0100 Message-Id: <20191202193230.21310-15-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113333_489093_98724C98 X-CRM114-Status: GOOD ( 11.18 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, Stefan Mavrodiev , linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Cc: Stefan Mavrodiev Cc: Thierry Reding Cc: Sam Ravnborg --- .../gpu/drm/panel/panel-olimex-lcd-olinuxino.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c b/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c index e553e584399b..09deb99981a4 100644 --- a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c +++ b/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c @@ -6,7 +6,6 @@ * Author: Stefan Mavrodiev */ -#include #include #include #include @@ -68,7 +67,6 @@ struct lcd_olinuxino { bool prepared; bool enabled; - struct backlight_device *backlight; struct regulator *supply; struct gpio_desc *enable_gpio; @@ -87,8 +85,6 @@ static int lcd_olinuxino_disable(struct drm_panel *panel) if (!lcd->enabled) return 0; - backlight_disable(lcd->backlight); - lcd->enabled = false; return 0; @@ -134,8 +130,6 @@ static int lcd_olinuxino_enable(struct drm_panel *panel) if (lcd->enabled) return 0; - backlight_enable(lcd->backlight); - lcd->enabled = true; return 0; @@ -283,13 +277,13 @@ static int lcd_olinuxino_probe(struct i2c_client *client, if (IS_ERR(lcd->enable_gpio)) return PTR_ERR(lcd->enable_gpio); - lcd->backlight = devm_of_find_backlight(dev); - if (IS_ERR(lcd->backlight)) - return PTR_ERR(lcd->backlight); - drm_panel_init(&lcd->panel, dev, &lcd_olinuxino_funcs, DRM_MODE_CONNECTOR_DPI); + ret = drm_panel_of_backlight(&lcd->panel); + if (ret) + return ret; + return drm_panel_add(&lcd->panel); } @@ -299,8 +293,8 @@ static int lcd_olinuxino_remove(struct i2c_client *client) drm_panel_remove(&panel->panel); - lcd_olinuxino_disable(&panel->panel); - lcd_olinuxino_unprepare(&panel->panel); + drm_panel_disable(&panel->panel); + drm_panel_unprepare(&panel->panel); return 0; } From patchwork Mon Dec 2 19:32:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269785 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94AAE109A for ; Mon, 2 Dec 2019 19:40:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7120320661 for ; Mon, 2 Dec 2019 19:40:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pud6wVWu"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fWsZc6px" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7120320661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=42K3iI01QNyCHHgoh9P9d8uR6pATUJ00ezEatZIbyrg=; b=pud6wVWuXtmePH Zb2kp2E73D8rBlXAhCHIBvnf5QAzXoDHK8rXpyBLN8L38Aodkhi6EsOz8ZtXXRXRss9TecmN08kKZ QL+Kmgv75HiPOnaB3McIv9gmqeoMnkAFI9J2VfUOAkBlFTh9MR8l6Ao9edea5Iq0xF7Fje7bJdDTI 4lvIk1qA9NRcWJFDDUdvIIHS2tRgeQYpKEwcFMmwsDi2aicwugOnwKe2tDV55T0cmN2U1NKFvkoLN MK+p8t4Y4L/LnQ2bPG5Njxi0FVzAyHHG8hgqOQTcKMdcnx9/ofISKq40Aq7/FdBRnm5D2l8cYDrPN AzSc5P1zyzJsGbfiBKdQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrYQ-0006kB-Ti; Mon, 02 Dec 2019 19:40:18 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRu-0007jC-UQ; Mon, 02 Dec 2019 19:33:40 +0000 Received: by mail-lf1-x142.google.com with SMTP id r14so786932lfm.5; Mon, 02 Dec 2019 11:33:34 -0800 (PST) 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=mwTbXFs73rhfB3XHykRb+0twTubxbVTCKbes8vP1eoM=; b=fWsZc6pxE2cR74tH1x5bcK85tMs5P3XVQy6wY8Dzsei7SXL9iuN8fSp5lSWf7pMIdC xa4gKaBfW9GQl0tsJcMEulN2LTZ1dFp27MuO1x3ucEfaXHh9k03NMnT8pnU6IY5gCxpY 8kA6ToWIuyco+mlNtxdfOniENQxwNYP7VK8XAJSeokDRcbVtY0rN/Vsyg4bJBVWLT3gI W4lYkw+KLbAeuKXj6iVyrITCefWtK7oUSk1KodcyX+U7pkfYxsD190Gy9r+bVtOrtIq+ AHb1cVc40/4a1zUiR1PFruWHBNmyVb28/b76FXir/cJ/Zsd30ak1i5gzL2R8sNvMdh7l S3Wg== 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=mwTbXFs73rhfB3XHykRb+0twTubxbVTCKbes8vP1eoM=; b=KGMk4dVQ64MrUQzfJ0ngWRhweNGi4PwI58eZ4XbhJ2aO2e07llqkXJNGQDS8Nm2xM9 lWkqq2dd/PGl/zSzYkDH3D+vzgwg7O6AHFlDG5ienTAsyyxPtCjBiXBEJIZBn4mbhUKR UyhE0Na2SkS+Rl8BpkLJOamu0JZeJbNBQCYNPrNoxdjOTEEXf0uZOob87nNLgAbY3Ted x4ozHCxQG5V57p3322Dc8Yfx9ZuenXr7NpnJDSIV3S5sfY9plhIHZWe8Vr1DThPZzrW6 v4iBH+NfwVYzbaJgsINpgOpkUj7LOqht2sRgx7g9d24tjuFt6iDu89AT5iAoEimSOd4T UMzA== X-Gm-Message-State: APjAAAWTr6vArJVTEE8V2xrRXlgbmWPVokHWtavgz+7f5UfVKrhw1Vam CI8laQ/a4RJ2gFQRd+smOyo= X-Google-Smtp-Source: APXvYqxzH31f+2bGhDcEEDLD8E4lagqqgmHLv3NkKQxX8k5tVEOx+63XjFDyGaJYh0xM4o22P4hcLw== X-Received: by 2002:ac2:5a1a:: with SMTP id q26mr431452lfn.33.1575315213309; Mon, 02 Dec 2019 11:33:33 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:32 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 15/26] drm/panel: osd-osd101t2587-53ts: use drm_panel backlight support Date: Mon, 2 Dec 2019 20:32:19 +0100 Message-Id: <20191202193230.21310-16-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113335_087599_B865559B X-CRM114-Status: GOOD ( 12.42 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:142 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Sam Ravnborg --- .../drm/panel/panel-osd-osd101t2587-53ts.c | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c b/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c index 2734b4835dfa..3a0229d60095 100644 --- a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c +++ b/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c @@ -4,7 +4,6 @@ * Author: Peter Ujfalusi */ -#include #include #include #include @@ -20,7 +19,6 @@ struct osd101t2587_panel { struct drm_panel base; struct mipi_dsi_device *dsi; - struct backlight_device *backlight; struct regulator *supply; bool prepared; @@ -42,8 +40,6 @@ static int osd101t2587_panel_disable(struct drm_panel *panel) if (!osd101t2587->enabled) return 0; - backlight_disable(osd101t2587->backlight); - ret = mipi_dsi_shutdown_peripheral(osd101t2587->dsi); osd101t2587->enabled = false; @@ -91,8 +87,6 @@ static int osd101t2587_panel_enable(struct drm_panel *panel) if (ret) return ret; - backlight_enable(osd101t2587->backlight); - osd101t2587->enabled = true; return ret; @@ -158,18 +152,19 @@ MODULE_DEVICE_TABLE(of, osd101t2587_of_match); static int osd101t2587_panel_add(struct osd101t2587_panel *osd101t2587) { struct device *dev = &osd101t2587->dsi->dev; + int ret; osd101t2587->supply = devm_regulator_get(dev, "power"); if (IS_ERR(osd101t2587->supply)) return PTR_ERR(osd101t2587->supply); - osd101t2587->backlight = devm_of_find_backlight(dev); - if (IS_ERR(osd101t2587->backlight)) - return PTR_ERR(osd101t2587->backlight); - drm_panel_init(&osd101t2587->base, &osd101t2587->dsi->dev, &osd101t2587_panel_funcs, DRM_MODE_CONNECTOR_DSI); + ret = drm_panel_of_backlight(&osd101t2587->base); + if (ret) + return ret; + return drm_panel_add(&osd101t2587->base); } @@ -215,12 +210,11 @@ static int osd101t2587_panel_remove(struct mipi_dsi_device *dsi) struct osd101t2587_panel *osd101t2587 = mipi_dsi_get_drvdata(dsi); int ret; - ret = osd101t2587_panel_disable(&osd101t2587->base); + ret = drm_panel_disable(&osd101t2587->base); if (ret < 0) dev_warn(&dsi->dev, "failed to disable panel: %d\n", ret); - osd101t2587_panel_unprepare(&osd101t2587->base); - + drm_panel_unprepare(&osd101t2587->base); drm_panel_remove(&osd101t2587->base); ret = mipi_dsi_detach(dsi); @@ -234,8 +228,8 @@ static void osd101t2587_panel_shutdown(struct mipi_dsi_device *dsi) { struct osd101t2587_panel *osd101t2587 = mipi_dsi_get_drvdata(dsi); - osd101t2587_panel_disable(&osd101t2587->base); - osd101t2587_panel_unprepare(&osd101t2587->base); + drm_panel_disable(&osd101t2587->base); + drm_panel_unprepare(&osd101t2587->base); } static struct mipi_dsi_driver osd101t2587_panel_driver = { From patchwork Mon Dec 2 19:32:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269775 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C8A1F13A4 for ; Mon, 2 Dec 2019 19:39:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 990AE20661 for ; Mon, 2 Dec 2019 19:39:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NbV0GbPx"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="imCcVCQm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 990AE20661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=X8oZHJN2IXSq+LyzuDy62/2mht0UAl2EtqZVUw0g52w=; b=NbV0GbPx5qDNWv GhYNctvv3aJyQwJCirRs/fDZ3Q4jCvXYmAcLgmcFaCGCvinV1Y5nLpThkMmG8qll6+DHf4k6T4V2u CUFKZdws5ZGPELHovqyGvDw/H+oxCVojoi/jKVNi7vr3ibQkzdwIquQbiCx80gO8/rwGJqh2FehQ/ Y8YYoF+47erbeyx4FoTatryfSwOt/0uVZ1d3ugUiSiNgQ9WY/xQAaWwQkIe7o6Zp3iZhgUY/ckxOz Wt/p9c9Bw6e9EGxswiNLKiFGZC1x9YgL3Pb9Nq5N6HM83A4pvYz0XNAuO5c/EycglNSc7n3NqmGXu Czwm9LGAwqFymc7NqW+g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrXo-00065o-LR; Mon, 02 Dec 2019 19:39:40 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRw-0007kg-LY; Mon, 02 Dec 2019 19:33:42 +0000 Received: by mail-lj1-x242.google.com with SMTP id a13so792515ljm.10; Mon, 02 Dec 2019 11:33:36 -0800 (PST) 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=1cwcVlQTSPEpvvTt7npXTAeRNecjJ4sL2WdE6IowvJo=; b=imCcVCQmdfVtejivHQ8KZ3aZd/wGiv7mSMxF8P61gBPk8JEEOnM5aBUs/RUQ/BM+Zs TZU5zBsnpML9NGpyS7AV6m4mryUxW3RdK/e9BhFtQolln8KI2MFdjwbNCEHgFDffbSEQ UjyRVShfamjiTe1VMJKsraIoBmzT5zYXchzx/cMKm+RKSDDy/7yuBZZmlKPnr9kFFV1s uhFD7Vjj5Rl80xoiyiU2KTIZs2jPm1h+3WusBF3g6jrXO/BIEGD2xe79Kr21fOZ0Hk+N 4cjdXLPmyBe9NWlJkOp0RvKlxnnEK+fOQ4pI38kQ0QEBBpF8I+Y4f2FVFn3Euq+UYigc 0brA== 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=1cwcVlQTSPEpvvTt7npXTAeRNecjJ4sL2WdE6IowvJo=; b=RKP+MDhMD9zGYENj/IE9ToMGHqxTz/8t8/kXPij95m+htouSOrcEOZZ7Z8pJeHsBH1 P4OhSVAMXiuwaP5wUUeHiB0yXUeqmW0jei6AYt8fvd2kSO3aPQNtk1P5dITIyvgX0+JS Q1hgApMFUEbUVh6LsFAJKRsZi5S2yY77wxXYJ2kp3x/cz1iCJJYVGYoFtXKFwW/WLeEH OQ1UpHLLInGY7cstT6ojYYRAuwB9jHvN4i3U4OJoddjSmpRhNkxpPAI6x8zNhltS0oYc 8ljDvZWECgpnMc/Uu6rLsfyVtAiOyMw+T1C/FaeCvP8FaWGWPe0PG5sSAPOlU3MaRy9V FNkg== X-Gm-Message-State: APjAAAU6OyMN3v1MKwRro6gOZ3Q8RTvDxhtZcQ21YmeUqJyTN/6D5kvC jZEF05TAi7MDgFixSyuxf9E= X-Google-Smtp-Source: APXvYqxuD4DYzYut6ry4UElFe4ZjLh8rR23KZMh/GwY0agg4mlfI8UchY6oM0rWOK2lXFt8pu36fCg== X-Received: by 2002:a2e:999a:: with SMTP id w26mr287454lji.142.1575315215038; Mon, 02 Dec 2019 11:33:35 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:34 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 16/26] drm/panel: panasonic-vvx10f034n00: use drm_panel backlight support Date: Mon, 2 Dec 2019 20:32:20 +0100 Message-Id: <20191202193230.21310-17-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113336_804804_F6C180A9 X-CRM114-Status: GOOD ( 13.56 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Sam Ravnborg --- .../drm/panel/panel-panasonic-vvx10f034n00.c | 45 +++---------------- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c index 579ac0d86ea4..4e15bff5a1b5 100644 --- a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +++ b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c @@ -7,7 +7,6 @@ * Based on AUO panel driver by Rob Clark */ -#include #include #include #include @@ -31,7 +30,6 @@ struct wuxga_nt_panel { struct drm_panel base; struct mipi_dsi_device *dsi; - struct backlight_device *backlight; struct regulator *supply; bool prepared; @@ -62,12 +60,6 @@ static int wuxga_nt_panel_disable(struct drm_panel *panel) mipi_ret = mipi_dsi_shutdown_peripheral(wuxga_nt->dsi); - if (wuxga_nt->backlight) { - wuxga_nt->backlight->props.power = FB_BLANK_POWERDOWN; - wuxga_nt->backlight->props.state |= BL_CORE_FBBLANK; - bl_ret = backlight_update_status(wuxga_nt->backlight); - } - wuxga_nt->enabled = false; return mipi_ret ? mipi_ret : bl_ret; @@ -142,12 +134,6 @@ static int wuxga_nt_panel_enable(struct drm_panel *panel) if (wuxga_nt->enabled) return 0; - if (wuxga_nt->backlight) { - wuxga_nt->backlight->props.power = FB_BLANK_UNBLANK; - wuxga_nt->backlight->props.state &= ~BL_CORE_FBBLANK; - backlight_update_status(wuxga_nt->backlight); - } - wuxga_nt->enabled = true; return 0; @@ -206,7 +192,6 @@ MODULE_DEVICE_TABLE(of, wuxga_nt_of_match); static int wuxga_nt_panel_add(struct wuxga_nt_panel *wuxga_nt) { struct device *dev = &wuxga_nt->dsi->dev; - struct device_node *np; int ret; wuxga_nt->mode = &default_mode; @@ -215,38 +200,20 @@ static int wuxga_nt_panel_add(struct wuxga_nt_panel *wuxga_nt) if (IS_ERR(wuxga_nt->supply)) return PTR_ERR(wuxga_nt->supply); - np = of_parse_phandle(dev->of_node, "backlight", 0); - if (np) { - wuxga_nt->backlight = of_find_backlight_by_node(np); - of_node_put(np); - - if (!wuxga_nt->backlight) - return -EPROBE_DEFER; - } - drm_panel_init(&wuxga_nt->base, &wuxga_nt->dsi->dev, &wuxga_nt_panel_funcs, DRM_MODE_CONNECTOR_DSI); - ret = drm_panel_add(&wuxga_nt->base); - if (ret < 0) - goto put_backlight; - - return 0; - -put_backlight: - if (wuxga_nt->backlight) - put_device(&wuxga_nt->backlight->dev); + ret = drm_panel_of_backlight(&wuxga_nt->base); + if (ret) + return ret; - return ret; + return drm_panel_add(&wuxga_nt->base); } static void wuxga_nt_panel_del(struct wuxga_nt_panel *wuxga_nt) { if (wuxga_nt->base.dev) drm_panel_remove(&wuxga_nt->base); - - if (wuxga_nt->backlight) - put_device(&wuxga_nt->backlight->dev); } static int wuxga_nt_panel_probe(struct mipi_dsi_device *dsi) @@ -281,7 +248,7 @@ static int wuxga_nt_panel_remove(struct mipi_dsi_device *dsi) struct wuxga_nt_panel *wuxga_nt = mipi_dsi_get_drvdata(dsi); int ret; - ret = wuxga_nt_panel_disable(&wuxga_nt->base); + ret = drm_panel_disable(&wuxga_nt->base); if (ret < 0) dev_err(&dsi->dev, "failed to disable panel: %d\n", ret); @@ -298,7 +265,7 @@ static void wuxga_nt_panel_shutdown(struct mipi_dsi_device *dsi) { struct wuxga_nt_panel *wuxga_nt = mipi_dsi_get_drvdata(dsi); - wuxga_nt_panel_disable(&wuxga_nt->base); + drm_panel_disable(&wuxga_nt->base); } static struct mipi_dsi_driver wuxga_nt_panel_driver = { From patchwork Mon Dec 2 19:32:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269793 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB066112B for ; Mon, 2 Dec 2019 19:41:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 87C7020661 for ; Mon, 2 Dec 2019 19:41:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GBeX5j+b"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UXVhIwS9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87C7020661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jvjrTIdKlviqFM2/gNULIJxAwJjV9ue2ysajg2UB3O8=; b=GBeX5j+bULPA6w jYn7PczrIRV4HuNAwEPUICqi0rD9G3UIXPrkRVL45S4j2UgV+4rA3tlPezSlj1gOPZhB+2zliJhE0 dOEVkryUrQL8elz5R+H874lSz+QUA0TkXDcYXN0faK55GYxrOKBXyCiT1BWyprXemnlWO9ZbYxBJO J/JJpdXymegdqB6w0pCM4PG76+uxRq3RL9xlT4Sj65BaTEeoQH10INYSh0hHnLpUxYmhC+abv12CU 73rL9yHMVrMyJ7fLOEtFkrl3zfdTSrif3hlfq4zGzPUhNGRwjyD1ytxHi0k4fs7CFLderrlnlLcrw TyR+pcMlfKEhpyv+wxGA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrZ3-0008SV-D8; Mon, 02 Dec 2019 19:40:57 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRy-0007mE-K1; Mon, 02 Dec 2019 19:33:43 +0000 Received: by mail-lj1-x242.google.com with SMTP id e28so800092ljo.9; Mon, 02 Dec 2019 11:33:38 -0800 (PST) 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=YHyg1Dv+yW1P3woHHern0IWhA1ZSh1oVCkpM4/quUn4=; b=UXVhIwS9hxqLyUKpFsi/9B+m1W8tz6O8LM+RB3HfE3wlqNoBarTzpBZk+cRfYXcKbn lA8UgPBM4FenshUYYPFPqreNDBD0AdQLGp+x3aW+O9T9/S+2zSZDnb0GB1Y0loieXdeD x4GtLZtb2OTb7W9PgYDmkjvrt2X/t6hZEa2L5ksHtQTbwiEOw1Lk1rgsxYN+OLJdJypE SyLoO7QNk3W0D2lNr5wmo+W5RLt+tCMvGf1qO/QjC6NNh8geO0+GKYkbHCQLQ5BOzjqz s/tm2pU99xfXKIdoDFCpO4LL9AXdqOSsLBqTrS/FhG5fmQTOIcEBokwV07Xlex9BHEN3 Urnw== 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=YHyg1Dv+yW1P3woHHern0IWhA1ZSh1oVCkpM4/quUn4=; b=qc/NScApczkTew3Fv09H2bubdheISiGJc4rTUeksMgWghAbgmHlIldJijhATL1ODbj dxF5yx2ap5NaGGqeynSisKio4EyUBwKf4F6agGxpPlh8Lgp6TDNc79SA6l022iDKkinh sJw/aW7n/9pcBhYsnwBAkpL2Kzmw6IzokVNZOdIM90fRm+KUso5lPhEleN2BvlFUcCia Xt5eiGIhKc40I3u+Q9Ue4VrQd+DVR14l2Qc6nCmvSFbuFIwS5gtxB80Z31IwYd2LKA/7 oVA5+Pki625Fu8tGDhUHFwumLENizHwRPxWUusglEDE707e95R0SN5EsTXnhT4lrj8g5 Z5KA== X-Gm-Message-State: APjAAAUe/rTEkw1JVnXcrMwRx91il7JUP9Ns50XOfX6TmEqIpFKhMryp jTDP8ju4LD5HxIDxejegGu4= X-Google-Smtp-Source: APXvYqz3r+laN9FnmWTYFLLBUS6ZnkiUvsIMFFNjcED2AJXxTlqVCVCVhK5M16rTTToSSV/kHLG6ng== X-Received: by 2002:a2e:b007:: with SMTP id y7mr253216ljk.215.1575315216701; Mon, 02 Dec 2019 11:33:36 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:36 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 17/26] drm/panel: raydium-rm68200: use drm_panel backlight support Date: Mon, 2 Dec 2019 20:32:21 +0100 Message-Id: <20191202193230.21310-18-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113338_749639_CCDB82BF X-CRM114-Status: GOOD ( 11.23 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Sam Ravnborg --- drivers/gpu/drm/panel/panel-raydium-rm68200.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-raydium-rm68200.c b/drivers/gpu/drm/panel/panel-raydium-rm68200.c index d6a03328e594..e8982948e0ea 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm68200.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm68200.c @@ -6,9 +6,9 @@ * Yannick Fertre */ -#include #include #include +#include #include #include @@ -78,7 +78,6 @@ struct rm68200 { struct drm_panel panel; struct gpio_desc *reset_gpio; struct regulator *supply; - struct backlight_device *backlight; bool prepared; bool enabled; }; @@ -242,8 +241,6 @@ static int rm68200_disable(struct drm_panel *panel) if (!ctx->enabled) return 0; - backlight_disable(ctx->backlight); - ctx->enabled = false; return 0; @@ -328,8 +325,6 @@ static int rm68200_enable(struct drm_panel *panel) if (ctx->enabled) return 0; - backlight_enable(ctx->backlight); - ctx->enabled = true; return 0; @@ -392,10 +387,6 @@ static int rm68200_probe(struct mipi_dsi_device *dsi) return ret; } - ctx->backlight = devm_of_find_backlight(dev); - if (IS_ERR(ctx->backlight)) - return PTR_ERR(ctx->backlight); - mipi_dsi_set_drvdata(dsi, ctx); ctx->dev = dev; @@ -408,6 +399,10 @@ static int rm68200_probe(struct mipi_dsi_device *dsi) drm_panel_init(&ctx->panel, dev, &rm68200_drm_funcs, DRM_MODE_CONNECTOR_DSI); + ret = drm_panel_of_backlight(&ctx->panel); + if (ret) + return ret; + drm_panel_add(&ctx->panel); ret = mipi_dsi_attach(dsi); From patchwork Mon Dec 2 19:32:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269807 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 85145112B for ; Mon, 2 Dec 2019 19:41:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 624D820661 for ; Mon, 2 Dec 2019 19:41:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uUOUEfGy"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NXrsvTVy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 624D820661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=71PUv2NxXfbXqnUzu6vv/FWqUo1UIr58TnDpVo+EUfw=; b=uUOUEfGyx9u7k/ jJN/QdIsWtbAJf++wsL5C2eiN2RFHGoNyHbuySZnVngAdgz6xHqB4r0461q0C1b48qgTzN5WICgT0 smNHQQuEopFeWifHjI5WAaRwrxb2Uy5qVAcol4xtVaVflaKhchBypDh9CsoAApbeJ+mIF2H0xQEKz V/pYBg2uyMxN0JZ2kgj1E6pCk/TGhzz3xQKjUW/vIqeLBGd7vWuEmHI5ij58vJbHgHDxc5BLdcxRY qguK8jUeTmgkvNL2xopK7XZDi/XSzLsMLT1pGiqUO4Txn4iGzJ1dwAXiAwDVSYwEVDnCOdgnxz7SH 1jBg79jmKdbzSY7duHww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrZp-00015W-95; Mon, 02 Dec 2019 19:41:45 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrS0-0007nX-Jh; Mon, 02 Dec 2019 19:33:44 +0000 Received: by mail-lj1-x244.google.com with SMTP id d20so778892ljc.12; Mon, 02 Dec 2019 11:33:40 -0800 (PST) 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=9l88xihpsr+Oq7AiOCDQfFuIMQfThGtVnWiYKe7NjT4=; b=NXrsvTVyKTVDN70+OK/7PF45HUHG5iMhS69DUkYT2xofsK/0mFMX5121dT/vftSM7R qpWNdC7qTqqXqAThmb+h5aQ9rm2oVx2VUbwhav5ehLUT6ffVSkzCmxdk4CfDL/Ex4G0W SodcXhFAjBSa16VNI+zM+1tj8zgBvTgKX4T3rTKedBUL8+Bsk3ogVw4MlixwlgKh4M8T Q02q2gq4vhycml3qIipLMtXIqfBm0UWXxBQzF6UdxFcxXL4UsH1fWSnPj+ZEP61vy2cu Wpp3fOUqsu8zeLeEcGbwxyDwq7ejHwvJ/M+G1AKiP/8ZbX/Gu9jjG75b0nywoWL8Pg5J dzLQ== 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=9l88xihpsr+Oq7AiOCDQfFuIMQfThGtVnWiYKe7NjT4=; b=lljNxPCofNsMP8q4ydjIx+fNaPl7pA7ItYkDIazq0XDA2PiGoX9sH8BvRZTZB1UAF2 BIN8a/POpK7szzUTl4oZeKEr37dSQ+LjABKvRCy1xAFSpUbP1NIW8iHRbSixKytxX/kT SWL1hbfcRm9tXub/2hSN2n/yKsF/PJ4+4aokLhDEOIcuMiWcghHFmIOkzHSqidTDxlfF t27z1dFtlA4nfbUXwknmNvGSlOpcfpf+R7TGEjA5qpl2mHXqeULmRTOF3uh8i1DgWKPR UAIlDc+QuwX1MWSMN3BgrUZ40VdFu4b1PNs8L+zm+tLfN8K0StSKsP1kBRVJqS0To5rv HEhA== X-Gm-Message-State: APjAAAX6D9JwYJ98egH5tbL3TO09GmlV5RopNeaH3i1UY6/sa9Ccpjmu CdxwYuDdf/how3mmK5S+bTo= X-Google-Smtp-Source: APXvYqzS7SokA6A/WeeKZw1vsjDaKZ/zMqV2/WXPSZ5E+ZDr9kYmre74jF/nrnnSX3bYrjhN+JwTpg== X-Received: by 2002:a2e:b5ae:: with SMTP id f14mr256760ljn.31.1575315218380; Mon, 02 Dec 2019 11:33:38 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:37 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 18/26] drm/panel: rocktech-jh057n00900: use drm_panel backlight support Date: Mon, 2 Dec 2019 20:32:22 +0100 Message-Id: <20191202193230.21310-19-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113340_689970_FA564860 X-CRM114-Status: GOOD ( 12.21 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , Sam Ravnborg , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , =?utf-8?q?Guido_G=C3=BCnther?= , NXP Linux Team , Jitao Shi , Pengutronix Kernel Team , Maarten Lankhorst , Maxime Ripard , linux-mediatek@lists.infradead.org, Abhinav Kumar , linux-tegra@vger.kernel.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Purism Kernel Team , linux-renesas-soc@vger.kernel.org, Boris Brezillon , Daniel Vetter Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver. While touching the include files sort them and divide them up in blocks. Signed-off-by: Sam Ravnborg Cc: "Guido Günther" Cc: Purism Kernel Team Cc: Thierry Reding Cc: Sam Ravnborg Reviewed-by: Guido Günther --- .../drm/panel/panel-rocktech-jh057n00900.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c index 3a4f1c0fce86..38ff742bc120 100644 --- a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c +++ b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c @@ -5,20 +5,22 @@ * Copyright (C) Purism SPC 2019 */ -#include -#include -#include -#include -#include #include #include #include #include +#include #include #include + #include