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: 10155965 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 6326760231 for ; Wed, 10 Jan 2018 19:27:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5558B27D4D for ; Wed, 10 Jan 2018 19:27:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49B1428372; Wed, 10 Jan 2018 19:27:01 +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,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D294727D4D for ; Wed, 10 Jan 2018 19:27:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=AVgZcNl8aTneQ64FcY7Qgk0MXDPiFKGrsd8BfBFQrAM=; b=cedUOYd+7LMUkzyl5IZjRtkzSm lDOWqivdznkg7kKBhzykqaoZ310o4+ImHwHfO+Aygym/lOywS90/gXgcr7QfhdjdHKcOHeVnZLez5 6IOT0QafIWn8E8pgeS5/3DPBWDCNlozCtP7YSQt4gBhp/lAWy5iXTO0aZ7XSkg470VWsYiDgA6AJW wjsEK75tiHsaSR14WTURi1YjT9xvRqQns9Acel3nm4zmhXNQEEwXz/gaImfM/+cv+VdyD/EmsMIN4 /Q8F+oSkYkGxf+fcwU+odR9EVh8QXIjjtosKB/hiWnfyNapAQQc/Uuwc/8+4QTrgtxd1fiA2q1gQy A7jC0HIg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eZM1a-00060y-WA; Wed, 10 Jan 2018 19:26:59 +0000 Received: from mailoutvs2.siol.net ([213.250.19.135] helo=mail.siol.net) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eZM0X-0004TT-B7 for linux-arm-kernel@lists.infradead.org; Wed, 10 Jan 2018 19:26:00 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180110_112554_060331_7CDC1EA1 X-CRM114-Status: UNSURE ( 9.86 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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;