Lines Matching refs:mb

51 	struct micro_battery *mb = container_of(work,  in micro_battery_work()  local
61 ipaq_micro_tx_msg_sync(mb->micro, &msg_battery); in micro_battery_work()
75 mb->ac = msg_battery.rx_data[0]; in micro_battery_work()
76 mb->chemistry = msg_battery.rx_data[1]; in micro_battery_work()
77 mb->voltage = ((((unsigned short)msg_battery.rx_data[3] << 8) + in micro_battery_work()
79 mb->flag = msg_battery.rx_data[4]; in micro_battery_work()
85 ipaq_micro_tx_msg_sync(mb->micro, &msg_sensor); in micro_battery_work()
86 mb->temperature = msg_sensor.rx_data[1] << 8 | msg_sensor.rx_data[0]; in micro_battery_work()
88 queue_delayed_work(mb->wq, &mb->update, msecs_to_jiffies(BATT_PERIOD)); in micro_battery_work()
93 struct micro_battery *mb = dev_get_drvdata(b->dev.parent); in get_capacity() local
95 switch (mb->flag & 0x07) { in get_capacity()
113 struct micro_battery *mb = dev_get_drvdata(b->dev.parent); in get_status() local
115 if (mb->flag == MICRO_BATT_STATUS_UNKNOWN) in get_status()
118 if (mb->flag & MICRO_BATT_STATUS_FULL) in get_status()
121 if ((mb->flag & MICRO_BATT_STATUS_CHARGING) || in get_status()
122 (mb->flag & MICRO_BATT_STATUS_CHARGEMAIN)) in get_status()
132 struct micro_battery *mb = dev_get_drvdata(b->dev.parent); in micro_batt_get_property() local
136 switch (mb->chemistry) { in micro_batt_get_property()
164 val->intval = mb->temperature; in micro_batt_get_property()
167 val->intval = mb->voltage; in micro_batt_get_property()
180 struct micro_battery *mb = dev_get_drvdata(b->dev.parent); in micro_ac_get_property() local
184 val->intval = mb->ac; in micro_ac_get_property()
227 struct micro_battery *mb; in micro_batt_probe() local
230 mb = devm_kzalloc(&pdev->dev, sizeof(*mb), GFP_KERNEL); in micro_batt_probe()
231 if (!mb) in micro_batt_probe()
234 mb->micro = dev_get_drvdata(pdev->dev.parent); in micro_batt_probe()
235 mb->wq = alloc_workqueue("ipaq-battery-wq", WQ_MEM_RECLAIM, 0); in micro_batt_probe()
236 if (!mb->wq) in micro_batt_probe()
239 INIT_DELAYED_WORK(&mb->update, micro_battery_work); in micro_batt_probe()
240 platform_set_drvdata(pdev, mb); in micro_batt_probe()
241 queue_delayed_work(mb->wq, &mb->update, 1); in micro_batt_probe()
263 cancel_delayed_work_sync(&mb->update); in micro_batt_probe()
264 destroy_workqueue(mb->wq); in micro_batt_probe()
271 struct micro_battery *mb = platform_get_drvdata(pdev); in micro_batt_remove() local
275 cancel_delayed_work_sync(&mb->update); in micro_batt_remove()
276 destroy_workqueue(mb->wq); in micro_batt_remove()
283 struct micro_battery *mb = dev_get_drvdata(dev); in micro_batt_suspend() local
285 cancel_delayed_work_sync(&mb->update); in micro_batt_suspend()
291 struct micro_battery *mb = dev_get_drvdata(dev); in micro_batt_resume() local
293 queue_delayed_work(mb->wq, &mb->update, msecs_to_jiffies(BATT_PERIOD)); in micro_batt_resume()