Profile cover photo
Profile photo
Lawrence Lansing
549 followers
549 followers
About
Lawrence's posts

Post has shared content
How to test for "cheater" USB cables that can break your phone, your computer, or your car.
USB C to A cable testing refined - Nexus 5X only
Edit: Now 6P as well
Edit: added descriptions of output values

Short version
5X
adb shell "cat /sys/bus/i2c/drivers/fusb301/*/fclientcur"
Or  from a shell on the phone
cat /sys/bus/i2c/drivers/fusb301/*/fclientcur

If the result is 3000 an A to C cable is non-compliant

Possible values
0 - standard USB charging
1500 - 1.5 amp type C charging
3000 - 3 amp type C charging

It will also report 0 if not plugged in.

6P
adb shell "cat /sys/class/typec/typec_device/current_detect"
Or from a shell on the phone
cat /sys/class/typec/typec_device/current_detect

If the result is 2 an A to C cable is non-compliant

Possible values
0 - standard USB charging
1 - 1.5A type C
2 - 3A type C

Details
The FUSB301 chip is connected directly to the configuration channel pins in the Type-C port on the Nexus 5X and is used determine if the cable is connected, the orientation, and the power level and direction.  The fusb301 driver makes the charge current value available in the file fclientcur in the sys file system.  Because this is as close as it gets to the CC pins in the port, this is the best that can be done from the phone.

Also, because this can be done from the phone, if it is in fact reliable, an app can be built around this.

Looking at the kernel sources for the 6P, it doesn't have the fusb301 driver so it is probably using a different chip. 

The 6P uses a tusb320

Post has attachment
PhotoPhotoPhotoPhotoPhoto
Agents of Chaos
43 Photos - View album

Post has attachment
PhotoPhotoPhotoPhotoPhoto
Sidewalk's End
31 Photos - View album

Post has shared content
Halloween 2009.  The gattling gun was motorized.

Post has attachment
Presidents of the United States of America.  (And me.  And a cute Asian girl who keeps following me around.)
Photo

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment
Wait while more posts are being loaded