From: paul@pwsan.com (Paul Walmsley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 14/19] OMAP: HWMOD: Add support for early device register into omap device layer
Date: Mon, 15 Feb 2010 18:24:58 -0700 [thread overview]
Message-ID: <20100216012455.1101.2409.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100216011942.1101.14348.stgit@localhost.localdomain>
From: Thara Gopinath <thara@ti.com>
This patch adds support in omap device layer to register devices
as early platform devices. Certain devices needed during system boot up
like timers, gpio etc can be registered as early devices. This will
allow for them to be probed very early on during system boot up.
This patch adds a parameter is_early_device in omap_device_build.
Depending on this parameter a call to early_platform_add_devices
or platform_register_device is made.
Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
arch/arm/plat-omap/include/plat/omap_device.h | 5 ++--
arch/arm/plat-omap/omap_device.c | 33 ++++++++++++++++++++++---
2 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index 4677ff7..3694b62 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -90,15 +90,16 @@ struct omap_device *omap_device_build(const char *pdev_name, int pdev_id,
struct omap_hwmod *oh, void *pdata,
int pdata_len,
struct omap_device_pm_latency *pm_lats,
- int pm_lats_cnt);
+ int pm_lats_cnt, int is_early_device);
struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
struct omap_hwmod **oh, int oh_cnt,
void *pdata, int pdata_len,
struct omap_device_pm_latency *pm_lats,
- int pm_lats_cnt);
+ int pm_lats_cnt, int is_early_device);
int omap_device_register(struct omap_device *od);
+int omap_early_device_register(struct omap_device *od);
/* OMAP PM interface */
int omap_device_align_pm_lat(struct platform_device *pdev,
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index c739a04..5904358 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -307,6 +307,7 @@ int omap_device_fill_resources(struct omap_device *od, struct resource *res)
* @pdata_len: amount of memory pointed to by @pdata
* @pm_lats: pointer to a omap_device_pm_latency array for this device
* @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
+ * @is_early_device: should the device be registered as an early device or not
*
* Convenience function for building and registering a single
* omap_device record, which in turn builds and registers a
@@ -318,7 +319,7 @@ struct omap_device *omap_device_build(const char *pdev_name, int pdev_id,
struct omap_hwmod *oh, void *pdata,
int pdata_len,
struct omap_device_pm_latency *pm_lats,
- int pm_lats_cnt)
+ int pm_lats_cnt, int is_early_device)
{
struct omap_hwmod *ohs[] = { oh };
@@ -326,7 +327,8 @@ struct omap_device *omap_device_build(const char *pdev_name, int pdev_id,
return ERR_PTR(-EINVAL);
return omap_device_build_ss(pdev_name, pdev_id, ohs, 1, pdata,
- pdata_len, pm_lats, pm_lats_cnt);
+ pdata_len, pm_lats, pm_lats_cnt,
+ is_early_device);
}
/**
@@ -338,6 +340,7 @@ struct omap_device *omap_device_build(const char *pdev_name, int pdev_id,
* @pdata_len: amount of memory pointed to by @pdata
* @pm_lats: pointer to a omap_device_pm_latency array for this device
* @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
+ * @is_early_device: should the device be registered as an early device or not
*
* Convenience function for building and registering an omap_device
* subsystem record. Subsystem records consist of multiple
@@ -349,7 +352,7 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
struct omap_hwmod **ohs, int oh_cnt,
void *pdata, int pdata_len,
struct omap_device_pm_latency *pm_lats,
- int pm_lats_cnt)
+ int pm_lats_cnt, int is_early_device)
{
int ret = -ENOMEM;
struct omap_device *od;
@@ -407,7 +410,11 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
od->magic = OMAP_DEVICE_MAGIC;
- ret = omap_device_register(od);
+ if (is_early_device)
+ ret = omap_early_device_register(od);
+ else
+ ret = omap_device_register(od);
+
if (ret)
goto odbs_exit4;
@@ -428,6 +435,24 @@ odbs_exit1:
}
/**
+ * omap_early_device_register - register an omap_device as an early platform
+ * device.
+ * @od: struct omap_device * to register
+ *
+ * Register the omap_device structure. This currently just calls
+ * platform_early_add_device() on the underlying platform_device.
+ * Returns 0 by default.
+ */
+int omap_early_device_register(struct omap_device *od)
+{
+ struct platform_device *devices[1];
+
+ devices[0] = &(od->pdev);
+ early_platform_add_devices(devices, 1);
+ return 0;
+}
+
+/**
* omap_device_register - register an omap_device with one omap_hwmod
* @od: struct omap_device * to register
*
next prev parent reply other threads:[~2010-02-16 1:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-16 1:24 [PATCH 00/19] OMAP: more clock/powerdomain/hwmod patches for 2.6.34 Paul Walmsley
2010-02-16 1:24 ` [PATCH 01/19] OMAP: omap_device: add omap_device_is_valid() Paul Walmsley
2010-02-16 1:24 ` [PATCH 02/19] OMAP: omap_device: when 'called from invalid state', print state Paul Walmsley
2010-02-16 1:24 ` [PATCH 03/19] OMAP3: clock: use std _MASK suffix for CM_FCLKEN_IVA2 defines Paul Walmsley
2010-02-16 1:24 ` [PATCH 04/19] OMAP3: Clock: Added IDLEST definitions for SGX Paul Walmsley
2010-02-16 1:24 ` [PATCH 05/19] OMAP2/3 PM: Adding powerdomain APIs for reading the next logic and mem state Paul Walmsley
2010-02-16 1:24 ` [PATCH 06/19] OMAP3 PM: Defining .pwrsts_logic_ret field for core power domain structure Paul Walmsley
2010-02-16 1:24 ` [PATCH 07/19] OMAP3 PM: Adding counters for power domain logic off and mem off during retention Paul Walmsley
2010-02-16 1:24 ` [PATCH 08/19] OMAP2/3 clock: Extend find_idlest() to pass back idle state value Paul Walmsley
2010-02-16 1:24 ` [PATCH 09/19] AM35xx: Add clock support for new modules on AM35xx Paul Walmsley
2010-02-16 1:24 ` [PATCH 10/19] OMAP3 clock: Check return values for clk_get() Paul Walmsley
2010-02-16 1:24 ` [PATCH 11/19] OMAP2/3: PRCM: fix misc. compiler warnings Paul Walmsley
2010-02-16 1:24 ` [PATCH 12/19] OMAP3 clock: Remove FreqSel for 3630 Paul Walmsley
2010-02-16 11:00 ` Sergei Shtylyov
2010-02-16 18:10 ` Paul Walmsley
2010-02-16 1:24 ` [PATCH 13/19] OMAP3: hwmod: support to specify the offset position of various SYSCONFIG register bits Paul Walmsley
2010-02-16 1:24 ` Paul Walmsley [this message]
2010-02-16 1:24 ` [PATCH 15/19] OMAP3630: Clock: Workaround for DPLL HS divider limitation Paul Walmsley
2010-02-16 1:25 ` [PATCH 16/19] ARM: OMAP4 clock domain: Add check for avoiding dependency related update Paul Walmsley
2010-02-16 1:25 ` [PATCH 17/19] OMAP3 clock: introduce DPLL4 Jtype Paul Walmsley
2010-02-16 1:25 ` [PATCH 18/19] OMAP3 clock: Introduce 3630 DPLL4 HSDivider changes Paul Walmsley
2010-02-16 1:25 ` [PATCH 19/19] OMAP3 clock: add support for 192Mhz DPLL4M2 output Paul Walmsley
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=20100216012455.1101.2409.stgit@localhost.localdomain \
--to=paul@pwsan.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).