summaryrefslogtreecommitdiff
path: root/include/linux/usb/fsl_xcvr.h
blob: 96e5526127dbeda2aa22fbc875d891f0cf633373 (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
 */

/*
 * The code contained herein is licensed under the GNU Lesser General
 * Public License.  You may obtain a copy of the GNU Lesser General
 * Public License Version 2.1 or later at the following locations:
 *
 * http://www.opensource.org/licenses/lgpl-license.html
 * http://www.gnu.org/copyleft/lgpl.html
 */
#ifndef __LINUX_USB_FSL_XCVR_H
#define __LINUX_USB_FSL_XCVR_H
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>

struct fsl_usb2_platform_data;

enum usb_test_mode{
	USB_TEST_J = 1,
	USB_TEST_K = 2,
};

/**
 * @name: transceiver name
 * @xcvr_type: one of PORTSC_PTS_{UTMI,SERIAL,ULPI}
 * @init: transceiver- and board-specific initialization function
 * @uninit: transceiver- and board-specific uninitialization function
 * @set_host:
 * @set_device:
 * @pullup: enable or disable D+ pullup
 *
 */
struct fsl_xcvr_ops {
	char *name;
	u32 xcvr_type;

	void (*init)(struct fsl_xcvr_ops *ops);
	void (*uninit)(struct fsl_xcvr_ops *ops);
	void (*suspend)(struct fsl_xcvr_ops *ops);
	void (*set_host)(void);
	void (*set_device)(void);
	void (*set_vbus_power)(struct fsl_xcvr_ops *ops,
			       struct fsl_usb2_platform_data *pdata, int on);
	void (*set_vbus_draw)(struct fsl_xcvr_ops *ops,
			struct fsl_usb2_platform_data *pdata, unsigned mA);
	void (*set_remote_wakeup)(u32 *view);
	void (*pullup)(int on);
	void(*set_test_mode)(u32 *view, enum usb_test_mode mode);
};

struct fsl_xcvr_power {
	struct platform_device *usb_pdev;
	struct regulator *regu1;
	struct regulator *regu2;
};
#endif