Skip to main content
Visitor II
July 13, 2021
Question

STM32mp1 pin mux in kernel dts

  • July 13, 2021
  • 3 replies
  • 1339 views

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

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    July 15, 2021

    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

    Ara.1Author
    Visitor II
    July 15, 2021
    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

    Technical Moderator
    July 15, 2021

    Hi Ara.1 (Community Member)

    Understood...

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

    BR

    Olivier

    Ara.1Author
    Visitor II
    July 15, 2021

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

    Technical Moderator
    July 21, 2021

    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'