asihpi: add hwdep (experimental)
PATCH 5/5 asihpi: add hwdep (experimental)
Add hpi ioctl via hwdep (experimental, disabled by default). Adjust sampleclock control to use new hpi apis.
---
pci/Kconfig +1 -0
@@ -17,6 +17,7 @@ config SND_ASIHPI depends on SND && X86 select FW_LOADER select SND_PCM + select SND_HWDEP help Say 'Y' or 'M' to include support for AudioScience ASIxxxx soundcards.
pci/asihpi/asihpi.c +66 -15
168 lines not on this page · raw message
*asihpi_control,
struct snd_kcontrol_new *snd_control)
{
snd_control->info = snd_asihpi_clkrate_info; snd_control->get = snd_asihpi_clkrate_get;
- snd_control->put = snd_asihpi_clkrate_put;
+ snd_control->access =
+ SNDRV_CTL_ELEM_ACCESS_VOLATILE | SNDRV_CTL_ELEM_ACCESS_READ;
asihpi_ctl_name(snd_control, asihpi_control, "Rate");
}
-
/*------------------------------------------------------------
Mixer
------------------------------------------------------------*/
@@ -2404,6 +2455,14 @@ static int __devinit snd_card_asihpi_mix
return err;
snd_asihpi_clkrate_new(&asihpi_control,
&snd_control);
+ err = snd_ctl_add(card,
+ snd_ctl_new1(&snd_control, asihpi));
+ if (err < 0)
+ return err;
+ if (asihpi->cc.has_local)
+ snd_asihpi_clklocal_new(&asihpi_control,
+ &snd_control);
+
break;
case HPI_CONTROL_CONNECTION: /* ignore these */
continue;
@@ -2510,6 +2569,55 @@ static void __devinit snd_asihpi_proc_in
}
/*------------------------------------------------------------
+ HWDEP
+ ------------------------------------------------------------*/ +
+static int snd_asihpi_hpi_open(struct snd_hwdep * hw, struct file *file) +{
+ return 0;
+}
+
+static int snd_asihpi_hpi_release(struct snd_hwdep * hw, struct file *file) +{
+ return 0;
+}
+
+long asihpi_hpi_ioctl(struct file *file,
+ unsigned int cmd, unsigned long arg);
+
+static int snd_asihpi_hpi_ioctl(struct snd_hwdep * hw, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ return asihpi_hpi_ioctl(file, cmd, arg);
+}
+
+
+/* results in /dev/snd/hwC#D0 file for each card with index #
+ also /proc/asound/hwdep will contain '#-00: asihpi (HPI) for each card'
+*/
+int __devinit snd_asihpi_hpi_new(struct snd_card_asihpi *asihpi, int device,
+ struct snd_hwdep ** rhwdep)
+{
+ struct snd_hwdep *hw;
+ int err;
+
+ if (rhwdep)
+ *rhwdep = NULL;
+ err = snd_hwdep_new(asihpi->card, "HPI", device, &hw);
+ if (err < 0)
+ return err;
+ strcpy(hw->name, "asihpi (HPI)");
+ hw->iface = SNDRV_HWDEP_IFACE_LAST;
+ hw->ops.open = snd_asihpi_hpi_open;
+ hw->ops.ioctl = snd_asihpi_hpi_ioctl;
+ hw->ops.release = snd_asihpi_hpi_release;
+ hw->private_data = asihpi;
+ if (rhwdep)
+ *rhwdep = hw;
+ return 0;
+}
+
+/*------------------------------------------------------------
CARD
------------------------------------------------------------*/
int __devinit snd_asihpi_bind(struct hpi_adapter *hpi_card)
@@ -2602,10 +2710,13 @@ int __devinit snd_asihpi_bind(struct hpi
HPI_CONTROL_SAMPLECLOCK, &hControl);
if (!err)
- err = HPI_SampleClock_SetSampleRate(phSubSys,
+ err = HPI_SampleClock_SetLocalRate(phSubSys,
hControl, adapter_fs);
snd_asihpi_proc_init(asihpi);
+
+ if (enable_hpi_hwdep)
+ snd_asihpi_hpi_new(asihpi, 0, NULL);
if (asihpi->support_mmap)
strcpy(card->driver, "ASIHPI-MMAP");
pci/asihpi/hpimod.c +87 -91
236 lines not on this page · raw message
Re: [PATCH 2/5] asihpi: Add new HPI apis for sampleclock, tuner
Patch 2/5 is waiting moderator approval (its 90K)
Re: [PATCH 2/5] asihpi: Add new HPI apis for sampleclock, tuner
At Thu, 06 Mar 2008 15:07:54 +1300,
Quoted 2 lines · Eliot Blennerhassett
Patch 2/5 is waiting moderator approval (its 90K)
Add my address to Cc at the next time so that I get patches directly.
thanks,
Takashi
Re: [PATCH 2/5] asihpi: Add new HPI apis for sampleclock, tuner
Quoted 6 lines · Takashi Iwai
At Thu, 06 Mar 2008 15:07:54 +1300,
Quoted 1 line · Eliot Blennerhassett
Patch 2/5 is waiting moderator approval (its 90K)
Add my address to Cc at the next time so that I get patches directly.
I've emailed Jaroslav a number of times asking to up the limit but have as usual seen them disappear into the great perex email blackhole. By now I'm simply rejecting them, asking posters to contact Jaroslav themselves...
The limit's at 60K right now which has been too little for quite a few valid patches. I believe that upto now 200K should mostly do but haven't in fact seen anything being size-moderated which _wasn't_ valid list content -- the size moderation category seems fairly useless to start with therefore.
Rene.
Re: [PATCH 2/5] asihpi: Add new HPI apis for sampleclock, tuner
At Thu, 06 Mar 2008 11:05:40 +0100,
Quoted 10 lines · Rene Herman
Quoted 6 lines · Takashi Iwai
At Thu, 06 Mar 2008 15:07:54 +1300,
Quoted 1 line · Eliot Blennerhassett
Patch 2/5 is waiting moderator approval (its 90K)
Add my address to Cc at the next time so that I get patches directly.
Quoted 8 lines
I've emailed Jaroslav a number of times asking to up the limit but have as usual seen them disappear into the great perex email blackhole. By now I'm simply rejecting them, asking posters to contact Jaroslav themselves...
The limit's at 60K right now which has been too little for quite a few valid patches. I believe that upto now 200K should mostly do but haven't in fact seen anything being size-moderated which _wasn't_ valid list content -- the size moderation category seems fairly useless to start with therefore.
Besides that, in general it's recommended to add relevent developers to Cc's if you post patches. Then patches reach directly to the developers and have more chances to get in more quickly and certainly.
Takashi
Re: [PATCH 2/5] asihpi: Add new HPI apis for sampleclock, tuner
Quoted 4 lines · Takashi Iwai
Besides that, in general it's recommended to add relevent developers to Cc's if you post patches. Then patches reach directly to the developers and have more chances to get in more quickly and certainly.
But note that there are a few subsystem maintainers who don't like this so it's worth looking at what other people submitting patches for the subsystem are doing.
Re: [PATCH 2/5] asihpi: Add new HPI apis for sampleclock, tuner
At Thu, 6 Mar 2008 10:17:04 +0000,
Quoted 11 lines · Mark Brown
Quoted 4 lines · Takashi Iwai
Besides that, in general it's recommended to add relevent developers to Cc's if you post patches. Then patches reach directly to the developers and have more chances to get in more quickly and certainly.
But note that there are a few subsystem maintainers who don't like this so it's worth looking at what other people submitting patches for the subsystem are doing.
Yeah there are always exceptions :) But, *in general*, Cc to developers is a good thing.
BTW, this doesn't mean that you don't send patches to ML. The patches should be sent to ML, and Cc to maintainers/developers.
Takashi