aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/ctxfi/ctatc.c82
-rw-r--r--sound/pci/ctxfi/ctatc.h3
-rw-r--r--sound/pci/ctxfi/cthardware.c4
-rw-r--r--sound/pci/ctxfi/cthw20k1.c205
-rw-r--r--sound/pci/ctxfi/cthw20k2.c195
-rw-r--r--sound/pci/ctxfi/xfi.c2
6 files changed, 243 insertions, 248 deletions
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index 10b741977dd7..9b1324544db0 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -1202,7 +1202,7 @@ static int atc_dev_free(struct snd_device *dev)
return ct_atc_destroy(atc);
}
-static int atc_identify_card(struct ct_atc *atc)
+static int __devinit atc_identify_card(struct ct_atc *atc)
{
u16 subsys;
u8 revision;
@@ -1243,7 +1243,7 @@ static int atc_identify_card(struct ct_atc *atc)
return 0;
}
-static int ct_create_alsa_devs(struct ct_atc *atc)
+int __devinit ct_atc_create_alsa_devs(struct ct_atc *atc)
{
enum CTALSADEVS i;
struct hw *hw = atc->hw;
@@ -1277,7 +1277,7 @@ static int ct_create_alsa_devs(struct ct_atc *atc)
return 0;
}
-static int atc_create_hw_devs(struct ct_atc *atc)
+static int __devinit atc_create_hw_devs(struct ct_atc *atc)
{
struct hw *hw = NULL;
struct card_conf info = {0};
@@ -1313,7 +1313,7 @@ static int atc_create_hw_devs(struct ct_atc *atc)
return 0;
}
-static int atc_get_resources(struct ct_atc *atc)
+static int __devinit atc_get_resources(struct ct_atc *atc)
{
struct daio_desc da_desc = {0};
struct daio_mgr *daio_mgr = NULL;
@@ -1423,7 +1423,7 @@ static int atc_get_resources(struct ct_atc *atc)
return 0;
}
-static void
+static void __devinit
atc_connect_dai(struct src_mgr *src_mgr, struct dai *dai,
struct src **srcs, struct srcimp **srcimps)
{
@@ -1462,7 +1462,7 @@ atc_connect_dai(struct src_mgr *src_mgr, struct dai *dai,
src_mgr->commit_write(src_mgr); /* Synchronously enable SRCs */
}
-static void atc_connect_resources(struct ct_atc *atc)
+static void __devinit atc_connect_resources(struct ct_atc *atc)
{
struct dai *dai = NULL;
struct dao *dao = NULL;
@@ -1508,37 +1508,35 @@ static void atc_connect_resources(struct ct_atc *atc)
}
}
-static void atc_set_ops(struct ct_atc *atc)
-{
- /* Set operations */
- atc->map_audio_buffer = ct_map_audio_buffer;
- atc->unmap_audio_buffer = ct_unmap_audio_buffer;
- atc->pcm_playback_prepare = atc_pcm_playback_prepare;
- atc->pcm_release_resources = atc_pcm_release_resources;
- atc->pcm_playback_start = atc_pcm_playback_start;
- atc->pcm_playback_stop = atc_pcm_stop;
- atc->pcm_playback_position = atc_pcm_playback_position;
- atc->pcm_capture_prepare = atc_pcm_capture_prepare;
- atc->pcm_capture_start = atc_pcm_capture_start;
- atc->pcm_capture_stop = atc_pcm_stop;
- atc->pcm_capture_position = atc_pcm_capture_position;
- atc->spdif_passthru_playback_prepare = spdif_passthru_playback_prepare;
- atc->get_ptp_phys = atc_get_ptp_phys;
- atc->select_line_in = atc_select_line_in;
- atc->select_mic_in = atc_select_mic_in;
- atc->select_digit_io = atc_select_digit_io;
- atc->line_front_unmute = atc_line_front_unmute;
- atc->line_surround_unmute = atc_line_surround_unmute;
- atc->line_clfe_unmute = atc_line_clfe_unmute;
- atc->line_rear_unmute = atc_line_rear_unmute;
- atc->line_in_unmute = atc_line_in_unmute;
- atc->spdif_out_unmute = atc_spdif_out_unmute;
- atc->spdif_in_unmute = atc_spdif_in_unmute;
- atc->spdif_out_get_status = atc_spdif_out_get_status;
- atc->spdif_out_set_status = atc_spdif_out_set_status;
- atc->spdif_out_passthru = atc_spdif_out_passthru;
- atc->have_digit_io_switch = atc_have_digit_io_switch;
-}
+static struct ct_atc atc_preset __devinitdata = {
+ .map_audio_buffer = ct_map_audio_buffer,
+ .unmap_audio_buffer = ct_unmap_audio_buffer,
+ .pcm_playback_prepare = atc_pcm_playback_prepare,
+ .pcm_release_resources = atc_pcm_release_resources,
+ .pcm_playback_start = atc_pcm_playback_start,
+ .pcm_playback_stop = atc_pcm_stop,
+ .pcm_playback_position = atc_pcm_playback_position,
+ .pcm_capture_prepare = atc_pcm_capture_prepare,
+ .pcm_capture_start = atc_pcm_capture_start,
+ .pcm_capture_stop = atc_pcm_stop,
+ .pcm_capture_position = atc_pcm_capture_position,
+ .spdif_passthru_playback_prepare = spdif_passthru_playback_prepare,
+ .get_ptp_phys = atc_get_ptp_phys,
+ .select_line_in = atc_select_line_in,
+ .select_mic_in = atc_select_mic_in,
+ .select_digit_io = atc_select_digit_io,
+ .line_front_unmute = atc_line_front_unmute,
+ .line_surround_unmute = atc_line_surround_unmute,
+ .line_clfe_unmute = atc_line_clfe_unmute,
+ .line_rear_unmute = atc_line_rear_unmute,
+ .line_in_unmute = atc_line_in_unmute,
+ .spdif_out_unmute = atc_spdif_out_unmute,
+ .spdif_in_unmute = atc_spdif_in_unmute,
+ .spdif_out_get_status = atc_spdif_out_get_status,
+ .spdif_out_set_status = atc_spdif_out_set_status,
+ .spdif_out_passthru = atc_spdif_out_passthru,
+ .have_digit_io_switch = atc_have_digit_io_switch,
+};
/**
* ct_atc_create - create and initialize a hardware manager
@@ -1552,7 +1550,7 @@ static void atc_set_ops(struct ct_atc *atc)
* Returns 0 if suceeds, or negative error code if fails.
*/
-int ct_atc_create(struct snd_card *card, struct pci_dev *pci,
+int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci,
unsigned int rsr, unsigned int msr, struct ct_atc **ratc)
{
struct ct_atc *atc = NULL;
@@ -1567,14 +1565,14 @@ int ct_atc_create(struct snd_card *card, struct pci_dev *pci,
if (NULL == atc)
return -ENOMEM;
+ /* Set operations */
+ *atc = atc_preset;
+
atc->card = card;
atc->pci = pci;
atc->rsr = rsr;
atc->msr = msr;
- /* Set operations */
- atc_set_ops(atc);
-
spin_lock_init(&atc->atc_lock);
/* Find card model */
@@ -1606,8 +1604,6 @@ int ct_atc_create(struct snd_card *card, struct pci_dev *pci,
if (!atc->timer)
goto error1;
- atc->create_alsa_devs = ct_create_alsa_devs;
-
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, atc, &ops);
if (err < 0)
goto error1;
diff --git a/sound/pci/ctxfi/ctatc.h b/sound/pci/ctxfi/ctatc.h
index a3f9b1bc7dcc..04459aa0d4d9 100644
--- a/sound/pci/ctxfi/ctatc.h
+++ b/sound/pci/ctxfi/ctatc.h
@@ -91,8 +91,6 @@ struct ct_atc {
const struct ct_atc_chip_details *chip_details;
enum CTCARDS model;
- /* Create all alsa devices */
- int (*create_alsa_devs)(struct ct_atc *atc);
struct ct_vm *vm; /* device virtual memory manager for this card */
int (*map_audio_buffer)(struct ct_atc *atc, struct ct_atc_pcm *apcm);
@@ -151,5 +149,6 @@ struct ct_atc {
int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci,
unsigned int rsr, unsigned int msr,
struct ct_atc **ratc);
+int __devinit ct_atc_create_alsa_devs(struct ct_atc *atc);
#endif /* CTATC_H */
diff --git a/sound/pci/ctxfi/cthardware.c b/sound/pci/ctxfi/cthardware.c
index 8e58860f641c..53d1acadc0e8 100644
--- a/sound/pci/ctxfi/cthardware.c
+++ b/sound/pci/ctxfi/cthardware.c
@@ -20,7 +20,7 @@
#include "cthw20k2.h"
#include <linux/bug.h>
-static enum CHIPTYP get_chip_type(struct hw *hw)
+static enum CHIPTYP __devinitdata get_chip_type(struct hw *hw)
{
enum CHIPTYP type = ATCNONE;
@@ -39,7 +39,7 @@ static enum CHIPTYP get_chip_type(struct hw *hw)
return type;
}
-int create_hw_obj(struct pci_dev *pci, struct hw **rhw)
+int __devinit create_hw_obj(struct pci_dev *pci, struct hw **rhw)
{
int err = 0;
diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c
index 550b30a2bcf1..df565c11fcca 100644
--- a/sound/pci/ctxfi/cthw20k1.c
+++ b/sound/pci/ctxfi/cthw20k1.c
@@ -2138,9 +2138,107 @@ static void hw_write_pci(struct hw *hw, u32 reg, u32 data)
&container_of(hw, struct hw20k1, hw)->reg_pci_lock, flags);
}
-int create_20k1_hw_obj(struct hw **rhw)
+static struct hw ct20k1_preset __devinitdata = {
+ .irq = -1,
+
+ .card_init = hw_card_init,
+ .card_stop = hw_card_stop,
+ .pll_init = hw_pll_init,
+ .is_adc_source_selected = hw_is_adc_input_selected,
+ .select_adc_source = hw_adc_input_select,
+ .have_digit_io_switch = hw_have_digit_io_switch,
+
+ .src_rsc_get_ctrl_blk = src_get_rsc_ctrl_blk,
+ .src_rsc_put_ctrl_blk = src_put_rsc_ctrl_blk,
+ .src_mgr_get_ctrl_blk = src_mgr_get_ctrl_blk,
+ .src_mgr_put_ctrl_blk = src_mgr_put_ctrl_blk,
+ .src_set_state = src_set_state,
+ .src_set_bm = src_set_bm,
+ .src_set_rsr = src_set_rsr,
+ .src_set_sf = src_set_sf,
+ .src_set_wr = src_set_wr,
+ .src_set_pm = src_set_pm,
+ .src_set_rom = src_set_rom,
+ .src_set_vo = src_set_vo,
+ .src_set_st = src_set_st,
+ .src_set_ie = src_set_ie,
+ .src_set_ilsz = src_set_ilsz,
+ .src_set_bp = src_set_bp,
+ .src_set_cisz = src_set_cisz,
+ .src_set_ca = src_set_ca,
+ .src_set_sa = src_set_sa,
+ .src_set_la = src_set_la,
+ .src_set_pitch = src_set_pitch,
+ .src_set_dirty = src_set_dirty,
+ .src_set_clear_zbufs = src_set_clear_zbufs,
+ .src_set_dirty_all = src_set_dirty_all,
+ .src_commit_write = src_commit_write,
+ .src_get_ca = src_get_ca,
+ .src_get_dirty = src_get_dirty,
+ .src_dirty_conj_mask = src_dirty_conj_mask,
+ .src_mgr_enbs_src = src_mgr_enbs_src,
+ .src_mgr_enb_src = src_mgr_enb_src,
+ .src_mgr_dsb_src = src_mgr_dsb_src,
+ .src_mgr_commit_write = src_mgr_commit_write,
+
+ .srcimp_mgr_get_ctrl_blk = srcimp_mgr_get_ctrl_blk,
+ .srcimp_mgr_put_ctrl_blk = srcimp_mgr_put_ctrl_blk,
+ .srcimp_mgr_set_imaparc = srcimp_mgr_set_imaparc,
+ .srcimp_mgr_set_imapuser = srcimp_mgr_set_imapuser,
+ .srcimp_mgr_set_imapnxt = srcimp_mgr_set_imapnxt,
+ .srcimp_mgr_set_imapaddr = srcimp_mgr_set_imapaddr,
+ .srcimp_mgr_commit_write = srcimp_mgr_commit_write,
+
+ .amixer_rsc_get_ctrl_blk = amixer_rsc_get_ctrl_blk,
+ .amixer_rsc_put_ctrl_blk = amixer_rsc_put_ctrl_blk,
+ .amixer_mgr_get_ctrl_blk = amixer_mgr_get_ctrl_blk,
+ .amixer_mgr_put_ctrl_blk = amixer_mgr_put_ctrl_blk,
+ .amixer_set_mode = amixer_set_mode,
+ .amixer_set_iv = amixer_set_iv,
+ .amixer_set_x = amixer_set_x,
+ .amixer_set_y = amixer_set_y,
+ .amixer_set_sadr = amixer_set_sadr,
+ .amixer_set_se = amixer_set_se,
+ .amixer_set_dirty = amixer_set_dirty,
+ .amixer_set_dirty_all = amixer_set_dirty_all,
+ .amixer_commit_write = amixer_commit_write,
+ .amixer_get_y = amixer_get_y,
+ .amixer_get_dirty = amixer_get_dirty,
+
+ .dai_get_ctrl_blk = dai_get_ctrl_blk,
+ .dai_put_ctrl_blk = dai_put_ctrl_blk,
+ .dai_srt_set_srco = dai_srt_set_srcr,
+ .dai_srt_set_srcm = dai_srt_set_srcl,
+ .dai_srt_set_rsr = dai_srt_set_rsr,
+ .dai_srt_set_drat = dai_srt_set_drat,
+ .dai_srt_set_ec = dai_srt_set_ec,
+ .dai_srt_set_et = dai_srt_set_et,
+ .dai_commit_write = dai_commit_write,
+
+ .dao_get_ctrl_blk = dao_get_ctrl_blk,
+ .dao_put_ctrl_blk = dao_put_ctrl_blk,
+ .dao_set_spos = dao_set_spos,
+ .dao_commit_write = dao_commit_write,
+ .dao_get_spos = dao_get_spos,
+
+ .daio_mgr_get_ctrl_blk = daio_mgr_get_ctrl_blk,
+ .daio_mgr_put_ctrl_blk = daio_mgr_put_ctrl_blk,
+ .daio_mgr_enb_dai = daio_mgr_enb_dai,
+ .daio_mgr_dsb_dai = daio_mgr_dsb_dai,
+ .daio_mgr_enb_dao = daio_mgr_enb_dao,
+ .daio_mgr_dsb_dao = daio_mgr_dsb_dao,
+ .daio_mgr_dao_init = daio_mgr_dao_init,
+ .daio_mgr_set_imaparc = daio_mgr_set_imaparc,
+ .daio_mgr_set_imapnxt = daio_mgr_set_imapnxt,
+ .daio_mgr_set_imapaddr = daio_mgr_set_imapaddr,
+ .daio_mgr_commit_write = daio_mgr_commit_write,
+
+ .set_timer_irq = set_timer_irq,
+ .set_timer_tick = set_timer_tick,
+};
+
+int __devinit create_20k1_hw_obj(struct hw **rhw)
{
- struct hw *hw;
struct hw20k1 *hw20k1;
*rhw = NULL;
@@ -2151,108 +2249,9 @@ int create_20k1_hw_obj(struct hw **rhw)
spin_lock_init(&hw20k1->reg_20k1_lock);
spin_lock_init(&hw20k1->reg_pci_lock);
- hw = &hw20k1->hw;
+ hw20k1->hw = ct20k1_preset;
- hw->io_base = 0;
- hw->mem_base = (unsigned long)NULL;
- hw->irq = -1;
-
- hw->card_init = hw_card_init;
- hw->card_stop = hw_card_stop;
- hw->pll_init = hw_pll_init;
- hw->is_adc_source_selected = hw_is_adc_input_selected;
- hw->select_adc_source = hw_adc_input_select;
- hw->have_digit_io_switch = hw_have_digit_io_switch;
-
- hw->src_rsc_get_ctrl_blk = src_get_rsc_ctrl_blk;
- hw->src_rsc_put_ctrl_blk = src_put_rsc_ctrl_blk;
- hw->src_mgr_get_ctrl_blk = src_mgr_get_ctrl_blk;
- hw->src_mgr_put_ctrl_blk = src_mgr_put_ctrl_blk;
- hw->src_set_state = src_set_state;
- hw->src_set_bm = src_set_bm;
- hw->src_set_rsr = src_set_rsr;
- hw->src_set_sf = src_set_sf;
- hw->src_set_wr = src_set_wr;
- hw->src_set_pm = src_set_pm;
- hw->src_set_rom = src_set_rom;
- hw->src_set_vo = src_set_vo;
- hw->src_set_st = src_set_st;
- hw->src_set_ie = src_set_ie;
- hw->src_set_ilsz = src_set_ilsz;
- hw->src_set_bp = src_set_bp;
- hw->src_set_cisz = src_set_cisz;
- hw->src_set_ca = src_set_ca;
- hw->src_set_sa = src_set_sa;
- hw->src_set_la = src_set_la;
- hw->src_set_pitch = src_set_pitch;
- hw->src_set_dirty = src_set_dirty;
- hw->src_set_clear_zbufs = src_set_clear_zbufs;
- hw->src_set_dirty_all = src_set_dirty_all;
- hw->src_commit_write = src_commit_write;
- hw->src_get_ca = src_get_ca;
- hw->src_get_dirty = src_get_dirty;
- hw->src_dirty_conj_mask = src_dirty_conj_mask;
- hw->src_mgr_enbs_src = src_mgr_enbs_src;
- hw->src_mgr_enb_src = src_mgr_enb_src;
- hw->src_mgr_dsb_src = src_mgr_dsb_src;
- hw->src_mgr_commit_write = src_mgr_commit_write;
-
- hw->srcimp_mgr_get_ctrl_blk = srcimp_mgr_get_ctrl_blk;
- hw->srcimp_mgr_put_ctrl_blk = srcimp_mgr_put_ctrl_blk;
- hw->srcimp_mgr_set_imaparc = srcimp_mgr_set_imaparc;
- hw->srcimp_mgr_set_imapuser = srcimp_mgr_set_imapuser;
- hw->srcimp_mgr_set_imapnxt = srcimp_mgr_set_imapnxt;
- hw->srcimp_mgr_set_imapaddr = srcimp_mgr_set_imapaddr;
- hw->srcimp_mgr_commit_write = srcimp_mgr_commit_write;
-
- hw->amixer_rsc_get_ctrl_blk = amixer_rsc_get_ctrl_blk;
- hw->amixer_rsc_put_ctrl_blk = amixer_rsc_put_ctrl_blk;
- hw->amixer_mgr_get_ctrl_blk = amixer_mgr_get_ctrl_blk;
- hw->amixer_mgr_put_ctrl_blk = amixer_mgr_put_ctrl_blk;
- hw->amixer_set_mode = amixer_set_mode;
- hw->amixer_set_iv = amixer_set_iv;
- hw->amixer_set_x = amixer_set_x;
- hw->amixer_set_y = amixer_set_y;
- hw->amixer_set_sadr = amixer_set_sadr;
- hw->amixer_set_se = amixer_set_se;
- hw->amixer_set_dirty = amixer_set_dirty;
- hw->amixer_set_dirty_all = amixer_set_dirty_all;
- hw->amixer_commit_write = amixer_commit_write;
- hw->amixer_get_y = amixer_get_y;
- hw->amixer_get_dirty = amixer_get_dirty;
-
- hw->dai_get_ctrl_blk = dai_get_ctrl_blk;
- hw->dai_put_ctrl_blk = dai_put_ctrl_blk;
- hw->dai_srt_set_srco = dai_srt_set_srcr;
- hw->dai_srt_set_srcm = dai_srt_set_srcl;
- hw->dai_srt_set_rsr = dai_srt_set_rsr;
- hw->dai_srt_set_drat = dai_srt_set_drat;
- hw->dai_srt_set_ec = dai_srt_set_ec;
- hw->dai_srt_set_et = dai_srt_set_et;
- hw->dai_commit_write = dai_commit_write;
-
- hw->dao_get_ctrl_blk = dao_get_ctrl_blk;
- hw->dao_put_ctrl_blk = dao_put_ctrl_blk;
- hw->dao_set_spos = dao_set_spos;
- hw->dao_commit_write = dao_commit_write;
- hw->dao_get_spos = dao_get_spos;
-
- hw->daio_mgr_get_ctrl_blk = daio_mgr_get_ctrl_blk;
- hw->daio_mgr_put_ctrl_blk = daio_mgr_put_ctrl_blk;
- hw->daio_mgr_enb_dai = daio_mgr_enb_dai;
- hw->daio_mgr_dsb_dai = daio_mgr_dsb_dai;
- hw->daio_mgr_enb_dao = daio_mgr_enb_dao;
- hw->daio_mgr_dsb_dao = daio_mgr_dsb_dao;
- hw->daio_mgr_dao_init = daio_mgr_dao_init;
- hw->daio_mgr_set_imaparc = daio_mgr_set_imaparc;
- hw->daio_mgr_set_imapnxt = daio_mgr_set_imapnxt;
- hw->daio_mgr_set_imapaddr = daio_mgr_set_imapaddr;
- hw->daio_mgr_commit_write = daio_mgr_commit_write;
-
- hw->set_timer_irq = set_timer_irq;
- hw->set_timer_tick = set_timer_tick;
-
- *rhw = hw;
+ *rhw = &hw20k1->hw;
return 0;
}
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c
index 349728765f2c..041199fbae16 100644
--- a/sound/pci/ctxfi/cthw20k2.c
+++ b/sound/pci/ctxfi/cthw20k2.c
@@ -2006,7 +2006,103 @@ static void hw_write_20kx(struct hw *hw, u32 reg, u32 data)
writel(data, (void *)(hw->mem_base + reg));
}
-int create_20k2_hw_obj(struct hw **rhw)
+static struct hw ct20k2_preset __devinitdata = {
+ .irq = -1,
+
+ .card_init = hw_card_init,
+ .card_stop = hw_card_stop,
+ .pll_init = hw_pll_init,
+ .is_adc_source_selected = hw_is_adc_input_selected,
+ .select_adc_source = hw_adc_input_select,
+ .have_digit_io_switch = hw_have_digit_io_switch,
+
+ .src_rsc_get_ctrl_blk = src_get_rsc_ctrl_blk,
+ .src_rsc_put_ctrl_blk = src_put_rsc_ctrl_blk,
+ .src_mgr_get_ctrl_blk = src_mgr_get_ctrl_blk,
+ .src_mgr_put_ctrl_blk = src_mgr_put_ctrl_blk,
+ .src_set_state = src_set_state,
+ .src_set_bm = src_set_bm,
+ .src_set_rsr = src_set_rsr,
+ .src_set_sf = src_set_sf,
+ .src_set_wr = src_set_wr,
+ .src_set_pm = src_set_pm,
+ .src_set_rom = src_set_rom,
+ .src_set_vo = src_set_vo,
+ .src_set_st = src_set_st,
+ .src_set_ie = src_set_ie,
+ .src_set_ilsz = src_set_ilsz,
+ .src_set_bp = src_set_bp,
+ .src_set_cisz = src_set_cisz,
+ .src_set_ca = src_set_ca,
+ .src_set_sa = src_set_sa,
+ .src_set_la = src_set_la,
+ .src_set_pitch = src_set_pitch,
+ .src_set_dirty = src_set_dirty,
+ .src_set_clear_zbufs = src_set_clear_zbufs,
+ .src_set_dirty_all = src_set_dirty_all,
+ .src_commit_write = src_commit_write,
+ .src_get_ca = src_get_ca,
+ .src_get_dirty = src_get_dirty,
+ .src_dirty_conj_mask = src_dirty_conj_mask,
+ .src_mgr_enbs_src = src_mgr_enbs_src,
+ .src_mgr_enb_src = src_mgr_enb_src,
+ .src_mgr_dsb_src = src_mgr_dsb_src,
+ .src_mgr_commit_write = src_mgr_commit_write,
+
+ .srcimp_mgr_get_ctrl_blk = srcimp_mgr_get_ctrl_blk,
+ .srcimp_mgr_put_ctrl_blk = srcimp_mgr_put_ctrl_blk,
+ .srcimp_mgr_set_imaparc = srcimp_mgr_set_imaparc,
+ .srcimp_mgr_set_imapuser = srcimp_mgr_set_imapuser,
+ .srcimp_mgr_set_imapnxt = srcimp_mgr_set_imapnxt,
+ .srcimp_mgr_set_imapaddr = srcimp_mgr_set_imapaddr,
+ .srcimp_mgr_commit_write = srcimp_mgr_commit_write,
+
+ .amixer_rsc_get_ctrl_blk = amixer_rsc_get_ctrl_blk,
+ .amixer_rsc_put_ctrl_blk = amixer_rsc_put_ctrl_blk,
+ .amixer_mgr_get_ctrl_blk = amixer_mgr_get_ctrl_blk,
+ .amixer_mgr_put_ctrl_blk = amixer_mgr_put_ctrl_blk,
+ .amixer_set_mode = amixer_set_mode,
+ .amixer_set_iv = amixer_set_iv,
+ .amixer_set_x = amixer_set_x,
+ .amixer_set_y = amixer_set_y,
+ .amixer_set_sadr = amixer_set_sadr,
+ .amixer_set_se = amixer_set_se,
+ .amixer_set_dirty = amixer_set_dirty,
+ .amixer_set_dirty_all = amixer_set_dirty_all,
+ .amixer_commit_write = amixer_commit_write,
+ .amixer_get_y = amixer_get_y,
+ .amixer_get_dirty = amixer_get_dirty,
+
+ .dai_get_ctrl_blk = dai_get_ctrl_blk,
+ .dai_put_ctrl_blk = dai_put_ctrl_blk,
+ .dai_srt_set_srco = dai_srt_set_srco,
+ .dai_srt_set_srcm = dai_srt_set_srcm,
+ .dai_srt_set_rsr = dai_srt_set_rsr,
+ .dai_srt_set_drat = dai_srt_set_drat,
+ .dai_srt_set_ec = dai_srt_set_ec,
+ .dai_srt_set_et = dai_srt_set_et,
+ .dai_commit_write = dai_commit_write,
+
+ .dao_get_ctrl_blk = dao_get_ctrl_blk,
+ .dao_put_ctrl_blk = dao_put_ctrl_blk,
+ .dao_set_spos = dao_set_spos,
+ .dao_commit_write = dao_commit_write,
+ .dao_get_spos = dao_get_spos,
+
+ .daio_mgr_get_ctrl_blk = daio_mgr_get_ctrl_blk,
+ .daio_mgr_put_ctrl_blk = daio_mgr_put_ctrl_blk,
+ .daio_mgr_enb_dai = daio_mgr_enb_dai,
+ .daio_mgr_dsb_dai = daio_mgr_dsb_dai,
+ .daio_mgr_enb_dao = daio_mgr_enb_dao,
+ .daio_mgr_dsb_dao = daio_mgr_dsb_dao,
+ .daio_mgr_dao_init = daio_mgr_dao_init,
+ .daio_mgr_set_imaparc = daio_mgr_set_imaparc,
+ .daio_mgr_set_imapnxt = daio_mgr_set_imapnxt,
+ .daio_mgr_set_imapaddr = daio_mgr_set_imapaddr,
+ .daio_mgr_commit_write = daio_mgr_commit_write,
+};
+
+int __devinit create_20k2_hw_obj(struct hw **rhw)
{
struct hw *hw;
@@ -2015,102 +2111,7 @@ int create_20k2_hw_obj(struct hw **rhw)
if (NULL == hw)
return -ENOMEM;
- hw->io_base = 0;
- hw->mem_base = (unsigned long)NULL;
- hw->irq = -1;
-
- hw->card_init = hw_card_init;
- hw->card_stop = hw_card_stop;
- hw->pll_init = hw_pll_init;
- hw->is_adc_source_selected = hw_is_adc_input_selected;
- hw->select_adc_source = hw_adc_input_select;
- hw->have_digit_io_switch = hw_have_digit_io_switch;
-
- hw->src_rsc_get_ctrl_blk = src_get_rsc_ctrl_blk;
- hw->src_rsc_put_ctrl_blk = src_put_rsc_ctrl_blk;
- hw->src_mgr_get_ctrl_blk = src_mgr_get_ctrl_blk;
- hw->src_mgr_put_ctrl_blk = src_mgr_put_ctrl_blk;
- hw->src_set_state = src_set_state;
- hw->src_set_bm = src_set_bm;
- hw->src_set_rsr = src_set_rsr;
- hw->src_set_sf = src_set_sf;
- hw->src_set_wr = src_set_wr;
- hw->src_set_pm = src_set_pm;
- hw->src_set_rom = src_set_rom;
- hw->src_set_vo = src_set_vo;
- hw->src_set_st = src_set_st;
- hw->src_set_ie = src_set_ie;
- hw->src_set_ilsz = src_set_ilsz;
- hw->src_set_bp = src_set_bp;
- hw->src_set_cisz = src_set_cisz;
- hw->src_set_ca = src_set_ca;
- hw->src_set_sa = src_set_sa;
- hw->src_set_la = src_set_la;
- hw->src_set_pitch = src_set_pitch;
- hw->src_set_dirty = src_set_dirty;
- hw->src_set_clear_zbufs = src_set_clear_zbufs;
- hw->src_set_dirty_all = src_set_dirty_all;
- hw->src_commit_write = src_commit_write;
- hw->src_get_ca = src_get_ca;
- hw->src_get_dirty = src_get_dirty;
- hw->src_dirty_conj_mask = src_dirty_conj_mask;
- hw->src_mgr_enbs_src = src_mgr_enbs_src;
- hw->src_mgr_enb_src = src_mgr_enb_src;
- hw->src_mgr_dsb_src = src_mgr_dsb_src;
- hw->src_mgr_commit_write = src_mgr_commit_write;
-
- hw->srcimp_mgr_get_ctrl_blk = srcimp_mgr_get_ctrl_blk;
- hw->srcimp_mgr_put_ctrl_blk = srcimp_mgr_put_ctrl_blk;
- hw->srcimp_mgr_set_imaparc = srcimp_mgr_set_imaparc;
- hw->srcimp_mgr_set_imapuser = srcimp_mgr_set_imapuser;
- hw->srcimp_mgr_set_imapnxt = srcimp_mgr_set_imapnxt;
- hw->srcimp_mgr_set_imapaddr = srcimp_mgr_set_imapaddr;
- hw->srcimp_mgr_commit_write = srcimp_mgr_commit_write;
-
- hw->amixer_rsc_get_ctrl_blk = amixer_rsc_get_ctrl_blk;
- hw->amixer_rsc_put_ctrl_blk = amixer_rsc_put_ctrl_blk;
- hw->amixer_mgr_get_ctrl_blk = amixer_mgr_get_ctrl_blk;
- hw->amixer_mgr_put_ctrl_blk = amixer_mgr_put_ctrl_blk;
- hw->amixer_set_mode = amixer_set_mode;
- hw->amixer_set_iv = amixer_set_iv;
- hw->amixer_set_x = amixer_set_x;
- hw->amixer_set_y = amixer_set_y;
- hw->amixer_set_sadr = amixer_set_sadr;
- hw->amixer_set_se = amixer_set_se;
- hw->amixer_set_dirty = amixer_set_dirty;
- hw->amixer_set_dirty_all = amixer_set_dirty_all;
- hw->amixer_commit_write = amixer_commit_write;
- hw->amixer_get_y = amixer_get_y;
- hw->amixer_get_dirty = amixer_get_dirty;
-
- hw->dai_get_ctrl_blk = dai_get_ctrl_blk;
- hw->dai_put_ctrl_blk = dai_put_ctrl_blk;
- hw->dai_srt_set_srco = dai_srt_set_srco;
- hw->dai_srt_set_srcm = dai_srt_set_srcm;
- hw->dai_srt_set_rsr = dai_srt_set_rsr;
- hw->dai_srt_set_drat = dai_srt_set_drat;
- hw->dai_srt_set_ec = dai_srt_set_ec;
- hw->dai_srt_set_et = dai_srt_set_et;
- hw->dai_commit_write = dai_commit_write;
-
- hw->dao_get_ctrl_blk = dao_get_ctrl_blk;
- hw->dao_put_ctrl_blk = dao_put_ctrl_blk;
- hw->dao_set_spos = dao_set_spos;
- hw->dao_commit_write = dao_commit_write;
- hw->dao_get_spos = dao_get_spos;
-
- hw->daio_mgr_get_ctrl_blk = daio_mgr_get_ctrl_blk;
- hw->daio_mgr_put_ctrl_blk = daio_mgr_put_ctrl_blk;
- hw->daio_mgr_enb_dai = daio_mgr_enb_dai;
- hw->daio_mgr_dsb_dai = daio_mgr_dsb_dai;
- hw->daio_mgr_enb_dao = daio_mgr_enb_dao;
- hw->daio_mgr_dsb_dao = daio_mgr_dsb_dao;
- hw->daio_mgr_dao_init = daio_mgr_dao_init;
- hw->daio_mgr_set_imaparc = daio_mgr_set_imaparc;
- hw->daio_mgr_set_imapnxt = daio_mgr_set_imapnxt;
- hw->daio_mgr_set_imapaddr = daio_mgr_set_imapaddr;
- hw->daio_mgr_commit_write = daio_mgr_commit_write;
-
+ *hw = ct20k2_preset;
*rhw = hw;
return 0;
diff --git a/sound/pci/ctxfi/xfi.c b/sound/pci/ctxfi/xfi.c
index bf232e7299ac..279dac6c34dd 100644
--- a/sound/pci/ctxfi/xfi.c
+++ b/sound/pci/ctxfi/xfi.c
@@ -86,7 +86,7 @@ ct_card_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
card->private_data = atc;
/* Create alsa devices supported by this card */
- err = atc->create_alsa_devs(atc);
+ err = ct_atc_create_alsa_devs(atc);
if (err < 0)
goto error;