Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184798
b: refs/heads/master
c: c23a97d
h: refs/heads/master
v: v3
  • Loading branch information
Thara Gopinath authored and Paul Walmsley committed Feb 24, 2010
1 parent ad5bdd8 commit 960be49
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 358f0e630d5409ab3837b86db3595560eae773b6
refs/heads/master: c23a97d377077c67e01f7526de3a411b316ee4f6
5 changes: 3 additions & 2 deletions trunk/arch/arm/plat-omap/include/plat/omap_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
33 changes: 29 additions & 4 deletions trunk/arch/arm/plat-omap/omap_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -318,15 +319,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_hwmod *ohs[] = { oh };

if (!oh)
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);
}

/**
Expand All @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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;

Expand All @@ -427,6 +434,24 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
return ERR_PTR(ret);
}

/**
* 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
Expand Down

0 comments on commit 960be49

Please sign in to comment.