aboutsummaryrefslogtreecommitdiff
path: root/include/linux/usb/msm_ext_chg.h
blob: e282699de49bcd538fc5048bba97ecf8801f1b63 (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
#ifndef __LINUX_USB_MSM_EXT_CHG_H
#define __LINUX_USB_MSM_EXT_CHG_H

#include <linux/ioctl.h>

#define USB_CHG_BLOCK_ULPI	1
#define USB_CHG_BLOCK_QSCRATCH	2

#define USB_REQUEST_5V		1
#define USB_REQUEST_9V		2

enum usb_mode_req {
	USB_REQUEST_MODE_NONE = 0,
	USB_REQUEST_MODE_5V,
	USB_REQUEST_MODE_9V,
	USB_REQUEST_MODE_PENDING = 0xFF,
};

enum usb_mode_stat {
	USB_REQUEST_STAT_SUCCESS = 0,
	USB_REQUEST_STAT_FAIL = 1,
	USB_REQUEST_STAT_PENDING = 0xFF,
};

/**
 * struct msm_usb_chg_info - MSM USB charger block details.
 * @chg_block_type: The type of charger block. QSCRATCH/ULPI.
 * @page_offset: USB charger register base may not be aligned to
 *              PAGE_SIZE.  The kernel driver aligns the base
 *              address and use it for memory mapping.  This
 *              page_offset is used by user space to calaculate
 *              the corret charger register base address.
 * @length: The length of the charger register address space.
 */
struct msm_usb_chg_info {
	uint32_t chg_block_type;
	off_t page_offset;
	size_t length;
};

/* Get the MSM USB charger block information */
#define MSM_USB_EXT_CHG_INFO _IOW('M', 0, struct msm_usb_chg_info)

/* Vote against USB hardware low power mode */
#define MSM_USB_EXT_CHG_BLOCK_LPM _IOW('M', 1, int)

/* To tell kernel about voltage being voted */
#define MSM_USB_EXT_CHG_VOLTAGE_INFO _IOW('M', 2, int)

/* To tell kernel about voltage request result */
#define MSM_USB_EXT_CHG_RESULT _IOW('M', 3, int)

#endif /* __LINUX_USB_MSM_EXT_CHG_H */