73 static void audiohd_init_path(audiohd_state_t *);
74 static void audiohd_del_controls(audiohd_state_t *);
75 static void audiohd_destroy(audiohd_state_t *);
76 static void audiohd_beep_on(void *);
77 static void audiohd_beep_off(void *);
78 static void audiohd_beep_freq(void *, int);
79 static wid_t audiohd_find_beep(hda_codec_t *, wid_t, int);
80 static void audiohd_build_beep_path(hda_codec_t *);
81 static void audiohd_build_beep_amp(hda_codec_t *);
82 static void audiohd_finish_beep_path(hda_codec_t *);
83 static void audiohd_do_set_beep_volume(audiohd_state_t *,
84 audiohd_path_t *, uint64_t);
85 static void audiohd_set_beep_volume(audiohd_state_t *);
86 static int audiohd_set_beep(void *, uint64_t);
87 static void audiohd_pin_sense(audiohd_state_t *, uint32_t, uint32_t);
88
89 static int audiohd_beep;
90 static int audiohd_beep_divider;
91 static int audiohd_beep_vol = 1;
92
93 /* Warlock annotation */
94 _NOTE(SCHEME_PROTECTS_DATA("unshared data", audiohd_beep))
95 _NOTE(SCHEME_PROTECTS_DATA("unshared data", audiohd_beep_divider))
96 _NOTE(SCHEME_PROTECTS_DATA("unshared data", audiohd_beep_vol))
97
98 static ddi_device_acc_attr_t hda_dev_accattr = {
99 DDI_DEVICE_ATTR_V0,
100 DDI_STRUCTURE_LE_ACC,
101 DDI_STRICTORDER_ACC
102 };
103
104 static const char *audiohd_dtypes[] = {
105 AUDIO_PORT_LINEOUT,
106 AUDIO_PORT_SPEAKER,
107 AUDIO_PORT_HEADPHONES,
108 AUDIO_PORT_CD,
109 AUDIO_PORT_SPDIFOUT,
110 AUDIO_PORT_DIGOUT,
111 AUDIO_PORT_MODEM,
112 AUDIO_PORT_HANDSET,
113 AUDIO_PORT_LINEIN,
114 AUDIO_PORT_AUX1IN,
115 AUDIO_PORT_MIC,
116 AUDIO_PORT_PHONE,
117 AUDIO_PORT_SPDIFIN,
|
73 static void audiohd_init_path(audiohd_state_t *);
74 static void audiohd_del_controls(audiohd_state_t *);
75 static void audiohd_destroy(audiohd_state_t *);
76 static void audiohd_beep_on(void *);
77 static void audiohd_beep_off(void *);
78 static void audiohd_beep_freq(void *, int);
79 static wid_t audiohd_find_beep(hda_codec_t *, wid_t, int);
80 static void audiohd_build_beep_path(hda_codec_t *);
81 static void audiohd_build_beep_amp(hda_codec_t *);
82 static void audiohd_finish_beep_path(hda_codec_t *);
83 static void audiohd_do_set_beep_volume(audiohd_state_t *,
84 audiohd_path_t *, uint64_t);
85 static void audiohd_set_beep_volume(audiohd_state_t *);
86 static int audiohd_set_beep(void *, uint64_t);
87 static void audiohd_pin_sense(audiohd_state_t *, uint32_t, uint32_t);
88
89 static int audiohd_beep;
90 static int audiohd_beep_divider;
91 static int audiohd_beep_vol = 1;
92
93 static ddi_device_acc_attr_t hda_dev_accattr = {
94 DDI_DEVICE_ATTR_V0,
95 DDI_STRUCTURE_LE_ACC,
96 DDI_STRICTORDER_ACC
97 };
98
99 static const char *audiohd_dtypes[] = {
100 AUDIO_PORT_LINEOUT,
101 AUDIO_PORT_SPEAKER,
102 AUDIO_PORT_HEADPHONES,
103 AUDIO_PORT_CD,
104 AUDIO_PORT_SPDIFOUT,
105 AUDIO_PORT_DIGOUT,
106 AUDIO_PORT_MODEM,
107 AUDIO_PORT_HANDSET,
108 AUDIO_PORT_LINEIN,
109 AUDIO_PORT_AUX1IN,
110 AUDIO_PORT_MIC,
111 AUDIO_PORT_PHONE,
112 AUDIO_PORT_SPDIFIN,
|