diff options
| author | Nicholas Troast <ntroast@codeaurora.org> | 2016-06-16 12:28:39 -0700 |
|---|---|---|
| committer | Nicholas Troast <ntroast@codeaurora.org> | 2016-07-13 15:37:15 -0700 |
| commit | e4ef9471ff8ce70199f20d2616b14fe0599508db (patch) | |
| tree | 0b6200bbc4741748f4ba6813f68e9435eeda5029 | |
| parent | 400520a6e2f06cc7c45e386e769a85d4aded565b (diff) | |
qcom-charger: qpnp-smb2: enable some irqs as a wakeup source
Parallel charging requires the device to wake up when entering taper
charging state in order to reduce the parallel charger's FCC. Enable
the chg-state-change irq as a wakeup source.
Parallel charging requires the device to wake up when the USB ICL
changes in order to enable or disable. Enable the usbin-icl-change
irq as a wakeup source.
When a change is detected on the Type-C CC pins the device should wake
up to handle the change. Enable the type-c-change irq as a wakeup
source.
When VBUS is detected the device should wake up to adjust the state of
DP/DM to allow for proper APSD. Enable the usbin-plugin irq as a wakeup
source.
When APSD finishes the device should wake up to notify the USB, and PD
drivers. Enable the usbin-src-change irq as a wakeup source.
CRs-Fixed: 1030478
Change-Id: I7cdc08d973b5ea711c877f7f2eabbe0fdbbf6fa0
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
| -rw-r--r-- | drivers/power/qcom-charger/qpnp-smb2.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/power/qcom-charger/qpnp-smb2.c b/drivers/power/qcom-charger/qpnp-smb2.c index 3c934cb0b1f9..542009a03e96 100644 --- a/drivers/power/qcom-charger/qpnp-smb2.c +++ b/drivers/power/qcom-charger/qpnp-smb2.c @@ -605,14 +605,16 @@ static int smb2_determine_initial_status(struct smb2 *chip) **************************/ struct smb2_irq_info { - const char *name; - const irq_handler_t handler; + const char *name; + const irq_handler_t handler; + const bool wake; + int irq; }; -static const struct smb2_irq_info smb2_irqs[] = { +static struct smb2_irq_info smb2_irqs[] = { /* CHARGER IRQs */ { "chg-error", smblib_handle_debug }, - { "chg-state-change", smblib_handle_chg_state_change }, + { "chg-state-change", smblib_handle_chg_state_change, true }, { "step-chg-state-change", smblib_handle_debug }, { "step-chg-soc-update-fail", smblib_handle_debug }, { "step-chg-soc-update-request", smblib_handle_debug }, @@ -633,10 +635,10 @@ static const struct smb2_irq_info smb2_irqs[] = { { "usbin-lt-3p6v", smblib_handle_debug }, { "usbin-uv", smblib_handle_debug }, { "usbin-ov", smblib_handle_debug }, - { "usbin-plugin", smblib_handle_usb_plugin }, - { "usbin-src-change", smblib_handle_usb_source_change }, - { "usbin-icl-change", smblib_handle_icl_change }, - { "type-c-change", smblib_handle_usb_typec_change }, + { "usbin-plugin", smblib_handle_usb_plugin, true }, + { "usbin-src-change", smblib_handle_usb_source_change, true }, + { "usbin-icl-change", smblib_handle_icl_change, true }, + { "type-c-change", smblib_handle_usb_typec_change, true }, /* DC INPUT IRQs */ { "dcin-collapse", smblib_handle_debug }, { "dcin-lt-3p6v", smblib_handle_debug }, @@ -705,6 +707,10 @@ static int smb2_request_interrupt(struct smb2 *chip, return rc; } + smb2_irqs[irq_index].irq = irq; + if (smb2_irqs[irq_index].wake) + enable_irq_wake(irq); + return rc; } |
