iic , device tree ; i2c device tree
msm8937 porting iic device
msm8937 porting iic device,有需要的朋友可以参考下。
又要加touch了,重新搞一遍porting工作,还是遇到了一些问题。
首先往Dtsi文件里加iic device的时候要注意看iic bus是否已经挂载成功了
我就遇到了用i2cdetect扫描bus的时候没有看到,结果在dtsi文件里发现bus是disable的
i2c_3: i2c@78b7000 { /* BLSP1 QUP3 */
compatible = "qcom,i2c-msm-v2";
#address-cells = <1>;
#size-cells = <0>;
reg-names = "qup_phys_addr";
reg = <0x78b7000 0x600>;
interrupt-names = "qup_irq";
interrupts = <0 97 0>;
qcom,clk-freq-out = <400000>;
qcom,clk-freq-in = <19200000>;
clock-names = "iface_clk", "core_clk";
clocks = <&clock_gcc clk_gcc_blsp1_ahb_clk>,
<&clock_gcc clk_gcc_blsp1_qup3_i2c_apps_clk>;
pinctrl-names = "i2c_active", "i2c_sleep";
pinctrl-0 = <&i2c_3_active>;
pinctrl-1 = <&i2c_3_sleep>;
qcom,noise-rjct-scl = <0>;
qcom,noise-rjct-sda = <0>;
qcom,master-id = <86>;
dmas = <&dma_blsp1 8 64 0x20000020 0x20>,
<&dma_blsp1 9 32 0x20000020 0x20>;
dma-names = "tx", "rx";
/*status = "disabled";*/ 这句话先禁了
};
&i2c_3 { /* BLSP1 QUP4 */
focaltech@38 {
compatible = "focaltech,5x06";
reg = <0x38>;
interrupt-parent = <&tlmm>; //这里变了以前是gpio
interrupts = <65 0x2008>;
vdd-supply = <&pm8937_l10>;
vcc_i2c-supply = <&pm8937_l5>;//这里也变了
/* pins used by touchscreen */
pinctrl-names = "pmx_ts_active","pmx_ts_suspend","pmx_ts_release";
pinctrl-0 = <&ts_int_active &ts_reset_active>;
pinctrl-1 = <&ts_int_suspend &ts_reset_suspend>;
pinctrl-2 = <&ts_release>;
focaltech,name = "ft5346";
focaltech,family-id = <0x54>;
focaltech,reset-gpio = <&tlmm 64 0x0>;//这里也变了
focaltech,irq-gpio = <&tlmm 65 0x2008>;//这里也变了
focaltech,display-coords = <0 0 720 1280>;
focaltech,panel-coords = <0 0 720 1400>;
focaltech,button-map= <139 102 158>;
focaltech,no-force-update;
focaltech,i2c-pull-up;
focaltech,group-id = <1>;
focaltech,hard-reset-delay-ms = <20>;
focaltech,soft-reset-delay-ms = <200>;
focaltech,num-max-touches = <5>;
focaltech,fw-delay-aa-ms = <30>;
focaltech,fw-delay-55-ms = <30>;
focaltech,fw-upgrade-id1 = <0x79>;
focaltech,fw-upgrade-id2 = <0x18>;
focaltech,fw-delay-readid-ms = <10>;
focaltech,fw-delay-era-flsh-ms = <2000>;
focaltech,fw-auto-cal;
focaltech,ignore-id-check;
};
};
想要确定i2c设备挂在哪个bus上,那就看i2c的gpio是哪两条
再找相应的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-pull-down;
};
};
};
说明在bus3上
Dtsi文件的修改就到这边了
posted on 2017-03-21 11:47 Red_Point 阅读(1197) 评论(0) 编辑 收藏 举报