浏览代码

ALSA: firewire-lib: Add 'direction' member to 'cmp_connection' structure

This patch adds 'direction' member to 'cmp_connection' structure to indicate
the direction of connection. This patch also adds 'direction' argument to
cmp_connection_init() function to determine the direction.

The cmp_connection_init() function is exported and used in snd-firewire-speakers
so this patch also affect it.

This patch just add them. Actual implementation will be done by followed
patches.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto 11 年之前
父节点
当前提交
c68a1c6584
共有 3 个文件被更改,包括 9 次插入1 次删除
  1. 1 0
      sound/firewire/cmp.c
  2. 7 0
      sound/firewire/cmp.h
  3. 1 1
      sound/firewire/speakers.c

+ 1 - 0
sound/firewire/cmp.c

@@ -94,6 +94,7 @@ static int pcr_modify(struct cmp_connection *c,
  */
  */
 int cmp_connection_init(struct cmp_connection *c,
 int cmp_connection_init(struct cmp_connection *c,
 			struct fw_unit *unit,
 			struct fw_unit *unit,
+			enum cmp_direction direction,
 			unsigned int pcr_index)
 			unsigned int pcr_index)
 {
 {
 	__be32 mpr_be;
 	__be32 mpr_be;

+ 7 - 0
sound/firewire/cmp.h

@@ -7,6 +7,11 @@
 
 
 struct fw_unit;
 struct fw_unit;
 
 
+enum cmp_direction {
+	CMP_INPUT = 0,
+	CMP_OUTPUT,
+};
+
 /**
 /**
  * struct cmp_connection - manages an isochronous connection to a device
  * struct cmp_connection - manages an isochronous connection to a device
  * @speed: the connection's actual speed
  * @speed: the connection's actual speed
@@ -26,10 +31,12 @@ struct cmp_connection {
 	__be32 last_pcr_value;
 	__be32 last_pcr_value;
 	unsigned int pcr_index;
 	unsigned int pcr_index;
 	unsigned int max_speed;
 	unsigned int max_speed;
+	enum cmp_direction direction;
 };
 };
 
 
 int cmp_connection_init(struct cmp_connection *connection,
 int cmp_connection_init(struct cmp_connection *connection,
 			struct fw_unit *unit,
 			struct fw_unit *unit,
+			enum cmp_direction direction,
 			unsigned int pcr_index);
 			unsigned int pcr_index);
 void cmp_connection_destroy(struct cmp_connection *connection);
 void cmp_connection_destroy(struct cmp_connection *connection);
 
 

+ 1 - 1
sound/firewire/speakers.c

@@ -673,7 +673,7 @@ static int fwspk_probe(struct fw_unit *unit,
 	fwspk->unit = fw_unit_get(unit);
 	fwspk->unit = fw_unit_get(unit);
 	fwspk->device_info = (const struct device_info *)id->driver_data;
 	fwspk->device_info = (const struct device_info *)id->driver_data;
 
 
-	err = cmp_connection_init(&fwspk->connection, unit, 0);
+	err = cmp_connection_init(&fwspk->connection, unit, CMP_INPUT, 0);
 	if (err < 0)
 	if (err < 0)
 		goto err_unit;
 		goto err_unit;