public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: "Cousson, Benoit" <b-cousson@ti.com>
To: "Cousson, Benoit" <b-cousson@ti.com>
Cc: "Hilman, Kevin" <khilman@ti.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Paul Walmsley <paul@pwsan.com>
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	[thread overview]
Message-ID: <4E73387B.2030403@ti.com> (raw)
In-Reply-To: <1314973520-3585-6-git-send-email-b-cousson@ti.com>

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 <b-cousson@ti.com>
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 <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
---
 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


  reply	other threads:[~2011-09-16 11:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-02 14:25 [PATCH v2 0/6] OMAP: omap_device cleanup before device-tree integration Benoit Cousson
2011-09-02 14:25 ` [PATCH v2 1/6] OMAP: omap_device: Add omap_hwmod_name_get_dev Benoit Cousson
2011-09-26 18:24   ` Kevin Hilman
2011-09-02 14:25 ` [PATCH v2 2/6] OMAP3: beagle-board: Use the omap_hwmod_name_get_dev API Benoit Cousson
2011-09-02 14:25 ` [PATCH v2 3/6] OMAP2+: pm: Use hwmod name instead of dev pointer Benoit Cousson
2011-09-02 14:25 ` [PATCH v2 4/6] OMAP2+: pm: Remove static devices variable for mpu, dsp, iva and l3 PM Benoit Cousson
2011-09-02 14:25 ` [PATCH v2 5/6] OMAP: omap_device: Create a default omap_device_pm_latency Benoit Cousson
2011-09-16 11:52   ` Cousson, Benoit [this message]
2011-09-16 16:41     ` Kevin Hilman
2011-09-02 14:25 ` [PATCH v2 6/6] OMAP2+: devices: Remove all omap_device_pm_latency structures Benoit Cousson
2011-09-26 22:36 ` [PATCH v2 0/6] OMAP: omap_device cleanup before device-tree integration Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E73387B.2030403@ti.com \
    --to=b-cousson@ti.com \
    --cc=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox