aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliot Blennerhassett <eblennerhassett@audioscience.com>2010-03-24 10:23:35 +1300
committerTakashi Iwai <tiwai@suse.de>2010-03-24 07:41:22 +0100
commitd648b617009a0d7fff84e20a8018f72e985288db (patch)
tree47ea1ef1e9b4e836dc49236706541533e6d32d81
parent41ec1a81a8370ca42e8560532dff417a54f843fd (diff)
downloadalsa-driver-build-unstable-d648b617009a0d7fff84e20a8018f72e985288db.tar.gz
snd-asihpi: Support mic control caching. Move an enum out of public api.
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--pci/asihpi/hpi.h8
-rw-r--r--pci/asihpi/hpi_internal.h11
-rw-r--r--pci/asihpi/hpicmn.c10
3 files changed, 22 insertions, 7 deletions
diff --git a/pci/asihpi/hpi.h b/pci/asihpi/hpi.h
index 71ddd610a..b89a55764 100644
--- a/pci/asihpi/hpi.h
+++ b/pci/asihpi/hpi.h
@@ -49,7 +49,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, 10)
+#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 3, 13)
/* Library version as documented in hpi-api-versions.txt */
#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(9, 0, 0)
@@ -178,12 +178,6 @@ The range is +1.0 to -1.0, which corresponds to digital fullscale.
HPI_FORMAT_UNDEFINED = 0xffff
};
-/******************************************* bus types */
-enum HPI_BUSES {
- HPI_BUS_ISAPNP = 1,
- HPI_BUS_PCI = 2,
- HPI_BUS_USB = 3
-};
/******************************************* in/out Stream states */
/*******************************************/
/** Stream States
diff --git a/pci/asihpi/hpi_internal.h b/pci/asihpi/hpi_internal.h
index 77b85e4f1..6ea091fc3 100644
--- a/pci/asihpi/hpi_internal.h
+++ b/pci/asihpi/hpi_internal.h
@@ -174,6 +174,14 @@ struct hpi_entity {
#pragma warning(pop)
#endif
+/******************************************* bus types */
+enum HPI_BUSES {
+ HPI_BUS_ISAPNP = 1,
+ HPI_BUS_PCI = 2,
+ HPI_BUS_USB = 3,
+ HPI_BUS_NET = 4
+};
+
/******************************************* CONTROL ATTRIBUTES ****/
/* (in order of control type ID */
@@ -1583,6 +1591,9 @@ struct hpi_control_cache_single {
u16 wSourceIndex;
u32 dwSampleRate;
} clk;
+ struct { /* microphone control */
+ u16 wState;
+ } phantom_power;
struct { /* generic control */
u32 dw1;
u32 dw2;
diff --git a/pci/asihpi/hpicmn.c b/pci/asihpi/hpicmn.c
index 4d4a796d0..012fd0f1f 100644
--- a/pci/asihpi/hpicmn.c
+++ b/pci/asihpi/hpicmn.c
@@ -414,6 +414,12 @@ short HpiCheckControlCache(
} else
found = 0;
break;
+ case HPI_CONTROL_MICROPHONE:
+ if (phm->u.c.wAttribute == HPI_MICROPHONE_PHANTOM_POWER) {
+ phr->u.c.dwParam1 = pC->u.phantom_power.wState;
+ } else
+ found = 0;
+ break;
case HPI_CONTROL_SAMPLECLOCK:
if (phm->u.c.wAttribute == HPI_SAMPLECLOCK_SOURCE)
phr->u.c.dwParam1 = pC->u.clk.wSource;
@@ -562,6 +568,10 @@ void HpiSyncControlCache(
pC->u.v.anLog[1] = phr->u.c.anLogValue[1];
}
break;
+ case HPI_CONTROL_MICROPHONE:
+ if (phm->u.c.wAttribute == HPI_MICROPHONE_PHANTOM_POWER)
+ pC->u.phantom_power.wState = (u16)phm->u.c.dwParam1;
+ break;
case HPI_CONTROL_AESEBU_TRANSMITTER:
if (phr->wError)
return;