IMX6UL Change Pin Function

cancel
Showing results for 
Search instead for 
Did you mean: 

IMX6UL Change Pin Function

661 Views
danielberhe
Contributor III

I have a custom IMX6UL board running Linux 4.14. I configured GPIO1_IO29 and GPIO1_IO28 for I2C in the device tree and all is working well with that. What I am struggling to figure out is how I can momentarily change the function of the I2C pins to GPIO without having to modify the device tree and recompiling the kernel. The I2C slave connected to my board sometimes requires a specific re-sync sequence that I can't achieve if the pins are in I2C mode. 

Any help would be appreciated.

 

Daniel

Labels (1)
0 Kudos
4 Replies

480 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Daniel,

There is no method to change the device tree on the fly as it is only loaded to setup the hardware variables. However, you may change the registers associated to the desired pins to change their functions on the fly. You would just need to be careful to make sure that there are no conflicts with the drivers or other functions.

I hope this helps!

Regards,

0 Kudos

480 Views
danielberhe
Contributor III

Hi Gusarambula,

Thanks for your response. 

My intention wasn't to change the device tree on the fly. I managed to get around the problem by writing a misc device driver that changes the pin functions by using the Linux PINCTRL subsystem. 

Regards,

Daniel

0 Kudos

460 Views
jochenstehle
Contributor III

Hi Daniel,

i have a similar problem. Can you give me more Infos how you do it or where i can get more information how to change pin functionality for userspace.

 

I want to switch my main serial uart to gpio after the system is booted up (in userspace).

Regards,

Jochen

0 Kudos

480 Views
2046880190
Contributor III

你好:

       请问你解决这个问题了么?我在使用i.mx8,不希望更改设备树或者内核,但是我发现使用echo去驱动的时候,IO口没有电平变化。

0 Kudos