blob: 5646aa6aba7943b22a1ded02e5dfd2d83fba9db7 [file] [log] [blame]
Flemmard77ad3212013-02-12 16:25:42 +01001/*
2 * Copyright (C) 2011 HTC, Inc.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef __HTC_INFO__
16#define __HTC_INFO__
17
18#include <mach/board.h>
19struct usb_info {
20 int *phy_init_seq;
21 void (*phy_reset)(void);
22 void (*hw_reset)(bool en);
23 void (*usb_uart_switch)(int);
24 void (*serial_debug_gpios)(int);
25 void (*usb_hub_enable)(bool);
26 int (*china_ac_detect)(void);
27 void (*disable_usb_charger)(void);
28 void (*change_phy_voltage)(int);
29 int (*ldo_init) (int init);
30 int (*ldo_enable) (int enable);
31 void (*usb_mhl_switch)(bool);
32
33
34 int connect_type_ready;
35 void (*usb_connected)(int);
36
37 enum usb_connect_type connect_type;
38 struct delayed_work chg_stop;
39};
40
41extern ssize_t otg_show_usb_phy_setting(char *buf);
42extern ssize_t otg_store_usb_phy_setting(const char *buf, size_t count);
43
44extern int usb_get_connect_type(void);
45extern int android_switch_function(unsigned func);
46extern int android_show_function(char *buf);
47extern void android_set_serialno(char *serialno);
48extern void android_force_reset(void);
49extern int htc_usb_enable_function(char *name, int ebl);
50
51extern void htc_mode_enable(int enable);
52extern int check_htc_mode_status(void);
53extern void android_switch_default(void);
54extern void android_switch_htc_mode(void);
55
56#ifdef err
57#undef err
58#endif
59#ifdef warn
60#undef warn
61#endif
62#ifdef info
63#undef info
64#endif
65
66#define USB_ERR(fmt, args...) \
67 printk(KERN_ERR "[USB:ERR] " fmt, ## args)
68#define USB_WARNING(fmt, args...) \
69 printk(KERN_WARNING "[USB] " fmt, ## args)
70#define USB_INFO(fmt, args...) \
71 printk(KERN_INFO "[USB] " fmt, ## args)
72#define USB_DEBUG(fmt, args...) \
73 printk(KERN_DEBUG "[USB] " fmt, ## args)
74
75#define USBH_ERR(fmt, args...) \
76 printk(KERN_ERR "[USBH:ERR] " fmt, ## args)
77#define USBH_WARNING(fmt, args...) \
78 printk(KERN_WARNING "[USBH] " fmt, ## args)
79#define USBH_INFO(fmt, args...) \
80 printk(KERN_INFO "[USBH] " fmt, ## args)
81#define USBH_DEBUG(fmt, args...) \
82 printk(KERN_DEBUG "[USBH] " fmt, ## args)
83
84#ifdef dev_err
85#undef dev_err
86#endif
87#define dev_err(dev, fmt, args...) \
88 printk(KERN_ERR "[USB] " pr_fmt(fmt), ## args)
89
90#ifdef dev_dbg
91#undef dev_dbg
92#endif
93#define dev_dbg(dev, fmt, args...) \
94 printk(KERN_INFO "[USB] " pr_fmt(fmt), ## args)
95
96#ifdef dev_info
97#undef dev_info
98#endif
99#define dev_info(dev, fmt, args...) \
100 printk(KERN_INFO "[USB] " pr_fmt(fmt), ## args)
101
102#ifdef pr_debug
103#undef pr_debug
104#endif
105#define pr_debug(fmt, args...) \
106 printk(KERN_INFO "[USB] " pr_fmt(fmt), ## args)
107
108#ifdef pr_err
109#undef pr_err
110#endif
111#define pr_err(fmt, args...) \
112 printk(KERN_ERR "[USB] " pr_fmt(fmt), ## args)
113
114#ifdef pr_info
115#undef pr_info
116#endif
117#define pr_info(fmt, args...) \
118 printk(KERN_INFO "[USB] " pr_fmt(fmt), ## args)
119
120#endif
121