Re: vanilla 2.6.0-test11 and CS4236 card

From: Adam Belay (ambx1_at_neo.rr.com)
Date: 12/03/03

  • Next message: David S. Miller: "Re: Extremely slow network with e1000 & ip_conntrack"
    Date:	Tue, 2 Dec 2003 23:44:32 +0000
    To: Takashi Iwai <tiwai@suse.de>
    
    

    On Tue, Dec 02, 2003 at 06:31:57PM +0100, Takashi Iwai wrote:
    > At Tue, 2 Dec 2003 11:06:39 -0600,
    > Joseph Pingenot wrote:
    > >
    > > Howdy.
    > >
    > > I'm having problems getting the CS4236+ driver to recognize my
    > > CS4236B card. pnp finds it on boot:
    > > isapnp: Scanning for PnP cards...
    > > isapnp: Card 'CS4236B'
    > > isapnp: 1 Plug & Play card detected total
    > >
    > > but the ALSA driver doesn't pick it up.
    > > isapnp detection failed and probing for CS4236+ is not supported
    > > CS4236+ soundcard not found or device busy
    > >
    > > Furthermore, after fudging with manually setting it up via modprobe
    > > options, it's still not loading:
    > > CS4236+ soundcard not found or device busy
    > >
    > > This used to work in the 2.4 series kernel without any modprobe.conf
    > > settings; the OSS driver would pick it up.
    > >
    > > Any assistance would be greatly appreciated; this is the only thing holding
    > > me back from 2.6 goodness. ;)
    >
    > does the attached patch work? (it's untested at all...)

    > --- linux-2.6.0-test11/drivers/pnp/card.c-dist 2003-12-02 18:14:21.000000000 +0100
    > +++ linux-2.6.0-test11/drivers/pnp/card.c 2003-12-02 18:29:20.000000000 +0100
    > @@ -26,8 +26,25 @@
    > {
    > const struct pnp_card_device_id * drv_id = drv->id_table;
    > while (*drv_id->id){
    > - if (compare_pnp_id(card->id,drv_id->id))
    > - return drv_id;
    > + if (compare_pnp_id(card->id,drv_id->id)) {
    > + int i = 0;
    > + for (;;) {
    > + int found;
    > + struct pnp_dev *dev;
    > + if (i == PNP_MAX_DEVICES || ! *drv_id->devs[i].id)
    > + return drv_id;
    > + found = 0;
    > + card_for_each_dev(card, dev) {
    > + if (compare_pnp_id(dev->id, drv_id->devs[i].id)) {
    > + found = 1;
    > + break;
    > + }
    > + }
    > + if (! found)
    > + break;
    > + i++;
    > + }
    > + }
    > drv_id++;
    > }
    > return NULL;
    >

    Here's a slight cleanup of the above patch -- tested with the cs4232 driver.
    Any additional testing would be appreciated.

    --- a/drivers/pnp/card.c 2003-11-26 20:45:38.000000000 +0000
    +++ b/drivers/pnp/card.c 2003-12-02 23:06:55.000000000 +0000
    @@ -26,8 +26,18 @@
     {
             const struct pnp_card_device_id * drv_id = drv->id_table;
             while (*drv_id->id){
    - if (compare_pnp_id(card->id,drv_id->id))
    - return drv_id;
    + if (compare_pnp_id(card->id,drv_id->id)) {
    + int i = 0;
    + for (;;i++) {
    + struct pnp_dev *dev;
    + if (i == PNP_MAX_DEVICES || ! *drv_id->devs[i].id)
    + return drv_id;
    + card_for_each_dev(card, dev) {
    + if (!compare_pnp_id(dev->id, drv_id->devs[i].id))
    + break;
    + }
    + }
    + }
                     drv_id++;
             }
             return NULL;

    In this case we could also just continue if the MPU device isn't present. It
    would probably be a good convention to do so because if, for whatever reason
    (3rd party driver, resource conflicts, etc), the MPU device is busy in any
    matched card id set, the entire probe would fail.

    How about something like this? (untested)

    --- a/sound/isa/cs423x/cs4236.c 2003-11-26 20:43:05.000000000 +0000
    +++ b/sound/isa/cs423x/cs4236.c 2003-12-02 23:36:59.000000000 +0000
    @@ -294,13 +294,8 @@
                     kfree(cfg);
                     return -EBUSY;
             }
    - if (id->devs[2].id[0]) {
    + if (id->devs[2].id[0])
                     acard->mpu = pnp_request_card_device(card, id->devs[2].id, NULL);
    - if (acard->mpu == NULL) {
    - kfree(cfg);
    - return -EBUSY;
    - }
    - }

             /* WSS initialization */
             pdev = acard->wss;

    Thanks,
    Adam
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: David S. Miller: "Re: Extremely slow network with e1000 & ip_conntrack"

    Relevant Pages

    • Re: cs4281 driver missing from 2.6.0-test6-bk6?
      ... > the cs4281 ALSA driver had disappeared. ... > Is this intentional, did I screw something up, or is it accidental? ... > patents against open source projects, Mundie replied, 'Yes, absolutely.' ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • alsa i8x0 driver bug in kernel newer than 2.6test1
      ... this is my first bug report, I hope I don't leave out any vital information. ... The ALSA driver for i8x0 sound cards has a minor bug in all 2.6 test ... It's not a total stop of playback, the speed is even increased a little bit. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: preempt-timing-2.6.8-rc1
      ... Yes, jackd does exactly this, mlockall then opens the ALSA driver with ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: High pitched noise from laptop: processor.c in linux 2.6
      ... Pavel Machek wrote: ... A new ALSA driver? ... Giuseppe "Oblomov" Bilotta ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)