aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-22 14:38:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-22 14:38:22 -0500
commite30aee9e10bb5168579e047f05c3d13d09e23356 (patch)
tree12371bdcd52d2427cad838201997479e31b6a9c9 /drivers/extcon/extcon.h
parent8ff546b801e5cca0337c0f0a7234795d0a6309a1 (diff)
parent6cf18e6927c0b224f972e3042fb85770d63cb9f8 (diff)
Merge tag 'char-misc-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH: "Here is the big char/misc driver patchset for 4.11-rc1. Lots of different driver subsystems updated here: rework for the hyperv subsystem to handle new platforms better, mei and w1 and extcon driver updates, as well as a number of other "minor" driver updates. All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (169 commits) goldfish: Sanitize the broken interrupt handler x86/platform/goldfish: Prevent unconditional loading vmbus: replace modulus operation with subtraction vmbus: constify parameters where possible vmbus: expose hv_begin/end_read vmbus: remove conditional locking of vmbus_write vmbus: add direct isr callback mode vmbus: change to per channel tasklet vmbus: put related per-cpu variable together vmbus: callback is in softirq not workqueue binder: Add support for file-descriptor arrays binder: Add support for scatter-gather binder: Add extra size to allocator binder: Refactor binder_transact() binder: Support multiple /dev instances binder: Deal with contexts in debugfs binder: Support multiple context managers binder: Split flat_binder_object auxdisplay: ht16k33: remove private workqueue auxdisplay: ht16k33: rework input device initialization ...
Diffstat (limited to 'drivers/extcon/extcon.h')
-rw-r--r--drivers/extcon/extcon.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/drivers/extcon/extcon.h b/drivers/extcon/extcon.h
new file mode 100644
index 000000000000..993ddccafe11
--- /dev/null
+++ b/drivers/extcon/extcon.h
@@ -0,0 +1,62 @@
1#ifndef __LINUX_EXTCON_INTERNAL_H__
2#define __LINUX_EXTCON_INTERNAL_H__
3
4#include <linux/extcon.h>
5
6/**
7 * struct extcon_dev - An extcon device represents one external connector.
8 * @name: The name of this extcon device. Parent device name is
9 * used if NULL.
10 * @supported_cable: Array of supported cable names ending with EXTCON_NONE.
11 * If supported_cable is NULL, cable name related APIs
12 * are disabled.
13 * @mutually_exclusive: Array of mutually exclusive set of cables that cannot
14 * be attached simultaneously. The array should be
15 * ending with NULL or be NULL (no mutually exclusive
16 * cables). For example, if it is { 0x7, 0x30, 0}, then,
17 * {0, 1}, {0, 1, 2}, {0, 2}, {1, 2}, or {4, 5} cannot
18 * be attached simulataneously. {0x7, 0} is equivalent to
19 * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there
20 * can be no simultaneous connections.
21 * @dev: Device of this extcon.
22 * @state: Attach/detach state of this extcon. Do not provide at
23 * register-time.
24 * @nh: Notifier for the state change events from this extcon
25 * @entry: To support list of extcon devices so that users can
26 * search for extcon devices based on the extcon name.
27 * @lock:
28 * @max_supported: Internal value to store the number of cables.
29 * @extcon_dev_type: Device_type struct to provide attribute_groups
30 * customized for each extcon device.
31 * @cables: Sysfs subdirectories. Each represents one cable.
32 *
33 * In most cases, users only need to provide "User initializing data" of
34 * this struct when registering an extcon. In some exceptional cases,
35 * optional callbacks may be needed. However, the values in "internal data"
36 * are overwritten by register function.
37 */
38struct extcon_dev {
39 /* Optional user initializing data */
40 const char *name;
41 const unsigned int *supported_cable;
42 const u32 *mutually_exclusive;
43
44 /* Internal data. Please do not set. */
45 struct device dev;
46 struct raw_notifier_head *nh;
47 struct list_head entry;
48 int max_supported;
49 spinlock_t lock; /* could be called by irq handler */
50 u32 state;
51
52 /* /sys/class/extcon/.../cable.n/... */
53 struct device_type extcon_dev_type;
54 struct extcon_cable *cables;
55
56 /* /sys/class/extcon/.../mutually_exclusive/... */
57 struct attribute_group attr_g_muex;
58 struct attribute **attrs_muex;
59 struct device_attribute *d_attrs_muex;
60};
61
62#endif /* __LINUX_EXTCON_INTERNAL_H__ */