aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hsi
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-05-18 12:13:33 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-05-18 12:13:33 -0400
commit16ee6576e25b83806d26eb771138249fcfb5eddc (patch)
tree7c717b80f28b5c59ba673dc00f2ca9bd0fc068d4 /include/linux/hsi
parent16fa7e8200fb9066b77a3f27cbed8e4a9fc71998 (diff)
parent9b63776fa3ca96c4ecda76f6fa947b7b0add66ac (diff)
Merge remote-tracking branch 'tip/perf/urgent' into perf/core
Merge reason: We are going to queue up a dependent patch: "perf tools: Move parse event automated tests to separated object" That depends on: commit e7c72d8 perf tools: Add 'G' and 'H' modifiers to event parsing Conflicts: tools/perf/builtin-stat.c Conflicted with the recent 'perf_target' patches when checking the result of perf_evsel open routines to see if a retry is needed to cope with older kernels where the exclude guest/host perf_event_attr bits were not used. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'include/linux/hsi')
-rw-r--r--include/linux/hsi/hsi.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/include/linux/hsi/hsi.h b/include/linux/hsi/hsi.h
index 4b178067f405..56fae865e272 100644
--- a/include/linux/hsi/hsi.h
+++ b/include/linux/hsi/hsi.h
@@ -26,9 +26,9 @@
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/mutex.h> 27#include <linux/mutex.h>
28#include <linux/scatterlist.h> 28#include <linux/scatterlist.h>
29#include <linux/spinlock.h>
30#include <linux/list.h> 29#include <linux/list.h>
31#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/notifier.h>
32 32
33/* HSI message ttype */ 33/* HSI message ttype */
34#define HSI_MSG_READ 0 34#define HSI_MSG_READ 0
@@ -121,18 +121,18 @@ static inline int hsi_register_board_info(struct hsi_board_info const *info,
121 * @device: Driver model representation of the device 121 * @device: Driver model representation of the device
122 * @tx_cfg: HSI TX configuration 122 * @tx_cfg: HSI TX configuration
123 * @rx_cfg: HSI RX configuration 123 * @rx_cfg: HSI RX configuration
124 * @hsi_start_rx: Called after incoming wake line goes high 124 * @e_handler: Callback for handling port events (RX Wake High/Low)
125 * @hsi_stop_rx: Called after incoming wake line goes low 125 * @pclaimed: Keeps tracks if the clients claimed its associated HSI port
126 * @nb: Notifier block for port events
126 */ 127 */
127struct hsi_client { 128struct hsi_client {
128 struct device device; 129 struct device device;
129 struct hsi_config tx_cfg; 130 struct hsi_config tx_cfg;
130 struct hsi_config rx_cfg; 131 struct hsi_config rx_cfg;
131 void (*hsi_start_rx)(struct hsi_client *cl);
132 void (*hsi_stop_rx)(struct hsi_client *cl);
133 /* private: */ 132 /* private: */
133 void (*ehandler)(struct hsi_client *, unsigned long);
134 unsigned int pclaimed:1; 134 unsigned int pclaimed:1;
135 struct list_head link; 135 struct notifier_block nb;
136}; 136};
137 137
138#define to_hsi_client(dev) container_of(dev, struct hsi_client, device) 138#define to_hsi_client(dev) container_of(dev, struct hsi_client, device)
@@ -147,6 +147,10 @@ static inline void *hsi_client_drvdata(struct hsi_client *cl)
147 return dev_get_drvdata(&cl->device); 147 return dev_get_drvdata(&cl->device);
148} 148}
149 149
150int hsi_register_port_event(struct hsi_client *cl,
151 void (*handler)(struct hsi_client *, unsigned long));
152int hsi_unregister_port_event(struct hsi_client *cl);
153
150/** 154/**
151 * struct hsi_client_driver - Driver associated to an HSI client 155 * struct hsi_client_driver - Driver associated to an HSI client
152 * @driver: Driver model representation of the driver 156 * @driver: Driver model representation of the driver
@@ -214,8 +218,7 @@ void hsi_free_msg(struct hsi_msg *msg);
214 * @start_tx: Callback to inform that a client wants to TX data 218 * @start_tx: Callback to inform that a client wants to TX data
215 * @stop_tx: Callback to inform that a client no longer wishes to TX data 219 * @stop_tx: Callback to inform that a client no longer wishes to TX data
216 * @release: Callback to inform that a client no longer uses the port 220 * @release: Callback to inform that a client no longer uses the port
217 * @clients: List of hsi_clients using the port. 221 * @n_head: Notifier chain for signaling port events to the clients.
218 * @clock: Lock to serialize access to the clients list.
219 */ 222 */
220struct hsi_port { 223struct hsi_port {
221 struct device device; 224 struct device device;
@@ -231,14 +234,14 @@ struct hsi_port {
231 int (*start_tx)(struct hsi_client *cl); 234 int (*start_tx)(struct hsi_client *cl);
232 int (*stop_tx)(struct hsi_client *cl); 235 int (*stop_tx)(struct hsi_client *cl);
233 int (*release)(struct hsi_client *cl); 236 int (*release)(struct hsi_client *cl);
234 struct list_head clients; 237 /* private */
235 spinlock_t clock; 238 struct atomic_notifier_head n_head;
236}; 239};
237 240
238#define to_hsi_port(dev) container_of(dev, struct hsi_port, device) 241#define to_hsi_port(dev) container_of(dev, struct hsi_port, device)
239#define hsi_get_port(cl) to_hsi_port((cl)->device.parent) 242#define hsi_get_port(cl) to_hsi_port((cl)->device.parent)
240 243
241void hsi_event(struct hsi_port *port, unsigned int event); 244int hsi_event(struct hsi_port *port, unsigned long event);
242int hsi_claim_port(struct hsi_client *cl, unsigned int share); 245int hsi_claim_port(struct hsi_client *cl, unsigned int share);
243void hsi_release_port(struct hsi_client *cl); 246void hsi_release_port(struct hsi_client *cl);
244 247
@@ -270,13 +273,13 @@ struct hsi_controller {
270 struct module *owner; 273 struct module *owner;
271 unsigned int id; 274 unsigned int id;
272 unsigned int num_ports; 275 unsigned int num_ports;
273 struct hsi_port *port; 276 struct hsi_port **port;
274}; 277};
275 278
276#define to_hsi_controller(dev) container_of(dev, struct hsi_controller, device) 279#define to_hsi_controller(dev) container_of(dev, struct hsi_controller, device)
277 280
278struct hsi_controller *hsi_alloc_controller(unsigned int n_ports, gfp_t flags); 281struct hsi_controller *hsi_alloc_controller(unsigned int n_ports, gfp_t flags);
279void hsi_free_controller(struct hsi_controller *hsi); 282void hsi_put_controller(struct hsi_controller *hsi);
280int hsi_register_controller(struct hsi_controller *hsi); 283int hsi_register_controller(struct hsi_controller *hsi);
281void hsi_unregister_controller(struct hsi_controller *hsi); 284void hsi_unregister_controller(struct hsi_controller *hsi);
282 285
@@ -294,7 +297,7 @@ static inline void *hsi_controller_drvdata(struct hsi_controller *hsi)
294static inline struct hsi_port *hsi_find_port_num(struct hsi_controller *hsi, 297static inline struct hsi_port *hsi_find_port_num(struct hsi_controller *hsi,
295 unsigned int num) 298 unsigned int num)
296{ 299{
297 return (num < hsi->num_ports) ? &hsi->port[num] : NULL; 300 return (num < hsi->num_ports) ? hsi->port[num] : NULL;
298} 301}
299 302
300/* 303/*