aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi/cthw20k2.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-06-05 10:34:10 -0400
committerTakashi Iwai <tiwai@suse.de>2009-06-05 10:44:24 -0400
commit2a36f67f8c81f0babda0e811c760b7bfa971010b (patch)
treeef95d02a3b468132f83f0a63077b4f33d3cff2a7 /sound/pci/ctxfi/cthw20k2.c
parent775ffa1d3e5a550dd2c9d947d773021c61531b36 (diff)
ALSA: ctxfi - Clean up / optimize
- Use static tables instead of assigining each funciton pointer - Add __devinit* to appropriate places; pcm, mixer and timer cannot be marked because they are kept in the function table that lives long - Move create_alsa_devs function out of struct ct_atc to mark it __devinit Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ctxfi/cthw20k2.c')
-rw-r--r--sound/pci/ctxfi/cthw20k2.c195
1 files changed, 98 insertions, 97 deletions
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c
index 349728765f2..041199fbae1 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)
2006 writel(data, (void *)(hw->mem_base + reg)); 2006 writel(data, (void *)(hw->mem_base + reg));
2007} 2007}
2008 2008
2009int create_20k2_hw_obj(struct hw **rhw) 2009static struct hw ct20k2_preset __devinitdata = {
2010 .irq = -1,
2011
2012 .card_init = hw_card_init,
2013 .card_stop = hw_card_stop,
2014 .pll_init = hw_pll_init,
2015 .is_adc_source_selected = hw_is_adc_input_selected,
2016 .select_adc_source = hw_adc_input_select,
2017 .have_digit_io_switch = hw_have_digit_io_switch,
2018
2019 .src_rsc_get_ctrl_blk = src_get_rsc_ctrl_blk,
2020 .src_rsc_put_ctrl_blk = src_put_rsc_ctrl_blk,
2021 .src_mgr_get_ctrl_blk = src_mgr_get_ctrl_blk,
2022 .src_mgr_put_ctrl_blk = src_mgr_put_ctrl_blk,
2023 .src_set_state = src_set_state,
2024 .src_set_bm = src_set_bm,
2025 .src_set_rsr = src_set_rsr,
2026 .src_set_sf = src_set_sf,
2027 .src_set_wr = src_set_wr,
2028 .src_set_pm = src_set_pm,
2029 .src_set_rom = src_set_rom,
2030 .src_set_vo = src_set_vo,
2031 .src_set_st = src_set_st,
2032 .src_set_ie = src_set_ie,
2033 .src_set_ilsz = src_set_ilsz,
2034 .src_set_bp = src_set_bp,
2035 .src_set_cisz = src_set_cisz,
2036 .src_set_ca = src_set_ca,
2037 .src_set_sa = src_set_sa,
2038 .src_set_la = src_set_la,
2039 .src_set_pitch = src_set_pitch,
2040 .src_set_dirty = src_set_dirty,
2041 .src_set_clear_zbufs = src_set_clear_zbufs,
2042 .src_set_dirty_all = src_set_dirty_all,
2043 .src_commit_write = src_commit_write,
2044 .src_get_ca = src_get_ca,
2045 .src_get_dirty = src_get_dirty,
2046 .src_dirty_conj_mask = src_dirty_conj_mask,
2047 .src_mgr_enbs_src = src_mgr_enbs_src,
2048 .src_mgr_enb_src = src_mgr_enb_src,
2049 .src_mgr_dsb_src = src_mgr_dsb_src,
2050 .src_mgr_commit_write = src_mgr_commit_write,
2051
2052 .srcimp_mgr_get_ctrl_blk = srcimp_mgr_get_ctrl_blk,
2053 .srcimp_mgr_put_ctrl_blk = srcimp_mgr_put_ctrl_blk,
2054 .srcimp_mgr_set_imaparc = srcimp_mgr_set_imaparc,
2055 .srcimp_mgr_set_imapuser = srcimp_mgr_set_imapuser,
2056 .srcimp_mgr_set_imapnxt = srcimp_mgr_set_imapnxt,
2057 .srcimp_mgr_set_imapaddr = srcimp_mgr_set_imapaddr,
2058 .srcimp_mgr_commit_write = srcimp_mgr_commit_write,
2059
2060 .amixer_rsc_get_ctrl_blk = amixer_rsc_get_ctrl_blk,
2061 .amixer_rsc_put_ctrl_blk = amixer_rsc_put_ctrl_blk,
2062 .amixer_mgr_get_ctrl_blk = amixer_mgr_get_ctrl_blk,
2063 .amixer_mgr_put_ctrl_blk = amixer_mgr_put_ctrl_blk,
2064 .amixer_set_mode = amixer_set_mode,
2065 .amixer_set_iv = amixer_set_iv,
2066 .amixer_set_x = amixer_set_x,
2067 .amixer_set_y = amixer_set_y,
2068 .amixer_set_sadr = amixer_set_sadr,
2069 .amixer_set_se = amixer_set_se,
2070 .amixer_set_dirty = amixer_set_dirty,
2071 .amixer_set_dirty_all = amixer_set_dirty_all,
2072 .amixer_commit_write = amixer_commit_write,
2073 .amixer_get_y = amixer_get_y,
2074 .amixer_get_dirty = amixer_get_dirty,
2075
2076 .dai_get_ctrl_blk = dai_get_ctrl_blk,
2077 .dai_put_ctrl_blk = dai_put_ctrl_blk,
2078 .dai_srt_set_srco = dai_srt_set_srco,
2079 .dai_srt_set_srcm = dai_srt_set_srcm,
2080 .dai_srt_set_rsr = dai_srt_set_rsr,
2081 .dai_srt_set_drat = dai_srt_set_drat,
2082 .dai_srt_set_ec = dai_srt_set_ec,
2083 .dai_srt_set_et = dai_srt_set_et,
2084 .dai_commit_write = dai_commit_write,
2085
2086 .dao_get_ctrl_blk = dao_get_ctrl_blk,
2087 .dao_put_ctrl_blk = dao_put_ctrl_blk,
2088 .dao_set_spos = dao_set_spos,
2089 .dao_commit_write = dao_commit_write,
2090 .dao_get_spos = dao_get_spos,
2091
2092 .daio_mgr_get_ctrl_blk = daio_mgr_get_ctrl_blk,
2093 .daio_mgr_put_ctrl_blk = daio_mgr_put_ctrl_blk,
2094 .daio_mgr_enb_dai = daio_mgr_enb_dai,
2095 .daio_mgr_dsb_dai = daio_mgr_dsb_dai,
2096 .daio_mgr_enb_dao = daio_mgr_enb_dao,
2097 .daio_mgr_dsb_dao = daio_mgr_dsb_dao,
2098 .daio_mgr_dao_init = daio_mgr_dao_init,
2099 .daio_mgr_set_imaparc = daio_mgr_set_imaparc,
2100 .daio_mgr_set_imapnxt = daio_mgr_set_imapnxt,
2101 .daio_mgr_set_imapaddr = daio_mgr_set_imapaddr,
2102 .daio_mgr_commit_write = daio_mgr_commit_write,
2103};
2104
2105int __devinit create_20k2_hw_obj(struct hw **rhw)
2010{ 2106{
2011 struct hw *hw; 2107 struct hw *hw;
2012 2108
@@ -2015,102 +2111,7 @@ int create_20k2_hw_obj(struct hw **rhw)
2015 if (NULL == hw) 2111 if (NULL == hw)
2016 return -ENOMEM; 2112 return -ENOMEM;
2017 2113
2018 hw->io_base = 0; 2114 *hw = ct20k2_preset;
2019 hw->mem_base = (unsigned long)NULL;
2020 hw->irq = -1;
2021
2022 hw->card_init = hw_card_init;
2023 hw->card_stop = hw_card_stop;
2024 hw->pll_init = hw_pll_init;
2025 hw->is_adc_source_selected = hw_is_adc_input_selected;
2026 hw->select_adc_source = hw_adc_input_select;
2027 hw->have_digit_io_switch = hw_have_digit_io_switch;
2028
2029 hw->src_rsc_get_ctrl_blk = src_get_rsc_ctrl_blk;
2030 hw->src_rsc_put_ctrl_blk = src_put_rsc_ctrl_blk;
2031 hw->src_mgr_get_ctrl_blk = src_mgr_get_ctrl_blk;
2032 hw->src_mgr_put_ctrl_blk = src_mgr_put_ctrl_blk;
2033 hw->src_set_state = src_set_state;
2034 hw->src_set_bm = src_set_bm;
2035 hw->src_set_rsr = src_set_rsr;
2036 hw->src_set_sf = src_set_sf;
2037 hw->src_set_wr = src_set_wr;
2038 hw->src_set_pm = src_set_pm;
2039 hw->src_set_rom = src_set_rom;
2040 hw->src_set_vo = src_set_vo;
2041 hw->src_set_st = src_set_st;
2042 hw->src_set_ie = src_set_ie;
2043 hw->src_set_ilsz = src_set_ilsz;
2044 hw->src_set_bp = src_set_bp;
2045 hw->src_set_cisz = src_set_cisz;
2046 hw->src_set_ca = src_set_ca;
2047 hw->src_set_sa = src_set_sa;
2048 hw->src_set_la = src_set_la;
2049 hw->src_set_pitch = src_set_pitch;
2050 hw->src_set_dirty = src_set_dirty;
2051 hw->src_set_clear_zbufs = src_set_clear_zbufs;
2052 hw->src_set_dirty_all = src_set_dirty_all;
2053 hw->src_commit_write = src_commit_write;
2054 hw->src_get_ca = src_get_ca;
2055 hw->src_get_dirty = src_get_dirty;
2056 hw->src_dirty_conj_mask = src_dirty_conj_mask;
2057 hw->src_mgr_enbs_src = src_mgr_enbs_src;
2058 hw->src_mgr_enb_src = src_mgr_enb_src;
2059 hw->src_mgr_dsb_src = src_mgr_dsb_src;
2060 hw->src_mgr_commit_write = src_mgr_commit_write;
2061
2062 hw->srcimp_mgr_get_ctrl_blk = srcimp_mgr_get_ctrl_blk;
2063 hw->srcimp_mgr_put_ctrl_blk = srcimp_mgr_put_ctrl_blk;
2064 hw->srcimp_mgr_set_imaparc = srcimp_mgr_set_imaparc;
2065 hw->srcimp_mgr_set_imapuser = srcimp_mgr_set_imapuser;
2066 hw->srcimp_mgr_set_imapnxt = srcimp_mgr_set_imapnxt;
2067 hw->srcimp_mgr_set_imapaddr = srcimp_mgr_set_imapaddr;
2068 hw->srcimp_mgr_commit_write = srcimp_mgr_commit_write;
2069
2070 hw->amixer_rsc_get_ctrl_blk = amixer_rsc_get_ctrl_blk;
2071 hw->amixer_rsc_put_ctrl_blk = amixer_rsc_put_ctrl_blk;
2072 hw->amixer_mgr_get_ctrl_blk = amixer_mgr_get_ctrl_blk;
2073 hw->amixer_mgr_put_ctrl_blk = amixer_mgr_put_ctrl_blk;
2074 hw->amixer_set_mode = amixer_set_mode;
2075 hw->amixer_set_iv = amixer_set_iv;
2076 hw->amixer_set_x = amixer_set_x;
2077 hw->amixer_set_y = amixer_set_y;
2078 hw->amixer_set_sadr = amixer_set_sadr;
2079 hw->amixer_set_se = amixer_set_se;
2080 hw->amixer_set_dirty = amixer_set_dirty;
2081 hw->amixer_set_dirty_all = amixer_set_dirty_all;
2082 hw->amixer_commit_write = amixer_commit_write;
2083 hw->amixer_get_y = amixer_get_y;
2084 hw->amixer_get_dirty = amixer_get_dirty;
2085
2086 hw->dai_get_ctrl_blk = dai_get_ctrl_blk;
2087 hw->dai_put_ctrl_blk = dai_put_ctrl_blk;
2088 hw->dai_srt_set_srco = dai_srt_set_srco;
2089 hw->dai_srt_set_srcm = dai_srt_set_srcm;
2090 hw->dai_srt_set_rsr = dai_srt_set_rsr;
2091 hw->dai_srt_set_drat = dai_srt_set_drat;
2092 hw->dai_srt_set_ec = dai_srt_set_ec;
2093 hw->dai_srt_set_et = dai_srt_set_et;
2094 hw->dai_commit_write = dai_commit_write;
2095
2096 hw->dao_get_ctrl_blk = dao_get_ctrl_blk;
2097 hw->dao_put_ctrl_blk = dao_put_ctrl_blk;
2098 hw->dao_set_spos = dao_set_spos;
2099 hw->dao_commit_write = dao_commit_write;
2100 hw->dao_get_spos = dao_get_spos;
2101
2102 hw->daio_mgr_get_ctrl_blk = daio_mgr_get_ctrl_blk;
2103 hw->daio_mgr_put_ctrl_blk = daio_mgr_put_ctrl_blk;
2104 hw->daio_mgr_enb_dai = daio_mgr_enb_dai;
2105 hw->daio_mgr_dsb_dai = daio_mgr_dsb_dai;
2106 hw->daio_mgr_enb_dao = daio_mgr_enb_dao;
2107 hw->daio_mgr_dsb_dao = daio_mgr_dsb_dao;
2108 hw->daio_mgr_dao_init = daio_mgr_dao_init;
2109 hw->daio_mgr_set_imaparc = daio_mgr_set_imaparc;
2110 hw->daio_mgr_set_imapnxt = daio_mgr_set_imapnxt;
2111 hw->daio_mgr_set_imapaddr = daio_mgr_set_imapaddr;
2112 hw->daio_mgr_commit_write = daio_mgr_commit_write;
2113
2114 *rhw = hw; 2115 *rhw = hw;
2115 2116
2116 return 0; 2117 return 0;