Lines Matching refs:cros_ec_cec
33 struct cros_ec_cec { struct
41 static void handle_cec_message(struct cros_ec_cec *cros_ec_cec) in handle_cec_message() argument
43 struct cros_ec_device *cros_ec = cros_ec_cec->cros_ec; in handle_cec_message()
47 cros_ec_cec->rx_msg.len = len; in handle_cec_message()
48 memcpy(cros_ec_cec->rx_msg.msg, cec_message, len); in handle_cec_message()
50 cec_received_msg(cros_ec_cec->adap, &cros_ec_cec->rx_msg); in handle_cec_message()
53 static void handle_cec_event(struct cros_ec_cec *cros_ec_cec) in handle_cec_event() argument
55 struct cros_ec_device *cros_ec = cros_ec_cec->cros_ec; in handle_cec_event()
59 cec_transmit_attempt_done(cros_ec_cec->adap, in handle_cec_event()
64 cec_transmit_attempt_done(cros_ec_cec->adap, in handle_cec_event()
73 struct cros_ec_cec *cros_ec_cec; in cros_ec_cec_event() local
76 cros_ec_cec = container_of(nb, struct cros_ec_cec, notifier); in cros_ec_cec_event()
77 cros_ec = cros_ec_cec->cros_ec; in cros_ec_cec_event()
80 handle_cec_event(cros_ec_cec); in cros_ec_cec_event()
85 handle_cec_message(cros_ec_cec); in cros_ec_cec_event()
94 struct cros_ec_cec *cros_ec_cec = adap->priv; in cros_ec_cec_set_log_addr() local
95 struct cros_ec_device *cros_ec = cros_ec_cec->cros_ec; in cros_ec_cec_set_log_addr()
120 struct cros_ec_cec *cros_ec_cec = adap->priv; in cros_ec_cec_transmit() local
121 struct cros_ec_device *cros_ec = cros_ec_cec->cros_ec; in cros_ec_cec_transmit()
144 struct cros_ec_cec *cros_ec_cec = adap->priv; in cros_ec_cec_adap_enable() local
145 struct cros_ec_device *cros_ec = cros_ec_cec->cros_ec; in cros_ec_cec_adap_enable()
178 struct cros_ec_cec *cros_ec_cec = dev_get_drvdata(&pdev->dev); in cros_ec_cec_suspend() local
181 enable_irq_wake(cros_ec_cec->cros_ec->irq); in cros_ec_cec_suspend()
189 struct cros_ec_cec *cros_ec_cec = dev_get_drvdata(&pdev->dev); in cros_ec_cec_resume() local
192 disable_irq_wake(cros_ec_cec->cros_ec->irq); in cros_ec_cec_resume()
263 struct cros_ec_cec *cros_ec_cec; in cros_ec_cec_probe() local
266 cros_ec_cec = devm_kzalloc(&pdev->dev, sizeof(*cros_ec_cec), in cros_ec_cec_probe()
268 if (!cros_ec_cec) in cros_ec_cec_probe()
271 platform_set_drvdata(pdev, cros_ec_cec); in cros_ec_cec_probe()
272 cros_ec_cec->cros_ec = cros_ec; in cros_ec_cec_probe()
274 ret = cros_ec_cec_get_notifier(&pdev->dev, &cros_ec_cec->notify); in cros_ec_cec_probe()
284 cros_ec_cec->adap = cec_allocate_adapter(&cros_ec_cec_ops, cros_ec_cec, in cros_ec_cec_probe()
286 if (IS_ERR(cros_ec_cec->adap)) in cros_ec_cec_probe()
287 return PTR_ERR(cros_ec_cec->adap); in cros_ec_cec_probe()
290 cros_ec_cec->notifier.notifier_call = cros_ec_cec_event; in cros_ec_cec_probe()
292 &cros_ec_cec->notifier); in cros_ec_cec_probe()
295 cec_delete_adapter(cros_ec_cec->adap); in cros_ec_cec_probe()
299 ret = cec_register_adapter(cros_ec_cec->adap, &pdev->dev); in cros_ec_cec_probe()
301 cec_delete_adapter(cros_ec_cec->adap); in cros_ec_cec_probe()
305 cec_register_cec_notifier(cros_ec_cec->adap, cros_ec_cec->notify); in cros_ec_cec_probe()
312 struct cros_ec_cec *cros_ec_cec = platform_get_drvdata(pdev); in cros_ec_cec_remove() local
317 &cros_ec_cec->cros_ec->event_notifier, in cros_ec_cec_remove()
318 &cros_ec_cec->notifier); in cros_ec_cec_remove()
325 cec_unregister_adapter(cros_ec_cec->adap); in cros_ec_cec_remove()
327 if (cros_ec_cec->notify) in cros_ec_cec_remove()
328 cec_notifier_put(cros_ec_cec->notify); in cros_ec_cec_remove()