View Single Post
joerg_rw's Avatar
Posts: 2,222 | Thanked: 12,651 times | Joined on Mar 2010 @ SOL 3
#785
Originally Posted by egoshin View Post
The last function clears DP/DM PULLDOWN and sets only DM_PULLDOWN.
I wonder why it sets any pulldown at all, actually I'd think even chrg_det won't work with both pulldowns set, it rather should use a pullup on one dataline, and a (much larger) pulldown plus voltage comparator on the other dataline for detection of D+/- short.
Then when a high power charger is detected, any D+/- meddling is highly senseless, as you'll notice unplugging of the charger anyway, by VBUS drop (if you simply switch off the charger, no side effects will arise from that either, as next return of VBUS - when you plug the wallwart to the wall again - will trigger another D+/- short detection cycle).

My 2 cent
/j

[edit]
Nokia-N900-02-8:~# cat /sys/devices/platform/musb_hdrc/charger /sys/class/i2c-adapter/i2c-1/1-0048/twl4030_usb/vbus
1) nothing attached
0 0
2) blank cable, D+/- short
0 0
3) VBUS (from hub downstream)
0 1
4) VBUS plus D+/- short
1 1
5) like 3) but after 4)
1 1

we see
a) /sys/class/i2c-adapter/i2c-1/1-0048/twl4030_usb/vbus is 5V VBUS detection, probably from twl4030
b) /sys/devices/platform/musb_hdrc/charger is D+/- short detect, aka charger_detect, probably from 1707
c) charger_detect only works (or is triggered) when VBUS is applied
d) charger_detect is 'stricky', se 3) vs 5) above. I.E. it is reset to 0 only when vbus is removed (I have not checked to keep D+/- short while removing VBUS, but I'd expect the standard charger when unplugged from mains does exactly that, and it results in 0 0 )




bme_RX-51 open files:
Code:
Nokia-N900-02-8:~# lsof -p 712    
COMMAND   PID USER   FD   TYPE     DEVICE    SIZE  NODE NAME
bme_RX-51 712 root  cwd    DIR      254,1    1704     1 /   
bme_RX-51 712 root  rtd    DIR      254,1    1704     1 /   
bme_RX-51 712 root  txt    REG      254,1  105500 17456 /usr/sbin/bme_RX-51
bme_RX-51 712 root  mem    REG      254,1  119108    88 /lib/ld-2.5.so     
bme_RX-51 712 root  mem    REG      254,1 1164232   121 /lib/libc-2.5.so   
bme_RX-51 712 root  mem    REG      254,1   45696   252 /lib/libgcc_s.so.1 
bme_RX-51 712 root  mem    REG      254,1   90612    87 /lib/libpthread-2.5.so
bme_RX-51 712 root  mem    REG      254,1   28428    84 /lib/librt-2.5.so     
bme_RX-51 712 root  mem    REG      254,1  868892  5664 /usr/lib/libglib-2.0.so.0.2000.3
bme_RX-51 712 root  mem    REG      254,1  450020    75 /lib/libm-2.5.so                
bme_RX-51 712 root  mem    REG      254,1   22112  6076 /usr/lib/libcal.so.1.0.0        
bme_RX-51 712 root  mem    REG      254,1    7600  6481 /usr/lib/libdsme.so.0.2.0       
bme_RX-51 712 root    0u   CHR        5,1           995 /dev/console                    
bme_RX-51 712 root    1u   CHR        5,1           995 /dev/console                    
bme_RX-51 712 root    2u   CHR        5,1           995 /dev/console                    
bme_RX-51 712 root    3r   CHR      10,63          1636 /dev/twl4030-adc                
bme_RX-51 712 root    4u   CHR       89,2          1496 /dev/i2c-2                      
bme_RX-51 712 root    5u   CHR       89,2          1496 /dev/i2c-2                      
bme_RX-51 712 root    6u   REG       0,11      80  3156 /nosmq                          
bme_RX-51 712 root    7r   REG        0,0    4096   951 /sys/class/i2c-adapter/i2c-1/1-0048/twl4030_usb/vbus
bme_RX-51 712 root    8r   REG        0,0    4096   989 /sys/devices/platform/musb_hdrc/mA                  
bme_RX-51 712 root    9r   REG        0,0    4096   991 /sys/devices/platform/musb_hdrc/charger             
bme_RX-51 712 root   10r   REG        0,0    4096   994 /sys/devices/platform/musb_hdrc/suspend             
bme_RX-51 712 root   11u  unix 0xcfc0da80          3172 socket                                              
bme_RX-51 712 root   12u  unix 0xcfc0de00          3174 /tmp/.bmesrv                                        
bme_RX-51 712 root   13u  unix 0xccbd7700          4651 /tmp/.bmesrv                                        
bme_RX-51 712 root   14u  unix 0xcc88d540          3776 socket
I wonder what /dev/twl4030-adc might do...

Last edited by joerg_rw; 2010-05-08 at 04:08.
 

The Following 2 Users Say Thank You to joerg_rw For This Useful Post: