From patchwork Mon Aug 22 15:19:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Cousson X-Patchwork-Id: 1085732 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7MFKPZY030475 for ; Mon, 22 Aug 2011 15:20:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752825Ab1HVPUW (ORCPT ); Mon, 22 Aug 2011 11:20:22 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:44885 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752725Ab1HVPUU (ORCPT ); Mon, 22 Aug 2011 11:20:20 -0400 Received: from dlep34.itg.ti.com ([157.170.170.115]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p7MFKGn3032744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 22 Aug 2011 10:20:16 -0500 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep34.itg.ti.com (8.13.7/8.13.8) with ESMTP id p7MFKG3W020777; Mon, 22 Aug 2011 10:20:16 -0500 (CDT) Received: from DFLE71.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7MFKGG1026266; Mon, 22 Aug 2011 10:20:16 -0500 (CDT) Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle71.ent.ti.com (128.247.5.62) with Microsoft SMTP Server id 14.1.323.3; Mon, 22 Aug 2011 10:20:15 -0500 Received: from localhost.localdomain (lncpu04.tif.ti.com [137.167.102.15]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7MFJT1t002210; Mon, 22 Aug 2011 10:20:14 -0500 From: Benoit Cousson To: CC: , , , Benoit Cousson Subject: [PATCH 6/7] OMAP: omap_device: Create a default omap_device_pm_latency Date: Mon, 22 Aug 2011 17:19:06 +0200 Message-ID: <1314026347-21623-7-git-send-email-b-cousson@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1314026347-21623-1-git-send-email-b-cousson@ti.com> References: <1314026347-21623-1-git-send-email-b-cousson@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 22 Aug 2011 15:20:39 +0000 (UTC) Most devices are using the same default omap_device_pm_latency structure during device built. In order to avoid the duplication of the same structure everywhere, add a default structure that will be used if the device does not have an explicit one. Next patches will clean the duplicated structures. Signed-off-by: Benoit Cousson Cc: Kevin Hilman Cc: Paul Walmsley --- arch/arm/plat-omap/omap_device.c | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index 455594a..f2149be 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -97,6 +97,14 @@ static int omap_device_register(struct platform_device *pdev); static int omap_early_device_register(struct platform_device *pdev); +static struct omap_device_pm_latency omap_default_latency[] = { + { + .deactivate_func = omap_device_idle_hwmods, + .activate_func = omap_device_enable_hwmods, + .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, + } +}; + /* Private functions */ /** @@ -510,8 +518,13 @@ struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id, if (ret) goto odbs_exit3; - od->pm_lats = pm_lats; - od->pm_lats_cnt = pm_lats_cnt; + if (pm_lats) { + od->pm_lats = pm_lats; + od->pm_lats_cnt = pm_lats_cnt; + } else { + od->pm_lats = omap_default_latency; + od->pm_lats_cnt = ARRAY_SIZE(omap_default_latency); + } for (i = 0; i < oh_cnt; i++) { hwmods[i]->od = od;