diff options
Diffstat (limited to 'include/linux/hsi/hsi.h')
-rw-r--r-- | include/linux/hsi/hsi.h | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/include/linux/hsi/hsi.h b/include/linux/hsi/hsi.h index 39bfd5b89077..3ec06300d535 100644 --- a/include/linux/hsi/hsi.h +++ b/include/linux/hsi/hsi.h | |||
@@ -68,17 +68,31 @@ enum { | |||
68 | }; | 68 | }; |
69 | 69 | ||
70 | /** | 70 | /** |
71 | * struct hsi_channel - channel resource used by the hsi clients | ||
72 | * @id: Channel number | ||
73 | * @name: Channel name | ||
74 | */ | ||
75 | struct hsi_channel { | ||
76 | unsigned int id; | ||
77 | const char *name; | ||
78 | }; | ||
79 | |||
80 | /** | ||
71 | * struct hsi_config - Configuration for RX/TX HSI modules | 81 | * struct hsi_config - Configuration for RX/TX HSI modules |
72 | * @mode: Bit transmission mode (STREAM or FRAME) | 82 | * @mode: Bit transmission mode (STREAM or FRAME) |
73 | * @channels: Number of channels to use [1..16] | 83 | * @channels: Channel resources used by the client |
84 | * @num_channels: Number of channel resources | ||
85 | * @num_hw_channels: Number of channels the transceiver is configured for [1..16] | ||
74 | * @speed: Max bit transmission speed (Kbit/s) | 86 | * @speed: Max bit transmission speed (Kbit/s) |
75 | * @flow: RX flow type (SYNCHRONIZED or PIPELINE) | 87 | * @flow: RX flow type (SYNCHRONIZED or PIPELINE) |
76 | * @arb_mode: Arbitration mode for TX frame (Round robin, priority) | 88 | * @arb_mode: Arbitration mode for TX frame (Round robin, priority) |
77 | */ | 89 | */ |
78 | struct hsi_config { | 90 | struct hsi_config { |
79 | unsigned int mode; | 91 | unsigned int mode; |
80 | unsigned int channels; | 92 | struct hsi_channel *channels; |
81 | unsigned int speed; | 93 | unsigned int num_channels; |
94 | unsigned int num_hw_channels; | ||
95 | unsigned int speed; | ||
82 | union { | 96 | union { |
83 | unsigned int flow; /* RX only */ | 97 | unsigned int flow; /* RX only */ |
84 | unsigned int arb_mode; /* TX only */ | 98 | unsigned int arb_mode; /* TX only */ |
@@ -282,6 +296,21 @@ struct hsi_controller *hsi_alloc_controller(unsigned int n_ports, gfp_t flags); | |||
282 | void hsi_put_controller(struct hsi_controller *hsi); | 296 | void hsi_put_controller(struct hsi_controller *hsi); |
283 | int hsi_register_controller(struct hsi_controller *hsi); | 297 | int hsi_register_controller(struct hsi_controller *hsi); |
284 | void hsi_unregister_controller(struct hsi_controller *hsi); | 298 | void hsi_unregister_controller(struct hsi_controller *hsi); |
299 | struct hsi_client *hsi_new_client(struct hsi_port *port, | ||
300 | struct hsi_board_info *info); | ||
301 | int hsi_remove_client(struct device *dev, void *data); | ||
302 | void hsi_port_unregister_clients(struct hsi_port *port); | ||
303 | |||
304 | #ifdef CONFIG_OF | ||
305 | void hsi_add_clients_from_dt(struct hsi_port *port, | ||
306 | struct device_node *clients); | ||
307 | #else | ||
308 | static inline void hsi_add_clients_from_dt(struct hsi_port *port, | ||
309 | struct device_node *clients) | ||
310 | { | ||
311 | return; | ||
312 | } | ||
313 | #endif | ||
285 | 314 | ||
286 | static inline void hsi_controller_set_drvdata(struct hsi_controller *hsi, | 315 | static inline void hsi_controller_set_drvdata(struct hsi_controller *hsi, |
287 | void *data) | 316 | void *data) |
@@ -305,6 +334,8 @@ static inline struct hsi_port *hsi_find_port_num(struct hsi_controller *hsi, | |||
305 | */ | 334 | */ |
306 | int hsi_async(struct hsi_client *cl, struct hsi_msg *msg); | 335 | int hsi_async(struct hsi_client *cl, struct hsi_msg *msg); |
307 | 336 | ||
337 | int hsi_get_channel_id_by_name(struct hsi_client *cl, char *name); | ||
338 | |||
308 | /** | 339 | /** |
309 | * hsi_id - Get HSI controller ID associated to a client | 340 | * hsi_id - Get HSI controller ID associated to a client |
310 | * @cl: Pointer to a HSI client | 341 | * @cl: Pointer to a HSI client |