aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hsi/hsi.h39
-rw-r--r--include/linux/hsi/ssi_protocol.h42
2 files changed, 77 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 */
75struct 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 */
78struct hsi_config { 90struct 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);
282void hsi_put_controller(struct hsi_controller *hsi); 296void hsi_put_controller(struct hsi_controller *hsi);
283int hsi_register_controller(struct hsi_controller *hsi); 297int hsi_register_controller(struct hsi_controller *hsi);
284void hsi_unregister_controller(struct hsi_controller *hsi); 298void hsi_unregister_controller(struct hsi_controller *hsi);
299struct hsi_client *hsi_new_client(struct hsi_port *port,
300 struct hsi_board_info *info);
301int hsi_remove_client(struct device *dev, void *data);
302void hsi_port_unregister_clients(struct hsi_port *port);
303
304#ifdef CONFIG_OF
305void hsi_add_clients_from_dt(struct hsi_port *port,
306 struct device_node *clients);
307#else
308static inline void hsi_add_clients_from_dt(struct hsi_port *port,
309 struct device_node *clients)
310{
311 return;
312}
313#endif
285 314
286static inline void hsi_controller_set_drvdata(struct hsi_controller *hsi, 315static 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 */
306int hsi_async(struct hsi_client *cl, struct hsi_msg *msg); 335int hsi_async(struct hsi_client *cl, struct hsi_msg *msg);
307 336
337int 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
diff --git a/include/linux/hsi/ssi_protocol.h b/include/linux/hsi/ssi_protocol.h
new file mode 100644
index 000000000000..1433651be0dc
--- /dev/null
+++ b/include/linux/hsi/ssi_protocol.h
@@ -0,0 +1,42 @@
1/*
2 * ssip_slave.h
3 *
4 * SSIP slave support header file
5 *
6 * Copyright (C) 2010 Nokia Corporation. All rights reserved.
7 *
8 * Contact: Carlos Chinea <carlos.chinea@nokia.com>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * version 2 as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22 * 02110-1301 USA
23 */
24
25#ifndef __LINUX_SSIP_SLAVE_H__
26#define __LINUX_SSIP_SLAVE_H__
27
28#include <linux/hsi/hsi.h>
29
30static inline void ssip_slave_put_master(struct hsi_client *master)
31{
32}
33
34struct hsi_client *ssip_slave_get_master(struct hsi_client *slave);
35int ssip_slave_start_tx(struct hsi_client *master);
36int ssip_slave_stop_tx(struct hsi_client *master);
37void ssip_reset_event(struct hsi_client *master);
38
39int ssip_slave_running(struct hsi_client *master);
40
41#endif /* __LINUX_SSIP_SLAVE_H__ */
42