summaryrefstree
path: root/kernel/include/linux/ccic/max77705_cc.h
blob: a15cbf4dc5152989e9b814a1a55279864827394c (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
 * Copyrights (C) 2017 Samsung Electronics, Inc.
 * Copyrights (C) 2017 Maxim Integrated Products, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef __LINUX_MFD_MAX77705_CC_H
#define __LINUX_MFD_MAX77705_CC_H
#include <linux/ccic/max77705.h>


#define MAX77705_CC_NAME	"max77705_CC"


#define MAX77865_IRQSRC_CHG		(1 << 0)
#define MAX77865_IRQSRC_FG      (1 << 2)

struct max77705_cc_data {

	/* interrupt pin */
	int irq_vconncop;
	int irq_vsafe0v;
	int irq_detabrt;
	int irq_vconnsc;
	int irq_ccpinstat;
	int irq_ccistat;
	int irq_ccvcnstat;
	int irq_ccstat;

	u8 usbc_status1;
	u8 usbc_status2;
	u8 bc_status;
	u8 cc_status0;
	u8 cc_status1;
	u8 pd_status0;
	u8 pd_status1;

	u8 opcode_res;

	/* VCONN Over Current Detection */
	u8 vconnocp;
	/* VCONN Over Short Circuit Detection */
	u8 vconnsc;
	/* Status of VBUS Detection */
	u8 vsafe0v;
	/* Charger Detection Abort Status */
	u8 detabrt;
	/* Output of active CC pin */
	u8 ccpinstat;
	/* CC Pin Detected Allowed VBUS Current in UFP mode */
	u8 ccistat;
	/* Status of Vconn Output */
	u8 ccvcnstat;
	/* CC Pin State Machine Detection */
	u8 ccstat;

	enum max77705_vcon_role	current_vcon;
	enum max77705_vcon_role	previous_vcon;
	enum max77705_power_role current_pr;
	enum max77705_power_role previous_pr;

	/* wakelock */
	struct wake_lock vconncop_wake_lock;
	struct wake_lock vsafe0v_wake_lock;
	struct wake_lock detabrt_wake_lock;
	struct wake_lock vconnsc_wake_lock;
	struct wake_lock ccpinstat_wake_lock;
	struct wake_lock ccistat_wake_lock;
	struct wake_lock ccvcnstat_wake_lock;
	struct wake_lock ccstat_wake_lock;
};
#endif