Alsa-devel
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 16 participants
- 51106 discussions

31 Jul '08
Hi,
2008/7/30 Russ Dill <russ.dill(a)gmail.com>:
> Here's a version of the third patch in the series without all the
> #ifdef's. Just a quick question for Dmitry, why all the if (!
> cpu_is_pxa3xx())'s around the pxa_gpio_mode's? Also, there was a build
> error when just building the sound/arm pxa2xx-ac97.
Good!
AFAIR pxa_gpio_mode isn't valid for the the pxa3xx, so cpu_is_pxa3xx().
>
> Support building pxa2xx-lib for several pxa chip versions by making code
> run-time selected, not only compile-time
>
> Signed-off-by: Russ Dill <russ.dill(a)gmail.com>
> ---
> include/asm-arm/arch-pxa/pxa-regs.h | 4 +-
> sound/arm/Kconfig | 2 +-
> sound/arm/pxa2xx-ac97-lib.c | 174 ++++++++++++++++------------------
> sound/soc/pxa/pxa2xx-i2s.c | 16 ++-
> 4 files changed, 95 insertions(+), 101 deletions(-)
>
--
With best wishes
Dmitry
2
1

31 Jul '08
> -----Original Message-----
> From: Russ Dill [mailto:russ.dill@gmail.com]
> Sent: Thursday, July 31, 2008 7:29 AM
> To: Dmitry
> Cc: alsa-devel(a)alsa-project.org; broonie(a)opensource.wolfsonmicro.com; Eric
> Miao
> Subject: Re: [PATCH] pxa2xx-lib: support building for several pxa's
>
> On Wed, Jul 30, 2008 at 3:41 PM, Dmitry <dbaryshkov(a)gmail.com> wrote:
> > Hi,
> >
> > 2008/7/30 Russ Dill <russ.dill(a)gmail.com>:
> >> Here's a version of the third patch in the series without all the
> >> #ifdef's. Just a quick question for Dmitry, why all the if (!
> >> cpu_is_pxa3xx())'s around the pxa_gpio_mode's? Also, there was a build
> >> error when just building the sound/arm pxa2xx-ac97.
> >
> > Good!
> >
> > AFAIR pxa_gpio_mode isn't valid for the the pxa3xx, so cpu_is_pxa3xx().
>
> I can't find any reason within the source that it wouldn't work. pxafb
> uses it, which is used by littleton and zylonite. I'm not sure when
> pxa_gpio_mode should be used vs the mfp pin config.
>
pxa_gpio_mode() is deprecated, please don't use that, even with pxa2xx
platforms. The reason some legacy pxa_gpio_mode() is still there, e.g.
pxafb, is that not all platforms have transitioned into use the new MFP
API, til then, I'll schedule a cleanup to remove all those pxa_gpio_mode,
so whenever possible, don't introduce any new pxa_gpio_mode().
P.S. the reason pxa_gpio_mode() doesn't cause any obvious consequence is
that PXA3xx no longer has those GAFR registers, but that's really going
to affect other registers, esp. the GPDR, which isn't correct.
> >>
> >> Support building pxa2xx-lib for several pxa chip versions by making code
> >> run-time selected, not only compile-time
> >>
> >> Signed-off-by: Russ Dill <russ.dill(a)gmail.com>
> >> ---
> >> include/asm-arm/arch-pxa/pxa-regs.h | 4 +-
> >> sound/arm/Kconfig | 2 +-
> >> sound/arm/pxa2xx-ac97-lib.c | 174
> ++++++++++++++++------------------
> >> sound/soc/pxa/pxa2xx-i2s.c | 16 ++-
> >> 4 files changed, 95 insertions(+), 101 deletions(-)
> >>
> > --
> > With best wishes
> > Dmitry
> >
1
0

31 Jul '08
I could not compile current git. (Error on acore/init.c)
Adding this to adriver.h fixed it for me. I'm not sure if this is the correct
general fix?
#ifndef CONFIG_SND_HAS_DEVICE_CREATE_DRVDATA
#define device_create_drvdata(c,d,m,p,s,n) device_create((c),(d),(m),(s),(n))
#endif
(My kernel 2.6.24-19-generic)
--
--
Eliot Blennerhassett
www.audioscience.com
3
3

Re: [alsa-devel] alsa-lib has anyone ever looked at taking it cross platform?
by Peter Dolding 30 Jul '08
by Peter Dolding 30 Jul '08
30 Jul '08
> Peter Dolding wrote:
>> This would kinda make logical sence.
>>
>> Alsa-lib plugin system in theory should be able to take any kind sound
>> output under it. Simplify development of all applications on top of
>> it. If alsa was cross platform why would you use something else as a
>> middle body wrapper when you port.
>>
>> Windows and Mac support could be done as plugins.
>>
>> Or is there something that is in the alsa-lib that is a problem?
>>
>> Its all about reducing distance between application and hardware and
>> reduce amount of coding.
>
> I'd rather see pulseaudio go fully cross platform. It's got some older
> windows ports but if pulse were to get a push in the right direction for
> windows and OSX then this lets alsa get on with the job of interfacing
> with the audio on linux (that's what the L stands for after all), and
> let higher level applications work with a more appropriate system with
> more appropriate interfaces for practical use.
Ok sorry to say the idea of let sound server do it is the same as
saying we will put up for every with xlib being single threaded and
have the toolkits above it deal with it. Instead of taking on the
problem. xcb is taking on the problem in the X11 stack of libs.
Except its many times worse.
Pulseaudio and all other Sound Servers since its a extra service adds
a extra point of complete sound failure to the Linux sound stack or
what ever stack they happen to be operating on top of. It more of a
hack around the limitations of the alsa framework. ALSA was really
designed to avoid the need of such extras. The existence of
Pulseaudio is really sign of failure. Reason Sound Servers existed at
first due to the failures of OSS to provide a multi application sound
support. ALSA was really designed to do away for the need of sound
servers completely. Now alsa is failing to provide per application
sound control and a sound server is back for another pass.
Now why are not alsa interfaces practical to use. It is ment to be
"Advanced Linux Sound Architecture" The complete Architecture. Not
something you have to tack bits onto because its not functional or
hard to use. Have we got to the point like xlib where the complete
alsa-lib has to be reworked for usability.
Now if you want to keep on thinking along that line has ALSA got to
the point it should be dumped like OSS has been dumped because of its
limitations?
alsa-lib to freebsd or somewhere with oss most likely could be done
really quickly since we already have a oss output option.
Its also like saying the Linux Standard Base is only used by Linux.
Its not its also used by a few non Linux's. Driver section of ALSA
most likely will always be Linux only. But the wrapper layer that
hides the hardware from the software really does not have to stay
Linux only. Alsa is going up to be part of the Linux Standard Base
its about time we all start looking at how it can be made most useful.
Provide all the features it should and work for stability.
Has anyone one attempted it or not. I guess not.
Peter Dolding
4
3

[alsa-devel] [PATCH] Permit simultaneous compilation of both PXA AC97 drivers
by Dmitry Baryshkov 30 Jul '08
by Dmitry Baryshkov 30 Jul '08
30 Jul '08
Signed-off-by: Dmitry Baryshkov <dbaryshkov(a)gmail.com>
---
sound/soc/pxa/pxa2xx-pcm.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
index 2df03ee..45ac468 100644
--- a/sound/soc/pxa/pxa2xx-pcm.c
+++ b/sound/soc/pxa/pxa2xx-pcm.c
@@ -330,7 +330,7 @@ static void pxa2xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
static u64 pxa2xx_pcm_dmamask = DMA_32BIT_MASK;
-int pxa2xx_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
+static int pxa2xx_soc_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
struct snd_pcm *pcm)
{
int ret = 0;
@@ -360,7 +360,7 @@ int pxa2xx_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
struct snd_soc_platform pxa2xx_soc_platform = {
.name = "pxa2xx-audio",
.pcm_ops = &pxa2xx_pcm_ops,
- .pcm_new = pxa2xx_pcm_new,
+ .pcm_new = pxa2xx_soc_pcm_new,
.pcm_free = pxa2xx_pcm_free_dma_buffers,
};
EXPORT_SYMBOL_GPL(pxa2xx_soc_platform);
--
1.5.6.2
5
8

[alsa-devel] [PATCH 1/1] ALSA: Fix limit of 8 PCM devices in SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE
by Pawel MOLL 30 Jul '08
by Pawel MOLL 30 Jul '08
30 Jul '08
ALSA: Fix limit of 8 PCM devices in SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE
When compiled with CONFIG_SND_DYNAMIC_MINORS the ALSA core is fine
to have more than 8 PCM devices per card, except one place - the
SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE ioctl, which will not enumerate
devices > 7. This patch fixes the issue, changing the devices list
organisation.
Instead of adding new device to the tail, the list is now kept always
ordered (by card number, then device number). Thus, during enumeration,
it is easy to discover the fact that there is no more given card's
devices. The same limit was present in OSS emulation code. It has
been fixed as well.
Additionally the device field of struct snd_pcm is now int, instead of
unsigned int, as there is no obvious reason for keeping it unsigned.
This caused a lot of problems with comparing this value with other
(almost always signed) variables. There is just one more place where
device number is unsigned - in struct snd_pcm_info, which should be
also sorted out in future.
Signed-off-by: Pawel MOLL <pawel.moll(a)st.com>
diff --git a/include/sound/minors.h b/include/sound/minors.h
index 46bcd20..a81798a 100644
--- a/include/sound/minors.h
+++ b/include/sound/minors.h
@@ -21,6 +21,8 @@
*
*/
+#define SNDRV_OS_MINORS 256
+
#define SNDRV_MINOR_DEVICES 32
#define SNDRV_MINOR_CARD(minor) ((minor) >> 5)
#define SNDRV_MINOR_DEVICE(minor) ((minor) & 0x001f)
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 51d58cc..bfc096a 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -84,8 +84,6 @@ struct snd_pcm_ops {
*
*/
-#define SNDRV_PCM_DEVICES 8
-
#define SNDRV_PCM_IOCTL1_FALSE ((void *)0)
#define SNDRV_PCM_IOCTL1_TRUE ((void *)1)
@@ -416,7 +414,7 @@ struct snd_pcm_str {
struct snd_pcm {
struct snd_card *card;
struct list_head list;
- unsigned int device; /* device number */
+ int device; /* device number */
unsigned int info_flags;
unsigned short dev_class;
unsigned short dev_subclass;
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 4c601b1..4ccd761 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -2947,7 +2947,7 @@ static void register_oss_dsp(struct snd_pcm *pcm, int index)
static int snd_pcm_oss_register_minor(struct snd_pcm *pcm)
{
pcm->oss.reg = 0;
- if (dsp_map[pcm->card->number] == (int)pcm->device) {
+ if (dsp_map[pcm->card->number] == pcm->device) {
char name[128];
int duplex;
register_oss_dsp(pcm, 0);
@@ -2963,7 +2963,7 @@ static int snd_pcm_oss_register_minor(struct snd_pcm *pcm)
pcm->oss.reg++;
pcm->oss.reg_mask |= 1;
}
- if (adsp_map[pcm->card->number] == (int)pcm->device) {
+ if (adsp_map[pcm->card->number] == pcm->device) {
register_oss_dsp(pcm, 1);
pcm->oss.reg++;
pcm->oss.reg_mask |= 2;
@@ -2988,7 +2988,7 @@ static int snd_pcm_oss_disconnect_minor(struct snd_pcm *pcm)
snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM,
pcm->card, 1);
}
- if (dsp_map[pcm->card->number] == (int)pcm->device) {
+ if (dsp_map[pcm->card->number] == pcm->device) {
#ifdef SNDRV_OSS_INFO_DEV_AUDIO
snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_AUDIO, pcm->card->number);
#endif
@@ -3019,12 +3019,12 @@ static int __init alsa_pcm_oss_init(void)
/* check device map table */
for (i = 0; i < SNDRV_CARDS; i++) {
- if (dsp_map[i] < 0 || dsp_map[i] >= SNDRV_PCM_DEVICES) {
+ if (dsp_map[i] < 0 || dsp_map[i] >= SNDRV_OS_MINORS) {
snd_printk(KERN_ERR "invalid dsp_map[%d] = %d\n",
i, dsp_map[i]);
dsp_map[i] = 0;
}
- if (adsp_map[i] < 0 || adsp_map[i] >= SNDRV_PCM_DEVICES) {
+ if (adsp_map[i] < 0 || adsp_map[i] >= SNDRV_OS_MINORS) {
snd_printk(KERN_ERR "invalid adsp_map[%d] = %d\n",
i, adsp_map[i]);
adsp_map[i] = 1;
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 9dd9bc7..df4c8a3 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -42,7 +42,7 @@ static int snd_pcm_dev_free(struct snd_device *device);
static int snd_pcm_dev_register(struct snd_device *device);
static int snd_pcm_dev_disconnect(struct snd_device *device);
-static struct snd_pcm *snd_pcm_search(struct snd_card *card, int device)
+static inline struct snd_pcm *snd_pcm_get(struct snd_card *card, int device)
{
struct snd_pcm *pcm;
@@ -53,6 +53,37 @@ static struct snd_pcm *snd_pcm_search(struct snd_card *card, int device)
return NULL;
}
+static inline int snd_pcm_next(struct snd_card *card, int device)
+{
+ struct snd_pcm *pcm;
+
+ list_for_each_entry(pcm, &snd_pcm_devices, list) {
+ if (pcm->card == card && pcm->device > device)
+ return pcm->device;
+ else if (pcm->card->number > card->number)
+ return -1;
+ }
+ return -1;
+}
+
+static inline int snd_pcm_add(struct snd_pcm *newpcm)
+{
+ struct snd_pcm *pcm;
+
+ list_for_each_entry(pcm, &snd_pcm_devices, list) {
+ if (pcm->card == newpcm->card && pcm->device == newpcm->device)
+ return -EBUSY;
+ if (pcm->card->number > newpcm->card->number ||
+ (pcm->card == newpcm->card &&
+ pcm->device > newpcm->device)) {
+ list_add(&newpcm->list, pcm->list.prev);
+ return 0;
+ }
+ }
+ list_add_tail(&newpcm->list, &snd_pcm_devices);
+ return 0;
+}
+
static int snd_pcm_control_ioctl(struct snd_card *card,
struct snd_ctl_file *control,
unsigned int cmd, unsigned long arg)
@@ -65,14 +96,7 @@ static int snd_pcm_control_ioctl(struct snd_card *card,
if (get_user(device, (int __user *)arg))
return -EFAULT;
mutex_lock(®ister_mutex);
- device = device < 0 ? 0 : device + 1;
- while (device < SNDRV_PCM_DEVICES) {
- if (snd_pcm_search(card, device))
- break;
- device++;
- }
- if (device == SNDRV_PCM_DEVICES)
- device = -1;
+ device = snd_pcm_next(card, device);
mutex_unlock(®ister_mutex);
if (put_user(device, (int __user *)arg))
return -EFAULT;
@@ -98,7 +122,7 @@ static int snd_pcm_control_ioctl(struct snd_card *card,
if (get_user(subdevice, &info->subdevice))
return -EFAULT;
mutex_lock(®ister_mutex);
- pcm = snd_pcm_search(card, device);
+ pcm = snd_pcm_get(card, device);
if (pcm == NULL) {
err = -ENXIO;
goto _error;
@@ -931,11 +955,11 @@ static int snd_pcm_dev_register(struct snd_device *device)
snd_assert(pcm != NULL && device != NULL, return -ENXIO);
mutex_lock(®ister_mutex);
- if (snd_pcm_search(pcm->card, pcm->device)) {
+ err = snd_pcm_add(pcm);
+ if (err) {
mutex_unlock(®ister_mutex);
- return -EBUSY;
+ return err;
}
- list_add_tail(&pcm->list, &snd_pcm_devices);
for (cidx = 0; cidx < 2; cidx++) {
int devtype = -1;
if (pcm->streams[cidx].substream == NULL)
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 1003ae3..838dd9e 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -34,8 +34,6 @@
#include <linux/kmod.h>
#include <linux/mutex.h>
-#define SNDRV_OS_MINORS 256
-
static int major = CONFIG_SND_MAJOR;
int snd_major;
EXPORT_SYMBOL(snd_major);
--
1.5.5.1
3
6
My hardware has four channels, each with seven identical biquads.
I'm making a custom control to handle them.
Don't I want to give then an index from 0 to 6?
Why is snd_soc_cnew() setting index to zero?
struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
void *data, char *long_name)
{
struct snd_kcontrol_new template;
memcpy(&template, _template, sizeof(template));
if (long_name)
template.name = long_name;
template.index = 0;
return snd_ctl_new1(&template, data);
}
EXPORT_SYMBOL_GPL(snd_soc_cnew);
--
Jon Smirl
jonsmirl(a)gmail.com
2
1

[alsa-devel] [PATCH v2] asoc: restrict sample rate and size in Freescale MPC8610 sound drivers
by Timur Tabi 29 Jul '08
by Timur Tabi 29 Jul '08
29 Jul '08
The Freescale MPC8610 SSI device has the option of using one clock for both
transmit and receive (synchronous mode), or independent clocks (asynchronous).
The SSI driver, however, programs the SSI into synchronous mode and then
tries to program the clock registers independently. The result is that the wrong
sample size is usually generated during recording.
This patch fixes the discrepancy by restricting the sample rate and sample size
of the playback and capture streams. The SSI driver remembers which stream
is opened first. When a second stream is opened, that stream is constrained
to the same sample rate and size as the first stream.
A future version of this driver will lift the sample size restriction.
Supporting independent sample rates is more difficult, because only certain
codecs provide dual independent clocks.
Signed-off-by: Timur Tabi <timur(a)freescale.com>
---
Please apply this patch for 2.6.26.1 and for 2.6.27-rc1. Without this patch,
recording on the MPC8610 is just plain broken, so it is a must-fix for 2.6.26.
sound/soc/fsl/fsl_dma.c | 7 ++++-
sound/soc/fsl/fsl_ssi.c | 74 ++++++++++++++++++++++++++++++++++++++++------
2 files changed, 70 insertions(+), 11 deletions(-)
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index da2bc59..7ceea2b 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -132,12 +132,17 @@ struct fsl_dma_private {
* Since each link descriptor has a 32-bit byte count field, we set
* period_bytes_max to the largest 32-bit number. We also have no maximum
* number of periods.
+ *
+ * Note that we specify SNDRV_PCM_INFO_JOINT_DUPLEX here, but only because a
+ * limitation in the SSI driver requires the sample rates for playback and
+ * capture to be the same.
*/
static const struct snd_pcm_hardware fsl_dma_hardware = {
.info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP |
- SNDRV_PCM_INFO_MMAP_VALID,
+ SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_JOINT_DUPLEX,
.formats = FSLDMA_PCM_FORMATS,
.rates = FSLDMA_PCM_RATES,
.rate_min = 5512,
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 71bff33..157a789 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -67,6 +67,8 @@
* @ssi: pointer to the SSI's registers
* @ssi_phys: physical address of the SSI registers
* @irq: IRQ of this SSI
+ * @first_stream: pointer to the stream that was opened first
+ * @second_stream: pointer to second stream
* @dev: struct device pointer
* @playback: the number of playback streams opened
* @capture: the number of capture streams opened
@@ -79,6 +81,8 @@ struct fsl_ssi_private {
struct ccsr_ssi __iomem *ssi;
dma_addr_t ssi_phys;
unsigned int irq;
+ struct snd_pcm_substream *first_stream;
+ struct snd_pcm_substream *second_stream;
struct device *dev;
unsigned int playback;
unsigned int capture;
@@ -342,6 +346,49 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream)
*/
}
+ if (!ssi_private->first_stream)
+ ssi_private->first_stream = substream;
+ else {
+ /* This is the second stream open, so we need to impose sample
+ * rate and maybe sample size constraints. Note that this can
+ * cause a race condition if the second stream is opened before
+ * the first stream is fully initialized.
+ *
+ * We provide some protection by checking to make sure the first
+ * stream is initialized, but it's not perfect. ALSA sometimes
+ * re-initializes the driver with a different sample rate or
+ * size. If the second stream is opened before the first stream
+ * has received its final parameters, then the second stream may
+ * be constrained to the wrong sample rate or size.
+ *
+ * FIXME: This code does not handle opening and closing streams
+ * repeatedly. If you open two streams and then close the first
+ * one, you may not be able to open another stream until you
+ * close the second one as well.
+ */
+ struct snd_pcm_runtime *first_runtime =
+ ssi_private->first_stream->runtime;
+
+ if (!first_runtime->rate || !first_runtime->sample_bits) {
+ dev_err(substream->pcm->card->dev,
+ "set sample rate and size in %s stream first\n",
+ substream->stream == SNDRV_PCM_STREAM_PLAYBACK
+ ? "capture" : "playback");
+ return -EAGAIN;
+ }
+
+ snd_pcm_hw_constraint_minmax(substream->runtime,
+ SNDRV_PCM_HW_PARAM_RATE,
+ first_runtime->rate, first_runtime->rate);
+
+ snd_pcm_hw_constraint_minmax(substream->runtime,
+ SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
+ first_runtime->sample_bits,
+ first_runtime->sample_bits);
+
+ ssi_private->second_stream = substream;
+ }
+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
ssi_private->playback++;
@@ -371,18 +418,16 @@ static int fsl_ssi_prepare(struct snd_pcm_substream *substream)
struct fsl_ssi_private *ssi_private = rtd->dai->cpu_dai->private_data;
struct ccsr_ssi __iomem *ssi = ssi_private->ssi;
- u32 wl;
- wl = CCSR_SSI_SxCCR_WL(snd_pcm_format_width(runtime->format));
+ if (substream == ssi_private->first_stream) {
+ u32 wl;
- clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
+ /* The SSI should always be disabled at this points (SSIEN=0) */
+ wl = CCSR_SSI_SxCCR_WL(snd_pcm_format_width(runtime->format));
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ /* In synchronous mode, the SSI uses STCCR for capture */
clrsetbits_be32(&ssi->stccr, CCSR_SSI_SxCCR_WL_MASK, wl);
- else
- clrsetbits_be32(&ssi->srccr, CCSR_SSI_SxCCR_WL_MASK, wl);
-
- setbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
+ }
return 0;
}
@@ -407,9 +452,13 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd)
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- setbits32(&ssi->scr, CCSR_SSI_SCR_TE);
+ clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
+ setbits32(&ssi->scr,
+ CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_TE);
} else {
- setbits32(&ssi->scr, CCSR_SSI_SCR_RE);
+ clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
+ setbits32(&ssi->scr,
+ CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE);
/*
* I think we need this delay to allow time for the SSI
@@ -452,6 +501,11 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream)
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
ssi_private->capture--;
+ if (ssi_private->first_stream == substream)
+ ssi_private->first_stream = ssi_private->second_stream;
+
+ ssi_private->second_stream = NULL;
+
/*
* If this is the last active substream, disable the SSI and release
* the IRQ.
--
1.5.5
2
3
ASOC: convert use of uint to unsigned int
Signed-off-by: Jon Smirl <jonsmirl(a)gmail.com>
---
include/sound/soc.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 5ca231f..a1e0357 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -527,7 +527,7 @@ struct snd_soc_pcm_runtime {
/* mixer control */
struct soc_mixer_control {
int min, max;
- uint reg, rreg, shift, rshift, invert;
+ unsigned int reg, rreg, shift, rshift, invert;
};
/* enumerated kcontrol */
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 11a881c..1563cee 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1457,8 +1457,8 @@ int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
int max = mc->max;
- uint shift = mc->min;
- uint rshift = mc->rshift;
+ unsigned int shift = mc->min;
+ unsigned int rshift = mc->rshift;
if (max == 1)
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
@@ -1487,12 +1487,12 @@ int snd_soc_get_volsw(struct snd_kcontrol *kcontrol,
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
- uint reg = mc->reg;
- uint shift = mc->shift;
- uint rshift = mc->rshift;
+ unsigned int reg = mc->reg;
+ unsigned int shift = mc->shift;
+ unsigned int rshift = mc->rshift;
int max = mc->max;
- uint mask = (1 << fls(max)) - 1;
- uint invert = mc->invert;
+ unsigned int mask = (1 << fls(max)) - 1;
+ unsigned int invert = mc->invert;
ucontrol->value.integer.value[0] =
(snd_soc_read(codec, reg) >> shift) & mask;
@@ -1526,12 +1526,12 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
- uint reg = mc->reg;
- uint shift = mc->shift;
- uint rshift = mc->rshift;
+ unsigned int reg = mc->reg;
+ unsigned int shift = mc->shift;
+ unsigned int rshift = mc->rshift;
int max = mc->max;
- uint mask = (1 << fls(max)) - 1;
- uint invert = mc->invert;
+ unsigned int mask = (1 << fls(max)) - 1;
+ unsigned int invert = mc->invert;
unsigned short val, val2, val_mask;
val = (ucontrol->value.integer.value[0] & mask);
@@ -1594,12 +1594,12 @@ int snd_soc_get_volsw_2r(struct snd_kcontrol *kcontrol,
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
- uint reg = mc->reg;
- uint reg2 = mc->rreg;
- uint shift = mc->shift;
+ unsigned int reg = mc->reg;
+ unsigned int reg2 = mc->rreg;
+ unsigned int shift = mc->shift;
int max = mc->max;
- uint mask = (1<<fls(max))-1;
- uint invert = mc->invert;
+ unsigned int mask = (1<<fls(max))-1;
+ unsigned int invert = mc->invert;
ucontrol->value.integer.value[0] =
(snd_soc_read(codec, reg) >> shift) & mask;
@@ -1631,12 +1631,12 @@ int snd_soc_put_volsw_2r(struct snd_kcontrol *kcontrol,
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
- uint reg = mc->reg;
- uint reg2 = mc->rreg;
- uint shift = mc->shift;
+ unsigned int reg = mc->reg;
+ unsigned int reg2 = mc->rreg;
+ unsigned int shift = mc->shift;
int max = mc->max;
- uint mask = (1 << fls(max)) - 1;
- uint invert = mc->invert;
+ unsigned int mask = (1 << fls(max)) - 1;
+ unsigned int invert = mc->invert;
int err;
unsigned short val, val2, val_mask;
@@ -1701,7 +1701,7 @@ int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol,
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
- uint reg = mc->reg;
+ unsigned int reg = mc->reg;
int min = mc->min;
int val = snd_soc_read(codec, reg);
@@ -1728,7 +1728,7 @@ int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol,
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
- uint reg = mc->reg;
+ unsigned int reg = mc->reg;
int min = mc->min;
unsigned short val;
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index f08be8a..7a88f76 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -106,11 +106,11 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
int val;
struct soc_mixer_control *mc = (struct soc_mixer_control *)
w->kcontrols[i].private_value;
- uint reg = mc->reg;
- uint shift = mc->shift;
+ unsigned int reg = mc->reg;
+ unsigned int shift = mc->shift;
int max = mc->max;
- uint mask = (1 << fls(max)) - 1;
- uint invert = mc->invert;
+ unsigned int mask = (1 << fls(max)) - 1;
+ unsigned int invert = mc->invert;
val = snd_soc_read(w->codec, reg);
val = (val >> shift) & mask;
@@ -252,11 +252,11 @@ static int dapm_set_pga(struct snd_soc_dapm_widget *widget, int power)
if (widget->num_kcontrols && k) {
struct soc_mixer_control *mc =
(struct soc_mixer_control *)k->private_value;
- uint reg = mc->reg;
- uint shift = mc->shift;
+ unsigned int reg = mc->reg;
+ unsigned int shift = mc->shift;
int max = mc->max;
- uint mask = (1 << fls(max)) - 1;
- uint invert = mc->invert;
+ unsigned int mask = (1 << fls(max)) - 1;
+ unsigned int invert = mc->invert;
if (power) {
int i;
@@ -1141,12 +1141,12 @@ int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol,
struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
- uint reg = mc->reg;
- uint shift = mc->shift;
- uint rshift = mc->rshift;
+ unsigned int reg = mc->reg;
+ unsigned int shift = mc->shift;
+ unsigned int rshift = mc->rshift;
int max = mc->max;
- uint invert = mc->invert;
- uint mask = (1 << fls(max)) - 1;
+ unsigned int invert = mc->invert;
+ unsigned int mask = (1 << fls(max)) - 1;
/* return the saved value if we are powered down */
if (widget->id == snd_soc_dapm_pga && !widget->power) {
@@ -1186,12 +1186,12 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
- uint reg = mc->reg;
- uint shift = mc->shift;
- uint rshift = mc->rshift;
+ unsigned int reg = mc->reg;
+ unsigned int shift = mc->shift;
+ unsigned int rshift = mc->rshift;
int max = mc->max;
- uint mask = (1 << fls(max)) - 1;
- uint invert = mc->invert;
+ unsigned int mask = (1 << fls(max)) - 1;
+ unsigned int invert = mc->invert;
unsigned short val, val2, val_mask;
int ret;
3
2

[alsa-devel] [PATCH - asihpi 1/5] split public and private defs
by linuxï¼ audioscience.com 29 Jul '08
by linuxï¼ audioscience.com 29 Jul '08
29 Jul '08
From: Eliot Blennerhassett <eblennerhassett(a)audioscience.com>
Signed-off-by: Eliot Blennerhassett <eblennerhassett(a)audioscience.com>
diff --git a/pci/asihpi/hpi.h b/pci/asihpi/hpi.h
index 4f52d09..1892271 100644
--- a/pci/asihpi/hpi.h
+++ b/pci/asihpi/hpi.h
@@ -21,9 +21,7 @@
AudioScience digital audio adapters
You must define one operating systems that the HPI is to be compiled under
- HPI_OS_WIN16 16bit Windows
HPI_OS_WIN32_USER 32bit Windows
- HPI_OS_DSP_563XX DSP563XX environment
HPI_OS_DSP_C6000 DSP TI C6000 environment
HPI_OS_WDM Windows WDM kernel driver
HPI_OS_LINUX Linux kernel driver
@@ -32,7 +30,6 @@
******************************************************************************/
#ifndef _HPI_H_
#define _HPI_H_
-
/* HPI Version
If HPI_VER_MINOR is odd then its a development release not intended for the
public. If HPI_VER_MINOR is even then is a release version
@@ -46,79 +43,10 @@ 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(3L, 10, 3)
-
-#ifdef _DOX_ONLY_
-/*****************************************************************************/
-/** \defgroup compile_time_defines HPI compile time defines
-
-This section descibes the usage of HPI defines to set the target compile
-environment.
-The definitions are used in the build environment to control how HPI is built.
-They are NOT predefined in hpi.h!
-\{
-*/
-/** \defgroup os_type_defines HPI_OS_XXX build environment defines
-
-Define exactly one of these depending on which OS you are compiling for.
-Should we also include DSP_53XXX, C6000, WDM etc?
-
-\{
-*/
-/**Define when creating a 16 bit Windows user application. */
-#define HPI_OS_WIN16
-/** Define when creating a 32 bit Windows user application. */
-#define HPI_OS_WIN32_USER
-/** Define when creating a Linux application.*/
-#define HPI_OS_LINUX
-/* Should we also include DSP_53XXX, C6000, WDM etc? */
-/**\}*/
-/** \def HPI64BIT
-Define this when building a 64 bit application.
-When not defined a 32 bit environment will be assumed.
-Currently only supported under Linux (autodetected).
-*/
-#define HPI64BIT
-
-/** Define this to remove public definition of deprecated functions and defines.
-Use this to reveal where the deprecated functionality is used
-*/
-#define HPI_EXCLUDE_DEPRECATED
-/** \defgroup hpi_dll_defines HPI DLL function attributes
-DLL environment defines.
-\{
-*/
-/** Define when building an application that links to ASIHPI32.LIB
- (imports HPI functions from ASIHPI32.DLL). */
-#define HPIDLL_IMPORTS
-/** Define when creating an application that uses the HPI DLL. */
-#define HPIDLL_EXPORTS
-/** Define when building an application that compiles in
- HPIFUNC.C and does not use ASIHPI32.DLL */
-#define HPIDLL_STATIC
-/**\}*/
+#define HPI_VER HPI_VERSION_CONSTRUCTOR(3L, 11, 9)
-/** \defgroup hpi_dspcode_defines HPI DSP code loading method
-Define exactly one of these to select how the DSP code is supplied to
-the adapter.
-
-End users writing applications that use the HPI interface do not have to
-use any of the below defines.
-They are only necessary for building drivers and 16 bit Windows applications.
-\{
-*/
-/** DSP code is supplied as a series of arrays that are linked into
- the driver/application. Only valid when \ref HPI_OS_WIN16 is defined. */
-#define HPI_DSPCODE_ARRAY
-/** DSP code is supplied as a file that is opened and read from by the driver.*/
-#define HPI_DSPCODE_FILE
-/** DSP code is read using the hotplug firmware loader module.
- Only valid when compiling the HPI kernel driver under Linux. */
-#define HPI_DSPCODE_FIRMWARE
-/**\}*/
-/**\}*/
-/*****************************************************************************/
-#endif /* #ifdef _DOX_ONLY_ */
+/* Library version as documented in hpi-api-versions.txt */
+#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(3, 3, 0)
#ifdef __cplusplus
/* *INDENT-OFF* */
@@ -126,26 +54,7 @@ extern "C" {
/* *INDENT-ON* */
#endif
-/** maximum number of memory regions mapped to an adapter */
-#define HPI_MAX_ADAPTER_MEM_SPACES (2)
-
-#include "hpios.h"
-
-/* A few convenience macros */
-#ifndef DEPRECATED
-#define DEPRECATED
-#endif
-
-#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(A) (sizeof(A)/sizeof((A)[0]))
-#endif
-
-#ifndef __stringify
-#define __stringify_1(x) #x
-#define __stringify(x) __stringify_1(x)
-#endif
-
-#define HPI_UNUSED(param) (void)param
+#include <linux/types.h>
/******************************************************************************/
/******************************************************************************/
@@ -153,10 +62,6 @@ extern "C" {
/******************************************************************************/
/******************************************************************************/
-/* //////////////////////////////////////////////////////////////////////// */
-/* BASIC TYPES */
-/* u8, u16, u32 MUST BE DEFINED IN HPIOS_xxx.H */
-
/* ////////////////////////////////////////////////////////////////////// */
/** \addtogroup hpi_defines HPI constant definitions
\{
@@ -557,20 +462,21 @@ The range is +1.0 to -1.0, which corresponds to digital fullscale.
*/
#define HPI_SOURCENODE_BASE 100
/** Out Stream (Play) node. */
-#define HPI_SOURCENODE_OSTREAM 101
-#define HPI_SOURCENODE_LINEIN 102 /**< Line in node. */
+#define HPI_SOURCENODE_OSTREAM 101
+/** Line in node - could be analog. AES/EBU or network. */
+#define HPI_SOURCENODE_LINEIN 102
#define HPI_SOURCENODE_AESEBU_IN 103 /**< AES/EBU input node. */
#define HPI_SOURCENODE_TUNER 104 /**< Tuner node. */
-#define HPI_SOURCENODE_RF 105 /**< RF input node. */
-#define HPI_SOURCENODE_CLOCK_SOURCE 106 /**< Clock source node. */
-#define HPI_SOURCENODE_RAW_BITSTREAM 107 /**< Raw bitstream node. */
-#define HPI_SOURCENODE_MICROPHONE 108 /**< Microphone node. */
+#define HPI_SOURCENODE_RF 105 /**< RF input node. */
+#define HPI_SOURCENODE_CLOCK_SOURCE 106 /**< Clock source node. */
+#define HPI_SOURCENODE_RAW_BITSTREAM 107 /**< Raw bitstream node. */
+#define HPI_SOURCENODE_MICROPHONE 108 /**< Microphone node. */
/** Cobranet input node.
Audio samples come from the Cobranet network and into the device. */
-#define HPI_SOURCENODE_COBRANET 109
-/*! Update this if you add a new sourcenode type, AND hpidebug.h */
-#define HPI_SOURCENODE_LAST_INDEX 109
-/* AX4 max sourcenode type = 15 */
+#define HPI_SOURCENODE_COBRANET 109
+#define HPI_SOURCENODE_ANALOG 110 /**< Analog input node. */
+/* Update this if you add a new sourcenode type, AND hpidebug.h */
+#define HPI_SOURCENODE_LAST_INDEX 110
/* AX6 max sourcenode type = 15 */
/**\}*/
@@ -578,19 +484,19 @@ The range is +1.0 to -1.0, which corresponds to digital fullscale.
/** \defgroup dest_nodes Destination node types
\{
*/
-#define HPI_DESTNODE_BASE 200
+#define HPI_DESTNODE_BASE 200
/** In Stream (Record) node. */
#define HPI_DESTNODE_ISTREAM 201
#define HPI_DESTNODE_LINEOUT 202 /**< Line Out node. */
-#define HPI_DESTNODE_AESEBU_OUT 203 /**< AES/EBU output node. */
-#define HPI_DESTNODE_RF 204 /**< RF output node. */
+#define HPI_DESTNODE_AESEBU_OUT 203 /**< AES/EBU output node. */
+#define HPI_DESTNODE_RF 204 /**< RF output node. */
#define HPI_DESTNODE_SPEAKER 205 /**< Speaker output node. */
/** Cobranet output node.
Audio samples from the device are sent out on the Cobranet network.*/
#define HPI_DESTNODE_COBRANET 206
+#define HPI_DESTNODE_ANALOG 207 /**< Analog output node. */
/*! Update this if you add a new destnode type. , AND hpidebug.h */
-#define HPI_DESTNODE_LAST_INDEX 206
-/* AX4 max destnode type = 7 */
+#define HPI_DESTNODE_LAST_INDEX 207
/* AX6 max destnode type = 15 */
/**\}*/
@@ -610,9 +516,9 @@ Audio samples from the device are sent out on the Cobranet network.*/
#define HPI_CONTROL_TUNER 9 /**< Tuner control. */
/*#define HPI_CONTROL_ONOFFSWITCH 10 */
#define HPI_CONTROL_VOX 11 /**< Vox control. */
-#define HPI_CONTROL_AES18_TRANSMITTER 12 /**< AES-18 transmitter control. */
-#define HPI_CONTROL_AES18_RECEIVER 13 /**< AES-18 receiver control. */
-#define HPI_CONTROL_AES18_BLOCKGENERATOR 14 /**< AES-18 block generator control. */
+/* #define HPI_CONTROL_AES18_TRANSMITTER 12 */
+/* #define HPI_CONTROL_AES18_RECEIVER 13 */
+/* #define HPI_CONTROL_AES18_BLOCKGENERATOR 14 */
#define HPI_CONTROL_CHANNEL_MODE 15 /**< Channel mode control. */
/* WARNING types 16 or greater impact bit packing in
@@ -844,18 +750,6 @@ when the number of channels is set to 1 will return an error.
#define HPI_MPEG_MODE_DUALCHANNEL (3)
/** \} */
-/* Locked memory buffer alloc/free phases */
-/** use one message to allocate or free physical memory */
-#define HPI_BUFFER_CMD_EXTERNAL 0
-/** alloc physical memory */
-#define HPI_BUFFER_CMD_INTERNAL_ALLOC 1
-/** send physical memory address to adapter */
-#define HPI_BUFFER_CMD_INTERNAL_GRANTADAPTER 2
-/** notify adapter to stop using physical buffer */
-#define HPI_BUFFER_CMD_INTERNAL_REVOKEADAPTER 3
-/** free physical buffer */
-#define HPI_BUFFER_CMD_INTERNAL_FREE 4
-
/******************************************* MIXER ATTRIBUTES ****/
/* \defgroup mixer_flags Mixer flags for HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES
@@ -882,56 +776,11 @@ enum HPI_MIXER_STORE_COMMAND {
HPI_MIXER_STORE_SAVE_SINGLE = 6
};
-/******************************************* CONTROL ATTRIBUTES ****/
-/* (in order of control type ID as above */
-
-/* This allows for 255 control types, 256 unique attributes each */
-#define HPI_CTL_ATTR(ctl, ai) (HPI_CONTROL_##ctl * 0x100 + ai)
-
-/* Get the sub-index of the attribute for a control type */
-#define HPI_CTL_ATTR_INDEX(i) (i&0xff)
-
-/* Original 0-based non-unique attributes, might become unique later */
-#define HPI_CTL_ATTR0(ctl, ai) (ai)
-
-/* Generic control attributes. If a control uses any of these attributes
- its other attributes must also be defined using HPI_CTL_ATTR()
-*/
-
-/** Enable a control.
-0=disable, 1=enable
-\note generic to all mixer plugins?
-*/
-#define HPI_GENERIC_ENABLE HPI_CTL_ATTR(GENERIC, 1)
-
-/** Enable event generation for a control.
-0=disable, 1=enable
-\note generic to all controls that can generate events
-*/
-#define HPI_GENERIC_EVENT_ENABLE HPI_CTL_ATTR(GENERIC, 2)
-
+/************************************* CONTROL ATTRIBUTE VALUES ****/
/* Used by mixer plugin enable functions */
#define HPI_SWITCH_OFF 0 /**< Turn the mixer plugin on. */
#define HPI_SWITCH_ON 1 /**< Turn the mixer plugin off. */
-/* Volume Control attributes */
-#define HPI_VOLUME_GAIN HPI_CTL_ATTR0(VOLUME, 1)
-/** log fade - dB attenuation changes linearly over time */
-#define HPI_VOLUME_AUTOFADE_LOG HPI_CTL_ATTR0(VOLUME, 2)
-#define HPI_VOLUME_AUTOFADE HPI_VOLUME_AUTOFADE_LOG
-/** linear fade - amplitude changes linearly */
-#define HPI_VOLUME_AUTOFADE_LINEAR HPI_CTL_ATTR0(VOLUME, 3)
-/** Not implemented yet -may be special profiles */
-#define HPI_VOLUME_AUTOFADE_1 HPI_CTL_ATTR0(VOLUME, 4)
-#define HPI_VOLUME_AUTOFADE_2 HPI_CTL_ATTR0(VOLUME, 5)
-/** For HPI_ControlQuery() to get the number of channels of a volume control*/
-#define HPI_VOLUME_NUM_CHANNELS HPI_CTL_ATTR0(VOLUME, 6)
-#define HPI_VOLUME_RANGE HPI_CTL_ATTR0(VOLUME, 10)
-
-/** Level Control attributes */
-#define HPI_LEVEL_GAIN HPI_CTL_ATTR0(LEVEL, 1)
-#define HPI_LEVEL_RANGE HPI_CTL_ATTR0(LEVEL, 10)
-
/* Volume control special gain values */
/** volumes units are 100ths of a dB */
#define HPI_UNITS_PER_dB 100
@@ -940,42 +789,11 @@ enum HPI_MIXER_STORE_COMMAND {
/** value returned for no signal */
#define HPI_METER_MINIMUM (-150 * HPI_UNITS_PER_dB)
-/* Meter Control attributes */
-/** return RMS signal level */
-#define HPI_METER_RMS HPI_CTL_ATTR0(METER, 1)
-/** return peak signal level */
-#define HPI_METER_PEAK HPI_CTL_ATTR0(METER, 2)
-/** ballistics for ALL rms meters on adapter */
-#define HPI_METER_RMS_BALLISTICS HPI_CTL_ATTR0(METER, 3)
-/** ballistics for ALL peak meters on adapter */
-#define HPI_METER_PEAK_BALLISTICS HPI_CTL_ATTR0(METER, 4)
-/** For HPI_ControlQuery() to get the number of channels of a meter control*/
-#define HPI_METER_NUM_CHANNELS HPI_CTL_ATTR0(METER, 5)
-
-/* Multiplexer control attributes */
-#define HPI_MULTIPLEXER_SOURCE HPI_CTL_ATTR0(MULTIPLEXER, 1)
-#define HPI_MULTIPLEXER_QUERYSOURCE HPI_CTL_ATTR0(MULTIPLEXER, 2)
-
-/** AES/EBU transmitter control attributes */
-/** AESEBU or SPDIF */
-#define HPI_AESEBUTX_FORMAT HPI_CTL_ATTR0(AESEBUTX, 1)
-#define HPI_AESEBUTX_SAMPLERATE HPI_CTL_ATTR0(AESEBUTX, 3)
-#define HPI_AESEBUTX_CHANNELSTATUS HPI_CTL_ATTR0(AESEBUTX, 4)
-#define HPI_AESEBUTX_USERDATA HPI_CTL_ATTR0(AESEBUTX, 5)
-
-/** AES/EBU receiver control attributes */
-#define HPI_AESEBURX_FORMAT HPI_CTL_ATTR0(AESEBURX, 1)
-#define HPI_AESEBURX_ERRORSTATUS HPI_CTL_ATTR0(AESEBURX, 2)
-#define HPI_AESEBURX_SAMPLERATE HPI_CTL_ATTR0(AESEBURX, 3)
-#define HPI_AESEBURX_CHANNELSTATUS HPI_CTL_ATTR0(AESEBURX, 4)
-#define HPI_AESEBURX_USERDATA HPI_CTL_ATTR0(AESEBURX, 5)
-
-/* NOTE: old defs only make sense when rx & tx not unique */
-#define HPI_AESEBU_FORMAT 1
-#define HPI_AESEBU_ERRORSTATUS 2
-#define HPI_AESEBU_SAMPLERATE 3
-#define HPI_AESEBU_CHANNELSTATUS 4
-#define HPI_AESEBU_USERDATA 5
+/* autofade profiles */
+/** log fade - dB attenuation changes linearly over time */
+#define HPI_VOLUME_AUTOFADE_LOG 2
+/** linear fade - amplitude changes linearly */
+#define HPI_VOLUME_AUTOFADE_LINEAR 3
/** AES/EBU physical format - AES/EBU balanced "professional" */
#define HPI_AESEBU_FORMAT_AESEBU 1
@@ -1000,64 +818,24 @@ enum HPI_MIXER_STORE_COMMAND {
/** \defgroup tuner_defs Tuners
\{
*/
-/** \defgroup tuner_attrs Tuner control attributes
-\{
-*/
-#define HPI_TUNER_BAND HPI_CTL_ATTR0(TUNER, 1)
-#define HPI_TUNER_FREQ HPI_CTL_ATTR0(TUNER, 2)
-#define HPI_TUNER_LEVEL HPI_CTL_ATTR0(TUNER, 3)
-#define HPI_TUNER_AUDIOMUTE HPI_CTL_ATTR0(TUNER, 4)
-/* use TUNER_STATUS instead */
-#define HPI_TUNER_VIDEO_STATUS HPI_CTL_ATTR0(TUNER, 5)
-#define HPI_TUNER_GAIN HPI_CTL_ATTR0(TUNER, 6)
-#define HPI_TUNER_STATUS HPI_CTL_ATTR0(TUNER, 7)
-#define HPI_TUNER_MODE HPI_CTL_ATTR0(TUNER, 8)
-/** RDS data. */
-#define HPI_TUNER_RDS HPI_CTL_ATTR0(TUNER, 9)
-/** Audio pre-emphasis. */
-#define HPI_TUNER_DEEMPHASIS HPI_CTL_ATTR(TUNER, 10)
-/** HD-Radio tuner program control. */
-#define HPI_TUNER_PROGRAM HPI_CTL_ATTR(TUNER, 11)
-/** HD-Radio tuner digital signal quality. */
-#define HPI_TUNER_HDRADIO_SIGNAL_QUALITY HPI_CTL_ATTR(TUNER, 12)
-/** HD-Radio SDK firmware version. */
-#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)
-/** \} */
/** \defgroup pads_attrs Tuner PADs control attributes
\{
*/
/** The text string containing the station/channel combination. */
-#define HPI_PAD_CHANNEL_NAME HPI_CTL_ATTR(PAD, 1)
#define HPI_PAD_CHANNEL_NAME_LEN 16
/** The text string containing the artist. */
-#define HPI_PAD_ARTIST HPI_CTL_ATTR(PAD, 2)
#define HPI_PAD_ARTIST_LEN 64
/** The text string containing the title. */
-#define HPI_PAD_TITLE HPI_CTL_ATTR(PAD, 3)
#define HPI_PAD_TITLE_LEN 64
/** The text string containing the comment. */
-#define HPI_PAD_COMMENT HPI_CTL_ATTR(PAD, 4)
#define HPI_PAD_COMMENT_LEN 256
-/** The integer containing the PTY code. */
-#define HPI_PAD_PROGRAM_TYPE HPI_CTL_ATTR(PAD, 5)
-/** The integer containing the program identification. */
-#define HPI_PAD_PROGRAM_ID HPI_CTL_ATTR(PAD, 6)
-/** The integer containing whether traffic information is supported.
-Contains either 1 or 0. */
-#define HPI_PAD_TA_SUPPORT HPI_CTL_ATTR(PAD, 7)
-/** The integer containing whether traffic announcement is in progress.
-Contains either 1 or 0. */
-#define HPI_PAD_TA_ACTIVE HPI_CTL_ATTR(PAD, 8)
/** Data types for PTY string translation.
*/
enum eHPI_RDS_type {
- HPI_RDS_DATATYPE_RDS = 0, /**< RDS bitstream. */
- HPI_RDS_DATATYPE_RDBS = 1, /**< RDBS bitstream. */
- HPI_RDS_DATATYPE_FUTURE = 2 /**< Future bitstream. */
+ HPI_RDS_DATATYPE_RDS = 0, /**< RDS bitstream.*/
+ HPI_RDS_DATATYPE_RBDS = 1 /**< RBDS bitstream.*/
};
/** \} */
@@ -1107,12 +885,6 @@ Multiple fields are returned from a single call.
/** \} */
/** \} */
-/* VOX control attributes */
-#define HPI_VOX_THRESHOLD HPI_CTL_ATTR0(VOX, 1)
-
-/*?? channel mode used hpi_multiplexer_source attribute == 1 */
-#define HPI_CHANNEL_MODE_MODE HPI_CTL_ATTR0(CHANNEL_MODE, 1)
-
/** \defgroup channel_modes Channel Modes
Used for HPI_ChannelModeSet/Get()
\{
@@ -1134,29 +906,6 @@ Used for HPI_ChannelModeSet/Get()
#define HPI_CHANNEL_MODE_LAST 6
/** \} */
-/* Bitstream control set attributes */
-#define HPI_BITSTREAM_DATA_POLARITY HPI_CTL_ATTR0(BITSTREAM, 1)
-#define HPI_BITSTREAM_CLOCK_EDGE HPI_CTL_ATTR0(BITSTREAM, 2)
-#define HPI_BITSTREAM_CLOCK_SOURCE HPI_CTL_ATTR0(BITSTREAM, 3)
-
-#define HPI_POLARITY_POSITIVE 0
-#define HPI_POLARITY_NEGATIVE 1
-
-/*
-Currently fixed at EXTERNAL
-#define HPI_SOURCE_EXTERNAL 0
-#define HPI_SOURCE_INTERNAL 1
-*/
-
-/* Bitstream control get attributes */
-#define HPI_BITSTREAM_ACTIVITY 1
-
-/* SampleClock control attributes */
-#define HPI_SAMPLECLOCK_SOURCE HPI_CTL_ATTR0(SAMPLECLOCK, 1)
-#define HPI_SAMPLECLOCK_SAMPLERATE HPI_CTL_ATTR0(SAMPLECLOCK, 2)
-#define HPI_SAMPLECLOCK_SOURCE_INDEX HPI_CTL_ATTR0(SAMPLECLOCK, 3)
-#define HPI_SAMPLECLOCK_LOCAL_SAMPLERATE HPI_CTL_ATTR0(SAMPLECLOCK, 4)
-
/** \defgroup sampleclock_source SampleClock source values
\{
*/
@@ -1175,7 +924,9 @@ Currently fixed at EXTERNAL
#define HPI_SAMPLECLOCK_SOURCE_SMPTE 5
/** One of the aesebu inputs */
#define HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT 6
-/** The first aesebu input with a valid signal */
+/** \deprecated The first aesebu input with a valid signal
+Superseded by separate Auto enable flag
+*/
#define HPI_SAMPLECLOCK_SOURCE_AESEBU_AUTO 7
/** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */
#define HPI_SAMPLECLOCK_SOURCE_NETWORK 8
@@ -1185,18 +936,6 @@ Currently fixed at EXTERNAL
#define HPI_SAMPLECLOCK_SOURCE_LAST 10
/** \} */
-/* Microphone control attributes */
-#define HPI_MICROPHONE_PHANTOM_POWER HPI_CTL_ATTR0(MICROPHONE, 1)
-
-/** Equalizer control attributes
-*/
-/** Used to get number of filters in an EQ. (Can't set) */
-#define HPI_EQUALIZER_NUM_FILTERS HPI_CTL_ATTR0(EQUALIZER, 1)
-/** Set/get the filter by type, freq, Q, gain */
-#define HPI_EQUALIZER_FILTER HPI_CTL_ATTR0(EQUALIZER, 2)
-/** Get the biquad coefficients */
-#define HPI_EQUALIZER_COEFFICIENTS HPI_CTL_ATTR0(EQUALIZER, 3)
-
/** Equalizer filter types. Used by HPI_ParametricEQ_SetBand() */
enum HPI_FILTER_TYPE {
HPI_FILTER_TYPE_BYPASS = 0, /**< Filter is turned off */
@@ -1211,129 +950,6 @@ enum HPI_FILTER_TYPE {
HPI_FILTER_TYPE_BANDSTOP = 7 /**< Standard band stop/notch */
};
-#define HPI_COMPANDER_PARAMS HPI_CTL_ATTR(COMPANDER, 1)
-
-/* Cobranet control attributes.
- MUST be distinct from all other control attributes.
- This is so that host side processing can easily identify a Cobranet control
- and apply additional host side operations (like copying data) as required.
-*/
-#define HPI_COBRANET_SET HPI_CTL_ATTR(COBRANET, 1)
-#define HPI_COBRANET_GET HPI_CTL_ATTR(COBRANET, 2)
-#define HPI_COBRANET_SET_DATA HPI_CTL_ATTR(COBRANET, 3)
-#define HPI_COBRANET_GET_DATA HPI_CTL_ATTR(COBRANET, 4)
-#define HPI_COBRANET_GET_STATUS HPI_CTL_ATTR(COBRANET, 5)
-#define HPI_COBRANET_SEND_PACKET HPI_CTL_ATTR(COBRANET, 6)
-#define HPI_COBRANET_GET_PACKET HPI_CTL_ATTR(COBRANET, 7)
-
-/*------------------------------------------------------------
- Cobranet Chip Bridge - copied from HMI.H
-------------------------------------------------------------*/
-#define HPI_COBRANET_HMI_cobraBridge 0x20000
-#define HPI_COBRANET_HMI_cobraBridgeTxPktBuf \
- (HPI_COBRANET_HMI_cobraBridge + 0x1000)
-#define HPI_COBRANET_HMI_cobraBridgeRxPktBuf \
- (HPI_COBRANET_HMI_cobraBridge + 0x2000)
-#define HPI_COBRANET_HMI_cobraIfTable1 0x110000
-#define HPI_COBRANET_HMI_cobraIfPhyAddress \
- (HPI_COBRANET_HMI_cobraIfTable1 + 0xd)
-#define HPI_COBRANET_HMI_cobraProtocolIP 0x72000
-#define HPI_COBRANET_HMI_cobraIpMonCurrentIP \
- (HPI_COBRANET_HMI_cobraProtocolIP + 0x0)
-#define HPI_COBRANET_HMI_cobraIpMonStaticIP \
- (HPI_COBRANET_HMI_cobraProtocolIP + 0x2)
-#define HPI_COBRANET_HMI_cobraSys 0x100000
-#define HPI_COBRANET_HMI_cobraSysDesc \
- (HPI_COBRANET_HMI_cobraSys + 0x0)
-#define HPI_COBRANET_HMI_cobraSysObjectID \
- (HPI_COBRANET_HMI_cobraSys + 0x100)
-#define HPI_COBRANET_HMI_cobraSysContact \
- (HPI_COBRANET_HMI_cobraSys + 0x200)
-#define HPI_COBRANET_HMI_cobraSysName \
- (HPI_COBRANET_HMI_cobraSys + 0x300)
-#define HPI_COBRANET_HMI_cobraSysLocation \
- (HPI_COBRANET_HMI_cobraSys + 0x400)
-
-/*------------------------------------------------------------
- Cobranet Chip Status bits
-------------------------------------------------------------*/
-#define HPI_COBRANET_HMI_STATUS_RXPACKET 2
-#define HPI_COBRANET_HMI_STATUS_TXPACKET 3
-
-/*------------------------------------------------------------
- Ethernet header size
-------------------------------------------------------------*/
-#define HPI_ETHERNET_HEADER_SIZE (16)
-
-/* These defines are used to fill in protocol information for an Ethernet packet
- sent using HMI on CS18102 */
-/** ID supplied by Cirrius for ASI packets. */
-#define HPI_ETHERNET_PACKET_ID 0x85
-/** Simple packet - no special routing required */
-#define HPI_ETHERNET_PACKET_V1 0x01
-/** This packet must make its way to the host across the HPI interface */
-#define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI 0x20
-/** This packet must make its way to the host across the HPI interface */
-#define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI_V1 0x21
-/** This packet must make its way to the host across the HPI interface */
-#define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI 0x40
-/** This packet must make its way to the host across the HPI interface */
-#define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI_V1 0x41
-
-#define HPI_ETHERNET_UDP_PORT (44600) /*!< UDP messaging port */
-
-/** Base network time out is set to 100 milli-seconds. */
-#define HPI_ETHERNET_TIMEOUT_MS (100)
-
-/** \defgroup tonedet_attr Tonedetector attributes
-\{
-Used by HPI_ToneDetector_Set() and HPI_ToneDetector_Get()
-*/
-
-/** Set the threshold level of a tonedetector,
-Threshold is a -ve number in units of dB/100,
-*/
-#define HPI_TONEDETECTOR_THRESHOLD HPI_CTL_ATTR(TONEDETECTOR, 1)
-
-/** Get the current state of tonedetection
-The result is a bitmap of detected tones. pairs of bits represent the left
-and right channels, with left channel in LSB.
-The lowest frequency detector state is in the LSB
-*/
-#define HPI_TONEDETECTOR_STATE HPI_CTL_ATTR(TONEDETECTOR, 2)
-
-/** Get the frequency of a tonedetector band.
-*/
-#define HPI_TONEDETECTOR_FREQUENCY HPI_CTL_ATTR(TONEDETECTOR, 3)
-
-/**\}*/
-
-/** \defgroup silencedet_attr SilenceDetector attributes
-\{
-*/
-
-/** Get the current state of tonedetection
-The result is a bitmap with 1s for silent channels. Left channel is in LSB
-*/
-#define HPI_SILENCEDETECTOR_STATE \
- HPI_CTL_ATTR(SILENCEDETECTOR, 2)
-
-/** Set the threshold level of a SilenceDetector,
-Threshold is a -ve number in units of dB/100,
-*/
-#define HPI_SILENCEDETECTOR_THRESHOLD \
- HPI_CTL_ATTR(SILENCEDETECTOR, 1)
-
-/** get/set the silence time before the detector triggers
-*/
-#define HPI_SILENCEDETECTOR_DELAY \
- HPI_CTL_ATTR(SILENCEDETECTOR, 3)
-
-/**\}*/
-
-/******************************************* CONTROLX ATTRIBUTES ****/
-/* NOTE: All controlx attributes must be unique, unlike control attributes */
-/******************************************* ASYNC ATTRIBUTES ****/
/** \defgroup async_event Async Event sources
\{
*/
@@ -1505,6 +1121,8 @@ to ASI if further capabilities updates are required */
#define HPI_ERROR_I2C_MISSING_ACK HPI_ERROR_CONTROL_I2C_MISSING_ACK
#define HPI_ERROR_I2C_BAD_ADR 460
+/* AES18 specific errors were 500..507 */
+
/** custom error to use for debugging */
#define HPI_ERROR_CUSTOM 600
@@ -1565,17 +1183,6 @@ struct hpi_anc_frame {
u8 bData[HPI_MAX_ANC_BYTES_PER_FRAME];
};
-struct hpi_punchinout {
- u32 dwPunchInSample;
- u32 dwPunchOutSample;
-};
-
-struct hpi_streamid {
- u16 wObjectType;
- /**< Type of object, HPI_OBJ_OSTREAM or HPI_OBJ_ISTREAM. */
- u16 wStreamIndex; /**< OStream or IStream index. */
-};
-
/** An object for containing a single async event.
*/
struct hpi_async_event {
@@ -1847,7 +1454,7 @@ u16 HPI_GpioReadBit(
u16 HPI_GpioReadAllBits(
struct hpi_hsubsys *phSubSys,
u32 hGpio,
- u16 *pwBitData
+ u16 *pwAllBitData
);
u16 HPI_GpioWriteBit(
@@ -1857,6 +1464,12 @@ u16 HPI_GpioWriteBit(
u16 wBitData
);
+u16 HPI_GpioWriteStatus(
+ struct hpi_hsubsys *phSubSys,
+ u32 hGpio,
+ u16 *pwAllBitData
+);
+
/**********************/
/* Async Event Object */
/**********************/
@@ -2195,41 +1808,6 @@ u16 HPI_MixerStore(
/*************************/
/* mixer CONTROLS */
/*************************/
-
-/* Generic query of available control settings */
-u16 HPI_ControlQuery(
- const struct hpi_hsubsys *phSubSys,
- const u32 hControl,
- const u16 wAttrib,
- const u32 dwIndex,
- const u32 dwParam,
- u32 *pdwSetting
-);
-
-#ifndef SWIG
-/* Generic setting of control attribute value */
-u16 HPI_ControlParamSet(
- const struct hpi_hsubsys *phSubSys,
- const u32 hControl,
- const u16 wAttrib,
- const u32 dwParam1,
- const u32 dwParam2
-);
-
-/* generic getting of control attribute value.
- Null pointers allowed for return values
-*/
-u16 HPI_ControlParamGet(
- const struct hpi_hsubsys *phSubSys,
- const u32 hControl,
- const u16 wAttrib,
- u32 dwParam1,
- u32 dwParam2,
- u32 *pdwParam1,
- u32 *pdwParam2
-);
-#endif
-
/*************************/
/* volume control */
/*************************/
@@ -2254,6 +1832,12 @@ u16 HPI_VolumeQueryRange(
short *nStepGain_01dB
);
+u16 HPI_Volume_QueryChannels(
+ const struct hpi_hsubsys *phSubSys,
+ const u32 hVolume,
+ u32 *pChannels
+);
+
u16 HPI_VolumeAutoFade(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2270,8 +1854,16 @@ u16 HPI_VolumeAutoFadeProfile(
);
/*************************/
-/* level control */
+/* level control */
/*************************/
+u16 HPI_LevelQueryRange(
+ struct hpi_hsubsys *phSubSys,
+ u32 hControl,
+ short *nMinGain_01dB,
+ short *nMaxGain_01dB,
+ short *nStepGain_01dB
+);
+
u16 HPI_LevelSetGain(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2287,6 +1879,12 @@ u16 HPI_LevelGetGain(
/*************************/
/* meter control */
/*************************/
+u16 HPI_Meter_QueryChannels(
+ const struct hpi_hsubsys *phSubSys,
+ const u32 hMeter,
+ u32 *pChannels
+);
+
u16 HPI_MeterGetPeak(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2330,6 +1928,13 @@ u16 HPI_MeterGetRmsBallistics(
/*************************/
/* channel mode control */
/*************************/
+u16 HPI_ChannelMode_QueryMode(
+ const struct hpi_hsubsys *phSubSys,
+ const u32 hMode,
+ const u32 dwIndex,
+ u16 *pwMode
+);
+
u16 HPI_ChannelModeSet(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2345,6 +1950,13 @@ u16 HPI_ChannelModeGet(
/*************************/
/* Tuner control */
/*************************/
+u16 HPI_Tuner_QueryBand(
+ const struct hpi_hsubsys *phSubSys,
+ const u32 hTuner,
+ const u32 dwIndex,
+ u16 *pwBand
+);
+
u16 HPI_Tuner_SetBand(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2357,6 +1969,14 @@ u16 HPI_Tuner_GetBand(
u16 *pwBand
);
+u16 HPI_Tuner_QueryFrequency(
+ const struct hpi_hsubsys *phSubSys,
+ const u32 hTuner,
+ const u32 dwIndex,
+ const u16 band,
+ u32 *pdwFreq
+);
+
u16 HPI_Tuner_SetFrequency(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2381,6 +2001,13 @@ u16 HPI_Tuner_GetRawRFLevel(
short *pwLevel
);
+u16 HPI_Tuner_QueryGain(
+ const struct hpi_hsubsys *phSubSys,
+ const u32 hTuner,
+ const u32 dwIndex,
+ u16 *pwGain
+);
+
u16 HPI_Tuner_SetGain(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2419,6 +2046,15 @@ u16 HPI_Tuner_GetRDS(
u32 hControl,
char *pRdsData
);
+
+u16 HPI_Tuner_QueryDeemphasis(
+ const struct hpi_hsubsys *phSubSys,
+ const u32 hTuner,
+ const u32 dwIndex,
+ const u16 band,
+ u32 *pdwDeemphasis
+);
+
u16 HPI_Tuner_SetDeemphasis(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2429,22 +2065,32 @@ u16 HPI_Tuner_GetDeemphasis(
u32 hControl,
u32 *pdwDeemphasis
);
+
+u16 HPI_Tuner_QueryProgram(
+ const struct hpi_hsubsys *phSubSys,
+ const u32 hTuner,
+ u32 *pbitmapProgram
+);
+
u16 HPI_Tuner_SetProgram(
struct hpi_hsubsys *phSubSys,
u32 hControl,
u32 dwProgram
);
+
u16 HPI_Tuner_GetProgram(
struct hpi_hsubsys *phSubSys,
u32 hControl,
u32 *pdwProgram
);
+
u16 HPI_Tuner_GetHdRadioDspVersion(
struct hpi_hsubsys *phSubSys,
u32 hControl,
char *pszDspVersion,
const u32 dwStringSize
);
+
u16 HPI_Tuner_GetHdRadioSdkVersion(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2514,6 +2160,13 @@ u16 HPI_PAD_GetProgramTypeString(
/****************************/
/* AES/EBU Receiver control */
/****************************/
+u16 HPI_AESEBU_Receiver_QueryFormat(
+ const struct hpi_hsubsys *phSubSys,
+ const u32 hAesRx,
+ const u32 dwIndex,
+ u16 *pwFormat
+);
+
u16 HPI_AESEBU_Receiver_SetFormat(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2540,16 +2193,14 @@ u16 HPI_AESEBU_Receiver_GetUserData(
);
u16 HPI_AESEBU_Receiver_GetChannelStatus(
- struct hpi_hsubsys
- *phSubSys,
+ struct hpi_hsubsys *phSubSys,
u32 hControl,
u16 wIndex,
u16 *pwData
);
u16 HPI_AESEBU_Receiver_GetErrorStatus(
- struct hpi_hsubsys
- *phSubSys,
+ struct hpi_hsubsys *phSubSys,
u32 hControl,
u16 *pwErrorData
);
@@ -2558,36 +2209,39 @@ u16 HPI_AESEBU_Receiver_GetErrorStatus(
/* AES/EBU Transmitter control */
/*******************************/
u16 HPI_AESEBU_Transmitter_SetSampleRate(
- struct hpi_hsubsys
- *phSubSys,
+ struct hpi_hsubsys *phSubSys,
u32 hControl,
u32 dwSampleRate
);
u16 HPI_AESEBU_Transmitter_SetUserData(
- struct hpi_hsubsys
- *phSubSys,
+ struct hpi_hsubsys *phSubSys,
u32 hControl,
u16 wIndex,
u16 wData
);
u16 HPI_AESEBU_Transmitter_SetChannelStatus(
- struct hpi_hsubsys
- *phSubSys,
+ struct hpi_hsubsys *phSubSys,
u32 hControl,
u16 wIndex,
u16 wData
);
u16 HPI_AESEBU_Transmitter_GetChannelStatus(
- struct hpi_hsubsys
- *phSubSys,
+ struct hpi_hsubsys *phSubSys,
u32 hControl,
u16 wIndex,
u16 *pwData
);
+u16 HPI_AESEBU_Transmitter_QueryFormat(
+ const struct hpi_hsubsys *phSubSys,
+ const u32 hAesTx,
+ const u32 dwIndex,
+ u16 *pwFormat
+);
+
u16 HPI_AESEBU_Transmitter_SetFormat(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2665,6 +2319,14 @@ u16 HPI_Bitstream_GetActivity(
/***********************/
/* SampleClock control */
/***********************/
+
+u16 HPI_SampleClock_QuerySource(
+ const struct hpi_hsubsys *phSubSys,
+ const u32 hClock,
+ const u32 dwIndex,
+ u16 *pwSource
+);
+
u16 HPI_SampleClock_SetSource(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2677,6 +2339,14 @@ u16 HPI_SampleClock_GetSource(
u16 *pwSource
);
+u16 HPI_SampleClock_QuerySourceIndex(
+ const struct hpi_hsubsys *phSubSys,
+ const u32 hClock,
+ const u32 dwIndex,
+ const u32 dwSource,
+ u16 *pwSourceIndex
+);
+
u16 HPI_SampleClock_SetSourceIndex(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2695,6 +2365,13 @@ u16 HPI_SampleClock_GetSampleRate(
u32 *pdwSampleRate
);
+u16 HPI_SampleClock_QueryLocalRate(
+ const struct hpi_hsubsys *phSubSys,
+ const u32 hClock,
+ const u32 dwIndex,
+ u32 *pdwSource
+);
+
u16 HPI_SampleClock_SetLocalRate(
struct hpi_hsubsys *phSubSys,
u32 hControl,
@@ -2707,6 +2384,18 @@ u16 HPI_SampleClock_GetLocalRate(
u32 *pdwSampleRate
);
+u16 HPI_SampleClock_SetAuto(
+ struct hpi_hsubsys *phSubSys,
+ u32 hControl,
+ u32 dwAuto
+);
+
+u16 HPI_SampleClock_GetAuto(
+ struct hpi_hsubsys *phSubSys,
+ u32 hControl,
+ u32 *pdwAuto
+);
+
/***********************/
/* Microphone control */
/***********************/
@@ -3051,978 +2740,6 @@ u16 HPI_FormatCreate(
/* Until it's verified, this function is for Windows OSs only */
-/*****************************************************************************/
-/*****************************************************************************/
-/******** HPI LOW LEVEL MESSAGES *******/
-/*****************************************************************************/
-/*****************************************************************************/
-/** Pnp ids */
-/** "ASI" - actual is "ASX" - need to change */
-#define HPI_ID_ISAPNP_AUDIOSCIENCE 0x0669
-/** PCI vendor ID that AudioScience uses */
-#define HPI_PCI_VENDOR_ID_AUDIOSCIENCE 0x175C
-/** PCI vendor ID that the DSP56301 has */
-#define HPI_PCI_VENDOR_ID_MOTOROLA 0x1057
-/** PCI vendor ID that TI uses */
-#define HPI_PCI_VENDOR_ID_TI 0x104C
-
-#define HPI_USB_VENDOR_ID_AUDIOSCIENCE 0x1257
-#define HPI_USB_W2K_TAG 0x57495341 /* "ASIW" */
-#define HPI_USB_LINUX_TAG 0x4C495341 /* "ASIL" */
-
-/******************************************* message types */
-#define HPI_TYPE_MESSAGE 1
-#define HPI_TYPE_RESPONSE 2
-#define HPI_TYPE_DATA 3
-#define HPI_TYPE_SSX2BYPASS_MESSAGE 4
-
-/******************************************* object types */
-#define HPI_OBJ_SUBSYSTEM 1
-#define HPI_OBJ_ADAPTER 2
-#define HPI_OBJ_OSTREAM 3
-#define HPI_OBJ_ISTREAM 4
-#define HPI_OBJ_MIXER 5
-#define HPI_OBJ_NODE 6
-#define HPI_OBJ_CONTROL 7
-#define HPI_OBJ_NVMEMORY 8
-#define HPI_OBJ_GPIO 9
-#define HPI_OBJ_WATCHDOG 10
-#define HPI_OBJ_CLOCK 11
-#define HPI_OBJ_PROFILE 12
-#define HPI_OBJ_CONTROLEX 13
-#define HPI_OBJ_ASYNCEVENT 14
-
-#define HPI_OBJ_MAXINDEX 14
-
-/******************************************* methods/functions */
-
-#define HPI_OBJ_FUNCTION_SPACING 0x100
-#define HPI_MAKE_INDEX(obj, index) (obj * HPI_OBJ_FUNCTION_SPACING + index)
-#define HPI_EXTRACT_INDEX(fn) (fn & 0xff)
-
-/* SUB-SYSTEM */
-#define HPI_SUBSYS_OPEN HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 1)
-#define HPI_SUBSYS_GET_VERSION HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 2)
-#define HPI_SUBSYS_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 3)
-#define HPI_SUBSYS_FIND_ADAPTERS HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 4)
-#define HPI_SUBSYS_CREATE_ADAPTER HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 5)
-#define HPI_SUBSYS_CLOSE HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 6)
-#define HPI_SUBSYS_DELETE_ADAPTER HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 7)
-#define HPI_SUBSYS_DRIVER_LOAD HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 8)
-#define HPI_SUBSYS_DRIVER_UNLOAD HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 9)
- /*SGT*/
-#define HPI_SUBSYS_READ_PORT_8 HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 10)
-#define HPI_SUBSYS_WRITE_PORT_8 HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 11)
-#define HPI_SUBSYS_GET_NUM_ADAPTERS HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 12)
-#define HPI_SUBSYS_GET_ADAPTER HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 13)
-#define HPI_SUBSYS_SET_NETWORK_INTERFACE HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 14)
-/* ADAPTER */
-#define HPI_ADAPTER_OPEN HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 1)
-#define HPI_ADAPTER_CLOSE HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 2)
-#define HPI_ADAPTER_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 3)
-#define HPI_ADAPTER_GET_ASSERT HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 4)
-#define HPI_ADAPTER_TEST_ASSERT HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 5)
-#define HPI_ADAPTER_SET_MODE HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 6)
-#define HPI_ADAPTER_GET_MODE HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 7)
-#define HPI_ADAPTER_ENABLE_CAPABILITY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 8)
-#define HPI_ADAPTER_SELFTEST HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 9)
-#define HPI_ADAPTER_FIND_OBJECT HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 10)
-#define HPI_ADAPTER_QUERY_FLASH HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 11)
-#define HPI_ADAPTER_START_FLASH HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 12)
-#define HPI_ADAPTER_PROGRAM_FLASH HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 13)
-#define HPI_ADAPTER_SET_PROPERTY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 14)
-#define HPI_ADAPTER_GET_PROPERTY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 15)
-#define HPI_ADAPTER_ENUM_PROPERTY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 16)
-#define HPI_ADAPTER_MODULE_INFO HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 17)
-#define HPI_ADAPTER_DEBUG_READ HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 18)
-#define HPI_ADAPTER_FUNCTION_COUNT 18
-/* OUTPUT STREAM */
-#define HPI_OSTREAM_OPEN HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 1)
-#define HPI_OSTREAM_CLOSE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 2)
-#define HPI_OSTREAM_WRITE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 3)
-#define HPI_OSTREAM_START HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 4)
-#define HPI_OSTREAM_STOP HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 5)
-#define HPI_OSTREAM_RESET HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 6)
-#define HPI_OSTREAM_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 7)
-#define HPI_OSTREAM_QUERY_FORMAT HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 8)
-#define HPI_OSTREAM_DATA HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 9)
-#define HPI_OSTREAM_SET_VELOCITY HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 10)
-#define HPI_OSTREAM_SET_PUNCHINOUT HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 11)
-#define HPI_OSTREAM_SINEGEN HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 12)
-#define HPI_OSTREAM_ANC_RESET HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 13)
-#define HPI_OSTREAM_ANC_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 14)
-#define HPI_OSTREAM_ANC_READ HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 15)
-#define HPI_OSTREAM_SET_TIMESCALE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 16)
-#define HPI_OSTREAM_SET_FORMAT HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 17)
-#define HPI_OSTREAM_HOSTBUFFER_ALLOC HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 18)
-#define HPI_OSTREAM_HOSTBUFFER_FREE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 19)
-#define HPI_OSTREAM_GROUP_ADD HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 20)
-#define HPI_OSTREAM_GROUP_GETMAP HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 21)
-#define HPI_OSTREAM_GROUP_RESET HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 22)
-#define HPI_OSTREAM_FUNCTION_COUNT (22)
-/* INPUT STREAM */
-#define HPI_ISTREAM_OPEN HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 1)
-#define HPI_ISTREAM_CLOSE HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 2)
-#define HPI_ISTREAM_SET_FORMAT HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 3)
-#define HPI_ISTREAM_READ HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 4)
-#define HPI_ISTREAM_START HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 5)
-#define HPI_ISTREAM_STOP HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 6)
-#define HPI_ISTREAM_RESET HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 7)
-#define HPI_ISTREAM_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 8)
-#define HPI_ISTREAM_QUERY_FORMAT HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 9)
-#define HPI_ISTREAM_ANC_RESET HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 10)
-#define HPI_ISTREAM_ANC_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 11)
-#define HPI_ISTREAM_ANC_WRITE HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 12)
-#define HPI_ISTREAM_HOSTBUFFER_ALLOC HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 13)
-#define HPI_ISTREAM_HOSTBUFFER_FREE HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 14)
-#define HPI_ISTREAM_GROUP_ADD HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 15)
-#define HPI_ISTREAM_GROUP_GETMAP HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 16)
-#define HPI_ISTREAM_GROUP_RESET HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 17)
-#define HPI_ISTREAM_FUNCTION_COUNT (17)
-/* MIXER */
-/* NOTE:
- GET_NODE_INFO, SET_CONNECTION, GET_CONNECTIONS are not currently used */
-#define HPI_MIXER_OPEN HPI_MAKE_INDEX(HPI_OBJ_MIXER, 1)
-#define HPI_MIXER_CLOSE HPI_MAKE_INDEX(HPI_OBJ_MIXER, 2)
-#define HPI_MIXER_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_MIXER, 3)
-#define HPI_MIXER_GET_NODE_INFO HPI_MAKE_INDEX(HPI_OBJ_MIXER, 4)
-#define HPI_MIXER_GET_CONTROL HPI_MAKE_INDEX(HPI_OBJ_MIXER, 5)
-#define HPI_MIXER_SET_CONNECTION HPI_MAKE_INDEX(HPI_OBJ_MIXER, 6)
-#define HPI_MIXER_GET_CONNECTIONS HPI_MAKE_INDEX(HPI_OBJ_MIXER, 7)
-#define HPI_MIXER_GET_CONTROL_BY_INDEX HPI_MAKE_INDEX(HPI_OBJ_MIXER, 8)
-#define HPI_MIXER_GET_CONTROL_ARRAY_BY_INDEX HPI_MAKE_INDEX(HPI_OBJ_MIXER, 9)
-#define HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES HPI_MAKE_INDEX(HPI_OBJ_MIXER, 10)
-#define HPI_MIXER_STORE HPI_MAKE_INDEX(HPI_OBJ_MIXER, 11)
-#define HPI_MIXER_FUNCTION_COUNT 11
-/* MIXER CONTROLS */
-#define HPI_CONTROL_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_CONTROL, 1)
-#define HPI_CONTROL_GET_STATE HPI_MAKE_INDEX(HPI_OBJ_CONTROL, 2)
-#define HPI_CONTROL_SET_STATE HPI_MAKE_INDEX(HPI_OBJ_CONTROL, 3)
-#define HPI_CONTROL_FUNCTION_COUNT 3
-/* NONVOL MEMORY */
-#define HPI_NVMEMORY_OPEN HPI_MAKE_INDEX(HPI_OBJ_NVMEMORY, 1)
-#define HPI_NVMEMORY_READ_BYTE HPI_MAKE_INDEX(HPI_OBJ_NVMEMORY, 2)
-#define HPI_NVMEMORY_WRITE_BYTE HPI_MAKE_INDEX(HPI_OBJ_NVMEMORY, 3)
-#define HPI_NVMEMORY_FUNCTION_COUNT 3
-/* GPIO */
-#define HPI_GPIO_OPEN HPI_MAKE_INDEX(HPI_OBJ_GPIO, 1)
-#define HPI_GPIO_READ_BIT HPI_MAKE_INDEX(HPI_OBJ_GPIO, 2)
-#define HPI_GPIO_WRITE_BIT HPI_MAKE_INDEX(HPI_OBJ_GPIO, 3)
-#define HPI_GPIO_READ_ALL HPI_MAKE_INDEX(HPI_OBJ_GPIO, 4)
-#define HPI_GPIO_FUNCTION_COUNT 4
-/* ASYNC EVENT */
-#define HPI_ASYNCEVENT_OPEN HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 1)
-#define HPI_ASYNCEVENT_CLOSE HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 2)
-#define HPI_ASYNCEVENT_WAIT HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 3)
-#define HPI_ASYNCEVENT_GETCOUNT HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 4)
-#define HPI_ASYNCEVENT_GET HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 5)
-#define HPI_ASYNCEVENT_SENDEVENTS HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 6)
-#define HPI_ASYNCEVENT_FUNCTION_COUNT 6
-/* WATCH-DOG */
-#define HPI_WATCHDOG_OPEN HPI_MAKE_INDEX(HPI_OBJ_WATCHDOG, 1)
-#define HPI_WATCHDOG_SET_TIME HPI_MAKE_INDEX(HPI_OBJ_WATCHDOG, 2)
-#define HPI_WATCHDOG_PING HPI_MAKE_INDEX(HPI_OBJ_WATCHDOG, 3)
-/* CLOCK */
-#define HPI_CLOCK_OPEN HPI_MAKE_INDEX(HPI_OBJ_CLOCK, 1)
-#define HPI_CLOCK_SET_TIME HPI_MAKE_INDEX(HPI_OBJ_CLOCK, 2)
-#define HPI_CLOCK_GET_TIME HPI_MAKE_INDEX(HPI_OBJ_CLOCK, 3)
-/* PROFILE */
-#define HPI_PROFILE_OPEN_ALL HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 1)
-#define HPI_PROFILE_START_ALL HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 2)
-#define HPI_PROFILE_STOP_ALL HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 3)
-#define HPI_PROFILE_GET HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 4)
-#define HPI_PROFILE_GET_IDLECOUNT HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 5)
-#define HPI_PROFILE_GET_NAME HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 6)
-#define HPI_PROFILE_GET_UTILIZATION HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 7)
-#define HPI_PROFILE_FUNCTION_COUNT 7
-/* ////////////////////////////////////////////////////////////////////// */
-/* STRUCTURES */
-#ifndef DISABLE_PRAGMA_PACK1
-#pragma pack(push, 1)
-#endif
-/** PCI bus resource */
- struct hpi_pci {
- u32 __iomem *apMemBase[HPI_MAX_ADAPTER_MEM_SPACES];
- struct pci_dev *pOsData;
-
-#ifndef HPI64BIT /* keep structure size constant */
- u32 dwPadding[HPI_MAX_ADAPTER_MEM_SPACES + 1];
-#endif
- u16 wVendorId;
- u16 wDeviceId;
- u16 wSubSysVendorId;
- u16 wSubSysDeviceId;
- u16 wBusNumber;
- u16 wDeviceNumber;
- u32 wInterrupt;
-};
-
-struct hpi_resource {
- union {
- struct hpi_pci *Pci;
- char *net_if;
- } r;
-#ifndef HPI64BIT /* keep structure size constant */
- u32 dwPadTo64;
-#endif
- u16 wBusType; /* HPI_BUS_PNPISA, _PCI, _USB etc */
- u16 wPadding;
-
-};
-
-/** Format info used inside struct hpi_message
- Not the same as public API struct hpi_format */
-struct hpi_msg_format {
- u32 dwSampleRate;
- /**< 11025, 32000, 44100 ... */
- u32 dwBitRate; /**< for MPEG */
- u32 dwAttributes;
- /**< Stereo/JointStereo/Mono */
- u16 wChannels; /**< 1,2..., (or ancillary mode or idle bit */
- u16 wFormat; /**< HPI_FORMAT_PCM16, _MPEG etc. see \ref formats. */
-};
-
-/** Buffer+format structure.
- Must be kept 7 * 32 bits to match public struct hpi_datastruct */
-struct hpi_msg_data {
- struct hpi_msg_format Format;
- u8 *pbData;
-#ifndef HPI64BIT
- u32 dwPadding;
-#endif
- u32 dwDataSize;
-};
-
-/** struct hpi_datastructure used up to 3.04 driver */
-struct hpi_data_legacy32 {
- struct hpi_format Format;
- u32 pbData;
- u32 dwDataSize;
-};
-
-#ifdef HPI64BIT
-/* Compatibility version of struct hpi_data*/
-struct hpi_data_compat32 {
- struct hpi_msg_format Format;
- u32 pbData;
- u32 dwPadding;
- u32 dwDataSize;
-};
-#endif
-
-struct hpi_buffer {
- /** placehoder for backward compatability (see dwBufferSize) */
- struct hpi_msg_format reserved;
- u32 dwCommand; /**< HPI_BUFFER_CMD_xxx*/
- u32 dwPciAddress; /**< PCI physical address of buffer for DSP DMA */
- u32 dwBufferSize; /**< must line up with dwDataSize of HPI_DATA*/
-};
-
-struct hpi_subsys_msg {
- struct hpi_resource Resource;
-};
-
-struct hpi_subsys_res {
- u32 dwVersion;
- u32 dwData; /* used to return extended version */
- u16 wNumAdapters; /* number of adapters */
- u16 wAdapterIndex;
- u16 awAdapterList[HPI_MAX_ADAPTERS];
-};
-
-struct hpi_adapter_msg {
- u32 dwAdapterMode; /* adapter mode */
- u16 wAssertId; /* assert number for "test assert" call
- wObjectIndex for find object call
- wQueryOrSet for HPI_AdapterSetModeEx() */
- u16 wObjectType; /* for adapter find object call */
-};
-
-union hpi_adapterx_msg {
- struct hpi_adapter_msg adapter;
- struct {
- u32 dwOffset;
- } query_flash;
- struct {
- u32 dwOffset;
- u32 dwLength;
- u32 dwKey;
- } start_flash;
- struct {
- u32 dwChecksum;
- u16 wSequence;
- u16 wLength;
- } program_flash;
- struct {
- u16 wProperty;
- u16 wParameter1;
- u16 wParameter2;
- } property_set;
- struct {
- u16 wIndex;
- u16 wWhat;
- u16 wPropertyIndex;
- } property_enum;
- struct {
- u16 index;
- } module_info;
- struct {
- u32 dwDspAddress;
- u32 dwCountBytes;
- } debug_read;
-};
-
-struct hpi_adapter_res {
- u32 dwSerialNumber;
- u16 wAdapterType;
- u16 wAdapterIndex; /* Is this needed? also used for wDspIndex */
- u16 wNumIStreams;
- u16 wNumOStreams;
- u16 wNumMixers;
- u16 wVersion;
- u8 szAdapterAssert[STR_SIZE(HPI_STRING_LEN)];
-};
-
-union hpi_adapterx_res {
- struct hpi_adapter_res adapter;
- struct {
- u32 dwChecksum;
- u32 dwLength;
- u32 dwVersion;
- } query_flash;
- struct {
- u16 wSequence;
- } program_flash;
- struct {
- u16 wParameter1;
- u16 wParameter2;
- } property_get;
-};
-
-struct hpi_stream_msg {
- union {
- struct hpi_msg_data Data;
- struct hpi_data_legacy32 Data32;
- u16 wVelocity;
- struct hpi_punchinout Pio;
- u32 dwTimeScale;
- struct hpi_buffer Buffer;
- struct hpi_streamid Stream;
- } u;
- u16 wStreamIndex;
- u16 wIStreamIndex;
-};
-
-struct hpi_stream_res {
- union {
- struct {
- /* size of hardware buffer */
- u32 dwBufferSize;
- /* OutStream - data to play,
- InStream - data recorded */
- u32 dwDataAvailable;
- /* OutStream - samples played,
- InStream - samples recorded */
- u32 dwSamplesTransferred;
- /* Adapter - OutStream - data to play,
- InStream - data recorded */
- u32 dwAuxiliaryDataAvailable;
- u16 wState; /* HPI_STATE_PLAYING, _STATE_STOPPED */
- u16 wPadding;
- } stream_info;
- struct {
- u32 dwBufferSize;
- u32 dwDataAvailable;
- u32 dwSamplesTransfered;
- u16 wState;
- u16 wOStreamIndex;
- u16 wIStreamIndex;
- u16 wPadding;
- u32 dwAuxiliaryDataAvailable;
- } legacy_stream_info;
- struct {
- /* bitmap of grouped OutStreams */
- u32 dwOutStreamGroupMap;
- /* bitmap of grouped InStreams */
- u32 dwInStreamGroupMap;
- } group_info;
- } u;
-};
-
-struct hpi_mixer_msg {
- u16 wControlIndex;
- u16 wControlType; /* = HPI_CONTROL_METER _VOLUME etc */
- u16 wPadding1; /* Maintain alignment of subsequent fields */
- u16 wNodeType1; /* = HPI_SOURCENODE_LINEIN etc */
- u16 wNodeIndex1; /* = 0..N */
- u16 wNodeType2;
- u16 wNodeIndex2;
- u16 wPadding2; /* round to 4 bytes */
-};
-
-struct hpi_mixer_res {
- u16 wSrcNodeType; /* = HPI_SOURCENODE_LINEIN etc */
- u16 wSrcNodeIndex; /* = 0..N */
- u16 wDstNodeType;
- u16 wDstNodeIndex;
- /* Also controlType for MixerGetControlByIndex */
- u16 wControlIndex;
- /* may indicate which DSP the control is located on */
- u16 wDspIndex;
-};
-
-union hpi_mixerx_msg {
- struct {
- u16 wStartingIndex;
- u16 wFlags;
- u32 dwLengthInBytes; /* length in bytes of pData */
- u32 pData; /* pointer to a data array */
- } gcabi;
- struct {
- u16 wCommand;
- u16 wIndex;
- } store; /* for HPI_MIXER_STORE message */
-};
-
-union hpi_mixerx_res {
- struct {
- u32 dwBytesReturned; /* size of items returned */
- u32 pData; /* pointer to data array */
- u16 wMoreToDo; /* indicates if there is more to do */
- } gcabi;
-};
-
-struct hpi_control_msg {
- u32 dwParam1; /* generic parameter 1 */
- u32 dwParam2; /* generic parameter 2 */
- short anLogValue[HPI_MAX_CHANNELS];
- u16 wAttribute; /* control attribute or property */
- u16 wControlIndex;
-};
-
-struct hpi_control_union_msg {
- union {
- struct {
- u32 dwParam1; /* generic parameter 1 */
- u32 dwParam2; /* generic parameter 2 */
- short anLogValue[HPI_MAX_CHANNELS];
- } old;
- union {
- u32 dwFrequency;
- u32 dwGain;
- u32 dwBand;
- u32 dwDeemphasis;
- u32 dwProgram;
- struct {
- u32 dwMode;
- u32 dwValue;
- } mode;
- } tuner;
- } u;
- u16 wAttribute; /* control attribute or property */
- u16 wControlIndex;
-};
-
-struct hpi_control_res {
- /* Could make union. dwParam, anLogValue never used in same response */
- u32 dwParam1;
- u32 dwParam2;
- short anLogValue[HPI_MAX_CHANNELS];
-};
-
-union hpi_control_union_res {
- struct {
- u32 dwParam1;
- u32 dwParam2;
- short anLogValue[HPI_MAX_CHANNELS];
- } old;
- union {
- u32 dwBand;
- u32 dwFrequency;
- u32 dwGain;
- u32 dwLevel;
- u32 dwDeemphasis;
- struct {
- u32 dwData[2];
- u32 dwBLER;
- } rds;
- } tuner;
- struct {
- char szData[8];
- u32 dwRemainingChars;
- } chars8;
-};
-
-/* HPI_CONTROLX_STRUCTURES */
-
-/* Message */
-
-/** Used for all HMI variables where max length <= 8 bytes
-*/
-struct hpi_controlx_msg_cobranet_data {
- u32 dwHmiAddress;
- u32 dwByteCount;
- u32 dwData[2];
-};
-
-/** Used for string data, and for packet bridge
-*/
-struct hpi_controlx_msg_cobranet_bigdata {
- u32 dwHmiAddress;
- u32 dwByteCount;
- u8 *pbData;
-#ifndef HPI64BIT
- u32 dwPadding;
-#endif
-};
-
-/** Used for PADS control reading of string fields.
-*/
-struct hpi_controlx_msg_pad_data {
- u32 dwField;
- u32 dwByteCount;
- u8 *pbData;
-#ifndef HPI64BIT
- u32 dwPadding;
-#endif
-};
-
-/** Used for generic data
-*/
-
-struct hpi_controlx_msg_generic {
- u32 dwParam1;
- u32 dwParam2;
-};
-
-struct hpi_controlx_msg {
- union {
- struct hpi_controlx_msg_cobranet_data cobranet_data;
- struct hpi_controlx_msg_cobranet_bigdata cobranet_bigdata;
- struct hpi_controlx_msg_generic generic;
- struct hpi_controlx_msg_pad_data pad_data;
- /* nothing extra to send for status read */
- } u;
- u16 wControlIndex;
- u16 wAttribute; /* control attribute or property */
-};
-
-/* Response */
-
-/**
-*/
-struct hpi_controlx_res_cobranet_data {
- u32 dwByteCount;
- u32 dwData[2];
-};
-
-struct hpi_controlx_res_cobranet_bigdata {
- u32 dwByteCount;
-};
-
-struct hpi_controlx_res_cobranet_status {
- u32 dwStatus;
- u32 dwReadableSize;
- u32 dwWriteableSize;
-};
-
-struct hpi_controlx_res_generic {
- u32 dwParam1;
- u32 dwParam2;
-};
-
-struct hpi_controlx_res {
- union {
- struct hpi_controlx_res_cobranet_bigdata cobranet_bigdata;
- struct hpi_controlx_res_cobranet_data cobranet_data;
- struct hpi_controlx_res_cobranet_status cobranet_status;
- struct hpi_controlx_res_generic generic;
- } u;
-};
-
-struct hpi_nvmemory_msg {
- u16 wIndex;
- u16 wData;
-};
-
-struct hpi_nvmemory_res {
- u16 wSizeInBytes;
- u16 wData;
-};
-
-struct hpi_gpio_msg {
- u16 wBitIndex;
- u16 wBitData;
-};
-
-struct hpi_gpio_res {
- u16 wNumberInputBits;
- u16 wNumberOutputBits;
- u16 wBitData;
- u16 wPadding;
-};
-
-struct hpi_async_msg {
- u32 dwEvents;
- u16 wMaximumEvents;
- u16 wPadding;
-};
-
-struct hpi_async_res {
- union {
- struct {
- u16 wCount;
- } count;
- struct {
- u32 dwEvents;
- u16 wNumberReturned;
- u16 wPadding;
- } get;
- struct hpi_async_event event;
- } u;
-};
-
-struct hpi_watchdog_msg {
- u32 dwTimeMs;
-};
-
-struct hpi_watchdog_res {
- u32 dwTimeMs;
-};
-
-struct hpi_clock_msg {
- u16 wHours;
- u16 wMinutes;
- u16 wSeconds;
- u16 wMilliSeconds;
-};
-
-struct hpi_clock_res {
- u16 wSizeInBytes;
- u16 wHours;
- u16 wMinutes;
- u16 wSeconds;
- u16 wMilliSeconds;
- u16 wPadding;
-};
-
-struct hpi_profile_msg {
- u16 wIndex;
- u16 wPadding;
-};
-
-struct hpi_profile_res_open {
- u16 wMaxProfiles;
-};
-
-struct hpi_profile_res_time {
- u32 dwMicroSeconds;
- u32 dwCallCount;
- u32 dwMaxMicroSeconds;
- u32 dwMinMicroSeconds;
- u16 wSeconds;
-};
-
-struct hpi_profile_res_name {
-/* u8 messes up response size for 56301 DSP */
- u16 szName[16];
-};
-
-struct hpi_profile_res {
- union {
- struct hpi_profile_res_open o;
- struct hpi_profile_res_time t;
- struct hpi_profile_res_name n;
- } u;
-};
-
-struct hpi_message_header {
- u16 wSize;
- u16 wType; /* HPI_MSG_MESSAGE, HPI_MSG_RESPONSE */
- u16 wObject; /* HPI_OBJ_* */
- u16 wFunction; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
- u16 wAdapterIndex; /* the adapter index */
- u16 wDspIndex; /* the dsp index on the adapter */
-};
-
-struct hpi_message {
- /* following fields must match HPI_MESSAGE_HEADER */
- u16 wSize;
- u16 wType; /* HPI_TYPE_MESSAGE, HPI_TYPE_RESPONSE */
- u16 wObject; /* HPI_OBJ_* */
- u16 wFunction; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
- u16 wAdapterIndex; /* the adapter index */
- u16 wDspIndex; /* the dsp index on the adapter */
- union {
- struct hpi_subsys_msg s;
- struct hpi_adapter_msg a;
- union hpi_adapterx_msg ax;
- struct hpi_stream_msg d;
- struct hpi_mixer_msg m;
- union hpi_mixerx_msg mx; /* extended mixer; */
- struct hpi_control_msg c; /* mixer control; */
- /* identical to struct hpi_control_msg,
- but field naming is improved */
- struct hpi_control_union_msg cu;
- struct hpi_controlx_msg cx; /* extended mixer control; */
- struct hpi_nvmemory_msg n;
- struct hpi_gpio_msg l; /* digital i/o */
- struct hpi_watchdog_msg w;
- struct hpi_clock_msg t; /* dsp time */
- struct hpi_profile_msg p;
- struct hpi_async_msg as;
- } u;
-};
-
-#define HPI_MESSAGE_SIZE_BY_OBJECT { \
- sizeof(struct hpi_message_header) , /* Default, no object type 0 */ \
- sizeof(struct hpi_message_header) + sizeof(struct hpi_subsys_msg),\
- sizeof(struct hpi_message_header) + sizeof(union hpi_adapterx_msg),\
- sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
- sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
- sizeof(struct hpi_message_header) + sizeof(struct hpi_mixer_msg),\
- sizeof(struct hpi_message_header) , /* no node message */ \
- sizeof(struct hpi_message_header) + sizeof(struct hpi_control_msg),\
- sizeof(struct hpi_message_header) + sizeof(struct hpi_nvmemory_msg),\
- sizeof(struct hpi_message_header) + sizeof(struct hpi_gpio_msg),\
- sizeof(struct hpi_message_header) + sizeof(struct hpi_watchdog_msg),\
- sizeof(struct hpi_message_header) + sizeof(struct hpi_clock_msg),\
- sizeof(struct hpi_message_header) + sizeof(struct hpi_profile_msg),\
- sizeof(struct hpi_message_header) + sizeof(struct hpi_controlx_msg),\
- sizeof(struct hpi_message_header) + sizeof(struct hpi_async_msg) \
-}
-
-struct hpi_response_header {
- u16 wSize;
- u16 wType; /* HPI_MSG_MESSAGE, HPI_MSG_RESPONSE */
- u16 wObject; /* HPI_OBJ_* */
- u16 wFunction; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
- u16 wError; /* HPI_ERROR_xxx */
- u16 wSpecificError; /* Adapter specific error */
-};
-
-struct hpi_response {
-/* following fields must match HPI_RESPONSE_HEADER */
- u16 wSize;
- u16 wType; /* HPI_MSG_MESSAGE, HPI_MSG_RESPONSE */
- u16 wObject; /* HPI_OBJ_* */
- u16 wFunction; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
- u16 wError; /* HPI_ERROR_xxx */
- u16 wSpecificError; /* Adapter specific error */
- union {
- struct hpi_subsys_res s;
- struct hpi_adapter_res a;
- union hpi_adapterx_res ax;
- struct hpi_stream_res d;
- struct hpi_mixer_res m;
- union hpi_mixerx_res mx; /* extended mixer; */
- struct hpi_control_res c; /* mixer control; */
- /* identical to hpi_control_res, but field naming is improved */
- union hpi_control_union_res cu;
- struct hpi_controlx_res cx; /* extended mixer control; */
- struct hpi_nvmemory_res n;
- struct hpi_gpio_res l; /* digital i/o */
- struct hpi_watchdog_res w;
- struct hpi_clock_res t; /* dsp time */
- struct hpi_profile_res p;
- struct hpi_async_res as;
- u8 bytes[52];
- } u;
-};
-
-#define HPI_RESPONSE_SIZE_BY_OBJECT { \
- sizeof(struct hpi_response_header) ,/* Default, no object type 0 */ \
- sizeof(struct hpi_response_header) + sizeof(struct hpi_subsys_res),\
- sizeof(struct hpi_response_header) + sizeof(union hpi_adapterx_res),\
- sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
- sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
- sizeof(struct hpi_response_header) + sizeof(struct hpi_mixer_res),\
- sizeof(struct hpi_response_header) , /* no node response */ \
- sizeof(struct hpi_response_header) + sizeof(struct hpi_control_res),\
- sizeof(struct hpi_response_header) + sizeof(struct hpi_nvmemory_res),\
- sizeof(struct hpi_response_header) + sizeof(struct hpi_gpio_res),\
- sizeof(struct hpi_response_header) + sizeof(struct hpi_watchdog_res),\
- sizeof(struct hpi_response_header) + sizeof(struct hpi_clock_res),\
- sizeof(struct hpi_response_header) + sizeof(struct hpi_profile_res),\
- sizeof(struct hpi_response_header) + sizeof(struct hpi_controlx_res),\
- sizeof(struct hpi_response_header) + sizeof(struct hpi_async_res) \
-}
-
-/*////////////////////////////////////////////////////////////////////////// */
-/* declarations for compact control calls */
-struct hpi_control_defn {
- u8 wType;
- u8 wChannels;
- u8 wSrcNodeType;
- u8 wSrcNodeIndex;
- u8 wDestNodeType;
- u8 wDestNodeIndex;
-};
-
-/*////////////////////////////////////////////////////////////////////////// */
-/* declarations for control caching (internal to HPI<->DSP interaction) */
-
-/** A compact representation of (part of) a controls state.
-Used for efficient transfer of the control state
-between DSP and host or across a network
-*/
-struct hpi_control_cache_info {
- /** one of HPI_CONTROL_* */
- u8 ControlType;
- /** The total size of cached information in 32-bit words. */
- u8 nSizeIn32bitWords;
- /** The original index of the control on the DSP */
- u16 ControlIndex;
-};
-
-struct hpi_control_cache_single {
- struct hpi_control_cache_info i;
- union {
- struct { /* volume */
- u16 anLog[2];
- } v;
- struct { /* peak meter */
- u16 anLogPeak[2];
- u16 anLogRMS[2];
- } p;
- struct { /* channel mode */
- u16 wMode;
- } m;
- struct { /* multiplexer */
- u16 wSourceNodeType;
- u16 wSourceNodeIndex;
- } x;
- struct { /* level/trim */
- u16 anLog[2];
- } l;
- struct { /* tuner - partial caching.
- Some attributes go to the DSP. */
- u32 dwFreqInkHz;
- u16 wBand;
- u16 wLevel;
- } t;
- struct { /* AESEBU Rx status */
- u32 dwErrorStatus;
- u32 dwSource;
- } aes3rx;
- struct { /* AESEBU Tx */
- u32 dwFormat;
- } aes3tx;
- struct { /* tone detector */
- u16 wState;
- } tone;
- struct { /* silence detector */
- u32 dwState;
- u32 dwCount;
- } silence;
- struct { /* sample clock */
- u16 wSource;
- u16 wSourceIndex;
- u32 dwSampleRate;
- } clk;
- struct { /* generic control */
- u32 dw1;
- u32 dw2;
- } g;
- } u;
-};
-
-struct hpi_control_cache_pad {
- struct hpi_control_cache_info i;
- u32 dwFieldValidFlags;
- u8 cChannel[8];
- u8 cArtist[40];
- u8 cTitle[40];
- u8 cComment[200];
- u32 dwPTY;
- u32 dwPI;
- u32 dwTrafficSupported;
- u32 dwTrafficAnouncement;
-};
-
-/*/////////////////////////////////////////////////////////////////////////// */
-/* declarations for 2^N sized FIFO buffer (internal to HPI<->DSP interaction) */
-struct hpi_fifo_buffer {
- u32 dwSize;
- u32 dwDSPIndex;
- u32 dwHostIndex;
-};
-
-#ifndef DISABLE_PRAGMA_PACK1
-#pragma pack(pop)
-#endif
-
-/* skip host side function declarations for DSP
- compile and documentation extraction */
-void HPI_InitMessage(
- struct hpi_message *phm,
- u16 wObject,
- u16 wFunction
-);
-
-void HPI_InitResponse(
- struct hpi_response *phr,
- u16 wObject,
- u16 wFunction,
- u16 wError
-);
-
-char HPI_HandleObject(
- const u32 dwHandle
-);
-
-void HPI_HandleToIndexes(
- const u32 dwHandle,
- u16 *pwAdapterIndex,
- u16 *pwObjectIndex,
- u16 *pwDspIndex
-);
-
-u32 HPI_IndexesToHandle(
- const char cObject,
- const u16 wAdapterIndex,
- const u16 wObjectIndex,
- const u16 wDspIndex
-);
-
-/*////////////////////////////////////////////////////////////////////////// */
-
-/* main HPI entry point */
-HPI_HandlerFunc HPI_Message;
-
-/* UDP message */
-void HPI_MessageUDP(
- struct hpi_message *phm,
- struct hpi_response *phr,
- unsigned int nTimeout
-);
-
-/* used in PnP OS/driver */
-u16 HPI_SubSysCreateAdapter(
- struct hpi_hsubsys *phSubSys,
- struct hpi_resource *pResource,
- u16 *pwAdapterIndex
-);
-
-u16 HPI_SubSysDeleteAdapter(
- struct hpi_hsubsys *phSubSys,
- u16 wAdapterIndex
-);
-
-void HPI_FormatToMsg(
- struct hpi_msg_format *pMF,
- struct hpi_format *pF
-);
-void HPI_StreamResponseToLegacy(
- struct hpi_stream_res *pSR
-);
-
-/*////////////////////////////////////////////////////////////////////////// */
-/* declarations for individual HPI entry points */
-HPI_HandlerFunc HPI_6000;
-HPI_HandlerFunc HPI_6205;
-HPI_HandlerFunc HPI_COMMON;
-
#ifdef __cplusplus
/* *INDENT-OFF* */
}
diff --git a/pci/asihpi/hpi_internal.h b/pci/asihpi/hpi_internal.h
new file mode 100644
index 0000000..9a1933f
--- /dev/null
+++ b/pci/asihpi/hpi_internal.h
@@ -0,0 +1,1346 @@
+/******************************************************************************
+
+ AudioScience HPI driver
+ Copyright (C) 1997-2003 AudioScience Inc. <support(a)audioscience.com>
+
+ 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
+ published by the Free Software Foundation;
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+HPI internal definitions
+
+(C) Copyright AudioScience Inc. 1996-2008
+******************************************************************************/
+
+#ifndef _HPI_INTERNAL_H_
+#define _HPI_INTERNAL_H_
+
+#include "hpi.h"
+
+/** maximum number of memory regions mapped to an adapter */
+#define HPI_MAX_ADAPTER_MEM_SPACES (2)
+
+#include "hpios.h"
+
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+/******************************************* CONTROL ATTRIBUTES ****/
+/* (in order of control type ID */
+
+ /* This allows for 255 control types, 256 unique attributes each */
+#define HPI_CTL_ATTR(ctl, ai) (HPI_CONTROL_##ctl * 0x100 + ai)
+
+/* Get the sub-index of the attribute for a control type */
+#define HPI_CTL_ATTR_INDEX(i) (i&0xff)
+
+/* Original 0-based non-unique attributes, might become unique later */
+#define HPI_CTL_ATTR0(ctl, ai) (ai)
+
+/* Generic control attributes. If a control uses any of these attributes
+ its other attributes must also be defined using HPI_CTL_ATTR()
+*/
+
+/** Enable a control.
+0=disable, 1=enable
+\note generic to all mixer plugins?
+*/
+#define HPI_GENERIC_ENABLE HPI_CTL_ATTR(GENERIC, 1)
+
+/** Enable event generation for a control.
+0=disable, 1=enable
+\note generic to all controls that can generate events
+*/
+#define HPI_GENERIC_EVENT_ENABLE HPI_CTL_ATTR(GENERIC, 2)
+
+/* Volume Control attributes */
+#define HPI_VOLUME_GAIN HPI_CTL_ATTR0(VOLUME, 1)
+#define HPI_VOLUME_AUTOFADE HPI_CTL_ATTR0(VOLUME, 2)
+
+/** For HPI_ControlQuery() to get the number of channels of a volume control*/
+#define HPI_VOLUME_NUM_CHANNELS HPI_CTL_ATTR0(VOLUME, 6)
+#define HPI_VOLUME_RANGE HPI_CTL_ATTR0(VOLUME, 10)
+
+/** Level Control attributes */
+#define HPI_LEVEL_GAIN HPI_CTL_ATTR0(LEVEL, 1)
+#define HPI_LEVEL_RANGE HPI_CTL_ATTR0(LEVEL, 10)
+
+/* Meter Control attributes */
+/** return RMS signal level */
+#define HPI_METER_RMS HPI_CTL_ATTR0(METER, 1)
+/** return peak signal level */
+#define HPI_METER_PEAK HPI_CTL_ATTR0(METER, 2)
+/** ballistics for ALL rms meters on adapter */
+#define HPI_METER_RMS_BALLISTICS HPI_CTL_ATTR0(METER, 3)
+/** ballistics for ALL peak meters on adapter */
+#define HPI_METER_PEAK_BALLISTICS HPI_CTL_ATTR0(METER, 4)
+
+/** For HPI_ControlQuery() to get the number of channels of a meter control*/
+#define HPI_METER_NUM_CHANNELS HPI_CTL_ATTR0(METER, 5)
+
+/* Multiplexer control attributes */
+#define HPI_MULTIPLEXER_SOURCE HPI_CTL_ATTR0(MULTIPLEXER, 1)
+#define HPI_MULTIPLEXER_QUERYSOURCE HPI_CTL_ATTR0(MULTIPLEXER, 2)
+
+/** AES/EBU transmitter control attributes */
+/** AESEBU or SPDIF */
+#define HPI_AESEBUTX_FORMAT HPI_CTL_ATTR0(AESEBUTX, 1)
+#define HPI_AESEBUTX_SAMPLERATE HPI_CTL_ATTR0(AESEBUTX, 3)
+#define HPI_AESEBUTX_CHANNELSTATUS HPI_CTL_ATTR0(AESEBUTX, 4)
+#define HPI_AESEBUTX_USERDATA HPI_CTL_ATTR0(AESEBUTX, 5)
+
+/** AES/EBU receiver control attributes */
+#define HPI_AESEBURX_FORMAT HPI_CTL_ATTR0(AESEBURX, 1)
+#define HPI_AESEBURX_ERRORSTATUS HPI_CTL_ATTR0(AESEBURX, 2)
+#define HPI_AESEBURX_SAMPLERATE HPI_CTL_ATTR0(AESEBURX, 3)
+#define HPI_AESEBURX_CHANNELSTATUS HPI_CTL_ATTR0(AESEBURX, 4)
+#define HPI_AESEBURX_USERDATA HPI_CTL_ATTR0(AESEBURX, 5)
+
+/** \defgroup tuner_defs Tuners
+\{
+*/
+/** \defgroup tuner_attrs Tuner control attributes
+\{
+*/
+#define HPI_TUNER_BAND HPI_CTL_ATTR0(TUNER, 1)
+#define HPI_TUNER_FREQ HPI_CTL_ATTR0(TUNER, 2)
+#define HPI_TUNER_LEVEL HPI_CTL_ATTR0(TUNER, 3)
+#define HPI_TUNER_AUDIOMUTE HPI_CTL_ATTR0(TUNER, 4)
+/* use TUNER_STATUS instead */
+#define HPI_TUNER_VIDEO_STATUS HPI_CTL_ATTR0(TUNER, 5)
+#define HPI_TUNER_GAIN HPI_CTL_ATTR0(TUNER, 6)
+#define HPI_TUNER_STATUS HPI_CTL_ATTR0(TUNER, 7)
+#define HPI_TUNER_MODE HPI_CTL_ATTR0(TUNER, 8)
+/** RDS data. */
+#define HPI_TUNER_RDS HPI_CTL_ATTR0(TUNER, 9)
+/** Audio pre-emphasis. */
+#define HPI_TUNER_DEEMPHASIS HPI_CTL_ATTR(TUNER, 10)
+/** HD-Radio tuner program control. */
+#define HPI_TUNER_PROGRAM HPI_CTL_ATTR(TUNER, 11)
+/** HD-Radio tuner digital signal quality. */
+#define HPI_TUNER_HDRADIO_SIGNAL_QUALITY HPI_CTL_ATTR(TUNER, 12)
+/** HD-Radio SDK firmware version. */
+#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)
+
+/** \} */
+
+/** \defgroup pads_attrs Tuner PADs control attributes
+\{
+*/
+/** The text string containing the station/channel combination. */
+#define HPI_PAD_CHANNEL_NAME HPI_CTL_ATTR(PAD, 1)
+/** The text string containing the artist. */
+#define HPI_PAD_ARTIST HPI_CTL_ATTR(PAD, 2)
+/** The text string containing the title. */
+#define HPI_PAD_TITLE HPI_CTL_ATTR(PAD, 3)
+/** The text string containing the comment. */
+#define HPI_PAD_COMMENT HPI_CTL_ATTR(PAD, 4)
+/** The integer containing the PTY code. */
+#define HPI_PAD_PROGRAM_TYPE HPI_CTL_ATTR(PAD, 5)
+/** The integer containing the program identification. */
+#define HPI_PAD_PROGRAM_ID HPI_CTL_ATTR(PAD, 6)
+/** The integer containing whether traffic information is supported.
+Contains either 1 or 0. */
+#define HPI_PAD_TA_SUPPORT HPI_CTL_ATTR(PAD, 7)
+/** The integer containing whether traffic announcement is in progress.
+Contains either 1 or 0. */
+#define HPI_PAD_TA_ACTIVE HPI_CTL_ATTR(PAD, 8)
+/** \} */
+
+/* VOX control attributes */
+#define HPI_VOX_THRESHOLD HPI_CTL_ATTR0(VOX, 1)
+
+/*?? channel mode used hpi_multiplexer_source attribute == 1 */
+#define HPI_CHANNEL_MODE_MODE HPI_CTL_ATTR0(CHANNEL_MODE, 1)
+
+/** \defgroup channel_modes Channel Modes
+Used for HPI_ChannelModeSet/Get()
+\{
+*/
+/** Left channel out = left channel in, Right channel out = right channel in. */
+#define HPI_CHANNEL_MODE_NORMAL 1
+/** Left channel out = right channel in, Right channel out = left channel in. */
+#define HPI_CHANNEL_MODE_SWAP 2
+/** Left channel out = left channel in, Right channel out = left channel in. */
+#define HPI_CHANNEL_MODE_LEFT_TO_STEREO 3
+/** Left channel out = right channel in, Right channel out = right channel in.*/
+#define HPI_CHANNEL_MODE_RIGHT_TO_STEREO 4
+/** Left channel out = (left channel in + right channel in)/2,
+ Right channel out = mute. */
+#define HPI_CHANNEL_MODE_STEREO_TO_LEFT 5
+/** Left channel out = mute,
+ Right channel out = (right channel in + left channel in)/2. */
+#define HPI_CHANNEL_MODE_STEREO_TO_RIGHT 6
+#define HPI_CHANNEL_MODE_LAST 6
+/** \} */
+
+/* Bitstream control set attributes */
+#define HPI_BITSTREAM_DATA_POLARITY HPI_CTL_ATTR0(BITSTREAM, 1)
+#define HPI_BITSTREAM_CLOCK_EDGE HPI_CTL_ATTR0(BITSTREAM, 2)
+#define HPI_BITSTREAM_CLOCK_SOURCE HPI_CTL_ATTR0(BITSTREAM, 3)
+
+#define HPI_POLARITY_POSITIVE 0
+#define HPI_POLARITY_NEGATIVE 1
+
+/* Bitstream control get attributes */
+#define HPI_BITSTREAM_ACTIVITY 1
+
+/* SampleClock control attributes */
+#define HPI_SAMPLECLOCK_SOURCE HPI_CTL_ATTR0(SAMPLECLOCK, 1)
+#define HPI_SAMPLECLOCK_SAMPLERATE HPI_CTL_ATTR0(SAMPLECLOCK, 2)
+#define HPI_SAMPLECLOCK_SOURCE_INDEX HPI_CTL_ATTR0(SAMPLECLOCK, 3)
+#define HPI_SAMPLECLOCK_LOCAL_SAMPLERATE HPI_CTL_ATTR0(SAMPLECLOCK, 4)
+#define HPI_SAMPLECLOCK_AUTO HPI_CTL_ATTR0(SAMPLECLOCK, 5)
+
+/* Microphone control attributes */
+#define HPI_MICROPHONE_PHANTOM_POWER HPI_CTL_ATTR0(MICROPHONE, 1)
+
+/** Equalizer control attributes
+*/
+/** Used to get number of filters in an EQ. (Can't set) */
+#define HPI_EQUALIZER_NUM_FILTERS HPI_CTL_ATTR0(EQUALIZER, 1)
+/** Set/get the filter by type, freq, Q, gain */
+#define HPI_EQUALIZER_FILTER HPI_CTL_ATTR0(EQUALIZER, 2)
+/** Get the biquad coefficients */
+#define HPI_EQUALIZER_COEFFICIENTS HPI_CTL_ATTR0(EQUALIZER, 3)
+
+#define HPI_COMPANDER_PARAMS HPI_CTL_ATTR(COMPANDER, 1)
+
+/* Cobranet control attributes.
+ MUST be distinct from all other control attributes.
+ This is so that host side processing can easily identify a Cobranet control
+ and apply additional host side operations (like copying data) as required.
+*/
+#define HPI_COBRANET_SET HPI_CTL_ATTR(COBRANET, 1)
+#define HPI_COBRANET_GET HPI_CTL_ATTR(COBRANET, 2)
+#define HPI_COBRANET_SET_DATA HPI_CTL_ATTR(COBRANET, 3)
+#define HPI_COBRANET_GET_DATA HPI_CTL_ATTR(COBRANET, 4)
+#define HPI_COBRANET_GET_STATUS HPI_CTL_ATTR(COBRANET, 5)
+#define HPI_COBRANET_SEND_PACKET HPI_CTL_ATTR(COBRANET, 6)
+#define HPI_COBRANET_GET_PACKET HPI_CTL_ATTR(COBRANET, 7)
+
+/*------------------------------------------------------------
+ Cobranet Chip Bridge - copied from HMI.H
+------------------------------------------------------------*/
+#define HPI_COBRANET_HMI_cobraBridge 0x20000
+#define HPI_COBRANET_HMI_cobraBridgeTxPktBuf \
+ (HPI_COBRANET_HMI_cobraBridge + 0x1000)
+#define HPI_COBRANET_HMI_cobraBridgeRxPktBuf \
+ (HPI_COBRANET_HMI_cobraBridge + 0x2000)
+#define HPI_COBRANET_HMI_cobraIfTable1 0x110000
+#define HPI_COBRANET_HMI_cobraIfPhyAddress \
+ (HPI_COBRANET_HMI_cobraIfTable1 + 0xd)
+#define HPI_COBRANET_HMI_cobraProtocolIP 0x72000
+#define HPI_COBRANET_HMI_cobraIpMonCurrentIP \
+ (HPI_COBRANET_HMI_cobraProtocolIP + 0x0)
+#define HPI_COBRANET_HMI_cobraIpMonStaticIP \
+ (HPI_COBRANET_HMI_cobraProtocolIP + 0x2)
+#define HPI_COBRANET_HMI_cobraSys 0x100000
+#define HPI_COBRANET_HMI_cobraSysDesc \
+ (HPI_COBRANET_HMI_cobraSys + 0x0)
+#define HPI_COBRANET_HMI_cobraSysObjectID \
+ (HPI_COBRANET_HMI_cobraSys + 0x100)
+#define HPI_COBRANET_HMI_cobraSysContact \
+ (HPI_COBRANET_HMI_cobraSys + 0x200)
+#define HPI_COBRANET_HMI_cobraSysName \
+ (HPI_COBRANET_HMI_cobraSys + 0x300)
+#define HPI_COBRANET_HMI_cobraSysLocation \
+ (HPI_COBRANET_HMI_cobraSys + 0x400)
+
+/*------------------------------------------------------------
+ Cobranet Chip Status bits
+------------------------------------------------------------*/
+#define HPI_COBRANET_HMI_STATUS_RXPACKET 2
+#define HPI_COBRANET_HMI_STATUS_TXPACKET 3
+
+/*------------------------------------------------------------
+ Ethernet header size
+------------------------------------------------------------*/
+#define HPI_ETHERNET_HEADER_SIZE (16)
+
+/* These defines are used to fill in protocol information for an Ethernet packet
+ sent using HMI on CS18102 */
+/** ID supplied by Cirrius for ASI packets. */
+#define HPI_ETHERNET_PACKET_ID 0x85
+/** Simple packet - no special routing required */
+#define HPI_ETHERNET_PACKET_V1 0x01
+/** This packet must make its way to the host across the HPI interface */
+#define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI 0x20
+/** This packet must make its way to the host across the HPI interface */
+#define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI_V1 0x21
+/** This packet must make its way to the host across the HPI interface */
+#define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI 0x40
+/** This packet must make its way to the host across the HPI interface */
+#define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI_V1 0x41
+
+#define HPI_ETHERNET_UDP_PORT (44600) /*!< UDP messaging port */
+
+/** Base network time out is set to 100 milli-seconds. */
+#define HPI_ETHERNET_TIMEOUT_MS (100)
+
+/** \defgroup tonedet_attr Tonedetector attributes
+\{
+Used by HPI_ToneDetector_Set() and HPI_ToneDetector_Get()
+*/
+
+/** Set the threshold level of a tonedetector,
+Threshold is a -ve number in units of dB/100,
+*/
+#define HPI_TONEDETECTOR_THRESHOLD HPI_CTL_ATTR(TONEDETECTOR, 1)
+
+/** Get the current state of tonedetection
+The result is a bitmap of detected tones. pairs of bits represent the left
+and right channels, with left channel in LSB.
+The lowest frequency detector state is in the LSB
+*/
+#define HPI_TONEDETECTOR_STATE HPI_CTL_ATTR(TONEDETECTOR, 2)
+
+/** Get the frequency of a tonedetector band.
+*/
+#define HPI_TONEDETECTOR_FREQUENCY HPI_CTL_ATTR(TONEDETECTOR, 3)
+
+/**\}*/
+
+/** \defgroup silencedet_attr SilenceDetector attributes
+\{
+*/
+
+/** Get the current state of tonedetection
+The result is a bitmap with 1s for silent channels. Left channel is in LSB
+*/
+#define HPI_SILENCEDETECTOR_STATE \
+ HPI_CTL_ATTR(SILENCEDETECTOR, 2)
+
+/** Set the threshold level of a SilenceDetector,
+Threshold is a -ve number in units of dB/100,
+*/
+#define HPI_SILENCEDETECTOR_THRESHOLD \
+ HPI_CTL_ATTR(SILENCEDETECTOR, 1)
+
+/** get/set the silence time before the detector triggers
+*/
+#define HPI_SILENCEDETECTOR_DELAY \
+ HPI_CTL_ATTR(SILENCEDETECTOR, 3)
+
+/**\}*/
+
+/* Locked memory buffer alloc/free phases */
+/** use one message to allocate or free physical memory */
+#define HPI_BUFFER_CMD_EXTERNAL 0
+/** alloc physical memory */
+#define HPI_BUFFER_CMD_INTERNAL_ALLOC 1
+/** send physical memory address to adapter */
+#define HPI_BUFFER_CMD_INTERNAL_GRANTADAPTER 2
+/** notify adapter to stop using physical buffer */
+#define HPI_BUFFER_CMD_INTERNAL_REVOKEADAPTER 3
+/** free physical buffer */
+#define HPI_BUFFER_CMD_INTERNAL_FREE 4
+
+/******************************************* CONTROLX ATTRIBUTES ****/
+/* NOTE: All controlx attributes must be unique, unlike control attributes */
+
+/*****************************************************************************/
+/*****************************************************************************/
+/******** HPI LOW LEVEL MESSAGES *******/
+/*****************************************************************************/
+/*****************************************************************************/
+/** Pnp ids */
+/** "ASI" - actual is "ASX" - need to change */
+#define HPI_ID_ISAPNP_AUDIOSCIENCE 0x0669
+/** PCI vendor ID that AudioScience uses */
+#define HPI_PCI_VENDOR_ID_AUDIOSCIENCE 0x175C
+/** PCI vendor ID that the DSP56301 has */
+#define HPI_PCI_VENDOR_ID_MOTOROLA 0x1057
+/** PCI vendor ID that TI uses */
+#define HPI_PCI_VENDOR_ID_TI 0x104C
+
+#define HPI_USB_VENDOR_ID_AUDIOSCIENCE 0x1257
+#define HPI_USB_W2K_TAG 0x57495341 /* "ASIW" */
+#define HPI_USB_LINUX_TAG 0x4C495341 /* "ASIL" */
+
+/******************************************* message types */
+#define HPI_TYPE_MESSAGE 1
+#define HPI_TYPE_RESPONSE 2
+#define HPI_TYPE_DATA 3
+#define HPI_TYPE_SSX2BYPASS_MESSAGE 4
+
+/******************************************* object types */
+#define HPI_OBJ_SUBSYSTEM 1
+#define HPI_OBJ_ADAPTER 2
+#define HPI_OBJ_OSTREAM 3
+#define HPI_OBJ_ISTREAM 4
+#define HPI_OBJ_MIXER 5
+#define HPI_OBJ_NODE 6
+#define HPI_OBJ_CONTROL 7
+#define HPI_OBJ_NVMEMORY 8
+#define HPI_OBJ_GPIO 9
+#define HPI_OBJ_WATCHDOG 10
+#define HPI_OBJ_CLOCK 11
+#define HPI_OBJ_PROFILE 12
+#define HPI_OBJ_CONTROLEX 13
+#define HPI_OBJ_ASYNCEVENT 14
+
+#define HPI_OBJ_MAXINDEX 14
+
+/******************************************* methods/functions */
+
+#define HPI_OBJ_FUNCTION_SPACING 0x100
+#define HPI_MAKE_INDEX(obj, index) (obj * HPI_OBJ_FUNCTION_SPACING + index)
+#define HPI_EXTRACT_INDEX(fn) (fn & 0xff)
+
+/* SUB-SYSTEM */
+#define HPI_SUBSYS_OPEN HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 1)
+#define HPI_SUBSYS_GET_VERSION HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 2)
+#define HPI_SUBSYS_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 3)
+#define HPI_SUBSYS_FIND_ADAPTERS HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 4)
+#define HPI_SUBSYS_CREATE_ADAPTER HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 5)
+#define HPI_SUBSYS_CLOSE HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 6)
+#define HPI_SUBSYS_DELETE_ADAPTER HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 7)
+#define HPI_SUBSYS_DRIVER_LOAD HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 8)
+#define HPI_SUBSYS_DRIVER_UNLOAD HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 9)
+ /*SGT*/
+#define HPI_SUBSYS_READ_PORT_8 HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 10)
+#define HPI_SUBSYS_WRITE_PORT_8 HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 11)
+#define HPI_SUBSYS_GET_NUM_ADAPTERS HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 12)
+#define HPI_SUBSYS_GET_ADAPTER HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 13)
+#define HPI_SUBSYS_SET_NETWORK_INTERFACE HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 14)
+/* ADAPTER */
+#define HPI_ADAPTER_OPEN HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 1)
+#define HPI_ADAPTER_CLOSE HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 2)
+#define HPI_ADAPTER_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 3)
+#define HPI_ADAPTER_GET_ASSERT HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 4)
+#define HPI_ADAPTER_TEST_ASSERT HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 5)
+#define HPI_ADAPTER_SET_MODE HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 6)
+#define HPI_ADAPTER_GET_MODE HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 7)
+#define HPI_ADAPTER_ENABLE_CAPABILITY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 8)
+#define HPI_ADAPTER_SELFTEST HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 9)
+#define HPI_ADAPTER_FIND_OBJECT HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 10)
+#define HPI_ADAPTER_QUERY_FLASH HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 11)
+#define HPI_ADAPTER_START_FLASH HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 12)
+#define HPI_ADAPTER_PROGRAM_FLASH HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 13)
+#define HPI_ADAPTER_SET_PROPERTY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 14)
+#define HPI_ADAPTER_GET_PROPERTY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 15)
+#define HPI_ADAPTER_ENUM_PROPERTY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 16)
+#define HPI_ADAPTER_MODULE_INFO HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 17)
+#define HPI_ADAPTER_DEBUG_READ HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 18)
+#define HPI_ADAPTER_FUNCTION_COUNT 18
+/* OUTPUT STREAM */
+#define HPI_OSTREAM_OPEN HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 1)
+#define HPI_OSTREAM_CLOSE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 2)
+#define HPI_OSTREAM_WRITE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 3)
+#define HPI_OSTREAM_START HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 4)
+#define HPI_OSTREAM_STOP HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 5)
+#define HPI_OSTREAM_RESET HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 6)
+#define HPI_OSTREAM_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 7)
+#define HPI_OSTREAM_QUERY_FORMAT HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 8)
+#define HPI_OSTREAM_DATA HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 9)
+#define HPI_OSTREAM_SET_VELOCITY HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 10)
+#define HPI_OSTREAM_SET_PUNCHINOUT HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 11)
+#define HPI_OSTREAM_SINEGEN HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 12)
+#define HPI_OSTREAM_ANC_RESET HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 13)
+#define HPI_OSTREAM_ANC_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 14)
+#define HPI_OSTREAM_ANC_READ HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 15)
+#define HPI_OSTREAM_SET_TIMESCALE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 16)
+#define HPI_OSTREAM_SET_FORMAT HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 17)
+#define HPI_OSTREAM_HOSTBUFFER_ALLOC HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 18)
+#define HPI_OSTREAM_HOSTBUFFER_FREE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 19)
+#define HPI_OSTREAM_GROUP_ADD HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 20)
+#define HPI_OSTREAM_GROUP_GETMAP HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 21)
+#define HPI_OSTREAM_GROUP_RESET HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 22)
+#define HPI_OSTREAM_FUNCTION_COUNT (22)
+/* INPUT STREAM */
+#define HPI_ISTREAM_OPEN HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 1)
+#define HPI_ISTREAM_CLOSE HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 2)
+#define HPI_ISTREAM_SET_FORMAT HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 3)
+#define HPI_ISTREAM_READ HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 4)
+#define HPI_ISTREAM_START HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 5)
+#define HPI_ISTREAM_STOP HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 6)
+#define HPI_ISTREAM_RESET HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 7)
+#define HPI_ISTREAM_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 8)
+#define HPI_ISTREAM_QUERY_FORMAT HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 9)
+#define HPI_ISTREAM_ANC_RESET HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 10)
+#define HPI_ISTREAM_ANC_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 11)
+#define HPI_ISTREAM_ANC_WRITE HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 12)
+#define HPI_ISTREAM_HOSTBUFFER_ALLOC HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 13)
+#define HPI_ISTREAM_HOSTBUFFER_FREE HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 14)
+#define HPI_ISTREAM_GROUP_ADD HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 15)
+#define HPI_ISTREAM_GROUP_GETMAP HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 16)
+#define HPI_ISTREAM_GROUP_RESET HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 17)
+#define HPI_ISTREAM_FUNCTION_COUNT (17)
+/* MIXER */
+/* NOTE:
+ GET_NODE_INFO, SET_CONNECTION, GET_CONNECTIONS are not currently used */
+#define HPI_MIXER_OPEN HPI_MAKE_INDEX(HPI_OBJ_MIXER, 1)
+#define HPI_MIXER_CLOSE HPI_MAKE_INDEX(HPI_OBJ_MIXER, 2)
+#define HPI_MIXER_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_MIXER, 3)
+#define HPI_MIXER_GET_NODE_INFO HPI_MAKE_INDEX(HPI_OBJ_MIXER, 4)
+#define HPI_MIXER_GET_CONTROL HPI_MAKE_INDEX(HPI_OBJ_MIXER, 5)
+#define HPI_MIXER_SET_CONNECTION HPI_MAKE_INDEX(HPI_OBJ_MIXER, 6)
+#define HPI_MIXER_GET_CONNECTIONS HPI_MAKE_INDEX(HPI_OBJ_MIXER, 7)
+#define HPI_MIXER_GET_CONTROL_BY_INDEX HPI_MAKE_INDEX(HPI_OBJ_MIXER, 8)
+#define HPI_MIXER_GET_CONTROL_ARRAY_BY_INDEX HPI_MAKE_INDEX(HPI_OBJ_MIXER, 9)
+#define HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES HPI_MAKE_INDEX(HPI_OBJ_MIXER, 10)
+#define HPI_MIXER_STORE HPI_MAKE_INDEX(HPI_OBJ_MIXER, 11)
+#define HPI_MIXER_FUNCTION_COUNT 11
+/* MIXER CONTROLS */
+#define HPI_CONTROL_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_CONTROL, 1)
+#define HPI_CONTROL_GET_STATE HPI_MAKE_INDEX(HPI_OBJ_CONTROL, 2)
+#define HPI_CONTROL_SET_STATE HPI_MAKE_INDEX(HPI_OBJ_CONTROL, 3)
+#define HPI_CONTROL_FUNCTION_COUNT 3
+/* NONVOL MEMORY */
+#define HPI_NVMEMORY_OPEN HPI_MAKE_INDEX(HPI_OBJ_NVMEMORY, 1)
+#define HPI_NVMEMORY_READ_BYTE HPI_MAKE_INDEX(HPI_OBJ_NVMEMORY, 2)
+#define HPI_NVMEMORY_WRITE_BYTE HPI_MAKE_INDEX(HPI_OBJ_NVMEMORY, 3)
+#define HPI_NVMEMORY_FUNCTION_COUNT 3
+/* GPIO */
+#define HPI_GPIO_OPEN HPI_MAKE_INDEX(HPI_OBJ_GPIO, 1)
+#define HPI_GPIO_READ_BIT HPI_MAKE_INDEX(HPI_OBJ_GPIO, 2)
+#define HPI_GPIO_WRITE_BIT HPI_MAKE_INDEX(HPI_OBJ_GPIO, 3)
+#define HPI_GPIO_READ_ALL HPI_MAKE_INDEX(HPI_OBJ_GPIO, 4)
+#define HPI_GPIO_WRITE_STATUS HPI_MAKE_INDEX(HPI_OBJ_GPIO, 5)
+#define HPI_GPIO_FUNCTION_COUNT 5
+/* ASYNC EVENT */
+#define HPI_ASYNCEVENT_OPEN HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 1)
+#define HPI_ASYNCEVENT_CLOSE HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 2)
+#define HPI_ASYNCEVENT_WAIT HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 3)
+#define HPI_ASYNCEVENT_GETCOUNT HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 4)
+#define HPI_ASYNCEVENT_GET HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 5)
+#define HPI_ASYNCEVENT_SENDEVENTS HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 6)
+#define HPI_ASYNCEVENT_FUNCTION_COUNT 6
+/* WATCH-DOG */
+#define HPI_WATCHDOG_OPEN HPI_MAKE_INDEX(HPI_OBJ_WATCHDOG, 1)
+#define HPI_WATCHDOG_SET_TIME HPI_MAKE_INDEX(HPI_OBJ_WATCHDOG, 2)
+#define HPI_WATCHDOG_PING HPI_MAKE_INDEX(HPI_OBJ_WATCHDOG, 3)
+/* CLOCK */
+#define HPI_CLOCK_OPEN HPI_MAKE_INDEX(HPI_OBJ_CLOCK, 1)
+#define HPI_CLOCK_SET_TIME HPI_MAKE_INDEX(HPI_OBJ_CLOCK, 2)
+#define HPI_CLOCK_GET_TIME HPI_MAKE_INDEX(HPI_OBJ_CLOCK, 3)
+/* PROFILE */
+#define HPI_PROFILE_OPEN_ALL HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 1)
+#define HPI_PROFILE_START_ALL HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 2)
+#define HPI_PROFILE_STOP_ALL HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 3)
+#define HPI_PROFILE_GET HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 4)
+#define HPI_PROFILE_GET_IDLECOUNT HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 5)
+#define HPI_PROFILE_GET_NAME HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 6)
+#define HPI_PROFILE_GET_UTILIZATION HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 7)
+#define HPI_PROFILE_FUNCTION_COUNT 7
+/* ////////////////////////////////////////////////////////////////////// */
+/* PRIVATE ATTRIBUTES */
+/* ////////////////////////////////////////////////////////////////////// */
+/* STRUCTURES */
+#ifndef DISABLE_PRAGMA_PACK1
+#pragma pack(push, 1)
+#endif
+/** PCI bus resource */
+ struct hpi_pci {
+ u32 __iomem *apMemBase[HPI_MAX_ADAPTER_MEM_SPACES];
+ struct pci_dev *pOsData;
+
+#ifndef HPI64BIT /* keep structure size constant */
+ u32 dwPadding[HPI_MAX_ADAPTER_MEM_SPACES + 1];
+#endif
+ u16 wVendorId;
+ u16 wDeviceId;
+ u16 wSubSysVendorId;
+ u16 wSubSysDeviceId;
+ u16 wBusNumber;
+ u16 wDeviceNumber;
+ u32 wInterrupt;
+};
+
+struct hpi_resource {
+ union {
+ struct hpi_pci *Pci;
+ char *net_if;
+ } r;
+#ifndef HPI64BIT /* keep structure size constant */
+ u32 dwPadTo64;
+#endif
+ u16 wBusType; /* HPI_BUS_PNPISA, _PCI, _USB etc */
+ u16 wPadding;
+
+};
+
+/** Format info used inside struct hpi_message
+ Not the same as public API struct hpi_format */
+struct hpi_msg_format {
+ u32 dwSampleRate;
+ /**< 11025, 32000, 44100 ... */
+ u32 dwBitRate; /**< for MPEG */
+ u32 dwAttributes;
+ /**< Stereo/JointStereo/Mono */
+ u16 wChannels; /**< 1,2..., (or ancillary mode or idle bit */
+ u16 wFormat; /**< HPI_FORMAT_PCM16, _MPEG etc. see \ref formats. */
+};
+
+/** Buffer+format structure.
+ Must be kept 7 * 32 bits to match public struct hpi_datastruct */
+struct hpi_msg_data {
+ struct hpi_msg_format Format;
+ u8 *pbData;
+#ifndef HPI64BIT
+ u32 dwPadding;
+#endif
+ u32 dwDataSize;
+};
+
+/** struct hpi_datastructure used up to 3.04 driver */
+struct hpi_data_legacy32 {
+ struct hpi_format Format;
+ u32 pbData;
+ u32 dwDataSize;
+};
+
+#ifdef HPI64BIT
+/* Compatibility version of struct hpi_data*/
+struct hpi_data_compat32 {
+ struct hpi_msg_format Format;
+ u32 pbData;
+ u32 dwPadding;
+ u32 dwDataSize;
+};
+#endif
+
+struct hpi_buffer {
+ /** placehoder for backward compatability (see dwBufferSize) */
+ struct hpi_msg_format reserved;
+ u32 dwCommand; /**< HPI_BUFFER_CMD_xxx*/
+ u32 dwPciAddress; /**< PCI physical address of buffer for DSP DMA */
+ u32 dwBufferSize; /**< must line up with dwDataSize of HPI_DATA*/
+};
+
+struct hpi_streamid {
+ u16 wObjectType;
+ /**< Type of object, HPI_OBJ_OSTREAM or HPI_OBJ_ISTREAM. */
+ u16 wStreamIndex; /**< OStream or IStream index. */
+};
+
+struct hpi_punchinout {
+ u32 dwPunchInSample;
+ u32 dwPunchOutSample;
+};
+
+struct hpi_subsys_msg {
+ struct hpi_resource Resource;
+};
+
+struct hpi_subsys_res {
+ u32 dwVersion;
+ u32 dwData; /* used to return extended version */
+ u16 wNumAdapters; /* number of adapters */
+ u16 wAdapterIndex;
+ u16 awAdapterList[HPI_MAX_ADAPTERS];
+};
+
+struct hpi_adapter_msg {
+ u32 dwAdapterMode; /* adapter mode */
+ u16 wAssertId; /* assert number for "test assert" call
+ wObjectIndex for find object call
+ wQueryOrSet for HPI_AdapterSetModeEx() */
+ u16 wObjectType; /* for adapter find object call */
+};
+
+union hpi_adapterx_msg {
+ struct hpi_adapter_msg adapter;
+ struct {
+ u32 dwOffset;
+ } query_flash;
+ struct {
+ u32 dwOffset;
+ u32 dwLength;
+ u32 dwKey;
+ } start_flash;
+ struct {
+ u32 dwChecksum;
+ u16 wSequence;
+ u16 wLength;
+ } program_flash;
+ struct {
+ u16 wProperty;
+ u16 wParameter1;
+ u16 wParameter2;
+ } property_set;
+ struct {
+ u16 wIndex;
+ u16 wWhat;
+ u16 wPropertyIndex;
+ } property_enum;
+ struct {
+ u16 index;
+ } module_info;
+ struct {
+ u32 dwDspAddress;
+ u32 dwCountBytes;
+ } debug_read;
+};
+
+struct hpi_adapter_res {
+ u32 dwSerialNumber;
+ u16 wAdapterType;
+ u16 wAdapterIndex; /* Is this needed? also used for wDspIndex */
+ u16 wNumIStreams;
+ u16 wNumOStreams;
+ u16 wNumMixers;
+ u16 wVersion;
+ u8 szAdapterAssert[HPI_STRING_LEN];
+};
+
+union hpi_adapterx_res {
+ struct hpi_adapter_res adapter;
+ struct {
+ u32 dwChecksum;
+ u32 dwLength;
+ u32 dwVersion;
+ } query_flash;
+ struct {
+ u16 wSequence;
+ } program_flash;
+ struct {
+ u16 wParameter1;
+ u16 wParameter2;
+ } property_get;
+};
+
+struct hpi_stream_msg {
+ union {
+ struct hpi_msg_data Data;
+ struct hpi_data_legacy32 Data32;
+ u16 wVelocity;
+ struct hpi_punchinout Pio;
+ u32 dwTimeScale;
+ struct hpi_buffer Buffer;
+ struct hpi_streamid Stream;
+ } u;
+ u16 wStreamIndex;
+ u16 wIStreamIndex;
+};
+
+struct hpi_stream_res {
+ union {
+ struct {
+ /* size of hardware buffer */
+ u32 dwBufferSize;
+ /* OutStream - data to play,
+ InStream - data recorded */
+ u32 dwDataAvailable;
+ /* OutStream - samples played,
+ InStream - samples recorded */
+ u32 dwSamplesTransferred;
+ /* Adapter - OutStream - data to play,
+ InStream - data recorded */
+ u32 dwAuxiliaryDataAvailable;
+ u16 wState; /* HPI_STATE_PLAYING, _STATE_STOPPED */
+ u16 wPadding;
+ } stream_info;
+ struct {
+ u32 dwBufferSize;
+ u32 dwDataAvailable;
+ u32 dwSamplesTransfered;
+ u16 wState;
+ u16 wOStreamIndex;
+ u16 wIStreamIndex;
+ u16 wPadding;
+ u32 dwAuxiliaryDataAvailable;
+ } legacy_stream_info;
+ struct {
+ /* bitmap of grouped OutStreams */
+ u32 dwOutStreamGroupMap;
+ /* bitmap of grouped InStreams */
+ u32 dwInStreamGroupMap;
+ } group_info;
+ } u;
+};
+
+struct hpi_mixer_msg {
+ u16 wControlIndex;
+ u16 wControlType; /* = HPI_CONTROL_METER _VOLUME etc */
+ u16 wPadding1; /* Maintain alignment of subsequent fields */
+ u16 wNodeType1; /* = HPI_SOURCENODE_LINEIN etc */
+ u16 wNodeIndex1; /* = 0..N */
+ u16 wNodeType2;
+ u16 wNodeIndex2;
+ u16 wPadding2; /* round to 4 bytes */
+};
+
+struct hpi_mixer_res {
+ u16 wSrcNodeType; /* = HPI_SOURCENODE_LINEIN etc */
+ u16 wSrcNodeIndex; /* = 0..N */
+ u16 wDstNodeType;
+ u16 wDstNodeIndex;
+ /* Also controlType for MixerGetControlByIndex */
+ u16 wControlIndex;
+ /* may indicate which DSP the control is located on */
+ u16 wDspIndex;
+};
+
+union hpi_mixerx_msg {
+ struct {
+ u16 wStartingIndex;
+ u16 wFlags;
+ u32 dwLengthInBytes; /* length in bytes of pData */
+ u32 pData; /* pointer to a data array */
+ } gcabi;
+ struct {
+ u16 wCommand;
+ u16 wIndex;
+ } store; /* for HPI_MIXER_STORE message */
+};
+
+union hpi_mixerx_res {
+ struct {
+ u32 dwBytesReturned; /* size of items returned */
+ u32 pData; /* pointer to data array */
+ u16 wMoreToDo; /* indicates if there is more to do */
+ } gcabi;
+};
+
+struct hpi_control_msg {
+ u32 dwParam1; /* generic parameter 1 */
+ u32 dwParam2; /* generic parameter 2 */
+ short anLogValue[HPI_MAX_CHANNELS];
+ u16 wAttribute; /* control attribute or property */
+ u16 wControlIndex;
+};
+
+struct hpi_control_union_msg {
+ union {
+ struct {
+ u32 dwParam1; /* generic parameter 1 */
+ u32 dwParam2; /* generic parameter 2 */
+ short anLogValue[HPI_MAX_CHANNELS];
+ } old;
+ union {
+ u32 dwFrequency;
+ u32 dwGain;
+ u32 dwBand;
+ u32 dwDeemphasis;
+ u32 dwProgram;
+ struct {
+ u32 dwMode;
+ u32 dwValue;
+ } mode;
+ } tuner;
+ } u;
+ u16 wAttribute; /* control attribute or property */
+ u16 wControlIndex;
+};
+
+struct hpi_control_res {
+ /* Could make union. dwParam, anLogValue never used in same response */
+ u32 dwParam1;
+ u32 dwParam2;
+ short anLogValue[HPI_MAX_CHANNELS];
+};
+
+union hpi_control_union_res {
+ struct {
+ u32 dwParam1;
+ u32 dwParam2;
+ short anLogValue[HPI_MAX_CHANNELS];
+ } old;
+ union {
+ u32 dwBand;
+ u32 dwFrequency;
+ u32 dwGain;
+ u32 dwLevel;
+ u32 dwDeemphasis;
+ struct {
+ u32 dwData[2];
+ u32 dwBLER;
+ } rds;
+ } tuner;
+ struct {
+ char szData[8];
+ u32 dwRemainingChars;
+ } chars8;
+};
+
+/* HPI_CONTROLX_STRUCTURES */
+
+/* Message */
+
+/** Used for all HMI variables where max length <= 8 bytes
+*/
+struct hpi_controlx_msg_cobranet_data {
+ u32 dwHmiAddress;
+ u32 dwByteCount;
+ u32 dwData[2];
+};
+
+/** Used for string data, and for packet bridge
+*/
+struct hpi_controlx_msg_cobranet_bigdata {
+ u32 dwHmiAddress;
+ u32 dwByteCount;
+ u8 *pbData;
+#ifndef HPI64BIT
+ u32 dwPadding;
+#endif
+};
+
+/** Used for PADS control reading of string fields.
+*/
+struct hpi_controlx_msg_pad_data {
+ u32 dwField;
+ u32 dwByteCount;
+ u8 *pbData;
+#ifndef HPI64BIT
+ u32 dwPadding;
+#endif
+};
+
+/** Used for generic data
+*/
+
+struct hpi_controlx_msg_generic {
+ u32 dwParam1;
+ u32 dwParam2;
+};
+
+struct hpi_controlx_msg {
+ union {
+ struct hpi_controlx_msg_cobranet_data cobranet_data;
+ struct hpi_controlx_msg_cobranet_bigdata cobranet_bigdata;
+ struct hpi_controlx_msg_generic generic;
+ struct hpi_controlx_msg_pad_data pad_data;
+ /* nothing extra to send for status read */
+ } u;
+ u16 wControlIndex;
+ u16 wAttribute; /* control attribute or property */
+};
+
+/* Response */
+
+/**
+*/
+struct hpi_controlx_res_cobranet_data {
+ u32 dwByteCount;
+ u32 dwData[2];
+};
+
+struct hpi_controlx_res_cobranet_bigdata {
+ u32 dwByteCount;
+};
+
+struct hpi_controlx_res_cobranet_status {
+ u32 dwStatus;
+ u32 dwReadableSize;
+ u32 dwWriteableSize;
+};
+
+struct hpi_controlx_res_generic {
+ u32 dwParam1;
+ u32 dwParam2;
+};
+
+struct hpi_controlx_res {
+ union {
+ struct hpi_controlx_res_cobranet_bigdata cobranet_bigdata;
+ struct hpi_controlx_res_cobranet_data cobranet_data;
+ struct hpi_controlx_res_cobranet_status cobranet_status;
+ struct hpi_controlx_res_generic generic;
+ } u;
+};
+
+struct hpi_nvmemory_msg {
+ u16 wIndex;
+ u16 wData;
+};
+
+struct hpi_nvmemory_res {
+ u16 wSizeInBytes;
+ u16 wData;
+};
+
+struct hpi_gpio_msg {
+ u16 wBitIndex;
+ u16 wBitData;
+};
+
+struct hpi_gpio_res {
+ u16 wNumberInputBits;
+ u16 wNumberOutputBits;
+ u16 wBitData[4];
+};
+
+struct hpi_async_msg {
+ u32 dwEvents;
+ u16 wMaximumEvents;
+ u16 wPadding;
+};
+
+struct hpi_async_res {
+ union {
+ struct {
+ u16 wCount;
+ } count;
+ struct {
+ u32 dwEvents;
+ u16 wNumberReturned;
+ u16 wPadding;
+ } get;
+ struct hpi_async_event event;
+ } u;
+};
+
+struct hpi_watchdog_msg {
+ u32 dwTimeMs;
+};
+
+struct hpi_watchdog_res {
+ u32 dwTimeMs;
+};
+
+struct hpi_clock_msg {
+ u16 wHours;
+ u16 wMinutes;
+ u16 wSeconds;
+ u16 wMilliSeconds;
+};
+
+struct hpi_clock_res {
+ u16 wSizeInBytes;
+ u16 wHours;
+ u16 wMinutes;
+ u16 wSeconds;
+ u16 wMilliSeconds;
+ u16 wPadding;
+};
+
+struct hpi_profile_msg {
+ u16 wIndex;
+ u16 wPadding;
+};
+
+struct hpi_profile_res_open {
+ u16 wMaxProfiles;
+};
+
+struct hpi_profile_res_time {
+ u32 dwMicroSeconds;
+ u32 dwCallCount;
+ u32 dwMaxMicroSeconds;
+ u32 dwMinMicroSeconds;
+ u16 wSeconds;
+};
+
+struct hpi_profile_res_name {
+/* u8 messes up response size for 56301 DSP */
+ u16 szName[16];
+};
+
+struct hpi_profile_res {
+ union {
+ struct hpi_profile_res_open o;
+ struct hpi_profile_res_time t;
+ struct hpi_profile_res_name n;
+ } u;
+};
+
+struct hpi_message_header {
+ u16 wSize;
+ u16 wType; /* HPI_MSG_MESSAGE, HPI_MSG_RESPONSE */
+ u16 wObject; /* HPI_OBJ_* */
+ u16 wFunction; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
+ u16 wAdapterIndex; /* the adapter index */
+ u16 wDspIndex; /* the dsp index on the adapter */
+};
+
+struct hpi_message {
+ /* following fields must match HPI_MESSAGE_HEADER */
+ u16 wSize;
+ u16 wType; /* HPI_TYPE_MESSAGE, HPI_TYPE_RESPONSE */
+ u16 wObject; /* HPI_OBJ_* */
+ u16 wFunction; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
+ u16 wAdapterIndex; /* the adapter index */
+ u16 wDspIndex; /* the dsp index on the adapter */
+ union {
+ struct hpi_subsys_msg s;
+ struct hpi_adapter_msg a;
+ union hpi_adapterx_msg ax;
+ struct hpi_stream_msg d;
+ struct hpi_mixer_msg m;
+ union hpi_mixerx_msg mx; /* extended mixer; */
+ struct hpi_control_msg c; /* mixer control; */
+ /* identical to struct hpi_control_msg,
+ but field naming is improved */
+ struct hpi_control_union_msg cu;
+ struct hpi_controlx_msg cx; /* extended mixer control; */
+ struct hpi_nvmemory_msg n;
+ struct hpi_gpio_msg l; /* digital i/o */
+ struct hpi_watchdog_msg w;
+ struct hpi_clock_msg t; /* dsp time */
+ struct hpi_profile_msg p;
+ struct hpi_async_msg as;
+ } u;
+};
+
+#define HPI_MESSAGE_SIZE_BY_OBJECT { \
+ sizeof(struct hpi_message_header) , /* Default, no object type 0 */ \
+ sizeof(struct hpi_message_header) + sizeof(struct hpi_subsys_msg),\
+ sizeof(struct hpi_message_header) + sizeof(union hpi_adapterx_msg),\
+ sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
+ sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
+ sizeof(struct hpi_message_header) + sizeof(struct hpi_mixer_msg),\
+ sizeof(struct hpi_message_header) , /* no node message */ \
+ sizeof(struct hpi_message_header) + sizeof(struct hpi_control_msg),\
+ sizeof(struct hpi_message_header) + sizeof(struct hpi_nvmemory_msg),\
+ sizeof(struct hpi_message_header) + sizeof(struct hpi_gpio_msg),\
+ sizeof(struct hpi_message_header) + sizeof(struct hpi_watchdog_msg),\
+ sizeof(struct hpi_message_header) + sizeof(struct hpi_clock_msg),\
+ sizeof(struct hpi_message_header) + sizeof(struct hpi_profile_msg),\
+ sizeof(struct hpi_message_header) + sizeof(struct hpi_controlx_msg),\
+ sizeof(struct hpi_message_header) + sizeof(struct hpi_async_msg) \
+}
+
+struct hpi_response_header {
+ u16 wSize;
+ u16 wType; /* HPI_MSG_MESSAGE, HPI_MSG_RESPONSE */
+ u16 wObject; /* HPI_OBJ_* */
+ u16 wFunction; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
+ u16 wError; /* HPI_ERROR_xxx */
+ u16 wSpecificError; /* Adapter specific error */
+};
+
+struct hpi_response {
+/* following fields must match HPI_RESPONSE_HEADER */
+ u16 wSize;
+ u16 wType; /* HPI_MSG_MESSAGE, HPI_MSG_RESPONSE */
+ u16 wObject; /* HPI_OBJ_* */
+ u16 wFunction; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
+ u16 wError; /* HPI_ERROR_xxx */
+ u16 wSpecificError; /* Adapter specific error */
+ union {
+ struct hpi_subsys_res s;
+ struct hpi_adapter_res a;
+ union hpi_adapterx_res ax;
+ struct hpi_stream_res d;
+ struct hpi_mixer_res m;
+ union hpi_mixerx_res mx; /* extended mixer; */
+ struct hpi_control_res c; /* mixer control; */
+ /* identical to hpi_control_res, but field naming is improved */
+ union hpi_control_union_res cu;
+ struct hpi_controlx_res cx; /* extended mixer control; */
+ struct hpi_nvmemory_res n;
+ struct hpi_gpio_res l; /* digital i/o */
+ struct hpi_watchdog_res w;
+ struct hpi_clock_res t; /* dsp time */
+ struct hpi_profile_res p;
+ struct hpi_async_res as;
+ u8 bytes[52];
+ } u;
+};
+
+#define HPI_RESPONSE_SIZE_BY_OBJECT { \
+ sizeof(struct hpi_response_header) ,/* Default, no object type 0 */ \
+ sizeof(struct hpi_response_header) + sizeof(struct hpi_subsys_res),\
+ sizeof(struct hpi_response_header) + sizeof(union hpi_adapterx_res),\
+ sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
+ sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
+ sizeof(struct hpi_response_header) + sizeof(struct hpi_mixer_res),\
+ sizeof(struct hpi_response_header) , /* no node response */ \
+ sizeof(struct hpi_response_header) + sizeof(struct hpi_control_res),\
+ sizeof(struct hpi_response_header) + sizeof(struct hpi_nvmemory_res),\
+ sizeof(struct hpi_response_header) + sizeof(struct hpi_gpio_res),\
+ sizeof(struct hpi_response_header) + sizeof(struct hpi_watchdog_res),\
+ sizeof(struct hpi_response_header) + sizeof(struct hpi_clock_res),\
+ sizeof(struct hpi_response_header) + sizeof(struct hpi_profile_res),\
+ sizeof(struct hpi_response_header) + sizeof(struct hpi_controlx_res),\
+ sizeof(struct hpi_response_header) + sizeof(struct hpi_async_res) \
+}
+
+/*////////////////////////////////////////////////////////////////////////// */
+/* declarations for compact control calls */
+struct hpi_control_defn {
+ u8 wType;
+ u8 wChannels;
+ u8 wSrcNodeType;
+ u8 wSrcNodeIndex;
+ u8 wDestNodeType;
+ u8 wDestNodeIndex;
+};
+
+/*////////////////////////////////////////////////////////////////////////// */
+/* declarations for control caching (internal to HPI<->DSP interaction) */
+
+/** A compact representation of (part of) a controls state.
+Used for efficient transfer of the control state
+between DSP and host or across a network
+*/
+struct hpi_control_cache_info {
+ /** one of HPI_CONTROL_* */
+ u8 ControlType;
+ /** The total size of cached information in 32-bit words. */
+ u8 nSizeIn32bitWords;
+ /** The original index of the control on the DSP */
+ u16 ControlIndex;
+};
+
+struct hpi_control_cache_single {
+ struct hpi_control_cache_info i;
+ union {
+ struct { /* volume */
+ u16 anLog[2];
+ } v;
+ struct { /* peak meter */
+ u16 anLogPeak[2];
+ u16 anLogRMS[2];
+ } p;
+ struct { /* channel mode */
+ u16 wMode;
+ } m;
+ struct { /* multiplexer */
+ u16 wSourceNodeType;
+ u16 wSourceNodeIndex;
+ } x;
+ struct { /* level/trim */
+ u16 anLog[2];
+ } l;
+ struct { /* tuner - partial caching.
+ Some attributes go to the DSP. */
+ u32 dwFreqInkHz;
+ u16 wBand;
+ u16 wLevel;
+ } t;
+ struct { /* AESEBU Rx status */
+ u32 dwErrorStatus;
+ u32 dwSource;
+ } aes3rx;
+ struct { /* AESEBU Tx */
+ u32 dwFormat;
+ } aes3tx;
+ struct { /* tone detector */
+ u16 wState;
+ } tone;
+ struct { /* silence detector */
+ u32 dwState;
+ u32 dwCount;
+ } silence;
+ struct { /* sample clock */
+ u16 wSource;
+ u16 wSourceIndex;
+ u32 dwSampleRate;
+ } clk;
+ struct { /* generic control */
+ u32 dw1;
+ u32 dw2;
+ } g;
+ } u;
+};
+
+struct hpi_control_cache_pad {
+ struct hpi_control_cache_info i;
+ u32 dwFieldValidFlags;
+ u8 cChannel[8];
+ u8 cArtist[40];
+ u8 cTitle[40];
+ u8 cComment[200];
+ u32 dwPTY;
+ u32 dwPI;
+ u32 dwTrafficSupported;
+ u32 dwTrafficAnouncement;
+};
+
+/*/////////////////////////////////////////////////////////////////////////// */
+/* declarations for 2^N sized FIFO buffer (internal to HPI<->DSP interaction) */
+struct hpi_fifo_buffer {
+ u32 dwSize;
+ u32 dwDSPIndex;
+ u32 dwHostIndex;
+};
+
+#ifndef DISABLE_PRAGMA_PACK1
+#pragma pack(pop)
+#endif
+
+/* skip host side function declarations for DSP
+ compile and documentation extraction */
+void HPI_InitMessage(
+ struct hpi_message *phm,
+ u16 wObject,
+ u16 wFunction
+);
+
+void HPI_InitResponse(
+ struct hpi_response *phr,
+ u16 wObject,
+ u16 wFunction,
+ u16 wError
+);
+
+char HPI_HandleObject(
+ const u32 dwHandle
+);
+
+void HPI_HandleToIndexes(
+ const u32 dwHandle,
+ u16 *pwAdapterIndex,
+ u16 *pwObjectIndex,
+ u16 *pwDspIndex
+);
+
+u32 HPI_IndexesToHandle(
+ const char cObject,
+ const u16 wAdapterIndex,
+ const u16 wObjectIndex,
+ const u16 wDspIndex
+);
+
+/*////////////////////////////////////////////////////////////////////////// */
+
+/* main HPI entry point */
+HPI_HandlerFunc HPI_Message;
+
+/* UDP message */
+void HPI_MessageUDP(
+ struct hpi_message *phm,
+ struct hpi_response *phr,
+ unsigned int nTimeout
+);
+
+/* used in PnP OS/driver */
+u16 HPI_SubSysCreateAdapter(
+ struct hpi_hsubsys *phSubSys,
+ struct hpi_resource *pResource,
+ u16 *pwAdapterIndex
+);
+
+u16 HPI_SubSysDeleteAdapter(
+ struct hpi_hsubsys *phSubSys,
+ u16 wAdapterIndex
+);
+
+void HPI_FormatToMsg(
+ struct hpi_msg_format *pMF,
+ struct hpi_format *pF
+);
+void HPI_StreamResponseToLegacy(
+ struct hpi_stream_res *pSR
+);
+
+/*////////////////////////////////////////////////////////////////////////// */
+/* declarations for individual HPI entry points */
+HPI_HandlerFunc HPI_6000;
+HPI_HandlerFunc HPI_6205;
+HPI_HandlerFunc HPI_COMMON;
+
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#endif /* _HPI_INTERNAL_H_ */
--
1.5.4.3
2
6