Changes in uspace/drv/audio/hdaudio/codec.c [b7fd2a0:dd8ab1c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/codec.c
rb7fd2a0 rdd8ab1c 46 46 #include "stream.h" 47 47 48 static errno_t hda_ccmd(hda_codec_t *codec, int node, uint32_t vid, uint32_t payload,48 static int hda_ccmd(hda_codec_t *codec, int node, uint32_t vid, uint32_t payload, 49 49 uint32_t *resp) 50 50 { … … 66 66 (payload & 0xffff); 67 67 } 68 errno_t rc = hda_cmd(codec->hda, verb, resp);68 int rc = hda_cmd(codec->hda, verb, resp); 69 69 /* 70 70 if (resp != NULL) { … … 78 78 } 79 79 80 static errno_t hda_get_parameter(hda_codec_t *codec, int node, hda_param_id_t param,80 static int hda_get_parameter(hda_codec_t *codec, int node, hda_param_id_t param, 81 81 uint32_t *resp) 82 82 { … … 84 84 } 85 85 86 static errno_t hda_get_subnc(hda_codec_t *codec, int node, int *startnode,86 static int hda_get_subnc(hda_codec_t *codec, int node, int *startnode, 87 87 int *nodecount) 88 88 { 89 errno_t rc;89 int rc; 90 90 uint32_t resp; 91 91 … … 103 103 104 104 /** Get Function Group Type */ 105 static errno_t hda_get_fgrp_type(hda_codec_t *codec, int node, bool *unsol,105 static int hda_get_fgrp_type(hda_codec_t *codec, int node, bool *unsol, 106 106 hda_fgrp_type_t *type) 107 107 { 108 errno_t rc;108 int rc; 109 109 uint32_t resp; 110 110 … … 119 119 } 120 120 121 static errno_t hda_get_clist_len(hda_codec_t *codec, int node, bool *longform,121 static int hda_get_clist_len(hda_codec_t *codec, int node, bool *longform, 122 122 int *items) 123 123 { 124 errno_t rc;124 int rc; 125 125 uint32_t resp; 126 126 … … 135 135 } 136 136 137 static errno_t hda_get_clist_entry(hda_codec_t *codec, int node, int n, uint32_t *resp)137 static int hda_get_clist_entry(hda_codec_t *codec, int node, int n, uint32_t *resp) 138 138 { 139 139 return hda_ccmd(codec, node, hda_clist_entry_get, n, resp); 140 140 } 141 141 142 static errno_t hda_get_eapd_btl_enable(hda_codec_t *codec, int node, uint32_t *resp)142 static int hda_get_eapd_btl_enable(hda_codec_t *codec, int node, uint32_t *resp) 143 143 { 144 144 return hda_ccmd(codec, node, hda_eapd_btl_enable_get, 0, resp); 145 145 } 146 146 147 static errno_t hda_set_eapd_btl_enable(hda_codec_t *codec, int node, uint8_t payload)147 static int hda_set_eapd_btl_enable(hda_codec_t *codec, int node, uint8_t payload) 148 148 { 149 149 return hda_ccmd(codec, node, hda_eapd_btl_enable_set, payload, NULL); … … 151 151 152 152 /** Get Suppported PCM Size, Rates */ 153 static errno_t hda_get_supp_rates(hda_codec_t *codec, int node, uint32_t *rates)153 static int hda_get_supp_rates(hda_codec_t *codec, int node, uint32_t *rates) 154 154 { 155 155 return hda_get_parameter(codec, node, hda_supp_rates, rates); … … 157 157 158 158 /** Get Suppported Stream Formats */ 159 static errno_t hda_get_supp_formats(hda_codec_t *codec, int node, uint32_t *fmts)159 static int hda_get_supp_formats(hda_codec_t *codec, int node, uint32_t *fmts) 160 160 { 161 161 return hda_get_parameter(codec, node, hda_supp_formats, fmts); 162 162 } 163 163 164 static errno_t hda_set_converter_fmt(hda_codec_t *codec, int node, uint16_t fmt)164 static int hda_set_converter_fmt(hda_codec_t *codec, int node, uint16_t fmt) 165 165 { 166 166 return hda_ccmd(codec, node, hda_converter_fmt_set, fmt, NULL); 167 167 } 168 168 169 static errno_t hda_set_converter_ctl(hda_codec_t *codec, int node, uint8_t stream,169 static int hda_set_converter_ctl(hda_codec_t *codec, int node, uint8_t stream, 170 170 uint8_t channel) 171 171 { … … 176 176 } 177 177 178 static errno_t hda_set_pin_ctl(hda_codec_t *codec, int node, uint8_t pctl)178 static int hda_set_pin_ctl(hda_codec_t *codec, int node, uint8_t pctl) 179 179 { 180 180 return hda_ccmd(codec, node, hda_pin_ctl_set, pctl, NULL); 181 181 } 182 182 183 static errno_t hda_get_pin_ctl(hda_codec_t *codec, int node, uint8_t *pctl)184 { 185 errno_t rc;183 static int hda_get_pin_ctl(hda_codec_t *codec, int node, uint8_t *pctl) 184 { 185 int rc; 186 186 uint32_t resp; 187 187 … … 195 195 196 196 /** Get Audio Widget Capabilities */ 197 static errno_t hda_get_aw_caps(hda_codec_t *codec, int node,197 static int hda_get_aw_caps(hda_codec_t *codec, int node, 198 198 hda_awidget_type_t *type, uint32_t *caps) 199 199 { 200 errno_t rc;200 int rc; 201 201 uint32_t resp; 202 202 … … 212 212 213 213 /** Get Pin Capabilities */ 214 static errno_t hda_get_pin_caps(hda_codec_t *codec, int node, uint32_t *caps)214 static int hda_get_pin_caps(hda_codec_t *codec, int node, uint32_t *caps) 215 215 { 216 216 return hda_get_parameter(codec, node, hda_pin_caps, caps); … … 218 218 219 219 /** Get Power State */ 220 static errno_t hda_get_power_state(hda_codec_t *codec, int node, uint32_t *pstate)220 static int hda_get_power_state(hda_codec_t *codec, int node, uint32_t *pstate) 221 221 { 222 222 return hda_ccmd(codec, node, hda_power_state_get, 0, pstate); … … 224 224 225 225 /** Get Configuration Default */ 226 static errno_t hda_get_cfg_def(hda_codec_t *codec, int node, uint32_t *cfgdef)226 static int hda_get_cfg_def(hda_codec_t *codec, int node, uint32_t *cfgdef) 227 227 { 228 228 return hda_ccmd(codec, node, hda_cfg_def_get, 0, cfgdef); 229 229 } 230 230 231 static errno_t hda_get_conn_sel(hda_codec_t *codec, int node, uint32_t *conn)231 static int hda_get_conn_sel(hda_codec_t *codec, int node, uint32_t *conn) 232 232 { 233 233 return hda_ccmd(codec, node, hda_conn_sel_get, 0, conn); … … 235 235 236 236 /** Get Amplifier Gain / Mute */ 237 static errno_t hda_get_amp_gain_mute(hda_codec_t *codec, int node, uint16_t payload,237 static int hda_get_amp_gain_mute(hda_codec_t *codec, int node, uint16_t payload, 238 238 uint32_t *resp) 239 239 { 240 240 // ddf_msg(LVL_NOTE, "hda_get_amp_gain_mute(codec, %d, %x)", 241 241 // node, payload); 242 errno_t rc = hda_ccmd(codec, node, hda_amp_gain_mute_get, payload, resp);242 int rc = hda_ccmd(codec, node, hda_amp_gain_mute_get, payload, resp); 243 243 // ddf_msg(LVL_NOTE, "hda_get_amp_gain_mute(codec, %d, %x, resp=%x)", 244 244 // node, payload, *resp); … … 247 247 248 248 /** Get GP I/O Count */ 249 static errno_t hda_get_gpio_cnt(hda_codec_t *codec, int node, uint32_t *resp)249 static int hda_get_gpio_cnt(hda_codec_t *codec, int node, uint32_t *resp) 250 250 { 251 251 return hda_get_parameter(codec, node, hda_gpio_cnt, resp); 252 252 } 253 253 254 static errno_t hda_set_amp_gain_mute(hda_codec_t *codec, int node, uint16_t payload)254 static int hda_set_amp_gain_mute(hda_codec_t *codec, int node, uint16_t payload) 255 255 { 256 256 // ddf_msg(LVL_NOTE, "hda_set_amp_gain_mute(codec, %d, %x)", … … 259 259 } 260 260 261 static errno_t hda_set_out_amp_max(hda_codec_t *codec, uint8_t aw)261 static int hda_set_out_amp_max(hda_codec_t *codec, uint8_t aw) 262 262 { 263 263 uint32_t ampcaps; 264 264 uint32_t gmleft, gmright; 265 265 uint32_t offset; 266 errno_t rc;266 int rc; 267 267 268 268 rc = hda_get_parameter(codec, aw, … … 294 294 } 295 295 296 static errno_t hda_set_in_amp_max(hda_codec_t *codec, uint8_t aw)296 static int hda_set_in_amp_max(hda_codec_t *codec, uint8_t aw) 297 297 { 298 298 uint32_t ampcaps; … … 300 300 uint32_t offset; 301 301 int i; 302 errno_t rc;302 int rc; 303 303 304 304 rc = hda_get_parameter(codec, aw, … … 332 332 } 333 333 334 static errno_t hda_clist_dump(hda_codec_t *codec, uint8_t aw)335 { 336 errno_t rc;334 static int hda_clist_dump(hda_codec_t *codec, uint8_t aw) 335 { 336 int rc; 337 337 bool longform; 338 338 int len; … … 394 394 } 395 395 396 static errno_t hda_pin_init(hda_codec_t *codec, uint8_t aw)397 { 398 errno_t rc;396 static int hda_pin_init(hda_codec_t *codec, uint8_t aw) 397 { 398 int rc; 399 399 uint32_t cfgdef; 400 400 uint32_t pcaps; … … 471 471 472 472 /** Init power-control in wiget capable of doing so. */ 473 static errno_t hda_power_ctl_init(hda_codec_t *codec, uint8_t aw)474 { 475 errno_t rc;473 static int hda_power_ctl_init(hda_codec_t *codec, uint8_t aw) 474 { 475 int rc; 476 476 uint32_t pwrstate; 477 477 … … 491 491 { 492 492 hda_codec_t *codec; 493 errno_t rc;493 int rc; 494 494 int sfg, nfg; 495 495 int saw, naw; … … 639 639 } 640 640 641 errno_t hda_out_converter_setup(hda_codec_t *codec, hda_stream_t *stream)642 { 643 errno_t rc;641 int hda_out_converter_setup(hda_codec_t *codec, hda_stream_t *stream) 642 { 643 int rc; 644 644 int out_aw; 645 645 int i; … … 666 666 } 667 667 668 errno_t hda_in_converter_setup(hda_codec_t *codec, hda_stream_t *stream)669 { 670 errno_t rc;668 int hda_in_converter_setup(hda_codec_t *codec, hda_stream_t *stream) 669 { 670 int rc; 671 671 672 672 /* Configure converter */
Note:
See TracChangeset
for help on using the changeset viewer.