blob: 88d76502a2b1546cd1a723de4fbd7e713187ceb9 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* linux/include/mach/rpc_hsusb.h
2 *
Lena Salman57d167e2012-03-21 19:46:38 +02003 * Copyright (c) 2008-2010, 2012 Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004 *
5 * All source code in this file is licensed under the following license except
6 * where indicated.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 *
16 * See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you can find it at http://www.fsf.org
19 */
20
21#ifndef __ASM_ARCH_MSM_RPC_HSUSB_H
22#define __ASM_ARCH_MSM_RPC_HSUSB_H
23
24#include <mach/msm_rpcrouter.h>
25#include <mach/msm_otg.h>
26#include <mach/msm_hsusb.h>
27
28#if defined(CONFIG_MSM_ONCRPCROUTER) && !defined(CONFIG_ARCH_MSM8X60)
29int msm_hsusb_rpc_connect(void);
30int msm_hsusb_phy_reset(void);
31int msm_hsusb_vbus_powerup(void);
32int msm_hsusb_vbus_shutdown(void);
33int msm_hsusb_reset_rework_installed(void);
34int msm_hsusb_enable_pmic_ulpidata0(void);
35int msm_hsusb_disable_pmic_ulpidata0(void);
36int msm_hsusb_rpc_close(void);
37
38int msm_chg_rpc_connect(void);
39int msm_chg_usb_charger_connected(uint32_t type);
40int msm_chg_usb_i_is_available(uint32_t sample);
41int msm_chg_usb_i_is_not_available(void);
42int msm_chg_usb_charger_disconnected(void);
43int msm_chg_rpc_close(void);
44
Lena Salman57d167e2012-03-21 19:46:38 +020045#ifdef CONFIG_USB_MSM_72K
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070046int hsusb_chg_init(int connect);
47void hsusb_chg_vbus_draw(unsigned mA);
48void hsusb_chg_connected(enum chg_type chgtype);
49#endif
50
51
52int msm_fsusb_rpc_init(struct msm_otg_ops *ops);
53int msm_fsusb_init_phy(void);
54int msm_fsusb_reset_phy(void);
55int msm_fsusb_suspend_phy(void);
56int msm_fsusb_resume_phy(void);
57int msm_fsusb_rpc_close(void);
58int msm_fsusb_remote_dev_disconnected(void);
59int msm_fsusb_set_remote_wakeup(void);
60void msm_fsusb_rpc_deinit(void);
61
62/* wrapper to send pid and serial# info to bootloader */
63int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum);
64#else
65static inline int msm_hsusb_rpc_connect(void) { return 0; }
66static inline int msm_hsusb_phy_reset(void) { return 0; }
67static inline int msm_hsusb_vbus_powerup(void) { return 0; }
68static inline int msm_hsusb_vbus_shutdown(void) { return 0; }
69static inline int msm_hsusb_reset_rework_installed(void) { return 0; }
70static inline int msm_hsusb_enable_pmic_ulpidata0(void) { return 0; }
71static inline int msm_hsusb_disable_pmic_ulpidata0(void) { return 0; }
72static inline int msm_hsusb_rpc_close(void) { return 0; }
73
74static inline int msm_chg_rpc_connect(void) { return 0; }
75static inline int msm_chg_usb_charger_connected(uint32_t type) { return 0; }
76static inline int msm_chg_usb_i_is_available(uint32_t sample) { return 0; }
77static inline int msm_chg_usb_i_is_not_available(void) { return 0; }
78static inline int msm_chg_usb_charger_disconnected(void) { return 0; }
79static inline int msm_chg_rpc_close(void) { return 0; }
80
Lena Salman57d167e2012-03-21 19:46:38 +020081#ifdef CONFIG_USB_MSM_72K
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070082static inline int hsusb_chg_init(int connect) { return 0; }
83static inline void hsusb_chg_vbus_draw(unsigned mA) { }
84static inline void hsusb_chg_connected(enum chg_type chgtype) { }
85#endif
86
87static inline int msm_fsusb_rpc_init(struct msm_otg_ops *ops) { return 0; }
88static inline int msm_fsusb_init_phy(void) { return 0; }
89static inline int msm_fsusb_reset_phy(void) { return 0; }
90static inline int msm_fsusb_suspend_phy(void) { return 0; }
91static inline int msm_fsusb_resume_phy(void) { return 0; }
92static inline int msm_fsusb_rpc_close(void) { return 0; }
93static inline int msm_fsusb_remote_dev_disconnected(void) { return 0; }
94static inline int msm_fsusb_set_remote_wakeup(void) { return 0; }
95static inline void msm_fsusb_rpc_deinit(void) { }
96static inline int
97usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum) { return 0; }
98#endif
99#endif