Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | /* linux/include/mach/rpc_hsusb.h |
| 2 | * |
Lena Salman | 57d167e | 2012-03-21 19:46:38 +0200 | [diff] [blame] | 3 | * Copyright (c) 2008-2010, 2012 Code Aurora Forum. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4 | * |
| 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) |
| 29 | int msm_hsusb_rpc_connect(void); |
| 30 | int msm_hsusb_phy_reset(void); |
| 31 | int msm_hsusb_vbus_powerup(void); |
| 32 | int msm_hsusb_vbus_shutdown(void); |
| 33 | int msm_hsusb_reset_rework_installed(void); |
| 34 | int msm_hsusb_enable_pmic_ulpidata0(void); |
| 35 | int msm_hsusb_disable_pmic_ulpidata0(void); |
| 36 | int msm_hsusb_rpc_close(void); |
| 37 | |
| 38 | int msm_chg_rpc_connect(void); |
| 39 | int msm_chg_usb_charger_connected(uint32_t type); |
| 40 | int msm_chg_usb_i_is_available(uint32_t sample); |
| 41 | int msm_chg_usb_i_is_not_available(void); |
| 42 | int msm_chg_usb_charger_disconnected(void); |
| 43 | int msm_chg_rpc_close(void); |
| 44 | |
Lena Salman | 57d167e | 2012-03-21 19:46:38 +0200 | [diff] [blame] | 45 | #ifdef CONFIG_USB_MSM_72K |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 46 | int hsusb_chg_init(int connect); |
| 47 | void hsusb_chg_vbus_draw(unsigned mA); |
| 48 | void hsusb_chg_connected(enum chg_type chgtype); |
| 49 | #endif |
| 50 | |
| 51 | |
| 52 | int msm_fsusb_rpc_init(struct msm_otg_ops *ops); |
| 53 | int msm_fsusb_init_phy(void); |
| 54 | int msm_fsusb_reset_phy(void); |
| 55 | int msm_fsusb_suspend_phy(void); |
| 56 | int msm_fsusb_resume_phy(void); |
| 57 | int msm_fsusb_rpc_close(void); |
| 58 | int msm_fsusb_remote_dev_disconnected(void); |
| 59 | int msm_fsusb_set_remote_wakeup(void); |
| 60 | void msm_fsusb_rpc_deinit(void); |
| 61 | |
| 62 | /* wrapper to send pid and serial# info to bootloader */ |
| 63 | int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum); |
| 64 | #else |
| 65 | static inline int msm_hsusb_rpc_connect(void) { return 0; } |
| 66 | static inline int msm_hsusb_phy_reset(void) { return 0; } |
| 67 | static inline int msm_hsusb_vbus_powerup(void) { return 0; } |
| 68 | static inline int msm_hsusb_vbus_shutdown(void) { return 0; } |
| 69 | static inline int msm_hsusb_reset_rework_installed(void) { return 0; } |
| 70 | static inline int msm_hsusb_enable_pmic_ulpidata0(void) { return 0; } |
| 71 | static inline int msm_hsusb_disable_pmic_ulpidata0(void) { return 0; } |
| 72 | static inline int msm_hsusb_rpc_close(void) { return 0; } |
| 73 | |
| 74 | static inline int msm_chg_rpc_connect(void) { return 0; } |
| 75 | static inline int msm_chg_usb_charger_connected(uint32_t type) { return 0; } |
| 76 | static inline int msm_chg_usb_i_is_available(uint32_t sample) { return 0; } |
| 77 | static inline int msm_chg_usb_i_is_not_available(void) { return 0; } |
| 78 | static inline int msm_chg_usb_charger_disconnected(void) { return 0; } |
| 79 | static inline int msm_chg_rpc_close(void) { return 0; } |
| 80 | |
Lena Salman | 57d167e | 2012-03-21 19:46:38 +0200 | [diff] [blame] | 81 | #ifdef CONFIG_USB_MSM_72K |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 82 | static inline int hsusb_chg_init(int connect) { return 0; } |
| 83 | static inline void hsusb_chg_vbus_draw(unsigned mA) { } |
| 84 | static inline void hsusb_chg_connected(enum chg_type chgtype) { } |
| 85 | #endif |
| 86 | |
| 87 | static inline int msm_fsusb_rpc_init(struct msm_otg_ops *ops) { return 0; } |
| 88 | static inline int msm_fsusb_init_phy(void) { return 0; } |
| 89 | static inline int msm_fsusb_reset_phy(void) { return 0; } |
| 90 | static inline int msm_fsusb_suspend_phy(void) { return 0; } |
| 91 | static inline int msm_fsusb_resume_phy(void) { return 0; } |
| 92 | static inline int msm_fsusb_rpc_close(void) { return 0; } |
| 93 | static inline int msm_fsusb_remote_dev_disconnected(void) { return 0; } |
| 94 | static inline int msm_fsusb_set_remote_wakeup(void) { return 0; } |
| 95 | static inline void msm_fsusb_rpc_deinit(void) { } |
| 96 | static inline int |
| 97 | usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum) { return 0; } |
| 98 | #endif |
| 99 | #endif |