Profile

Cover photo
Lawrence Lansing
Works at Google
Attended Rensselaer Polytechnic Institute
552 followers|868,665 views
AboutPostsPhotosYouTubeReviews

Stream

Lawrence Lansing

Shared publicly  - 
 
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
143 comments on original post
3
Viet-Tam Luu's profile photoUdi Meiri's profile photoLawrence Lansing's profile photo
3 comments
 
Yup! 3 amps vs. 500mA on a spec cable on my machine at work.
Add a comment...

Lawrence Lansing

Shared publicly  - 
1
Add a comment...

Lawrence Lansing

Shared publicly  - 
 
Presidents of the United States of America.  (And me.  And a cute Asian girl who keeps following me around.)
2
Add a comment...
Have him in circles
552 people
Jill Cupcake Skinner's profile photo
Cody Smith's profile photo
Cathy Chen's profile photo
Kerri McKinnon's profile photo
Maiju Wesley's profile photo
Devi Lanphere's profile photo
Razvan Musaloiu-E.'s profile photo
Delia Gonzales's profile photo
Geoff B's profile photo

Lawrence Lansing

Shared publicly  - 
5
Marshall Bockrath-Vandegrift's profile photo
 
If they're agents of chaos, why are they all dressed the same?
Add a comment...

Lawrence Lansing

Shared publicly  - 
 
Halloween 2009.  The gattling gun was motorized.
2
Tigearnan Breen's profile photo
 
Vampires? Meh!
Watch out for:

Abe Lincoln:
EVERYTHING Hunter!
Add a comment...
People
Have him in circles
552 people
Jill Cupcake Skinner's profile photo
Cody Smith's profile photo
Cathy Chen's profile photo
Kerri McKinnon's profile photo
Maiju Wesley's profile photo
Devi Lanphere's profile photo
Razvan Musaloiu-E.'s profile photo
Delia Gonzales's profile photo
Geoff B's profile photo
Education
  • Rensselaer Polytechnic Institute
    Computer Science, 1999 - 2003
  • Lansingburgh High School
Work
Occupation
Software Engineer
Employment
  • Google
    Software Engineer, 2006 - present
  • FactSet
    2004 - 2006
  • AgileView Software
    2003 - 2004
Basic Information
Gender
Male
3 reviews
Map
Map
Map
By far my favorite auto shop in the bay area.
Public - 2 years ago
reviewed 2 years ago