aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/platform_data
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-03-19 13:05:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-19 13:05:34 -0400
commit1200b6809dfd9d73bc4c7db76d288c35fa4b2ebe (patch)
tree552e03de245cdbd0780ca1215914edc4a26540f7 /include/linux/platform_data
parent6b5f04b6cf8ebab9a65d9c0026c650bb2538fd0f (diff)
parentfe30937b65354c7fec244caebbdaae68e28ca797 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "Highlights: 1) Support more Realtek wireless chips, from Jes Sorenson. 2) New BPF types for per-cpu hash and arrap maps, from Alexei Starovoitov. 3) Make several TCP sysctls per-namespace, from Nikolay Borisov. 4) Allow the use of SO_REUSEPORT in order to do per-thread processing of incoming TCP/UDP connections. The muxing can be done using a BPF program which hashes the incoming packet. From Craig Gallek. 5) Add a multiplexer for TCP streams, to provide a messaged based interface. BPF programs can be used to determine the message boundaries. From Tom Herbert. 6) Add 802.1AE MACSEC support, from Sabrina Dubroca. 7) Avoid factorial complexity when taking down an inetdev interface with lots of configured addresses. We were doing things like traversing the entire address less for each address removed, and flushing the entire netfilter conntrack table for every address as well. 8) Add and use SKB bulk free infrastructure, from Jesper Brouer. 9) Allow offloading u32 classifiers to hardware, and implement for ixgbe, from John Fastabend. 10) Allow configuring IRQ coalescing parameters on a per-queue basis, from Kan Liang. 11) Extend ethtool so that larger link mode masks can be supported. From David Decotigny. 12) Introduce devlink, which can be used to configure port link types (ethernet vs Infiniband, etc.), port splitting, and switch device level attributes as a whole. From Jiri Pirko. 13) Hardware offload support for flower classifiers, from Amir Vadai. 14) Add "Local Checksum Offload". Basically, for a tunneled packet the checksum of the outer header is 'constant' (because with the checksum field filled into the inner protocol header, the payload of the outer frame checksums to 'zero'), and we can take advantage of that in various ways. From Edward Cree" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1548 commits) bonding: fix bond_get_stats() net: bcmgenet: fix dma api length mismatch net/mlx4_core: Fix backward compatibility on VFs phy: mdio-thunder: Fix some Kconfig typos lan78xx: add ndo_get_stats64 lan78xx: handle statistics counter rollover RDS: TCP: Remove unused constant RDS: TCP: Add sysctl tunables for sndbuf/rcvbuf on rds-tcp socket net: smc911x: convert pxa dma to dmaengine team: remove duplicate set of flag IFF_MULTICAST bonding: remove duplicate set of flag IFF_MULTICAST net: fix a comment typo ethernet: micrel: fix some error codes ip_tunnels, bpf: define IP_TUNNEL_OPTS_MAX and use it bpf, dst: add and use dst_tclassid helper bpf: make skb->tc_classid also readable net: mvneta: bm: clarify dependencies cls_bpf: reset class and reuse major in da ldmvsw: Checkpatch sunvnet.c and sunvnet_common.c ldmvsw: Add ldmvsw.c driver code ...
Diffstat (limited to 'include/linux/platform_data')
-rw-r--r--include/linux/platform_data/brcmfmac-sdio.h135
-rw-r--r--include/linux/platform_data/brcmfmac.h185
-rw-r--r--include/linux/platform_data/microread.h35
3 files changed, 185 insertions, 170 deletions
diff --git a/include/linux/platform_data/brcmfmac-sdio.h b/include/linux/platform_data/brcmfmac-sdio.h
deleted file mode 100644
index e75dcbf2b230..000000000000
--- a/include/linux/platform_data/brcmfmac-sdio.h
+++ /dev/null
@@ -1,135 +0,0 @@
1/*
2 * Copyright (c) 2013 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#ifndef _LINUX_BRCMFMAC_PLATFORM_H
18#define _LINUX_BRCMFMAC_PLATFORM_H
19
20/*
21 * Platform specific driver functions and data. Through the platform specific
22 * device data functions can be provided to help the brcmfmac driver to
23 * operate with the device in combination with the used platform.
24 *
25 * Use the platform data in the following (similar) way:
26 *
27 *
28#include <brcmfmac_platform.h>
29
30
31static void brcmfmac_power_on(void)
32{
33}
34
35static void brcmfmac_power_off(void)
36{
37}
38
39static void brcmfmac_reset(void)
40{
41}
42
43static struct brcmfmac_sdio_platform_data brcmfmac_sdio_pdata = {
44 .power_on = brcmfmac_power_on,
45 .power_off = brcmfmac_power_off,
46 .reset = brcmfmac_reset
47};
48
49static struct platform_device brcmfmac_device = {
50 .name = BRCMFMAC_SDIO_PDATA_NAME,
51 .id = PLATFORM_DEVID_NONE,
52 .dev.platform_data = &brcmfmac_sdio_pdata
53};
54
55void __init brcmfmac_init_pdata(void)
56{
57 brcmfmac_sdio_pdata.oob_irq_supported = true;
58 brcmfmac_sdio_pdata.oob_irq_nr = gpio_to_irq(GPIO_BRCMF_SDIO_OOB);
59 brcmfmac_sdio_pdata.oob_irq_flags = IORESOURCE_IRQ |
60 IORESOURCE_IRQ_HIGHLEVEL;
61 platform_device_register(&brcmfmac_device);
62}
63 *
64 *
65 * Note: the brcmfmac can be loaded as module or be statically built-in into
66 * the kernel. If built-in then do note that it uses module_init (and
67 * module_exit) routines which equal device_initcall. So if you intend to
68 * create a module with the platform specific data for the brcmfmac and have
69 * it built-in to the kernel then use a higher initcall then device_initcall
70 * (see init.h). If this is not done then brcmfmac will load without problems
71 * but will not pickup the platform data.
72 *
73 * When the driver does not "detect" platform driver data then it will continue
74 * without reporting anything and just assume there is no data needed. Which is
75 * probably true for most platforms.
76 *
77 * Explanation of the platform_data fields:
78 *
79 * drive_strength: is the preferred drive_strength to be used for the SDIO
80 * pins. If 0 then a default value will be used. This is the target drive
81 * strength, the exact drive strength which will be used depends on the
82 * capabilities of the device.
83 *
84 * oob_irq_supported: does the board have support for OOB interrupts. SDIO
85 * in-band interrupts are relatively slow and for having less overhead on
86 * interrupt processing an out of band interrupt can be used. If the HW
87 * supports this then enable this by setting this field to true and configure
88 * the oob related fields.
89 *
90 * oob_irq_nr, oob_irq_flags: the OOB interrupt information. The values are
91 * used for registering the irq using request_irq function.
92 *
93 * broken_sg_support: flag for broken sg list support of SDIO host controller.
94 * Set this to true if the SDIO host controller has higher align requirement
95 * than 32 bytes for each scatterlist item.
96 *
97 * sd_head_align: alignment requirement for start of data buffer
98 *
99 * sd_sgentry_align: length alignment requirement for each sg entry
100 *
101 * power_on: This function is called by the brcmfmac when the module gets
102 * loaded. This can be particularly useful for low power devices. The platform
103 * spcific routine may for example decide to power up the complete device.
104 * If there is no use-case for this function then provide NULL.
105 *
106 * power_off: This function is called by the brcmfmac when the module gets
107 * unloaded. At this point the device can be powered down or otherwise be reset.
108 * So if an actual power_off is not supported but reset is then reset the device
109 * when this function gets called. This can be particularly useful for low power
110 * devices. If there is no use-case for this function (either power-down or
111 * reset) then provide NULL.
112 *
113 * reset: This function can get called if the device communication broke down.
114 * This functionality is particularly useful in case of SDIO type devices. It is
115 * possible to reset a dongle via sdio data interface, but it requires that
116 * this is fully functional. This function is chip/module specific and this
117 * function should return only after the complete reset has completed.
118 */
119
120#define BRCMFMAC_SDIO_PDATA_NAME "brcmfmac_sdio"
121
122struct brcmfmac_sdio_platform_data {
123 unsigned int drive_strength;
124 bool oob_irq_supported;
125 unsigned int oob_irq_nr;
126 unsigned long oob_irq_flags;
127 bool broken_sg_support;
128 unsigned short sd_head_align;
129 unsigned short sd_sgentry_align;
130 void (*power_on)(void);
131 void (*power_off)(void);
132 void (*reset)(void);
133};
134
135#endif /* _LINUX_BRCMFMAC_PLATFORM_H */
diff --git a/include/linux/platform_data/brcmfmac.h b/include/linux/platform_data/brcmfmac.h
new file mode 100644
index 000000000000..1d30bf278231
--- /dev/null
+++ b/include/linux/platform_data/brcmfmac.h
@@ -0,0 +1,185 @@
1/*
2 * Copyright (c) 201 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#ifndef _LINUX_BRCMFMAC_PLATFORM_H
18#define _LINUX_BRCMFMAC_PLATFORM_H
19
20
21#define BRCMFMAC_PDATA_NAME "brcmfmac"
22
23#define BRCMFMAC_COUNTRY_BUF_SZ 4
24
25
26/*
27 * Platform specific driver functions and data. Through the platform specific
28 * device data functions and data can be provided to help the brcmfmac driver to
29 * operate with the device in combination with the used platform.
30 */
31
32
33/**
34 * Note: the brcmfmac can be loaded as module or be statically built-in into
35 * the kernel. If built-in then do note that it uses module_init (and
36 * module_exit) routines which equal device_initcall. So if you intend to
37 * create a module with the platform specific data for the brcmfmac and have
38 * it built-in to the kernel then use a higher initcall then device_initcall
39 * (see init.h). If this is not done then brcmfmac will load without problems
40 * but will not pickup the platform data.
41 *
42 * When the driver does not "detect" platform driver data then it will continue
43 * without reporting anything and just assume there is no data needed. Which is
44 * probably true for most platforms.
45 */
46
47/**
48 * enum brcmf_bus_type - Bus type identifier. Currently SDIO, USB and PCIE are
49 * supported.
50 */
51enum brcmf_bus_type {
52 BRCMF_BUSTYPE_SDIO,
53 BRCMF_BUSTYPE_USB,
54 BRCMF_BUSTYPE_PCIE
55};
56
57
58/**
59 * struct brcmfmac_sdio_pd - SDIO Device specific platform data.
60 *
61 * @txglomsz: SDIO txglom size. Use 0 if default of driver is to be
62 * used.
63 * @drive_strength: is the preferred drive_strength to be used for the SDIO
64 * pins. If 0 then a default value will be used. This is
65 * the target drive strength, the exact drive strength
66 * which will be used depends on the capabilities of the
67 * device.
68 * @oob_irq_supported: does the board have support for OOB interrupts. SDIO
69 * in-band interrupts are relatively slow and for having
70 * less overhead on interrupt processing an out of band
71 * interrupt can be used. If the HW supports this then
72 * enable this by setting this field to true and configure
73 * the oob related fields.
74 * @oob_irq_nr,
75 * @oob_irq_flags: the OOB interrupt information. The values are used for
76 * registering the irq using request_irq function.
77 * @broken_sg_support: flag for broken sg list support of SDIO host controller.
78 * Set this to true if the SDIO host controller has higher
79 * align requirement than 32 bytes for each scatterlist
80 * item.
81 * @sd_head_align: alignment requirement for start of data buffer.
82 * @sd_sgentry_align: length alignment requirement for each sg entry.
83 * @reset: This function can get called if the device communication
84 * broke down. This functionality is particularly useful in
85 * case of SDIO type devices. It is possible to reset a
86 * dongle via sdio data interface, but it requires that
87 * this is fully functional. This function is chip/module
88 * specific and this function should return only after the
89 * complete reset has completed.
90 */
91struct brcmfmac_sdio_pd {
92 int txglomsz;
93 unsigned int drive_strength;
94 bool oob_irq_supported;
95 unsigned int oob_irq_nr;
96 unsigned long oob_irq_flags;
97 bool broken_sg_support;
98 unsigned short sd_head_align;
99 unsigned short sd_sgentry_align;
100 void (*reset)(void);
101};
102
103/**
104 * struct brcmfmac_pd_cc_entry - Struct for translating user space country code
105 * (iso3166) to firmware country code and
106 * revision.
107 *
108 * @iso3166: iso3166 alpha 2 country code string.
109 * @cc: firmware country code string.
110 * @rev: firmware country code revision.
111 */
112struct brcmfmac_pd_cc_entry {
113 char iso3166[BRCMFMAC_COUNTRY_BUF_SZ];
114 char cc[BRCMFMAC_COUNTRY_BUF_SZ];
115 s32 rev;
116};
117
118/**
119 * struct brcmfmac_pd_cc - Struct for translating country codes as set by user
120 * space to a country code and rev which can be used by
121 * firmware.
122 *
123 * @table_size: number of entries in table (> 0)
124 * @table: array of 1 or more elements with translation information.
125 */
126struct brcmfmac_pd_cc {
127 int table_size;
128 struct brcmfmac_pd_cc_entry table[0];
129};
130
131/**
132 * struct brcmfmac_pd_device - Device specific platform data. (id/rev/bus_type)
133 * is the unique identifier of the device.
134 *
135 * @id: ID of the device for which this data is. In case of SDIO
136 * or PCIE this is the chipid as identified by chip.c In
137 * case of USB this is the chipid as identified by the
138 * device query.
139 * @rev: chip revision, see id.
140 * @bus_type: The type of bus. Some chipid/rev exist for different bus
141 * types. Each bus type has its own set of settings.
142 * @feature_disable: Bitmask of features to disable (override), See feature.c
143 * in brcmfmac for details.
144 * @country_codes: If available, pointer to struct for translating country
145 * codes.
146 * @bus: Bus specific (union) device settings. Currently only
147 * SDIO.
148 */
149struct brcmfmac_pd_device {
150 unsigned int id;
151 unsigned int rev;
152 enum brcmf_bus_type bus_type;
153 unsigned int feature_disable;
154 struct brcmfmac_pd_cc *country_codes;
155 union {
156 struct brcmfmac_sdio_pd sdio;
157 } bus;
158};
159
160/**
161 * struct brcmfmac_platform_data - BRCMFMAC specific platform data.
162 *
163 * @power_on: This function is called by the brcmfmac driver when the module
164 * gets loaded. This can be particularly useful for low power
165 * devices. The platform spcific routine may for example decide to
166 * power up the complete device. If there is no use-case for this
167 * function then provide NULL.
168 * @power_off: This function is called by the brcmfmac when the module gets
169 * unloaded. At this point the devices can be powered down or
170 * otherwise be reset. So if an actual power_off is not supported
171 * but reset is supported by the devices then reset the devices
172 * when this function gets called. This can be particularly useful
173 * for low power devices. If there is no use-case for this
174 * function then provide NULL.
175 */
176struct brcmfmac_platform_data {
177 void (*power_on)(void);
178 void (*power_off)(void);
179 char *fw_alternative_path;
180 int device_count;
181 struct brcmfmac_pd_device devices[0];
182};
183
184
185#endif /* _LINUX_BRCMFMAC_PLATFORM_H */
diff --git a/include/linux/platform_data/microread.h b/include/linux/platform_data/microread.h
deleted file mode 100644
index ca13992089b8..000000000000
--- a/include/linux/platform_data/microread.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Driver include for the Inside Secure microread NFC Chip.
3 *
4 * Copyright (C) 2011 Tieto Poland
5 * Copyright (C) 2012 Intel Corporation. All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef _MICROREAD_H
22#define _MICROREAD_H
23
24#include <linux/i2c.h>
25
26#define MICROREAD_DRIVER_NAME "microread"
27
28/* board config platform data for microread */
29struct microread_nfc_platform_data {
30 unsigned int rst_gpio;
31 unsigned int irq_gpio;
32 unsigned int ioh_gpio;
33};
34
35#endif /* _MICROREAD_H */