高通修改i2c速率的方法

在驱动的dts中修改: qcom,clk-freq-out = <400000>;//速率
arch/arm64/boot/dts/qcom/msm8953.dtsi

i2c_2: i2c@78b6000 { /* BLSP1 QUP2 */
                compatible = "qcom,i2c-msm-v2";
                #address-cells = <1>;
                #size-cells = <0>;
                reg-names = "qup_phys_addr";
                reg = <0x78b6000 0x600>;
                interrupt-names = "qup_irq";
                interrupts = <0 96 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_qup2_i2c_apps_clk>;

                pinctrl-names = "i2c_active", "i2c_sleep";
                pinctrl-0 = <&i2c_2_active>;
                pinctrl-1 = <&i2c_2_sleep>;
                qcom,noise-rjct-scl = <0>;
                qcom,noise-rjct-sda = <0>;
                qcom,master-id = <86>;
                dmas = <&dma_blsp1 6 64 0x20000020 0x20>,
                        <&dma_blsp1 7 32 0x20000020 0x20>;
                dma-names = "tx", "rx";
                status = "disabled";
        };

        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 = <100000>;//速率
                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对应的gpio控制,不用修改
arch/arm64/boot/dts/qcom/msm8953-pinctrl.dtsi

i2c_2 {
                        i2c_2_active: i2c_2_active {
                                /* active state */
                                mux {
                                        pins = "gpio6", "gpio7";
                                        function = "blsp_i2c2";
                                };

                                config {
                                        pins = "gpio6", "gpio7";
                                        drive-strength = <2>;
                                        bias-disable;
                                };
                        };

                        i2c_2_sleep: i2c_2_sleep {
                                /* suspended state */
                                mux {
                                        pins = "gpio6", "gpio7";
                                        function = "gpio";
                                };

                                config {
                                        pins = "gpio6", "gpio7";
                                        drive-strength = <2>;
                                        bias-disable;
                                };
                        };
                };

                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;
                                };
                        };
                };

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值