* [PATCH 1/2] OMAP3: PM: Add function omap_device_find_pdev to omap_device layer
@ 2009-07-27 11:28 Ranjith Lohithakshan
2009-08-05 22:30 ` Kevin Hilman
2009-08-06 13:39 ` Paul Walmsley
0 siblings, 2 replies; 3+ messages in thread
From: Ranjith Lohithakshan @ 2009-07-27 11:28 UTC (permalink / raw)
To: linux-omap; +Cc: ranjithl
This patch adds a function, omap_device_find_pdev, which will get the
omap_device associated with the platform_device provided. This is currently
required by the SRF layer for setting max_dev_wakeup_lat and getting
dev_context_loss_count.
Signed-off-by: Ranjith Lohithakshan <ranjithl@ti.com>
---
arch/arm/plat-omap/include/mach/omap_device.h | 2 +-
arch/arm/plat-omap/omap_device.c | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/arch/arm/plat-omap/include/mach/omap_device.h b/arch/arm/plat-omap/include/mach/omap_device.h
index bd0e136..5874af2 100644
--- a/arch/arm/plat-omap/include/mach/omap_device.h
+++ b/arch/arm/plat-omap/include/mach/omap_device.h
@@ -136,6 +136,6 @@ struct omap_device_pm_latency {
int (*activate_func)(struct omap_device *od);
};
-
+struct omap_device *omap_device_find_pdev(struct platform_device *pdev);
#endif
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 2c409fc..b947faf 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -685,3 +685,25 @@ int omap_device_enable_clocks(struct omap_device *od)
/* XXX pass along return value here? */
return 0;
}
+
+/**
+ * omap_device_find_pdev - look up an OMAP module by platform_device
+ * @pdev: platform_device to find
+ *
+ * Finds a registered OMAP module by the platform_device associated
+ * with it in the omap_device structure. Returns a pointer to the
+ * struct omap_device if found, or NULL otherwise.
+ */
+
+struct omap_device *omap_device_find_pdev(struct platform_device *pdev)
+{
+ struct omap_device *od;
+
+ if (!pdev)
+ return NULL;
+
+ od = _find_by_pdev(pdev);
+
+ return od;
+}
+
--
1.6.2.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 1/2] OMAP3: PM: Add function omap_device_find_pdev to omap_device layer
2009-07-27 11:28 [PATCH 1/2] OMAP3: PM: Add function omap_device_find_pdev to omap_device layer Ranjith Lohithakshan
@ 2009-08-05 22:30 ` Kevin Hilman
2009-08-06 13:39 ` Paul Walmsley
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Hilman @ 2009-08-05 22:30 UTC (permalink / raw)
To: Ranjith Lohithakshan; +Cc: linux-omap
Ranjith Lohithakshan <ranjithl@ti.com> writes:
> This patch adds a function, omap_device_find_pdev, which will get the
> omap_device associated with the platform_device provided. This is currently
> required by the SRF layer for setting max_dev_wakeup_lat and getting
> dev_context_loss_count.
>
> Signed-off-by: Ranjith Lohithakshan <ranjithl@ti.com>
Thanks, appying this to PM branch for now to get SRF working again but
Paul will review/comment/merge into his omap_device branch for
upstream.
Kevin
> ---
> arch/arm/plat-omap/include/mach/omap_device.h | 2 +-
> arch/arm/plat-omap/omap_device.c | 22 ++++++++++++++++++++++
> 2 files changed, 23 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/plat-omap/include/mach/omap_device.h b/arch/arm/plat-omap/include/mach/omap_device.h
> index bd0e136..5874af2 100644
> --- a/arch/arm/plat-omap/include/mach/omap_device.h
> +++ b/arch/arm/plat-omap/include/mach/omap_device.h
> @@ -136,6 +136,6 @@ struct omap_device_pm_latency {
> int (*activate_func)(struct omap_device *od);
> };
>
> -
> +struct omap_device *omap_device_find_pdev(struct platform_device *pdev);
> #endif
>
> diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
> index 2c409fc..b947faf 100644
> --- a/arch/arm/plat-omap/omap_device.c
> +++ b/arch/arm/plat-omap/omap_device.c
> @@ -685,3 +685,25 @@ int omap_device_enable_clocks(struct omap_device *od)
> /* XXX pass along return value here? */
> return 0;
> }
> +
> +/**
> + * omap_device_find_pdev - look up an OMAP module by platform_device
> + * @pdev: platform_device to find
> + *
> + * Finds a registered OMAP module by the platform_device associated
> + * with it in the omap_device structure. Returns a pointer to the
> + * struct omap_device if found, or NULL otherwise.
> + */
> +
> +struct omap_device *omap_device_find_pdev(struct platform_device *pdev)
> +{
> + struct omap_device *od;
> +
> + if (!pdev)
> + return NULL;
> +
> + od = _find_by_pdev(pdev);
> +
> + return od;
> +}
> +
> --
> 1.6.2.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 1/2] OMAP3: PM: Add function omap_device_find_pdev to omap_device layer
2009-07-27 11:28 [PATCH 1/2] OMAP3: PM: Add function omap_device_find_pdev to omap_device layer Ranjith Lohithakshan
2009-08-05 22:30 ` Kevin Hilman
@ 2009-08-06 13:39 ` Paul Walmsley
1 sibling, 0 replies; 3+ messages in thread
From: Paul Walmsley @ 2009-08-06 13:39 UTC (permalink / raw)
To: Ranjith Lohithakshan; +Cc: linux-omap, paul
Hi Ranjith,
On Mon, 27 Jul 2009, Ranjith Lohithakshan wrote:
> This patch adds a function, omap_device_find_pdev, which will get the
> omap_device associated with the platform_device provided. This is currently
> required by the SRF layer for setting max_dev_wakeup_lat and getting
> dev_context_loss_count.
>
> Signed-off-by: Ranjith Lohithakshan <ranjithl@ti.com>
Looks good to me, I will pull this into omap_device.
- Paul
> ---
> arch/arm/plat-omap/include/mach/omap_device.h | 2 +-
> arch/arm/plat-omap/omap_device.c | 22 ++++++++++++++++++++++
> 2 files changed, 23 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/plat-omap/include/mach/omap_device.h b/arch/arm/plat-omap/include/mach/omap_device.h
> index bd0e136..5874af2 100644
> --- a/arch/arm/plat-omap/include/mach/omap_device.h
> +++ b/arch/arm/plat-omap/include/mach/omap_device.h
> @@ -136,6 +136,6 @@ struct omap_device_pm_latency {
> int (*activate_func)(struct omap_device *od);
> };
>
> -
> +struct omap_device *omap_device_find_pdev(struct platform_device *pdev);
> #endif
>
> diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
> index 2c409fc..b947faf 100644
> --- a/arch/arm/plat-omap/omap_device.c
> +++ b/arch/arm/plat-omap/omap_device.c
> @@ -685,3 +685,25 @@ int omap_device_enable_clocks(struct omap_device *od)
> /* XXX pass along return value here? */
> return 0;
> }
> +
> +/**
> + * omap_device_find_pdev - look up an OMAP module by platform_device
> + * @pdev: platform_device to find
> + *
> + * Finds a registered OMAP module by the platform_device associated
> + * with it in the omap_device structure. Returns a pointer to the
> + * struct omap_device if found, or NULL otherwise.
> + */
> +
> +struct omap_device *omap_device_find_pdev(struct platform_device *pdev)
> +{
> + struct omap_device *od;
> +
> + if (!pdev)
> + return NULL;
> +
> + od = _find_by_pdev(pdev);
> +
> + return od;
> +}
> +
> --
> 1.6.2.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
- Paul
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-08-06 13:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-27 11:28 [PATCH 1/2] OMAP3: PM: Add function omap_device_find_pdev to omap_device layer Ranjith Lohithakshan
2009-08-05 22:30 ` Kevin Hilman
2009-08-06 13:39 ` Paul Walmsley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox