18 #include <linux/types.h>
19 #include <linux/slab.h>
20 #include <linux/pci.h>
22 #include <linux/string.h>
24 #include <linux/kernel.h>
30 #if BITS_PER_LONG == 32
31 #define CT_XFI_DMA_MASK DMA_BIT_MASK(32)
33 #define CT_XFI_DMA_MASK DMA_BIT_MASK(64)
57 #define SRCCTL_STATE 0x00000007
58 #define SRCCTL_BM 0x00000008
59 #define SRCCTL_RSR 0x00000030
60 #define SRCCTL_SF 0x000001C0
61 #define SRCCTL_WR 0x00000200
62 #define SRCCTL_PM 0x00000400
63 #define SRCCTL_ROM 0x00001800
64 #define SRCCTL_VO 0x00002000
65 #define SRCCTL_ST 0x00004000
66 #define SRCCTL_IE 0x00008000
67 #define SRCCTL_ILSZ 0x000F0000
68 #define SRCCTL_BP 0x00100000
70 #define SRCCCR_CISZ 0x000007FF
71 #define SRCCCR_CWA 0x001FF800
72 #define SRCCCR_D 0x00200000
73 #define SRCCCR_RS 0x01C00000
74 #define SRCCCR_NAL 0x3E000000
75 #define SRCCCR_RA 0xC0000000
77 #define SRCCA_CA 0x03FFFFFF
78 #define SRCCA_RS 0x1C000000
79 #define SRCCA_NAL 0xE0000000
81 #define SRCSA_SA 0x03FFFFFF
83 #define SRCLA_LA 0x03FFFFFF
87 #define MPRLH_PITCH 0xFFFFFFFF
138 #define SRCAIM_ARC 0x00000FFF
139 #define SRCAIM_NXT 0x00FF0000
140 #define SRCAIM_SRC 0xFF000000
165 static int src_get_rsc_ctrl_blk(
void **rblk)
179 static int src_put_rsc_ctrl_blk(
void *blk)
186 static int src_set_state(
void *blk,
unsigned int state)
195 static int src_set_bm(
void *blk,
unsigned int bm)
204 static int src_set_rsr(
void *blk,
unsigned int rsr)
213 static int src_set_sf(
void *blk,
unsigned int sf)
222 static int src_set_wr(
void *blk,
unsigned int wr)
231 static int src_set_pm(
void *blk,
unsigned int pm)
240 static int src_set_rom(
void *blk,
unsigned int rom)
249 static int src_set_vo(
void *blk,
unsigned int vo)
258 static int src_set_st(
void *blk,
unsigned int st)
267 static int src_set_ie(
void *blk,
unsigned int ie)
276 static int src_set_ilsz(
void *blk,
unsigned int ilsz)
285 static int src_set_bp(
void *blk,
unsigned int bp)
294 static int src_set_cisz(
void *blk,
unsigned int cisz)
303 static int src_set_ca(
void *blk,
unsigned int ca)
312 static int src_set_sa(
void *blk,
unsigned int sa)
321 static int src_set_la(
void *blk,
unsigned int la)
330 static int src_set_pitch(
void *blk,
unsigned int pitch)
339 static int src_set_clear_zbufs(
void *blk,
unsigned int clear)
345 static int src_set_dirty(
void *blk,
unsigned int flags)
351 static int src_set_dirty_all(
void *blk)
357 #define AR_SLOT_SIZE 4096
358 #define AR_SLOT_BLOCK_SIZE 16
359 #define AR_PTS_PITCH 6
360 #define AR_PARAM_SRC_OFFSET 0x60
362 static unsigned int src_param_pitch_mixer(
unsigned int src_idx)
369 static int src_commit_write(
struct hw *
hw,
unsigned int idx,
void *blk)
376 for (i = 0; i < 8; i++)
377 hw_write_20kx(hw,
SRCUPZ+idx*0x100+i*0x4, 0);
379 for (i = 0; i < 4; i++)
380 hw_write_20kx(hw,
SRCDN0Z+idx*0x100+i*0x4, 0);
382 for (i = 0; i < 8; i++)
383 hw_write_20kx(hw,
SRCDN1Z+idx*0x100+i*0x4, 0);
392 unsigned int pm_idx = src_param_pitch_mixer(idx);
394 hw_write_20kx(hw,
PMOPLO+8*pm_idx, 0x3);
395 hw_write_20kx(hw,
PMOPHI+8*pm_idx, 0x0);
399 hw_write_20kx(hw,
SRCSA+idx*0x100, ctl->
sa);
403 hw_write_20kx(hw,
SRCLA+idx*0x100, ctl->
la);
407 hw_write_20kx(hw,
SRCCA+idx*0x100, ctl->
ca);
412 hw_write_20kx(hw,
SRCCF+idx*0x100, 0x0);
415 hw_write_20kx(hw,
SRCCCR+idx*0x100, ctl->
ccr);
419 hw_write_20kx(hw,
SRCCTL+idx*0x100, ctl->
ctl);
426 static int src_get_ca(
struct hw *hw,
unsigned int idx,
void *blk)
430 ctl->
ca = hw_read_20kx(hw,
SRCCA+idx*0x100);
436 static unsigned int src_get_dirty(
void *blk)
441 static unsigned int src_dirty_conj_mask(
void)
446 static int src_mgr_enbs_src(
void *blk,
unsigned int idx)
454 static int src_mgr_enb_src(
void *blk,
unsigned int idx)
461 static int src_mgr_dsb_src(
void *blk,
unsigned int idx)
468 static int src_mgr_commit_write(
struct hw *hw,
void *blk)
481 for (i = 0; i < 8; i++) {
483 hw_write_20kx(hw,
SRCENB+(i*0x100), ctl->
enb[i]);
491 static int src_mgr_get_ctrl_blk(
void **rblk)
505 static int src_mgr_put_ctrl_blk(
void *blk)
512 static int srcimp_mgr_get_ctrl_blk(
void **rblk)
526 static int srcimp_mgr_put_ctrl_blk(
void *blk)
533 static int srcimp_mgr_set_imaparc(
void *blk,
unsigned int slot)
542 static int srcimp_mgr_set_imapuser(
void *blk,
unsigned int user)
551 static int srcimp_mgr_set_imapnxt(
void *blk,
unsigned int next)
560 static int srcimp_mgr_set_imapaddr(
void *blk,
unsigned int addr)
569 static int srcimp_mgr_commit_write(
struct hw *hw,
void *blk)
586 #define AMOPLO_M 0x00000003
587 #define AMOPLO_X 0x0003FFF0
588 #define AMOPLO_Y 0xFFFC0000
590 #define AMOPHI_SADR 0x000000FF
591 #define AMOPHI_SE 0x80000000
610 static int amixer_set_mode(
void *blk,
unsigned int mode)
619 static int amixer_set_iv(
void *blk,
unsigned int iv)
625 static int amixer_set_x(
void *blk,
unsigned int x)
634 static int amixer_set_y(
void *blk,
unsigned int y)
643 static int amixer_set_sadr(
void *blk,
unsigned int sadr)
652 static int amixer_set_se(
void *blk,
unsigned int se)
661 static int amixer_set_dirty(
void *blk,
unsigned int flags)
667 static int amixer_set_dirty_all(
void *blk)
673 static int amixer_commit_write(
struct hw *hw,
unsigned int idx,
void *blk)
687 static int amixer_get_y(
void *blk)
694 static unsigned int amixer_get_dirty(
void *blk)
699 static int amixer_rsc_get_ctrl_blk(
void **rblk)
713 static int amixer_rsc_put_ctrl_blk(
void *blk)
720 static int amixer_mgr_get_ctrl_blk(
void **rblk)
734 static int amixer_mgr_put_ctrl_blk(
void *blk)
746 #define SRTCTL_SRCR 0x000000FF
747 #define SRTCTL_SRCL 0x0000FF00
748 #define SRTCTL_RSR 0x00030000
749 #define SRTCTL_DRAT 0x000C0000
750 #define SRTCTL_RLE 0x10000000
751 #define SRTCTL_RLP 0x20000000
752 #define SRTCTL_EC 0x40000000
753 #define SRTCTL_ET 0x80000000
786 #define AIM_ARC 0x00000FFF
787 #define AIM_NXT 0x007F0000
795 #define I2SCTL_EA 0x00000004
796 #define I2SCTL_EI 0x00000010
799 #define SPOCTL_OE 0x00000001
800 #define SPOCTL_OS 0x0000000E
801 #define SPOCTL_RIV 0x00000010
802 #define SPOCTL_LIV 0x00000020
803 #define SPOCTL_SR 0x000000C0
806 #define SPICTL_EN 0x00000001
807 #define SPICTL_I24 0x00000002
808 #define SPICTL_IB 0x00000004
809 #define SPICTL_SM 0x00000008
810 #define SPICTL_VM 0x00000010
834 static int dai_srt_set_srcr(
void *blk,
unsigned int src)
843 static int dai_srt_set_srcl(
void *blk,
unsigned int src)
852 static int dai_srt_set_rsr(
void *blk,
unsigned int rsr)
861 static int dai_srt_set_drat(
void *blk,
unsigned int drat)
870 static int dai_srt_set_ec(
void *blk,
unsigned int ec)
879 static int dai_srt_set_et(
void *blk,
unsigned int et)
888 static int dai_commit_write(
struct hw *hw,
unsigned int idx,
void *blk)
906 static int dai_get_ctrl_blk(
void **rblk)
920 static int dai_put_ctrl_blk(
void *blk)
927 static int dao_set_spos(
void *blk,
unsigned int spos)
934 static int dao_commit_write(
struct hw *hw,
unsigned int idx,
void *blk)
941 hw_write_20kx(hw,
SPOS+0x4*idx, ctl->
spos);
949 static int dao_get_spos(
void *blk,
unsigned int *
spos)
955 static int dao_get_ctrl_blk(
void **rblk)
969 static int dao_put_ctrl_blk(
void *blk)
976 static int daio_mgr_enb_dai(
void *blk,
unsigned int idx)
993 static int daio_mgr_dsb_dai(
void *blk,
unsigned int idx)
1010 static int daio_mgr_enb_dao(
void *blk,
unsigned int idx)
1027 static int daio_mgr_dsb_dao(
void *blk,
unsigned int idx)
1044 static int daio_mgr_dao_init(
void *blk,
unsigned int idx,
unsigned int conf)
1050 switch ((conf & 0x7)) {
1071 ((conf >> 3) & 0x1) ? 2 : 2);
1081 static int daio_mgr_set_imaparc(
void *blk,
unsigned int slot)
1090 static int daio_mgr_set_imapnxt(
void *blk,
unsigned int next)
1099 static int daio_mgr_set_imapaddr(
void *blk,
unsigned int addr)
1108 static int daio_mgr_commit_write(
struct hw *hw,
void *blk)
1114 for (i = 0; i < 4; i++) {
1115 if ((ctl->
dirty.
bf.i2sictl & (0x1 << i)))
1116 ctl->
dirty.
bf.i2sictl &= ~(0x1 <<
i);
1118 if ((ctl->
dirty.
bf.i2soctl & (0x1 << i)))
1119 ctl->
dirty.
bf.i2soctl &= ~(0x1 << i);
1125 for (i = 0; i < 4; i++) {
1126 if ((ctl->
dirty.
bf.spoctl & (0x1 << i)))
1127 ctl->
dirty.
bf.spoctl &= ~(0x1 <<
i);
1133 for (i = 0; i < 4; i++) {
1134 if ((ctl->
dirty.
bf.spictl & (0x1 << i)))
1135 ctl->
dirty.
bf.spictl &= ~(0x1 <<
i);
1149 static int daio_mgr_get_ctrl_blk(
struct hw *hw,
void **rblk)
1167 static int daio_mgr_put_ctrl_blk(
void *blk)
1175 static int set_timer_irq(
struct hw *hw,
int enable)
1177 hw_write_20kx(hw,
GIE, enable ?
IT_INT : 0);
1181 static int set_timer_tick(
struct hw *hw,
unsigned int ticks)
1185 hw_write_20kx(hw,
TIMR, ticks);
1189 static unsigned int get_wc(
struct hw *hw)
1191 return hw_read_20kx(hw,
WC);
1213 static int hw_daio_init(
struct hw *hw,
const struct daio_conf *
info)
1220 i2sorg = 0x94040404;
1223 i2sorg &= 0xfffffffc;
1228 hw_write_20kx(hw,
SPOCTL, 0x0);
1231 switch (info->
msr) {
1234 spdorg |= (0x0 << 6);
1238 spdorg |= (0x1 << 6);
1242 spdorg |= (0x2 << 6);
1249 hw_write_20kx(hw,
I2SCTL, i2sorg);
1250 hw_write_20kx(hw,
SPOCTL, spdorg);
1254 hw_write_20kx(hw,
SPICTL, 0x0);
1256 spdorg = 0x0a0a0a0a;
1257 hw_write_20kx(hw,
SPICTL, spdorg);
1264 static int hw_trn_init(
struct hw *hw,
const struct trn_conf *
info)
1267 u32 ptp_phys_low, ptp_phys_high;
1278 if (
sizeof(
void *) == 8)
1281 #if PAGE_SIZE == 8192
1285 hw_write_20kx(hw,
PTPALX, ptp_phys_low);
1286 hw_write_20kx(hw,
PTPAHX, ptp_phys_high);
1287 hw_write_20kx(hw,
TRNCTL, trnctl);
1288 hw_write_20kx(hw,
TRNIS, 0x200c01);
1294 #define GCTL_EAC 0x00000001
1295 #define GCTL_EAI 0x00000002
1296 #define GCTL_BEP 0x00000004
1297 #define GCTL_BES 0x00000008
1298 #define GCTL_DSP 0x00000010
1299 #define GCTL_DBP 0x00000020
1300 #define GCTL_ABP 0x00000040
1301 #define GCTL_TBP 0x00000080
1302 #define GCTL_SBP 0x00000100
1303 #define GCTL_FBP 0x00000200
1304 #define GCTL_XA 0x00000400
1305 #define GCTL_ET 0x00000800
1306 #define GCTL_PR 0x00001000
1307 #define GCTL_MRL 0x00002000
1308 #define GCTL_SDE 0x00004000
1309 #define GCTL_SDI 0x00008000
1310 #define GCTL_SM 0x00010000
1311 #define GCTL_SR 0x00020000
1312 #define GCTL_SD 0x00040000
1313 #define GCTL_SE 0x00080000
1314 #define GCTL_AID 0x00100000
1316 static int hw_pll_init(
struct hw *hw,
unsigned int rsr)
1318 unsigned int pllctl;
1321 pllctl = (48000 == rsr) ? 0x1480a001 : 0x1480a731;
1322 for (i = 0; i < 3; i++) {
1323 if (hw_read_20kx(hw,
PLLCTL) == pllctl)
1326 hw_write_20kx(hw,
PLLCTL, pllctl);
1337 static int hw_auto_init(
struct hw *hw)
1342 gctl = hw_read_20kx(hw,
GCTL);
1344 hw_write_20kx(hw,
GCTL, gctl);
1346 hw_write_20kx(hw,
GCTL, gctl);
1348 for (i = 0; i < 400000; i++) {
1349 gctl = hw_read_20kx(hw,
GCTL);
1361 static int i2c_unlock(
struct hw *hw)
1363 if ((hw_read_pci(hw, 0xcc) & 0xff) == 0xaa)
1366 hw_write_pci(hw, 0xcc, 0x8c);
1367 hw_write_pci(hw, 0xcc, 0x0e);
1368 if ((hw_read_pci(hw, 0xcc) & 0xff) == 0xaa)
1371 hw_write_pci(hw, 0xcc, 0xee);
1372 hw_write_pci(hw, 0xcc, 0xaa);
1373 if ((hw_read_pci(hw, 0xcc) & 0xff) == 0xaa)
1379 static void i2c_lock(
struct hw *hw)
1381 if ((hw_read_pci(hw, 0xcc) & 0xff) == 0xaa)
1382 hw_write_pci(hw, 0xcc, 0x00);
1390 ret = hw_read_pci(hw, 0xEC);
1391 }
while (!(ret & 0x800000));
1392 hw_write_pci(hw, 0xE0, device);
1393 hw_write_pci(hw, 0xE4, (data << 8) | (addr & 0xff));
1398 static int hw_reset_dac(
struct hw *hw)
1408 ret = hw_read_pci(hw, 0xEC);
1409 }
while (!(ret & 0x800000));
1410 hw_write_pci(hw, 0xEC, 0x05);
1413 for (i = 0; i < 2; i++) {
1416 gpioorg = (
u16)hw_read_20kx(hw,
GPIO);
1418 hw_write_20kx(hw,
GPIO, gpioorg);
1420 hw_write_20kx(hw,
GPIO, gpioorg | 0x2);
1431 static int hw_dac_init(
struct hw *hw,
const struct dac_conf *info)
1439 gpioorg = (
u16)hw_read_20kx(hw,
GPIO);
1442 hw_write_20kx(hw,
GPIO, gpioorg);
1447 gpioorg = (
u16)hw_read_20kx(hw,
GPIO);
1449 hw_write_20kx(hw,
GPIO, gpioorg);
1456 hw_write_pci(hw, 0xEC, 0x05);
1458 ret = hw_read_pci(hw, 0xEC);
1459 }
while (!(ret & 0x800000));
1461 switch (info->
msr) {
1484 gpioorg = (
u16)hw_read_20kx(hw,
GPIO);
1485 gpioorg = gpioorg | 0x40;
1486 hw_write_20kx(hw,
GPIO, gpioorg);
1493 static int is_adc_input_selected_SB055x(
struct hw *hw,
enum ADCSRC type)
1498 static int is_adc_input_selected_SBx(
struct hw *hw,
enum ADCSRC type)
1502 data = hw_read_20kx(hw,
GPIO);
1505 data = ((data & (0x1<<7)) && (data & (0x1<<8)));
1508 data = (!(data & (0x1<<7)) && (data & (0x1<<8)));
1511 data = (!(data & (0x1<<8)));
1519 static int is_adc_input_selected_hendrix(
struct hw *hw,
enum ADCSRC type)
1523 data = hw_read_20kx(hw,
GPIO);
1526 data = (data & (0x1 << 7)) ? 1 : 0;
1529 data = (data & (0x1 << 7)) ? 0 : 1;
1537 static int hw_is_adc_input_selected(
struct hw *hw,
enum ADCSRC type)
1539 switch (hw->
model) {
1541 return is_adc_input_selected_SB055x(hw, type);
1543 return is_adc_input_selected_hendrix(hw, type);
1545 return is_adc_input_selected_hendrix(hw, type);
1547 return is_adc_input_selected_SBx(hw, type);
1552 adc_input_select_SB055x(
struct hw *hw,
enum ADCSRC type,
unsigned char boost)
1565 data = hw_read_20kx(hw,
GPIO);
1569 data |= (0x1<<7) | (0x1<<8) | (0x1<<9) ;
1570 data |= boost ? (0x1<<2) : 0;
1576 data |= (0x1<<8) | (0x1<<12);
1585 hw_write_20kx(hw,
GPIO, data);
1592 adc_input_select_SBx(
struct hw *hw,
enum ADCSRC type,
unsigned char boost)
1602 ret = hw_read_pci(hw, 0xEC);
1603 }
while (!(ret & 0x800000));
1605 hw_write_pci(hw, 0xEC, 0x05);
1607 data = hw_read_20kx(hw,
GPIO);
1610 data |= ((0x1 << 7) | (0x1 << 8));
1614 data &= ~(0x1 << 7);
1619 data &= ~(0x1 << 8);
1626 hw_write_20kx(hw,
GPIO, data);
1627 i2c_write(hw, 0x001a0080, 0x2a, i2c_data);
1642 adc_input_select_hendrix(
struct hw *hw,
enum ADCSRC type,
unsigned char boost)
1652 ret = hw_read_pci(hw, 0xEC);
1653 }
while (!(ret & 0x800000));
1655 hw_write_pci(hw, 0xEC, 0x05);
1657 data = hw_read_20kx(hw,
GPIO);
1664 data &= ~(0x1 << 7);
1671 hw_write_20kx(hw,
GPIO, data);
1672 i2c_write(hw, 0x001a0080, 0x2a, i2c_data);
1686 static int hw_adc_input_select(
struct hw *hw,
enum ADCSRC type)
1690 switch (hw->
model) {
1692 return adc_input_select_SB055x(hw, type, state);
1694 return adc_input_select_hendrix(hw, type, state);
1696 return adc_input_select_hendrix(hw, type, state);
1698 return adc_input_select_SBx(hw, type, state);
1702 static int adc_init_SB055x(
struct hw *hw,
int input,
int mic20db)
1704 return adc_input_select_SB055x(hw, input, mic20db);
1707 static int adc_init_SBx(
struct hw *hw,
int input,
int mic20db)
1714 input_source = 0x100;
1718 input_source = 0x180;
1742 ret = hw_read_pci(hw, 0xEC);
1743 }
while (!(ret & 0x800000));
1744 hw_write_pci(hw, 0xEC, 0x05);
1749 i2c_write(hw, 0x001a0080, 0x2a, adcdata);
1759 if (!(hw_read_20kx(hw,
ID0) & 0x100))
1764 gpioorg = (
u16)hw_read_20kx(hw,
GPIO);
1766 gpioorg |= input_source;
1767 hw_write_20kx(hw,
GPIO, gpioorg);
1772 static int hw_adc_init(
struct hw *hw,
const struct adc_conf *info)
1775 return adc_init_SB055x(hw, info->
input, info->
mic20db);
1786 cap.dedicated_mic = 0;
1787 cap.output_switch = 0;
1788 cap.mic_source_switch = 0;
1793 #define CTLBITS(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
1795 #define UAA_CFG_PWRSTATUS 0x44
1796 #define UAA_CFG_SPACE_FLAG 0xA0
1797 #define UAA_CORE_CHANGE 0x3FFC
1798 static int uaa_to_xfi(
struct pci_dev *pci)
1800 unsigned int bar0, bar1, bar2, bar3, bar4, bar5;
1801 unsigned int cmd,
irq, cl_size, l_timer, pwr;
1802 unsigned int is_uaa;
1803 unsigned int data[4] = {0};
1807 const u32 CTLX =
CTLBITS(
'C',
'T',
'L',
'X');
1808 const u32 CTL_ =
CTLBITS(
'C',
'T',
'L',
'-');
1809 const u32 CTLF =
CTLBITS(
'C',
'T',
'L',
'F');
1810 const u32 CTLi =
CTLBITS(
'C',
'T',
'L',
'i');
1811 const u32 CTLA =
CTLBITS(
'C',
'T',
'L',
'A');
1812 const u32 CTLZ =
CTLBITS(
'C',
'T',
'L',
'Z');
1813 const u32 CTLL =
CTLBITS(
'C',
'T',
'L',
'L');
1822 for (i = 0; i < 4; i++)
1826 if (data[0] == CTLA) {
1827 is_uaa = ((data[1] == CTLZ && data[2] == CTLL
1828 && data[3] == CTLA) || (data[1] == CTLA
1829 && data[2] == CTLZ && data[3] == CTLL));
1830 }
else if (data[0] == CTLZ) {
1831 is_uaa = (data[1] == CTLL
1832 && data[2] == CTLA && data[3] == CTLA);
1833 }
else if (data[0] == CTLL) {
1834 is_uaa = (data[1] == CTLA
1835 && data[2] == CTLA && data[3] == CTLZ);
1891 status = hw_read_20kx(hw,
GIP);
1898 hw_write_20kx(hw,
GIP, status);
1902 static int hw_card_start(
struct hw *hw)
1915 "busmaster DMA with mask 0x%llx\n",
1935 err = uaa_to_xfi(pci);
1943 KBUILD_MODNAME, hw);
1963 static int hw_card_stop(
struct hw *hw)
1968 hw_write_20kx(hw,
TRNCTL, 0x00);
1971 data = hw_read_20kx(hw,
PLLCTL);
1972 hw_write_20kx(hw,
PLLCTL, (data & (~(0x0F<<12))));
1980 static int hw_card_shutdown(
struct hw *hw)
2002 static int hw_card_init(
struct hw *hw,
struct card_conf *info)
2013 err = hw_card_start(hw);
2018 err = hw_pll_init(hw, info->
rsr);
2023 err = hw_auto_init(hw);
2028 gctl = hw_read_20kx(hw,
GCTL);
2034 hw_write_20kx(hw,
GCTL, gctl);
2038 hw_write_20kx(hw,
GIE, 0);
2040 hw_write_20kx(hw,
SRCIP, 0);
2044 switch (hw->
model) {
2046 hw_write_20kx(hw,
GPIOCTL, 0x13fe);
2049 hw_write_20kx(hw,
GPIOCTL, 0x00e6);
2052 hw_write_20kx(hw,
GPIOCTL, 0x00c2);
2055 hw_write_20kx(hw,
GPIOCTL, 0x01e6);
2060 err = hw_trn_init(hw, &trn_info);
2064 daio_info.
msr = info->
msr;
2065 err = hw_daio_init(hw, &daio_info);
2069 dac_info.
msr = info->
msr;
2070 err = hw_dac_init(hw, &dac_info);
2074 adc_info.
msr = info->
msr;
2077 err = hw_adc_init(hw, &adc_info);
2081 data = hw_read_20kx(hw,
SRCMCTL);
2083 hw_write_20kx(hw,
SRCMCTL, data);
2088 #ifdef CONFIG_PM_SLEEP
2089 static int hw_suspend(
struct hw *hw)
2107 static int hw_resume(
struct hw *hw,
struct card_conf *info)
2115 return hw_card_init(hw, info);
2119 static u32 hw_read_20kx(
struct hw *hw,
u32 reg)
2122 unsigned long flags;
2128 spin_unlock_irqrestore(
2134 static void hw_write_20kx(
struct hw *hw,
u32 reg,
u32 data)
2136 unsigned long flags;
2142 spin_unlock_irqrestore(
2147 static u32 hw_read_pci(
struct hw *hw,
u32 reg)
2150 unsigned long flags;
2156 spin_unlock_irqrestore(
2162 static void hw_write_pci(
struct hw *hw,
u32 reg,
u32 data)
2164 unsigned long flags;
2170 spin_unlock_irqrestore(
2177 .card_init = hw_card_init,
2178 .card_stop = hw_card_stop,
2179 .pll_init = hw_pll_init,
2180 .is_adc_source_selected = hw_is_adc_input_selected,
2181 .select_adc_source = hw_adc_input_select,
2182 .capabilities = hw_capabilities,
2183 #ifdef CONFIG_PM_SLEEP
2184 .suspend = hw_suspend,
2185 .resume = hw_resume,
2188 .src_rsc_get_ctrl_blk = src_get_rsc_ctrl_blk,
2189 .src_rsc_put_ctrl_blk = src_put_rsc_ctrl_blk,
2247 .dai_srt_set_srco = dai_srt_set_srcr,
2248 .dai_srt_set_srcm = dai_srt_set_srcl,
2283 hw20k1 = kzalloc(
sizeof(*hw20k1),
GFP_KERNEL);
2290 hw20k1->
hw = ct20k1_preset;
2300 hw_card_shutdown(hw);