diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-06-05 10:34:10 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-06-05 10:44:24 -0400 |
commit | 2a36f67f8c81f0babda0e811c760b7bfa971010b (patch) | |
tree | ef95d02a3b468132f83f0a63077b4f33d3cff2a7 /sound/pci/ctxfi/cthw20k1.c | |
parent | 775ffa1d3e5a550dd2c9d947d773021c61531b36 (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/cthw20k1.c')
-rw-r--r-- | sound/pci/ctxfi/cthw20k1.c | 205 |
1 files changed, 102 insertions, 103 deletions
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) | |||
2138 | &container_of(hw, struct hw20k1, hw)->reg_pci_lock, flags); | 2138 | &container_of(hw, struct hw20k1, hw)->reg_pci_lock, flags); |
2139 | } | 2139 | } |
2140 | 2140 | ||
2141 | int create_20k1_hw_obj(struct hw **rhw) | 2141 | static struct hw ct20k1_preset __devinitdata = { |
2142 | .irq = -1, | ||
2143 | |||
2144 | .card_init = hw_card_init, | ||
2145 | .card_stop = hw_card_stop, | ||
2146 | .pll_init = hw_pll_init, | ||
2147 | .is_adc_source_selected = hw_is_adc_input_selected, | ||
2148 | .select_adc_source = hw_adc_input_select, | ||
2149 | .have_digit_io_switch = hw_have_digit_io_switch, | ||
2150 | |||
2151 | .src_rsc_get_ctrl_blk = src_get_rsc_ctrl_blk, | ||
2152 | .src_rsc_put_ctrl_blk = src_put_rsc_ctrl_blk, | ||
2153 | .src_mgr_get_ctrl_blk = src_mgr_get_ctrl_blk, | ||
2154 | .src_mgr_put_ctrl_blk = src_mgr_put_ctrl_blk, | ||
2155 | .src_set_state = src_set_state, | ||
2156 | .src_set_bm = src_set_bm, | ||
2157 | .src_set_rsr = src_set_rsr, | ||
2158 | .src_set_sf = src_set_sf, | ||
2159 | .src_set_wr = src_set_wr, | ||
2160 | .src_set_pm = src_set_pm, | ||
2161 | .src_set_rom = src_set_rom, | ||
2162 | .src_set_vo = src_set_vo, | ||
2163 | .src_set_st = src_set_st, | ||
2164 | .src_set_ie = src_set_ie, | ||
2165 | .src_set_ilsz = src_set_ilsz, | ||
2166 | .src_set_bp = src_set_bp, | ||
2167 | .src_set_cisz = src_set_cisz, | ||
2168 | .src_set_ca = src_set_ca, | ||
2169 | .src_set_sa = src_set_sa, | ||
2170 | .src_set_la = src_set_la, | ||
2171 | .src_set_pitch = src_set_pitch, | ||
2172 | .src_set_dirty = src_set_dirty, | ||
2173 | .src_set_clear_zbufs = src_set_clear_zbufs, | ||
2174 | .src_set_dirty_all = src_set_dirty_all, | ||
2175 | .src_commit_write = src_commit_write, | ||
2176 | .src_get_ca = src_get_ca, | ||
2177 | .src_get_dirty = src_get_dirty, | ||
2178 | .src_dirty_conj_mask = src_dirty_conj_mask, | ||
2179 | .src_mgr_enbs_src = src_mgr_enbs_src, | ||
2180 | .src_mgr_enb_src = src_mgr_enb_src, | ||
2181 | .src_mgr_dsb_src = src_mgr_dsb_src, | ||
2182 | .src_mgr_commit_write = src_mgr_commit_write, | ||
2183 | |||
2184 | .srcimp_mgr_get_ctrl_blk = srcimp_mgr_get_ctrl_blk, | ||
2185 | .srcimp_mgr_put_ctrl_blk = srcimp_mgr_put_ctrl_blk, | ||
2186 | .srcimp_mgr_set_imaparc = srcimp_mgr_set_imaparc, | ||
2187 | .srcimp_mgr_set_imapuser = srcimp_mgr_set_imapuser, | ||
2188 | .srcimp_mgr_set_imapnxt = srcimp_mgr_set_imapnxt, | ||
2189 | .srcimp_mgr_set_imapaddr = srcimp_mgr_set_imapaddr, | ||
2190 | .srcimp_mgr_commit_write = srcimp_mgr_commit_write, | ||
2191 | |||
2192 | .amixer_rsc_get_ctrl_blk = amixer_rsc_get_ctrl_blk, | ||
2193 | .amixer_rsc_put_ctrl_blk = amixer_rsc_put_ctrl_blk, | ||
2194 | .amixer_mgr_get_ctrl_blk = amixer_mgr_get_ctrl_blk, | ||
2195 | .amixer_mgr_put_ctrl_blk = amixer_mgr_put_ctrl_blk, | ||
2196 | .amixer_set_mode = amixer_set_mode, | ||
2197 | .amixer_set_iv = amixer_set_iv, | ||
2198 | .amixer_set_x = amixer_set_x, | ||
2199 | .amixer_set_y = amixer_set_y, | ||
2200 | .amixer_set_sadr = amixer_set_sadr, | ||
2201 | .amixer_set_se = amixer_set_se, | ||
2202 | .amixer_set_dirty = amixer_set_dirty, | ||
2203 | .amixer_set_dirty_all = amixer_set_dirty_all, | ||
2204 | .amixer_commit_write = amixer_commit_write, | ||
2205 | .amixer_get_y = amixer_get_y, | ||
2206 | .amixer_get_dirty = amixer_get_dirty, | ||
2207 | |||
2208 | .dai_get_ctrl_blk = dai_get_ctrl_blk, | ||
2209 | .dai_put_ctrl_blk = dai_put_ctrl_blk, | ||
2210 | .dai_srt_set_srco = dai_srt_set_srcr, | ||
2211 | .dai_srt_set_srcm = dai_srt_set_srcl, | ||
2212 | .dai_srt_set_rsr = dai_srt_set_rsr, | ||
2213 | .dai_srt_set_drat = dai_srt_set_drat, | ||
2214 | .dai_srt_set_ec = dai_srt_set_ec, | ||
2215 | .dai_srt_set_et = dai_srt_set_et, | ||
2216 | .dai_commit_write = dai_commit_write, | ||
2217 | |||
2218 | .dao_get_ctrl_blk = dao_get_ctrl_blk, | ||
2219 | .dao_put_ctrl_blk = dao_put_ctrl_blk, | ||
2220 | .dao_set_spos = dao_set_spos, | ||
2221 | .dao_commit_write = dao_commit_write, | ||
2222 | .dao_get_spos = dao_get_spos, | ||
2223 | |||
2224 | .daio_mgr_get_ctrl_blk = daio_mgr_get_ctrl_blk, | ||
2225 | .daio_mgr_put_ctrl_blk = daio_mgr_put_ctrl_blk, | ||
2226 | .daio_mgr_enb_dai = daio_mgr_enb_dai, | ||
2227 | .daio_mgr_dsb_dai = daio_mgr_dsb_dai, | ||
2228 | .daio_mgr_enb_dao = daio_mgr_enb_dao, | ||
2229 | .daio_mgr_dsb_dao = daio_mgr_dsb_dao, | ||
2230 | .daio_mgr_dao_init = daio_mgr_dao_init, | ||
2231 | .daio_mgr_set_imaparc = daio_mgr_set_imaparc, | ||
2232 | .daio_mgr_set_imapnxt = daio_mgr_set_imapnxt, | ||
2233 | .daio_mgr_set_imapaddr = daio_mgr_set_imapaddr, | ||
2234 | .daio_mgr_commit_write = daio_mgr_commit_write, | ||
2235 | |||
2236 | .set_timer_irq = set_timer_irq, | ||
2237 | .set_timer_tick = set_timer_tick, | ||
2238 | }; | ||
2239 | |||
2240 | int __devinit create_20k1_hw_obj(struct hw **rhw) | ||
2142 | { | 2241 | { |
2143 | struct hw *hw; | ||
2144 | struct hw20k1 *hw20k1; | 2242 | struct hw20k1 *hw20k1; |
2145 | 2243 | ||
2146 | *rhw = NULL; | 2244 | *rhw = NULL; |
@@ -2151,108 +2249,9 @@ int create_20k1_hw_obj(struct hw **rhw) | |||
2151 | spin_lock_init(&hw20k1->reg_20k1_lock); | 2249 | spin_lock_init(&hw20k1->reg_20k1_lock); |
2152 | spin_lock_init(&hw20k1->reg_pci_lock); | 2250 | spin_lock_init(&hw20k1->reg_pci_lock); |
2153 | 2251 | ||
2154 | hw = &hw20k1->hw; | 2252 | hw20k1->hw = ct20k1_preset; |
2155 | 2253 | ||
2156 | hw->io_base = 0; | 2254 | *rhw = &hw20k1->hw; |
2157 | hw->mem_base = (unsigned long)NULL; | ||
2158 | hw->irq = -1; | ||
2159 | |||
2160 | hw->card_init = hw_card_init; | ||
2161 | hw->card_stop = hw_card_stop; | ||
2162 | hw->pll_init = hw_pll_init; | ||
2163 | hw->is_adc_source_selected = hw_is_adc_input_selected; | ||
2164 | hw->select_adc_source = hw_adc_input_select; | ||
2165 | hw->have_digit_io_switch = hw_have_digit_io_switch; | ||
2166 | |||
2167 | hw->src_rsc_get_ctrl_blk = src_get_rsc_ctrl_blk; | ||
2168 | hw->src_rsc_put_ctrl_blk = src_put_rsc_ctrl_blk; | ||
2169 | hw->src_mgr_get_ctrl_blk = src_mgr_get_ctrl_blk; | ||
2170 | hw->src_mgr_put_ctrl_blk = src_mgr_put_ctrl_blk; | ||
2171 | hw->src_set_state = src_set_state; | ||
2172 | hw->src_set_bm = src_set_bm; | ||
2173 | hw->src_set_rsr = src_set_rsr; | ||
2174 | hw->src_set_sf = src_set_sf; | ||
2175 | hw->src_set_wr = src_set_wr; | ||
2176 | hw->src_set_pm = src_set_pm; | ||
2177 | hw->src_set_rom = src_set_rom; | ||
2178 | hw->src_set_vo = src_set_vo; | ||
2179 | hw->src_set_st = src_set_st; | ||
2180 | hw->src_set_ie = src_set_ie; | ||
2181 | hw->src_set_ilsz = src_set_ilsz; | ||
2182 | hw->src_set_bp = src_set_bp; | ||
2183 | hw->src_set_cisz = src_set_cisz; | ||
2184 | hw->src_set_ca = src_set_ca; | ||
2185 | hw->src_set_sa = src_set_sa; | ||
2186 | hw->src_set_la = src_set_la; | ||
2187 | hw->src_set_pitch = src_set_pitch; | ||
2188 | hw->src_set_dirty = src_set_dirty; | ||
2189 | hw->src_set_clear_zbufs = src_set_clear_zbufs; | ||
2190 | hw->src_set_dirty_all = src_set_dirty_all; | ||
2191 | hw->src_commit_write = src_commit_write; | ||
2192 | hw->src_get_ca = src_get_ca; | ||
2193 | hw->src_get_dirty = src_get_dirty; | ||
2194 | hw->src_dirty_conj_mask = src_dirty_conj_mask; | ||
2195 | hw->src_mgr_enbs_src = src_mgr_enbs_src; | ||
2196 | hw->src_mgr_enb_src = src_mgr_enb_src; | ||
2197 | hw->src_mgr_dsb_src = src_mgr_dsb_src; | ||
2198 | hw->src_mgr_commit_write = src_mgr_commit_write; | ||
2199 | |||
2200 | hw->srcimp_mgr_get_ctrl_blk = srcimp_mgr_get_ctrl_blk; | ||
2201 | hw->srcimp_mgr_put_ctrl_blk = srcimp_mgr_put_ctrl_blk; | ||
2202 | hw->srcimp_mgr_set_imaparc = srcimp_mgr_set_imaparc; | ||
2203 | hw->srcimp_mgr_set_imapuser = srcimp_mgr_set_imapuser; | ||
2204 | hw->srcimp_mgr_set_imapnxt = srcimp_mgr_set_imapnxt; | ||
2205 | hw->srcimp_mgr_set_imapaddr = srcimp_mgr_set_imapaddr; | ||
2206 | hw->srcimp_mgr_commit_write = srcimp_mgr_commit_write; | ||
2207 | |||
2208 | hw->amixer_rsc_get_ctrl_blk = amixer_rsc_get_ctrl_blk; | ||
2209 | hw->amixer_rsc_put_ctrl_blk = amixer_rsc_put_ctrl_blk; | ||
2210 | hw->amixer_mgr_get_ctrl_blk = amixer_mgr_get_ctrl_blk; | ||
2211 | hw->amixer_mgr_put_ctrl_blk = amixer_mgr_put_ctrl_blk; | ||
2212 | hw->amixer_set_mode = amixer_set_mode; | ||
2213 | hw->amixer_set_iv = amixer_set_iv; | ||
2214 | hw->amixer_set_x = amixer_set_x; | ||
2215 | hw->amixer_set_y = amixer_set_y; | ||
2216 | hw->amixer_set_sadr = amixer_set_sadr; | ||
2217 | hw->amixer_set_se = amixer_set_se; | ||
2218 | hw->amixer_set_dirty = amixer_set_dirty; | ||
2219 | hw->amixer_set_dirty_all = amixer_set_dirty_all; | ||
2220 | hw->amixer_commit_write = amixer_commit_write; | ||
2221 | hw->amixer_get_y = amixer_get_y; | ||
2222 | hw->amixer_get_dirty = amixer_get_dirty; | ||
2223 | |||
2224 | hw->dai_get_ctrl_blk = dai_get_ctrl_blk; | ||
2225 | hw->dai_put_ctrl_blk = dai_put_ctrl_blk; | ||
2226 | hw->dai_srt_set_srco = dai_srt_set_srcr; | ||
2227 | hw->dai_srt_set_srcm = dai_srt_set_srcl; | ||
2228 | hw->dai_srt_set_rsr = dai_srt_set_rsr; | ||
2229 | hw->dai_srt_set_drat = dai_srt_set_drat; | ||
2230 | hw->dai_srt_set_ec = dai_srt_set_ec; | ||
2231 | hw->dai_srt_set_et = dai_srt_set_et; | ||
2232 | hw->dai_commit_write = dai_commit_write; | ||
2233 | |||
2234 | hw->dao_get_ctrl_blk = dao_get_ctrl_blk; | ||
2235 | hw->dao_put_ctrl_blk = dao_put_ctrl_blk; | ||
2236 | hw->dao_set_spos = dao_set_spos; | ||
2237 | hw->dao_commit_write = dao_commit_write; | ||
2238 | hw->dao_get_spos = dao_get_spos; | ||
2239 | |||
2240 | hw->daio_mgr_get_ctrl_blk = daio_mgr_get_ctrl_blk; | ||
2241 | hw->daio_mgr_put_ctrl_blk = daio_mgr_put_ctrl_blk; | ||
2242 | hw->daio_mgr_enb_dai = daio_mgr_enb_dai; | ||
2243 | hw->daio_mgr_dsb_dai = daio_mgr_dsb_dai; | ||
2244 | hw->daio_mgr_enb_dao = daio_mgr_enb_dao; | ||
2245 | hw->daio_mgr_dsb_dao = daio_mgr_dsb_dao; | ||
2246 | hw->daio_mgr_dao_init = daio_mgr_dao_init; | ||
2247 | hw->daio_mgr_set_imaparc = daio_mgr_set_imaparc; | ||
2248 | hw->daio_mgr_set_imapnxt = daio_mgr_set_imapnxt; | ||
2249 | hw->daio_mgr_set_imapaddr = daio_mgr_set_imapaddr; | ||
2250 | hw->daio_mgr_commit_write = daio_mgr_commit_write; | ||
2251 | |||
2252 | hw->set_timer_irq = set_timer_irq; | ||
2253 | hw->set_timer_tick = set_timer_tick; | ||
2254 | |||
2255 | *rhw = hw; | ||
2256 | 2255 | ||
2257 | return 0; | 2256 | return 0; |
2258 | } | 2257 | } |