From patchwork Sat Dec 7 14:03:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277509 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 DAD44930 for ; Sat, 7 Dec 2019 14:05:36 +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 B736C217BA for ; Sat, 7 Dec 2019 14:05:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sE98q4o4"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C9PRof0N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B736C217BA 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-mediatek-bounces+patchwork-linux-mediatek=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=mM6JrhZQq/ucsGjtlkscbGUu13ZkhMnLSXlkWbmiUl0=; b=sE98q4o4tQhih0 MQME18u7UKWINj3Hf4dRvVKNousE9dawLHC/iHf+5wZNzyOMKKLqa+iGu8YbPLYVFHQBHPPN+vu8N w3MFmLxQEkRuTG8LVmJxsxtJgjIZf0bdVJe+Mt/n0/ZNADCZEXov4+mc06HUIymimFM2fVIiThkz+ ssakvyKOLIKXlyKBBrWuN0CTwg50fxeIPLhIjGq2JBuHJybeFTPA3fwW1c5uFlJiWIQbgAlGUQh5R B+e/VTajp7awtdc6BwKi11YNtR/nwqu36oonz+7QiRgZ9ISMajQnjew271YPTqNtyaBA1Vhg3tSIE Wwir8lngPNHIML8erHHA==; 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 1idaiD-0006Vd-L4; Sat, 07 Dec 2019 14:05:33 +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 1idagu-0005VD-VR; Sat, 07 Dec 2019 14:04:14 +0000 Received: by mail-lj1-x241.google.com with SMTP id j6so10736658lja.2; Sat, 07 Dec 2019 06:04: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=zyDIaHIEoOsgYEFRA3EghxouF1YrEXIv4HHsD97xPLY=; b=C9PRof0NX84HlyZnuMy1HkuR+urn77PykHwGwtYCsEyr6rTcJeRmCjQ5g2ixx/0RM9 Se7vv0thWblq7zsasyBMcwA7XfTlbG738iwERThU8FvhOx6oedkZDjZTlZAQRFqRgodC 6iYN4EYy2+8GUYYyjlAWKyn4JK8/JgHU9I/lvHsUxZAa4drMFxfQpzeRy8jMSqkpycA7 XDrdyMwSWvwdrwp2ooadc+5+MYpufwz4goxK5Rf/Ti4jh/QjjEL63pOxHU6BQBCiZf0v 95QHvqdd5J8P3iGhpXL6lDsvlVS/c5lE7Evs7ZJrLk8YB7No3rhmfYkrZrskHhjOqLPR xT3A== 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=zyDIaHIEoOsgYEFRA3EghxouF1YrEXIv4HHsD97xPLY=; b=pmtpUb+FiIy2N9/+7kVLr+r6a6FgK5rzgyghbxEKGjhStJXHiiKk9TWhfkEEJ2zVWk u0dRv9WGATLYcERbEb1/+PfFUhrodLd3CnxvTjP7oNql+0mRzuf+STQQmC4bwhyRttrs LNTFrM5mihWvfiy6IBD3gRlXUc3g6cvqJXpQuOJWavH+wGF9AcQAoeGh7Rkxc47JjOVr wdSkaAlilV/2lTLcZKTzI5ll3mAKR0gFMrJLs+dM+7ynMdXpVm+CkNoMmebJObQO2XU9 nmgpHfc93foDrqJo5PAEZSXF+qVFbzlWFxL4u7YvAWRETFjuGHOoTwWdUp/YchrUhUqc 9NqQ== X-Gm-Message-State: APjAAAWj4IBNH6bkOyCTMc94WbyJyC/WeRJ7x9X4hqQcLhGsQa0C1s3z pdpsKnxwSESlqwudZoSkuQ0= X-Google-Smtp-Source: APXvYqzpRBwpO/dF5C8JBYFQuw6pI7aoTL/fA2BOACkUfXUITFiwu46JMYMO1GTATj6PIk+cZ8htEw== X-Received: by 2002:a2e:9e16:: with SMTP id e22mr4086043ljk.220.1575727450296; Sat, 07 Dec 2019 06:04: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 w17sm5644188lfn.22.2019.12.07.06.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:09 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 01/25] drm/drm_panel: no error when no callback Date: Sat, 7 Dec 2019 15:03:29 +0100 Message-Id: <20191207140353.23967-2-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060413_009483_48FED702 X-CRM114-Status: GOOD ( 11.93 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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. v2: - Document what functions in drm_panel_funcs are optional (Laurent) - Return -EOPNOTSUPP if get_modes() is not assigned (Laurent) (Sam: -EOPNOTSUPP seems to best error code in this situation) Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thierry Reding Cc: Sam Ravnborg Cc: David Airlie Cc: Daniel Vetter --- drivers/gpu/drm/drm_panel.c | 35 +++++++++++++++++++++++++---------- include/drm/drm_panel.h | 18 ++++++++++++++++-- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index ed7985c0535a..4ab7229fb22b 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 -EOPNOTSUPP; } EXPORT_SYMBOL(drm_panel_get_modes); diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index ce8da64022b4..d71655b2634c 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -65,6 +65,8 @@ struct drm_panel_funcs { * @prepare: * * Turn on panel and perform set up. + * + * This function is optional. */ int (*prepare)(struct drm_panel *panel); @@ -72,6 +74,8 @@ struct drm_panel_funcs { * @enable: * * Enable panel (turn on back light, etc.). + * + * This function is optional. */ int (*enable)(struct drm_panel *panel); @@ -79,6 +83,8 @@ struct drm_panel_funcs { * @disable: * * Disable panel (turn off back light, etc.). + * + * This function is optional. */ int (*disable)(struct drm_panel *panel); @@ -86,14 +92,20 @@ struct drm_panel_funcs { * @unprepare: * * Turn off panel. + * + * This function is optional. */ int (*unprepare)(struct drm_panel *panel); /** * @get_modes: * - * Add modes to the connector that the panel is attached to and - * return the number of modes added. + * Add modes to the connector that the panel is attached to. + * + * This function is mandatory. + * + * Returns the number of modes added, -EOPNOTSUPP if callback + * is missing, -EINVAL if panel is NULL. */ int (*get_modes)(struct drm_panel *panel); @@ -102,6 +114,8 @@ struct drm_panel_funcs { * * Copy display timings into the provided array and return * the number of display timings available. + * + * This function is optional. */ int (*get_timings)(struct drm_panel *panel, unsigned int num_timings, struct display_timing *timings); From patchwork Sat Dec 7 14:03:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277515 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 F3ED914BD for ; Sat, 7 Dec 2019 14:05: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 D1E21217BA for ; Sat, 7 Dec 2019 14:05:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pMDuEEgo"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JNdIVTzd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1E21217BA 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-mediatek-bounces+patchwork-linux-mediatek=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=Sy1t8ROEtE+P+FnTOURlB8UWlE3AGTxmuOESjLGpCFQ=; b=pMDuEEgobi/MJy t/Gh85sJxT3/10XRK8sMqkozqI3pFUOtJzMK3W8ftjjk0Y1Ol/fKHdv1jjzXJ3BunaMQpx28XCebg /x1BCxGsMGbFfNFKfiKJaGc3A6yXgN9Ge/BEYthh1nQ/tbT2Plg0o1sUCMwol0kePLxCDXKLRjdDY zBDsxuF+xxdLfSnRgkRicK9NQcn+2kzdLJJjD231H7uwU2r4SP3YSGHwHjq29E3ZcgZ7F6Df2R3Vt McfwxskZJEP99zN9vxjw8BV9ki9gQzI6bs4oK4gqcn4odYDdDv848wyrALjeUWAyl4m6/dpQLG852 GAda3v6A58LzSVBO0lsg==; 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 1idaiW-0007x4-Vx; Sat, 07 Dec 2019 14:05:53 +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 1idagv-0005VF-Qn; Sat, 07 Dec 2019 14:04:16 +0000 Received: by mail-lf1-x141.google.com with SMTP id f15so6583186lfl.13; Sat, 07 Dec 2019 06:04:13 -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=IAuPLO1NXXX2GjlvTopVslbL6mzsD4aerKxWopEcOV0=; b=JNdIVTzd6hQQR40rf18YTN5f5Q4Fe4/2lb99BbqbpfnGZU2hooEMtpBwrqswQgbwH2 l5ZdY3rh5F+K8ww1hsp2bIC0eVB+FviQ+SQHIkoIZyirWeskQD/aUi+YsUgSOLXCdW7k XaHFzu8l1uWmE7zrcMkyE24irdFrvx8CRWH/7OEN6MnIVxM7opSCoVZJOrE5B7XyUTc6 +/JDRgydJj91C3F69+BuQF4vm3gIkIEYeONJIetsChdLXbwFqbRw4UEjw7GzJmuV8815 DAv5H9f+AezQ+Jhlp930lnBdD0Bt4uQ95sDaoPrxl/gyiTe/PO1xsMDUEz8fKDhvG680 ixSA== 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=IAuPLO1NXXX2GjlvTopVslbL6mzsD4aerKxWopEcOV0=; b=Lf91QRD2SBdREeUp6CHJTIT6ZKfDYqSXVE/LdhaIvdEq9AAa9AJ3YAnRA8cGgoVIwR j21HEa4k8vR1NJE7M7qWeLOKTQstfqOsOtC3wx1BrYq1Jo2UDQk3yW9FFrdYCdNXEP3P p49gisAhYx84/ngerpjrSewPaVwott+nU5+q5KP5G3wC+735Sy4bp3dmbLtCQL362Q29 VjJ4E0eKlmUov3+C4UbLAJ86tdYza88aDROAgrI+baFvBkVQJeDhipcQYvZzyTw9Ifq4 47nipjfqbPE0rT0QdYmh6C1xSE11tcLCF0Oro/3FP+KjDB8rTYZrwd4YfzCjzimlrBg+ oX+g== X-Gm-Message-State: APjAAAUGksvtzrvdSKDRDUWTpwae1dNG5rofcohOOgl2/xzFCaT/iTsi wJmkAiOppYyJXpb6Ou86YLQ= X-Google-Smtp-Source: APXvYqxmrzRpkskz4b2beRWGwblJ8U53QdScC/djuvK/AuxHBlhrUpqau4y6mRBIbKrsHRxbDv56yw== X-Received: by 2002:ac2:4436:: with SMTP id w22mr10814360lfl.185.1575727452027; Sat, 07 Dec 2019 06:04:12 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id w17sm5644188lfn.22.2019.12.07.06.04.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:11 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 02/25] drm/panel: add backlight support Date: Sat, 7 Dec 2019 15:03:30 +0100 Message-Id: <20191207140353.23967-3-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060413_864233_1C53EDE6 X-CRM114-Status: GOOD ( 21.10 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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. There is one caveat with the backlight support. If drm_panel_(enable|disable) are called multiple times in row then backlight_(enable|disable) will be called multiple times. The above will happen when a panel drivers unconditionally calls drm_panel_disable() in their shutdown() function, whan the panel is already disabled and then shutdown() is called. Reading the backlight code it seems safe to call the backlight_(enable|disable) several times. v3: - Improve comments, fix grammar (Laurent) - Do not fail in drm_panel_of_backlight() if no DT support (Laurent) - Log if backlight_(enable|disable) fails (Laurent) - Improve drm_panel_of_backlight() docs - Updated changelog with backlight analysis (triggered by Laurent) 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: Thierry Reding Cc: Laurent Pinchart Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Sean Paul Cc: David Airlie Cc: Daniel Vetter Reviewed-by: Laurent Pinchart Reviewed-by: Linus Walleij --- drivers/gpu/drm/drm_panel.c | 58 ++++++++++++++++++++++++++++++++++++- include/drm/drm_panel.h | 25 ++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index 4ab7229fb22b..c312d5eb214d 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -21,11 +21,13 @@ * DEALINGS IN THE SOFTWARE. */ +#include #include #include #include #include +#include static DEFINE_MUTEX(panel_lock); static LIST_HEAD(panel_list); @@ -196,11 +198,20 @@ 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); + + if (ret < 0) + return ret; + + ret = backlight_enable(panel->backlight); + if (ret < 0) + DRM_DEV_INFO(panel->dev, "failed to enable backlight: %d\n", ret); return 0; } @@ -218,9 +229,15 @@ EXPORT_SYMBOL(drm_panel_enable); */ int drm_panel_disable(struct drm_panel *panel) { + int ret; + if (!panel) return -EINVAL; + ret = backlight_disable(panel->backlight); + if (ret < 0) + DRM_DEV_INFO(panel->dev, "failed to disable backlight: %d\n", ret); + if (panel->funcs && panel->funcs->disable) return panel->funcs->disable(panel); @@ -289,6 +306,45 @@ 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 phandle. + * + * When the panel is enabled backlight will be enabled after a + * successfull call to &drm_panel_funcs.enable() + * + * When the 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 at probe time. Backlight will then be handled + * transparently without requiring any intervention from the driver. + * drm_panel_of_backlight() must be called after the call to drm_panel_init(). + * + * 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 d71655b2634c..c751c9b17df0 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 does not need to implement the + * functionality to enable/disable backlight. */ struct drm_panel_funcs { /** @@ -146,6 +151,17 @@ 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 the call to + * disable(). + * backlight is set by drm_panel_of_backlight() and drivers + * shall not assign it. + */ + struct backlight_device *backlight; + /** * @funcs: * @@ -197,4 +213,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 0; +} +#endif + #endif From patchwork Sat Dec 7 14:03:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277523 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 1F925930 for ; Sat, 7 Dec 2019 14:06:29 +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 D117F217BA for ; Sat, 7 Dec 2019 14:06:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ODCEaUyl"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ONroKxMu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D117F217BA 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-mediatek-bounces+patchwork-linux-mediatek=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=xf9NKsNyQHR2BfRiB/vviR3Rp3FUoX8npF+SlTxYoNY=; b=ODCEaUylHQKRgV LS2Cx5tI3RJGYjYlhTHNBZhzQdM72SzD1SieyICpfzUHWh9lzbRvho6ftUmKvBgeFAdc1Bvxn538Y 5fiBPNBr2zk0K8a56+bKjWKxfSezKqFBBdi5mXv0G1aREr8R+4qOBE4TZHrs7p8opsfwkb5/wCnEK /r3fOjxb7nRvMdsoPUpGJrr3ll9BTVlYc//e0wpVueKSxi68m+A9LfoygGcFNqmrjrR8Rr6e6Pcwn LE3zlds9oj53RimK//6ZVQBOigPpzlq0cB4Jqf64l1qA9jlfvIlvE7tToy/vab0a7dRYCRtP/eGZ2 3iDrRO/1QI9ZdZde+rkA==; 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 1idaj2-00008v-IX; Sat, 07 Dec 2019 14:06:24 +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 1idagx-0005WC-MR; Sat, 07 Dec 2019 14:04:17 +0000 Received: by mail-lj1-x242.google.com with SMTP id z17so10642414ljk.13; Sat, 07 Dec 2019 06:04: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=5vCTCmVJSztZsLx2nB6Og8LCjqNM0f0O19o9JcKr1ls=; b=ONroKxMumL+T3hvdkZI9e/yngpNuwwNxZSNxYiSryJEsMLtAe08ansnBJYorWhKfZO hVxGTK2d5XzQTs8G3iaYWtW4eIP7t++joPvMvZ9rSfhLyN+JT1RLt4tHwxWfEyZyoH9j QXs8wv0edFhdDrvcFEx22LoEeo6VKaIKfwlNsuEuFVMvRLRADKza27bYBGswsFjyb1z2 OlztirgxOS/7wTCauSPPhVgG9IzKDrijbHgtAk3sZzkcM0BKmxNUnTec0/Tntd9plCv7 1r6rCHD4mCSj8KACmxzLunlleNO7X71r0qZBSW7VPzO+aElZICNRbynzkYzyzCsNrMO+ EXrw== 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=5vCTCmVJSztZsLx2nB6Og8LCjqNM0f0O19o9JcKr1ls=; b=sDQpDcc/XPcbiF33MlueBvwLTXdTH1JiK1EspjtBV+5ed8gu3K0+8sqxVeEWyb13He I0aJmpw9Hv6wnrQQ9lD6J1B8ZxpeboGwf+1qvVIFzAVPZw4GvUKiYIYz9jneC1lRpIa0 PV0wme+Q4WwnwsE7wcja799efjmCrAh5CsfTptxOTu2OD3usO0xiWh2xTo+imuUXJ+WO PwIu4mnCWPLulJBOEvNx12M1PXfVvCDcRp7sVPgA59dROqVRenCZg2Ds+h7G7UGbWKvo VEWnBg5Qw3ntyq/OQQYlpfk5TNiPLunll3fQydypMDwpYNT7V1YVM+C/FAzVB/5auRFp qmCA== X-Gm-Message-State: APjAAAVPefbVgLuNYSYbLsD9I8F/W4N33G9lGi5KapXtG0m9SXqeToxQ SZMf3kDOsrVPTPiJ1HHB+3E= X-Google-Smtp-Source: APXvYqw1rMaDJY7zRGC5Q0+tQaHvY5zBV064KItUGg2cwityxaKTBr2l0hHLdZAMNVa/CibXuS1pdw== X-Received: by 2002:a2e:9899:: with SMTP id b25mr11320230ljj.70.1575727453898; Sat, 07 Dec 2019 06:04: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 w17sm5644188lfn.22.2019.12.07.06.04.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:13 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 03/25] drm/panel: simple: use drm_panel backlight support Date: Sat, 7 Dec 2019 15:03:31 +0100 Message-Id: <20191207140353.23967-4-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060415_765769_94998FEF X-CRM114-Status: GOOD ( 13.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:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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 Reviewed-by: Laurent Pinchart cc: Laurent Pinchart Cc: Thierry Reding Cc: Sam Ravnborg --- 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 Sat Dec 7 14:03:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277525 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 D79036C1 for ; Sat, 7 Dec 2019 14:06:34 +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 AAAFE217BA for ; Sat, 7 Dec 2019 14:06:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dnJj7tdP"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kStv8JKN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAAFE217BA 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-mediatek-bounces+patchwork-linux-mediatek=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=s7OnppFnne8sRznYOoDYa54dKtp4rqk9i15C5w3HcUU=; b=dnJj7tdP41/zjk dc0yG9rakR6oE37B7kXw4k4y7wQzLDs6Q3rqLVYQt/2lELCQr9hz9HarzjUbVoypAYH1ReKggGM/N cSw1l0Qh3CUQU0dTaUNYzyRtRmV10p1ZUR+6WPbUpssuH2gPBQziAw0YA0+62K4iTGBEqJ5zajr1/ ciijdHXVF4pI5UaJ+DWZiAv68rHsvrCZV8VdkCbjLJUjC8el+tnGG79To88EgnYeLyXsIKxy4Ygky 9pjLIu1pnxpXMPOK/pKrL0tZFajl46vL64NGP2SPwgtcuMuEtpxsJBgisiVm5VwxIHk9qPe74YqY1 uKflJd7uYQWa3AeX+tzA==; 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 1idaj8-0000ES-4P; Sat, 07 Dec 2019 14:06:30 +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 1idagz-0005Xu-8n; Sat, 07 Dec 2019 14:04:19 +0000 Received: by mail-lj1-x244.google.com with SMTP id m6so10742415ljc.1; Sat, 07 Dec 2019 06:04:17 -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=gDEv0RS9u1sLbcP7aKD5NbZuatHNrJrYBV8mFE5d35g=; b=kStv8JKNews1ASDw7z7ddDiOlhdDEBCUGAHaTsm2tqKG4s4k0usHJl0qikxyLF9l9i b+pAsI3DhJaJ4XzVpar+XAqSpOTNRuZt5OzO/ynvbcmOcibfSycfMibvGO8KC0Racviq WDgEemyCuEarftv/+KvkNawtDborBcOYRqnGjIv5g1chot9s2DDqXvAJ/i8SLatpn3gu /befl/LXxlDAYDEaCocPaBINxBC+2eQ9QuiKj0lqbRFuYFoMycJZb4CpUXGuURBnuJ8D Mp0RLVdvzCvOakf/ZYceQr9QM6xIbMwxYbXvZbnsuwdSKukz28Dn1/CgjJC0NItO/h1P +fjQ== 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=gDEv0RS9u1sLbcP7aKD5NbZuatHNrJrYBV8mFE5d35g=; b=oNfC09f5WbMU4c9PV8THZJBCdYQXAM5xuvlaHnAgZrvb8xWFV3WJsX0LNRDNtGM4E7 ADooi5Mb4BHWtZ5ak0HGPENhbYKnEe+0qppEB0w+fuHrY/gD/UtLuDfjK5dzs+7CZmdq 9DySJyToYQh6p6KDfYb3T1KMsAd49nxqQ0IJUFSvT/SEVnk8TKN2FJufLTot0ZQFGm4F /UuRcHRkIL3/oaaFsnU7VyR1ODmTJaQ1OOU0R09dNJsCxSK2M9dUIIT5O6ZwsaQu5Zt1 aEAfm3ihdHOAsL/dAB33H6jz5GqpXRUnVzLSkhWtjT76vDi6Py+vN9rsA/ri0xiiUGoC QolQ== X-Gm-Message-State: APjAAAUeXeR+Aop5CP6vJalrx3QY1ZGMWYZ2tD3KBaj6L3PBCCY0hTMp t/GUI5HuaRSVbl3nlPUhM+A= X-Google-Smtp-Source: APXvYqzZ+jdskQadQ/ngsbumGhCcPqqfliYALT5+d2ISdCnkwPth2IL1jzPJ+7K6rUHJWF2qX8vUWw== X-Received: by 2002:a05:651c:1110:: with SMTP id d16mr11870528ljo.86.1575727455771; Sat, 07 Dec 2019 06:04:15 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id w17sm5644188lfn.22.2019.12.07.06.04.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:15 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 04/25] drm: get drm_bridge_panel connector via helper Date: Sat, 7 Dec 2019 15:03:32 +0100 Message-Id: <20191207140353.23967-5-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060417_461673_13222915 X-CRM114-Status: GOOD ( 13.38 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Stefan Agner , Andrzej Hajda , Laurent Pinchart , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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. The change is done in preparation for removal of drm_panel.connector. Update pl111 and tve200 to use the new helper. Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart Reviewed-by: Linus Walleij 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 --- drivers/gpu/drm/bridge/panel.c | 17 +++++++++++++++++ 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, 20 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index f4e293e7cf64..554da47f6d62 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -289,3 +289,20 @@ 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 the connector for the panel bridge + * + * drm_panel_bridge creates the connector. + * This function gives external access to the connector. + * + * Returns: Pointer to drm_connector + */ +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 Sat Dec 7 14:03:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277533 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 752B96C1 for ; Sat, 7 Dec 2019 14:07: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 38DCA21835 for ; Sat, 7 Dec 2019 14:07: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="K2l6FbCe"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Pw9uU8qe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38DCA21835 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-mediatek-bounces+patchwork-linux-mediatek=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=+nmNFW7zDRjrNOZgnlTVbOBZS4nfHvhy8RzjndS8Pr4=; b=K2l6FbCe0PjhEN QV4IuCnt7aQ1x0+OsheDW46CqoY6SD1Xox50qpJQMJBSZVq7pJ1c2joZxTAGNuc6ugylCgdcy0XOL TkdwUJMKi04b7h1qrQWszM3upaQpQHyk7h9xMTgS2FFtum8akmoexA/r7ESgH0GP2rxehhqjRnGV5 572AjgYrAxYmCgIRoblNb4DCS8EPaybD+PXSXooiuceYOZ2UYQnHFnu9W3jofrcmYhDWyy1QKOuVy LXWtxkn/c9xVvS+GLfsVVLbNKFb5U7RVuSnGTOSUXIEZGzvlWnUftRiru8I2+mK/4QhbGjzzYqSEs 87Fobi4p+QTvN6J6aMaA==; 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 1idaja-0000eR-LT; Sat, 07 Dec 2019 14:06:58 +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 1idah1-0005Zf-Rc; Sat, 07 Dec 2019 14:04:23 +0000 Received: by mail-lj1-x243.google.com with SMTP id 21so10750930ljr.0; Sat, 07 Dec 2019 06:04:19 -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=+bbubY9HJTCHfeW+RD8JJSmO1C6KxxFezRDYrdi2hCA=; b=Pw9uU8qeJAp8ohytY3XGLh+P4CeKQpO16ye+QVFneSGmEAiwyNngUBtZ8rQrDyT7CR +iC3fJVyy0jX1kbEIWSTs1IXjbcjd2OHH3o6weweZUSp/P97fLLnEVi6FMq4g/HGVIVc zRyRlixn4sVqUvfvRfJGrGbQcTFG3E00U3SHtkv5Isz4y+ef8jblXqn5D3miDZlXM9uK khxIxdOlkATRoi+dqxmOWIS2RGRfEN8Uuh8W3bFyTeMdjQwZiOpqZsLvLGJjgmjSC6sM kBte7/IwXu2Q3/2Wi5zRZy/izSy+xNY3j/dmcYoItgbObw5Sl+bIXCaejiGqZX1F/rv7 gppQ== 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=+bbubY9HJTCHfeW+RD8JJSmO1C6KxxFezRDYrdi2hCA=; b=VfOlHpsiiJ8nSQBsVF5xPx4vyGiu9u91xDR5gsfhSbwbYCnuoqDT7s9kII93gF11m4 9cnooG157uwmw1zzGftmeRZSOuANfUHxdjPtb9wnlP1CILonxtC6juRd8U4ALEQNJVPi fzo2udpToAc3FK6JLS+nqgXTWDcKyHHm98FsRZkD9DItZhK8M8io9g2NRHBCF0fu6uAf MUh+MCA6cXu7higOsJbnGJH+43bSS5CQWfPRzX/IGAJJO76oeD041YtWaov+tOcneR4q /P1FiVwgCv0x6W6cOS6QpWDa/7DLtZtlhfEuxrMqYR96jg5iisZpURKzgw06rZ75mVaL HN/A== X-Gm-Message-State: APjAAAVbr05GBSYf9R5BQTFymZWn+7Tdh54mQ/4z6gZI3DS8lCzjsp9w q9dAMVowU13P3QMsuyHDpuY= X-Google-Smtp-Source: APXvYqzUTfqUVkzLVVdf6rt4gq/jut8/BT7asCuk0HlLy1tuUb3fl3pA/m4JQLsuw4+2PA3icjL41w== X-Received: by 2002:a2e:9855:: with SMTP id e21mr11600738ljj.170.1575727457823; Sat, 07 Dec 2019 06:04:17 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id w17sm5644188lfn.22.2019.12.07.06.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:17 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 05/25] drm/panel: add drm_connector argument to get_modes() Date: Sat, 7 Dec 2019 15:03:33 +0100 Message-Id: <20191207140353.23967-6-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060419_978397_ECC7928F X-CRM114-Status: GOOD ( 13.40 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , =?utf-8?q?Guido_G=C3=BCnther?= , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , linux-samsung-soc@vger.kernel.org, Stefan Mavrodiev , linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , Robert Chiras , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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. v2: - drop accidental change (Laurent) - update docs for get_modes (Laurent) Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart Reviewed-by: Linus Walleij Cc: Thierry Reding Cc: Laurent Pinchart 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 --- 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 | 4 +-- 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 | 6 +++-- 41 files changed, 143 insertions(+), 130 deletions(-) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index c312d5eb214d..4caa734b4fde 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -261,7 +261,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 -EOPNOTSUPP; } 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..7e5062b07ac8 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; 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 adf2dace96e3..0b8cc199c8d2 100644 --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c @@ -309,9 +309,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 c751c9b17df0..fb01b8df8c2a 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -105,14 +105,16 @@ struct drm_panel_funcs { /** * @get_modes: * - * Add modes to the connector that the panel is attached to. + * Add panel modes to the given connector and return the number of + * modes added. * * This function is mandatory. * * Returns the number of modes added, -EOPNOTSUPP if callback * is missing, -EINVAL if panel is NULL. */ - int (*get_modes)(struct drm_panel *panel); + int (*get_modes)(struct drm_panel *panel, + struct drm_connector *connector); /** * @get_timings: From patchwork Sat Dec 7 14:03:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277537 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 76A986C1 for ; Sat, 7 Dec 2019 14:07: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 41B0621835 for ; Sat, 7 Dec 2019 14:07: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="Z3p6pq6k"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tWhw1BWV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41B0621835 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-mediatek-bounces+patchwork-linux-mediatek=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=qVbpjjpSMuX4/joUmoG8PIu4NNuUe7wfQjtm2gZKw8Q=; b=Z3p6pq6kC5Y3KI w78pT74R048lMlJY4Bkh0EUOae0HXq7R6KJMIEfktPrZWXtSmGcdC5H8yKFt7S4ri/Lemo2JxhNRo F6SIbtahi1ZZrNDUc68s4F0bcsDX3+zyClChlNqqGBZvZoG+E3GZ2RZeb1tsGyWz7UN5QJd7E3UU2 8JZHyo0q10Uf1Lm7jHuRGWY3nqapxbfq6Rjas3jeAoU//pd1Fl8T40l0wbbIVklHeiIttERYcPGcY O9KrI5A8pD3eHYmkbcMNEosu1V1hcJysorkgTbpv+ESfciW8HxbYWe1Fv9+OsVmzZumFzmUJ2WAbZ P/+2/7h7W/G2aagJJGXQ==; 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 1idajv-0000w2-Jx; Sat, 07 Dec 2019 14:07:19 +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 1idah4-0005cG-Qr; Sat, 07 Dec 2019 14:04:26 +0000 Received: by mail-lj1-x242.google.com with SMTP id a13so10680763ljm.10; Sat, 07 Dec 2019 06:04: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=8evkGsqdjsxR6zNlKLbjRkRrMXnGbeONdZJG9XNraAU=; b=tWhw1BWV4Yl2ikgOj65djC4gYLZCEkrpXDYcNsZF6C7wn617opaIeQ9W0zB4TuLATQ Gddy20esVBCvho9jBXBxERLH5W1qzHh8r+g91KW4GD7+g2wAR8WDnwmOZmPjzG1pTv7v phUAsS4hYxJhX3cLhiT3Q6NkX+PUzM+Vr3/LcRQGqgZIABQv7ab9B2z9Fw2FfpXme5/1 j/+oUBHrCS03+Mi9M5EkpgOcLOyVrbgNBkWwtFkDB+OisAKZ1mwvYkY90WsJZh6HYZTp sw3TibrcWJ/3MuAGa9kvsDKWly0n71POCIP6B+oW8PiDIWq39hVKF71ubaknqH2T5c5S yXfQ== 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=8evkGsqdjsxR6zNlKLbjRkRrMXnGbeONdZJG9XNraAU=; b=X4PI0I5JPavQgg6XtCPdT3DMDTskB2FxYNBg9ndwmKHHZp3uxD/qhLnLQ/AL66+mh7 v2e9SVHpA5qPa61yrZYR1WGDNwE+Naq0URTuXuZpIc5lEUTXuDVPHfseUI1Sw3ff50cj 1zyTrf8cQajYVu+wr/iIxwYt32Pp1wiMsihtMZ4UokkwImOk/sVVCiYGiLZSD0EdU9DT RqL2m/s8pFoTBB8nK1rf/AZO9mISpyinJ9MMLx9OXWrQhQi+smWlEmfssmaqDs8X5sy2 ipa4RGN+rbvarSr0lcWlbhkAM6t1Q4nXaOojnYJH7TULw2fy1+KOk5teMJYwQ7QQxDmk iCpw== X-Gm-Message-State: APjAAAVMFRiNURyCfJT3NZMVUVt2AsPuYyakpvHp0BrZp6Qsf1cm5YYp V6FaXsrSk9TbPneTUmDXlmk= X-Google-Smtp-Source: APXvYqx/+SUnV468LyYnP995w3QVYgJ09FxOnaYpXCmTjBFRMhaMCgkb2I0DIsChTSff65ukPpIL1Q== X-Received: by 2002:a2e:9942:: with SMTP id r2mr11974513ljj.182.1575727460821; Sat, 07 Dec 2019 06:04: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 w17sm5644188lfn.22.2019.12.07.06.04.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:20 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 06/25] drm/panel: decouple connector from drm_panel Date: Sat, 7 Dec 2019 15:03:34 +0100 Message-Id: <20191207140353.23967-7-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060423_143978_477E5EEC X-CRM114-Status: GOOD ( 18.64 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 , Stefan Agner , Andrzej Hajda , Laurent Pinchart , Benjamin Gaignard , Fabio Estevam , Marek Vasut , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , Vincent Abriou , Jeffrey Hugo , 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 , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org To facilitate moving connector creation to display drivers, decouple the drm_connector from drm_panel. This patch adds 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 keeps a reference to the drm_connector. Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart Reviewed-by: Linus Walleij Acked-by: Jeffrey Hugo 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 --- 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 554da47f6d62..1443897f999b 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 4caa734b4fde..3daebf56dc44 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -114,10 +114,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; @@ -136,7 +135,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); @@ -248,6 +246,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. @@ -255,13 +254,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 -EOPNOTSUPP; } 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 fb01b8df8c2a..5c62dfe73c68 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -139,13 +139,6 @@ struct drm_panel { */ struct drm_device *drm; - /** - * @connector: - * - * DRM connector that the panel is attached to. - */ - struct drm_connector *connector; - /** * @dev: * @@ -204,7 +197,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 Sat Dec 7 14:03:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277549 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 1824614BD for ; Sat, 7 Dec 2019 14:08:12 +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 DF4D424670 for ; Sat, 7 Dec 2019 14:08: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="uTDTk9FY"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sllq2ePX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF4D424670 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-mediatek-bounces+patchwork-linux-mediatek=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=Oh+eSbZdGbF9MhWHm9lMbOaPzMsJmwkZVY7ZRhc67Sk=; b=uTDTk9FYDxWoWc eb8x82z4cFQE7KQ4K1ezSU/mh1JKcCjxAXU2Jk/3v9maekIAEh0GpbJr0hDTq+PvRKMov37OXkNfd CDhUYt83ThWnrNLm/MFVUD9evd3dXNyE3L9Vl07tg9tjmzgMflQBtsLrLgVYbq3JqVFL4CQ7bzhyI 6VI6da4UCW5pGvVzmyDrW1LwwmV07Gy7iNiLPbLEpzS2RDb9vb8kLZE8c1xUoyiDFXBi9agMRigyQ d80p5bXYjfviqKN+GgMR0fqnJr/oJXLCjCXnHvHWp5oxQtTBlVZ/ghCrzcgHVkv5ylSya9T5tVpQc hdzdN62+unCuOXK3gASg==; 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 1idaki-0001br-Rp; Sat, 07 Dec 2019 14:08:08 +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 1idah7-0005da-3Q; Sat, 07 Dec 2019 14:04:29 +0000 Received: by mail-lf1-x142.google.com with SMTP id 9so7397439lfq.10; Sat, 07 Dec 2019 06:04:24 -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=gR58eaxcFb3u7zE/4U+FDGi+VP78py5ZvZcYPjpTaLg=; b=sllq2ePXGGvjQGN9sJ6Cexg0SaBMhcQyKWuGqbUKfu5i/AsW9wfqVSLH03+bAebhHA NGPvT4RTeDLTrm57YuqVu0LR4pz4GedOlER7XMq1kx/ag5KvZimKe/EuP+OSxsAICImH CiNp5PLXC3lCRPEe8QVI/hzLC3ik3IUhYuism86Iuv4eogkqHGZOFRQd5b0n5d+VPwLC Or2RM3/6xqC4DoWTpz7AaifnUNT8T0LVKWhydoH5tYv4IFQeULxB8gDH92a44WBzEIdF BlEDE6bCZuuqIUfVE3Jf3p2eBrafb+LGNp4jr3/6E398r87FMr1mlGO+dkkIxKdO7IsC 2k6g== 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=gR58eaxcFb3u7zE/4U+FDGi+VP78py5ZvZcYPjpTaLg=; b=qA2luY0jC9HtsUqqzGK8DuW1ueB8UKCu9zRoCxa3ZQGqp4+LnhcaTmzdolUnSIb/wK 3AoM/ZpvBa26xKUzu6LxNqMEBNlsjhPkvnmmVTnwmyJ65UOqwSy6Tnl0hE1ymLkOE0+Z frXajTgqUP/JgrD4ELw1NRDmKrdWMEvhTWjf2NxIc+Y6wyQYsitFHLM2YFItjN+IO70R F1b9C3FGTMB7P3slcy5QnJbKAu0LXlnb6dmagBSp4oB4mgp/Qab0JnNLY5CecEifsf9W XWKFp9RkVwshMJJjBwjVPfnG5d7TbWu97Xg9ivNY88TFfPtEa8uL9ZypcTrna4C1QObR Ra6Q== X-Gm-Message-State: APjAAAU7xsLcnUYn0JOu7qJGWAQV0Fc7XZjHs9h8zolcqsJMeDeG4SZM 29W7cq1eOomSLxtPeLn3Cz0= X-Google-Smtp-Source: APXvYqxZY73th5LcErkHNXbzH/+aHgH0/rMHu4A2zTaRLwpzTcNza+wlKndhP+9CbNuVwMShjcPeYQ== X-Received: by 2002:a19:f00d:: with SMTP id p13mr11187974lfc.37.1575727462835; Sat, 07 Dec 2019 06:04: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 w17sm5644188lfn.22.2019.12.07.06.04.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:22 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 07/25] drm/panel: drop drm_device from drm_panel Date: Sat, 7 Dec 2019 15:03:35 +0100 Message-Id: <20191207140353.23967-8-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060425_279887_FA275B5A X-CRM114-Status: GOOD ( 15.68 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , =?utf-8?q?Guido_G=C3=BCnther?= , Stefan Agner , Andrzej Hajda , Laurent Pinchart , Benjamin Gaignard , linux-samsung-soc@vger.kernel.org, Stefan Mavrodiev , linux-rockchip@lists.infradead.org, Tomi Valkeinen , Jagan Teki , Robert Chiras , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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 longer have any use as they are empty functions. v2: - editorial correction in changelog (Laurent) Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart Reviewed-by: Linus Walleij 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 --- 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 3daebf56dc44..993e40c0d582 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -114,11 +114,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); @@ -135,7 +130,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 7e5062b07ac8..f394d53a7da4 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; @@ -663,26 +664,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 0b8cc199c8d2..8f078b7dd89e 100644 --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c @@ -312,7 +312,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; @@ -320,9 +319,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 b878930b17e4..18e745104aaf 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 d6299fe6d276..ec449c18beba 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 5c62dfe73c68..d2142e4170c8 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -132,13 +132,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 Sat Dec 7 14:03:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277543 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 44CC6930 for ; Sat, 7 Dec 2019 14:08:03 +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 1DF7524670 for ; Sat, 7 Dec 2019 14:08:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XuHCQEV0"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="euqtqE1p" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DF7524670 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-mediatek-bounces+patchwork-linux-mediatek=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=C+OQdJCMIvDjwmXFDt8g0rm67YMl6ads/oYEgtqLSc4=; b=XuHCQEV01z1Bh6 gH8nQStc8dpMhJv14ocUnkHgX4rDranEZ6h32Gd8iu+d9Q4/fLR+qPtzuhXCIM4JcGXPcN/+AEKY5 rfFr9KDXqqiO4VKcJ9xwKBWZFy4ODbOjYDfijmaosAJP4G2BSHs8R/ICv9Al/jRjW3hAANV37cuob MNtFdWdVOUeetO7gY3LuHvZIw3DR49gHKovkk0Qf+QnHbRD3N/V7Kq+c9zP2DoxO21lVbGF/lvcsK rPB13sJHtC0eUDJFw3q1tLEdTxSXrGO3C5KTsutHPIcih/dOfe/BdWFJa9+5CQjh7kRde66OptlCF Wf46ahecL1Ag98QzQr4g==; 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 1idaka-0001Vn-JT; Sat, 07 Dec 2019 14:08:00 +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 1idah8-0005eT-1n; Sat, 07 Dec 2019 14:04:28 +0000 Received: by mail-lj1-x244.google.com with SMTP id u17so10723622lja.4; Sat, 07 Dec 2019 06:04: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=a/X1ku96PJtMOzhRmVeY8hbSu7FlKPaZgSc8fbXe+3Q=; b=euqtqE1pfc3hrle5JL0T16PR1L5s+gJEwTWJzevgh0O7PZ66Jv2B50bf0spx1cau+t QePMKRl0lP8NMT/G0y+Ypfpy91xuYEAdflY9cuxYUJR/0OtX6NIbaI0Er2rS3gOxnFdt tg16hWbgLAlhru+jIbcRH4wTMqohJwkGHXeWOqt1JIFNw5fgO/4JyanxyGnXsyCZDap7 wtYXIJhQABWszpbteIBw62xqiMfEYV29xOzGzGBNS/teKsSMj9y40x3IcYVfhxsgzd1u w/xEqE68bfhC3Sm5xv8oSO/g158a13sKqoy5QP+n5wZILCXOqSVde3mfFu4Il/I6sGtq bLbg== 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=a/X1ku96PJtMOzhRmVeY8hbSu7FlKPaZgSc8fbXe+3Q=; b=SMTRQzUQ0bev2upJ2aW7Z/EF6XXHbb2mcfmHYT/e1W7dbgUtsqIoUEUnaf+VtI1Y/Y S8yVhdbLiR4Kg8cKS1RBqA8pQ0lbaKL+2p0Az3elxzUqpQOKStPAQO2IGJrMKU5pziRj gNUfu2rhM7AIVKtXKQ4WsEP7qx36CsTCuWAjJVZIr+PPr/0fulOuT4fZwUUnwWwRAsn8 ++YysI3Qy5Ft5/AWlC5EUpgkjbbD9pvcQP7ybNO6F2C8ggVB55/Potd1qbUeTfBXMk8d e8CCMaaPJSyCPBu1Q8AbFXPKeGZ7c3B945B/MPJZbWOeTzEt5Gm75p3ko7oblTu/vLJB H6Tw== X-Gm-Message-State: APjAAAXU+/dNfoFQs/6eo9qN4E49dTbHvsAWUXKMd/Cx9FWnkVyzGj6t 2Z+L4HMxfchE7S22N+FQKpI= X-Google-Smtp-Source: APXvYqwFENSCVyDVwakZNKkQAOC32yhJVErz1ubaDfyLjZVYnCk6bftAg9IioG6emITjn57KtG6AsQ== X-Received: by 2002:a2e:2e0e:: with SMTP id u14mr11617285lju.106.1575727464491; Sat, 07 Dec 2019 06:04:24 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id w17sm5644188lfn.22.2019.12.07.06.04.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:24 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 08/25] drm/panel: feiyang-fy07024di26a30d: use drm_panel backlight support Date: Sat, 7 Dec 2019 15:03:36 +0100 Message-Id: <20191207140353.23967-9-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060426_138836_334AE6A8 X-CRM114-Status: GOOD ( 11.80 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart 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 Sat Dec 7 14:03:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277551 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 39A0C930 for ; Sat, 7 Dec 2019 14:08:14 +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 129EB24670 for ; Sat, 7 Dec 2019 14:08:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WPNPE9B3"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HqZQqzcX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 129EB24670 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-mediatek-bounces+patchwork-linux-mediatek=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=2As77zGiy3N4pDlWfyp06cXs8pJjWvEsAv/wBlvISr8=; b=WPNPE9B3jDP/MN SeHnNAL8sPb3CCk6bqPm4xETHX0kRSXlxi7mFMkZsvChfQKfJFSyEtiLce6ZKDjch/XFRjissoUj8 LPwWIbG4Ya2kcr/TvL+c0gqc8ralthOcBtxKfs515h3IA8ciqnY5RXnIeYRRRzWL4MFu2blZp1AtQ Gc8UxPWkArALvBJnSUqAVQzTz5oQgNbBBacpMnex2nSCF8W0DZ+Q9MCK78W6mYmaqXOgfZEaXcnqu 1BNOr2+aZAlWnfgyqoyIjyigtwjjqErHrXhxRhnFrkk7r1ebyWhV82c72xzJhrCEKX1eWPZHi3PTV IiKNVcc99b+p65FPGXSw==; 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 1idakl-0001ee-OV; Sat, 07 Dec 2019 14:08:11 +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 1idahA-0005g6-G1; Sat, 07 Dec 2019 14:04:30 +0000 Received: by mail-lj1-x242.google.com with SMTP id a13so10680932ljm.10; Sat, 07 Dec 2019 06:04:27 -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=63FAYeXHOLWZvE39+BvFTQvx8rk1mNWwTMgVp4w9KIs=; b=HqZQqzcXLz6qqDnZBbtAncz09h4HHdF2Rkf9L00gHYZQMGeLF4pATtZsOyBRySDv3s Bl3agh2QBKbOWCqCed3xKaiQ1hIYC4wfRE3lkCWQUbcCp2hc82VNbjrgwBfWtPlyOUUj TJPJwwUs5scJ4AZ3yh3dgLIhOcFzhQCvGwbnLzxnHt909E9Zlma812SMN43OXAbuKxhA TH6UiuR0tJW2YyO2/ggmZGxM7VQ+KvuhI20nEw/+PuNfy6SuD4QeOEzWmGd6pbg/zb+1 IKovefo+w7fUJoUZPp71KIiPRelS6vNLmT9JDbi+oRq5TSvBn3wWF86rEoCCs2oWMu1x V6Sw== 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=63FAYeXHOLWZvE39+BvFTQvx8rk1mNWwTMgVp4w9KIs=; b=a847/VLfA7Yjm26J7oX8PiVacVlJ88GPwHCTzDLq/3J3PZWWO2q2u8f/hqtOHv9MJu 7ZTrMp7Dm0fCODJtDpJ642ADRq+Rv2UjwJ3cF9UlCBHW/blddMy+Wkkdb9UhwNdt1vcE LXJJYuV6ySGeNZyaYmXMOrAPyRcdK5J4r7dhI76/aPcwqnosoIJawSlE7ormwBT3EC7R YI5Oji0IdlA4sjn+rwdj+/s3uOUzb6ZkK2IerTPRLtfNFrFJuCMExPfRmoiQevlf1mGs EUZlMRheZ0edk3QlgbPUPruXGWzbxPLRwZ+rZzofskjcF6eDA5f/o5K1sLrv+l8JYQJP SlcA== X-Gm-Message-State: APjAAAUl/10Nb1zbP9FQGFsIMHcIUBeObFVbpywfga4jOFuwQ+sCFnfU rhZqX6CPZoWU75GtdsxI7iw= X-Google-Smtp-Source: APXvYqwCXvyDmoKVIc4zlBB2XBU0M9Y6CN9iEAOB/MhVUE9gB+QmdDrvfL6CdFab3+wa1LcGnDUevg== X-Received: by 2002:a2e:548:: with SMTP id 69mr11532790ljf.67.1575727466338; Sat, 07 Dec 2019 06:04:26 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id w17sm5644188lfn.22.2019.12.07.06.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:25 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 09/25] drm/panel: ilitek-ili9881c: use drm_panel backlight support Date: Sat, 7 Dec 2019 15:03:37 +0100 Message-Id: <20191207140353.23967-10-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060428_764536_CBAC9315 X-CRM114-Status: GOOD ( 13.36 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart 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 Sat Dec 7 14:03:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277559 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 2DBFA14BD for ; Sat, 7 Dec 2019 14:08:42 +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 0BE5C24670 for ; Sat, 7 Dec 2019 14:08:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="s6137jKw"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZfHiRiue" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0BE5C24670 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-mediatek-bounces+patchwork-linux-mediatek=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=Jsrq/VeCtiGl9cEUmxzE3fdN5fn6x+AovvWPp8lP+PM=; b=s6137jKw7gPKa1 g/QD0trDxnu+FwO5n6e7zXfcpefe0ajKjxY7xD8i+i50UzmYtDYGup2rCBJtF9QOCu1yA8GX9Wz0E K64PnRCKC/oBuY+UkN3isWzqrho4m0jlSvFY+i7RDhpxDS8oKRa1vvX8vPbuAyL/LvNGq5PQmVnpo poUIXN0tKv5YyqXTFGQj0GAn0g0o0wrEBbktP6+Hjt4O2DF6CtxtHPj1b3vCp0XX8u6gQ2hASfecR N21f9M0XlYYkA63Lvz4ROZnhtrGAGE3DTKVkzyroYdzaWcf7HOrxR7XMWI7Kpc0BzDOfCzqiX469d EpMGk8sDsMtbAzBWEIkQ==; 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 1idalD-00026a-2V; Sat, 07 Dec 2019 14:08:39 +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 1idahC-0005hL-1O; Sat, 07 Dec 2019 14:04:31 +0000 Received: by mail-lj1-x243.google.com with SMTP id m6so10742809ljc.1; Sat, 07 Dec 2019 06:04: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=PEkkKHiq+AcHePdv87qZ46O+yNk0TpaePUBzT0oWsAc=; b=ZfHiRiueSHRoMm/wWPg2IEAFbC+nin4k5/h6+jqp6YAW6dtNdKpHxhLUqyQBrdiW5X IS69T1/XMFvXqXGcc956VzDbI9EAU0LALkPtX5E1ULJfoYNnPXw878/lGy/5UDWRyoZn lOJzZCmr3W4w+L4mhA22VZAR5ei76vWyygf4hVaS3BMOuchXlSmvt1qbmiOnS6ogFTSO AFppLqocMVslabJ7DToSGuHPtYw6gN3Q4temBKQ8tfmnNP9Mpz7mwHqyqb78C40OcI3S W84v8/HgfHEL4T9hbGi/iSwgNqm/ytbENpyqiJ1UF+/MPBXwVyJpguDgnGdveWD5YDi/ QtIA== 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=PEkkKHiq+AcHePdv87qZ46O+yNk0TpaePUBzT0oWsAc=; b=T7ClYDaIz2TVic+kBYIV5PYjvA3gscZarplT0t6PvYo2bzCuUDhSrKcD02BQBXZetG u+Kf6LKedeQeEJ+4X9yRoobJP8KuHihrJjJfUbVY1fm/b7rLchAFcgBKakT3rzU69KDs jnH/FQfHBG+GyTn3lFZ2secp72GU/Sgom4N4h2wUyJPryVPQiRH+M4p599cb1fvp1uB8 Lu56LTC0Pj9bXyAhYACJrhP4yFN0z4kSPnMo0ilWLqNE4EjVEbrV5d8VGFxj4L+HGn6T fBa/hlh/te9SuO3JoK4joDBHtHb6A273BDvWxWlCjtcfMBiD+DIW1DwObsHjN/EM4+sa XC4A== X-Gm-Message-State: APjAAAWDNzAKzeXKOBf1ECVsfHSmgAaRcwY+6qGiYqcuOXPT9u3kFpxM nU1gV9vXzDp05qoTFD+ai8w= X-Google-Smtp-Source: APXvYqyvSwIE32v2Kp9t6aC1p3mZ5oj9u6z9msGZC5D9TpRLAqQ5hY1QRbeh6HQns7Z439S/CNir0g== X-Received: by 2002:a2e:978d:: with SMTP id y13mr11771522lji.103.1575727468217; Sat, 07 Dec 2019 06:04: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 w17sm5644188lfn.22.2019.12.07.06.04.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:27 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 10/25] drm/panel: innolux-p079zca: use drm_panel backlight support Date: Sat, 7 Dec 2019 15:03:38 +0100 Message-Id: <20191207140353.23967-11-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060430_120786_9EAE15E1 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:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart 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 Sat Dec 7 14:03:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277589 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 4E62B6C1 for ; Sat, 7 Dec 2019 14:11:32 +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 2C82824677 for ; Sat, 7 Dec 2019 14:11:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TqRJpID3"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="s22pFD4Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C82824677 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-mediatek-bounces+patchwork-linux-mediatek=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=jQXxfrlPchiqbA3UnoL/R6QwwtyjAey0EsULuKV8IAk=; b=TqRJpID3t372hM zvHcjPo9n2eE5Val75HRPp9icIPH6SmQ5h2qTPc6zO3lLHeNmXPVMuhyMPN2r4UFf6F9cCa9RG5LY 9hPhp3y3n14bGvkwVEjyG1yHCoxlS0rSLbgFCRjUY8rICYJ5f1FSyAFGkxGz9j7IzYYiIcqkyhClC PhKEOlQh+foCwZs5Bo8reRAzoBTx2R2+a3UpvYnDsw6VZkqBRV22ppq7IYdjwXDXbwzGNUu97IF8A vC0axAx2Rq/fUU8VBj/V6yVH0W9zwzcykhTmC7m6OKjm/pDnsZPnXHt6OSc+o+oYyx03vfpOiHi+Q GYKInC4kqH4RFwDE0rcQ==; 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 1idany-0005tx-Mx; Sat, 07 Dec 2019 14:11:30 +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 1idahD-0005iv-MJ; Sat, 07 Dec 2019 14:04:43 +0000 Received: by mail-lf1-x144.google.com with SMTP id y5so7411562lfy.7; Sat, 07 Dec 2019 06:04: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=uCcsUdwReshm9HwMNcrU5BxdMhIAKJ/ocTck1sZP+Fo=; b=s22pFD4YrEM3PFFzKv+ZLsVIXm+HdH/EaDdcclRIe89iftvcVnXlN37VAJLTLRpKCI Joj9aeFpY8riXENAwhHWUGERnh/I5RyC2zHkzJ4cvd/ly3H5g+HjF7GEvZPbNkirgs3P ZVynpmSQopiLvYNmQKwKGrQsFS4gud4WijDs1HgxL2uNpFOb7fIg/6ULqcKqAMszS3Rj 3KtWDPxC+GD7oLwj9GPbI4DrWrOgAo6SdNIDXyYnDcF7eOmSvKVExMRWyVzwV/tSHyMC E76/PwPIZVH4HkQC9Me7Eg88eefxTIt8g9IHrCvjj+IcTjeu1oIAncoo/mzoGU9hxyPr B8Ow== 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=uCcsUdwReshm9HwMNcrU5BxdMhIAKJ/ocTck1sZP+Fo=; b=roLDPej+1NQu+5DK7stNvJ/EYY+PlGf7dWDPk1DNe3O4RcDhz9IBjVVa55H5E9dVQw DrC0MyYeZIH6OMP4C9+yGvMq+ZyvyEkWDRjg2q2+Hke3NmhR0/g7wNry8L/x9fNvw2F/ 53Iqs6Bs4RPyQECCb6iKrjQg168CVF3SMXexYsz07yQFuSgD9ggMqdnLmSGNTVVxRUEm IKd6OhG0wBcyB5IHbI6+cg9NSyIxuV4RyCnIPsyNHCYSAWcBc3d4Qsm5jSAdqdKdl+pw Xv8Wkk/7iFgaSV1ru6DUCyeF3xEBhm+OIC5ioEKfLTDW1wcVDVz9vhERKOp4OVHXVJmK 2I8A== X-Gm-Message-State: APjAAAVHoAmtg5Cg+OpCxYJ5JmUKAIuYNObDYd2hIS6SWhapUNIxYsBS 6c3aUV/eQ+cCOval8KYpIBQ= X-Google-Smtp-Source: APXvYqwODyhNxo//UXLNaOKxcezmY/8FXmz3+HXMvPwIlwOjWb5g2QkT3BMHdTPdMLzXRsxZlWwl5w== X-Received: by 2002:ac2:5635:: with SMTP id b21mr814144lff.127.1575727469887; Sat, 07 Dec 2019 06:04: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 w17sm5644188lfn.22.2019.12.07.06.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:29 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 11/25] drm/panel: kingdisplay-kd097d04: use drm_panel backlight support Date: Sat, 7 Dec 2019 15:03:39 +0100 Message-Id: <20191207140353.23967-12-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060433_429173_3678C6D5 X-CRM114-Status: GOOD ( 12.60 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart 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 Sat Dec 7 14:03:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277587 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 4130D112B for ; Sat, 7 Dec 2019 14:11:31 +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 1EE4824679 for ; Sat, 7 Dec 2019 14:11:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dMvQu5C9"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jJMVa7cV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1EE4824679 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-mediatek-bounces+patchwork-linux-mediatek=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=Bqaa6OJCDyHlGnneF6IEMVa72YhtCfNxRm2JGALI1Ls=; b=dMvQu5C9SA3hU6 1zJgapIf8M4O81Ru8RintR1CkMj2xLdd3Q1RIECEka3LWvbpgL1JLF8fpEd0eLf8V8r61FYRsJJR8 tSqqPATz5cvmVuTzUk6bYqVGWIKILYWZOjEBxktRwzdCacTdQkCwrOYYzccVOutV3Sn9MJ4i5TDfW ESX+4/Ep42gr5r0DO6SH+mWLOvNitk+YSUULTYPYeDcRlR6PFauKCsNwi0e+Th/h2Qnu1i+YziHrk YOQcbptqYXVeUIpy5fx7Bfu5Hb3SCWCkKvQ/lSkxlMsb8DFYsrtqXVPXowkURS+h/XXhQYtVyQYkw YEk+7ey2CXjrxCTszzgg==; 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 1idanx-0005s6-BH; Sat, 07 Dec 2019 14:11:29 +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 1idahF-0005jh-0G; Sat, 07 Dec 2019 14:04:42 +0000 Received: by mail-lf1-x142.google.com with SMTP id l18so7432673lfc.1; Sat, 07 Dec 2019 06:04:32 -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=MSWnR6VdohNUNOoFOCWn8BMjZQT0wFgumDrz53vPK98=; b=jJMVa7cVhgExq5uNImKtY6/kAmaigjLdQdldbzHZ8hHjFeI1pllqcDO4VPkreZkZUe gInPMWKqkwzqBMn59QbKd6B4gjT7NocpAfheSUD7gPQrHOPNEVCqbh38OtEbOEm0XJng FNCtKiR4ukXNMybUrn3xS9B9vJtxzZJpUHaSYVbSwXYai/MhVi6loFQFyYJ/WNXSqhvm 4g79W0XLNcpsuHCRaif2tYztXzPefA4N5hLfLFp/G5J/Qivb0VZauDHAmJFEcWWu4OyZ bR//VvZOUNtfe1bu6uWhvILlq1BXI5fPkjY+cevovvV57fcE3l2izpgpliMgAcGWx2S9 4J/w== 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=MSWnR6VdohNUNOoFOCWn8BMjZQT0wFgumDrz53vPK98=; b=c13h8MOnp1nZWmJs5Ax+1eClQrj0kgMJEoXGjho/R/4LfknWCjQ+dkFYZtbDkumoHm u1b0jPcJ2r2nu72n8nmbXjqz4dSVZRze5/SXr5wEaGsRSeBxzecJq3JLcW7UYeBvxcoX xUaVCYepyKsb1QOyrTRnosjHKEfNvRMs4XYagHYHMgh5MjwNvUJ11vb/U1e5AxYy0OL1 HAlzl328lecNE2FxibJiNVgUqoBnNJO8l56DKj5RudMKBqCxIYW0TsVt/ECkJwFUbaPF sPl3qc7d42hPgyGHGfSCCy8KLuTRayzIunIkSD/hVQFUk3QpS8aT5S6ImjFbMF9Kz5ur DCmg== X-Gm-Message-State: APjAAAX9ETc6Ob1EXY3W6eB1e2gOv1QRIFwMMr406y8c7oxrCRuFynUR mf9TUjl/gtkanzxF5nBntNQ= X-Google-Smtp-Source: APXvYqyNmfcdDlQvYICW2Ts4KjEsPdwDqWLhVGnv7aiHkVxrXOcZ/rYb2aF+AgT/0jQiarjudoHLkg== X-Received: by 2002:a19:6a06:: with SMTP id u6mr6860850lfu.187.1575727471568; Sat, 07 Dec 2019 06:04: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 w17sm5644188lfn.22.2019.12.07.06.04.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:31 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 12/25] drm/panel: lvds: use drm_panel backlight support Date: Sat, 7 Dec 2019 15:03:40 +0100 Message-Id: <20191207140353.23967-13-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060433_360438_31CA2EC8 X-CRM114-Status: GOOD ( 12.67 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart Cc: Thierry Reding Cc: Sam Ravnborg --- 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 Sat Dec 7 14:03:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277581 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 CB2E26C1 for ; Sat, 7 Dec 2019 14:11:07 +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 8C83324677 for ; Sat, 7 Dec 2019 14:11:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Efe98y0t"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eXo50RX1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C83324677 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-mediatek-bounces+patchwork-linux-mediatek=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=PFCsI/CqS6ntZyZwaJXGyJEukEEr0U1wuxeU0LezkfI=; b=Efe98y0tp1ONsB VCpG1mnITS9/D/Ya/xH1N5GcNN9zSWsXZok/w2Kur9NlxBo8c5v+NMxf1tvmS8KjnkC2MfUEVELLT Ys5fjV+3Oauu/PaOh7/L83m9Mbdknv1h0KMqJKmvCmm2e8C65//Yqq56okW/fEdtb5oNsXAEqhAyY nuGOneSro5pTjBk94UTua5EB9i9JreS1Wqz8owR9rIxR2ULzp34tH5yjnb8xSRyNvGjlhovWoZPrJ /nNKOVOXkCs7XZ6QkmsD2AtcVSSyptozGowBay96nwhR1vJtmu1dgVhFcTI294SAxwfU7CzMigJkr k7fVHMerfMjmGV+iTkxw==; 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 1idanZ-0005YZ-2t; Sat, 07 Dec 2019 14:11:05 +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 1idahH-0005lm-5v; Sat, 07 Dec 2019 14:04:43 +0000 Received: by mail-lf1-x142.google.com with SMTP id y19so7378435lfl.9; Sat, 07 Dec 2019 06:04: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=66uC10NTDsBRb7X6vStnogHiILcbdjND8PJjJ30cYbk=; b=eXo50RX1awgOgNqXA1euoTjADMDxJIIFt7Pu3nB1qA9kL/D53Wde7x1V7fPKl2ER6f mKPD6elw1ZuMST7wwxBb3iv3VN9n4mHUZuCyvBBdvRZ+zO9nzDUfgM+nr89reyidFjk2 5bl5lEnsZ5a+YLW/5u7sk+EqFefyVyztWmjYqKsrM0j+3Hu9JYA32AFZOHg/zXqQEhil EaIetBjkLamIOXtQH7Ef+AHxOdglN5O/sqEFpPCFljHdlSqIYsq3aggg2FUtPigLHmwG Qwnhq8a1y98GH4vItHdyUv4SzuVygkRRme4IlJZiEXPhgPjwJOXY5+RKh3KzTEoOj3Oe uylw== 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=66uC10NTDsBRb7X6vStnogHiILcbdjND8PJjJ30cYbk=; b=lITHTzSCzcrBLldgODRU9dCl2c4yyG7ZpnKWz4rudE2q1iZ2/Z/oH6t4PcCZlXnsGz q67CquRFG92TFiReB51HIKRIWVpsF5KmRVQxL+5dOIDxqMopXsRGaiRIe8RgOIDhWD+t WOz6RyoK4jT4JnQtJLQB+hFT6SqmDWckQWarcHtCmGx6bjFlEOClB2T2Cj1/dxEzc1og eLWS9cezyZE3heKgvn9OMg13WO9mtT+uIfFfTmI0aXTVpow/YXP8ckd0n1AswszZHJiE ELEk/gcqmSu4ANWHDHDVScYvf669MXOvPopr1ypi6uIg2E9GRYFkzyFnrMbjhlIxMiAU RjXw== X-Gm-Message-State: APjAAAVSD6yf56ylkaeK/KIlkfn0KnuI2gsxRhv+kRId7mBReV0JEeg8 TVU85iL58/su5fyOG2OP/zQ= X-Google-Smtp-Source: APXvYqxVNVpfDn6H4MM9EgRQ26sPL400SlH6382v5r0u3Jj20zEKSwiT5FQB/2Gog+qGIuLc4xC8dA== X-Received: by 2002:a19:550a:: with SMTP id n10mr10813033lfe.104.1575727473305; Sat, 07 Dec 2019 06:04: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 w17sm5644188lfn.22.2019.12.07.06.04.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:32 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 13/25] drm/panel: olimex-lcd-olinuxino: use drm_panel backlight support Date: Sat, 7 Dec 2019 15:03:41 +0100 Message-Id: <20191207140353.23967-14-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060435_436473_6538958B X-CRM114-Status: GOOD ( 10.77 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart 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 Sat Dec 7 14:03:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277585 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 44D11112B for ; Sat, 7 Dec 2019 14:11:29 +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 1CD8224677 for ; Sat, 7 Dec 2019 14:11:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="U7wrUFXk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jrIBA/vq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CD8224677 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-mediatek-bounces+patchwork-linux-mediatek=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=oF7wJ3vYZSvlCUR1BtKHVJthWXCC1pMT4bc9PNRInPQ=; b=U7wrUFXkxX8e55 TXpNS3P6ZHYKokvFM/dzgxpKqoT2sLS2SBOg8Vu9o+MYnlmSikyczm8QNoP0TdFpYlIAPCWpQ7TeQ PI4TIq6Gkic46bfbGWQfsb7tD8BE00GvqTOgs68NS2I54QOme+blgWN2hUGEJuZWEJ89QOJ1IwxvB vq2agMcDXbo/ZSWQLAY8iGWJFla7fCF/AEXtA+XKgD+VNgDv86yUokxqg0LHSFBl1Bn+J2FZR2mtL ux4L+3BVoCHPq44TEcOPuYyEm7Nwci19rQyc0H/xUOvNtMB4JOZKFqqcTdGflh6c2BLOqc9jIvAYG 8nj4Ixj9bUBqxyHKwEJQ==; 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 1idanu-0005pj-Do; Sat, 07 Dec 2019 14:11:26 +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 1idahJ-0005mv-1J; Sat, 07 Dec 2019 14:04:43 +0000 Received: by mail-lj1-x243.google.com with SMTP id k8so10695285ljh.5; Sat, 07 Dec 2019 06:04: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=QgFTzPZd3zR98m50NY0shuKpKVuv4VS4hyjW7Qv2Omk=; b=jrIBA/vqZodxViATSQARFkZD7wiEmAHsUlNjZymh8plju65SezxDVb232LWzAO7ZIW kFmv4T1O4tF5vglDYs7mo4WPhnmXCBga6BPzrqpFEBPGLxUnHCEBoSwvhJwtj7oRuhlS 6rwymBSXbUJPHSE7F/TU8cIy0yfuhOGxq2EqTEjr+GR83yUN1lmmKWt05j/V1aizGnHO wgK6mWeVCzmN88mPT83aIwPcsTK3vHQyFbEpBjVUFt4zCSV0mYD0xYZ3Pshw39dUtj4c 43kY3UcyVgHIbBrvs4Oc2i2daiu7MlFv1k5I9puW67OdIwCy5GI7bOhctWxExoJ6EIrm kodA== 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=QgFTzPZd3zR98m50NY0shuKpKVuv4VS4hyjW7Qv2Omk=; b=UpakUKBJ+WSe8Vdt8wqsklknkiXjm/K3IqZPtMs/iPV+oFPsAmcm0vBWEJeDFZNKam ZS/ncBRwM2Lj6EmjiiC7ypRzDRSJqV3bYcFCQytFA5MCa9LCr7K3jDDLX5LL5tizDiHf RIz4wyGdynTkIbXrxbj+PQNHFqu5NB9YB9/GOjgz446if+e8vF9VEbHGutPq5IxWEO9T qh7qsBC+GgM4u5ZiW2+cya4RTJTylN4p8eH/S3J90/ugY6KKY95XBtjO/kBnS6uEVLHQ dqMCdGwjVLGCW++KVgUfT3UaVYfyFQAeq6/FBrTRLiDuiHUBLcf7O1ruhnfxF4HJS/c6 qEwg== X-Gm-Message-State: APjAAAXxv3b29pLM8ey4SpD5CAnbFG+z7DV96UwTbAHYTeg86TNGTZsf bt0Cw3BAgVaJKdxdRF1cBKE= X-Google-Smtp-Source: APXvYqwqO/B3zDP/lU5w3BMKEFkPcSjN9evJVHeZCNcA2LQ9S+SRHMryllzKBI+PlPdvQ9Zo/y8d+Q== X-Received: by 2002:a2e:9b58:: with SMTP id o24mr11509631ljj.197.1575727475273; Sat, 07 Dec 2019 06:04: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 w17sm5644188lfn.22.2019.12.07.06.04.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:34 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 14/25] drm/panel: osd-osd101t2587-53ts: use drm_panel backlight support Date: Sat, 7 Dec 2019 15:03:42 +0100 Message-Id: <20191207140353.23967-15-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060437_151368_EC6CB958 X-CRM114-Status: GOOD ( 12.10 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart 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 Sat Dec 7 14:03:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277591 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 544C56C1 for ; Sat, 7 Dec 2019 14:11:33 +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 3227024679 for ; Sat, 7 Dec 2019 14:11:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EU9PNZmM"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GLR0ghga" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3227024679 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-mediatek-bounces+patchwork-linux-mediatek=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=00UWZ8e6scFcZiiaY74ai9zhv8BNOPV+AlTWjcnRku4=; b=EU9PNZmMZSxJCC SO4saWZOCtTgW7P3H6yqT4G2JiMY6kq7wo75PWnd54uLPLDty8+hXm+VtxNo26hPIAHneYlnWNI+s 2Qq+3P15IW0DM7wU0MBAwHiyWLLUHX8yNlbpTOfpt4n/uFEsLwRgHSHWo/oNj44yYJExY3cgAM4G5 pZiRmq0gKKBcsP7gHNtHJOH9SlQnCChjylHxo0X0UJQeHBuzlYnxsAVgtBskVrwt3kVUriAXDYp8K L8Su3rvykbfwTrhbGF4VgE5XuFcjgU5cseoU55DwWfFgJs5gh1rarK1DmQLpt2oTkAq0C6ypwrLMQ Wp3mcgUN0iCXXL+EySag==; 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 1idanz-0005uy-At; Sat, 07 Dec 2019 14:11:31 +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 1idahK-0005o0-W0; Sat, 07 Dec 2019 14:04:45 +0000 Received: by mail-lj1-x244.google.com with SMTP id m6so10743068ljc.1; Sat, 07 Dec 2019 06:04: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=nh+auvkxV6hzFWp6G1ySZlQ+h5mj84VTfDwYW3UcNEg=; b=GLR0ghga41ugllFnX9V68j3o6mCPObjN2evzL1OX/t2lGBgTB8wmIPLgwwMBOpjpDq Nk8zbYrhiz40wWzyaxFyDCOx9Qp3c7eNa8A/95q5A1Qqh83tyWD1BVp0y4VctW8mG+WZ DAA9mowrjQXH5AcAt80VyzXd/OACUG56WyF75bVLrPavuEBdVpRprBVKB4AV35/ONJLz 6OVdFjErq0R1IIbK1uTpO/rvDNpe+vSvtO8NekSaF7kbDOnEy/SGbQ4OnXGYt3pmaEeA mb8xoiJxNRlo37czxRawcLQfn8YURT2gt7i/+ojRcPc73xXdZuJ4AZGjcgILa50pJKcz KvKA== 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=nh+auvkxV6hzFWp6G1ySZlQ+h5mj84VTfDwYW3UcNEg=; b=ufRMWxxx69KVhHPgTVcmQ0LeGJc7hVlxzH5ujs7GoSze7LRblFFWzVNcMCEFgIaKck qwAk4uiKwaZFjKWPjpBkfl93aiiCeri/+7uzF7Wp10UH6gGNXPj55dV+zIS2M0eL7e5Z ogqNSwRqxLD8YRyYWCzjDd1NpfNCFqt0v4236pM32TnOHyJR2XdltR2MD3gQkVlbCzPX Yxx+h/s9Mo8shu91JxEGWtM2Bvy83agSlHRTy1GeB7pNeYFBhLCBdGUKRvghUMDCWrxD ErSgyaDVQJ44tXhKLFHOV9uYl05Zu+g/JCLL51A1LkjajWXm4CeP5v1Y0nEn8628E6mc FpVg== X-Gm-Message-State: APjAAAXqkUCNtkmwihdyhOh7Nc4q5vMWiP6Y4vlDe+OPuXpOMFUmcmRR gwOCA1ICmZAO4Fxe7nse99g= X-Google-Smtp-Source: APXvYqwiY4N+GIwVJEZXPGgmoqNV1sicVH+q4kCFtsUl1LtIrxYJcm5qUL/ngh8pFMnKlvdyCiPdfA== X-Received: by 2002:a2e:2418:: with SMTP id k24mr12093950ljk.49.1575727477038; Sat, 07 Dec 2019 06:04:37 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id w17sm5644188lfn.22.2019.12.07.06.04.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:36 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 15/25] drm/panel: panasonic-vvx10f034n00: use drm_panel backlight support Date: Sat, 7 Dec 2019 15:03:43 +0100 Message-Id: <20191207140353.23967-16-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060439_084896_E8004307 X-CRM114-Status: GOOD ( 13.25 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart 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 Sat Dec 7 14:03:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277595 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 E9FA36C1 for ; Sat, 7 Dec 2019 14:11:46 +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 9949B24677 for ; Sat, 7 Dec 2019 14:11:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="O3ef+vzm"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="del00zw1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9949B24677 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-mediatek-bounces+patchwork-linux-mediatek=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=RrLAhbwYcAa4MyTa6kiCf0BNJesqDsacj96L7lGDEiA=; b=O3ef+vzmjiGiIY WJs/LEV4lLlY22sDi52TTKuaK6EuU2Df2U9XSyvqOYM6ahbN34vh3BOYHH74mZcmJa9su3v+9HfP4 r83SS0ebtw72SjWy9XBUcqBOoF/Dy40KOvd3Ce7Cbo30iMdZKhQd6QEvf4OX0lqS2U8cIS5ukh97K f/9LTTFuOY36lktOcD0VWZw7eZxkGj/F6kXY25gGWpMxi3lqFLuzczU/RCQi3uKzLb5em7WIsC+9R ZXtbh8+mVA4dguHl68HXbqkeH1qI8elTKm3h+13QGehwCcmbL0lfL5F3bYZWK/RJPGYlWw0ORdk7p HIaQYrjlBAXOut6fPdoA==; 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 1idaoB-0006Dz-G6; Sat, 07 Dec 2019 14:11:43 +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 1idahM-0005pD-Lp; Sat, 07 Dec 2019 14:04:46 +0000 Received: by mail-lj1-x244.google.com with SMTP id d20so10659723ljc.12; Sat, 07 Dec 2019 06:04: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=9ajEOdCUpT16GVN8gH4RbvIy9yc0BScTRBZ/ljCGiME=; b=del00zw1hnJOSv6lindha+LEL+pXCeIab6795BI3uAGU4qQMEuuUbjQwOGzbrRfYnV sLSpfj7wW3bvryQATj7Q51EwRQD7wRWf62nDjfn6BJFcMaN5LBIhK6IJMt0XJ1Ebfo6J XUVLV3X2Ol3AiWrAA9fIpAo3H6pPHhti2T+aMNzt8UWn1Bt5wiHgZX3ad8qBtPltlD/C 46l3GHw3p5o3zqTX2ZlVW52Bzx2xLd494I1jvveB4FXyii3QJbWyltaWAjdwlm7zXUoI jqbYvwE1QXqvMA4YnM5UQcphd58kDP+oaaRq+YP7wmtRkB5l6+6cYecRYZcs/vzQN+4A dMQQ== 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=9ajEOdCUpT16GVN8gH4RbvIy9yc0BScTRBZ/ljCGiME=; b=YGdJuC/X2V/toaE8r5Y1nWc734OKytkjyGGx9u08057xlvOrxDHlELliU+odCJbtKm RVZHH8dtEmlodTUS2BgNRX4lJKPj/iOZMgV4ZLfVYalIZy3Odmzx4XiOKOOJJaHHW7jL Sav2d04QtOzbr/OPifUdsvuUDWVCWC/IIT9cQFsig+uwhLRgmnVS/OpvU9Qg+NbhREG0 lb89PamKL0fiTBsiig7xzBM+my2e/8a7Z7xVKAAcDFm3bPeblRh20W1OtdOLYcFYN5BY cA3DHuREfoiFqc0L9+hvgXFCl7Z4g3gnRBq1gddTkVKjQtzjucoFJbjZNTZqS7seBeIZ cVpQ== X-Gm-Message-State: APjAAAVC8ZFoV60ndMBqQm5sPTGg7j51Uw+wn3XhXhPyFQnDc6ZjUvHe KFnZI2cpG54I2YCNwIzgbvA= X-Google-Smtp-Source: APXvYqzCbSGlblzAZsh3pGQCv4tblDf1OnHgS/cPV5hd9q+X+WS1X5hlR+rDAbIA4PDjxaKo1Ddq2Q== X-Received: by 2002:a2e:9890:: with SMTP id b16mr11789523ljj.190.1575727478849; Sat, 07 Dec 2019 06:04: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 w17sm5644188lfn.22.2019.12.07.06.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:38 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 16/25] drm/panel: raydium-rm68200: use drm_panel backlight support Date: Sat, 7 Dec 2019 15:03:44 +0100 Message-Id: <20191207140353.23967-17-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060440_869870_F563E936 X-CRM114-Status: GOOD ( 10.91 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart 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 Sat Dec 7 14:03:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277597 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 D5537112B for ; Sat, 7 Dec 2019 14:11:49 +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 ADD5024677 for ; Sat, 7 Dec 2019 14:11:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dRci7FNb"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cZTvjGkj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADD5024677 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-mediatek-bounces+patchwork-linux-mediatek=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=coOaAYZQK0xHdZh0s+SRPmxB9eSjO2vLvYvYDmdRGV0=; b=dRci7FNbAy0hSL 5vIrC7yXYPw7VeRt0J72itAJiip7PgxeXEy+mhRE3ppQ+Jcho6fWVCxkDZgRJ4dv96uaB61FmzU89 asFzlnIlxhScTpf6kxdnbSV28xOTAk2y+XD5TRR+FhZVKDDnl9n5coSvsrg6I4L5zSpqZOrKoaUp6 6sVkdTR5OGxvY4dDJLOhIfMsz/lPOc2tCkPSY4dzIwyG3le3UAOg4HxmHuqNlbEqu7XIA4Lyd+I9L ggkrToLJOO7bOPQICQGwucQ8Savu3fLYA0HjvQw6zQ1iVJImlXIqiG9rGdd90lCkAHgFsXq8XXKa3 aNbFIVn5RGQimrWCdb7w==; 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 1idaoF-0006JZ-GG; Sat, 07 Dec 2019 14:11:47 +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 1idahO-0005qK-T9; Sat, 07 Dec 2019 14:04:46 +0000 Received: by mail-lf1-x144.google.com with SMTP id l18so7432867lfc.1; Sat, 07 Dec 2019 06:04:42 -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=VaBvhdhNtObbqsxPerTgXU57K3m4iUiAmX6XWjRdma8=; b=cZTvjGkjrfyjv3XvlFQLZd1fBYvUwA2F7rgXxqR3m5nmg4z4VuWhpUyxwuWV5mLHFW EdupZomTGwmdPvT58sN7eRALuAXX1G0Nf92Bt0sdGN7fHTxOx7iUT0HS0GMmbu4ySvtw z1MUgMzIaR7Bwp2VeOeHbW+y77pfYovpN7W+UV2JENCEMJ1WGIHs4myc1V5VnsO2AiKE 2tga/sY6fV6bOSKUJ3nKwOYkXHC1SOsy0XuCyXv/SWN3wThH9FXB/1CboBK4SmOHKKmO SPscZrSICFYQIb1PpbDJJ10R9p2xTo/OvSCjOU7YcPTtvqZD2jvRDV1/q6CSOmLuOh1R ldUg== 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=VaBvhdhNtObbqsxPerTgXU57K3m4iUiAmX6XWjRdma8=; b=qx1nrcZnask0Zh9IAHEyJTe/wdjrVFQbRLI2vJmTv4aagZeMcxzeeKtSy00si4jDQh ckFwRdVNELQC3qL6oEGTMsD75j7WVb/Nawg7wuFK7ldv2MdsPTM6TD7V2joskCxpdvjW g7QEGrFgCKpEUT6sL45w52zZVbliZhz0Ae7eYeFcUNAycCewRA8J8MZxWuiVLWkKnm7X R6RvlK6G5YTLqmE9OnkeLRtZ4uTTfkL3OTp5MgcOnZ0NgHRivyxHzyCBSTNBkxw+Yjta bxvv73Yy09vJcHYNcFrKyROmQOTP+6F7SqQNwsnlt8xYRhCv+Lnt+seNx83NcYbLFZlT QAFw== X-Gm-Message-State: APjAAAXIFd7nPmBlnZCOBw3ybQvB672u14VjKEjDXAzeqb/KDJFb7PD3 NduoJhYpqk8fOt7ia2PjgTs= X-Google-Smtp-Source: APXvYqwM0erZxo6LOlySak2aMfBaSTmHMVITDmR/sT0HyMLyvaaqCnJATLGaFQPO9c/qhW5jo19sYg== X-Received: by 2002:a19:ac08:: with SMTP id g8mr11551704lfc.112.1575727480871; Sat, 07 Dec 2019 06:04:40 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id w17sm5644188lfn.22.2019.12.07.06.04.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:40 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Subject: [PATCH v2 17/25] drm/panel: rocktech-jh057n00900: use drm_panel backlight support Date: Sat, 7 Dec 2019 15:03:45 +0100 Message-Id: <20191207140353.23967-18-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191207_060443_142559_BB4C79A5 X-CRM114-Status: GOOD ( 11.90 ) 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.0 SPF_HELO_NONE SPF: HELO does not publish an 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , =?utf-8?q?Guido_G=C3=BCnther?= , Stefan Agner , Andrzej Hajda , Benjamin Gaignard , 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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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 Reviewed-by: Guido Günther Reviewed-by: Laurent Pinchart Cc: "Guido Günther" Cc: Purism Kernel Team Cc: Thierry Reding Cc: Sam Ravnborg --- .../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