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)
190 battery_cfg.drv_data = mfi;
192 mfi->charge_type = POWER_SUPPLY_CHARGE_TYPE_TRICKLE;
193 mfi->battery = power_supply_register(&udev->dev,
196 if (IS_ERR(mfi->battery)) {
198 err = PTR_ERR(mfi->battery);
199 kfree(mfi);
203 mfi->udev = usb_get_dev(udev);
204 dev_set_drvdata(&udev->dev, mfi);
211 struct mfi_device *mfi;
213 mfi = dev_get_drvdata(&udev->dev);
214 if (mfi->battery)
215 power_supply_unregister(mfi->battery);
217 usb_put_dev(mfi->udev);
218 kfree(mfi);
222 .name = "apple-mfi-fastcharge",