Re: [PATCH v2 27/30] usb: musb: am35x: usb dev_pm_ops structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 06-12-2010 15:13, Felipe Balbi wrote:

instead of using musb_platform_suspend_resume,
we can use dev_pm_ops and let platform_device
core handle when to call musb_core's suspend and
glue layer's suspend.

Signed-off-by: Felipe Balbi<balbi@xxxxxx>
[...]

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 14413a8..4569f7a 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -88,6 +88,7 @@ struct am35x_glue {
  	struct clk		*phy_clk;
  	struct clk		*clk;
  };
+#define glue_to_musb(g)		platform_get_drvdata(g->musb)

   Why get platfrom data of you already have 'musb' pointer, 'g->musb'?

@@ -653,10 +637,56 @@ static int __exit am35x_remove(struct platform_device *pdev)
  	return 0;
  }

+#ifdef CONFIG_PM
+static int am35x_suspend(struct device *dev)
+{
+	struct am35x_glue	*glue = dev_get_drvdata(dev);
+	struct musb		*musb = glue_to_musb(musb);
+
+	phy_off();
+	clk_disable(glue->phy_clk);
+	clk_disable(glue->clk);
+
+	return 0;
+}
+
+static int am35x_resume(struct device *dev)
+{
+	struct am35x_glue	*glue = dev_get_drvdata(dev);
+	struct musb		*musb = glue_to_musb(musb);
+	int			ret;
+
+	phy_oon();

   Typo.

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux