Lines Matching defs:mfi
50 static int apple_mfi_fc_set_charge_type(struct mfi_device *mfi,
57 if (mfi->charge_type == val->intval) {
58 dev_dbg(&mfi->udev->dev, "charge type %d already set\n",
59 mfi->charge_type);
75 retval = usb_control_msg(mfi->udev, usb_sndctrlpipe(mfi->udev, 0),
82 dev_dbg(&mfi->udev->dev, "retval = %d\n", retval);
86 mfi->charge_type = val->intval;
95 struct mfi_device *mfi = power_supply_get_drvdata(psy);
97 dev_dbg(&mfi->udev->dev, "prop: %d\n", psp);
101 val->intval = mfi->charge_type;
117 struct mfi_device *mfi = power_supply_get_drvdata(psy);
120 dev_dbg(&mfi->udev->dev, "prop: %d\n", psp);
122 ret = pm_runtime_get_sync(&mfi->udev->dev);
124 pm_runtime_put_noidle(&mfi->udev->dev);
130 ret = apple_mfi_fc_set_charge_type(mfi, val);
136 pm_runtime_mark_last_busy(&mfi->udev->dev);
137 pm_runtime_put_autosuspend(&mfi->udev->dev);
180 struct mfi_device *mfi = NULL;
186 mfi = kzalloc(sizeof(struct mfi_device), GFP_KERNEL);
187 if (!mfi) {
192 battery_cfg.drv_data = mfi;
194 mfi->charge_type = POWER_SUPPLY_CHARGE_TYPE_TRICKLE;
195 mfi->battery = power_supply_register(&udev->dev,
198 if (IS_ERR(mfi->battery)) {
200 err = PTR_ERR(mfi->battery);
204 mfi->udev = usb_get_dev(udev);
205 dev_set_drvdata(&udev->dev, mfi);
210 kfree(mfi);
216 struct mfi_device *mfi;
218 mfi = dev_get_drvdata(&udev->dev);
219 if (mfi->battery)
220 power_supply_unregister(mfi->battery);
222 usb_put_dev(mfi->udev);
223 kfree(mfi);
227 .name = "apple-mfi-fastcharge",