alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] Remove unused io map functions.
@ 2010-05-27  5:53 linux
  2010-05-27  5:53 ` [PATCH 2/5] Add hd radio blend functions. HPI version inc to 4.03.25 linux
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: linux @ 2010-05-27  5:53 UTC (permalink / raw)
  To: patch; +Cc: tiwai, Eliot Blennerhassett, alsa-devel

From: Eliot Blennerhassett <eblennerhassett@audioscience.com>

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
---
 sound/pci/asihpi/hpios.c |   23 -----------------------
 sound/pci/asihpi/hpios.h |    9 ---------
 2 files changed, 0 insertions(+), 32 deletions(-)

diff --git a/sound/pci/asihpi/hpios.c b/sound/pci/asihpi/hpios.c
index de615cf..742ee12 100644
--- a/sound/pci/asihpi/hpios.c
+++ b/sound/pci/asihpi/hpios.c
@@ -89,26 +89,3 @@ u16 hpios_locked_mem_free(struct consistent_dma_area *p_mem_area)
 void hpios_locked_mem_free_all(void)
 {
 }
-
-void __iomem *hpios_map_io(struct pci_dev *pci_dev, int idx,
-	unsigned int length)
-{
-	HPI_DEBUG_LOG(DEBUG, "mapping %d %s %08llx-%08llx %04llx len 0x%x\n",
-		idx, pci_dev->resource[idx].name,
-		(unsigned long long)pci_resource_start(pci_dev, idx),
-		(unsigned long long)pci_resource_end(pci_dev, idx),
-		(unsigned long long)pci_resource_flags(pci_dev, idx), length);
-
-	if (!(pci_resource_flags(pci_dev, idx) & IORESOURCE_MEM)) {
-		HPI_DEBUG_LOG(ERROR, "not an io memory resource\n");
-		return NULL;
-	}
-
-	if (length > pci_resource_len(pci_dev, idx)) {
-		HPI_DEBUG_LOG(ERROR, "resource too small for requested %d \n",
-			length);
-		return NULL;
-	}
-
-	return ioremap(pci_resource_start(pci_dev, idx), length);
-}
diff --git a/sound/pci/asihpi/hpios.h b/sound/pci/asihpi/hpios.h
index a62c3f1..370f39b 100644
--- a/sound/pci/asihpi/hpios.h
+++ b/sound/pci/asihpi/hpios.h
@@ -166,13 +166,4 @@ struct hpi_adapter {
 	void __iomem *ap_remapped_mem_base[HPI_MAX_ADAPTER_MEM_SPACES];
 };
 
-static inline void hpios_unmap_io(void __iomem *addr,
-	unsigned long size)
-{
-	iounmap(addr);
-}
-
-void __iomem *hpios_map_io(struct pci_dev *pci_dev, int idx,
-	unsigned int length);
-
 #endif
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/5] Add hd radio blend functions. HPI version inc to 4.03.25
  2010-05-27  5:53 [PATCH 1/5] Remove unused io map functions linux
@ 2010-05-27  5:53 ` linux
  2010-05-27  5:53 ` [PATCH 3/5] Remove support for old ASI8800 family. Fix imbalanced lock path in hw_message linux
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: linux @ 2010-05-27  5:53 UTC (permalink / raw)
  To: patch; +Cc: tiwai, Eliot Blennerhassett, alsa-devel

From: Eliot Blennerhassett <eblennerhassett@audioscience.com>

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
---
 sound/pci/asihpi/hpi.h          |    8 +++++++-
 sound/pci/asihpi/hpi_internal.h |    5 +++++
 sound/pci/asihpi/hpifunc.c      |   17 +++++++++++++++--
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/sound/pci/asihpi/hpi.h b/sound/pci/asihpi/hpi.h
index 99400de..0173bbe 100644
--- a/sound/pci/asihpi/hpi.h
+++ b/sound/pci/asihpi/hpi.h
@@ -50,7 +50,7 @@ i.e 3.05.02 is a development version
 #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, 3, 18)
+#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 3, 25)
 
 /* Library version as documented in hpi-api-versions.txt */
 #define HPI_LIB_VER  HPI_VERSION_CONSTRUCTOR(9, 0, 0)
@@ -1632,6 +1632,12 @@ u16 hpi_tuner_get_hd_radio_sdk_version(const struct hpi_hsubsys *ph_subsys,
 u16 hpi_tuner_get_hd_radio_signal_quality(const struct hpi_hsubsys *ph_subsys,
 	u32 h_control, u32 *pquality);
 
+u16 hpi_tuner_get_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys,
+	u32 h_control, u32 *pblend);
+
+u16 hpi_tuner_set_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys,
+	u32 h_control, const u32 blend);
+
 /****************************/
 /* PADs control             */
 /****************************/
diff --git a/sound/pci/asihpi/hpi_internal.h b/sound/pci/asihpi/hpi_internal.h
index f1cd6f1..fdd0ce0 100644
--- a/sound/pci/asihpi/hpi_internal.h
+++ b/sound/pci/asihpi/hpi_internal.h
@@ -232,6 +232,8 @@ enum HPI_BUSES {
 #define HPI_TUNER_HDRADIO_SDK_VERSION   HPI_CTL_ATTR(TUNER, 13)
 /** HD Radio DSP firmware version. */
 #define HPI_TUNER_HDRADIO_DSP_VERSION   HPI_CTL_ATTR(TUNER, 14)
+/** HD Radio signal blend (force analog, or automatic). */
+#define HPI_TUNER_HDRADIO_BLEND         HPI_CTL_ATTR(TUNER, 15)
 
 /** \} */
 
@@ -478,8 +480,10 @@ Threshold is a -ve number in units of dB/100,
 
 /** First 2 hex digits define the adapter family */
 #define HPI_ADAPTER_FAMILY_MASK         0xff00
+#define HPI_MODULE_FAMILY_MASK          0xfff0
 
 #define HPI_ADAPTER_FAMILY_ASI(f)   (f & HPI_ADAPTER_FAMILY_MASK)
+#define HPI_MODULE_FAMILY_ASI(f)   (f & HPI_MODULE_FAMILY_MASK)
 #define HPI_ADAPTER_ASI(f)   (f)
 
 /******************************************* message types */
@@ -970,6 +974,7 @@ struct hpi_control_union_msg {
 				u32 mode;
 				u32 value;
 			} mode;
+			u32 blend;
 		} tuner;
 	} u;
 };
diff --git a/sound/pci/asihpi/hpifunc.c b/sound/pci/asihpi/hpifunc.c
index eda26b3..298eef3 100644
--- a/sound/pci/asihpi/hpifunc.c
+++ b/sound/pci/asihpi/hpifunc.c
@@ -2946,6 +2946,20 @@ u16 hpi_tuner_get_hd_radio_signal_quality(const struct hpi_hsubsys *ph_subsys,
 		HPI_TUNER_HDRADIO_SIGNAL_QUALITY, 0, 0, pquality, NULL);
 }
 
+u16 hpi_tuner_get_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys,
+	u32 h_control, u32 *pblend)
+{
+	return hpi_control_param_get(ph_subsys, h_control,
+		HPI_TUNER_HDRADIO_BLEND, 0, 0, pblend, NULL);
+}
+
+u16 hpi_tuner_set_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys,
+	u32 h_control, const u32 blend)
+{
+	return hpi_control_param_set(ph_subsys, h_control,
+		HPI_TUNER_HDRADIO_BLEND, blend, 0);
+}
+
 u16 hpi_tuner_getRDS(const struct hpi_hsubsys *ph_subsys, u32 h_control,
 	char *p_data)
 {
@@ -3266,8 +3280,7 @@ u16 hpi_entity_find_next(struct hpi_entity *container_entity,
 
 void hpi_entity_free(struct hpi_entity *entity)
 {
-	if (entity != NULL)
-		kfree(entity);
+	kfree(entity);
 }
 
 static u16 hpi_entity_alloc_and_copy(struct hpi_entity *src,
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/5] Remove support for old ASI8800 family. Fix imbalanced lock path in hw_message.
  2010-05-27  5:53 [PATCH 1/5] Remove unused io map functions linux
  2010-05-27  5:53 ` [PATCH 2/5] Add hd radio blend functions. HPI version inc to 4.03.25 linux
@ 2010-05-27  5:53 ` linux
  2010-05-27  5:53 ` [PATCH 4/5] Fix bug preventing outstream_write preload from happening. Add support for new ASI8800 family linux
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: linux @ 2010-05-27  5:53 UTC (permalink / raw)
  To: patch; +Cc: tiwai, Eliot Blennerhassett, alsa-devel

From: Eliot Blennerhassett <eblennerhassett@audioscience.com>

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
---
 sound/pci/asihpi/hpi6000.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/pci/asihpi/hpi6000.c b/sound/pci/asihpi/hpi6000.c
index 839ecb2..12dab5e 100644
--- a/sound/pci/asihpi/hpi6000.c
+++ b/sound/pci/asihpi/hpi6000.c
@@ -691,9 +691,6 @@ static short hpi6000_adapter_boot_load_dsp(struct hpi_adapter_obj *pao,
 	case 0x6200:
 		boot_load_family = HPI_ADAPTER_FAMILY_ASI(0x6200);
 		break;
-	case 0x8800:
-		boot_load_family = HPI_ADAPTER_FAMILY_ASI(0x8800);
-		break;
 	default:
 		return HPI6000_ERROR_UNHANDLED_SUBSYS_ID;
 	}
@@ -1775,7 +1772,6 @@ static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm,
 	u16 error = 0;
 	u16 dsp_index = 0;
 	u16 num_dsp = ((struct hpi_hw_obj *)pao->priv)->num_dsp;
-	hpios_dsplock_lock(pao);
 
 	if (num_dsp < 2)
 		dsp_index = 0;
@@ -1796,6 +1792,8 @@ static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm,
 			}
 		}
 	}
+
+	hpios_dsplock_lock(pao);
 	error = hpi6000_message_response_sequence(pao, dsp_index, phm, phr);
 
 	/* maybe an error response */
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/5] Fix bug preventing outstream_write preload from happening. Add support for new ASI8800 family.
  2010-05-27  5:53 [PATCH 1/5] Remove unused io map functions linux
  2010-05-27  5:53 ` [PATCH 2/5] Add hd radio blend functions. HPI version inc to 4.03.25 linux
  2010-05-27  5:53 ` [PATCH 3/5] Remove support for old ASI8800 family. Fix imbalanced lock path in hw_message linux
@ 2010-05-27  5:53 ` linux
  2010-05-27  5:53 ` [PATCH 5/5] Minor code cleanup linux
  2010-05-27  8:12 ` [PATCH 1/5] Remove unused io map functions Takashi Iwai
  4 siblings, 0 replies; 6+ messages in thread
From: linux @ 2010-05-27  5:53 UTC (permalink / raw)
  To: patch; +Cc: tiwai, Eliot Blennerhassett, alsa-devel

From: Eliot Blennerhassett <eblennerhassett@audioscience.com>

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
---
 sound/pci/asihpi/hpi6205.c |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/sound/pci/asihpi/hpi6205.c b/sound/pci/asihpi/hpi6205.c
index 5e88c1f..e89991e 100644
--- a/sound/pci/asihpi/hpi6205.c
+++ b/sound/pci/asihpi/hpi6205.c
@@ -966,23 +966,16 @@ static void outstream_write(struct hpi_adapter_obj *pao,
 	status = &interface->outstream_host_buffer_status[phm->obj_index];
 
 	if (phw->flag_outstream_just_reset[phm->obj_index]) {
-		/* Format can only change after reset. Must tell DSP. */
-		u16 function = phm->function;
-		phw->flag_outstream_just_reset[phm->obj_index] = 0;
-		phm->function = HPI_OSTREAM_SET_FORMAT;
-		hw_message(pao, phm, phr);	/* send the format to the DSP */
-		phm->function = function;
-		if (phr->error)
-			return;
-	}
-#if 1
-	if (phw->flag_outstream_just_reset[phm->obj_index]) {
 		/* First OutStremWrite() call following reset will write data to the
-		   adapter's buffers, reducing delay before stream can start
+		   adapter's buffers, reducing delay before stream can start. The DSP
+		   takes care of setting the stream data format using format information
+		   embedded in phm.
 		 */
 		int partial_write = 0;
 		unsigned int original_size = 0;
 
+		phw->flag_outstream_just_reset[phm->obj_index] = 0;
+
 		/* Send the first buffer to the DSP the old way. */
 		/* Limit size of first transfer - */
 		/* expect that this will not usually be triggered. */
@@ -1012,7 +1005,6 @@ static void outstream_write(struct hpi_adapter_obj *pao,
 			original_size - HPI6205_SIZEOF_DATA;
 		phm->u.d.u.data.pb_data += HPI6205_SIZEOF_DATA;
 	}
-#endif
 
 	space_available = outstream_get_space_available(status);
 	if (space_available < (long)phm->u.d.u.data.data_size) {
@@ -1369,6 +1361,9 @@ static u16 adapter_boot_load_dsp(struct hpi_adapter_obj *pao,
 	case HPI_ADAPTER_FAMILY_ASI(0x6500):
 		firmware_id = HPI_ADAPTER_FAMILY_ASI(0x6600);
 		break;
+	case HPI_ADAPTER_FAMILY_ASI(0x8800):
+		firmware_id = HPI_ADAPTER_FAMILY_ASI(0x8900);
+		break;
 	}
 	boot_code_id[1] = firmware_id;
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 5/5] Minor code cleanup.
  2010-05-27  5:53 [PATCH 1/5] Remove unused io map functions linux
                   ` (2 preceding siblings ...)
  2010-05-27  5:53 ` [PATCH 4/5] Fix bug preventing outstream_write preload from happening. Add support for new ASI8800 family linux
@ 2010-05-27  5:53 ` linux
  2010-05-27  8:12 ` [PATCH 1/5] Remove unused io map functions Takashi Iwai
  4 siblings, 0 replies; 6+ messages in thread
From: linux @ 2010-05-27  5:53 UTC (permalink / raw)
  To: patch; +Cc: tiwai, Eliot Blennerhassett, alsa-devel

From: Eliot Blennerhassett <eblennerhassett@audioscience.com>

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
---
 sound/pci/asihpi/hpicmn.c |   38 +++++++++++++-------------------------
 1 files changed, 13 insertions(+), 25 deletions(-)

diff --git a/sound/pci/asihpi/hpicmn.c b/sound/pci/asihpi/hpicmn.c
index 565102c..fcd6453 100644
--- a/sound/pci/asihpi/hpicmn.c
+++ b/sound/pci/asihpi/hpicmn.c
@@ -347,20 +347,15 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
 			found = 0;
 		break;
 	case HPI_CONTROL_TUNER:
-		{
-			struct hpi_control_cache_single *pCT =
-				(struct hpi_control_cache_single *)pI;
-			if (phm->u.c.attribute == HPI_TUNER_FREQ)
-				phr->u.c.param1 = pCT->u.t.freq_ink_hz;
-			else if (phm->u.c.attribute == HPI_TUNER_BAND)
-				phr->u.c.param1 = pCT->u.t.band;
-			else if ((phm->u.c.attribute == HPI_TUNER_LEVEL)
-				&& (phm->u.c.param1 ==
-					HPI_TUNER_LEVEL_AVERAGE))
-				phr->u.c.param1 = pCT->u.t.level;
-			else
-				found = 0;
-		}
+		if (phm->u.c.attribute == HPI_TUNER_FREQ)
+			phr->u.c.param1 = pC->u.t.freq_ink_hz;
+		else if (phm->u.c.attribute == HPI_TUNER_BAND)
+			phr->u.c.param1 = pC->u.t.band;
+		else if ((phm->u.c.attribute == HPI_TUNER_LEVEL)
+			&& (phm->u.c.param1 == HPI_TUNER_LEVEL_AVERAGE))
+			phr->u.c.param1 = pC->u.t.level;
+		else
+			found = 0;
 		break;
 	case HPI_CONTROL_AESEBU_RECEIVER:
 		if (phm->u.c.attribute == HPI_AESEBURX_ERRORSTATUS)
@@ -503,6 +498,9 @@ void hpi_sync_control_cache(struct hpi_control_cache *p_cache,
 	struct hpi_control_cache_single *pC;
 	struct hpi_control_cache_info *pI;
 
+	if (phr->error)
+		return;
+
 	if (!find_control(phm, p_cache, &pI, &control_index))
 		return;
 
@@ -520,8 +518,6 @@ void hpi_sync_control_cache(struct hpi_control_cache *p_cache,
 		break;
 	case HPI_CONTROL_MULTIPLEXER:
 		/* mux does not return its setting on Set command. */
-		if (phr->error)
-			return;
 		if (phm->u.c.attribute == HPI_MULTIPLEXER_SOURCE) {
 			pC->u.x.source_node_type = (u16)phm->u.c.param1;
 			pC->u.x.source_node_index = (u16)phm->u.c.param2;
@@ -529,8 +525,6 @@ void hpi_sync_control_cache(struct hpi_control_cache *p_cache,
 		break;
 	case HPI_CONTROL_CHANNEL_MODE:
 		/* mode does not return its setting on Set command. */
-		if (phr->error)
-			return;
 		if (phm->u.c.attribute == HPI_CHANNEL_MODE_MODE)
 			pC->u.m.mode = (u16)phm->u.c.param1;
 		break;
@@ -545,20 +539,14 @@ void hpi_sync_control_cache(struct hpi_control_cache *p_cache,
 			pC->u.phantom_power.state = (u16)phm->u.c.param1;
 		break;
 	case HPI_CONTROL_AESEBU_TRANSMITTER:
-		if (phr->error)
-			return;
 		if (phm->u.c.attribute == HPI_AESEBUTX_FORMAT)
 			pC->u.aes3tx.format = phm->u.c.param1;
 		break;
 	case HPI_CONTROL_AESEBU_RECEIVER:
-		if (phr->error)
-			return;
 		if (phm->u.c.attribute == HPI_AESEBURX_FORMAT)
 			pC->u.aes3rx.source = phm->u.c.param1;
 		break;
 	case HPI_CONTROL_SAMPLECLOCK:
-		if (phr->error)
-			return;
 		if (phm->u.c.attribute == HPI_SAMPLECLOCK_SOURCE)
 			pC->u.clk.source = (u16)phm->u.c.param1;
 		else if (phm->u.c.attribute == HPI_SAMPLECLOCK_SOURCE_INDEX)
@@ -590,7 +578,7 @@ struct hpi_control_cache *hpi_alloc_control_cache(const u32
 
 void hpi_free_control_cache(struct hpi_control_cache *p_cache)
 {
-	if ((p_cache->init) && (p_cache->p_info)) {
+	if (p_cache->init) {
 		kfree(p_cache->p_info);
 		p_cache->p_info = NULL;
 		p_cache->init = 0;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/5] Remove unused io map functions.
  2010-05-27  5:53 [PATCH 1/5] Remove unused io map functions linux
                   ` (3 preceding siblings ...)
  2010-05-27  5:53 ` [PATCH 5/5] Minor code cleanup linux
@ 2010-05-27  8:12 ` Takashi Iwai
  4 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2010-05-27  8:12 UTC (permalink / raw)
  To: linux; +Cc: Eliot Blennerhassett, alsa-devel

At Thu, 27 May 2010 17:53:51 +1200,
linux@audioscience.com wrote:
> 
> From: Eliot Blennerhassett <eblennerhassett@audioscience.com>
> 
> Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>

Thanks, applied all patches now.

However, some commits contain multiple fixes in each.  For example,
    [PATCH 3/5] Remove support for old ASI8800 family. Fix imbalanced
    lock path in hw_message.

This one should be split to two patches, one for removing old ASI8800,
and another for fixing imbalanced locks.  So did I manually while
applying these.

It'd be nice if you try to split patches in a logical functional
manner at the next time.


Takashi

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-05-27  8:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-27  5:53 [PATCH 1/5] Remove unused io map functions linux
2010-05-27  5:53 ` [PATCH 2/5] Add hd radio blend functions. HPI version inc to 4.03.25 linux
2010-05-27  5:53 ` [PATCH 3/5] Remove support for old ASI8800 family. Fix imbalanced lock path in hw_message linux
2010-05-27  5:53 ` [PATCH 4/5] Fix bug preventing outstream_write preload from happening. Add support for new ASI8800 family linux
2010-05-27  5:53 ` [PATCH 5/5] Minor code cleanup linux
2010-05-27  8:12 ` [PATCH 1/5] Remove unused io map functions Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).