Skip to contentSkip to conversation

ALSA: asihpi - update from HPI 4.06 to 4.08

PATCH In review [email protected] 2 participants 36 messages Jul 22, 2011 1 message not in the archive Sound

lore
Share & tools
lore
#0 lore raw

cover ALSA: asihpi - update from HPI 4.06 to 4.08

From: Eliot Blennerhassett <[email protected]>

Main visible change is the addition of mute switch to volume controls. The rest are relatively minor changes and cleanups to HPI code.

patch#6 reverts commit 4a122c10f "check adapter index in hpi_ioctl"

The associated 4.08 firmware release adds support for new cards ASI5544/5541/5540/5520

Eliot Blennerhassett (15):
ALSA: asihpi - Give more meaningful name to hpi request message type
ALSA: asihpi - Increase request and response buffer sizes
ALSA: asihpi - Remove controlex structs and associated special data
transfer code
ALSA: asihpi - DSP code loader API now independent of OS
ALSA: asihpi - Revise snd_pcm_debug_name, get rid of DEBUG_NAME macro
ALSA: asihpi - Remove spurious adapter index check
ALSA: asihpi - Remove unused structures, macros and functions
ALSA: asihpi - Fix minor typos and spelling
ALSA: asihpi - Make local function static
ALSA: asihpi - Add new node and message defines
ALSA: asihpi - Explicitly include mutex.h
ALSA: asihpi - Use size_t for sizeof result
ALSA: asihpi - Control name updates
ALSA: asihpi - Add volume mute controls
ALSA: asihpi - HPI version 4.08

 sound/pci/asihpi/asihpi.c       |   87 ++++++++++++++++++----
 sound/pci/asihpi/hpi.h          |   24 ++++--
 sound/pci/asihpi/hpi6000.c      |   11 +--
 sound/pci/asihpi/hpi6205.c      |   52 ++++---------
 sound/pci/asihpi/hpi6205.h      |   25 +++++--
 sound/pci/asihpi/hpi_internal.h |  155 ++++++++++----------------------------
 sound/pci/asihpi/hpicmn.c       |   17 ++--
 sound/pci/asihpi/hpidspcd.c     |  137 ++++++++++++++--------------------
 sound/pci/asihpi/hpidspcd.h     |   72 ++++++++++--------
 sound/pci/asihpi/hpifunc.c      |   86 ++++++++++-----------
 sound/pci/asihpi/hpimsginit.c   |    4 +-
 sound/pci/asihpi/hpimsgx.c      |    6 +-
 sound/pci/asihpi/hpioctl.c      |   10 +--
 sound/pci/asihpi/hpios.c        |    8 --
 sound/pci/asihpi/hpios.h        |    1 +
 15 files changed, 319 insertions(+), 376 deletions(-)
#1 lore raw

PATCH 1/15 ALSA: asihpi - Give more meaningful name to hpi request message type

From: Eliot Blennerhassett <[email protected]>

Having a 'request message' makes more sense than a 'message message'

---
 sound/pci/asihpi/hpi6000.c      |    4 ++--
 sound/pci/asihpi/hpi6205.c      |    7 ++++---
 sound/pci/asihpi/hpi_internal.h |    2 +-
 sound/pci/asihpi/hpicmn.c       |    2 +-
 sound/pci/asihpi/hpimsginit.c   |    4 ++--
 sound/pci/asihpi/hpimsgx.c      |    2 +-
 6 files changed, 11 insertions(+), 10 deletions(-)
sound/pci/asihpi/hpi6000.c +2 -2
index df4aed5..c8db36e 100644
@@ -359,7 +359,7 @@ void HPI_6000(struct hpi_message *phm, struct hpi_response *phr)
 			HPI_ERROR_PROCESSING_MESSAGE);
 
 	switch (phm->type) {
-	case HPI_TYPE_MESSAGE:
+	case HPI_TYPE_REQUEST:
 		switch (phm->object) {
 		case HPI_OBJ_SUBSYSTEM:
 			subsys_message(phm, phr);
@@ -538,7 +538,7 @@ static short create_adapter_obj(struct hpi_adapter_obj *pao,
 
 		HPI_DEBUG_LOG(VERBOSE, "send ADAPTER_GET_INFO\n");
 		memset(&hm, 0, sizeof(hm));
-		hm.type = HPI_TYPE_MESSAGE;
+		hm.type = HPI_TYPE_REQUEST;
 		hm.size = sizeof(struct hpi_message);
 		hm.object = HPI_OBJ_ADAPTER;
 		hm.function = HPI_ADAPTER_GET_INFO;
sound/pci/asihpi/hpi6205.c +4 -3
index 9d5df54..faff9e3 100644
@@ -392,7 +392,7 @@ void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm,
 
 	HPI_DEBUG_LOG(VERBOSE, "start of switch\n");
 	switch (phm->type) {
-	case HPI_TYPE_MESSAGE:
+	case HPI_TYPE_REQUEST:
 		switch (phm->object) {
 		case HPI_OBJ_SUBSYSTEM:
 			subsys_message(pao, phm, phr);
@@ -634,11 +634,12 @@ static u16 create_adapter_obj(struct hpi_adapter_obj *pao,
 
 		HPI_DEBUG_LOG(VERBOSE, "init ADAPTER_GET_INFO\n");
 		memset(&hm, 0, sizeof(hm));
-		hm.type = HPI_TYPE_MESSAGE;
+		/* wAdapterIndex == version == 0 */
+		hm.type = HPI_TYPE_REQUEST;
 		hm.size = sizeof(hm);
 		hm.object = HPI_OBJ_ADAPTER;
 		hm.function = HPI_ADAPTER_GET_INFO;
-		hm.adapter_index = 0;
+
 		memset(&hr, 0, sizeof(hr));
 		hr.size = sizeof(hr);
 
sound/pci/asihpi/hpi_internal.h +1 -1
index bf5eced..ce5d7cd 100644
@@ -364,7 +364,7 @@ Used in DLL to indicate device not present
 #define HPI_ADAPTER_ASI(f)   (f)
 
 enum HPI_MESSAGE_TYPES {
-	HPI_TYPE_MESSAGE = 1,
+	HPI_TYPE_REQUEST = 1,
 	HPI_TYPE_RESPONSE = 2,
 	HPI_TYPE_DATA = 3,
 	HPI_TYPE_SSX2BYPASS_MESSAGE = 4
sound/pci/asihpi/hpicmn.c +1 -1
index b15a02e..801dcd8 100644
@@ -682,7 +682,7 @@ static void subsys_message(struct hpi_message *phm, struct hpi_response *phr)
 void HPI_COMMON(struct hpi_message *phm, struct hpi_response *phr)
 {
 	switch (phm->type) {
-	case HPI_TYPE_MESSAGE:
+	case HPI_TYPE_REQUEST:
 		switch (phm->object) {
 		case HPI_OBJ_SUBSYSTEM:
 			subsys_message(phm, phr);
sound/pci/asihpi/hpimsginit.c +2 -2
index 628376c..52400a6 100644
@@ -46,7 +46,7 @@ static void hpi_init_message(struct hpi_message *phm, u16 object,
 	if (gwSSX2_bypass)
 		phm->type = HPI_TYPE_SSX2BYPASS_MESSAGE;
 	else
-		phm->type = HPI_TYPE_MESSAGE;
+		phm->type = HPI_TYPE_REQUEST;
 	phm->object = object;
 	phm->function = function;
 	phm->version = 0;
@@ -89,7 +89,7 @@ static void hpi_init_messageV1(struct hpi_message_header *phm, u16 size,
 	memset(phm, 0, sizeof(*phm));
 	if ((object > 0) && (object <= HPI_OBJ_MAXINDEX)) {
 		phm->size = size;
-		phm->type = HPI_TYPE_MESSAGE;
+		phm->type = HPI_TYPE_REQUEST;
 		phm->object = object;
 		phm->function = function;
 		phm->version = 1;
sound/pci/asihpi/hpimsgx.c +1 -1
index 7352a5f..111f774 100644
@@ -315,7 +315,7 @@ void hpi_send_recv_ex(struct hpi_message *phm, struct hpi_response *phr,
 {
 	HPI_DEBUG_MESSAGE(DEBUG, phm);
 
-	if (phm->type != HPI_TYPE_MESSAGE) {
+	if (phm->type != HPI_TYPE_REQUEST) {
 		hpi_init_response(phr, phm->object, phm->function,
 			HPI_ERROR_INVALID_TYPE);
 		return;
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 1/15 Give more meaningful name to hpi request message type

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Having a 'request message' makes more sense than a 'message message'

---
 sound/pci/asihpi/hpi6000.c      |    4 ++--
 sound/pci/asihpi/hpi6205.c      |    7 ++++---
 sound/pci/asihpi/hpi_internal.h |    2 +-
 sound/pci/asihpi/hpicmn.c       |    2 +-
 sound/pci/asihpi/hpimsginit.c   |    4 ++--
 sound/pci/asihpi/hpimsgx.c      |    2 +-
 6 files changed, 11 insertions(+), 10 deletions(-)
sound/pci/asihpi/hpi6000.c +2 -2
index df4aed5..c8db36e 100644
@@ -359,7 +359,7 @@ void HPI_6000(struct hpi_message *phm, struct hpi_response *phr)
 			HPI_ERROR_PROCESSING_MESSAGE);
 
 	switch (phm->type) {
-	case HPI_TYPE_MESSAGE:
+	case HPI_TYPE_REQUEST:
 		switch (phm->object) {
 		case HPI_OBJ_SUBSYSTEM:
 			subsys_message(phm, phr);
@@ -538,7 +538,7 @@ static short create_adapter_obj(struct hpi_adapter_obj *pao,
 
 		HPI_DEBUG_LOG(VERBOSE, "send ADAPTER_GET_INFO\n");
 		memset(&hm, 0, sizeof(hm));
-		hm.type = HPI_TYPE_MESSAGE;
+		hm.type = HPI_TYPE_REQUEST;
 		hm.size = sizeof(struct hpi_message);
 		hm.object = HPI_OBJ_ADAPTER;
 		hm.function = HPI_ADAPTER_GET_INFO;
sound/pci/asihpi/hpi6205.c +4 -3
index 9d5df54..faff9e3 100644
@@ -392,7 +392,7 @@ void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm,
 
 	HPI_DEBUG_LOG(VERBOSE, "start of switch\n");
 	switch (phm->type) {
-	case HPI_TYPE_MESSAGE:
+	case HPI_TYPE_REQUEST:
 		switch (phm->object) {
 		case HPI_OBJ_SUBSYSTEM:
 			subsys_message(pao, phm, phr);
@@ -634,11 +634,12 @@ static u16 create_adapter_obj(struct hpi_adapter_obj *pao,
 
 		HPI_DEBUG_LOG(VERBOSE, "init ADAPTER_GET_INFO\n");
 		memset(&hm, 0, sizeof(hm));
-		hm.type = HPI_TYPE_MESSAGE;
+		/* wAdapterIndex == version == 0 */
+		hm.type = HPI_TYPE_REQUEST;
 		hm.size = sizeof(hm);
 		hm.object = HPI_OBJ_ADAPTER;
 		hm.function = HPI_ADAPTER_GET_INFO;
-		hm.adapter_index = 0;
+
 		memset(&hr, 0, sizeof(hr));
 		hr.size = sizeof(hr);
 
sound/pci/asihpi/hpi_internal.h +1 -1
index bf5eced..ce5d7cd 100644
@@ -364,7 +364,7 @@ Used in DLL to indicate device not present
 #define HPI_ADAPTER_ASI(f)   (f)
 
 enum HPI_MESSAGE_TYPES {
-	HPI_TYPE_MESSAGE = 1,
+	HPI_TYPE_REQUEST = 1,
 	HPI_TYPE_RESPONSE = 2,
 	HPI_TYPE_DATA = 3,
 	HPI_TYPE_SSX2BYPASS_MESSAGE = 4
sound/pci/asihpi/hpicmn.c +1 -1
index b15a02e..801dcd8 100644
@@ -682,7 +682,7 @@ static void subsys_message(struct hpi_message *phm, struct hpi_response *phr)
 void HPI_COMMON(struct hpi_message *phm, struct hpi_response *phr)
 {
 	switch (phm->type) {
-	case HPI_TYPE_MESSAGE:
+	case HPI_TYPE_REQUEST:
 		switch (phm->object) {
 		case HPI_OBJ_SUBSYSTEM:
 			subsys_message(phm, phr);
sound/pci/asihpi/hpimsginit.c +2 -2
index 628376c..52400a6 100644
@@ -46,7 +46,7 @@ static void hpi_init_message(struct hpi_message *phm, u16 object,
 	if (gwSSX2_bypass)
 		phm->type = HPI_TYPE_SSX2BYPASS_MESSAGE;
 	else
-		phm->type = HPI_TYPE_MESSAGE;
+		phm->type = HPI_TYPE_REQUEST;
 	phm->object = object;
 	phm->function = function;
 	phm->version = 0;
@@ -89,7 +89,7 @@ static void hpi_init_messageV1(struct hpi_message_header *phm, u16 size,
 	memset(phm, 0, sizeof(*phm));
 	if ((object > 0) && (object <= HPI_OBJ_MAXINDEX)) {
 		phm->size = size;
-		phm->type = HPI_TYPE_MESSAGE;
+		phm->type = HPI_TYPE_REQUEST;
 		phm->object = object;
 		phm->function = function;
 		phm->version = 1;
sound/pci/asihpi/hpimsgx.c +1 -1
index 7352a5f..111f774 100644
@@ -315,7 +315,7 @@ void hpi_send_recv_ex(struct hpi_message *phm, struct hpi_response *phr,
 {
 	HPI_DEBUG_MESSAGE(DEBUG, phm);
 
-	if (phm->type != HPI_TYPE_MESSAGE) {
+	if (phm->type != HPI_TYPE_REQUEST) {
 		hpi_init_response(phr, phm->object, phm->function,
 			HPI_ERROR_INVALID_TYPE);
 		return;
Signature · 1 line
1.7.0.4
#3 lore raw

PATCH 2/15 ALSA: asihpi - Increase request and response buffer sizes

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Allow for up to 256 bytes of extra data on top of standard hpi request and response sizes.

---
 sound/pci/asihpi/hpi6205.c |   15 ++++++++-------
 sound/pci/asihpi/hpi6205.h |   25 +++++++++++++++++++------
 sound/pci/asihpi/hpicmn.c  |   13 +++++++------
 3 files changed, 34 insertions(+), 19 deletions(-)
sound/pci/asihpi/hpi6205.c +8 -7
index faff9e3..8831a6f 100644
@@ -2085,13 +2085,13 @@ static u16 message_response_sequence(struct hpi_adapter_obj *pao,
 	u16 err = 0;
 
 	message_count++;
-	if (phm->size > sizeof(interface->u)) {
+	if (phm->size > sizeof(interface->u.message_buffer)) {
 		phr->error = HPI_ERROR_MESSAGE_BUFFER_TOO_SMALL;
-		phr->specific_error = sizeof(interface->u);
+		phr->specific_error = sizeof(interface->u.message_buffer);
 		phr->size = sizeof(struct hpi_response_header);
 		HPI_DEBUG_LOG(ERROR,
 			"message len %d too big for buffer %zd \n", phm->size,
-			sizeof(interface->u));
+			sizeof(interface->u.message_buffer));
 		return 0;
 	}
 
@@ -2123,18 +2123,19 @@ static u16 message_response_sequence(struct hpi_adapter_obj *pao,
 
 	/* read the result */
 	if (time_out) {
-		if (interface->u.response_buffer.size <= phr->size)
+		if (interface->u.response_buffer.response.size <= phr->size)
 			memcpy(phr, &interface->u.response_buffer,
-				interface->u.response_buffer.size);
+				interface->u.response_buffer.response.size);
 		else {
 			HPI_DEBUG_LOG(ERROR,
 				"response len %d too big for buffer %d\n",
-				interface->u.response_buffer.size, phr->size);
+				interface->u.response_buffer.response.size,
+				phr->size);
 			memcpy(phr, &interface->u.response_buffer,
 				sizeof(struct hpi_response_header));
 			phr->error = HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL;
 			phr->specific_error =
-				interface->u.response_buffer.size;
+				interface->u.response_buffer.response.size;
 			phr->size = sizeof(struct hpi_response_header);
 		}
 	}
sound/pci/asihpi/hpi6205.h +19 -6
index df2f02c..ec0827b 100644
@@ -1,7 +1,7 @@
 /*****************************************************************************
 
     AudioScience HPI driver
-    Copyright (C) 1997-2010  AudioScience Inc. <[email protected]>
+    Copyright (C) 1997-2011  AudioScience Inc. <[email protected]>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of version 2 of the GNU General Public License as
@@ -70,15 +70,28 @@ The Host located memory buffer that the 6205 will bus master
 in and out of.
 ************************************************************/
 #define HPI6205_SIZEOF_DATA (16*1024)
+
+struct message_buffer_6205 {
+	struct hpi_message message;
+	char data[256];
+};
+
+struct response_buffer_6205 {
+	struct hpi_response response;
+	char data[256];
+};
+
+union buffer_6205 {
+	struct message_buffer_6205 message_buffer;
+	struct response_buffer_6205 response_buffer;
+	u8 b_data[HPI6205_SIZEOF_DATA];
+};
+
 struct bus_master_interface {
 	u32 host_cmd;
 	u32 dsp_ack;
 	u32 transfer_size_in_bytes;
-	union {
-		struct hpi_message_header message_buffer;
-		struct hpi_response_header response_buffer;
-		u8 b_data[HPI6205_SIZEOF_DATA];
-	} u;
+	union buffer_6205 u;
 	struct controlcache_6205 control_cache;
 	struct async_event_buffer_6205 async_buffer;
 	struct hpi_hostbuffer_status
sound/pci/asihpi/hpicmn.c +7 -6
index 801dcd8..fe2e1ae 100644
@@ -315,8 +315,7 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
 	short found = 1;
 	struct hpi_control_cache_info *pI;
 	struct hpi_control_cache_single *pC;
-	struct hpi_control_cache_pad *p_pad;
-
+	u16 response_size;
 	if (!find_control(phm->obj_index, p_cache, &pI)) {
 		HPI_DEBUG_LOG(VERBOSE,
 			"HPICMN find_control() failed for adap %d\n",
@@ -326,11 +325,15 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
 
 	phr->error = 0;
 
+	/* set the default response size */
+	response_size =
+		sizeof(struct hpi_response_header) +
+		sizeof(struct hpi_control_res);
+
 	/* pC is the default cached control strucure. May be cast to
 	   something else in the following switch statement.
 	 */
 	pC = (struct hpi_control_cache_single *)pI;
-	p_pad = (struct hpi_control_cache_pad *)pI;
 
 	switch (pI->control_type) {
 
@@ -529,9 +532,7 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
 		pI->control_index, pI->control_type, phm->u.c.attribute);
 
 	if (found)
-		phr->size =
-			sizeof(struct hpi_response_header) +
-			sizeof(struct hpi_control_res);
+		phr->size = response_size;
 
 	return found;
 }
Signature · 1 line
1.7.0.4
#4 lore raw

PATCH 2/15 Increase request and response buffer sizes

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Allow for up to 256 bytes of extra data on top of standard hpi request and response sizes.

---
 sound/pci/asihpi/hpi6205.c |   15 ++++++++-------
 sound/pci/asihpi/hpi6205.h |   25 +++++++++++++++++++------
 sound/pci/asihpi/hpicmn.c  |   13 +++++++------
 3 files changed, 34 insertions(+), 19 deletions(-)
sound/pci/asihpi/hpi6205.c +8 -7
index faff9e3..8831a6f 100644
@@ -2085,13 +2085,13 @@ static u16 message_response_sequence(struct hpi_adapter_obj *pao,
 	u16 err = 0;
 
 	message_count++;
-	if (phm->size > sizeof(interface->u)) {
+	if (phm->size > sizeof(interface->u.message_buffer)) {
 		phr->error = HPI_ERROR_MESSAGE_BUFFER_TOO_SMALL;
-		phr->specific_error = sizeof(interface->u);
+		phr->specific_error = sizeof(interface->u.message_buffer);
 		phr->size = sizeof(struct hpi_response_header);
 		HPI_DEBUG_LOG(ERROR,
 			"message len %d too big for buffer %zd \n", phm->size,
-			sizeof(interface->u));
+			sizeof(interface->u.message_buffer));
 		return 0;
 	}
 
@@ -2123,18 +2123,19 @@ static u16 message_response_sequence(struct hpi_adapter_obj *pao,
 
 	/* read the result */
 	if (time_out) {
-		if (interface->u.response_buffer.size <= phr->size)
+		if (interface->u.response_buffer.response.size <= phr->size)
 			memcpy(phr, &interface->u.response_buffer,
-				interface->u.response_buffer.size);
+				interface->u.response_buffer.response.size);
 		else {
 			HPI_DEBUG_LOG(ERROR,
 				"response len %d too big for buffer %d\n",
-				interface->u.response_buffer.size, phr->size);
+				interface->u.response_buffer.response.size,
+				phr->size);
 			memcpy(phr, &interface->u.response_buffer,
 				sizeof(struct hpi_response_header));
 			phr->error = HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL;
 			phr->specific_error =
-				interface->u.response_buffer.size;
+				interface->u.response_buffer.response.size;
 			phr->size = sizeof(struct hpi_response_header);
 		}
 	}
sound/pci/asihpi/hpi6205.h +19 -6
index df2f02c..ec0827b 100644
@@ -1,7 +1,7 @@
 /*****************************************************************************
 
     AudioScience HPI driver
-    Copyright (C) 1997-2010  AudioScience Inc. <[email protected]>
+    Copyright (C) 1997-2011  AudioScience Inc. <[email protected]>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of version 2 of the GNU General Public License as
@@ -70,15 +70,28 @@ The Host located memory buffer that the 6205 will bus master
 in and out of.
 ************************************************************/
 #define HPI6205_SIZEOF_DATA (16*1024)
+
+struct message_buffer_6205 {
+	struct hpi_message message;
+	char data[256];
+};
+
+struct response_buffer_6205 {
+	struct hpi_response response;
+	char data[256];
+};
+
+union buffer_6205 {
+	struct message_buffer_6205 message_buffer;
+	struct response_buffer_6205 response_buffer;
+	u8 b_data[HPI6205_SIZEOF_DATA];
+};
+
 struct bus_master_interface {
 	u32 host_cmd;
 	u32 dsp_ack;
 	u32 transfer_size_in_bytes;
-	union {
-		struct hpi_message_header message_buffer;
-		struct hpi_response_header response_buffer;
-		u8 b_data[HPI6205_SIZEOF_DATA];
-	} u;
+	union buffer_6205 u;
 	struct controlcache_6205 control_cache;
 	struct async_event_buffer_6205 async_buffer;
 	struct hpi_hostbuffer_status
sound/pci/asihpi/hpicmn.c +7 -6
index 801dcd8..fe2e1ae 100644
@@ -315,8 +315,7 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
 	short found = 1;
 	struct hpi_control_cache_info *pI;
 	struct hpi_control_cache_single *pC;
-	struct hpi_control_cache_pad *p_pad;
-
+	u16 response_size;
 	if (!find_control(phm->obj_index, p_cache, &pI)) {
 		HPI_DEBUG_LOG(VERBOSE,
 			"HPICMN find_control() failed for adap %d\n",
@@ -326,11 +325,15 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
 
 	phr->error = 0;
 
+	/* set the default response size */
+	response_size =
+		sizeof(struct hpi_response_header) +
+		sizeof(struct hpi_control_res);
+
 	/* pC is the default cached control strucure. May be cast to
 	   something else in the following switch statement.
 	 */
 	pC = (struct hpi_control_cache_single *)pI;
-	p_pad = (struct hpi_control_cache_pad *)pI;
 
 	switch (pI->control_type) {
 
@@ -529,9 +532,7 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
 		pI->control_index, pI->control_type, phm->u.c.attribute);
 
 	if (found)
-		phr->size =
-			sizeof(struct hpi_response_header) +
-			sizeof(struct hpi_control_res);
+		phr->size = response_size;
 
 	return found;
 }
Signature · 1 line
1.7.0.4
#5 lore raw

PATCH 3/15 ALSA: asihpi - Remove controlex structs and associated special data transfer code

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Some cobranet control data would not fit in an original HPI message. Now that HPI is able to transfer larger messages, this special handling is no longer required.

---
 sound/pci/asihpi/hpi6205.c      |   18 -----
 sound/pci/asihpi/hpi_internal.h |  132 ++++++++++----------------------------
 sound/pci/asihpi/hpifunc.c      |   86 ++++++++++++-------------
 3 files changed, 76 insertions(+), 160 deletions(-)
sound/pci/asihpi/hpi6205.c +0 -18
index 8831a6f..d011932 100644
@@ -402,7 +402,6 @@ void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm,
 			adapter_message(pao, phm, phr);
 			break;
 
-		case HPI_OBJ_CONTROLEX:
 		case HPI_OBJ_CONTROL:
 			control_message(pao, phm, phr);
 			break;
@@ -2204,23 +2203,6 @@ static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm,
 			phm->u.d.u.data.data_size, H620_HIF_GET_DATA);
 		break;
 
-	case HPI_CONTROL_SET_STATE:
-		if (phm->object == HPI_OBJ_CONTROLEX
-			&& phm->u.cx.attribute == HPI_COBRANET_SET_DATA)
-			err = hpi6205_transfer_data(pao,
-				phm->u.cx.u.cobranet_bigdata.pb_data,
-				phm->u.cx.u.cobranet_bigdata.byte_count,
-				H620_HIF_SEND_DATA);
-		break;
-
-	case HPI_CONTROL_GET_STATE:
-		if (phm->object == HPI_OBJ_CONTROLEX
-			&& phm->u.cx.attribute == HPI_COBRANET_GET_DATA)
-			err = hpi6205_transfer_data(pao,
-				phm->u.cx.u.cobranet_bigdata.pb_data,
-				phr->u.cx.u.cobranet_data.byte_count,
-				H620_HIF_GET_DATA);
-		break;
 	}
 	phr->error = err;
 
sound/pci/asihpi/hpi_internal.h +35 -97

193 lines not on this page · raw message

sound/pci/asihpi/hpifunc.c +41 -45

132 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#6 lore raw

PATCH 3/15 Remove controlex structs and associated special data transfer code

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Some cobranet control data would not fit in an original HPI message. Now that HPI is able to transfer larger messages, this special handling is no longer required.

---
 sound/pci/asihpi/hpi6205.c      |   18 -----
 sound/pci/asihpi/hpi_internal.h |  132 ++++++++++----------------------------
 sound/pci/asihpi/hpifunc.c      |   86 ++++++++++++-------------
 3 files changed, 76 insertions(+), 160 deletions(-)
sound/pci/asihpi/hpi6205.c +0 -18
index 8831a6f..d011932 100644
@@ -402,7 +402,6 @@ void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm,
 			adapter_message(pao, phm, phr);
 			break;
 
-		case HPI_OBJ_CONTROLEX:
 		case HPI_OBJ_CONTROL:
 			control_message(pao, phm, phr);
 			break;
@@ -2204,23 +2203,6 @@ static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm,
 			phm->u.d.u.data.data_size, H620_HIF_GET_DATA);
 		break;
 
-	case HPI_CONTROL_SET_STATE:
-		if (phm->object == HPI_OBJ_CONTROLEX
-			&& phm->u.cx.attribute == HPI_COBRANET_SET_DATA)
-			err = hpi6205_transfer_data(pao,
-				phm->u.cx.u.cobranet_bigdata.pb_data,
-				phm->u.cx.u.cobranet_bigdata.byte_count,
-				H620_HIF_SEND_DATA);
-		break;
-
-	case HPI_CONTROL_GET_STATE:
-		if (phm->object == HPI_OBJ_CONTROLEX
-			&& phm->u.cx.attribute == HPI_COBRANET_GET_DATA)
-			err = hpi6205_transfer_data(pao,
-				phm->u.cx.u.cobranet_bigdata.pb_data,
-				phr->u.cx.u.cobranet_data.byte_count,
-				H620_HIF_GET_DATA);
-		break;
 	}
 	phr->error = err;
 
sound/pci/asihpi/hpi_internal.h +35 -97

193 lines not on this page · raw message

sound/pci/asihpi/hpifunc.c +41 -45

132 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#7 lore raw

PATCH 4/15 ALSA: asihpi - DSP code loader API now independent of OS

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

The loader API has been revised so that OS specific data is kept local to hpidspcd.c, and the public API is unchanged across OSes.

---
 sound/pci/asihpi/hpi6000.c  |    7 +--
 sound/pci/asihpi/hpi6205.c  |    5 +-
 sound/pci/asihpi/hpidspcd.c |  136 +++++++++++++++++-------------------------
 sound/pci/asihpi/hpidspcd.h |   72 ++++++++++++----------
 4 files changed, 98 insertions(+), 122 deletions(-)
sound/pci/asihpi/hpi6000.c +2 -5
index c8db36e..3cc6f11 100644
@@ -946,11 +946,8 @@ static short hpi6000_adapter_boot_load_dsp(struct hpi_adapter_obj *pao,
 		}
 
 		/* write the DSP code down into the DSPs memory */
-		/*HpiDspCode_Open(nBootLoadFamily,&DspCode,pdwOsErrorCode); */
-		dsp_code.ps_dev = pao->pci.pci_dev;
-
-		error = hpi_dsp_code_open(boot_load_family, &dsp_code,
-			pos_error_code);
+		error = hpi_dsp_code_open(boot_load_family, pao->pci.pci_dev,
+			&dsp_code, pos_error_code);
 
 		if (error)
 			return error;
sound/pci/asihpi/hpi6205.c +2 -3
index d011932..3e31a3f 100644
@@ -1371,9 +1371,8 @@ static u16 adapter_boot_load_dsp(struct hpi_adapter_obj *pao,
 			return err;
 
 		/* write the DSP code down into the DSPs memory */
-		dsp_code.ps_dev = pao->pci.pci_dev;
-		err = hpi_dsp_code_open(boot_code_id[dsp], &dsp_code,
-			pos_error_code);
+		err = hpi_dsp_code_open(boot_code_id[dsp], pao->pci.pci_dev,
+			&dsp_code, pos_error_code);
 		if (err)
 			return err;
 
sound/pci/asihpi/hpidspcd.c +55 -81

220 lines not on this page · raw message

sound/pci/asihpi/hpidspcd.h +39 -33

102 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#9 lore raw

PATCH 4/15 DSP code loader API now independent of OS

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

The loader API has been revised so that OS specific data is kept local to hpidspcd.c, and the public API is unchanged across OSes.

---
 sound/pci/asihpi/hpi6000.c  |    7 +--
 sound/pci/asihpi/hpi6205.c  |    5 +-
 sound/pci/asihpi/hpidspcd.c |  136 +++++++++++++++++-------------------------
 sound/pci/asihpi/hpidspcd.h |   72 ++++++++++++----------
 4 files changed, 98 insertions(+), 122 deletions(-)
sound/pci/asihpi/hpi6000.c +2 -5
index c8db36e..3cc6f11 100644
@@ -946,11 +946,8 @@ static short hpi6000_adapter_boot_load_dsp(struct hpi_adapter_obj *pao,
 		}
 
 		/* write the DSP code down into the DSPs memory */
-		/*HpiDspCode_Open(nBootLoadFamily,&DspCode,pdwOsErrorCode); */
-		dsp_code.ps_dev = pao->pci.pci_dev;
-
-		error = hpi_dsp_code_open(boot_load_family, &dsp_code,
-			pos_error_code);
+		error = hpi_dsp_code_open(boot_load_family, pao->pci.pci_dev,
+			&dsp_code, pos_error_code);
 
 		if (error)
 			return error;
sound/pci/asihpi/hpi6205.c +2 -3
index d011932..3e31a3f 100644
@@ -1371,9 +1371,8 @@ static u16 adapter_boot_load_dsp(struct hpi_adapter_obj *pao,
 			return err;
 
 		/* write the DSP code down into the DSPs memory */
-		dsp_code.ps_dev = pao->pci.pci_dev;
-		err = hpi_dsp_code_open(boot_code_id[dsp], &dsp_code,
-			pos_error_code);
+		err = hpi_dsp_code_open(boot_code_id[dsp], pao->pci.pci_dev,
+			&dsp_code, pos_error_code);
 		if (err)
 			return err;
 
sound/pci/asihpi/hpidspcd.c +55 -81

220 lines not on this page · raw message

sound/pci/asihpi/hpidspcd.h +39 -33

102 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#10 lore raw

PATCH 5/15 ALSA: asihpi - Revise snd_pcm_debug_name, get rid of DEBUG_NAME macro

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Work towards moving the function into alsa common header.

---
 sound/pci/asihpi/asihpi.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)
sound/pci/asihpi/asihpi.c +15 -9
index 023a62a..60444e7 100644
@@ -49,19 +49,21 @@ MODULE_DESCRIPTION("AudioScience ALSA ASI5000 ASI6000 ASI87xx ASI89xx");
 #if defined CONFIG_SND_DEBUG
 /* copied from pcm_lib.c, hope later patch will make that version public
 and this copy can be removed */
-static void pcm_debug_name(struct snd_pcm_substream *substream,
-			   char *name, size_t len)
+static inline void
+snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size)
 {
-	snprintf(name, len, "pcmC%dD%d%c:%d",
+	snprintf(buf, size, "pcmC%dD%d%c:%d",
 		 substream->pcm->card->number,
 		 substream->pcm->device,
 		 substream->stream ? 'c' : 'p',
 		 substream->number);
 }
-#define DEBUG_NAME(substream, name) char name[16]; pcm_debug_name(substream, name, sizeof(name))
 #else
-#define pcm_debug_name(s, n, l) do { } while (0)
-#define DEBUG_NAME(name, substream) do { } while (0)
+static inline void
+snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size)
+{
+	*buf = 0;
+}
 #endif
 
 #if defined CONFIG_SND_DEBUG_VERBOSE
@@ -304,7 +306,8 @@ static u16 handle_error(u16 err, int line, char *filename)
 static void print_hwparams(struct snd_pcm_substream *substream,
 				struct snd_pcm_hw_params *p)
 {
-	DEBUG_NAME(substream, name);
+	char name[16];
+	snd_pcm_debug_name(substream, name, sizeof(name));
 	snd_printd("%s HWPARAMS\n", name);
 	snd_printd(" samplerate %d Hz\n", params_rate(p));
 	snd_printd(" channels %d\n", params_channels(p));
@@ -576,8 +579,9 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream,
 	struct snd_card_asihpi *card = snd_pcm_substream_chip(substream);
 	struct snd_pcm_substream *s;
 	u16 e;
-	DEBUG_NAME(substream, name);
+	char name[16];
 
+	snd_pcm_debug_name(substream, name, sizeof(name));
 	snd_printdd("%s trigger\n", name);
 
 	switch (cmd) {
@@ -741,7 +745,9 @@ static void snd_card_asihpi_timer_function(unsigned long data)
 	int loops = 0;
 	u16 state;
 	u32 buffer_size, bytes_avail, samples_played, on_card_bytes;
-	DEBUG_NAME(substream, name);
+	char name[16];
+
+	snd_pcm_debug_name(substream, name, sizeof(name));
 
 	snd_printdd("%s snd_card_asihpi_timer_function\n", name);
 
Signature · 1 line
1.7.0.4
#11 lore raw

PATCH 5/15 Revise snd_pcm_debug_name, get rid of DEBUG_NAME macro

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Work towards moving the function into alsa common header.

---
 sound/pci/asihpi/asihpi.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)
sound/pci/asihpi/asihpi.c +15 -9
index 023a62a..60444e7 100644
@@ -49,19 +49,21 @@ MODULE_DESCRIPTION("AudioScience ALSA ASI5000 ASI6000 ASI87xx ASI89xx");
 #if defined CONFIG_SND_DEBUG
 /* copied from pcm_lib.c, hope later patch will make that version public
 and this copy can be removed */
-static void pcm_debug_name(struct snd_pcm_substream *substream,
-			   char *name, size_t len)
+static inline void
+snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size)
 {
-	snprintf(name, len, "pcmC%dD%d%c:%d",
+	snprintf(buf, size, "pcmC%dD%d%c:%d",
 		 substream->pcm->card->number,
 		 substream->pcm->device,
 		 substream->stream ? 'c' : 'p',
 		 substream->number);
 }
-#define DEBUG_NAME(substream, name) char name[16]; pcm_debug_name(substream, name, sizeof(name))
 #else
-#define pcm_debug_name(s, n, l) do { } while (0)
-#define DEBUG_NAME(name, substream) do { } while (0)
+static inline void
+snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size)
+{
+	*buf = 0;
+}
 #endif
 
 #if defined CONFIG_SND_DEBUG_VERBOSE
@@ -304,7 +306,8 @@ static u16 handle_error(u16 err, int line, char *filename)
 static void print_hwparams(struct snd_pcm_substream *substream,
 				struct snd_pcm_hw_params *p)
 {
-	DEBUG_NAME(substream, name);
+	char name[16];
+	snd_pcm_debug_name(substream, name, sizeof(name));
 	snd_printd("%s HWPARAMS\n", name);
 	snd_printd(" samplerate %d Hz\n", params_rate(p));
 	snd_printd(" channels %d\n", params_channels(p));
@@ -576,8 +579,9 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream,
 	struct snd_card_asihpi *card = snd_pcm_substream_chip(substream);
 	struct snd_pcm_substream *s;
 	u16 e;
-	DEBUG_NAME(substream, name);
+	char name[16];
 
+	snd_pcm_debug_name(substream, name, sizeof(name));
 	snd_printdd("%s trigger\n", name);
 
 	switch (cmd) {
@@ -741,7 +745,9 @@ static void snd_card_asihpi_timer_function(unsigned long data)
 	int loops = 0;
 	u16 state;
 	u32 buffer_size, bytes_avail, samples_played, on_card_bytes;
-	DEBUG_NAME(substream, name);
+	char name[16];
+
+	snd_pcm_debug_name(substream, name, sizeof(name));
 
 	snd_printdd("%s snd_card_asihpi_timer_function\n", name);
 
Signature · 1 line
1.7.0.4
#12 lore raw

PATCH 6/15 ALSA: asihpi - Remove spurious adapter index check

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Subsystem requests don't have or need a valid adapter index. The adapter index is already checked further on, before it is used to index the adapters array. (Reverts 4a122c10f)

---
 sound/pci/asihpi/hpioctl.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
sound/pci/asihpi/hpioctl.c +3 -7
index d8e7047..65fcf47 100644
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
     AudioScience HPI driver
-    Copyright (C) 1997-2010  AudioScience Inc. <[email protected]>
+    Copyright (C) 1997-2011  AudioScience Inc. <[email protected]>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of version 2 of the GNU General Public License as
@@ -157,11 +157,6 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		goto out;
 	}
 
-	if (hm->h.adapter_index >= HPI_MAX_ADAPTERS) {
-		err = -EINVAL;
-		goto out;
-	}
-
 	switch (hm->h.function) {
 	case HPI_SUBSYS_CREATE_ADAPTER:
 	case HPI_ADAPTER_DELETE:
@@ -187,7 +182,6 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		/* -1=no data 0=read from user mem, 1=write to user mem */
 		int wrflag = -1;
 		u32 adapter = hm->h.adapter_index;
-		pa = &adapters[adapter];
 
 		if ((adapter > HPI_MAX_ADAPTERS) || (!pa->type)) {
 			hpi_init_response(&hr->r0, HPI_OBJ_ADAPTER,
@@ -203,6 +197,8 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 			goto out;
 		}
 
+		pa = &adapters[adapter];
+
 		if (mutex_lock_interruptible(&adapters[adapter].mutex)) {
 			err = -EINTR;
 			goto out;
Signature · 1 line
1.7.0.4
#13 lore raw

PATCH 6/15 Remove spurious adapter index check

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Subsystem requests don't have or need a valid adapter index.

---
 sound/pci/asihpi/hpioctl.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
sound/pci/asihpi/hpioctl.c +1 -6
index d8e7047..53e3506 100644
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
     AudioScience HPI driver
-    Copyright (C) 1997-2010  AudioScience Inc. <[email protected]>
+    Copyright (C) 1997-2011  AudioScience Inc. <[email protected]>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of version 2 of the GNU General Public License as
@@ -157,11 +157,6 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		goto out;
 	}
 
-	if (hm->h.adapter_index >= HPI_MAX_ADAPTERS) {
-		err = -EINVAL;
-		goto out;
-	}
-
 	switch (hm->h.function) {
 	case HPI_SUBSYS_CREATE_ADAPTER:
 	case HPI_ADAPTER_DELETE:
Signature · 1 line
1.7.0.4
#14 lore raw

PATCH 7/15 ALSA: asihpi - Remove unused structures, macros and functions

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

---
 sound/pci/asihpi/hpi6205.c      |    6 ------
 sound/pci/asihpi/hpi_internal.h |   13 -------------
 sound/pci/asihpi/hpidspcd.c     |    1 -
 sound/pci/asihpi/hpimsgx.c      |    2 --
 sound/pci/asihpi/hpios.c        |    8 --------
 5 files changed, 0 insertions(+), 30 deletions(-)
sound/pci/asihpi/hpi6205.c +0 -6
index 3e31a3f..3c75df8 100644
@@ -658,9 +658,6 @@ static u16 create_adapter_obj(struct hpi_adapter_obj *pao,
 			hr.u.ax.info.num_outstreams +
 			hr.u.ax.info.num_instreams;
 
-		hpios_locked_mem_prepare((max_streams * 6) / 10, max_streams,
-			65536, pao->pci.pci_dev);
-
 		HPI_DEBUG_LOG(VERBOSE,
 			"got adapter info type %x index %d serial %d\n",
 			hr.u.ax.info.adapter_type, hr.u.ax.info.adapter_index,
@@ -709,9 +706,6 @@ static void delete_adapter_obj(struct hpi_adapter_obj *pao)
 				[i]);
 			phw->outstream_host_buffer_size[i] = 0;
 		}
-
-	hpios_locked_mem_unprepare(pao->pci.pci_dev);
-
 	kfree(phw);
 }
 
sound/pci/asihpi/hpi_internal.h +0 -13
index 848fb75..332fb59 100644
@@ -32,12 +32,6 @@ HPI internal definitions
 #include "hpios.h"
 
 /* physical memory allocation */
-void hpios_locked_mem_init(void
-	);
-void hpios_locked_mem_free_all(void
-	);
-#define hpios_locked_mem_prepare(a, b, c, d);
-#define hpios_locked_mem_unprepare(a)
 
 /** Allocate and map an area of locked memory for bus master DMA operations.
 
@@ -1431,12 +1425,6 @@ struct hpi_control_cache_microphone {
 	char temp_padding[6];
 };
 
-struct hpi_control_cache_generic {
-	struct hpi_control_cache_info i;
-	u32 dw1;
-	u32 dw2;
-};
-
 struct hpi_control_cache_single {
 	union {
 		struct hpi_control_cache_info i;
@@ -1452,7 +1440,6 @@ struct hpi_control_cache_single {
 		struct hpi_control_cache_silencedetector silence;
 		struct hpi_control_cache_sampleclock clk;
 		struct hpi_control_cache_microphone microphone;
-		struct hpi_control_cache_generic generic;
 	} u;
 };
 
sound/pci/asihpi/hpidspcd.c +0 -1
index a03eb86..c5c6531 100644
@@ -36,7 +36,6 @@ struct dsp_code_private {
 #define HPI_VER_DECIMAL ((int)(HPI_VER_MAJOR(HPI_VER) * 10000 + \
 	    HPI_VER_MINOR(HPI_VER) * 100 + HPI_VER_RELEASE(HPI_VER)))
 
-#include <linux/pci.h>
 /*-------------------------------------------------------------------*/
 short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code,
 	u32 *os_error_code)
sound/pci/asihpi/hpimsgx.c +0 -2
index 111f774..83b7e73 100644
@@ -186,7 +186,6 @@ static void subsys_message(struct hpi_message *phm, struct hpi_response *phr,
 		/* Initialize this module's internal state */
 		hpios_msgxlock_init(&msgx_lock);
 		memset(&hpi_entry_points, 0, sizeof(hpi_entry_points));
-		hpios_locked_mem_init();
 		/* Init subsys_findadapters response to no-adapters */
 		HPIMSGX__reset(HPIMSGX_ALLADAPTERS);
 		hpi_init_response(phr, HPI_OBJ_SUBSYSTEM,
@@ -197,7 +196,6 @@ static void subsys_message(struct hpi_message *phm, struct hpi_response *phr,
 	case HPI_SUBSYS_DRIVER_UNLOAD:
 		HPI_COMMON(phm, phr);
 		HPIMSGX__cleanup(HPIMSGX_ALLADAPTERS, h_owner);
-		hpios_locked_mem_free_all();
 		hpi_init_response(phr, HPI_OBJ_SUBSYSTEM,
 			HPI_SUBSYS_DRIVER_UNLOAD, 0);
 		return;
sound/pci/asihpi/hpios.c +0 -8
index 742ee12..ff2a19b 100644
@@ -39,10 +39,6 @@ void hpios_delay_micro_seconds(u32 num_micro_sec)
 
 }
 
-void hpios_locked_mem_init(void)
-{
-}
-
 /** Allocated an area of locked memory for bus master DMA operations.
 
 On error, return -ENOMEM, and *pMemArea.size = 0
@@ -85,7 +81,3 @@ u16 hpios_locked_mem_free(struct consistent_dma_area *p_mem_area)
 		return 1;
 	}
 }
-
-void hpios_locked_mem_free_all(void)
-{
-}
Signature · 1 line
1.7.0.4
#15 lore raw

PATCH 7/15 Remove unused structures, macros and functions

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

---
 sound/pci/asihpi/hpi6205.c      |    6 ------
 sound/pci/asihpi/hpi_internal.h |   13 -------------
 sound/pci/asihpi/hpidspcd.c     |    1 -
 sound/pci/asihpi/hpimsgx.c      |    2 --
 sound/pci/asihpi/hpios.c        |    8 --------
 5 files changed, 0 insertions(+), 30 deletions(-)
sound/pci/asihpi/hpi6205.c +0 -6
index 3e31a3f..3c75df8 100644
@@ -658,9 +658,6 @@ static u16 create_adapter_obj(struct hpi_adapter_obj *pao,
 			hr.u.ax.info.num_outstreams +
 			hr.u.ax.info.num_instreams;
 
-		hpios_locked_mem_prepare((max_streams * 6) / 10, max_streams,
-			65536, pao->pci.pci_dev);
-
 		HPI_DEBUG_LOG(VERBOSE,
 			"got adapter info type %x index %d serial %d\n",
 			hr.u.ax.info.adapter_type, hr.u.ax.info.adapter_index,
@@ -709,9 +706,6 @@ static void delete_adapter_obj(struct hpi_adapter_obj *pao)
 				[i]);
 			phw->outstream_host_buffer_size[i] = 0;
 		}
-
-	hpios_locked_mem_unprepare(pao->pci.pci_dev);
-
 	kfree(phw);
 }
 
sound/pci/asihpi/hpi_internal.h +0 -13
index 848fb75..332fb59 100644
@@ -32,12 +32,6 @@ HPI internal definitions
 #include "hpios.h"
 
 /* physical memory allocation */
-void hpios_locked_mem_init(void
-	);
-void hpios_locked_mem_free_all(void
-	);
-#define hpios_locked_mem_prepare(a, b, c, d);
-#define hpios_locked_mem_unprepare(a)
 
 /** Allocate and map an area of locked memory for bus master DMA operations.
 
@@ -1431,12 +1425,6 @@ struct hpi_control_cache_microphone {
 	char temp_padding[6];
 };
 
-struct hpi_control_cache_generic {
-	struct hpi_control_cache_info i;
-	u32 dw1;
-	u32 dw2;
-};
-
 struct hpi_control_cache_single {
 	union {
 		struct hpi_control_cache_info i;
@@ -1452,7 +1440,6 @@ struct hpi_control_cache_single {
 		struct hpi_control_cache_silencedetector silence;
 		struct hpi_control_cache_sampleclock clk;
 		struct hpi_control_cache_microphone microphone;
-		struct hpi_control_cache_generic generic;
 	} u;
 };
 
sound/pci/asihpi/hpidspcd.c +0 -1
index a03eb86..c5c6531 100644
@@ -36,7 +36,6 @@ struct dsp_code_private {
 #define HPI_VER_DECIMAL ((int)(HPI_VER_MAJOR(HPI_VER) * 10000 + \
 	    HPI_VER_MINOR(HPI_VER) * 100 + HPI_VER_RELEASE(HPI_VER)))
 
-#include <linux/pci.h>
 /*-------------------------------------------------------------------*/
 short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code,
 	u32 *os_error_code)
sound/pci/asihpi/hpimsgx.c +0 -2
index 111f774..83b7e73 100644
@@ -186,7 +186,6 @@ static void subsys_message(struct hpi_message *phm, struct hpi_response *phr,
 		/* Initialize this module's internal state */
 		hpios_msgxlock_init(&msgx_lock);
 		memset(&hpi_entry_points, 0, sizeof(hpi_entry_points));
-		hpios_locked_mem_init();
 		/* Init subsys_findadapters response to no-adapters */
 		HPIMSGX__reset(HPIMSGX_ALLADAPTERS);
 		hpi_init_response(phr, HPI_OBJ_SUBSYSTEM,
@@ -197,7 +196,6 @@ static void subsys_message(struct hpi_message *phm, struct hpi_response *phr,
 	case HPI_SUBSYS_DRIVER_UNLOAD:
 		HPI_COMMON(phm, phr);
 		HPIMSGX__cleanup(HPIMSGX_ALLADAPTERS, h_owner);
-		hpios_locked_mem_free_all();
 		hpi_init_response(phr, HPI_OBJ_SUBSYSTEM,
 			HPI_SUBSYS_DRIVER_UNLOAD, 0);
 		return;
sound/pci/asihpi/hpios.c +0 -8
index 742ee12..ff2a19b 100644
@@ -39,10 +39,6 @@ void hpios_delay_micro_seconds(u32 num_micro_sec)
 
 }
 
-void hpios_locked_mem_init(void)
-{
-}
-
 /** Allocated an area of locked memory for bus master DMA operations.
 
 On error, return -ENOMEM, and *pMemArea.size = 0
@@ -85,7 +81,3 @@ u16 hpios_locked_mem_free(struct consistent_dma_area *p_mem_area)
 		return 1;
 	}
 }
-
-void hpios_locked_mem_free_all(void)
-{
-}
Signature · 1 line
1.7.0.4
#16 lore raw

PATCH 8/15 ALSA: asihpi - Fix minor typos and spelling

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

---
 sound/pci/asihpi/hpi_internal.h |    2 +-
 sound/pci/asihpi/hpicmn.c       |    2 +-
 sound/pci/asihpi/hpimsgx.c      |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
sound/pci/asihpi/hpi_internal.h +1 -1
index 332fb59..93d2908 100644
@@ -602,7 +602,7 @@ struct hpi_data_compat32 {
 #endif
 
 struct hpi_buffer {
-  /** placehoder for backward compatibility (see dwBufferSize) */
+  /** placeholder for backward compatibility (see dwBufferSize) */
 	struct hpi_msg_format reserved;
 	u32 command; /**< HPI_BUFFER_CMD_xxx*/
 	u32 pci_address; /**< PCI physical address of buffer for DSP DMA */
sound/pci/asihpi/hpicmn.c +1 -1
index fe2e1ae..808f184 100644
@@ -57,7 +57,7 @@ u16 hpi_validate_response(struct hpi_message *phm, struct hpi_response *phr)
 	}
 
 	if (phr->function != phm->function) {
-		HPI_DEBUG_LOG(ERROR, "header type %d invalid\n",
+		HPI_DEBUG_LOG(ERROR, "header function %d invalid\n",
 			phr->function);
 		return HPI_ERROR_INVALID_RESPONSE;
 	}
sound/pci/asihpi/hpimsgx.c +1 -1
index 83b7e73..2e77942 100644
@@ -16,7 +16,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-Extended Message Function With Response Cacheing
+Extended Message Function With Response Caching
 
 (C) Copyright AudioScience Inc. 2002
 *****************************************************************************/
Signature · 1 line
1.7.0.4
#17 lore raw

PATCH 8/15 Fix minor typos and spelling

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

---
 sound/pci/asihpi/hpi_internal.h |    2 +-
 sound/pci/asihpi/hpicmn.c       |    2 +-
 sound/pci/asihpi/hpimsgx.c      |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
sound/pci/asihpi/hpi_internal.h +1 -1
index 332fb59..93d2908 100644
@@ -602,7 +602,7 @@ struct hpi_data_compat32 {
 #endif
 
 struct hpi_buffer {
-  /** placehoder for backward compatibility (see dwBufferSize) */
+  /** placeholder for backward compatibility (see dwBufferSize) */
 	struct hpi_msg_format reserved;
 	u32 command; /**< HPI_BUFFER_CMD_xxx*/
 	u32 pci_address; /**< PCI physical address of buffer for DSP DMA */
sound/pci/asihpi/hpicmn.c +1 -1
index fe2e1ae..808f184 100644
@@ -57,7 +57,7 @@ u16 hpi_validate_response(struct hpi_message *phm, struct hpi_response *phr)
 	}
 
 	if (phr->function != phm->function) {
-		HPI_DEBUG_LOG(ERROR, "header type %d invalid\n",
+		HPI_DEBUG_LOG(ERROR, "header function %d invalid\n",
 			phr->function);
 		return HPI_ERROR_INVALID_RESPONSE;
 	}
sound/pci/asihpi/hpimsgx.c +1 -1
index 83b7e73..2e77942 100644
@@ -16,7 +16,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-Extended Message Function With Response Cacheing
+Extended Message Function With Response Caching
 
 (C) Copyright AudioScience Inc. 2002
 *****************************************************************************/
Signature · 1 line
1.7.0.4
#18 lore raw

PATCH 9/15 ALSA: asihpi - Make local function static

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Fixes a sparse warning.

---
 sound/pci/asihpi/hpi6205.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
sound/pci/asihpi/hpi6205.c +1 -0
index 3c75df8..e041a6a 100644
@@ -373,6 +373,7 @@ static void instream_message(struct hpi_adapter_obj *pao,
 /** Entry point to this HPI backend
  * All calls to the HPI start here
  */
+static
 void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm,
 	struct hpi_response *phr)
 {
Signature · 1 line
1.7.0.4
#19 lore raw

PATCH 9/15 Make local function static

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Fixes a sparse warning.

---
 sound/pci/asihpi/hpi6205.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
sound/pci/asihpi/hpi6205.c +1 -0
index 3c75df8..e041a6a 100644
@@ -373,6 +373,7 @@ static void instream_message(struct hpi_adapter_obj *pao,
 /** Entry point to this HPI backend
  * All calls to the HPI start here
  */
+static
 void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm,
 	struct hpi_response *phr)
 {
Signature · 1 line
1.7.0.4
#20 lore raw

PATCH 10/15 Add new node and message defines

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

---
 sound/pci/asihpi/hpi.h          |   15 +++++++++++----
 sound/pci/asihpi/hpi_internal.h |    6 ++++--
 2 files changed, 15 insertions(+), 6 deletions(-)
sound/pci/asihpi/hpi.h +11 -4
index 255429c..9538f12 100644
@@ -211,8 +211,12 @@ enum HPI_SOURCENODES {
 	HPI_SOURCENODE_COBRANET = 109,
 	HPI_SOURCENODE_ANALOG = 110,	     /**< analog input node. */
 	HPI_SOURCENODE_ADAPTER = 111,	     /**< adapter node. */
+	/** RTP stream input node - This node is a destination for
+	    packets of RTP audio samples from other devices. */
+	HPI_SOURCENODE_RTP_DESTINATION = 112,
+	HPI_SOURCENODE_GP_IN = 113,	     /**< general purpose input. */
 	/* !!!Update this  AND hpidebug.h if you add a new sourcenode type!!! */
-	HPI_SOURCENODE_LAST_INDEX = 111	     /**< largest ID */
+	HPI_SOURCENODE_LAST_INDEX = 113	     /**< largest ID */
 		/* AX6 max sourcenode types = 15 */
 };
 
@@ -228,7 +232,7 @@ enum HPI_DESTNODES {
 	HPI_DESTNODE_NONE = 200,
 	/** In Stream (Record) node. */
 	HPI_DESTNODE_ISTREAM = 201,
-	HPI_DESTNODE_LINEOUT = 202,	    /**< line out node. */
+	HPI_DESTNODE_LINEOUT = 202,	     /**< line out node. */
 	HPI_DESTNODE_AESEBU_OUT = 203,	     /**< AES/EBU output node. */
 	HPI_DESTNODE_RF = 204,		     /**< RF output node. */
 	HPI_DESTNODE_SPEAKER = 205,	     /**< speaker output node. */
@@ -236,9 +240,12 @@ enum HPI_DESTNODES {
 	    Audio samples from the device are sent out on the Cobranet network.*/
 	HPI_DESTNODE_COBRANET = 206,
 	HPI_DESTNODE_ANALOG = 207,	     /**< analog output node. */
-
+	/** RTP stream output node - This node is a source for
+	    packets of RTP audio samples that are sent to other devices. */
+	HPI_DESTNODE_RTP_SOURCE = 208,
+	HPI_DESTNODE_GP_OUT = 209,	     /**< general purpose output node. */
 	/* !!!Update this AND hpidebug.h if you add a new destnode type!!! */
-	HPI_DESTNODE_LAST_INDEX = 207	     /**< largest ID */
+	HPI_DESTNODE_LAST_INDEX = 209	     /**< largest ID */
 		/* AX6 max destnode types = 15 */
 };
 
sound/pci/asihpi/hpi_internal.h +4 -2
index 93d2908..d497030 100644
@@ -1,7 +1,7 @@
 /******************************************************************************
 
     AudioScience HPI driver
-    Copyright (C) 1997-2010  AudioScience Inc. <[email protected]>
+    Copyright (C) 1997-2011  AudioScience Inc. <[email protected]>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of version 2 of the GNU General Public License as
@@ -361,7 +361,9 @@ enum HPI_MESSAGE_TYPES {
 	HPI_TYPE_REQUEST = 1,
 	HPI_TYPE_RESPONSE = 2,
 	HPI_TYPE_DATA = 3,
-	HPI_TYPE_SSX2BYPASS_MESSAGE = 4
+	HPI_TYPE_SSX2BYPASS_MESSAGE = 4,
+	HPI_TYPE_COMMAND = 5,
+	HPI_TYPE_NOTIFICATION = 6
 };
 
 enum HPI_OBJECT_TYPES {
Signature · 1 line
1.7.0.4
#21 lore raw

PATCH 10/15 ALSA: asihpi - Add new node and message defines

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

---
 sound/pci/asihpi/hpi.h          |   15 +++++++++++----
 sound/pci/asihpi/hpi_internal.h |    6 ++++--
 2 files changed, 15 insertions(+), 6 deletions(-)
sound/pci/asihpi/hpi.h +11 -4
index 255429c..9538f12 100644
@@ -211,8 +211,12 @@ enum HPI_SOURCENODES {
 	HPI_SOURCENODE_COBRANET = 109,
 	HPI_SOURCENODE_ANALOG = 110,	     /**< analog input node. */
 	HPI_SOURCENODE_ADAPTER = 111,	     /**< adapter node. */
+	/** RTP stream input node - This node is a destination for
+	    packets of RTP audio samples from other devices. */
+	HPI_SOURCENODE_RTP_DESTINATION = 112,
+	HPI_SOURCENODE_GP_IN = 113,	     /**< general purpose input. */
 	/* !!!Update this  AND hpidebug.h if you add a new sourcenode type!!! */
-	HPI_SOURCENODE_LAST_INDEX = 111	     /**< largest ID */
+	HPI_SOURCENODE_LAST_INDEX = 113	     /**< largest ID */
 		/* AX6 max sourcenode types = 15 */
 };
 
@@ -228,7 +232,7 @@ enum HPI_DESTNODES {
 	HPI_DESTNODE_NONE = 200,
 	/** In Stream (Record) node. */
 	HPI_DESTNODE_ISTREAM = 201,
-	HPI_DESTNODE_LINEOUT = 202,	    /**< line out node. */
+	HPI_DESTNODE_LINEOUT = 202,	     /**< line out node. */
 	HPI_DESTNODE_AESEBU_OUT = 203,	     /**< AES/EBU output node. */
 	HPI_DESTNODE_RF = 204,		     /**< RF output node. */
 	HPI_DESTNODE_SPEAKER = 205,	     /**< speaker output node. */
@@ -236,9 +240,12 @@ enum HPI_DESTNODES {
 	    Audio samples from the device are sent out on the Cobranet network.*/
 	HPI_DESTNODE_COBRANET = 206,
 	HPI_DESTNODE_ANALOG = 207,	     /**< analog output node. */
-
+	/** RTP stream output node - This node is a source for
+	    packets of RTP audio samples that are sent to other devices. */
+	HPI_DESTNODE_RTP_SOURCE = 208,
+	HPI_DESTNODE_GP_OUT = 209,	     /**< general purpose output node. */
 	/* !!!Update this AND hpidebug.h if you add a new destnode type!!! */
-	HPI_DESTNODE_LAST_INDEX = 207	     /**< largest ID */
+	HPI_DESTNODE_LAST_INDEX = 209	     /**< largest ID */
 		/* AX6 max destnode types = 15 */
 };
 
sound/pci/asihpi/hpi_internal.h +4 -2
index 93d2908..d497030 100644
@@ -1,7 +1,7 @@
 /******************************************************************************
 
     AudioScience HPI driver
-    Copyright (C) 1997-2010  AudioScience Inc. <[email protected]>
+    Copyright (C) 1997-2011  AudioScience Inc. <[email protected]>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of version 2 of the GNU General Public License as
@@ -361,7 +361,9 @@ enum HPI_MESSAGE_TYPES {
 	HPI_TYPE_REQUEST = 1,
 	HPI_TYPE_RESPONSE = 2,
 	HPI_TYPE_DATA = 3,
-	HPI_TYPE_SSX2BYPASS_MESSAGE = 4
+	HPI_TYPE_SSX2BYPASS_MESSAGE = 4,
+	HPI_TYPE_COMMAND = 5,
+	HPI_TYPE_NOTIFICATION = 6
 };
 
 enum HPI_OBJECT_TYPES {
Signature · 1 line
1.7.0.4
#22 lore raw

PATCH 11/15 ALSA: asihpi - Explicitly include mutex.h

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Because mutex is used in adapter struct defined here.

---
 sound/pci/asihpi/hpios.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
sound/pci/asihpi/hpios.h +1 -0
index 03273e7..2f605e3 100644
@@ -38,6 +38,7 @@ HPI Operating System Specific macros for Linux Kernel driver
 #include <linux/firmware.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
+#include <linux/mutex.h>
 
 #define HPI_NO_OS_FILE_OPS
 
Signature · 1 line
1.7.0.4
#23 lore raw

PATCH 11/15 Explicitly include mutex.h

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Because mutex is used in adapter struct defined here.

---
 sound/pci/asihpi/hpios.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
sound/pci/asihpi/hpios.h +1 -0
index 03273e7..2f605e3 100644
@@ -38,6 +38,7 @@ HPI Operating System Specific macros for Linux Kernel driver
 #include <linux/firmware.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
+#include <linux/mutex.h>
 
 #define HPI_NO_OS_FILE_OPS
 
Signature · 1 line
1.7.0.4
#24 lore raw

PATCH 12/15 ALSA: asihpi - Use size_t for sizeof result

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

---
 sound/pci/asihpi/hpicmn.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/pci/asihpi/hpicmn.c +2 -2
index 808f184..65b7ca1 100644
@@ -315,7 +315,7 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
 	short found = 1;
 	struct hpi_control_cache_info *pI;
 	struct hpi_control_cache_single *pC;
-	u16 response_size;
+	size_t response_size;
 	if (!find_control(phm->obj_index, p_cache, &pI)) {
 		HPI_DEBUG_LOG(VERBOSE,
 			"HPICMN find_control() failed for adap %d\n",
@@ -532,7 +532,7 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
 		pI->control_index, pI->control_type, phm->u.c.attribute);
 
 	if (found)
-		phr->size = response_size;
+		phr->size = (u16)response_size;
 
 	return found;
 }
Signature · 1 line
1.7.0.4
#25 lore raw

PATCH 12/15 Use size_t for sizeof result

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

---
 sound/pci/asihpi/hpicmn.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/pci/asihpi/hpicmn.c +2 -2
index 808f184..65b7ca1 100644
@@ -315,7 +315,7 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
 	short found = 1;
 	struct hpi_control_cache_info *pI;
 	struct hpi_control_cache_single *pC;
-	u16 response_size;
+	size_t response_size;
 	if (!find_control(phm->obj_index, p_cache, &pI)) {
 		HPI_DEBUG_LOG(VERBOSE,
 			"HPICMN find_control() failed for adap %d\n",
@@ -532,7 +532,7 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
 		pI->control_index, pI->control_type, phm->u.c.attribute);
 
 	if (found)
-		phr->size = response_size;
+		phr->size = (u16)response_size;
 
 	return found;
 }
Signature · 1 line
1.7.0.4
#26 lore raw

PATCH 13/15 ALSA: asihpi - Control name updates

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Add names corresponding to new HPI node types. Shorten some names so that constructed names don't overflow the maximum name length.

---
 sound/pci/asihpi/asihpi.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
sound/pci/asihpi/asihpi.c +8 -4
index 60444e7..8033d85 100644
@@ -1329,10 +1329,12 @@ static const char * const asihpi_src_names[] = {
 	"RF",
 	"Clock",
 	"Bitstream",
-	"Microphone",
-	"Cobranet",
+	"Mic",
+	"Net",
 	"Analog",
 	"Adapter",
+	"RTP",
+	"GPI",
 };
 
 compile_time_assert(
@@ -1347,8 +1349,10 @@ static const char * const asihpi_dst_names[] = {
 	"Digital",
 	"RF",
 	"Speaker",
-	"Cobranet Out",
-	"Analog"
+	"Net",
+	"Analog",
+	"RTP",
+	"GPO",
 };
 
 compile_time_assert(
Signature · 1 line
1.7.0.4
#27 lore raw

PATCH 13/15 Control name updates

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Add names corresponding to new HPI node types. Shorten some names so that constructed names don't overflow the maximum name length.

---
 sound/pci/asihpi/asihpi.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
sound/pci/asihpi/asihpi.c +8 -4
index 60444e7..8033d85 100644
@@ -1329,10 +1329,12 @@ static const char * const asihpi_src_names[] = {
 	"RF",
 	"Clock",
 	"Bitstream",
-	"Microphone",
-	"Cobranet",
+	"Mic",
+	"Net",
 	"Analog",
 	"Adapter",
+	"RTP",
+	"GPI",
 };
 
 compile_time_assert(
@@ -1347,8 +1349,10 @@ static const char * const asihpi_dst_names[] = {
 	"Digital",
 	"RF",
 	"Speaker",
-	"Cobranet Out",
-	"Analog"
+	"Net",
+	"Analog",
+	"RTP",
+	"GPO",
 };
 
 compile_time_assert(
Signature · 1 line
1.7.0.4
#28 lore raw

PATCH 14/15 Add volume mute controls

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Mute functionality was recently added to the DSP firmware

---
 sound/pci/asihpi/asihpi.c |   51 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 50 insertions(+), 1 deletions(-)
sound/pci/asihpi/asihpi.c +50 -1
index 8033d85..47366fb 100644
@@ -1486,11 +1486,48 @@ static int snd_asihpi_volume_put(struct snd_kcontrol *kcontrol,
 
 static const DECLARE_TLV_DB_SCALE(db_scale_100, -10000, VOL_STEP_mB, 0);
 
+static int snd_asihpi_volume_mute_info(struct snd_kcontrol *kcontrol,
+				  struct snd_ctl_elem_info *uinfo)
+{
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+	uinfo->count = 1;
+	uinfo->value.integer.min = 0;
+	uinfo->value.integer.max = 1;
+	return 0;
+}
+
+static int snd_asihpi_volume_mute_get(struct snd_kcontrol *kcontrol,
+				 struct snd_ctl_elem_value *ucontrol)
+{
+	u32 h_control = kcontrol->private_value;
+	u32 mute;
+
+	hpi_handle_error(hpi_volume_get_mute(h_control, &mute));
+	ucontrol->value.integer.value[0] = mute ? 0 : 1;
+
+	return 0;
+}
+
+static int snd_asihpi_volume_mute_put(struct snd_kcontrol *kcontrol,
+				 struct snd_ctl_elem_value *ucontrol)
+{
+	u32 h_control = kcontrol->private_value;
+	int change = 1;
+	/* HPI currently only supports all or none muting of multichannel volume
+	ALSA Switch element has opposite sense to HPI mute: on==unmuted, off=muted
+	*/
+	int mute =  ucontrol->value.integer.value[0] ? 0 : HPI_BITMASK_ALL_CHANNELS;
+	hpi_handle_error(hpi_volume_set_mute(h_control, mute));
+	return change;
+}
+
 static int __devinit snd_asihpi_volume_add(struct snd_card_asihpi *asihpi,
 					struct hpi_control *hpi_ctl)
 {
 	struct snd_card *card = asihpi->card;
 	struct snd_kcontrol_new snd_control;
+	int err;
+	u32 mute;
 
 	asihpi_ctl_init(&snd_control, hpi_ctl, "Volume");
 	snd_control.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
@@ -1500,7 +1537,19 @@ static int __devinit snd_asihpi_volume_add(struct snd_card_asihpi *asihpi,
 	snd_control.put = snd_asihpi_volume_put;
 	snd_control.tlv.p = db_scale_100;
 
-	return ctl_add(card, &snd_control, asihpi);
+	err = ctl_add(card, &snd_control, asihpi);
+	if (err)
+		return err;
+
+	if (hpi_volume_get_mute(hpi_ctl->h_control, &mute) == 0) {
+		asihpi_ctl_init(&snd_control, hpi_ctl, "Switch");
+		snd_control.access = SNDRV_CTL_ELEM_ACCESS_READWRITE;
+		snd_control.info = snd_asihpi_volume_mute_info;
+		snd_control.get = snd_asihpi_volume_mute_get;
+		snd_control.put = snd_asihpi_volume_mute_put;
+		err = ctl_add(card, &snd_control, asihpi);
+	}
+	return err;
 }
 
 /*------------------------------------------------------------
Signature · 1 line
1.7.0.4
#29 lore raw

PATCH 14/15 ALSA: asihpi - Add volume mute controls

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

Mute functionality was recently added to the DSP firmware

---
 sound/pci/asihpi/asihpi.c |   51 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 50 insertions(+), 1 deletions(-)
sound/pci/asihpi/asihpi.c +50 -1
index 8033d85..47366fb 100644
@@ -1486,11 +1486,48 @@ static int snd_asihpi_volume_put(struct snd_kcontrol *kcontrol,
 
 static const DECLARE_TLV_DB_SCALE(db_scale_100, -10000, VOL_STEP_mB, 0);
 
+static int snd_asihpi_volume_mute_info(struct snd_kcontrol *kcontrol,
+				  struct snd_ctl_elem_info *uinfo)
+{
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+	uinfo->count = 1;
+	uinfo->value.integer.min = 0;
+	uinfo->value.integer.max = 1;
+	return 0;
+}
+
+static int snd_asihpi_volume_mute_get(struct snd_kcontrol *kcontrol,
+				 struct snd_ctl_elem_value *ucontrol)
+{
+	u32 h_control = kcontrol->private_value;
+	u32 mute;
+
+	hpi_handle_error(hpi_volume_get_mute(h_control, &mute));
+	ucontrol->value.integer.value[0] = mute ? 0 : 1;
+
+	return 0;
+}
+
+static int snd_asihpi_volume_mute_put(struct snd_kcontrol *kcontrol,
+				 struct snd_ctl_elem_value *ucontrol)
+{
+	u32 h_control = kcontrol->private_value;
+	int change = 1;
+	/* HPI currently only supports all or none muting of multichannel volume
+	ALSA Switch element has opposite sense to HPI mute: on==unmuted, off=muted
+	*/
+	int mute =  ucontrol->value.integer.value[0] ? 0 : HPI_BITMASK_ALL_CHANNELS;
+	hpi_handle_error(hpi_volume_set_mute(h_control, mute));
+	return change;
+}
+
 static int __devinit snd_asihpi_volume_add(struct snd_card_asihpi *asihpi,
 					struct hpi_control *hpi_ctl)
 {
 	struct snd_card *card = asihpi->card;
 	struct snd_kcontrol_new snd_control;
+	int err;
+	u32 mute;
 
 	asihpi_ctl_init(&snd_control, hpi_ctl, "Volume");
 	snd_control.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
@@ -1500,7 +1537,19 @@ static int __devinit snd_asihpi_volume_add(struct snd_card_asihpi *asihpi,
 	snd_control.put = snd_asihpi_volume_put;
 	snd_control.tlv.p = db_scale_100;
 
-	return ctl_add(card, &snd_control, asihpi);
+	err = ctl_add(card, &snd_control, asihpi);
+	if (err)
+		return err;
+
+	if (hpi_volume_get_mute(hpi_ctl->h_control, &mute) == 0) {
+		asihpi_ctl_init(&snd_control, hpi_ctl, "Switch");
+		snd_control.access = SNDRV_CTL_ELEM_ACCESS_READWRITE;
+		snd_control.info = snd_asihpi_volume_mute_info;
+		snd_control.get = snd_asihpi_volume_mute_get;
+		snd_control.put = snd_asihpi_volume_mute_put;
+		err = ctl_add(card, &snd_control, asihpi);
+	}
+	return err;
 }
 
 /*------------------------------------------------------------
Signature · 1 line
1.7.0.4
#31 lore raw

PATCH 15/15 ALSA: asihpi - HPI version 4.08

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

HPI Version is used to check for firmware compatibility. This version will accept 4.08.xx released firmware, and will also accept 4.09.xx beta firmware

---
 sound/pci/asihpi/hpi.h |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
sound/pci/asihpi/hpi.h +4 -5
index 9538f12..f207272 100644
@@ -1,7 +1,7 @@
 /******************************************************************************
 
     AudioScience HPI driver
-    Copyright (C) 1997-2010  AudioScience Inc. <[email protected]>
+    Copyright (C) 1997-2011  AudioScience Inc. <[email protected]>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of version 2 of the GNU General Public License as
@@ -42,12 +42,11 @@ i.e 3.05.02 is a development version
 #define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF))
 #define HPI_VER_RELEASE(v) ((int)(v & 0xFF))
 
-/* Use single digits for versions less that 10 to avoid octal. */
-#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 6, 0)
-#define HPI_VER_STRING "4.06.00"
+#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 8, 0)
+#define HPI_VER_STRING "4.08.00"
 
 /* Library version as documented in hpi-api-versions.txt */
-#define HPI_LIB_VER  HPI_VERSION_CONSTRUCTOR(9, 0, 0)
+#define HPI_LIB_VER  HPI_VERSION_CONSTRUCTOR(10, 0, 0)
 
 #include <linux/types.h>
 #define HPI_BUILD_EXCLUDE_DEPRECATED
Signature · 1 line
1.7.0.4
#32 lore raw

PATCH 15/15 HPI version 4.08

In reply to [email protected]

From: Eliot Blennerhassett <[email protected]>

HPI Version is used to check for firmware compatibility. This version will accept 4.08.xx released firmware, and will also accept 4.09.xx beta firmware

---
 sound/pci/asihpi/hpi.h |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
sound/pci/asihpi/hpi.h +4 -5
index 9538f12..f207272 100644
@@ -1,7 +1,7 @@
 /******************************************************************************
 
     AudioScience HPI driver
-    Copyright (C) 1997-2010  AudioScience Inc. <[email protected]>
+    Copyright (C) 1997-2011  AudioScience Inc. <[email protected]>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of version 2 of the GNU General Public License as
@@ -42,12 +42,11 @@ i.e 3.05.02 is a development version
 #define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF))
 #define HPI_VER_RELEASE(v) ((int)(v & 0xFF))
 
-/* Use single digits for versions less that 10 to avoid octal. */
-#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 6, 0)
-#define HPI_VER_STRING "4.06.00"
+#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 8, 0)
+#define HPI_VER_STRING "4.08.00"
 
 /* Library version as documented in hpi-api-versions.txt */
-#define HPI_LIB_VER  HPI_VERSION_CONSTRUCTOR(9, 0, 0)
+#define HPI_LIB_VER  HPI_VERSION_CONSTRUCTOR(10, 0, 0)
 
 #include <linux/types.h>
 #define HPI_BUILD_EXCLUDE_DEPRECATED
Signature · 1 line
1.7.0.4
#8 lore raw

Re: [PATCH 04/15] ALSA: asihpi - DSP code loader API now independent of OS

In reply to [email protected]

At Fri, 22 Jul 2011 15:52:42 +1200,

Quoted 5 lines · [email protected] wrote:
sound/pci/asihpi/hpidspcd.c +0 -0
index 5c6ea11..a03eb86 100644

...

Quoted 4 lines

#define SOURCEFILE_NAME "hpidspcd.c"
#include "hpidspcd.h"
#include "hpidebug.h"
+#include "linux/pci.h"

This line is obviously superfluous. I removed this from the patch.

thanks,

Takashi

#30 lore raw

Re: [PATCH 14/15] ALSA: asihpi - Add volume mute controls

In reply to [email protected]

At Fri, 22 Jul 2011 15:53:03 +1200,

Quoted 8 lines · [email protected] wrote:
sound/pci/asihpi/asihpi.c +0 -0
index 8033d85..47366fb 100644
@@ -1486,11 +1486,48 @@ static int snd_asihpi_volume_put(struct snd_kcontrol *kcontrol,
 
 static const DECLARE_TLV_DB_SCALE(db_scale_100, -10000, VOL_STEP_mB, 0);

sound/pci/asihpi/asihpi.c static int snd_asihpi_volume_put(struct snd_kcontrol *kcontrol, · line 1497

Quoted 10 lines
sound/pci/asihpi/asihpi.c +9 -0
 
+static int snd_asihpi_volume_mute_info(struct snd_kcontrol *kcontrol,
+				  struct snd_ctl_elem_info *uinfo)
+{
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+	uinfo->count = 1;
+	uinfo->value.integer.min = 0;
+	uinfo->value.integer.max = 1;
+	return 0;
+}

snd_ctl_boolean_mono_info() is provided just for this type. I applied the patch below in addition.

Takashi

---
From: Takashi Iwai <[email protected]>
Subject: [PATCH] ALSA: asihpi - Replace with snd_ctl_boolean_mono_info()

---
 sound/pci/asihpi/asihpi.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)
sound/pci/asihpi/asihpi.c +1 -9
index f2b35e1..cc809ac 100644
@@ -1487,15 +1487,7 @@ static int snd_asihpi_volume_put(struct snd_kcontrol *kcontrol,
 
 static const DECLARE_TLV_DB_SCALE(db_scale_100, -10000, VOL_STEP_mB, 0);
 
-static int snd_asihpi_volume_mute_info(struct snd_kcontrol *kcontrol,
-				  struct snd_ctl_elem_info *uinfo)
-{
-	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
-	uinfo->count = 1;
-	uinfo->value.integer.min = 0;
-	uinfo->value.integer.max = 1;
-	return 0;
-}
+#define snd_asihpi_volume_mute_info	snd_ctl_boolean_mono_info
 
 static int snd_asihpi_volume_mute_get(struct snd_kcontrol *kcontrol,
 				 struct snd_ctl_elem_value *ucontrol)
Signature · 1 line
1.7.6
#34 lore raw
In reply to [email protected]

At Fri, 22 Jul 2011 15:52:35 +1200,

Quoted 5 lines · [email protected] wrote:

From: Eliot Blennerhassett <[email protected]>

Main visible change is the addition of mute switch to volume controls. The rest are relatively minor changes and cleanups to HPI code.

Thanks, now applied all patches with a couple of minor fixes.

Takashi

Quoted 40 lines

patch#6 reverts commit 4a122c10f "check adapter index in hpi_ioctl"

The associated 4.08 firmware release adds support for new cards ASI5544/5541/5540/5520

Eliot Blennerhassett (15):
ALSA: asihpi - Give more meaningful name to hpi request message type
ALSA: asihpi - Increase request and response buffer sizes
ALSA: asihpi - Remove controlex structs and associated special data
transfer code
ALSA: asihpi - DSP code loader API now independent of OS
ALSA: asihpi - Revise snd_pcm_debug_name, get rid of DEBUG_NAME macro
ALSA: asihpi - Remove spurious adapter index check
ALSA: asihpi - Remove unused structures, macros and functions
ALSA: asihpi - Fix minor typos and spelling
ALSA: asihpi - Make local function static
ALSA: asihpi - Add new node and message defines
ALSA: asihpi - Explicitly include mutex.h
ALSA: asihpi - Use size_t for sizeof result
ALSA: asihpi - Control name updates
ALSA: asihpi - Add volume mute controls
ALSA: asihpi - HPI version 4.08

 sound/pci/asihpi/asihpi.c       |   87 ++++++++++++++++++----
 sound/pci/asihpi/hpi.h          |   24 ++++--
 sound/pci/asihpi/hpi6000.c      |   11 +--
 sound/pci/asihpi/hpi6205.c      |   52 ++++---------
 sound/pci/asihpi/hpi6205.h      |   25 +++++--
 sound/pci/asihpi/hpi_internal.h |  155 ++++++++++----------------------------
 sound/pci/asihpi/hpicmn.c       |   17 ++--
 sound/pci/asihpi/hpidspcd.c     |  137 ++++++++++++++--------------------
 sound/pci/asihpi/hpidspcd.h     |   72 ++++++++++--------
 sound/pci/asihpi/hpifunc.c      |   86 ++++++++++-----------
 sound/pci/asihpi/hpimsginit.c   |    4 +-
 sound/pci/asihpi/hpimsgx.c      |    6 +-
 sound/pci/asihpi/hpioctl.c      |   10 +--
 sound/pci/asihpi/hpios.c        |    8 --
 sound/pci/asihpi/hpios.h        |    1 +
 15 files changed, 319 insertions(+), 376 deletions(-)
#36 lore raw

Re: asihpi - update from HPI 4.06 to 4.08 - Firmware

In reply to a message not in the archive

At Fri, 22 Jul 2011 16:05:43 +1200,

Quoted 11 lines · Eliot Blennerhassett
Quoted 4 lines · On 22/07/11 15:52, [email protected] wrote:

From: Eliot Blennerhassett <[email protected]>

Main visible change is the addition of mute switch to volume controls. The rest are relatively minor changes and cleanups to HPI code.

I also forgot to mention that the associated firmware/asihpi should be updated with the contents of

http://www.audioscience.com/internet/download/drivers/released/v4/08/02/asihpi-firmware-40802.7z

OK, now updated alsa-firmware tree, too.

thanks,

Takashi