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>
This commit is contained in:
Sebastian Reichel 2014-03-28 22:48:23 +01:00
parent a0bf37edb4
commit a088cf161c
3 changed files with 71 additions and 11 deletions

View file

@ -67,18 +67,32 @@ enum {
HSI_EVENT_STOP_RX,
};
/**
* 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