mfd: wm8350-i2c: Make sure the i2c regmap functions are compiled
[linux/fpc-iii.git] / drivers / usb / chipidea / ci_hdrc_msm.c
blobca1123d415c58475cc6cbabae9f4b3a41554e126
1 /* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 */
8 #include <linux/module.h>
9 #include <linux/platform_device.h>
10 #include <linux/pm_runtime.h>
11 #include <linux/usb/msm_hsusb_hw.h>
12 #include <linux/usb/ulpi.h>
13 #include <linux/usb/gadget.h>
14 #include <linux/usb/chipidea.h>
16 #include "ci.h"
18 #define MSM_USB_BASE (ci->hw_bank.abs)
20 static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event)
22 struct device *dev = ci->gadget.dev.parent;
24 switch (event) {
25 case CI_HDRC_CONTROLLER_RESET_EVENT:
26 dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n");
27 writel(0, USB_AHBBURST);
28 writel(0, USB_AHBMODE);
29 usb_phy_init(ci->transceiver);
30 break;
31 case CI_HDRC_CONTROLLER_STOPPED_EVENT:
32 dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n");
34 * Put the transceiver in non-driving mode. Otherwise host
35 * may not detect soft-disconnection.
37 usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN);
38 break;
39 default:
40 dev_dbg(dev, "unknown ci_hdrc event\n");
41 break;
45 static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = {
46 .name = "ci_hdrc_msm",
47 .flags = CI_HDRC_REGS_SHARED |
48 CI_HDRC_REQUIRE_TRANSCEIVER |
49 CI_HDRC_DISABLE_STREAMING,
51 .notify_event = ci_hdrc_msm_notify_event,
54 static int ci_hdrc_msm_probe(struct platform_device *pdev)
56 struct platform_device *plat_ci;
58 dev_dbg(&pdev->dev, "ci_hdrc_msm_probe\n");
60 plat_ci = ci_hdrc_add_device(&pdev->dev,
61 pdev->resource, pdev->num_resources,
62 &ci_hdrc_msm_platdata);
63 if (IS_ERR(plat_ci)) {
64 dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n");
65 return PTR_ERR(plat_ci);
68 platform_set_drvdata(pdev, plat_ci);
70 pm_runtime_no_callbacks(&pdev->dev);
71 pm_runtime_enable(&pdev->dev);
73 return 0;
76 static int ci_hdrc_msm_remove(struct platform_device *pdev)
78 struct platform_device *plat_ci = platform_get_drvdata(pdev);
80 pm_runtime_disable(&pdev->dev);
81 ci_hdrc_remove_device(plat_ci);
83 return 0;
86 static struct platform_driver ci_hdrc_msm_driver = {
87 .probe = ci_hdrc_msm_probe,
88 .remove = ci_hdrc_msm_remove,
89 .driver = { .name = "msm_hsusb", },
92 module_platform_driver(ci_hdrc_msm_driver);
94 MODULE_ALIAS("platform:msm_hsusb");
95 MODULE_ALIAS("platform:ci13xxx_msm");
96 MODULE_LICENSE("GPL v2");