Lines Matching refs:cdata
158 mshw0011_notify(struct mshw0011_data *cdata, u8 arg1, u8 arg2, in mshw0011_notify() argument
165 handle = ACPI_HANDLE(&cdata->adp1->dev); in mshw0011_notify()
172 dev_err(&cdata->adp1->dev, "device _DSM execution failed\n"); in mshw0011_notify()
207 static int mshw0011_bix(struct mshw0011_data *cdata, struct bix *bix) in mshw0011_bix() argument
209 struct i2c_client *client = cdata->bat0; in mshw0011_bix()
271 static int mshw0011_bst(struct mshw0011_data *cdata, struct bst *bst) in mshw0011_bst() argument
273 struct i2c_client *client = cdata->bat0; in mshw0011_bst()
305 static int mshw0011_adp_psr(struct mshw0011_data *cdata) in mshw0011_adp_psr() argument
307 return i2c_smbus_read_byte_data(cdata->adp1, MSHW0011_ADP1_REG_PSR); in mshw0011_adp_psr()
310 static int mshw0011_isr(struct mshw0011_data *cdata) in mshw0011_isr() argument
317 ret = mshw0011_adp_psr(cdata); in mshw0011_isr()
322 if (status != cdata->charging) in mshw0011_isr()
323 mshw0011_notify(cdata, cdata->notify_mask, in mshw0011_isr()
326 cdata->charging = status; in mshw0011_isr()
328 ret = mshw0011_bst(cdata, &bst); in mshw0011_isr()
333 if (bat_status != cdata->bat_charging) in mshw0011_isr()
334 mshw0011_notify(cdata, cdata->notify_mask, in mshw0011_isr()
337 cdata->bat_charging = bat_status; in mshw0011_isr()
339 ret = mshw0011_bix(cdata, &bix); in mshw0011_isr()
343 if (bix.last_full_charg_capacity != cdata->full_capacity) in mshw0011_isr()
344 mshw0011_notify(cdata, cdata->notify_mask, in mshw0011_isr()
347 cdata->full_capacity = bix.last_full_charg_capacity; in mshw0011_isr()
354 struct mshw0011_data *cdata = data; in mshw0011_poll_task() local
357 cdata->kthread_running = true; in mshw0011_poll_task()
369 cdata->kthread_running = false; in mshw0011_poll_task()
383 struct mshw0011_data *cdata = i2c_get_clientdata(client); in mshw0011_space_handler() local
405 status = mshw0011_adp_psr(cdata); in mshw0011_space_handler()
424 ret = mshw0011_bix(cdata, &gsb->bix); in mshw0011_space_handler()
427 cdata->trip_point = gsb->cmd.arg2; in mshw0011_space_handler()
430 ret = mshw0011_bst(cdata, &gsb->bst); in mshw0011_space_handler()
433 dev_info(&cdata->bat0->dev, "command(0x%02x) is not supported.\n", gsb->cmd.arg1); in mshw0011_space_handler()
559 struct mshw0011_data *cdata = i2c_get_clientdata(client); in mshw0011_remove() local
563 if (cdata->kthread_running) in mshw0011_remove()
564 kthread_stop(cdata->poll_task); in mshw0011_remove()
566 i2c_unregister_device(cdata->bat0); in mshw0011_remove()