Skip to contentSkip to conversation

OMAP3: PM: Add function omap_device_find_pdev to omap_device layer

PATCH In review Ranjith Lohithakshan 3 participants 3 messages Jul 27, 2009 – Aug 6, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 OMAP3: PM: Add function omap_device_find_pdev to omap_device layer

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.

---
 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(-)
arch/arm/plat-omap/include/mach/omap_device.h +1 -1
index bd0e136..5874af2 100644
@@ -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
 
arch/arm/plat-omap/omap_device.c +22 -0
index 2c409fc..b947faf 100644
@@ -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;
+}
+
Signature · 1 line
1.6.2.4
#1 lore raw
Quoted 6 lines · Ranjith Lohithakshan

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.

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

Quoted 54 lines
---
 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(-)
arch/arm/plat-omap/include/mach/omap_device.h +1 -1
index bd0e136..5874af2 100644
@@ -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
 
arch/arm/plat-omap/omap_device.c +22 -0
index 2c409fc..b947faf 100644
@@ -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;
+}
+
Signature · 6 lines
1.6.2.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to Ranjith Lohithakshan

Hi Ranjith,

Quoted 6 lines · Ranjith Lohithakshan

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.

Looks good to me, I will pull this into omap_device.

- Paul

Quoted 55 lines
---
 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(-)
arch/arm/plat-omap/include/mach/omap_device.h +1 -1
index bd0e136..5874af2 100644
@@ -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
 
arch/arm/plat-omap/omap_device.c +22 -0
index 2c409fc..b947faf 100644
@@ -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;
+}
+
Signature · 6 lines
1.6.2.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

- Paul