Lines Matching refs:ec

86 } ec;
163 mutex_enter(&ec.ec_mutex);
164 sc = inb(ec.ec_sc);
176 outb(ec.ec_sc, EC_RD); /* output a read command */
177 if (ec_wait_ibf_clear(ec.ec_sc) < 0) {
180 mutex_exit(&ec.ec_mutex);
184 outb(ec.ec_base, addr); /* output addr */
185 if (ec_wait_ibf_clear(ec.ec_sc) < 0) {
188 mutex_exit(&ec.ec_mutex);
191 if (ec_wait_obf_set(ec.ec_sc) < 0) {
194 mutex_exit(&ec.ec_mutex);
198 rv = inb(ec.ec_base);
199 mutex_exit(&ec.ec_mutex);
212 mutex_enter(&ec.ec_mutex);
213 sc = inb(ec.ec_sc);
225 outb(ec.ec_sc, EC_WR); /* output a write command */
226 if (ec_wait_ibf_clear(ec.ec_sc) < 0) {
229 mutex_exit(&ec.ec_mutex);
233 outb(ec.ec_base, addr); /* output addr */
234 if (ec_wait_ibf_clear(ec.ec_sc) < 0) {
237 mutex_exit(&ec.ec_mutex);
241 outb(ec.ec_base, val); /* write data */
242 if (ec_wait_ibf_clear(ec.ec_sc) < 0) {
245 mutex_exit(&ec.ec_mutex);
249 mutex_exit(&ec.ec_mutex);
262 mutex_enter(&ec.ec_mutex);
263 outb(ec.ec_sc, EC_QR); /* output a query command */
264 if (ec_wait_ibf_clear(ec.ec_sc) < 0) {
267 mutex_exit(&ec.ec_mutex);
271 if (ec_wait_obf_set(ec.ec_sc) < 0) {
274 mutex_exit(&ec.ec_mutex);
278 rv = inb(ec.ec_base);
279 mutex_exit(&ec.ec_mutex);
285 * Requires: ec.ec_sc, ec.ec_base
295 if (ec.ec_ok == 0)
355 if (!(inb(ec.ec_sc) & EC_SCI))
363 (void) AcpiEvaluateObject(ec.ec_dev_hdl, query_str, NULL, NULL);
366 AcpiFinishGpe(ec.ec_gpe_hdl, ec.ec_gpe_bit);
382 if (ec.ec_ok == 0)
437 ec.ec_base = ecdt->Data.Address;
438 ec.ec_sc = ecdt->Control.Address;
439 ec.ec_dev_hdl = dev_hdl;
440 ec.ec_gpe_hdl = NULL;
441 ec.ec_gpe_bit = ecdt->Gpe;
442 ec.ec_ok = 1;
576 ec.ec_base = ec_base;
577 ec.ec_sc = ec_sc;
578 ec.ec_dev_hdl = dev_hdl;
579 ec.ec_gpe_hdl = gpe_hdl;
580 ec.ec_gpe_bit = gpe_bit;
581 ec.ec_ok = 1;
600 if (ec.ec_ok == 0)
607 if (inb(ec.ec_sc) & EC_OBF) {
608 x = inb(ec.ec_base); /* read and discard value */
658 if (ec.ec_ok == 0) {
667 rc = AcpiInstallGpeHandler(ec.ec_gpe_hdl, ec.ec_gpe_bit,
675 rc = AcpiEnableGpe(ec.ec_gpe_hdl, ec.ec_gpe_bit);
688 AcpiRemoveGpeHandler(ec.ec_gpe_hdl, ec.ec_gpe_bit,
728 mutex_init(&ec.ec_mutex, NULL, MUTEX_DRIVER, NULL);