2000-11-23 00:50:29

by C.L. Tien - 田承禮

[permalink] [raw]
Subject: Linux driver for c-media cm8x38 ver 4.12 released

Hi all,

For those who has C-Media 8338/8738-based sound card or as on-board
sound chip and need to work with Linux or BeOS, please download the beta
driver at http://members.home.net/puresoft/cmedia.html. The Linux driver
can work with kernel 2.2 and 2.4.

For questions, please e-mail to [email protected], thanks a lot !

Sincerely,
ChenLi Tien


2000-11-23 10:10:33

by Peter Samuelson

[permalink] [raw]
Subject: Re: Linux driver for c-media cm8x38 ver 4.12 released


[ChenLi Tien, from http://members.home.net/puresoft/cmedia.html]
> - * Copyright (C) 1999 ChenLi Tien ([email protected])
> - *
> - * Based on the PCI drivers by Thomas Sailer ([email protected])
> + * Copyright (C) 1999 ChenLi Tien ([email protected])
> + * C-media support ([email protected])

This is somewhat impolite -- unless the driver is *not* actually based
on Tom's work.

> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
> + owner: THIS_MODULE,
> +#endif
> llseek: cm_llseek,
> ioctl: cm_ioctl_mixdev,
> open: cm_open_mixdev,
> release: cm_release_mixdev,
> +#else
> + &cm_llseek,
> + NULL, /* read */
> + NULL, /* write */
> + NULL, /* readdir */
> + NULL, /* poll */
> + &cm_ioctl_mixdev,
> + NULL, /* mmap */
> + &cm_open_mixdev,
> + NULL, /* flush */
> + &cm_release_mixdev,
> + NULL, /* fsync */
> + NULL, /* fasync */
> + NULL, /* check_media_change */
> + NULL, /* revalidate */
> + NULL, /* lock */
> +#endif

I don't think the (2,3,0) ifdef is necessary. Just use the labeled
initializers for all kernels. See also cm_audio_fops, cm_dsp_fops,
cm_midi_fops, cm_dmfm_fops.

> +#ifdef MODULE
> +MODULE_PARM(mpu_io, "i");
> +MODULE_PARM(fm_io, "i");
> +MODULE_PARM(spdif_inverse, "i");
> +MODULE_PARM(spdif_loop, "i");
> +MODULE_PARM(four_sp, "i");
> +MODULE_PARM(rear_out, "i");
> +MODULE_PARM(modem, "i");
> +MODULE_PARM(joystick, "i");
> #endif

No need for '#ifdef MODULE'.

> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
> +static int __init init_cmpci(void)
> +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
> +#ifdef MODULE
> +int __init init_module(void)
> +#else
> int __init init_cmpci(void)
> #endif
> +#else
> +#ifdef MODULE
> +__initfunc(int init_module(void))
> +#else
> +__initfunc(int init_cmpci(void))
> +#endif
> +#endif

__init is fine in 2.2, no need for conditional __initfunc().

Peter

2000-11-23 13:50:50

by C.L. Tien - 田承禮

[permalink] [raw]
Subject: Re: Linux driver for c-media cm8x38 ver 4.12 released



Peter Samuelson wrote:

> [ChenLi Tien, from http://members.home.net/puresoft/cmedia.html]
> > - * Copyright (C) 1999 ChenLi Tien ([email protected])
> > - *
> > - * Based on the PCI drivers by Thomas Sailer ([email protected])
> > + * Copyright (C) 1999 ChenLi Tien ([email protected])
> > + * C-media support ([email protected])
>
> This is somewhat impolite -- unless the driver is *not* actually based
> on Tom's work.
>

I didn't notice someone add this line, but I will be happy to add it.

>
> > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
> > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
> > + owner: THIS_MODULE,
> > +#endif
> > llseek: cm_llseek,
> > ioctl: cm_ioctl_mixdev,
> > open: cm_open_mixdev,
> > release: cm_release_mixdev,
> > +#else
> > + &cm_llseek,
> > + NULL, /* read */
> > + NULL, /* write */
> > + NULL, /* readdir */
> > + NULL, /* poll */
> > + &cm_ioctl_mixdev,
> > + NULL, /* mmap */
> > + &cm_open_mixdev,
> > + NULL, /* flush */
> > + &cm_release_mixdev,
> > + NULL, /* fsync */
> > + NULL, /* fasync */
> > + NULL, /* check_media_change */
> > + NULL, /* revalidate */
> > + NULL, /* lock */
> > +#endif
>
> I don't think the (2,3,0) ifdef is necessary. Just use the labeled
> initializers for all kernels. See also cm_audio_fops, cm_dsp_fops,
> cm_midi_fops, cm_dmfm_fops.

Yes, as 2.3.x series is not for end-user, I can remove them. I keep it for
easy to tell what's different for kernel 2.3 and 2.4.

>
>
> > +#ifdef MODULE
> > +MODULE_PARM(mpu_io, "i");
> > +MODULE_PARM(fm_io, "i");
> > +MODULE_PARM(spdif_inverse, "i");
> > +MODULE_PARM(spdif_loop, "i");
> > +MODULE_PARM(four_sp, "i");
> > +MODULE_PARM(rear_out, "i");
> > +MODULE_PARM(modem, "i");
> > +MODULE_PARM(joystick, "i");
> > #endif
>
> No need for '#ifdef MODULE'.

I will remove it if kernel 2.2 can work.

>
>
> > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
> > +static int __init init_cmpci(void)
> > +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
> > +#ifdef MODULE
> > +int __init init_module(void)
> > +#else
> > int __init init_cmpci(void)
> > #endif
> > +#else
> > +#ifdef MODULE
> > +__initfunc(int init_module(void))
> > +#else
> > +__initfunc(int init_cmpci(void))
> > +#endif
> > +#endif
>
> __init is fine in 2.2, no need for conditional __initfunc().
>
> Peter

Thanks for your suggestion, I can change it.

ChenLi Tien

2000-11-23 14:58:06

by Peter Samuelson

[permalink] [raw]
Subject: Re: Linux driver for c-media cm8x38 ver 4.12 released


[ChenLi Tien]
> > I don't think the (2,3,0) ifdef is necessary. Just use the labeled
> > initializers for all kernels. See also cm_audio_fops, cm_dsp_fops,
> > cm_midi_fops, cm_dmfm_fops.
>
> Yes, as 2.3.x series is not for end-user, I can remove them. I keep it for
> easy to tell what's different for kernel 2.3 and 2.4.

What I meant was, the code which you have '#if version >= 2.3.0' is
also valid for 2.2. You should not have any conditional code there
except the 'owner:' member, which is '#if version >= 2.4.0'.

> > No need for '#ifdef MODULE'.
>
> I will remove it if kernel 2.2 can work.

It can. I checked 2.2.0.

Peter

2000-11-28 02:31:53

by C.L. Tien - 田承禮

[permalink] [raw]
Subject: Re: Linux driver for c-media cm8x38 ver 4.12 released

Hi,

I change it so a release 4.14 posted at
http://members.home.net/puresoft/cmedia.html. This version has no functional
change.

Sincerely,
ChenLi Tien

Peter Samuelson wrote:

> [ChenLi Tien]
> > > I don't think the (2,3,0) ifdef is necessary. Just use the labeled
> > > initializers for all kernels. See also cm_audio_fops, cm_dsp_fops,
> > > cm_midi_fops, cm_dmfm_fops.
> >
> > Yes, as 2.3.x series is not for end-user, I can remove them. I keep it for
> > easy to tell what's different for kernel 2.3 and 2.4.
>
> What I meant was, the code which you have '#if version >= 2.3.0' is
> also valid for 2.2. You should not have any conditional code there
> except the 'owner:' member, which is '#if version >= 2.4.0'.
>
> > > No need for '#ifdef MODULE'.
> >
> > I will remove it if kernel 2.2 can work.
>
> It can. I checked 2.2.0.
>
> Peter