diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-14 19:43:47 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-14 19:43:47 -0500 |
| commit | 6ae840e7cc4be0be3aa40d9f67c35c75cfc67d83 (patch) | |
| tree | 9c83c87a8670ef678d95f8d6f76a07f24a09a49f /include/linux | |
| parent | e6b5be2be4e30037eb551e0ed09dd97bd00d85d3 (diff) | |
| parent | 91905b6f4afe51e23a3f58df93e4cdc5e49cf40c (diff) | |
Merge tag 'char-misc-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH:
"Here's the big char/misc driver update for 3.19-rc1
Lots of little things all over the place in different drivers, and a
new subsystem, "coresight" has been added. Full details are in the
shortlog"
* tag 'char-misc-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (73 commits)
parport: parport_pc, do not remove parent devices early
spmi: Remove shutdown/suspend/resume kernel-doc
carma-fpga-program: drop videobuf dependency
carma-fpga: drop videobuf dependency
carma-fpga-program.c: fix compile errors
i8k: Fix temperature bug handling in i8k_get_temp()
cxl: Name interrupts in /proc/interrupt
CXL: Return error to PSL if IRQ demultiplexing fails & print clearer warning
coresight-replicator: remove .owner field for driver
coresight: fixed comments in coresight.h
coresight: fix typo in comment in coresight-priv.h
coresight: bindings for coresight drivers
coresight: Adding ABI documentation
w1: support auto-load of w1_bq27000 module.
w1: avoid potential u16 overflow
cn: verify msg->len before making callback
mei: export fw status registers through sysfs
mei: read and print all six FW status registers
mei: txe: add cherrytrail device id
mei: kill cached host and me csr values
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/amba/bus.h | 1 | ||||
| -rw-r--r-- | include/linux/coresight.h | 263 | ||||
| -rw-r--r-- | include/linux/io.h | 4 | ||||
| -rw-r--r-- | include/linux/spmi.h | 3 | ||||
| -rw-r--r-- | include/linux/uio_driver.h | 2 |
5 files changed, 267 insertions, 6 deletions
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index ac02f9bd63dc..2afc618b15ce 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | #define AMBA_NR_IRQS 9 | 24 | #define AMBA_NR_IRQS 9 |
| 25 | #define AMBA_CID 0xb105f00d | 25 | #define AMBA_CID 0xb105f00d |
| 26 | #define CORESIGHT_CID 0xb105900d | ||
| 26 | 27 | ||
| 27 | struct clk; | 28 | struct clk; |
| 28 | 29 | ||
diff --git a/include/linux/coresight.h b/include/linux/coresight.h new file mode 100644 index 000000000000..5d3c54311f7a --- /dev/null +++ b/include/linux/coresight.h | |||
| @@ -0,0 +1,263 @@ | |||
| 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. | ||
| 2 | * | ||
| 3 | * This program is free software; you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License version 2 and | ||
| 5 | * only version 2 as published by the Free Software Foundation. | ||
| 6 | * | ||
| 7 | * This program is distributed in the hope that it will be useful, | ||
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 10 | * GNU General Public License for more details. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef _LINUX_CORESIGHT_H | ||
| 14 | #define _LINUX_CORESIGHT_H | ||
| 15 | |||
| 16 | #include <linux/device.h> | ||
| 17 | |||
| 18 | /* Peripheral id registers (0xFD0-0xFEC) */ | ||
| 19 | #define CORESIGHT_PERIPHIDR4 0xfd0 | ||
| 20 | #define CORESIGHT_PERIPHIDR5 0xfd4 | ||
| 21 | #define CORESIGHT_PERIPHIDR6 0xfd8 | ||
| 22 | #define CORESIGHT_PERIPHIDR7 0xfdC | ||
| 23 | #define CORESIGHT_PERIPHIDR0 0xfe0 | ||
| 24 | #define CORESIGHT_PERIPHIDR1 0xfe4 | ||
| 25 | #define CORESIGHT_PERIPHIDR2 0xfe8 | ||
| 26 | #define CORESIGHT_PERIPHIDR3 0xfeC | ||
| 27 | /* Component id registers (0xFF0-0xFFC) */ | ||
| 28 | #define CORESIGHT_COMPIDR0 0xff0 | ||
| 29 | #define CORESIGHT_COMPIDR1 0xff4 | ||
| 30 | #define CORESIGHT_COMPIDR2 0xff8 | ||
| 31 | #define CORESIGHT_COMPIDR3 0xffC | ||
| 32 | |||
| 33 | #define ETM_ARCH_V3_3 0x23 | ||
| 34 | #define ETM_ARCH_V3_5 0x25 | ||
| 35 | #define PFT_ARCH_V1_0 0x30 | ||
| 36 | #define PFT_ARCH_V1_1 0x31 | ||
| 37 | |||
| 38 | #define CORESIGHT_UNLOCK 0xc5acce55 | ||
| 39 | |||
| 40 | extern struct bus_type coresight_bustype; | ||
| 41 | |||
| 42 | enum coresight_dev_type { | ||
| 43 | CORESIGHT_DEV_TYPE_NONE, | ||
| 44 | CORESIGHT_DEV_TYPE_SINK, | ||
| 45 | CORESIGHT_DEV_TYPE_LINK, | ||
| 46 | CORESIGHT_DEV_TYPE_LINKSINK, | ||
| 47 | CORESIGHT_DEV_TYPE_SOURCE, | ||
| 48 | }; | ||
| 49 | |||
| 50 | enum coresight_dev_subtype_sink { | ||
| 51 | CORESIGHT_DEV_SUBTYPE_SINK_NONE, | ||
| 52 | CORESIGHT_DEV_SUBTYPE_SINK_PORT, | ||
| 53 | CORESIGHT_DEV_SUBTYPE_SINK_BUFFER, | ||
| 54 | }; | ||
| 55 | |||
| 56 | enum coresight_dev_subtype_link { | ||
| 57 | CORESIGHT_DEV_SUBTYPE_LINK_NONE, | ||
| 58 | CORESIGHT_DEV_SUBTYPE_LINK_MERG, | ||
| 59 | CORESIGHT_DEV_SUBTYPE_LINK_SPLIT, | ||
| 60 | CORESIGHT_DEV_SUBTYPE_LINK_FIFO, | ||
| 61 | }; | ||
| 62 | |||
| 63 | enum coresight_dev_subtype_source { | ||
| 64 | CORESIGHT_DEV_SUBTYPE_SOURCE_NONE, | ||
| 65 | CORESIGHT_DEV_SUBTYPE_SOURCE_PROC, | ||
| 66 | CORESIGHT_DEV_SUBTYPE_SOURCE_BUS, | ||
| 67 | CORESIGHT_DEV_SUBTYPE_SOURCE_SOFTWARE, | ||
| 68 | }; | ||
| 69 | |||
| 70 | /** | ||
| 71 | * struct coresight_dev_subtype - further characterisation of a type | ||
| 72 | * @sink_subtype: type of sink this component is, as defined | ||
| 73 | by @coresight_dev_subtype_sink. | ||
| 74 | * @link_subtype: type of link this component is, as defined | ||
| 75 | by @coresight_dev_subtype_link. | ||
| 76 | * @source_subtype: type of source this component is, as defined | ||
| 77 | by @coresight_dev_subtype_source. | ||
| 78 | */ | ||
| 79 | struct coresight_dev_subtype { | ||
| 80 | enum coresight_dev_subtype_sink sink_subtype; | ||
| 81 | enum coresight_dev_subtype_link link_subtype; | ||
| 82 | enum coresight_dev_subtype_source source_subtype; | ||
| 83 | }; | ||
| 84 | |||
| 85 | /** | ||
| 86 | * struct coresight_platform_data - data harvested from the DT specification | ||
| 87 | * @cpu: the CPU a source belongs to. Only applicable for ETM/PTMs. | ||
| 88 | * @name: name of the component as shown under sysfs. | ||
| 89 | * @nr_inport: number of input ports for this component. | ||
| 90 | * @outports: list of remote endpoint port number. | ||
| 91 | * @child_names:name of all child components connected to this device. | ||
| 92 | * @child_ports:child component port number the current component is | ||
| 93 | connected to. | ||
| 94 | * @nr_outport: number of output ports for this component. | ||
| 95 | * @clk: The clock this component is associated to. | ||
| 96 | */ | ||
| 97 | struct coresight_platform_data { | ||
| 98 | int cpu; | ||
| 99 | const char *name; | ||
| 100 | int nr_inport; | ||
| 101 | int *outports; | ||
| 102 | const char **child_names; | ||
| 103 | int *child_ports; | ||
| 104 | int nr_outport; | ||
| 105 | struct clk *clk; | ||
| 106 | }; | ||
| 107 | |||
| 108 | /** | ||
| 109 | * struct coresight_desc - description of a component required from drivers | ||
| 110 | * @type: as defined by @coresight_dev_type. | ||
| 111 | * @subtype: as defined by @coresight_dev_subtype. | ||
| 112 | * @ops: generic operations for this component, as defined | ||
| 113 | by @coresight_ops. | ||
| 114 | * @pdata: platform data collected from DT. | ||
| 115 | * @dev: The device entity associated to this component. | ||
| 116 | * @groups: operations specific to this component. These will end up | ||
| 117 | in the component's sysfs sub-directory. | ||
| 118 | */ | ||
| 119 | struct coresight_desc { | ||
| 120 | enum coresight_dev_type type; | ||
| 121 | struct coresight_dev_subtype subtype; | ||
| 122 | const struct coresight_ops *ops; | ||
| 123 | struct coresight_platform_data *pdata; | ||
| 124 | struct device *dev; | ||
| 125 | const struct attribute_group **groups; | ||
| 126 | }; | ||
| 127 | |||
| 128 | /** | ||
| 129 | * struct coresight_connection - representation of a single connection | ||
| 130 | * @outport: a connection's output port number. | ||
| 131 | * @chid_name: remote component's name. | ||
| 132 | * @child_port: remote component's port number @output is connected to. | ||
| 133 | * @child_dev: a @coresight_device representation of the component | ||
| 134 | connected to @outport. | ||
| 135 | */ | ||
| 136 | struct coresight_connection { | ||
| 137 | int outport; | ||
| 138 | const char *child_name; | ||
| 139 | int child_port; | ||
| 140 | struct coresight_device *child_dev; | ||
| 141 | }; | ||
| 142 | |||
| 143 | /** | ||
| 144 | * struct coresight_device - representation of a device as used by the framework | ||
| 145 | * @conns: array of coresight_connections associated to this component. | ||
| 146 | * @nr_inport: number of input port associated to this component. | ||
| 147 | * @nr_outport: number of output port associated to this component. | ||
| 148 | * @type: as defined by @coresight_dev_type. | ||
| 149 | * @subtype: as defined by @coresight_dev_subtype. | ||
| 150 | * @ops: generic operations for this component, as defined | ||
| 151 | by @coresight_ops. | ||
| 152 | * @dev: The device entity associated to this component. | ||
| 153 | * @refcnt: keep track of what is in use. | ||
| 154 | * @path_link: link of current component into the path being enabled. | ||
| 155 | * @orphan: true if the component has connections that haven't been linked. | ||
| 156 | * @enable: 'true' if component is currently part of an active path. | ||
| 157 | * @activated: 'true' only if a _sink_ has been activated. A sink can be | ||
| 158 | activated but not yet enabled. Enabling for a _sink_ | ||
| 159 | happens when a source has been selected for that it. | ||
| 160 | */ | ||
| 161 | struct coresight_device { | ||
| 162 | struct coresight_connection *conns; | ||
| 163 | int nr_inport; | ||
| 164 | int nr_outport; | ||
| 165 | enum coresight_dev_type type; | ||
| 166 | struct coresight_dev_subtype subtype; | ||
| 167 | const struct coresight_ops *ops; | ||
| 168 | struct device dev; | ||
| 169 | atomic_t *refcnt; | ||
| 170 | struct list_head path_link; | ||
| 171 | bool orphan; | ||
| 172 | bool enable; /* true only if configured as part of a path */ | ||
| 173 | bool activated; /* true only if a sink is part of a path */ | ||
| 174 | }; | ||
| 175 | |||
| 176 | #define to_coresight_device(d) container_of(d, struct coresight_device, dev) | ||
| 177 | |||
| 178 | #define source_ops(csdev) csdev->ops->source_ops | ||
| 179 | #define sink_ops(csdev) csdev->ops->sink_ops | ||
| 180 | #define link_ops(csdev) csdev->ops->link_ops | ||
| 181 | |||
| 182 | #define CORESIGHT_DEBUGFS_ENTRY(__name, __entry_name, \ | ||
| 183 | __mode, __get, __set, __fmt) \ | ||
| 184 | DEFINE_SIMPLE_ATTRIBUTE(__name ## _ops, __get, __set, __fmt); \ | ||
| 185 | static const struct coresight_ops_entry __name ## _entry = { \ | ||
| 186 | .name = __entry_name, \ | ||
| 187 | .mode = __mode, \ | ||
| 188 | .ops = &__name ## _ops \ | ||
| 189 | } | ||
| 190 | |||
| 191 | /** | ||
| 192 | * struct coresight_ops_sink - basic operations for a sink | ||
| 193 | * Operations available for sinks | ||
| 194 | * @enable: enables the sink. | ||
| 195 | * @disable: disables the sink. | ||
| 196 | */ | ||
| 197 | struct coresight_ops_sink { | ||
| 198 | int (*enable)(struct coresight_device *csdev); | ||
| 199 | void (*disable)(struct coresight_device *csdev); | ||
| 200 | }; | ||
| 201 | |||
| 202 | /** | ||
| 203 | * struct coresight_ops_link - basic operations for a link | ||
| 204 | * Operations available for links. | ||
| 205 | * @enable: enables flow between iport and oport. | ||
| 206 | * @disable: disables flow between iport and oport. | ||
| 207 | */ | ||
| 208 | struct coresight_ops_link { | ||
| 209 | int (*enable)(struct coresight_device *csdev, int iport, int oport); | ||
| 210 | void (*disable)(struct coresight_device *csdev, int iport, int oport); | ||
| 211 | }; | ||
| 212 | |||
| 213 | /** | ||
| 214 | * struct coresight_ops_source - basic operations for a source | ||
| 215 | * Operations available for sources. | ||
| 216 | * @trace_id: returns the value of the component's trace ID as known | ||
| 217 | to the HW. | ||
| 218 | * @enable: enables tracing from a source. | ||
| 219 | * @disable: disables tracing for a source. | ||
| 220 | */ | ||
| 221 | struct coresight_ops_source { | ||
| 222 | int (*trace_id)(struct coresight_device *csdev); | ||
| 223 | int (*enable)(struct coresight_device *csdev); | ||
| 224 | void (*disable)(struct coresight_device *csdev); | ||
| 225 | }; | ||
| 226 | |||
| 227 | struct coresight_ops { | ||
| 228 | const struct coresight_ops_sink *sink_ops; | ||
| 229 | const struct coresight_ops_link *link_ops; | ||
| 230 | const struct coresight_ops_source *source_ops; | ||
| 231 | }; | ||
| 232 | |||
| 233 | #ifdef CONFIG_CORESIGHT | ||
| 234 | extern struct coresight_device * | ||
| 235 | coresight_register(struct coresight_desc *desc); | ||
| 236 | extern void coresight_unregister(struct coresight_device *csdev); | ||
| 237 | extern int coresight_enable(struct coresight_device *csdev); | ||
| 238 | extern void coresight_disable(struct coresight_device *csdev); | ||
| 239 | extern int coresight_is_bit_set(u32 val, int position, int value); | ||
| 240 | extern int coresight_timeout(void __iomem *addr, u32 offset, | ||
| 241 | int position, int value); | ||
| 242 | #ifdef CONFIG_OF | ||
| 243 | extern struct coresight_platform_data *of_get_coresight_platform_data( | ||
| 244 | struct device *dev, struct device_node *node); | ||
| 245 | #endif | ||
| 246 | #else | ||
| 247 | static inline struct coresight_device * | ||
| 248 | coresight_register(struct coresight_desc *desc) { return NULL; } | ||
| 249 | static inline void coresight_unregister(struct coresight_device *csdev) {} | ||
| 250 | static inline int | ||
| 251 | coresight_enable(struct coresight_device *csdev) { return -ENOSYS; } | ||
| 252 | static inline void coresight_disable(struct coresight_device *csdev) {} | ||
| 253 | static inline int coresight_is_bit_set(u32 val, int position, int value) | ||
| 254 | { return 0; } | ||
| 255 | static inline int coresight_timeout(void __iomem *addr, u32 offset, | ||
| 256 | int position, int value) { return 1; } | ||
| 257 | #ifdef CONFIG_OF | ||
| 258 | static inline struct coresight_platform_data *of_get_coresight_platform_data( | ||
| 259 | struct device *dev, struct device_node *node) { return NULL; } | ||
| 260 | #endif | ||
| 261 | #endif | ||
| 262 | |||
| 263 | #endif | ||
diff --git a/include/linux/io.h b/include/linux/io.h index d5fc9b8d8b03..fa02e55e5a2e 100644 --- a/include/linux/io.h +++ b/include/linux/io.h | |||
| @@ -61,9 +61,9 @@ static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr) | |||
| 61 | #define IOMEM_ERR_PTR(err) (__force void __iomem *)ERR_PTR(err) | 61 | #define IOMEM_ERR_PTR(err) (__force void __iomem *)ERR_PTR(err) |
| 62 | 62 | ||
| 63 | void __iomem *devm_ioremap(struct device *dev, resource_size_t offset, | 63 | void __iomem *devm_ioremap(struct device *dev, resource_size_t offset, |
| 64 | unsigned long size); | 64 | resource_size_t size); |
| 65 | void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset, | 65 | void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset, |
| 66 | unsigned long size); | 66 | resource_size_t size); |
| 67 | void devm_iounmap(struct device *dev, void __iomem *addr); | 67 | void devm_iounmap(struct device *dev, void __iomem *addr); |
| 68 | int check_signature(const volatile void __iomem *io_addr, | 68 | int check_signature(const volatile void __iomem *io_addr, |
| 69 | const unsigned char *signature, int length); | 69 | const unsigned char *signature, int length); |
diff --git a/include/linux/spmi.h b/include/linux/spmi.h index 91f5eab9e428..f84212cd3b7d 100644 --- a/include/linux/spmi.h +++ b/include/linux/spmi.h | |||
| @@ -134,9 +134,6 @@ void spmi_controller_remove(struct spmi_controller *ctrl); | |||
| 134 | * this structure. | 134 | * this structure. |
| 135 | * @probe: binds this driver to a SPMI device. | 135 | * @probe: binds this driver to a SPMI device. |
| 136 | * @remove: unbinds this driver from the SPMI device. | 136 | * @remove: unbinds this driver from the SPMI device. |
| 137 | * @shutdown: standard shutdown callback used during powerdown/halt. | ||
| 138 | * @suspend: standard suspend callback used during system suspend. | ||
| 139 | * @resume: standard resume callback used during system resume. | ||
| 140 | * | 137 | * |
| 141 | * If PM runtime support is desired for a slave, a device driver can call | 138 | * If PM runtime support is desired for a slave, a device driver can call |
| 142 | * pm_runtime_put() from their probe() routine (and a balancing | 139 | * pm_runtime_put() from their probe() routine (and a balancing |
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h index baa81718d985..32c0e83d6239 100644 --- a/include/linux/uio_driver.h +++ b/include/linux/uio_driver.h | |||
| @@ -35,7 +35,7 @@ struct uio_map; | |||
| 35 | struct uio_mem { | 35 | struct uio_mem { |
| 36 | const char *name; | 36 | const char *name; |
| 37 | phys_addr_t addr; | 37 | phys_addr_t addr; |
| 38 | unsigned long size; | 38 | resource_size_t size; |
| 39 | int memtype; | 39 | int memtype; |
| 40 | void __iomem *internal_addr; | 40 | void __iomem *internal_addr; |
| 41 | struct uio_map *map; | 41 | struct uio_map *map; |
