forked from luck/tmp_suning_uos_patched
power supply and reset changes for the v4.13 series (part 2)
* two fixes for twl4030-charger -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAllmp2IACgkQ2O7X88g7 +pqgXRAAg9kBJUYoTmLOg67L8HpnUuiPuy4Mp0oceQQYbDSRTaaQKN7d4m3+6k3H SV0Z84CH3GfgZDaSCAxPT84/gsiFsBSxKvvQ/X9DxitdULj5KehS9IYok0p+83RU BL6St1gZcJiM2GAip81+IMn9MVGyvr6hxY0sme6nsvXRg8BT7aSk8eC/2pESuoo/ MGpgPCJrYPtPNPDYTGrD1rgW+0zWxkBITOvjvRAXm3fvdN42yFf4FfhK5XvjjQwA /wO3TgGOVa+ibUMoPnnlqIvZq7SqyeiPsE+/Et4/7/EKpVmuNelZtouKS2T+gy+J lxLIMxlB+AIY2gQDVczHrewIQG342hVCwQWAJkp9ifC/a76iAK7mmdLPXZqEs9AT qvaaL+sUxmYgPslXj+L6h78NRjRordYA5z0d6CLBzKDln4BNsGq3EvAEYKlhIL+r V5lJu+wPv75Y8HEsfcrLmLztojxjjjdqiSjO828ZR1Y+qEK0qJMEoSfGPdIFKzd5 0it1eqceye4VOBQ/1au+aPkTdO48/4nfAlPwxtY7UzKtLfulLhUJbWxbFXVrvLWs vSZ9Tp8W6QdulGSseBu6BtT2ogmHbNEjl2e0CWpScj6hZwCvTXZdrnELJ/HpNu/f j5Ul6BhCM5EJMux9ahP67YH9CyGi60x1P9vItkFp75kjU3tOU6Y= =shuZ -----END PGP SIGNATURE----- Merge tag 'for-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply fixes from Reichel: "I have two more fixes for the power-supply subsystem: - two fixes for twl4030-charger" * tag 'for-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: power: supply: twl4030-charger: add deferred probing for phy and iio power: supply: twl4030-charger: move irq allocation to just before irqs are enabled
This commit is contained in:
commit
dc087d1ef1
|
@ -980,10 +980,37 @@ static int twl4030_bci_probe(struct platform_device *pdev)
|
|||
|
||||
platform_set_drvdata(pdev, bci);
|
||||
|
||||
INIT_WORK(&bci->work, twl4030_bci_usb_work);
|
||||
INIT_DELAYED_WORK(&bci->current_worker, twl4030_current_worker);
|
||||
|
||||
bci->channel_vac = devm_iio_channel_get(&pdev->dev, "vac");
|
||||
if (IS_ERR(bci->channel_vac)) {
|
||||
ret = PTR_ERR(bci->channel_vac);
|
||||
if (ret == -EPROBE_DEFER)
|
||||
return ret; /* iio not ready */
|
||||
dev_warn(&pdev->dev, "could not request vac iio channel (%d)",
|
||||
ret);
|
||||
bci->channel_vac = NULL;
|
||||
dev_warn(&pdev->dev, "could not request vac iio channel");
|
||||
}
|
||||
|
||||
if (bci->dev->of_node) {
|
||||
struct device_node *phynode;
|
||||
|
||||
phynode = of_find_compatible_node(bci->dev->of_node->parent,
|
||||
NULL, "ti,twl4030-usb");
|
||||
if (phynode) {
|
||||
bci->usb_nb.notifier_call = twl4030_bci_usb_ncb;
|
||||
bci->transceiver = devm_usb_get_phy_by_node(
|
||||
bci->dev, phynode, &bci->usb_nb);
|
||||
if (IS_ERR(bci->transceiver)) {
|
||||
ret = PTR_ERR(bci->transceiver);
|
||||
if (ret == -EPROBE_DEFER)
|
||||
return ret; /* phy not ready */
|
||||
dev_warn(&pdev->dev, "could not request transceiver (%d)",
|
||||
ret);
|
||||
bci->transceiver = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bci->ac = devm_power_supply_register(&pdev->dev, &twl4030_bci_ac_desc,
|
||||
|
@ -1019,20 +1046,6 @@ static int twl4030_bci_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
INIT_WORK(&bci->work, twl4030_bci_usb_work);
|
||||
INIT_DELAYED_WORK(&bci->current_worker, twl4030_current_worker);
|
||||
|
||||
bci->usb_nb.notifier_call = twl4030_bci_usb_ncb;
|
||||
if (bci->dev->of_node) {
|
||||
struct device_node *phynode;
|
||||
|
||||
phynode = of_find_compatible_node(bci->dev->of_node->parent,
|
||||
NULL, "ti,twl4030-usb");
|
||||
if (phynode)
|
||||
bci->transceiver = devm_usb_get_phy_by_node(
|
||||
bci->dev, phynode, &bci->usb_nb);
|
||||
}
|
||||
|
||||
/* Enable interrupts now. */
|
||||
reg = ~(u32)(TWL4030_ICHGLOW | TWL4030_ICHGEOC | TWL4030_TBATOR2 |
|
||||
TWL4030_TBATOR1 | TWL4030_BATSTS);
|
||||
|
|
Loading…
Reference in New Issue
Block a user