Hello,
I have a question about the Linux 4.9: is there a way to change the pin function in the Kernel? For example, in the SAMA5D2 Series Datasheet, the pin PA21 can be a TCLK0 (func D) or a IRQ (func A). Can I change the pin from TCLK0 to a IRQ in the kernel? I searched in the Google, in the Kernel documentation and in the topics of this community too and nothing.
Thank you in advance.
Change Pin Function - Linux 4.9
Moderator: nferre
- blue_z
- Location: USA
Post
The definition (in the board's Device Tree) of a pin-control group and pin attributes is normally all you have do to specify pin functionality for each peripheral.
If the pin was originally configured for one peripheral function, do you actually want to change the pin to a different function?
Does the connection to the board actually support either functionality?
Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt,
Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt , and
Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt.
Regards
Re: Change Pin Function - Linux 4.9
Yes, but normally this is performed only one time during boot using the Device Tree.igortf wrote: ↑is there a way to change the pin function in the Kernel?
The definition (in the board's Device Tree) of a pin-control group and pin attributes is normally all you have do to specify pin functionality for each peripheral.
Is this hypothetical or supposed to be a real question?igortf wrote: ↑For example, in the SAMA5D2 Series Datasheet, the pin PA21 can be a TCLK0 (func D) or a IRQ (func A). Can I change the pin from TCLK0 to a IRQ in the kernel?
If the pin was originally configured for one peripheral function, do you actually want to change the pin to a different function?
Does the connection to the board actually support either functionality?
Study Documentation/pinctrl.txt,igortf wrote: ↑I searched in the Google, in the Kernel documentation and in the topics of this community too and nothing.
Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt,
Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt , and
Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt.
Regards
Post
Re: Change Pin Function - Linux 4.9
Hello blue_z,
Thanks for your answer.
Best regards.
Thanks for your answer.
It's a real question. I already try to change the pin function by register in the Linux using the "devmem" command. It works.blue_z wrote: Is this hypothetical or supposed to be a real question?
If the pin was originally configured for one peripheral function, do you actually want to change the pin to a different function?
Does the connection to the board actually support either functionality?
I read these documents already and they only show how to configure in Device Tree. I want to change the pin function during execution. So, I want to know if there is a API to do this or only by registers handling.
Best regards.
- blue_z
- Location: USA
Post
In the first document, I see a section titled Pin control requests from drivers, and there's a list for the semantics of the pinctrl APIs .
Finally there's a section on Runtime pinmuxing with a code example.
Isn't that what you're asking for?
Regards
Re: Change Pin Function - Linux 4.9
Really??!!igortf wrote: ↑I read these documents already and they only show how to configure in Device Tree.
In the first document, I see a section titled Pin control requests from drivers, and there's a list for the semantics of the pinctrl APIs .
Finally there's a section on Runtime pinmuxing with a code example.
Isn't that what you're asking for?
Regards
Post
Re: Change Pin Function - Linux 4.9
Hello blue_z
Thank you very much for your support.
Best regards.
I reread all the documents you mentioned a few times and still don't get how the Runtime Pinmuxing works. So, I searched one of the functions mentioned in the first document. I found the same doubt I have in the Stack Overflow (https://stackoverflow.com/questions/373 ... nux-kernel). I finally understand how it works.blue_z wrote: ↑Thu Oct 25, 2018 10:08 pmReally??!!igortf wrote: ↑I read these documents already and they only show how to configure in Device Tree.
In the first document, I see a section titled Pin control requests from drivers, and there's a list for the semantics of the pinctrl APIs .
Finally there's a section on Runtime pinmuxing with a code example.
Isn't that what you're asking for?
Thank you very much for your support.
Best regards.
Who is online
Users browsing this forum: No registered users and 2 guests