Ignore:
Timestamp:
Jul 13, 2007, 4:47:31 PM (18 years ago)
Author:
Brendan Oakley
Message:

Merged to Alsa 0.9.0rc3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712.c

    r207 r210  
    700700
    701701static snd_kcontrol_new_t snd_ice1712_mixer_digmix_route_ac97 __devinitdata = {
    702 #ifdef TARGET_OS2
    703         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    704         "Digital Mixer To AC97",0,0,
    705         snd_ice1712_digmix_route_ac97_info,
    706         snd_ice1712_digmix_route_ac97_get,
    707         snd_ice1712_digmix_route_ac97_put,0
    708 #else
    709         iface: SNDRV_CTL_ELEM_IFACE_MIXER,
    710         name: "Digital Mixer To AC97",
    711         info: snd_ice1712_digmix_route_ac97_info,
    712         get: snd_ice1712_digmix_route_ac97_get,
    713         put: snd_ice1712_digmix_route_ac97_put,
    714 #endif
     702        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     703        .name = "Digital Mixer To AC97",
     704        .info = snd_ice1712_digmix_route_ac97_info,
     705        .get = snd_ice1712_digmix_route_ac97_get,
     706        .put = snd_ice1712_digmix_route_ac97_put,
    715707};
    716708
     
    873865}
    874866
    875 #ifdef TARGET_OS2
    876 static ice1712_cs8427_ops_t snd_ice1712_ap_cs8427_ops = {
    877         ap_cs8427_sendbytes,
    878         ap_cs8427_readbytes,
    879         ap_cs8427_probeaddr,
     867static snd_i2c_ops_t ap_cs8427_i2c_ops = {
     868        .sendbytes = ap_cs8427_sendbytes,
     869        .readbytes = ap_cs8427_readbytes,
     870        .probeaddr = ap_cs8427_probeaddr,
    880871};
    881 #else
    882 static snd_i2c_ops_t ap_cs8427_i2c_ops = {
    883         sendbytes: ap_cs8427_sendbytes,
    884         readbytes: ap_cs8427_readbytes,
    885         probeaddr: ap_cs8427_probeaddr,
    886 };
    887 #endif
    888872
    889873/*
     
    967951}
    968952
    969 #ifdef TARGET_OS2
    970953static snd_i2c_bit_ops_t snd_ice1712_ewx_cs8427_bit_ops = {
    971         ewx_i2c_start,
    972         ewx_i2c_stop,
    973         ewx_i2c_direction,
    974         ewx_i2c_setlines,
    975         ewx_i2c_getclock,
    976         ewx_i2c_getdata,
     954        .start = ewx_i2c_start,
     955        .stop = ewx_i2c_stop,
     956        .direction = ewx_i2c_direction,
     957        .setlines = ewx_i2c_setlines,
     958        .getclock = ewx_i2c_getclock,
     959        .getdata = ewx_i2c_getdata,
    977960};
    978 #else
    979 static snd_i2c_bit_ops_t snd_ice1712_ewx_cs8427_bit_ops = {
    980         start: ewx_i2c_start,
    981         stop: ewx_i2c_stop,
    982         direction: ewx_i2c_direction,
    983         setlines: ewx_i2c_setlines,
    984         getclock: ewx_i2c_getclock,
    985         getdata: ewx_i2c_getdata,
    986 };
    987 #endif
    988961
    989962/* AK4524 chip select; address 0x48 bit 0-3 */
    990 static void snd_ice1712_ews88mt_chip_select(ice1712_t *ice, int chip_mask)
     963static int snd_ice1712_ews88mt_chip_select(ice1712_t *ice, int chip_mask)
    991964{
    992965        unsigned char data, ndata;
    993966
    994         snd_assert(chip_mask >= 0 && chip_mask <= 0x0f, return);
     967        snd_assert(chip_mask >= 0 && chip_mask <= 0x0f, return -EINVAL);
    995968        snd_i2c_lock(ice->i2c);
    996         snd_runtime_check(snd_i2c_readbytes(ice->pcf8574[1], &data, 1) == 1, snd_i2c_unlock(ice->i2c); return);
     969        if (snd_i2c_readbytes(ice->pcf8574[1], &data, 1) != 1)
     970                goto __error;
    997971        ndata = (data & 0xf0) | chip_mask;
    998972        if (ndata != data)
    999                 snd_runtime_check(snd_i2c_sendbytes(ice->pcf8574[1], &ndata, 1) == 1, snd_i2c_unlock(ice->i2c); return);
     973                if (snd_i2c_sendbytes(ice->pcf8574[1], &ndata, 1) != 1)
     974                        goto __error;
    1000975        snd_i2c_unlock(ice->i2c);
     976        return 0;
     977
     978     __error:
     979        snd_i2c_unlock(ice->i2c);
     980        snd_printk(KERN_ERR "AK4524 chip select failed, check cable to the front module\n");
     981        return -EIO;
    1001982}
    1002983
     
    1016997        if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_EWS88MT) {
    1017998                /* assert AK4524 CS */
    1018                 snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f);
     999                if (snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f) < 0)
     1000                        return;
    10191001                //snd_ice1712_ews88mt_chip_select(ice, 0x0f);
    10201002        }
     
    11701152        unsigned char reg[2] = { 0x80 | 4, 0 };   /* CS8427 auto increment | register number 4 + data */
    11711153        unsigned char val, nval;
     1154        int res = 0;
     1155       
    11721156        snd_i2c_lock(ice->i2c);
    11731157        if (snd_i2c_sendbytes(ice->cs8427, reg, 1) != 1) {
    11741158                snd_i2c_unlock(ice->i2c);
    1175                 return -EREMOTE;
     1159                return -EIO;
    11761160        }
    11771161        if (snd_i2c_readbytes(ice->cs8427, &val, 1) != 1) {
    11781162                snd_i2c_unlock(ice->i2c);
    1179                 return -EREMOTE;
     1163                return -EIO;
    11801164        }
    11811165        nval = val & 0xf0;
     
    11871171                reg[1] = nval;
    11881172                if (snd_i2c_sendbytes(ice->cs8427, reg, 2) != 2) {
     1173                        res = -EIO;
     1174                } else {
     1175                        res++;
     1176                }
     1177        }
    11891178                        snd_i2c_unlock(ice->i2c);
    1190                         return -EREMOTE;
    1191                 }
    1192                 return 1;
    1193         }
    1194         snd_i2c_unlock(ice->i2c);
    1195         return 0;
     1179        return res;
    11961180}
    11971181
     
    15531537}
    15541538
    1555 #ifdef TARGET_OS2
    15561539static snd_pcm_hardware_t snd_ice1712_playback =
    15571540{
    1558 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1541        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    15591542                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    15601543                                 SNDRV_PCM_INFO_MMAP_VALID |
    15611544                                 SNDRV_PCM_INFO_PAUSE),
    1562 /*      formats:          */    SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
    1563 /*      rates:            */    SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
    1564 /*      rate_min:         */    4000,
    1565 /*      rate_max:         */    48000,
    1566 /*      channels_min:     */    1,
    1567 /*      channels_max:     */    2,
    1568 /*      buffer_bytes_max:  */   (64*1024),
    1569 /*      period_bytes_min:  */   64,
    1570 /*      period_bytes_max:  */   (64*1024),
    1571 /*      periods_min:      */    1,
    1572 /*      periods_max:      */    1024,
    1573 /*      fifo_size:        */    0,
     1545        .formats =              SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
     1546        .rates =                SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
     1547        .rate_min =             4000,
     1548        .rate_max =             48000,
     1549        .channels_min =         1,
     1550        .channels_max =         2,
     1551        .buffer_bytes_max =     (64*1024),
     1552        .period_bytes_min =     64,
     1553        .period_bytes_max =     (64*1024),
     1554        .periods_min =          1,
     1555        .periods_max =          1024,
     1556        .fifo_size =            0,
    15741557};
    15751558
    15761559static snd_pcm_hardware_t snd_ice1712_playback_ds =
    15771560{
    1578 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1561        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    15791562                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    15801563                                 SNDRV_PCM_INFO_MMAP_VALID |
    15811564                                 SNDRV_PCM_INFO_PAUSE),
    1582 /*      formats:          */    SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
    1583 /*      rates:            */    SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
    1584 /*      rate_min:         */    4000,
    1585 /*      rate_max:         */    48000,
    1586 /*      channels_min:     */    1,
    1587 /*      channels_max:     */    2,
    1588 /*      buffer_bytes_max:  */   (128*1024),
    1589 /*      period_bytes_min:  */   64,
    1590 /*      period_bytes_max:  */   (128*1024),
    1591 /*      periods_min:      */    2,
    1592 /*      periods_max:      */    2,
    1593 /*      fifo_size:        */    0,
     1565        .formats =              SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
     1566        .rates =                SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
     1567        .rate_min =             4000,
     1568        .rate_max =             48000,
     1569        .channels_min =         1,
     1570        .channels_max =         2,
     1571        .buffer_bytes_max =     (128*1024),
     1572        .period_bytes_min =     64,
     1573        .period_bytes_max =     (128*1024),
     1574        .periods_min =          2,
     1575        .periods_max =          2,
     1576        .fifo_size =            0,
    15941577};
    15951578
    15961579static snd_pcm_hardware_t snd_ice1712_capture =
    15971580{
    1598 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1581        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    15991582                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    16001583                                 SNDRV_PCM_INFO_MMAP_VALID),
    1601 /*      formats:          */    SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
    1602 /*      rates:            */    SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
    1603 /*      rate_min:         */    4000,
    1604 /*      rate_max:         */    48000,
    1605 /*      channels_min:     */    1,
    1606 /*      channels_max:     */    2,
    1607 /*      buffer_bytes_max:  */   (64*1024),
    1608 /*      period_bytes_min:  */   64,
    1609 /*      period_bytes_max:  */   (64*1024),
    1610 /*      periods_min:      */    1,
    1611 /*      periods_max:      */    1024,
    1612 /*      fifo_size:        */    0,
     1584        .formats =              SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
     1585        .rates =                SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
     1586        .rate_min =             4000,
     1587        .rate_max =             48000,
     1588        .channels_min =         1,
     1589        .channels_max =         2,
     1590        .buffer_bytes_max =     (64*1024),
     1591        .period_bytes_min =     64,
     1592        .period_bytes_max =     (64*1024),
     1593        .periods_min =          1,
     1594        .periods_max =          1024,
     1595        .fifo_size =            0,
    16131596};
    1614 #else
    1615 static snd_pcm_hardware_t snd_ice1712_playback =
    1616 {
    1617         info:                   (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    1618                                  SNDRV_PCM_INFO_BLOCK_TRANSFER |
    1619                                  SNDRV_PCM_INFO_MMAP_VALID |
    1620                                  SNDRV_PCM_INFO_PAUSE),
    1621         formats:                SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
    1622         rates:                  SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
    1623         rate_min:               4000,
    1624         rate_max:               48000,
    1625         channels_min:           1,
    1626         channels_max:           2,
    1627         buffer_bytes_max:       (64*1024),
    1628         period_bytes_min:       64,
    1629         period_bytes_max:       (64*1024),
    1630         periods_min:            1,
    1631         periods_max:            1024,
    1632         fifo_size:              0,
    1633 };
    1634 
    1635 static snd_pcm_hardware_t snd_ice1712_playback_ds =
    1636 {
    1637         info:                   (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    1638                                  SNDRV_PCM_INFO_BLOCK_TRANSFER |
    1639                                  SNDRV_PCM_INFO_MMAP_VALID |
    1640                                  SNDRV_PCM_INFO_PAUSE),
    1641         formats:                SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
    1642         rates:                  SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
    1643         rate_min:               4000,
    1644         rate_max:               48000,
    1645         channels_min:           1,
    1646         channels_max:           2,
    1647         buffer_bytes_max:       (128*1024),
    1648         period_bytes_min:       64,
    1649         period_bytes_max:       (128*1024),
    1650         periods_min:            2,
    1651         periods_max:            2,
    1652         fifo_size:              0,
    1653 };
    1654 
    1655 static snd_pcm_hardware_t snd_ice1712_capture =
    1656 {
    1657         info:                   (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    1658                                  SNDRV_PCM_INFO_BLOCK_TRANSFER |
    1659                                  SNDRV_PCM_INFO_MMAP_VALID),
    1660         formats:                SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
    1661         rates:                  SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
    1662         rate_min:               4000,
    1663         rate_max:               48000,
    1664         channels_min:           1,
    1665         channels_max:           2,
    1666         buffer_bytes_max:       (64*1024),
    1667         period_bytes_min:       64,
    1668         period_bytes_max:       (64*1024),
    1669         periods_min:            1,
    1670         periods_max:            1024,
    1671         fifo_size:              0,
    1672 };
    1673 #endif
    16741597
    16751598static int snd_ice1712_playback_open(snd_pcm_substream_t * substream)
     
    17441667}
    17451668
    1746 #ifdef TARGET_OS2
    17471669static snd_pcm_ops_t snd_ice1712_playback_ops = {
    1748         snd_ice1712_playback_open,
    1749         snd_ice1712_playback_close,
    1750         snd_pcm_lib_ioctl,
    1751         snd_ice1712_hw_params,
    1752         snd_ice1712_hw_free,
    1753         snd_ice1712_playback_prepare,
    1754         snd_ice1712_playback_trigger,
    1755         snd_ice1712_playback_pointer,0,0
     1670        .open =         snd_ice1712_playback_open,
     1671        .close =        snd_ice1712_playback_close,
     1672        .ioctl =        snd_pcm_lib_ioctl,
     1673        .hw_params =    snd_ice1712_hw_params,
     1674        .hw_free =      snd_ice1712_hw_free,
     1675        .prepare =      snd_ice1712_playback_prepare,
     1676        .trigger =      snd_ice1712_playback_trigger,
     1677        .pointer =      snd_ice1712_playback_pointer,
    17561678};
    17571679
    17581680static snd_pcm_ops_t snd_ice1712_playback_ds_ops = {
    1759         snd_ice1712_playback_ds_open,
    1760         snd_ice1712_playback_ds_close,
    1761         snd_pcm_lib_ioctl,
    1762         snd_ice1712_hw_params,
    1763         snd_ice1712_hw_free,
    1764         snd_ice1712_playback_ds_prepare,
    1765         snd_ice1712_playback_ds_trigger,
    1766         snd_ice1712_playback_ds_pointer,0,0
     1681        .open =         snd_ice1712_playback_ds_open,
     1682        .close =        snd_ice1712_playback_ds_close,
     1683        .ioctl =        snd_pcm_lib_ioctl,
     1684        .hw_params =    snd_ice1712_hw_params,
     1685        .hw_free =      snd_ice1712_hw_free,
     1686        .prepare =      snd_ice1712_playback_ds_prepare,
     1687        .trigger =      snd_ice1712_playback_ds_trigger,
     1688        .pointer =      snd_ice1712_playback_ds_pointer,
    17671689};
    17681690
    17691691static snd_pcm_ops_t snd_ice1712_capture_ops = {
    1770         snd_ice1712_capture_open,
    1771         snd_ice1712_capture_close,
    1772         snd_pcm_lib_ioctl,
    1773         snd_ice1712_hw_params,
    1774         snd_ice1712_hw_free,
    1775         snd_ice1712_capture_prepare,
    1776         snd_ice1712_capture_trigger,
    1777         snd_ice1712_capture_pointer,0,0
     1692        .open =         snd_ice1712_capture_open,
     1693        .close =        snd_ice1712_capture_close,
     1694        .ioctl =        snd_pcm_lib_ioctl,
     1695        .hw_params =    snd_ice1712_hw_params,
     1696        .hw_free =      snd_ice1712_hw_free,
     1697        .prepare =      snd_ice1712_capture_prepare,
     1698        .trigger =      snd_ice1712_capture_trigger,
     1699        .pointer =      snd_ice1712_capture_pointer,
    17781700};
    1779 #else
    1780 static snd_pcm_ops_t snd_ice1712_playback_ops = {
    1781         open:           snd_ice1712_playback_open,
    1782         close:          snd_ice1712_playback_close,
    1783         ioctl:          snd_pcm_lib_ioctl,
    1784         hw_params:      snd_ice1712_hw_params,
    1785         hw_free:        snd_ice1712_hw_free,
    1786         prepare:        snd_ice1712_playback_prepare,
    1787         trigger:        snd_ice1712_playback_trigger,
    1788         pointer:        snd_ice1712_playback_pointer,
    1789 };
    1790 
    1791 static snd_pcm_ops_t snd_ice1712_playback_ds_ops = {
    1792         open:           snd_ice1712_playback_ds_open,
    1793         close:          snd_ice1712_playback_ds_close,
    1794         ioctl:          snd_pcm_lib_ioctl,
    1795         hw_params:      snd_ice1712_hw_params,
    1796         hw_free:        snd_ice1712_hw_free,
    1797         prepare:        snd_ice1712_playback_ds_prepare,
    1798         trigger:        snd_ice1712_playback_ds_trigger,
    1799         pointer:        snd_ice1712_playback_ds_pointer,
    1800 };
    1801 
    1802 static snd_pcm_ops_t snd_ice1712_capture_ops = {
    1803         open:           snd_ice1712_capture_open,
    1804         close:          snd_ice1712_capture_close,
    1805         ioctl:          snd_pcm_lib_ioctl,
    1806         hw_params:      snd_ice1712_hw_params,
    1807         hw_free:        snd_ice1712_hw_free,
    1808         prepare:        snd_ice1712_capture_prepare,
    1809         trigger:        snd_ice1712_capture_trigger,
    1810         pointer:        snd_ice1712_capture_pointer,
    1811 };
    1812 #endif
    18131701
    18141702static void snd_ice1712_pcm_free(snd_pcm_t *pcm)
     
    18921780#define RATES sizeof(rates) / sizeof(rates[0])
    18931781
    1894 #ifdef TARGET_OS2
    18951782static snd_pcm_hw_constraint_list_t hw_constraints_rates = {
    1896         RATES,
    1897         rates,
    1898         0,
     1783        .count = RATES,
     1784        .list = rates,
     1785        .mask = 0,
    18991786};
    1900 #else
    1901 static snd_pcm_hw_constraint_list_t hw_constraints_rates = {
    1902         count: RATES,
    1903         list: rates,
    1904         mask: 0,
    1905 };
    1906 #endif
    19071787
    19081788#if 0
     
    20991979}
    21001980
    2101 #ifdef TARGET_OS2
    21021981static snd_pcm_hardware_t snd_ice1712_playback_pro =
    21031982{
    2104 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1983        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    21051984                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    21061985                                 SNDRV_PCM_INFO_MMAP_VALID |
    21071986                                 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START),
    2108 /*      formats:          */    SNDRV_PCM_FMTBIT_S32_LE,
    2109 /*      rates:            */    SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000,
    2110 /*      rate_min:         */    4000,
    2111 /*      rate_max:         */    96000,
    2112 /*      channels_min:     */    10,
    2113 /*      channels_max:     */    10,
    2114 /*      buffer_bytes_max:  */   (256*1024),
    2115 /*      period_bytes_min:  */   10 * 4 * 2,
    2116 /*      period_bytes_max:  */   131040,
    2117 /*      periods_min:      */    1,
    2118 /*      periods_max:      */    1024,
    2119 /*      fifo_size:        */    0,
     1987        .formats =              SNDRV_PCM_FMTBIT_S32_LE,
     1988        .rates =                SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000,
     1989        .rate_min =             4000,
     1990        .rate_max =             96000,
     1991        .channels_min =         10,
     1992        .channels_max =         10,
     1993        .buffer_bytes_max =     (256*1024),
     1994        .period_bytes_min =     10 * 4 * 2,
     1995        .period_bytes_max =     131040,
     1996        .periods_min =          1,
     1997        .periods_max =          1024,
     1998        .fifo_size =            0,
    21201999};
    21212000
    21222001static snd_pcm_hardware_t snd_ice1712_capture_pro =
    21232002{
    2124 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     2003        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    21252004                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    21262005                                 SNDRV_PCM_INFO_MMAP_VALID |
    21272006                                 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START),
    2128 /*      formats:          */    SNDRV_PCM_FMTBIT_S32_LE,
    2129 /*      rates:            */    SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000,
    2130 /*      rate_min:         */    4000,
    2131 /*      rate_max:         */    96000,
    2132 /*      channels_min:     */    12,
    2133 /*      channels_max:     */    12,
    2134 /*      buffer_bytes_max:  */   (256*1024),
    2135 /*      period_bytes_min:  */   12 * 4 * 2,
    2136 /*      period_bytes_max:  */   131040,
    2137 /*      periods_min:      */    1,
    2138 /*      periods_max:      */    1024,
    2139 /*      fifo_size:        */    0,
     2007        .formats =              SNDRV_PCM_FMTBIT_S32_LE,
     2008        .rates =                SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000,
     2009        .rate_min =             4000,
     2010        .rate_max =             96000,
     2011        .channels_min =         12,
     2012        .channels_max =         12,
     2013        .buffer_bytes_max =     (256*1024),
     2014        .period_bytes_min =     12 * 4 * 2,
     2015        .period_bytes_max =     131040,
     2016        .periods_min =          1,
     2017        .periods_max =          1024,
     2018        .fifo_size =            0,
    21402019};
    2141 #else
    2142 static snd_pcm_hardware_t snd_ice1712_playback_pro =
    2143 {
    2144         info:                   (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    2145                                  SNDRV_PCM_INFO_BLOCK_TRANSFER |
    2146                                  SNDRV_PCM_INFO_MMAP_VALID |
    2147                                  SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START),
    2148         formats:                SNDRV_PCM_FMTBIT_S32_LE,
    2149         rates:                  SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000,
    2150         rate_min:               4000,
    2151         rate_max:               96000,
    2152         channels_min:           10,
    2153         channels_max:           10,
    2154         buffer_bytes_max:       (256*1024),
    2155         period_bytes_min:       10 * 4 * 2,
    2156         period_bytes_max:       131040,
    2157         periods_min:            1,
    2158         periods_max:            1024,
    2159         fifo_size:              0,
    2160 };
    2161 
    2162 static snd_pcm_hardware_t snd_ice1712_capture_pro =
    2163 {
    2164         info:                   (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    2165                                  SNDRV_PCM_INFO_BLOCK_TRANSFER |
    2166                                  SNDRV_PCM_INFO_MMAP_VALID |
    2167                                  SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START),
    2168         formats:                SNDRV_PCM_FMTBIT_S32_LE,
    2169         rates:                  SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000,
    2170         rate_min:               4000,
    2171         rate_max:               96000,
    2172         channels_min:           12,
    2173         channels_max:           12,
    2174         buffer_bytes_max:       (256*1024),
    2175         period_bytes_min:       12 * 4 * 2,
    2176         period_bytes_max:       131040,
    2177         periods_min:            1,
    2178         periods_max:            1024,
    2179         fifo_size:              0,
    2180 };
    2181 #endif
    21822020
    21832021static int snd_ice1712_playback_pro_open(snd_pcm_substream_t * substream)
     
    22382076}
    22392077
    2240 #ifdef TARGET_OS2
    22412078static snd_pcm_ops_t snd_ice1712_playback_pro_ops = {
    2242         snd_ice1712_playback_pro_open,
    2243         snd_ice1712_playback_pro_close,
    2244         snd_pcm_lib_ioctl,
    2245         snd_ice1712_hw_params,
    2246         snd_ice1712_hw_free,
    2247         snd_ice1712_playback_pro_prepare,
    2248         snd_ice1712_pro_trigger,
    2249         snd_ice1712_playback_pro_pointer,0,0
     2079        .open =         snd_ice1712_playback_pro_open,
     2080        .close =        snd_ice1712_playback_pro_close,
     2081        .ioctl =        snd_pcm_lib_ioctl,
     2082        .hw_params =    snd_ice1712_hw_params,
     2083        .hw_free =      snd_ice1712_hw_free,
     2084        .prepare =      snd_ice1712_playback_pro_prepare,
     2085        .trigger =      snd_ice1712_pro_trigger,
     2086        .pointer =      snd_ice1712_playback_pro_pointer,
    22502087};
    22512088
    22522089static snd_pcm_ops_t snd_ice1712_capture_pro_ops = {
    2253         snd_ice1712_capture_pro_open,
    2254         snd_ice1712_capture_pro_close,
    2255         snd_pcm_lib_ioctl,
    2256         snd_ice1712_hw_params,
    2257         snd_ice1712_hw_free,
    2258         snd_ice1712_capture_pro_prepare,
    2259         snd_ice1712_pro_trigger,
    2260         snd_ice1712_capture_pro_pointer,0,0
     2090        .open =         snd_ice1712_capture_pro_open,
     2091        .close =        snd_ice1712_capture_pro_close,
     2092        .ioctl =        snd_pcm_lib_ioctl,
     2093        .hw_params =    snd_ice1712_hw_params,
     2094        .hw_free =      snd_ice1712_hw_free,
     2095        .prepare =      snd_ice1712_capture_pro_prepare,
     2096        .trigger =      snd_ice1712_pro_trigger,
     2097        .pointer =      snd_ice1712_capture_pro_pointer,
    22612098};
    2262 #else
    2263 static snd_pcm_ops_t snd_ice1712_playback_pro_ops = {
    2264         open:           snd_ice1712_playback_pro_open,
    2265         close:          snd_ice1712_playback_pro_close,
    2266         ioctl:          snd_pcm_lib_ioctl,
    2267         hw_params:      snd_ice1712_hw_params,
    2268         hw_free:        snd_ice1712_hw_free,
    2269         prepare:        snd_ice1712_playback_pro_prepare,
    2270         trigger:        snd_ice1712_pro_trigger,
    2271         pointer:        snd_ice1712_playback_pro_pointer,
    2272 };
    2273 
    2274 static snd_pcm_ops_t snd_ice1712_capture_pro_ops = {
    2275         open:           snd_ice1712_capture_pro_open,
    2276         close:          snd_ice1712_capture_pro_close,
    2277         ioctl:          snd_pcm_lib_ioctl,
    2278         hw_params:      snd_ice1712_hw_params,
    2279         hw_free:        snd_ice1712_hw_free,
    2280         prepare:        snd_ice1712_capture_pro_prepare,
    2281         trigger:        snd_ice1712_pro_trigger,
    2282         pointer:        snd_ice1712_capture_pro_pointer,
    2283 };
    2284 #endif
    22852099
    22862100static int __devinit snd_ice1712_pcm_profi(ice1712_t * ice, int device, snd_pcm_t ** rpcm)
     
    27162530
    27172531static snd_kcontrol_new_t snd_ice1712_eeprom __devinitdata = {
    2718 #ifdef TARGET_OS2
    2719         SNDRV_CTL_ELEM_IFACE_CARD,0,0,
    2720         "ICE1712 EEPROM",0,
    2721         SNDRV_CTL_ELEM_ACCESS_READ,
    2722         snd_ice1712_eeprom_info,
    2723         snd_ice1712_eeprom_get,0,0
    2724 #else
    2725         iface: SNDRV_CTL_ELEM_IFACE_CARD,
    2726         name: "ICE1712 EEPROM",
    2727         access: SNDRV_CTL_ELEM_ACCESS_READ,
    2728         info: snd_ice1712_eeprom_info,
    2729         get: snd_ice1712_eeprom_get
    2730 #endif
     2532        .iface = SNDRV_CTL_ELEM_IFACE_CARD,
     2533        .name = "ICE1712 EEPROM",
     2534        .access = SNDRV_CTL_ELEM_ACCESS_READ,
     2535        .info = snd_ice1712_eeprom_info,
     2536        .get = snd_ice1712_eeprom_get
    27312537};
    27322538
     
    28032609static snd_kcontrol_new_t snd_ice1712_spdif_default __devinitdata =
    28042610{
    2805 #ifdef TARGET_OS2
    2806         SNDRV_CTL_ELEM_IFACE_PCM,0,0,
    2807         SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),0,0,
    2808         snd_ice1712_spdif_default_info,
    2809         snd_ice1712_spdif_default_get,
    2810         snd_ice1712_spdif_default_put,0
    2811 #else
    2812         iface:          SNDRV_CTL_ELEM_IFACE_PCM,
    2813         name:           SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
    2814         info:           snd_ice1712_spdif_default_info,
    2815         get:            snd_ice1712_spdif_default_get,
    2816         put:            snd_ice1712_spdif_default_put
    2817 #endif
     2611        .iface =                SNDRV_CTL_ELEM_IFACE_PCM,
     2612        .name =           SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
     2613        .info =         snd_ice1712_spdif_default_info,
     2614        .get =          snd_ice1712_spdif_default_get,
     2615        .put =          snd_ice1712_spdif_default_put
    28182616};
    28192617
     
    28872685static snd_kcontrol_new_t snd_ice1712_spdif_maskc __devinitdata =
    28882686{
    2889 #ifdef TARGET_OS2
    2890         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    2891         SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),0,
    2892         SNDRV_CTL_ELEM_ACCESS_READ,
    2893         snd_ice1712_spdif_mask_info,
    2894         snd_ice1712_spdif_maskc_get,0,0
    2895 #else
    2896         access:         SNDRV_CTL_ELEM_ACCESS_READ,
    2897         iface:          SNDRV_CTL_ELEM_IFACE_MIXER,
    2898         name:           SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),
    2899         info:           snd_ice1712_spdif_mask_info,
    2900         get:            snd_ice1712_spdif_maskc_get,
    2901 #endif
     2687        .access =               SNDRV_CTL_ELEM_ACCESS_READ,
     2688        .iface =                SNDRV_CTL_ELEM_IFACE_MIXER,
     2689        .name =           SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),
     2690        .info =         snd_ice1712_spdif_mask_info,
     2691        .get =          snd_ice1712_spdif_maskc_get,
    29022692};
    29032693
    29042694static snd_kcontrol_new_t snd_ice1712_spdif_maskp __devinitdata =
    29052695{
    2906 #ifdef TARGET_OS2
    2907         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    2908         SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK),0,
    2909         SNDRV_CTL_ELEM_ACCESS_READ,
    2910         snd_ice1712_spdif_mask_info,
    2911         snd_ice1712_spdif_maskp_get,0,0
    2912 #else
    2913         access:         SNDRV_CTL_ELEM_ACCESS_READ,
    2914         iface:          SNDRV_CTL_ELEM_IFACE_MIXER,
    2915         name:           SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK),
    2916         info:           snd_ice1712_spdif_mask_info,
    2917         get:            snd_ice1712_spdif_maskp_get,
    2918 #endif
     2696        .access =               SNDRV_CTL_ELEM_ACCESS_READ,
     2697        .iface =                SNDRV_CTL_ELEM_IFACE_MIXER,
     2698        .name =           SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK),
     2699        .info =         snd_ice1712_spdif_mask_info,
     2700        .get =          snd_ice1712_spdif_maskp_get,
    29192701};
    29202702
     
    29892771static snd_kcontrol_new_t snd_ice1712_spdif_stream __devinitdata =
    29902772{
    2991 #ifdef TARGET_OS2
    2992         SNDRV_CTL_ELEM_IFACE_PCM,0,0,
    2993         SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),0,
    2994         SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
    2995         snd_ice1712_spdif_stream_info,
    2996         snd_ice1712_spdif_stream_get,
    2997         snd_ice1712_spdif_stream_put,0
    2998 #else
    2999         access:         SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
    3000         iface:          SNDRV_CTL_ELEM_IFACE_PCM,
    3001         name:           SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),
    3002         info:           snd_ice1712_spdif_stream_info,
    3003         get:            snd_ice1712_spdif_stream_get,
    3004         put:            snd_ice1712_spdif_stream_put
    3005 #endif
     2773        .access =               SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
     2774        .iface =                SNDRV_CTL_ELEM_IFACE_PCM,
     2775        .name =           SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),
     2776        .info =         snd_ice1712_spdif_stream_info,
     2777        .get =          snd_ice1712_spdif_stream_get,
     2778        .put =          snd_ice1712_spdif_stream_put
    30062779};
    30072780
    3008 #ifdef TARGET_OS2
    30092781#define ICE1712_GPIO(xiface, xname, xindex, mask, invert, xaccess) \
    3010 { xiface, 0, 0, xname, 0, xaccess, snd_ice1712_gpio_info, \
    3011   snd_ice1712_gpio_get, snd_ice1712_gpio_put, \
    3012         mask | (invert << 24) }
    3013 #else
    3014 #define ICE1712_GPIO(xiface, xname, xindex, mask, invert, xaccess) \
    3015 { iface: xiface, name: xname, access: xaccess, info: snd_ice1712_gpio_info, \
    3016   get: snd_ice1712_gpio_get, put: snd_ice1712_gpio_put, \
    3017   private_value: mask | (invert << 24) }
    3018 #endif
     2782{ .iface = xiface, .name = xname, .access = xaccess, .info = snd_ice1712_gpio_info, \
     2783  .get = snd_ice1712_gpio_get, .put = snd_ice1712_gpio_put, \
     2784  .private_value = mask | (invert << 24) }
    30192785
    30202786static int snd_ice1712_gpio_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    31102876
    31112877static snd_kcontrol_new_t snd_ice1712_pro_spdif_master __devinitdata = {
    3112 #ifdef TARGET_OS2
    3113         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    3114         "Multi Track IEC958 Master",0,0,
    3115         snd_ice1712_pro_spdif_master_info,
    3116         snd_ice1712_pro_spdif_master_get,
    3117         snd_ice1712_pro_spdif_master_put,0
    3118 #else
    3119         iface: SNDRV_CTL_ELEM_IFACE_MIXER,
    3120         name: "Multi Track IEC958 Master",
    3121         info: snd_ice1712_pro_spdif_master_info,
    3122         get: snd_ice1712_pro_spdif_master_get,
    3123         put: snd_ice1712_pro_spdif_master_put
    3124 #endif
     2878        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     2879        .name = "Multi Track IEC958 Master",
     2880        .info = snd_ice1712_pro_spdif_master_info,
     2881        .get = snd_ice1712_pro_spdif_master_get,
     2882        .put = snd_ice1712_pro_spdif_master_put
    31252883};
    31262884
     
    32693027
    32703028static snd_kcontrol_new_t snd_ice1712_mixer_pro_analog_route __devinitdata = {
    3271 #ifdef TARGET_OS2
    3272         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    3273         "H/W Playback Route",0,0,
    3274         snd_ice1712_pro_route_info,
    3275         snd_ice1712_pro_route_analog_get,
    3276         snd_ice1712_pro_route_analog_put,0
    3277 #else
    3278         iface: SNDRV_CTL_ELEM_IFACE_MIXER,
    3279         name: "H/W Playback Route",
    3280         info: snd_ice1712_pro_route_info,
    3281         get: snd_ice1712_pro_route_analog_get,
    3282         put: snd_ice1712_pro_route_analog_put,
    3283 #endif
     3029        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     3030        .name = "H/W Playback Route",
     3031        .info = snd_ice1712_pro_route_info,
     3032        .get = snd_ice1712_pro_route_analog_get,
     3033        .put = snd_ice1712_pro_route_analog_put,
    32843034};
    32853035
    32863036static snd_kcontrol_new_t snd_ice1712_mixer_pro_spdif_route __devinitdata = {
    3287 #ifdef TARGET_OS2
    3288         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    3289         "IEC958 Playback Route",0,0,
    3290         snd_ice1712_pro_route_info,
    3291         snd_ice1712_pro_route_spdif_get,
    3292         snd_ice1712_pro_route_spdif_put,0
    3293 #else
    3294         iface: SNDRV_CTL_ELEM_IFACE_MIXER,
    3295         name: "IEC958 Playback Route",
    3296         info: snd_ice1712_pro_route_info,
    3297         get: snd_ice1712_pro_route_spdif_get,
    3298         put: snd_ice1712_pro_route_spdif_put,
    3299 #endif
     3037        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     3038        .name = "IEC958 Playback Route",
     3039        .info = snd_ice1712_pro_route_info,
     3040        .get = snd_ice1712_pro_route_spdif_get,
     3041        .put = snd_ice1712_pro_route_spdif_put,
    33003042};
    33013043
     
    33353077
    33363078static snd_kcontrol_new_t snd_ice1712_mixer_pro_volume_rate __devinitdata = {
    3337 #ifdef TARGET_OS2
    3338         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    3339         "Multi Track Volume Rate",0,0,
    3340         snd_ice1712_pro_volume_rate_info,
    3341         snd_ice1712_pro_volume_rate_get,
    3342         snd_ice1712_pro_volume_rate_put,0
    3343 #else
    3344         iface: SNDRV_CTL_ELEM_IFACE_MIXER,
    3345         name: "Multi Track Volume Rate",
    3346         info: snd_ice1712_pro_volume_rate_info,
    3347         get: snd_ice1712_pro_volume_rate_get,
    3348         put: snd_ice1712_pro_volume_rate_put
    3349 #endif
     3079        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     3080        .name = "Multi Track Volume Rate",
     3081        .info = snd_ice1712_pro_volume_rate_info,
     3082        .get = snd_ice1712_pro_volume_rate_get,
     3083        .put = snd_ice1712_pro_volume_rate_put
    33503084};
    33513085
     
    33753109
    33763110static snd_kcontrol_new_t snd_ice1712_mixer_pro_peak __devinitdata = {
    3377 #ifdef TARGET_OS2
    3378         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    3379         "Multi Track Peak",0,
    3380         SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
    3381         snd_ice1712_pro_peak_info,
    3382         snd_ice1712_pro_peak_get,0,0
    3383 #else
    3384         iface: SNDRV_CTL_ELEM_IFACE_MIXER,
    3385         name: "Multi Track Peak",
    3386         access: SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
    3387         info: snd_ice1712_pro_peak_info,
    3388         get: snd_ice1712_pro_peak_get
    3389 #endif
     3111        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     3112        .name = "Multi Track Peak",
     3113        .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
     3114        .info = snd_ice1712_pro_peak_info,
     3115        .get = snd_ice1712_pro_peak_get
    33903116};
    33913117
     
    34393165
    34403166static snd_kcontrol_new_t snd_ice1712_ewx_input_sense __devinitdata = {
    3441 #ifdef TARGET_OS2
    3442         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    3443         "Input Sensitivity Switch",0,0,
    3444         snd_ice1712_ewx_io_sense_info,
    3445         snd_ice1712_ewx_io_sense_get,
    3446         snd_ice1712_ewx_io_sense_put,
    3447         ICE1712_EWX2496_AIN_SEL,
    3448 #else
    3449         iface: SNDRV_CTL_ELEM_IFACE_MIXER,
    3450         name: "Input Sensitivity Switch",
    3451         info: snd_ice1712_ewx_io_sense_info,
    3452         get: snd_ice1712_ewx_io_sense_get,
    3453         put: snd_ice1712_ewx_io_sense_put,
    3454         private_value: ICE1712_EWX2496_AIN_SEL,
    3455 #endif
     3167        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     3168        .name = "Input Sensitivity Switch",
     3169        .info = snd_ice1712_ewx_io_sense_info,
     3170        .get = snd_ice1712_ewx_io_sense_get,
     3171        .put = snd_ice1712_ewx_io_sense_put,
     3172        .private_value = ICE1712_EWX2496_AIN_SEL,
    34563173};
    34573174
    34583175static snd_kcontrol_new_t snd_ice1712_ewx_output_sense __devinitdata = {
    3459 #ifdef TARGET_OS2
    3460         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    3461         "Output Sensitivity Switch",0,0,
    3462         snd_ice1712_ewx_io_sense_info,
    3463         snd_ice1712_ewx_io_sense_get,
    3464         snd_ice1712_ewx_io_sense_put,
    3465         ICE1712_EWX2496_AOUT_SEL,
    3466 #else
    3467         iface: SNDRV_CTL_ELEM_IFACE_MIXER,
    3468         name: "Output Sensitivity Switch",
    3469         info: snd_ice1712_ewx_io_sense_info,
    3470         get: snd_ice1712_ewx_io_sense_get,
    3471         put: snd_ice1712_ewx_io_sense_put,
    3472         private_value: ICE1712_EWX2496_AOUT_SEL,
    3473 #endif
     3176        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     3177        .name = "Output Sensitivity Switch",
     3178        .info = snd_ice1712_ewx_io_sense_info,
     3179        .get = snd_ice1712_ewx_io_sense_get,
     3180        .put = snd_ice1712_ewx_io_sense_put,
     3181        .private_value = ICE1712_EWX2496_AOUT_SEL,
    34743182};
    34753183
     
    34873195        if (snd_i2c_readbytes(ice->pcf8574[1], &data, 1) != 1) {
    34883196                snd_i2c_unlock(ice->i2c);
    3489                 return -EREMOTE;
     3197                return -EIO;
    34903198        }
    34913199        snd_i2c_unlock(ice->i2c);
     
    35033211        if (snd_i2c_readbytes(ice->pcf8574[1], &data, 1) != 1) {
    35043212                snd_i2c_unlock(ice->i2c);
    3505                 return -EREMOTE;
     3213                return -EIO;
    35063214        }
    35073215        ndata = (data & ~ICE1712_EWS88MT_OUTPUT_SENSE) | (ucontrol->value.enumerated.item[0] ? ICE1712_EWS88MT_OUTPUT_SENSE : 0);
    35083216        if (ndata != data && snd_i2c_sendbytes(ice->pcf8574[1], &ndata, 1) != 1) {
    35093217                snd_i2c_unlock(ice->i2c);
    3510                 return -EREMOTE;
     3218                return -EIO;
    35113219        }
    35123220        snd_i2c_unlock(ice->i2c);
     
    35253233        if (snd_i2c_readbytes(ice->pcf8574[0], &data, 1) != 1) {
    35263234                snd_i2c_unlock(ice->i2c);
    3527                 return -EREMOTE;
     3235                return -EIO;
    35283236        }
    35293237        /* reversed; high = +4dBu, low = -10dBV */
     
    35433251        if (snd_i2c_readbytes(ice->pcf8574[0], &data, 1) != 1) {
    35443252                snd_i2c_unlock(ice->i2c);
    3545                 return -EREMOTE;
     3253                return -EIO;
    35463254        }
    35473255        ndata = (data & ~(1 << channel)) | (ucontrol->value.enumerated.item[0] ? 0 : (1 << channel));
    35483256        if (ndata != data && snd_i2c_sendbytes(ice->pcf8574[0], &ndata, 1) != 1) {
    35493257                snd_i2c_unlock(ice->i2c);
    3550                 return -EREMOTE;
     3258                return -EIO;
    35513259        }
    35523260        snd_i2c_unlock(ice->i2c);
     
    35553263
    35563264static snd_kcontrol_new_t snd_ice1712_ews88mt_input_sense __devinitdata = {
    3557 #ifdef TARGET_OS2
    3558         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    3559         "Input Sensitivity Switch",0,0,
    3560         snd_ice1712_ewx_io_sense_info,
    3561         snd_ice1712_ews88mt_input_sense_get,
    3562         snd_ice1712_ews88mt_input_sense_put,0
    3563 #else
    3564         iface: SNDRV_CTL_ELEM_IFACE_MIXER,
    3565         name: "Input Sensitivity Switch",
    3566         info: snd_ice1712_ewx_io_sense_info,
    3567         get: snd_ice1712_ews88mt_input_sense_get,
    3568         put: snd_ice1712_ews88mt_input_sense_put,
    3569 #endif
     3265        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     3266        .name = "Input Sensitivity Switch",
     3267        .info = snd_ice1712_ewx_io_sense_info,
     3268        .get = snd_ice1712_ews88mt_input_sense_get,
     3269        .put = snd_ice1712_ews88mt_input_sense_put,
    35703270};
    35713271
    35723272static snd_kcontrol_new_t snd_ice1712_ews88mt_output_sense __devinitdata = {
    3573 #ifdef TARGET_OS2
    3574         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    3575         "Output Sensitivity Switch",0,0,
    3576         snd_ice1712_ewx_io_sense_info,
    3577         snd_ice1712_ews88mt_output_sense_get,
    3578         snd_ice1712_ews88mt_output_sense_put,0
    3579 #else
    3580         iface: SNDRV_CTL_ELEM_IFACE_MIXER,
    3581         name: "Output Sensitivity Switch",
    3582         info: snd_ice1712_ewx_io_sense_info,
    3583         get: snd_ice1712_ews88mt_output_sense_get,
    3584         put: snd_ice1712_ews88mt_output_sense_put,
    3585 #endif
     3273        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     3274        .name = "Output Sensitivity Switch",
     3275        .info = snd_ice1712_ewx_io_sense_info,
     3276        .get = snd_ice1712_ews88mt_output_sense_get,
     3277        .put = snd_ice1712_ews88mt_output_sense_put,
    35863278};
    35873279
     
    36103302        if (snd_i2c_readbytes(ice->pcf8575, data, 2) != 2) {
    36113303                snd_i2c_unlock(ice->i2c);
    3612                 return -EREMOTE;
     3304                return -EIO;
    36133305        }
    36143306        snd_i2c_unlock(ice->i2c);
     
    36313323        if (snd_i2c_readbytes(ice->pcf8575, data, 2) != 2) {
    36323324                snd_i2c_unlock(ice->i2c);
    3633                 return -EREMOTE;
     3325                return -EIO;
    36343326        }
    36353327        ndata[shift >> 3] = data[shift >> 3] & ~(1 << (shift & 7));
     
    36443336        if (change && snd_i2c_sendbytes(ice->pcf8575, data, 2) != 2) {
    36453337                snd_i2c_unlock(ice->i2c);
    3646                 return -EREMOTE;
     3338                return -EIO;
    36473339        }
    36483340        snd_i2c_unlock(ice->i2c);
     
    36503342}
    36513343
    3652 #ifdef TARGET_OS2
    36533344#define EWS88D_CONTROL(xiface, xname, xshift, xinvert, xaccess) \
    3654 { xiface,0,0,\
    3655   xname, 0,\
    3656   xaccess,\
    3657   snd_ice1712_ews88d_control_info,\
    3658   snd_ice1712_ews88d_control_get,\
    3659   snd_ice1712_ews88d_control_put,\
    3660   xshift | (xinvert << 8),\
    3661 }
    3662 #else
    3663 #define EWS88D_CONTROL(xiface, xname, xshift, xinvert, xaccess) \
    3664 { iface: xiface,\
    3665   name: xname,\
    3666   access: xaccess,\
    3667   info: snd_ice1712_ews88d_control_info,\
    3668   get: snd_ice1712_ews88d_control_get,\
    3669   put: snd_ice1712_ews88d_control_put,\
    3670   private_value: xshift | (xinvert << 8),\
    3671 }
    3672 #endif
     3345{ .iface = xiface,\
     3346  .name = xname,\
     3347  .access = xaccess,\
     3348  .info = snd_ice1712_ews88d_control_info,\
     3349  .get = snd_ice1712_ews88d_control_get,\
     3350  .put = snd_ice1712_ews88d_control_put,\
     3351  .private_value = xshift | (xinvert << 8),\
     3352}
    36733353
    36743354static snd_kcontrol_new_t snd_ice1712_ews88d_controls[] __devinitdata = {
     
    36943374        if (snd_i2c_readbytes(ice->pcf8575, &byte, 1) != 1) {
    36953375                snd_i2c_unlock(ice->i2c);
    3696                 return -EREMOTE;
     3376                return -EIO;
    36973377        }
    36983378        snd_i2c_unlock(ice->i2c);
     
    37083388        if (snd_i2c_sendbytes(ice->pcf8575, bytes, 2) != 2) {
    37093389                snd_i2c_unlock(ice->i2c);
    3710                 return -EREMOTE;
     3390                return -EIO;
    37113391        }
    37123392        snd_i2c_unlock(ice->i2c);
     
    37613441
    37623442#define DMX6FIRE_CONTROL(xiface, xname, xshift, xinvert, xaccess) \
    3763 { iface: xiface,\
    3764   name: xname,\
    3765   access: xaccess,\
    3766   info: snd_ice1712_6fire_control_info,\
    3767   get: snd_ice1712_6fire_control_get,\
    3768   put: snd_ice1712_6fire_control_put,\
    3769   private_value: xshift | (xinvert << 8),\
     3443{ .iface = xiface,\
     3444  .name = xname,\
     3445  .access = xaccess,\
     3446  .info = snd_ice1712_6fire_control_info,\
     3447  .get = snd_ice1712_6fire_control_get,\
     3448  .put = snd_ice1712_6fire_control_put,\
     3449  .private_value = xshift | (xinvert << 8),\
    37703450}
    37713451
     
    41643844        /* second stage of initialization, analog parts and others */
    41653845        switch (ice->eeprom.subvendor) {
     3846        case ICE1712_SUBDEVICE_EWS88MT:
     3847                /* Check if the front module is connected */
     3848                if ((err = snd_ice1712_ews88mt_chip_select(ice, 0x0f)) < 0)
     3849                        return err;
     3850                /* Fall through */
    41663851        case ICE1712_SUBDEVICE_DELTA66:
    41673852        case ICE1712_SUBDEVICE_DELTA44:
    41683853        case ICE1712_SUBDEVICE_AUDIOPHILE:
    41693854        case ICE1712_SUBDEVICE_EWX2496:
    4170         case ICE1712_SUBDEVICE_EWS88MT:
    41713855        case ICE1712_SUBDEVICE_DMX6FIRE:
    41723856                snd_ice1712_ak4524_init(ice);
     
    44084092      __hw_end:
    44094093        snd_ice1712_proc_done(ice);
    4410         synchronize_irq();
    4411         if (ice->irq)
     4094        if (ice->irq >= 0) {
     4095                synchronize_irq(ice->irq);
    44124096                free_irq(ice->irq, (void *) ice);
     4097        }
    44134098        if (ice->res_port) {
    44144099                release_resource(ice->res_port);
     
    44444129        ice1712_t *ice;
    44454130        int err;
    4446 #ifdef TARGET_OS2
    44474131        static snd_device_ops_t ops = {
    4448                 snd_ice1712_dev_free,0,0,0
     4132                .dev_free =     snd_ice1712_dev_free,
    44494133        };
    4450 #else
    4451         static snd_device_ops_t ops = {
    4452                 dev_free:       snd_ice1712_dev_free,
    4453         };
    4454 #endif
    44554134
    44564135        *r_ice1712 = NULL;
     
    44874166        pci_write_config_word(ice->pci, 0x42, 0x0006);
    44884167        snd_ice1712_proc_init(ice);
    4489         synchronize_irq();
     4168        synchronize_irq(pci->irq);
    44904169
    44914170        if ((ice->res_port = request_region(ice->port, 32, "ICE1712 - Controller")) == NULL) {
     
    46664345}
    46674346
    4668 #ifdef TARGET_OS2
    46694347static struct pci_driver driver = {
    4670         0,0,"ICE1712",
    4671         snd_ice1712_ids,
    4672         snd_ice1712_probe,
    4673         snd_ice1712_remove,0,0
     4348        .name = "ICE1712",
     4349        .id_table = snd_ice1712_ids,
     4350        .probe = snd_ice1712_probe,
     4351        .remove = __devexit_p(snd_ice1712_remove),
    46744352};
    4675 #else
    4676 static struct pci_driver driver = {
    4677         name: "ICE1712",
    4678         id_table: snd_ice1712_ids,
    4679         probe: snd_ice1712_probe,
    4680         remove: __devexit_p(snd_ice1712_remove),
    4681 };
    4682 #endif
    46834353
    46844354static int __init alsa_card_ice1712_init(void)
Note: See TracChangeset for help on using the changeset viewer.