Lines Matching refs:ec
70 struct olpc_ec_priv *ec = container_of(w, struct olpc_ec_priv, worker); in olpc_ec_worker() local
75 spin_lock_irqsave(&ec->cmd_q_lock, flags); in olpc_ec_worker()
76 if (!list_empty(&ec->cmd_q)) { in olpc_ec_worker()
77 desc = list_first_entry(&ec->cmd_q, struct ec_cmd_desc, node); in olpc_ec_worker()
80 spin_unlock_irqrestore(&ec->cmd_q_lock, flags); in olpc_ec_worker()
87 mutex_lock(&ec->cmd_lock); in olpc_ec_worker()
90 mutex_unlock(&ec->cmd_lock); in olpc_ec_worker()
96 schedule_work(&ec->worker); in olpc_ec_worker()
104 struct olpc_ec_priv *ec) in queue_ec_descriptor() argument
110 spin_lock_irqsave(&ec->cmd_q_lock, flags); in queue_ec_descriptor()
111 list_add_tail(&desc->node, &ec->cmd_q); in queue_ec_descriptor()
112 spin_unlock_irqrestore(&ec->cmd_q_lock, flags); in queue_ec_descriptor()
114 schedule_work(&ec->worker); in queue_ec_descriptor()
119 struct olpc_ec_priv *ec = ec_priv; in olpc_ec_cmd() local
126 if (!ec) in olpc_ec_cmd()
130 if (WARN_ON(ec->suspended)) in olpc_ec_cmd()
143 queue_ec_descriptor(&desc, ec); in olpc_ec_cmd()
260 struct olpc_ec_priv *ec; in olpc_ec_probe() local
266 ec = kzalloc(sizeof(*ec), GFP_KERNEL); in olpc_ec_probe()
267 if (!ec) in olpc_ec_probe()
270 ec->drv = ec_driver; in olpc_ec_probe()
271 INIT_WORK(&ec->worker, olpc_ec_worker); in olpc_ec_probe()
272 mutex_init(&ec->cmd_lock); in olpc_ec_probe()
274 INIT_LIST_HEAD(&ec->cmd_q); in olpc_ec_probe()
275 spin_lock_init(&ec->cmd_q_lock); in olpc_ec_probe()
277 ec_priv = ec; in olpc_ec_probe()
278 platform_set_drvdata(pdev, ec); in olpc_ec_probe()
283 kfree(ec); in olpc_ec_probe()
285 ec->dbgfs_dir = olpc_ec_setup_debugfs(); in olpc_ec_probe()
294 struct olpc_ec_priv *ec = platform_get_drvdata(pdev); in olpc_ec_suspend() local
300 ec->suspended = true; in olpc_ec_suspend()
308 struct olpc_ec_priv *ec = platform_get_drvdata(pdev); in olpc_ec_resume() local
310 ec->suspended = false; in olpc_ec_resume()