From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Cousson, Benoit" Subject: Re: [PATCH v2 5/6] OMAP: omap_device: Create a default omap_device_pm_latency Date: Fri, 16 Sep 2011 13:52:27 +0200 Message-ID: <4E73387B.2030403@ti.com> References: <1314973520-3585-1-git-send-email-b-cousson@ti.com> <1314973520-3585-6-git-send-email-b-cousson@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: Received: from comal.ext.ti.com ([198.47.26.152]:49827 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751968Ab1IPLwe (ORCPT ); Fri, 16 Sep 2011 07:52:34 -0400 In-Reply-To: <1314973520-3585-6-git-send-email-b-cousson@ti.com> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: "Cousson, Benoit" Cc: "Hilman, Kevin" , "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Paul Walmsley Hi Kevin, On 9/2/2011 4:25 PM, Cousson, Benoit wrote: > 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. [...] > - 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); > + } Here is the fix for that part. I did the easy version :-). Splitting the structure in two parts will indeed require more work. I updated the for_3.2/1_omap_device_cleanup branch. Regards, Benoit --- >>From ad163000568dd61dee441473d0a576d84152da9e Mon Sep 17 00:00:00 2001 From: Benoit Cousson Date: Tue, 9 Aug 2011 16:54:19 +0200 Subject: [PATCH v3 5/6] OMAP: omap_device: Create a default omap_device_pm_latency 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 | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index 7b2cf62..54bbe7b 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,17 @@ struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id, if (ret) goto odbs_exit3; - od->pm_lats = pm_lats; + if (!pm_lats) { + pm_lats = omap_default_latency; + pm_lats_cnt = ARRAY_SIZE(omap_default_latency); + } + od->pm_lats_cnt = pm_lats_cnt; + od->pm_lats = kmemdup(pm_lats, + sizeof(struct omap_device_pm_latency) * pm_lats_cnt, + GFP_KERNEL); + if (!od->pm_lats) + goto odbs_exit3; for (i = 0; i < oh_cnt; i++) { hwmods[i]->od = od; -- 1.7.0.4