Lines Matching refs:ec
68 struct olpc_ec_priv *ec = container_of(w, struct olpc_ec_priv, worker); in olpc_ec_worker() local
73 spin_lock_irqsave(&ec->cmd_q_lock, flags); in olpc_ec_worker()
74 if (!list_empty(&ec->cmd_q)) { in olpc_ec_worker()
75 desc = list_first_entry(&ec->cmd_q, struct ec_cmd_desc, node); in olpc_ec_worker()
78 spin_unlock_irqrestore(&ec->cmd_q_lock, flags); in olpc_ec_worker()
85 mutex_lock(&ec->cmd_lock); in olpc_ec_worker()
88 mutex_unlock(&ec->cmd_lock); in olpc_ec_worker()
94 schedule_work(&ec->worker); in olpc_ec_worker()
102 struct olpc_ec_priv *ec) in queue_ec_descriptor() argument
108 spin_lock_irqsave(&ec->cmd_q_lock, flags); in queue_ec_descriptor()
109 list_add_tail(&desc->node, &ec->cmd_q); in queue_ec_descriptor()
110 spin_unlock_irqrestore(&ec->cmd_q_lock, flags); in queue_ec_descriptor()
112 schedule_work(&ec->worker); in queue_ec_descriptor()
117 struct olpc_ec_priv *ec = ec_priv; in olpc_ec_cmd() local
124 if (!ec) in olpc_ec_cmd()
128 if (WARN_ON(ec->suspended)) in olpc_ec_cmd()
141 queue_ec_descriptor(&desc, ec); in olpc_ec_cmd()
258 struct olpc_ec_priv *ec; in olpc_ec_probe() local
264 ec = kzalloc(sizeof(*ec), GFP_KERNEL); in olpc_ec_probe()
265 if (!ec) in olpc_ec_probe()
268 ec->drv = ec_driver; in olpc_ec_probe()
269 INIT_WORK(&ec->worker, olpc_ec_worker); in olpc_ec_probe()
270 mutex_init(&ec->cmd_lock); in olpc_ec_probe()
272 INIT_LIST_HEAD(&ec->cmd_q); in olpc_ec_probe()
273 spin_lock_init(&ec->cmd_q_lock); in olpc_ec_probe()
275 ec_priv = ec; in olpc_ec_probe()
276 platform_set_drvdata(pdev, ec); in olpc_ec_probe()
281 kfree(ec); in olpc_ec_probe()
283 ec->dbgfs_dir = olpc_ec_setup_debugfs(); in olpc_ec_probe()
292 struct olpc_ec_priv *ec = platform_get_drvdata(pdev); in olpc_ec_suspend() local
298 ec->suspended = true; in olpc_ec_suspend()
306 struct olpc_ec_priv *ec = platform_get_drvdata(pdev); in olpc_ec_resume() local
308 ec->suspended = false; in olpc_ec_resume()