Changeset 210 for GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712.c
- Timestamp:
- Jul 13, 2007, 4:47:31 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712.c
r207 r210 700 700 701 701 static 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, 715 707 }; 716 708 … … 873 865 } 874 866 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, 867 static snd_i2c_ops_t ap_cs8427_i2c_ops = { 868 .sendbytes = ap_cs8427_sendbytes, 869 .readbytes = ap_cs8427_readbytes, 870 .probeaddr = ap_cs8427_probeaddr, 880 871 }; 881 #else882 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 #endif888 872 889 873 /* … … 967 951 } 968 952 969 #ifdef TARGET_OS2970 953 static 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, 977 960 }; 978 #else979 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 #endif988 961 989 962 /* AK4524 chip select; address 0x48 bit 0-3 */ 990 static voidsnd_ice1712_ews88mt_chip_select(ice1712_t *ice, int chip_mask)963 static int snd_ice1712_ews88mt_chip_select(ice1712_t *ice, int chip_mask) 991 964 { 992 965 unsigned char data, ndata; 993 966 994 snd_assert(chip_mask >= 0 && chip_mask <= 0x0f, return );967 snd_assert(chip_mask >= 0 && chip_mask <= 0x0f, return -EINVAL); 995 968 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; 997 971 ndata = (data & 0xf0) | chip_mask; 998 972 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; 1000 975 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; 1001 982 } 1002 983 … … 1016 997 if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_EWS88MT) { 1017 998 /* 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; 1019 1001 //snd_ice1712_ews88mt_chip_select(ice, 0x0f); 1020 1002 } … … 1170 1152 unsigned char reg[2] = { 0x80 | 4, 0 }; /* CS8427 auto increment | register number 4 + data */ 1171 1153 unsigned char val, nval; 1154 int res = 0; 1155 1172 1156 snd_i2c_lock(ice->i2c); 1173 1157 if (snd_i2c_sendbytes(ice->cs8427, reg, 1) != 1) { 1174 1158 snd_i2c_unlock(ice->i2c); 1175 return -E REMOTE;1159 return -EIO; 1176 1160 } 1177 1161 if (snd_i2c_readbytes(ice->cs8427, &val, 1) != 1) { 1178 1162 snd_i2c_unlock(ice->i2c); 1179 return -E REMOTE;1163 return -EIO; 1180 1164 } 1181 1165 nval = val & 0xf0; … … 1187 1171 reg[1] = nval; 1188 1172 if (snd_i2c_sendbytes(ice->cs8427, reg, 2) != 2) { 1173 res = -EIO; 1174 } else { 1175 res++; 1176 } 1177 } 1189 1178 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; 1196 1180 } 1197 1181 … … 1553 1537 } 1554 1538 1555 #ifdef TARGET_OS21556 1539 static snd_pcm_hardware_t snd_ice1712_playback = 1557 1540 { 1558 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1541 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1559 1542 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1560 1543 SNDRV_PCM_INFO_MMAP_VALID | 1561 1544 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, 1574 1557 }; 1575 1558 1576 1559 static snd_pcm_hardware_t snd_ice1712_playback_ds = 1577 1560 { 1578 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1561 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1579 1562 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1580 1563 SNDRV_PCM_INFO_MMAP_VALID | 1581 1564 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, 1594 1577 }; 1595 1578 1596 1579 static snd_pcm_hardware_t snd_ice1712_capture = 1597 1580 { 1598 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1581 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1599 1582 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1600 1583 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, 1613 1596 }; 1614 #else1615 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 #endif1674 1597 1675 1598 static int snd_ice1712_playback_open(snd_pcm_substream_t * substream) … … 1744 1667 } 1745 1668 1746 #ifdef TARGET_OS21747 1669 static 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,01670 .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, 1756 1678 }; 1757 1679 1758 1680 static 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,01681 .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, 1767 1689 }; 1768 1690 1769 1691 static 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,01692 .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, 1778 1700 }; 1779 #else1780 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 #endif1813 1701 1814 1702 static void snd_ice1712_pcm_free(snd_pcm_t *pcm) … … 1892 1780 #define RATES sizeof(rates) / sizeof(rates[0]) 1893 1781 1894 #ifdef TARGET_OS21895 1782 static snd_pcm_hw_constraint_list_t hw_constraints_rates = { 1896 RATES,1897 rates,1898 0,1783 .count = RATES, 1784 .list = rates, 1785 .mask = 0, 1899 1786 }; 1900 #else1901 static snd_pcm_hw_constraint_list_t hw_constraints_rates = {1902 count: RATES,1903 list: rates,1904 mask: 0,1905 };1906 #endif1907 1787 1908 1788 #if 0 … … 2099 1979 } 2100 1980 2101 #ifdef TARGET_OS22102 1981 static snd_pcm_hardware_t snd_ice1712_playback_pro = 2103 1982 { 2104 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1983 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 2105 1984 SNDRV_PCM_INFO_BLOCK_TRANSFER | 2106 1985 SNDRV_PCM_INFO_MMAP_VALID | 2107 1986 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, 2120 1999 }; 2121 2000 2122 2001 static snd_pcm_hardware_t snd_ice1712_capture_pro = 2123 2002 { 2124 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |2003 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 2125 2004 SNDRV_PCM_INFO_BLOCK_TRANSFER | 2126 2005 SNDRV_PCM_INFO_MMAP_VALID | 2127 2006 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, 2140 2019 }; 2141 #else2142 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 #endif2182 2020 2183 2021 static int snd_ice1712_playback_pro_open(snd_pcm_substream_t * substream) … … 2238 2076 } 2239 2077 2240 #ifdef TARGET_OS22241 2078 static 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,02079 .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, 2250 2087 }; 2251 2088 2252 2089 static 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,02090 .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, 2261 2098 }; 2262 #else2263 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 #endif2285 2099 2286 2100 static int __devinit snd_ice1712_pcm_profi(ice1712_t * ice, int device, snd_pcm_t ** rpcm) … … 2716 2530 2717 2531 static 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 2731 2537 }; 2732 2538 … … 2803 2609 static snd_kcontrol_new_t snd_ice1712_spdif_default __devinitdata = 2804 2610 { 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 2818 2616 }; 2819 2617 … … 2887 2685 static snd_kcontrol_new_t snd_ice1712_spdif_maskc __devinitdata = 2888 2686 { 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, 2902 2692 }; 2903 2693 2904 2694 static snd_kcontrol_new_t snd_ice1712_spdif_maskp __devinitdata = 2905 2695 { 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, 2919 2701 }; 2920 2702 … … 2989 2771 static snd_kcontrol_new_t snd_ice1712_spdif_stream __devinitdata = 2990 2772 { 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 3006 2779 }; 3007 2780 3008 #ifdef TARGET_OS23009 2781 #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) } 3019 2785 3020 2786 static int snd_ice1712_gpio_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 3110 2876 3111 2877 static 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 3125 2883 }; 3126 2884 … … 3269 3027 3270 3028 static 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, 3284 3034 }; 3285 3035 3286 3036 static 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, 3300 3042 }; 3301 3043 … … 3335 3077 3336 3078 static 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 3350 3084 }; 3351 3085 … … 3375 3109 3376 3110 static 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 3390 3116 }; 3391 3117 … … 3439 3165 3440 3166 static 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, 3456 3173 }; 3457 3174 3458 3175 static 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, 3474 3182 }; 3475 3183 … … 3487 3195 if (snd_i2c_readbytes(ice->pcf8574[1], &data, 1) != 1) { 3488 3196 snd_i2c_unlock(ice->i2c); 3489 return -E REMOTE;3197 return -EIO; 3490 3198 } 3491 3199 snd_i2c_unlock(ice->i2c); … … 3503 3211 if (snd_i2c_readbytes(ice->pcf8574[1], &data, 1) != 1) { 3504 3212 snd_i2c_unlock(ice->i2c); 3505 return -E REMOTE;3213 return -EIO; 3506 3214 } 3507 3215 ndata = (data & ~ICE1712_EWS88MT_OUTPUT_SENSE) | (ucontrol->value.enumerated.item[0] ? ICE1712_EWS88MT_OUTPUT_SENSE : 0); 3508 3216 if (ndata != data && snd_i2c_sendbytes(ice->pcf8574[1], &ndata, 1) != 1) { 3509 3217 snd_i2c_unlock(ice->i2c); 3510 return -E REMOTE;3218 return -EIO; 3511 3219 } 3512 3220 snd_i2c_unlock(ice->i2c); … … 3525 3233 if (snd_i2c_readbytes(ice->pcf8574[0], &data, 1) != 1) { 3526 3234 snd_i2c_unlock(ice->i2c); 3527 return -E REMOTE;3235 return -EIO; 3528 3236 } 3529 3237 /* reversed; high = +4dBu, low = -10dBV */ … … 3543 3251 if (snd_i2c_readbytes(ice->pcf8574[0], &data, 1) != 1) { 3544 3252 snd_i2c_unlock(ice->i2c); 3545 return -E REMOTE;3253 return -EIO; 3546 3254 } 3547 3255 ndata = (data & ~(1 << channel)) | (ucontrol->value.enumerated.item[0] ? 0 : (1 << channel)); 3548 3256 if (ndata != data && snd_i2c_sendbytes(ice->pcf8574[0], &ndata, 1) != 1) { 3549 3257 snd_i2c_unlock(ice->i2c); 3550 return -E REMOTE;3258 return -EIO; 3551 3259 } 3552 3260 snd_i2c_unlock(ice->i2c); … … 3555 3263 3556 3264 static 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, 3570 3270 }; 3571 3271 3572 3272 static 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, 3586 3278 }; 3587 3279 … … 3610 3302 if (snd_i2c_readbytes(ice->pcf8575, data, 2) != 2) { 3611 3303 snd_i2c_unlock(ice->i2c); 3612 return -E REMOTE;3304 return -EIO; 3613 3305 } 3614 3306 snd_i2c_unlock(ice->i2c); … … 3631 3323 if (snd_i2c_readbytes(ice->pcf8575, data, 2) != 2) { 3632 3324 snd_i2c_unlock(ice->i2c); 3633 return -E REMOTE;3325 return -EIO; 3634 3326 } 3635 3327 ndata[shift >> 3] = data[shift >> 3] & ~(1 << (shift & 7)); … … 3644 3336 if (change && snd_i2c_sendbytes(ice->pcf8575, data, 2) != 2) { 3645 3337 snd_i2c_unlock(ice->i2c); 3646 return -E REMOTE;3338 return -EIO; 3647 3339 } 3648 3340 snd_i2c_unlock(ice->i2c); … … 3650 3342 } 3651 3343 3652 #ifdef TARGET_OS23653 3344 #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 } 3673 3353 3674 3354 static snd_kcontrol_new_t snd_ice1712_ews88d_controls[] __devinitdata = { … … 3694 3374 if (snd_i2c_readbytes(ice->pcf8575, &byte, 1) != 1) { 3695 3375 snd_i2c_unlock(ice->i2c); 3696 return -E REMOTE;3376 return -EIO; 3697 3377 } 3698 3378 snd_i2c_unlock(ice->i2c); … … 3708 3388 if (snd_i2c_sendbytes(ice->pcf8575, bytes, 2) != 2) { 3709 3389 snd_i2c_unlock(ice->i2c); 3710 return -E REMOTE;3390 return -EIO; 3711 3391 } 3712 3392 snd_i2c_unlock(ice->i2c); … … 3761 3441 3762 3442 #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),\ 3770 3450 } 3771 3451 … … 4164 3844 /* second stage of initialization, analog parts and others */ 4165 3845 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 */ 4166 3851 case ICE1712_SUBDEVICE_DELTA66: 4167 3852 case ICE1712_SUBDEVICE_DELTA44: 4168 3853 case ICE1712_SUBDEVICE_AUDIOPHILE: 4169 3854 case ICE1712_SUBDEVICE_EWX2496: 4170 case ICE1712_SUBDEVICE_EWS88MT:4171 3855 case ICE1712_SUBDEVICE_DMX6FIRE: 4172 3856 snd_ice1712_ak4524_init(ice); … … 4408 4092 __hw_end: 4409 4093 snd_ice1712_proc_done(ice); 4410 synchronize_irq();4411 if (ice->irq)4094 if (ice->irq >= 0) { 4095 synchronize_irq(ice->irq); 4412 4096 free_irq(ice->irq, (void *) ice); 4097 } 4413 4098 if (ice->res_port) { 4414 4099 release_resource(ice->res_port); … … 4444 4129 ice1712_t *ice; 4445 4130 int err; 4446 #ifdef TARGET_OS24447 4131 static snd_device_ops_t ops = { 4448 snd_ice1712_dev_free,0,0,04132 .dev_free = snd_ice1712_dev_free, 4449 4133 }; 4450 #else4451 static snd_device_ops_t ops = {4452 dev_free: snd_ice1712_dev_free,4453 };4454 #endif4455 4134 4456 4135 *r_ice1712 = NULL; … … 4487 4166 pci_write_config_word(ice->pci, 0x42, 0x0006); 4488 4167 snd_ice1712_proc_init(ice); 4489 synchronize_irq( );4168 synchronize_irq(pci->irq); 4490 4169 4491 4170 if ((ice->res_port = request_region(ice->port, 32, "ICE1712 - Controller")) == NULL) { … … 4666 4345 } 4667 4346 4668 #ifdef TARGET_OS24669 4347 static struct pci_driver driver = { 4670 0,0,"ICE1712",4671 snd_ice1712_ids,4672 snd_ice1712_probe,4673 snd_ice1712_remove,0,04348 .name = "ICE1712", 4349 .id_table = snd_ice1712_ids, 4350 .probe = snd_ice1712_probe, 4351 .remove = __devexit_p(snd_ice1712_remove), 4674 4352 }; 4675 #else4676 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 #endif4683 4353 4684 4354 static int __init alsa_card_ice1712_init(void)
Note:
See TracChangeset
for help on using the changeset viewer.