Lines Matching refs:ec

53 static bool wilco_ec_response_timed_out(struct wilco_ec_device *ec)  in wilco_ec_response_timed_out()  argument
58 if (!(inb(ec->io_command->start) & in wilco_ec_response_timed_out()
115 static int wilco_ec_transfer(struct wilco_ec_device *ec, in wilco_ec_transfer() argument
129 outb(EC_MAILBOX_START_COMMAND, ec->io_command->start); in wilco_ec_transfer()
133 dev_dbg(ec->dev, "EC does not respond to this command\n"); in wilco_ec_transfer()
138 if (wilco_ec_response_timed_out(ec)) { in wilco_ec_transfer()
139 dev_dbg(ec->dev, "response timed out\n"); in wilco_ec_transfer()
144 flag = inb(ec->io_data->start); in wilco_ec_transfer()
146 dev_dbg(ec->dev, "bad response: 0x%02x\n", flag); in wilco_ec_transfer()
151 rs = ec->data_buffer; in wilco_ec_transfer()
156 dev_dbg(ec->dev, "bad packet checksum 0x%02x\n", rs->checksum); in wilco_ec_transfer()
161 dev_dbg(ec->dev, "EC reported failure: 0x%02x\n", rs->result); in wilco_ec_transfer()
166 dev_dbg(ec->dev, "unexpected packet size (%u != %u)\n", in wilco_ec_transfer()
172 dev_dbg(ec->dev, "EC didn't return enough data (%u < %zu)\n", in wilco_ec_transfer()
196 int wilco_ec_mailbox(struct wilco_ec_device *ec, struct wilco_ec_message *msg) in wilco_ec_mailbox() argument
201 dev_dbg(ec->dev, "type=%04x flags=%02x rslen=%zu rqlen=%zu\n", in wilco_ec_mailbox()
204 mutex_lock(&ec->mailbox_lock); in wilco_ec_mailbox()
206 rq = ec->data_buffer; in wilco_ec_mailbox()
209 ret = wilco_ec_transfer(ec, msg, rq); in wilco_ec_mailbox()
210 mutex_unlock(&ec->mailbox_lock); in wilco_ec_mailbox()