Lines Matching refs:cdata
158 mshw0011_notify(struct mshw0011_data *cdata, u8 arg1, u8 arg2, in mshw0011_notify() argument
166 handle = ACPI_HANDLE(&cdata->adp1->dev); in mshw0011_notify()
173 dev_err(&cdata->adp1->dev, "device _DSM execution failed\n"); in mshw0011_notify()
208 static int mshw0011_bix(struct mshw0011_data *cdata, struct bix *bix) in mshw0011_bix() argument
210 struct i2c_client *client = cdata->bat0; in mshw0011_bix()
272 static int mshw0011_bst(struct mshw0011_data *cdata, struct bst *bst) in mshw0011_bst() argument
274 struct i2c_client *client = cdata->bat0; in mshw0011_bst()
306 static int mshw0011_adp_psr(struct mshw0011_data *cdata) in mshw0011_adp_psr() argument
308 return i2c_smbus_read_byte_data(cdata->adp1, MSHW0011_ADP1_REG_PSR); in mshw0011_adp_psr()
311 static int mshw0011_isr(struct mshw0011_data *cdata) in mshw0011_isr() argument
318 ret = mshw0011_adp_psr(cdata); in mshw0011_isr()
323 if (status != cdata->charging) in mshw0011_isr()
324 mshw0011_notify(cdata, cdata->notify_mask, in mshw0011_isr()
327 cdata->charging = status; in mshw0011_isr()
329 ret = mshw0011_bst(cdata, &bst); in mshw0011_isr()
334 if (bat_status != cdata->bat_charging) in mshw0011_isr()
335 mshw0011_notify(cdata, cdata->notify_mask, in mshw0011_isr()
338 cdata->bat_charging = bat_status; in mshw0011_isr()
340 ret = mshw0011_bix(cdata, &bix); in mshw0011_isr()
344 if (bix.last_full_charg_capacity != cdata->full_capacity) in mshw0011_isr()
345 mshw0011_notify(cdata, cdata->notify_mask, in mshw0011_isr()
348 cdata->full_capacity = bix.last_full_charg_capacity; in mshw0011_isr()
355 struct mshw0011_data *cdata = data; in mshw0011_poll_task() local
358 cdata->kthread_running = true; in mshw0011_poll_task()
370 cdata->kthread_running = false; in mshw0011_poll_task()
384 struct mshw0011_data *cdata = i2c_get_clientdata(client); in mshw0011_space_handler() local
412 status = mshw0011_adp_psr(cdata); in mshw0011_space_handler()
431 ret = mshw0011_bix(cdata, &gsb->bix); in mshw0011_space_handler()
434 cdata->trip_point = gsb->cmd.arg2; in mshw0011_space_handler()
437 ret = mshw0011_bst(cdata, &gsb->bst); in mshw0011_space_handler()
440 dev_info(&cdata->bat0->dev, "command(0x%02x) is not supported.\n", gsb->cmd.arg1); in mshw0011_space_handler()
566 struct mshw0011_data *cdata = i2c_get_clientdata(client); in mshw0011_remove() local
570 if (cdata->kthread_running) in mshw0011_remove()
571 kthread_stop(cdata->poll_task); in mshw0011_remove()
573 i2c_unregister_device(cdata->bat0); in mshw0011_remove()