Lines Matching refs:ec_dev
127 struct cros_ec_device *ec_dev; member
138 struct cros_ec_device *ec_dev = client_data->ec_dev; in ish_evt_handler() local
140 if (cros_ec_get_next_event(ec_dev, NULL) > 0) { in ish_evt_handler()
141 blocking_notifier_call_chain(&ec_dev->event_notifier, in ish_evt_handler()
142 0, ec_dev); in ish_evt_handler()
414 static int prepare_cros_ec_rx(struct cros_ec_device *ec_dev, in prepare_cros_ec_rx() argument
423 rv = cros_ec_check_result(ec_dev, msg); in prepare_cros_ec_rx()
428 dev_err(ec_dev->dev, "Packet too long (%d bytes, expected %d)", in prepare_cros_ec_rx()
442 dev_dbg(ec_dev->dev, "Bad received packet checksum %d\n", sum); in prepare_cros_ec_rx()
449 static int cros_ec_pkt_xfer_ish(struct cros_ec_device *ec_dev, in cros_ec_pkt_xfer_ish() argument
453 struct ishtp_cl *cros_ish_cl = ec_dev->priv; in cros_ec_pkt_xfer_ish()
456 struct cros_ish_in_msg *in_msg = (struct cros_ish_in_msg *)ec_dev->din; in cros_ec_pkt_xfer_ish()
458 (struct cros_ish_out_msg *)ec_dev->dout; in cros_ec_pkt_xfer_ish()
463 if (in_size > ec_dev->din_size) { in cros_ec_pkt_xfer_ish()
466 in_size, ec_dev->din_size); in cros_ec_pkt_xfer_ish()
470 if (out_size > ec_dev->dout_size) { in cros_ec_pkt_xfer_ish()
473 out_size, ec_dev->dout_size); in cros_ec_pkt_xfer_ish()
488 ec_dev->dout += OUT_MSG_EC_REQUEST_PREAMBLE; in cros_ec_pkt_xfer_ish()
489 cros_ec_prepare_tx(ec_dev, msg); in cros_ec_pkt_xfer_ish()
490 ec_dev->dout -= OUT_MSG_EC_REQUEST_PREAMBLE; in cros_ec_pkt_xfer_ish()
507 rv = prepare_cros_ec_rx(ec_dev, in_msg, msg); in cros_ec_pkt_xfer_ish()
531 struct cros_ec_device *ec_dev; in cros_ec_dev_init() local
534 ec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL); in cros_ec_dev_init()
535 if (!ec_dev) in cros_ec_dev_init()
538 client_data->ec_dev = ec_dev; in cros_ec_dev_init()
539 dev->driver_data = ec_dev; in cros_ec_dev_init()
541 ec_dev->dev = dev; in cros_ec_dev_init()
542 ec_dev->priv = client_data->cros_ish_cl; in cros_ec_dev_init()
543 ec_dev->cmd_xfer = NULL; in cros_ec_dev_init()
544 ec_dev->pkt_xfer = cros_ec_pkt_xfer_ish; in cros_ec_dev_init()
545 ec_dev->phys_name = dev_name(dev); in cros_ec_dev_init()
546 ec_dev->din_size = sizeof(struct cros_ish_in_msg) + in cros_ec_dev_init()
548 ec_dev->dout_size = sizeof(struct cros_ish_out_msg); in cros_ec_dev_init()
550 return cros_ec_register(ec_dev); in cros_ec_dev_init()
592 client_data->ec_dev->priv = client_data->cros_ish_cl; in reset_handler()
594 dev->driver_data = client_data->ec_dev; in reset_handler()
713 return cros_ec_suspend(client_data->ec_dev); in cros_ec_ishtp_suspend()
728 return cros_ec_resume(client_data->ec_dev); in cros_ec_ishtp_resume()