On Thu, 2013-08-01 at 21:08 +0800, Nishanth Menon wrote:On 04:08-20130801, Bill Huang wrote:On Wed, 2013-07-31 at 19:57 +0800, Nishanth Menon wrote:we dont have a irq cleanup, irq handling is done in palmas-mfd. Further,Why do we need to add Palmas USB_IRQ unmask logic in shutdown? Does that
If you notice the reference code I send, atleast on TWL6035/37 variants
of Palmas, USB IRQ unmask is mandatory for power on with USB cable -
example usage scenario: extremely low battery, device powered off, plug
in usb cable to restart charging - you'd like to initiate charging logic
in bootloader, but that wont work if the device does not do OFF-ON
transition with usb cable plugged in for vbus.
mean for all platform using Palmas has to unmask USB IRQ (including
those do not power vbus through Palmas)? Can't we just have a simple
shutdown function but have the VBus programming been done in USB driver
or maybe platform driver since it is platform specific control?
Why would USB driver care about vbus supply needs in complete power off
- it is the job of palmas driver? Further, palmas-mfd shutdown
handler(currently missing) if probably cleansup things:
mfd_remove_devices(palmas->dev);
palmas_irq_exit(palmas);
shutdown sequence becomes complicated further esp if things are
cleanedup in shutdown (Dummy patch[1]).
All I am saying is this: shutdown should allow powerup functionality to
work as well, how we do that is upto us - I personally found it a little
easier to keep the IRQ unmask in shutdown easier to deal with, but other
options might be possible as well.
I'm not sure if I understand your comments completely (maybe due to I'm
not familiar with the mechanism of unmasking USB IRQ in Palmas driver)
but doing cleanup in each driver shutdown handler makes sense to me, if
those clean up can be done in shutdown then we can make power off
function as simple as possible and being part of Palmas mfd driver?