summaryrefstree
path: root/kernel/include/linux/external_notify.h
blob: 40ae00761017f310724d6977ae5fe361e7af4f90 (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
/*
 * include/linux/external_notify.h
 *
 * header file supporting usb notify layer
 * external notify call chain information
 *
 * Copyright (C) 2016-2017 Samsung Electronics
 *
 * 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 *
 */

  /* usb notify layer v3.0 */

#ifndef __EXTERNAL_NOTIFY_H__
#define __EXTERNAL_NOTIFY_H__

#include <linux/notifier.h>

/* external notifier call chain command */
enum external_notify_cmd {
	EXTERNAL_NOTIFY_3S_NODEVICE = 1,
	EXTERNAL_NOTIFY_DEVICE_CONNECT,
	EXTERNAL_NOTIFY_HOSTBLOCK_PRE,
	EXTERNAL_NOTIFY_HOSTBLOCK_POST,
	EXTERNAL_NOTIFY_MDMBLOCK_PRE,
	EXTERNAL_NOTIFY_MDMBLOCK_POST,
};

/* external notifier call sequence,
 * largest priority number device will be called first. */
enum external_notify_device {
	EXTERNAL_NOTIFY_DEV_MUIC,
	EXTERNAL_NOTIFY_DEV_CHARGER,
	EXTERNAL_NOTIFY_DEV_PDIC,
};

enum external_notify_condev {
	EXTERNAL_NOTIFY_NONE = 0,
	EXTERNAL_NOTIFY_GPAD,
	EXTERNAL_NOTIFY_LANHUB,
};

#ifdef CONFIG_USB_EXTERNAL_NOTIFY
extern int send_external_notify(unsigned long cmd, int data);
extern int usb_external_notify_register(struct notifier_block *nb,
		notifier_fn_t notifier, int listener);
extern int usb_external_notify_unregister(struct notifier_block *nb);
#else
static inline int send_external_notify(unsigned long cmd,
			int data) {return 0; }
static inline int usb_external_notify_register(struct notifier_block *nb,
			notifier_fn_t notifier, int listener) {return 0; }
static inline int usb_external_notify_unregister(struct notifier_block *nb)
			{return 0; }
#endif

#endif /* __EXTERNAL_NOTIFY_H__ */