lkml.org 
[lkml]   [1998]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectPatch: support for Opti924 PnP
    The attached patch adds support for the Opti924
    in Plug-n-Play mode.

    -aw@mail1.bet1.puv.fi
    --- linux/drivers/sound/mad16.c.OLD Sat May 16 18:29:31 1998
    +++ linux/drivers/sound/mad16.c Sat May 16 22:42:25 1998
    @@ -16,7 +16,7 @@
    * OAK OTI-601D Mozart
    * OPTi 82C929 MAD16 Pro
    * OPTi 82C930
    - * OPTi 82C924 (in non PnP mode)
    + * OPTi 82C924
    *
    * These audio interface chips don't produce sound themselves. They just
    * connect some other components (OPL-[234] and a WSS compatible codec)
    @@ -60,6 +60,10 @@
    * Changes
    *
    * Alan Cox Clean up, added module selections.
    + *
    + * A. Wik Added support for Opti924 PnP.
    + * Improved debugging support. 16-May-1998
    + *
    */

    #include "sound_config.h"
    @@ -116,11 +120,14 @@
    static int board_type = C928;

    static int *mad16_osp;
    -static int c931_detected; /* minor diferences from C930 */
    +static int c931_detected; /* minor differences from C930 */
    +static char c924pnp = 0; /* " " " C924 */
    +static int debug = 0; /* debugging output */

    -#ifndef DDB
    -#define DDB(x)
    +#ifdef DDB
    +#undef DDB
    #endif
    +#define DDB(x) {if (debug) x;}

    static unsigned char mad_read(int port)
    {
    @@ -146,7 +153,9 @@
    break;

    case C924:
    - outb((0xE5), PASSWD_REG);
    + if (!c924pnp)
    + outb((0xE5), PASSWD_REG); else
    + outb((0xE5), PASSWD_REG - 0x80);
    break;
    }

    @@ -156,7 +165,9 @@
    tmp = inb(0xe0f); /* Read from data reg */
    }
    else
    - tmp = inb(port);
    + if (!c924pnp)
    + tmp = inb(port); else
    + tmp = inb(port-0x80);
    restore_flags(flags);

    return tmp;
    @@ -185,7 +196,9 @@
    break;

    case C924:
    - outb((0xE5), PASSWD_REG);
    + if (!c924pnp)
    + outb((0xE5), PASSWD_REG); else
    + outb((0xE5), PASSWD_REG - 0x80);
    break;
    }

    @@ -195,7 +208,9 @@
    outb(((unsigned char) (value & 0xff)), 0xe0f);
    }
    else
    - outb(((unsigned char) (value & 0xff)), port);
    + if (!c924pnp)
    + outb(((unsigned char) (value & 0xff)), port); else
    + outb(((unsigned char) (value & 0xff)), port-0x80);
    restore_flags(flags);
    }

    @@ -288,7 +303,9 @@
    return 0;
    }
    for (i = 0xf8d; i <= 0xf98; i++)
    - DDB(printk("Port %0x (init value) = %0x\n", i, mad_read(i)));
    + if (!c924pnp)
    + DDB(printk("Port %0x (init value) = %0x\n", i, mad_read(i))) else
    + DDB(printk("Port %0x (init value) = %0x\n", i-0x80, mad_read(i)));

    if (board_type == C930)
    return detect_c930();
    @@ -431,6 +448,11 @@
    board_type = C924;

    DDB(printk("Detect using password = 0xE5\n"));
    +
    + if (!detect_mad16()) {
    + c924pnp++;
    + DDB(printk("Detect using password = 0xE5 (again), port offset -0x80\n"));
    + }

    if (!detect_mad16()) /* No luck. Try different model */
    {
    @@ -523,7 +545,9 @@


    for (i = 0xf8d; i <= 0xf93; i++)
    - DDB(printk("port %03x = %02x\n", i, mad_read(i)));
    + if (!c924pnp)
    + DDB(printk("port %03x = %02x\n", i, mad_read(i))) else
    + DDB(printk("port %03x = %02x\n", i-0x80, mad_read(i)));

    /*
    * Set the WSS address
    @@ -863,6 +887,7 @@
    MODULE_PARM(cddma,"i");
    MODULE_PARM(opl4,"i");
    MODULE_PARM(joystick,"i");
    +MODULE_PARM(debug,"i");

    EXPORT_NO_SYMBOLS;
    \
     
     \ /
      Last update: 2005-03-22 13:42    [W:0.022 / U:60.488 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site