blob: 308a0e81b5e4d827251feed17cf14d33752d71e5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
/*
* exynos-usb-switch.h - USB switch driver for Exynos
*
* Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
* Yulgon Kim <yulgon.kim@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __EXYNOS_USB_SWITCH
#define __EXYNOS_USB_SWITCH
#define SWITCH_WAIT_TIME 500
#define WAIT_TIMES 10
enum usb_cable_status {
USB_DEVICE_DETACHED = 0,
USB_DEVICE_ATTACHED,
USB_HOST_DETACHED,
USB_HOST_ATTACHED,
};
struct exynos_usb_switch {
atomic_t connect;
unsigned int host_detect_irq;
unsigned int device_detect_irq;
unsigned int gpio_host_detect;
unsigned int gpio_device_detect;
unsigned int gpio_host_vbus;
struct workqueue_struct *workqueue;
struct work_struct switch_work;
struct mutex mutex;
atomic_t usb_status;
int (*get_usb_mode)(void);
int (*change_usb_mode)(int mode);
};
extern int s5p_ehci_port_power_off(struct platform_device *pdev);
extern int s5p_ohci_port_power_off(struct platform_device *pdev);
extern int s5p_ehci_port_power_on(struct platform_device *pdev);
extern int s5p_ohci_port_power_on(struct platform_device *pdev);
#endif
|