[alsa-devel] [PATCH][asihpi] Meter control return peak.

Eliot Blennerhassett linux at audioscience.com
Tue Jun 17 03:35:44 CEST 2008


Use Peak meter instead of Rms meter because it is supported by all card 
families.
Minor checkpatch cleanups.

Signed-off-by: Eliot Blennerhassett <linux at audioscience.com>

---
diff --git a/pci/asihpi/asihpi.c b/pci/asihpi/asihpi.c
index 8cbefab..ab90b08 100644
--- a/pci/asihpi/asihpi.c
+++ b/pci/asihpi/asihpi.c
@@ -383,15 +383,15 @@ static void snd_card_asihpi_pcm_samplerates(struct 
snd_card_asihpi *asihpi,
 		rate_max = 100000;
 	} else {
 		/* on cards without SRC,
-		    valid rates are determined by sampleclock */
+		   valid rates are determined by sampleclock */
 		err = HPI_MixerGetControl(phSubSys, asihpi->hMixer,
 					  HPI_SOURCENODE_CLOCK_SOURCE, 0, 0, 0,
 					  HPI_CONTROL_SAMPLECLOCK, &hControl);
 
 		for (idx = 0; idx < 100; idx++) {
 			if (HPI_ControlQuery(phSubSys, hControl,
-				HPI_SAMPLECLOCK_SAMPLERATE, idx, 0,
-				&sampleRate))
+					HPI_SAMPLECLOCK_SAMPLERATE,
+					idx, 0, &sampleRate))
 				break;
 
 			rate_min = min(rate_min, sampleRate);
@@ -443,7 +443,7 @@ static void snd_card_asihpi_pcm_samplerates(struct 
snd_card_asihpi *asihpi,
 		}
 	}
 
-	/*printk(KERN_INFO "Supported rates %X %d %d\n",
+	/* printk(KERN_INFO "Supported rates %X %d %d\n",
 	   rates, rate_min, rate_max); */
 	pcmhw->rates = rates;
 	pcmhw->rate_min = rate_min;
@@ -885,7 +885,7 @@ static void snd_card_asihpi_playback_format(struct 
snd_card_asihpi *asihpi,
 						u32 hStream,
 						struct snd_pcm_hardware *pcmhw)
 {
-  struct hpi_format hpi_format;
+	struct hpi_format hpi_format;
 	u16 wFormat;
 	u16 err;
 	u32 hControl;
@@ -1126,10 +1126,10 @@ static void snd_card_asihpi_capture_format(struct 
snd_card_asihpi *asihpi,
 	for (wFormat = HPI_FORMAT_PCM8_UNSIGNED;
 		wFormat <= HPI_FORMAT_PCM24_SIGNED; wFormat++) {
 
-		HPI_FormatCreate(
-			&hpi_format, 2, wFormat, dwSampleRate, 128000, 0);
-
-		err = HPI_InStreamQueryFormat(phSubSys, hStream,
+		HPI_FormatCreate(&hpi_format, 2, wFormat, dwSampleRate,
+						128000, 0);
+		err =
+		    HPI_InStreamQueryFormat(phSubSys, hStream,
 					    &hpi_format);
 		if (!err)
 			pcmhw->formats |=
@@ -2025,7 +2025,7 @@ static int snd_asihpi_meter_get(struct snd_kcontrol 
*kcontrol,
 	short anGain0_01dB[HPI_MAX_CHANNELS], i;
 	u16 err;
 
-	err = HPI_MeterGetRms(phSubSys, hControl, anGain0_01dB);
+	err = HPI_MeterGetPeak(phSubSys, hControl, anGain0_01dB);
 
 	for (i = 0; i < HPI_MAX_CHANNELS; i++) {
 #if ASIHPI_LINEAR_METERS
@@ -2796,7 +2796,7 @@ int __devinit snd_asihpi_probe(struct pci_dev *pci_dev,
 	asihpi->support_mmap = (!err);
 
 	asihpi->support_mrx = (((asihpi->wType & 0xFF00) == 0x8900) ||
-					((asihpi->wType & 0xF000) == 0x6000));
+			((asihpi->wType & 0xF000) == 0x6000));
 
 
 	printk(KERN_INFO "Supports mmap:%d grouping:%d\n",

-- 
--
Eliot Blennerhassett
www.audioscience.com


More information about the Alsa-devel mailing list