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]

 



On 07-12-2010 15:49, I 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'?

   Ah, that's 'struct platform_device *musb' -- I got muddled up by naming... :-)

@@ -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);

   Argument to the macro should be 'glue'.

+
+ 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);

   Here too.

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