summaryrefslogtreecommitdiff
path: root/include/linux/hsi
diff options
context:
space:
mode:
authorSebastian Reichel <sre@kernel.org>2014-03-28 22:48:23 +0100
committerSebastian Reichel <sre@kernel.org>2014-05-16 00:54:36 +0200
commita088cf161cc87b39e83c7c53b9f239773422d212 (patch)
treea58304be6d5e9fd06e2739c1485a87a0824db0e6 /include/linux/hsi
parenta0bf37edb4d34c21bdaa19a1624378924b917491 (diff)
downloadlwn-a088cf161cc87b39e83c7c53b9f239773422d212.tar.gz
lwn-a088cf161cc87b39e83c7c53b9f239773422d212.zip
HSI: Add channel resource support to HSI clients
Make HSI channel ids platform data, which can be provided by platform data. Signed-off-by: Sebastian Reichel <sre@kernel.org> Tested-By: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Diffstat (limited to 'include/linux/hsi')
-rw-r--r--include/linux/hsi/hsi.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/include/linux/hsi/hsi.h b/include/linux/hsi/hsi.h
index 5a9f1210ed22..e3cff94bef04 100644
--- a/include/linux/hsi/hsi.h
+++ b/include/linux/hsi/hsi.h
@@ -68,17 +68,31 @@ enum {
};
/**
+ * struct hsi_channel - channel resource used by the hsi clients
+ * @id: Channel number
+ * @name: Channel name
+ */
+struct hsi_channel {
+ unsigned int id;
+ const char *name;
+};
+
+/**
* struct hsi_config - Configuration for RX/TX HSI modules
* @mode: Bit transmission mode (STREAM or FRAME)
- * @channels: Number of channels to use [1..16]
+ * @channels: Channel resources used by the client
+ * @num_channels: Number of channel resources
+ * @num_hw_channels: Number of channels the transceiver is configured for [1..16]
* @speed: Max bit transmission speed (Kbit/s)
* @flow: RX flow type (SYNCHRONIZED or PIPELINE)
* @arb_mode: Arbitration mode for TX frame (Round robin, priority)
*/
struct hsi_config {
- unsigned int mode;
- unsigned int channels;
- unsigned int speed;
+ unsigned int mode;
+ struct hsi_channel *channels;
+ unsigned int num_channels;
+ unsigned int num_hw_channels;
+ unsigned int speed;
union {
unsigned int flow; /* RX only */
unsigned int arb_mode; /* TX only */
@@ -306,6 +320,8 @@ static inline struct hsi_port *hsi_find_port_num(struct hsi_controller *hsi,
*/
int hsi_async(struct hsi_client *cl, struct hsi_msg *msg);
+int hsi_get_channel_id_by_name(struct hsi_client *cl, char *name);
+
/**
* hsi_id - Get HSI controller ID associated to a client
* @cl: Pointer to a HSI client