From patchwork Thu May 30 09:34:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 2634621 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 9747BDF2A1 for ; Thu, 30 May 2013 09:35:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030368Ab3E3Jf4 (ORCPT ); Thu, 30 May 2013 05:35:56 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:49832 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030342Ab3E3Jfw (ORCPT ); Thu, 30 May 2013 05:35:52 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4U9ZqJc003356; Thu, 30 May 2013 04:35:52 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r4U9Zq1N005718; Thu, 30 May 2013 04:35:52 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Thu, 30 May 2013 04:35:51 -0500 Received: from deskari.tieu.ti.com (h64-9.vpn.ti.com [172.24.64.9]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r4U9ZJ1v002669; Thu, 30 May 2013 04:35:50 -0500 From: Tomi Valkeinen To: , , Archit Taneja CC: Tomi Valkeinen Subject: [PATCH 23/32] OMAPDSS: don't use dss bus in suspend/resume Date: Thu, 30 May 2013 12:34:44 +0300 Message-ID: <1369906493-27538-24-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com> References: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org We have support functions to suspend and resume all the displays that are used with system suspend. These functions use the dss bus to iterate the display devices. As we aim to remove the custom dss bus totally, this patch removes the explicit use of dss bus from these functions. Instead the for_each_dss_dev() macro is used to go through the devices. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/display.c | 77 ++++++++++++++------------------------- 1 file changed, 28 insertions(+), 49 deletions(-) diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c index ba83ec3..dfe3322 100644 --- a/drivers/video/omap2/dss/display.c +++ b/drivers/video/omap2/dss/display.c @@ -76,74 +76,53 @@ void omapdss_default_get_timings(struct omap_dss_device *dssdev, } EXPORT_SYMBOL(omapdss_default_get_timings); -static int dss_suspend_device(struct device *dev, void *data) -{ - struct omap_dss_device *dssdev = to_dss_device(dev); - - if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) { - dssdev->activate_after_resume = false; - return 0; - } - - dssdev->driver->disable(dssdev); - - dssdev->activate_after_resume = true; - - return 0; -} - int dss_suspend_all_devices(void) { - int r; - struct bus_type *bus = dss_get_bus(); - - r = bus_for_each_dev(bus, NULL, NULL, dss_suspend_device); - if (r) { - /* resume all displays that were suspended */ - dss_resume_all_devices(); - return r; - } - - return 0; -} + struct omap_dss_device *dssdev = NULL; -static int dss_resume_device(struct device *dev, void *data) -{ - int r; - struct omap_dss_device *dssdev = to_dss_device(dev); + for_each_dss_dev(dssdev) { + if (!dssdev->driver) + continue; - if (dssdev->activate_after_resume) { - r = dssdev->driver->enable(dssdev); - if (r) - return r; + if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) { + dssdev->driver->disable(dssdev); + dssdev->activate_after_resume = true; + } else { + dssdev->activate_after_resume = false; + } } - dssdev->activate_after_resume = false; - return 0; } int dss_resume_all_devices(void) { - struct bus_type *bus = dss_get_bus(); - - return bus_for_each_dev(bus, NULL, NULL, dss_resume_device); -} + struct omap_dss_device *dssdev = NULL; -static int dss_disable_device(struct device *dev, void *data) -{ - struct omap_dss_device *dssdev = to_dss_device(dev); + for_each_dss_dev(dssdev) { + if (!dssdev->driver) + continue; - if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) - dssdev->driver->disable(dssdev); + if (dssdev->activate_after_resume) { + dssdev->driver->enable(dssdev); + dssdev->activate_after_resume = false; + } + } return 0; } void dss_disable_all_devices(void) { - struct bus_type *bus = dss_get_bus(); - bus_for_each_dev(bus, NULL, NULL, dss_disable_device); + struct omap_dss_device *dssdev = NULL; + + for_each_dss_dev(dssdev) { + if (!dssdev->driver) + continue; + + if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) + dssdev->driver->disable(dssdev); + } } static LIST_HEAD(panel_list);