Skip to contentSkip to conversation

pda_power: add function callbacks for suspend and resume

PATCH Applied Daniel Mack 2 participants 3 messages Apr 12, 2010 – Apr 16, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pda_power: add function callbacks for suspend and resume

Add function prototypes for power management events so they can be handled and used by platform implementations.

Cc Dmitry Baryshkov <[email protected]>
Cc Anton Vorontsov <[email protected]>
Cc David Woodhouse <[email protected]>
---
 drivers/power/pda_power.c |    9 +++++++++
 include/linux/pda_power.h |    2 ++
 2 files changed, 11 insertions(+), 0 deletions(-)
drivers/power/pda_power.c +9 -0
index a232de6..0b27b9d 100644
@@ -404,6 +404,12 @@ static int usb_wakeup_enabled;
 
 static int pda_power_suspend(struct platform_device *pdev, pm_message_t state)
 {
+	if (pdata->suspend) {
+		int ret = pdata->suspend(state);
+		if (ret)
+			return ret;
+	}
+
 	if (device_may_wakeup(&pdev->dev)) {
 		if (ac_irq)
 			ac_wakeup_enabled = !enable_irq_wake(ac_irq->start);
@@ -423,6 +429,9 @@ static int pda_power_resume(struct platform_device *pdev)
 			disable_irq_wake(ac_irq->start);
 	}
 
+	if (pdata->resume)
+		return pdata->resume();
+
 	return 0;
 }
 #else
include/linux/pda_power.h +2 -0
index d4cf7a2..c9e4d81 100644
@@ -24,6 +24,8 @@ struct pda_power_pdata {
 	int (*is_usb_online)(void);
 	void (*set_charge)(int flags);
 	void (*exit)(struct device *dev);
+	int (*suspend)(pm_message_t state);
+	int (*resume)(void);
 
 	char **supplied_to;
 	size_t num_supplicants;
Signature · 1 line
1.7.0.3
#1 lore raw

Ping.

Quoted 55 lines · Daniel Mack

Add function prototypes for power management events so they can be handled and used by platform implementations.

Cc Dmitry Baryshkov <[email protected]>
Cc Anton Vorontsov <[email protected]>
Cc David Woodhouse <[email protected]>
---
 drivers/power/pda_power.c |    9 +++++++++
 include/linux/pda_power.h |    2 ++
 2 files changed, 11 insertions(+), 0 deletions(-)
drivers/power/pda_power.c +9 -0
index a232de6..0b27b9d 100644
@@ -404,6 +404,12 @@ static int usb_wakeup_enabled;
 
 static int pda_power_suspend(struct platform_device *pdev, pm_message_t state)
 {
+	if (pdata->suspend) {
+		int ret = pdata->suspend(state);
+		if (ret)
+			return ret;
+	}
+
 	if (device_may_wakeup(&pdev->dev)) {
 		if (ac_irq)
 			ac_wakeup_enabled = !enable_irq_wake(ac_irq->start);
@@ -423,6 +429,9 @@ static int pda_power_resume(struct platform_device *pdev)
 			disable_irq_wake(ac_irq->start);
 	}
 
+	if (pdata->resume)
+		return pdata->resume();
+
 	return 0;
 }
 #else
include/linux/pda_power.h +2 -0
index d4cf7a2..c9e4d81 100644
@@ -24,6 +24,8 @@ struct pda_power_pdata {
 	int (*is_usb_online)(void);
 	void (*set_charge)(int flags);
 	void (*exit)(struct device *dev);
+	int (*suspend)(pm_message_t state);
+	int (*resume)(void);
 
 	char **supplied_to;
 	size_t num_supplicants;
Signature · 1 line
1.7.0.3