* conversion of opti93x driver to use cs4231-lib
@ 2008-01-07 19:08 Krzysztof Helt
2008-01-08 11:38 ` Takashi Iwai
0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Helt @ 2008-01-07 19:08 UTC (permalink / raw)
To: Alsa-devel
Hi,
I posted some time ago two patches which converts opti93x driver to use cs4231-lib library.
The opti93x chips are almost compatible with the cs4231 differing mostly by mixer.
This change greatly reduces the source of the opti drivers.
Here are patches:
[addition of opti93x details to the cs4231-lib]
http://mailman.alsa-project.org/pipermail/alsa-devel/2007-September/003395.html
and
[conversion of opti93x driver to use cs4231-lib]
http://mailman.alsa-project.org/pipermail/alsa-devel/2007-September/003396.html
I will rediff the second patch as there were some changes to opti93x driver after sending the patch.
If it is not a good idea to do such conversion, please reply and drop patches.
Regards,
Krzysztof
------------------------------------------------------------
Walcz w kosmicznej wojnie w nowej grze!
Kliknij >>> http://link.interia.pl/f1cc1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: conversion of opti93x driver to use cs4231-lib
2008-01-07 19:08 conversion of opti93x driver to use cs4231-lib Krzysztof Helt
@ 2008-01-08 11:38 ` Takashi Iwai
2008-01-08 14:16 ` Rene Herman
0 siblings, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2008-01-08 11:38 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: Rene Herman, Alsa-devel
At Mon, 7 Jan 2008 20:08:01 +0100,
Krzysztof Helt wrote:
>
> Hi,
>
> I posted some time ago two patches which converts opti93x driver to use cs4231-lib library.
>
> The opti93x chips are almost compatible with the cs4231 differing mostly by mixer.
>
> This change greatly reduces the source of the opti drivers.
>
> Here are patches:
> [addition of opti93x details to the cs4231-lib]
> http://mailman.alsa-project.org/pipermail/alsa-devel/2007-September/003395.html
>
> and
> [conversion of opti93x driver to use cs4231-lib]
> http://mailman.alsa-project.org/pipermail/alsa-devel/2007-September/003396.html
>
> I will rediff the second patch as there were some changes to opti93x driver after sending the patch.
>
> If it is not a good idea to do such conversion, please reply and drop patches.
The only concern is whether this breaks the workign opti9xx stuff.
If someone can confirm it's OK, then I'm 100% for these patches.
Added Rene to Cc to hear his opinion.
Takashi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: conversion of opti93x driver to use cs4231-lib
2008-01-08 11:38 ` Takashi Iwai
@ 2008-01-08 14:16 ` Rene Herman
2008-01-08 14:36 ` Rene Herman
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Rene Herman @ 2008-01-08 14:16 UTC (permalink / raw)
To: Takashi Iwai, Jaroslav Kysela; +Cc: Alsa-devel, Krzysztof Helt
On 08-01-08 12:38, Takashi Iwai wrote:
Jaroslav -- do you know/remember why opti93x didn't use cs4231-lib?
> At Mon, 7 Jan 2008 20:08:01 +0100,
> Krzysztof Helt wrote:
>> Hi,
>>
>> I posted some time ago two patches which converts opti93x driver to use cs4231-lib library.
>>
>> The opti93x chips are almost compatible with the cs4231 differing mostly by mixer.
>>
>> This change greatly reduces the source of the opti drivers.
>>
>> Here are patches:
>> [addition of opti93x details to the cs4231-lib]
>> http://mailman.alsa-project.org/pipermail/alsa-devel/2007-September/003395.html
>>
>> and
>> [conversion of opti93x driver to use cs4231-lib]
>> http://mailman.alsa-project.org/pipermail/alsa-devel/2007-September/003396.html
>>
>> I will rediff the second patch as there were some changes to opti93x driver after sending the patch.
>>
>> If it is not a good idea to do such conversion, please reply and drop patches.
>
> The only concern is whether this breaks the workign opti9xx stuff.
> If someone can confirm it's OK, then I'm 100% for these patches.
>
> Added Rene to Cc to hear his opinion.
Missed this one originally. I'll look into this in some detail but will need
a few days. Obviously, if it works, it's desirable. Maybe Jaroslav knows why
it's not that way now?
Rene.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: conversion of opti93x driver to use cs4231-lib
2008-01-08 14:16 ` Rene Herman
@ 2008-01-08 14:36 ` Rene Herman
2008-01-20 16:13 ` Rene Herman
2008-01-08 15:15 ` Jaroslav Kysela
2008-01-08 16:32 ` Krzysztof Helt
2 siblings, 1 reply; 8+ messages in thread
From: Rene Herman @ 2008-01-08 14:36 UTC (permalink / raw)
To: Rene Herman, Krzysztof Helt; +Cc: Takashi Iwai, Alsa-devel, Jaroslav Kysela
On 08-01-08 15:16, Rene Herman wrote:
>> At Mon, 7 Jan 2008 20:08:01 +0100,
>> Krzysztof Helt wrote:
>>> I will rediff the second patch as there were some changes to opti93x
>>> driver after sending the patch.
> Missed this one originally. I'll look into this in some detail but will
> need a few days. Obviously, if it works, it's desirable. Maybe Jaroslav
> knows why it's not that way now?
Oh, and by the way, I suppose it'll be trivial but a rediff would be good
for testing.
Rene.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: conversion of opti93x driver to use cs4231-lib
2008-01-08 14:16 ` Rene Herman
2008-01-08 14:36 ` Rene Herman
@ 2008-01-08 15:15 ` Jaroslav Kysela
2008-01-08 16:32 ` Krzysztof Helt
2 siblings, 0 replies; 8+ messages in thread
From: Jaroslav Kysela @ 2008-01-08 15:15 UTC (permalink / raw)
To: Rene Herman; +Cc: Takashi Iwai, Alsa-devel, Krzysztof Helt
On Tue, 8 Jan 2008, Rene Herman wrote:
> On 08-01-08 12:38, Takashi Iwai wrote:
>
> Jaroslav -- do you know/remember why opti93x didn't use cs4231-lib?
>
> > At Mon, 7 Jan 2008 20:08:01 +0100,
> > Krzysztof Helt wrote:
> >> Hi,
> >>
> >> I posted some time ago two patches which converts opti93x driver to use cs4231-lib library.
> >>
> >> The opti93x chips are almost compatible with the cs4231 differing mostly by mixer.
> >>
> >> This change greatly reduces the source of the opti drivers.
> >>
> >> Here are patches:
> >> [addition of opti93x details to the cs4231-lib]
> >> http://mailman.alsa-project.org/pipermail/alsa-devel/2007-September/003395.html
> >>
> >> and
> >> [conversion of opti93x driver to use cs4231-lib]
> >> http://mailman.alsa-project.org/pipermail/alsa-devel/2007-September/003396.html
> >>
> >> I will rediff the second patch as there were some changes to opti93x driver after sending the patch.
> >>
> >> If it is not a good idea to do such conversion, please reply and drop patches.
> >
> > The only concern is whether this breaks the workign opti9xx stuff.
> > If someone can confirm it's OK, then I'm 100% for these patches.
> >
> > Added Rene to Cc to hear his opinion.
>
> Missed this one originally. I'll look into this in some detail but will
> need a few days. Obviously, if it works, it's desirable. Maybe Jaroslav
> knows why it's not that way now?
I think that it was opti driver author decision, but I also don't see any
problem to use common code (if verified to be working, of course).
Jaroslav
-----
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: conversion of opti93x driver to use cs4231-lib
2008-01-08 14:16 ` Rene Herman
2008-01-08 14:36 ` Rene Herman
2008-01-08 15:15 ` Jaroslav Kysela
@ 2008-01-08 16:32 ` Krzysztof Helt
2 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Helt @ 2008-01-08 16:32 UTC (permalink / raw)
To: Rene Herman, Takashi Iwai, Jaroslav Kysela; +Cc: Alsa-devel
On Tue, 08 Jan 2008 15:16:57 +0100
Rene Herman <rene.herman@keyaccess.nl> wrote:
> On 08-01-08 12:38, Takashi Iwai wrote:
>
> Jaroslav -- do you know/remember why opti93x didn't use cs4231-lib?
>
One reason is that OPTi93x mixer has slightly different control bits. That's why the first patch is added.
A big part of the second patch changes (removes) lines from the code ifdef-ed for opti93x only. Below
is the part of patch which shows differences in common paths with opti92x. It is much much shorter.
One thing to notice - the changed code has no common patch with opti92x-ad1848 as it is always
ifdef-ed as CS4231 code. So only opti92x-cs4231 can be affected. Judge it from the diff below.
@@ -34,15 +34,10 @@
#include <asm/io.h>
#include <asm/dma.h>
#include <sound/core.h>
-#ifdef CS4231
+#if defined(CS4231) || defined(OPTi93X)
#include <sound/cs4231.h>
#else
-#ifndef OPTi93X
#include <sound/ad1848.h>
-#else
-#include <sound/control.h>
-#include <sound/pcm.h>
-#endif /* OPTi93X */
#endif /* CS4231 */
#include <sound/mpu401.h>
#include <sound/opl3.h>
@@ -110,7 +105,6 @@ module_param(dma2, int, 0444);
MODULE_PARM_DESC(dma2, "2nd dma # for opti9xx driver.");
#endif /* CS4231 || OPTi93X */
-#define OPTi9XX_HW_DETECT 0
#define OPTi9XX_HW_82C928 1
#define OPTi9XX_HW_82C929 2
#define OPTi9XX_HW_82C924 3
@@ -1783,11 +748,11 @@ static int __devinit snd_opti9xx_probe(s
static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1};
int error;
struct snd_opti9xx *chip = card->private_data;
-#if defined(OPTi93X)
- struct snd_opti93x *codec;
-#elif defined(CS4231)
+#if defined(CS4231) || defined(OPTi93X)
struct snd_cs4231 *codec;
+#ifdef CS4231
struct snd_timer *timer;
+#endif
#else
struct snd_ad1848 *codec;
#endif
@@ -1819,26 +784,31 @@ static int __devinit snd_opti9xx_probe(s
if ((error = snd_opti9xx_configure(chip)))
return error;
-#if defined(OPTi93X)
- if ((error = snd_opti93x_create(card, chip, chip->dma1, chip->dma2, &codec)))
- return error;
- if ((error = snd_opti93x_pcm(codec, 0, &pcm)) < 0)
- return error;
- if ((error = snd_opti93x_mixer(codec)) < 0)
- return error;
-#elif defined(CS4231)
+#if defined(CS4231) || defined(OPTi93X)
if ((error = snd_cs4231_create(card, chip->wss_base + 4, -1,
chip->irq, chip->dma1, chip->dma2,
- CS4231_HW_DETECT,
- 0,
+#ifdef CS4231
+ CS4231_HW_DETECT, 0,
+#else /* OPTi93x */
+ CS4231_HW_OPTI93X, CS4231_HWSHARE_IRQ,
+#endif
&codec)) < 0)
return error;
+ chip->codec = codec;
if ((error = snd_cs4231_pcm(codec, 0, &pcm)) < 0)
return error;
if ((error = snd_cs4231_mixer(codec)) < 0)
return error;
+#ifdef CS4231
if ((error = snd_cs4231_timer(codec, 0, &timer)) < 0)
return error;
+#else /* OPTI93X */
+ error = request_irq(chip->irq, snd_opti93x_interrupt, IRQF_DISABLED, DEV_NAME" - WSS", codec);
+ if (error < 0) {
+ snd_printk(KERN_ERR "opti9xx: can't grab IRQ %d\n", chip->irq);
+ return error;
+ }
+#endif
#else
if ((error = snd_ad1848_create(card, chip->wss_base + 4,
chip->irq, chip->dma1,
----------------------------------------------------------------------
Chcesz kupic aparat? Sprawdz, ktory jest najlepszy!
Kliknij >>> http://link.interia.pl/f1cd3
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: conversion of opti93x driver to use cs4231-lib
2008-01-08 14:36 ` Rene Herman
@ 2008-01-20 16:13 ` Rene Herman
0 siblings, 0 replies; 8+ messages in thread
From: Rene Herman @ 2008-01-20 16:13 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: Takashi Iwai, Alsa-devel, Jaroslav Kysela
On 08-01-08 15:36, Rene Herman wrote:
>> Missed this one originally. I'll look into this in some detail but
>> will need a few days. Obviously, if it works, it's desirable. Maybe
>> Jaroslav knows why it's not that way now?
>
> Oh, and by the way, I suppose it'll be trivial but a rediff would be
> good for testing.
Just now found time but could you provide an updated one? Mucho reject on
cs4231_lib (which I didn't actually look at). Against some mainline tree
(2.6.23.x or 2.6.24-rc) is preferred. The test box is not my main box and
recompiling stuff on it is failry painful.
(I have 930, 931 and 933 to test with by the way...)
Rene.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: conversion of opti93x driver to use cs4231-lib
@ 2008-01-22 9:56 krzysztof.h1
0 siblings, 0 replies; 8+ messages in thread
From: krzysztof.h1 @ 2008-01-22 9:56 UTC (permalink / raw)
To: Rene Herman, Krzysztof Helt; +Cc: Takashi Iwai, Alsa-devel, Jaroslav Kysela
> On 08-01-08 15:36, Rene Herman wrote:
>
> >> Missed this one originally. I'll look into this in some detail but
> >> will need a few days. Obviously, if it works, it's desirable. Maybe
> >> Jaroslav knows why it's not that way now?
> >
> > Oh, and by the way, I suppose it'll be trivial but a rediff would be
> > good for testing.
>
I'll do a new diff on weekend.
Thanks,
Krzysztof
PS. I tested it on 931 and 933.
----------------------------------------------------------------------
Sprawdz, ktore komorki sa najmodniejsze!
Kliknij >>> http://link.interia.pl/f1cd4
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-01-22 9:56 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-07 19:08 conversion of opti93x driver to use cs4231-lib Krzysztof Helt
2008-01-08 11:38 ` Takashi Iwai
2008-01-08 14:16 ` Rene Herman
2008-01-08 14:36 ` Rene Herman
2008-01-20 16:13 ` Rene Herman
2008-01-08 15:15 ` Jaroslav Kysela
2008-01-08 16:32 ` Krzysztof Helt
-- strict thread matches above, loose matches on Subject: below --
2008-01-22 9:56 krzysztof.h1
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.