From patchwork Fri Mar 10 04:32:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9614781 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 0C37C60415 for ; Fri, 10 Mar 2017 04:50:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F35E8286C0 for ; Fri, 10 Mar 2017 04:50:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7C4A286EF; Fri, 10 Mar 2017 04:50:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 A92E4286E3 for ; Fri, 10 Mar 2017 04:50:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 608E16EDA5; Fri, 10 Mar 2017 04:50:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x231.google.com (mail-qk0-x231.google.com [IPv6:2607:f8b0:400d:c09::231]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2CAB06EDA5 for ; Fri, 10 Mar 2017 04:50:30 +0000 (UTC) Received: by mail-qk0-x231.google.com with SMTP id p64so152529392qke.1 for ; Thu, 09 Mar 2017 20:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yOqwO3oQAzOggGzJgVTVyiVu8FOzStwVUZUIYrwG4ok=; b=CZmRwAtpAec1F+TOd9NfOKzQd9UGMGYyLwR1psYroEr3n2Y3VIuYhNt9mMyPpTfDpj 8vAN3vcSaITYVCxCPMDM6FMbKRzEOMINQ40wiotU41tp/j+DnhC4jFSC+/m7D2YqamHa 6vyB1neiefnJIr2Ro7jSERao+iChawvww9Xek= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yOqwO3oQAzOggGzJgVTVyiVu8FOzStwVUZUIYrwG4ok=; b=knthF3G6aDJe3XN1wLKFIbcbYlnQqH9VKbRPqZk8gMo2+iJD3/1W7FWLLlsqOZ9nit B462g40w32wr/PHkd+OEVAKqkfUIcPe5tImhzv4+geVk2S3t2bz1osF2su+V3pIhV69k Z72d7LToEkI5Df4TFSnX6lM/O6obAGcj5GbvTGYl6VWYccXbTka/W5jzFp26Sh2End1N X0tEnPCSDsLuokWGX2207EX/rOv5lGIlvOEfk2I0zAYiOd0Wi/OnHxw+TMy+acQe1sxv rPv8XsbUhcjVFER4A7UQvwKQneZa4LYv3vedXAoZojzYEyuUEXEOwpzqmJfP0K1ZUPeK a81w== X-Gm-Message-State: AMke39keMyvW96ttIJLAoo7thrpyAAzyjJnRHdzJyfB/jCJDWTO4eidPIIp+Iv288jUhOBCY X-Received: by 10.200.40.86 with SMTP id 22mr19232753qtr.245.1489120906495; Thu, 09 Mar 2017 20:41:46 -0800 (PST) Received: from boxwood.roam.corp.google.com (cpe-75-189-128-87.nc.res.rr.com. [75.189.128.87]) by smtp.gmail.com with ESMTPSA id n19sm5697731qtn.35.2017.03.09.20.41.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 20:41:45 -0800 (PST) From: Sean Paul To: linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH 34/41] drm/bridge: analogix_dp: Allow master driver to cleanup in unbind Date: Thu, 9 Mar 2017 23:32:49 -0500 Message-Id: <20170310043305.17216-35-seanpaul@chromium.org> X-Mailer: git-send-email 2.12.0.246.ga2ecc84866-goog In-Reply-To: <20170310043305.17216-1-seanpaul@chromium.org> References: <20170310043305.17216-1-seanpaul@chromium.org> Cc: zain wang , Lin Huang , Tomeu Vizoso , Brian Norris , Douglas Anderson , Tomasz Figa , Yakir Yang , "Kristian H . Kristensen" 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 From: Tomasz Figa Since we take the ownership of drvdata, the master driver does not have any means of accessing its own data from unbind callback and all it can do is calling the analogix unbind callback. However it might be necessary to do some clean up in the master driver before we really unbind the analogix part (such as PSR unregister in Rockchip case), so this patch provides a plat_data->cleanup() callback which is called at the beginning of analogix_dp_unbind(). Cc: Kristian H. Kristensen Cc: Brian Norris Signed-off-by: Tomasz Figa Signed-off-by: Sean Paul --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 3 +++ include/drm/bridge/analogix_dp.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 65af5ef8ec12..6391f5da7643 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1651,6 +1651,9 @@ void analogix_dp_unbind(struct device *dev, struct device *master, { struct analogix_dp_device *dp = dev_get_drvdata(dev); + if (dp->plat_data->cleanup) + dp->plat_data->cleanup(dp->plat_data); + analogix_dp_bridge_disable(dp->bridge); if (dp->plat_data->panel) { diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h index 4fc0165ed3f5..414e9a7f362e 100644 --- a/include/drm/bridge/analogix_dp.h +++ b/include/drm/bridge/analogix_dp.h @@ -36,6 +36,7 @@ struct analogix_dp_plat_data { struct drm_connector *); int (*get_modes)(struct analogix_dp_plat_data *, struct drm_connector *); + void (*cleanup)(struct analogix_dp_plat_data *); }; int analogix_dp_psr_enabled(struct device *dev);