调试中加入debugfs有时可以起到事半功倍的效果(注意:一般我使用的时候位于目录/sys/kernel/debug):

adb shell
#mkdir /data/debug
#mount -t debugfs debugfs /data/debug
#cd /data/debug

查看gpio状态

root@android:/data/debugfs # cat gpio
GPIOs 0-15:
 gpio-0   (front_camera_rst    ) out lo

GPIOs 16-42:
 gpio-17  (tsl2771_int         ) in  hi
 gpio-26  (ctp_reset           ) out hi
 gpio-29  (front_camera_pwd    ) out hi
 gpio-31  (gpio_kp_out         ) out lo
 gpio-32  (gpio_kp_out         ) out lo
 gpio-35  (GPIO_E186_POWER     ) in  lo
 gpio-36  (gpio_kp_in          ) in  hi
 gpio-37  (gpio_kp_in          ) in  hi
 gpio-42  (hs_sw               ) in  hi

查看regulator
root@android:/data/debugfs # cd
regulator/                                    
dummy/ ldo03/ ldo06/ ldo09/ ldo12/ ldo15/ ldo18/ smps1/ smps4/
ldo01/ ldo04/ ldo07/ ldo10/ ldo13/ ldo16/ ldo19/ smps2/
ldo02/ ldo05/ ldo08/ ldo11/ ldo14/ ldo17/ ncp/   smps3/
root@android:/data/debugfs # cat
regulator/ldo10/voltage                      
3000000

查看clk
root@android:/ #
cat /data/debugfs/clk/                                       
adm_clk/                  ebi_mddi_clk/
sdc1_p_clk/          
adsp_clk/                 ebi_vfe_clk/
sdc2_clk/            
ahb_m_clk/                ecodec_clk/
sdc2_p_clk/          
ahb_s_clk/                gp_clk/
sdc3_clk/            
cam_m_clk/                grp_3d_clk/
sdc3_p_clk/          
csi0_clk/                 grp_3d_p_clk/
sdc4_clk/            
csi0_p_clk/               gsbi1_qup_clk/
sdc4_p_clk/          
csi0_vfe_clk/             gsbi1_qup_p_clk/
tsif_p_clk/          
csi1_clk/                 gsbi2_qup_clk/
tsif_ref_clk/        
csi1_p_clk/               gsbi2_qup_p_clk/
uart1_clk/           
csi1_vfe_clk/             icodec_rx_clk/
uart1dm_clk/         
debug_suspend             icodec_tx_clk/
uart2_clk/           
dsi_byte_clk/             imem_clk/
uart2dm_clk/         


root@android:/ #
cat /data/debugfs/clk/mdp_clk/rate                           
200000000

http://blog.csdn.net/linux_devices_driver/article/details/8300094
Logo

更多推荐