一、I2C配置
1.根据原理图,查找相关的i2c引脚对应的GPIO值,以GPIO10作为I2C_SDA,GPIO11作为I2C_SCL为例。
2.根据MSM8937 DEVICE SPECIFICATION文档,查找GPIO10与GPIO11对应的BLSP,以及检查GPIO10与GPIO11是否可以作为I2C来使用。根据文档,GPIO10对应BLSP3_1,GPIO11对应BLSP3_0。
3.根据80-nu767-1_h_linux_bam_low-speed_peripherals_configuration_and_debug_guide文件,查找I2C部分BLSP3_0与BLSP3_1对应内容,包括其物理地址、reg size、中断号......
4.进入kernel/msm-3.18/arch/arm/boot/dts/qcom/路径下修改msm8937-pinctrl.dtsi文件
GPIO配置如下:
i2c_3 {
i2c_3_active: i2c_3_active {
/* active state */
mux {
pins = "gpio10", "gpio11";
function = "blsp_i2c3";
};
config {
pins = "gpio10", "gpio11";
drive-strength = <2>;
bias-disable;
};
};
i2c_3_sleep: i2c_3_sleep {
/* suspended state */
mux {
pins = "gpio10", "gpio11";
function = "gpio";
};
config {
pins = "gpio10", "gpio11";
drive-strength = <2>;
bias-disable;
};
};
};
i2c_3_active: i2c_3_active {
/* active state */
mux {
pins = "gpio10", "gpio11";
function = "blsp_i2c3";
};
config {
pins = "gpio10", "gpio11";
drive-strength = <2>;
bias-disable;
};
};
i2c_3_sleep: i2c_3_sleep {
/* suspended state */
mux {
pins = "gpio10", "gpio11";
function = "gpio";
};
config {
pins = "gpio10", "gpio11";
drive-strength = <2>;
bias-disable;
};
};
};
5.进入kernel/msm-3.18/arch/arm/boot