summaryrefslogtreecommitdiffstats
path: root/drivers/extcon/Kconfig
blob: 07122a9ef36e6592812aec1f97b3f830914be361 (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
menuconfig EXTCON
	tristate "External Connector Class (extcon) support"
	help
	  Say Y here to enable external connector class (extcon) support.
	  This allows monitoring external connectors by userspace
	  via sysfs and uevent and supports external connectors with
	  multiple states; i.e., an extcon that may have multiple
	  cables attached. For example, an external connector of a device
	  may be used to connect an HDMI cable and a AC adaptor, and to
	  host USB ports. Many of 30-pin connectors including PDMI are
	  also good examples.

if EXTCON

comment "Extcon Device Drivers"

config EXTCON_GPIO
	tristate "GPIO extcon support"
	depends on GENERIC_GPIO
	help
	  Say Y here to enable GPIO based extcon support. Note that GPIO
	  extcon supports single state per extcon instance.

config EXTCON_ADC_JACK
	tristate "ADC Jack extcon support"
	depends on IIO
	help
	  Say Y here to enable extcon device driver based on ADC values.

config EXTCON_MAX77693
	tristate "MAX77693 EXTCON Support"
	depends on MFD_MAX77693
	select IRQ_DOMAIN
	select REGMAP_I2C
	help
	  If you say yes here you get support for the MUIC device of
	  Maxim MAX77693 PMIC. The MAX77693 MUIC is a USB port accessory
	  detector and switch.

config EXTCON_MAX8997
	tristate "MAX8997 EXTCON Support"
	depends on MFD_MAX8997 && IRQ_DOMAIN
	help
	  If you say yes here you get support for the MUIC device of
	  Maxim MAX8997 PMIC. The MAX8997 MUIC is a USB port accessory
	  detector and switch.

config EXTCON_ARIZONA
	tristate "Wolfson Arizona EXTCON support"
	depends on MFD_ARIZONA && INPUT
	help
	  Say Y here to enable support for external accessory detection
	  with Wolfson Arizona devices. These are audio CODECs with
	  advanced audio accessory detection support.

endif # MULTISTATE_SWITCH
n> #include <linux/if_ether.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/skbuff.h> #include <linux/icmpv6.h> #include <linux/netfilter_ipv6.h> #include <net/dst.h> #include <net/ipv6.h> #include <net/ip6_route.h> #include <net/xfrm.h> int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, u8 **prevhdr) { return ip6_find_1stfragopt(skb, prevhdr); } EXPORT_SYMBOL(xfrm6_find_1stfragopt); static int xfrm6_local_dontfrag(struct sk_buff *skb) { int proto; struct sock *sk = skb->sk; if (sk) { if (sk->sk_family != AF_INET6) return 0; proto = sk->sk_protocol; if (proto == IPPROTO_UDP || proto == IPPROTO_RAW) return inet6_sk(sk)->dontfrag; } return 0; } static void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu) { struct flowi6 fl6; struct sock *sk = skb->sk; fl6.flowi6_oif = sk->sk_bound_dev_if; fl6.daddr = ipv6_hdr(skb)->daddr; ipv6_local_rxpmtu(sk, &fl6, mtu); } void xfrm6_local_error(struct sk_buff *skb, u32 mtu) { struct flowi6 fl6; const struct ipv6hdr *hdr; struct sock *sk = skb->sk; hdr = skb->encapsulation ? inner_ipv6_hdr(skb) : ipv6_hdr(skb); fl6.fl6_dport = inet_sk(sk)->inet_dport; fl6.daddr = hdr->daddr; ipv6_local_error(sk, EMSGSIZE, &fl6, mtu); } static int xfrm6_tunnel_check_size(struct sk_buff *skb) { int mtu, ret = 0; struct dst_entry *dst = skb_dst(skb); mtu = dst_mtu(dst); if (mtu < IPV6_MIN_MTU) mtu = IPV6_MIN_MTU; if (!skb->ignore_df && skb->len > mtu) { skb->dev = dst->dev; if (xfrm6_local_dontfrag(skb)) xfrm6_local_rxpmtu(skb, mtu); else if (skb->sk) xfrm_local_error(skb, mtu); else icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); ret = -EMSGSIZE; } return ret; } int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb) { int err; err = xfrm6_tunnel_check_size(skb); if (err) return err; XFRM_MODE_SKB_CB(skb)->protocol = ipv6_hdr(skb)->nexthdr; return xfrm6_extract_header(skb); } int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb) { int err; err = xfrm_inner_extract_output(x, skb); if (err) return err; skb->ignore_df = 1; skb->protocol = htons(ETH_P_IPV6); return x->outer_mode->output2(x, skb); } EXPORT_SYMBOL(xfrm6_prepare_output); int xfrm6_output_finish(struct sock *sk, struct sk_buff *skb) { memset(IP6CB(skb), 0, sizeof(*IP6CB(skb))); #ifdef CONFIG_NETFILTER IP6CB(skb)->flags |= IP6SKB_XFRM_TRANSFORMED; #endif return xfrm_output(sk, skb); } static int __xfrm6_output(struct sock *sk, struct sk_buff *skb) { struct dst_entry *dst = skb_dst(skb); struct xfrm_state *x = dst->xfrm; int mtu; #ifdef CONFIG_NETFILTER if (!x) { IP6CB(skb)->flags |= IP6SKB_REROUTED; return dst_output(sk, skb); } #endif if (skb->protocol == htons(ETH_P_IPV6)) mtu = ip6_skb_dst_mtu(skb); else mtu = dst_mtu(skb_dst(skb)); if (skb->len > mtu && xfrm6_local_dontfrag(skb)) { xfrm6_local_rxpmtu(skb, mtu); return -EMSGSIZE; } else if (!skb->ignore_df && skb->len > mtu && skb->sk) { xfrm_local_error(skb, mtu); return -EMSGSIZE; } if (x->props.mode == XFRM_MODE_TUNNEL && ((skb->len > mtu && !skb_is_gso(skb)) || dst_allfrag(skb_dst(skb)))) { return ip6_fragment(sk, skb, x->outer_mode->afinfo->output_finish); } return x->outer_mode->afinfo->output_finish(sk, skb); } int xfrm6_output(struct sock *sk, struct sk_buff *skb) { return NF_HOOK_COND(NFPROTO_IPV6, NF_INET_POST_ROUTING, sk, skb, NULL, skb_dst(skb)->dev, __xfrm6_output, !(IP6CB(skb)->flags & IP6SKB_REROUTED)); }