From patchwork Wed Jan 10 19:25:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 10157523 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9D948601A1 for ; Thu, 11 Jan 2018 08:30:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E29828727 for ; Thu, 11 Jan 2018 08:30:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FE572870B; Thu, 11 Jan 2018 08:30:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 362432870F for ; Thu, 11 Jan 2018 08:30:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C6E46E3F1; Thu, 11 Jan 2018 08:30:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.siol.net (mailoutvs3.siol.net [213.250.19.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2A33D6E373 for ; Wed, 10 Jan 2018 19:25:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTP id 88CF7520EE7; Wed, 10 Jan 2018 20:25:32 +0100 (CET) X-Virus-Scanned: amavisd-new at psrvmta11.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta11.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id qA9FmQSAPhJE; Wed, 10 Jan 2018 20:25:31 +0100 (CET) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTPS id D655B520F26; Wed, 10 Jan 2018 20:25:31 +0100 (CET) Received: from localhost.localdomain (cpe-86-58-68-135.ftth.triera.net [86.58.68.135]) (Authenticated sender: 031275009) by mail.siol.net (Postfix) with ESMTPSA id 624DF520F28; Wed, 10 Jan 2018 20:25:29 +0100 (CET) From: Jernej Skrabec To: maxime.ripard@free-electrons.com, airlied@linux.ie, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, architt@codeaurora.org, a.hajda@samsung.com, Laurent.pinchart@ideasonboard.com Subject: [PATCH v2 05/12] drm/bridge/synopsys: dw-hdmi: Add deinit callback Date: Wed, 10 Jan 2018 20:25:05 +0100 Message-Id: <20180110192512.19684-6-jernej.skrabec@siol.net> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180110192512.19684-1-jernej.skrabec@siol.net> References: <20180110192512.19684-1-jernej.skrabec@siol.net> X-Mailman-Approved-At: Thu, 11 Jan 2018 08:29:58 +0000 Cc: Jose.Abreu@synopsys.com, devicetree@vger.kernel.org, jernej.skrabec@siol.net, narmstrong@baylibre.com, mturquette@baylibre.com, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sunxi@googlegroups.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Some SoCs, like Allwinner A83T, have to do additional cleanup when HDMI driver unloads. When using DW HDMI through DRM bridge API, there is no place to store driver's private data so it can be accessed in unbind function. Because of that, add deinit function which is called at the very end, so drivers can do a proper cleanup. Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 3 +++ include/drm/bridge/dw_hdmi.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 7d80f4b56683..1b7650f2b425 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2589,6 +2589,9 @@ static void __dw_hdmi_remove(struct dw_hdmi *hdmi) i2c_del_adapter(&hdmi->i2c->adap); else i2c_put_adapter(hdmi->ddc); + + if (hdmi->plat_data->deinit) + hdmi->plat_data->deinit(hdmi->plat_data); } /* ----------------------------------------------------------------------------- diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h index 4a35e5065f6f..9ad83054a5dd 100644 --- a/include/drm/bridge/dw_hdmi.h +++ b/include/drm/bridge/dw_hdmi.h @@ -124,6 +124,7 @@ struct dw_hdmi_phy_ops { struct dw_hdmi_plat_data { struct regmap *regm; + void (*deinit)(const struct dw_hdmi_plat_data *pdata); enum drm_mode_status (*mode_valid)(struct drm_connector *connector, const struct drm_display_mode *mode); unsigned long input_bus_format;