Even more OTG charging

Time to dig in to the differences in the various code branches. On AOSP for MSM,  https://android.googlesource.com/kernel/msm.git, there is a 'newer' branch. Newer in the sense that it is a newer kernel.

To diff the version shipped w/ the Nexus 7 vs the newer one, run git diff remotes/origin/android-msm-3.9-usb-and-mmc-hacks — msm_otg.c

(or just from the top if you have time!)

One interesting area is msm_hsusb_ldo_enable(). The ‘newer’ version has more cases than just off/on.

It also looks like msm_otg_phy_reset() needs a short delay.

msm_otg_suspend() also has a small piece that could be merged

msm_otg_notify_power_supply() is also interesting. In my version, its >0 mA, in the 3.9… version, its >2mA.

msm_otg_set_host() is interesting.  There’s a chunk that the FLO branch has a) commented out, and b) ‘if mako’

The USB_CHG_STATE_DETECTED case in msm_chg_detect_work() is intriguing.

OTG_STATE_B_PERIPHERAL case in msm_otg_sm_work() interesting, there is another case here (for the DCP, dedicated charger, e.g. just V+/GND).

The  “} else if ((otgsc & OTGSC_BSVIE) && (otgsc & OTGSC_BSVIS)) {” part of msm_otg_irq()  also looks like it needs merging.

Merging the power_prop part could also be useful. And maybe the ‘pnoc errata fix’ (hmm, can’t find any info online about what that HW errata might be).

The bottom of msm_otg_probe() has some pm8921_charger_register… bits in the newer one.








Leave a Reply

Your email address will not be published. Required fields are marked *