cancel
Showing results for 
Search instead for 
Did you mean: 

STM32mp1 pin mux in kernel dts

Ara.1
Senior

currently i have a pin <STM32_PINMUX('F', 14, GPIO)> how to mux as a GPIO before using as a gpiolib, export work fine, but i2c4 is not working but i can see GPIO is getting based on sys gpiolib.

as before export i see PF14 line is muxed as pin 94 (PF14): input - low - pull up

and this line has AF as a i2c4-clk

5 REPLIES 5
OlivierK
ST Employee

Hi Ara.1 (Community Member)

I am not sure to understand what you try to acheive here. if you've declared PF14 as AF assigned to i2c4-clk, the i2c driver will use this pin (pinctrl framework). This is mutually exclusive to control PF14 as a GPIO using gpiolib framework.

Maybe a good starting point: https://wiki.st.com/stm32mpu/wiki/Overview_of_GPIO_pins

Regards,

Olivier

  1. i2c is not working when i do sysfs gpio activity on PF14,
  2. but when i use same PF14 pin set via gpiochip , i2c works neatly

point 1

 echo 94 > /sys/class/gpio/export  -

point 2

gpioset gpiochip5 14=1

OlivierK
ST Employee

Hi Ara.1 (Community Member)

Understood...

sysfs gpio is deprecated since Linux 4.8, you should use gpiochip instead.

BR

Olivier

sysfs gpio i can set and reset, same reflecting on PF14, but why i2c4 lines are different touch is failing this looks strange.

PatrickF
ST Employee

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.