# Unable to configure/communicate with additional I2c interface for wp7608

**URL:** <https://mangoh.discourse.group/t/unable-to-configure-communicate-with-additional-i2c-interface-for-wp7608/3483>\
**Category:** Uncategorized\
**Created:** [January 20, 2020, 6:48am UTC](https://mangoh.discourse.group/t/unable-to-configure-communicate-with-additional-i2c-interface-for-wp7608/3483 "2020-01-20T06:48:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![amrutasant](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@amrutasant](https://mangoh.discourse.group/u/amrutasant)\
**Post date:** [January 20, 2020, 6:48am UTC](https://mangoh.discourse.group/t/unable-to-configure-communicate-with-additional-i2c-interface-for-wp7608/3483/1 "2020-01-20T06:48:40Z")

</div>

Hi,  
We are trying to configure additional I2c interface (I2c-5) on WP7608. We have done following changes (using I2c-4 config as reference ) in device tree files using GPIO-10 and GPIO-11. We are able to detect /dev/I2c-5 but unable to see any transition on clock signal.  
Please refer following changes in device tree config and dmesg logs for reference.

```auto
mdm9607.dtsi : 
aliases {
		/* smdtty devices */
		smd7 = &smdtty_data1;
		smd8 = &smdtty_data4;
		smd9 = &smdtty_data2;
		smd10 = &smdtty_data3;
		smd11 = &smdtty_data11;
		smd21 = &smdtty_data21;
		smd36 = &smdtty_loopback;
		/* spi device */
		spi1 = &spi_1;
		i2c4 = &i2c_4;
		**i2c5 = &i2c_5;**
		sdhc2 = &sdhc_2; /* SDC2 SD card slot */
	};

**Added following block to above file :** 
**i2c_5: i2c@78b9000** { /* BLSP1 QUP4 */
		compatible = "qcom,i2c-msm-v2";
		#address-cells = <1>;
		#size-cells = <0>;
		reg-names = "qup_phys_addr";
		**reg = <0x78b9000 0x600>;**
		interrupt-names = "qup_irq";
		interrupts = <0 99 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_qup5_i2c_apps_clk>;

		pinctrl-names = "i2c_active", "i2c_sleep";
		**pinctrl-0 = <&i2c_5_active>;**
 **pinctrl-1 = <&i2c_5_sleep>;**
		qcom,noise-rjct-scl = <0>;
		qcom,noise-rjct-sda = <0>;
		qcom,master-id = <86>;
		**dmas = <&dma_blsp1 10 64 0x20000020 0x20>,**
 **<&dma_blsp1 11 32 0x20000020 0x20>;**
		dma-names = "tx", "rx";
		status = "disabled";
	};

mdm9607-pinctrl.dtsi : 
Added following block to above file.

i2c_5 {
			i2c_5_active: i2c_5_active {
				/* active state */
				mux {
					pins = "gpio10", "gpio11";
					function = "blsp_i2c5";
				};
				config {
					pins = "gpio10", "gpio11";
					drive-strength = <2>;
					bias-disable;
				};
			};

			i2c_5_sleep: i2c_5_sleep {
				/* suspended state */
				mux {
					pins = "gpio10", "gpio11";
					function = "gpio";
				};
				config {
					pins = "gpio10", "gpio11";
					drive-strength = <2>;
					bias-pull-down;
				};
			};
		};

mdm9607-wp76xx.dtsi :

 Added following block to above file. 
&i2c_5 {
	/* reduce bus frequency as a workaround for MCU ROM boot loader */
	qcom,clk-freq-out = <100000>;

	/* Increase clock high width from 3.4ns to 4.6ns to meet I2C spec */
	qcom,fs-clk-div = <100>;
	qcom,high-time-clk-div = <86>;
	status = "ok";
};

**Please find following logs for your reference :** 
root@RelySys:~# i2cdetect -y -r 5
     0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --               

```

Attaching dmesg logs for your reference.[dmesg.txt](https://mangoh.discourse.group/uploads/short-url/jF68yYh2NjiZXCLkzRw7yNTpJD2.txt) (91.8 KB)

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [January 20, 2020, 11:16pm UTC](https://mangoh.discourse.group/t/unable-to-configure-communicate-with-additional-i2c-interface-for-wp7608/3483/2 "2020-01-20T23:16:59Z")

</div>

When posting, please use triple backticks to surround multi-line preformatted text or code. For example:

```  
YOUR CODE  
OR COMMAND OUTPUT  
HERE  
```

This makes it much easier to read.

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [January 21, 2020, 8:16pm UTC](https://mangoh.discourse.group/t/unable-to-configure-communicate-with-additional-i2c-interface-for-wp7608/3483/3 "2020-01-21T20:16:53Z")

</div>

> We are able to detect /dev/I2c-5 but unable to see any transition on clock signal.

Did you see any activity on the data line? I have personally never tried using i2c\_5. Can you share information about why you need a second I2C master?

---

<div class="post-metadata">

**Author:** ![amrutasant](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@amrutasant](https://mangoh.discourse.group/u/amrutasant)\
**Post date:** [January 22, 2020, 6:23am UTC](https://mangoh.discourse.group/t/unable-to-configure-communicate-with-additional-i2c-interface-for-wp7608/3483/4 "2020-01-22T06:23:01Z")

</div>

Hi,  
We are using one more audio codec , so we need additional I2c master.

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [January 23, 2020, 7:54pm UTC](https://mangoh.discourse.group/t/unable-to-configure-communicate-with-additional-i2c-interface-for-wp7608/3483/5 "2020-01-23T19:54:26Z")

</div>

It’s unfortunate that the WM8944 was placed upstream of the I2C switch. If it had been designed downstream of the I2C switch, then you would be able to put the second codec on a different port.

You didn’t specify whether or not you saw any activity on the sda line. Did you check?

---

<div class="post-metadata">

**Author:** ![amrutasant](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@amrutasant](https://mangoh.discourse.group/u/amrutasant)\
**Post date:** [January 24, 2020, 6:50am UTC](https://mangoh.discourse.group/t/unable-to-configure-communicate-with-additional-i2c-interface-for-wp7608/3483/6 "2020-01-24T06:50:56Z")

</div>

We didn’t see any activity on the sda line. Could you please confirm ,is it possible to add additional I2c interface for WP7608?

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [January 27, 2020, 7:25pm UTC](https://mangoh.discourse.group/t/unable-to-configure-communicate-with-additional-i2c-interface-for-wp7608/3483/7 "2020-01-27T19:25:40Z")

</div>

I have never done this myself, but I think your approach seems reasonable.

---

<div class="post-metadata">

**Author:** ![amrutasant](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@amrutasant](https://mangoh.discourse.group/u/amrutasant)\
**Post date:** [February 4, 2020, 7:20am UTC](https://mangoh.discourse.group/t/unable-to-configure-communicate-with-additional-i2c-interface-for-wp7608/3483/8 "2020-02-04T07:20:34Z")

</div>

Any updates on this?
