All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrice CHOTARD <patrice.chotard@st.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 0/5] Add get_alt_function ops
Date: Tue, 11 Sep 2018 07:31:54 +0000	[thread overview]
Message-ID: <af4058ba-fb38-4e16-c454-3be663fce51a@st.com> (raw)
In-Reply-To: <2593e82a-13d5-9a63-4ddd-7fe378f9e1f2@xilinx.com>

Hi Michal

On 09/11/2018 07:51 AM, Michal Simek wrote:
> On 10.9.2018 18:11, Patrice Chotard wrote:
>>
>> This series :
>>   - Add new gpio ops get_alt_function
>>   - Add get_function and get_alt_function support to stm32 gpio driver
>>   - Add get_alt_function test
> 
> 
> I went quickly over this series and TBH I am not getting what this is
> for. It looks like that this is the part of pinmux.
> 
> Can you please elaborate more what this is for?

Currently, get_function callback returns the state of a gpio
(GPIOF_INPUT, GPIOF_OUTPUT or GPIO_FUNC).

If a pin's state is GPIO_FUNC, it's useful to know which alternate
function is selected for debug purpose.

As example, on STM32 SoCs, a pins can be configured as GPIO or also
configured with up to 16 alternate function. Using command "gpio", user
can retrieve this information as shown below:

STM32MP> gpio state -a

Bank GPIOA:
GPIOA0: unused: 0 [ ]
GPIOA1: unused: 0 [ ]
GPIOA2: unused: 0 [ ]
GPIOA3: unused: 0 [ ]
GPIOA4: unused: 0 [ ]
GPIOA5: unused: 0 [ ]
GPIOA6: unused: 0 [ ]
GPIOA7: unused: 0 [ ]
GPIOA8: func: 9
GPIOA9: func: 10
GPIOA10: unused: 0 [ ]
GPIOA11: unused: 0 [ ]
GPIOA12: unused: 0 [ ]
GPIOA13: output: 1 [x] red.gpios
GPIOA14: output: 0 [x] green.gpios
GPIOA15: unused: 0 [ ]

It shows that pin 8 and 9 of bank A are configured respectively in
alternate function 9 and 10.

Patrice



> 
> Thanks,
> Michal
> 

  reply	other threads:[~2018-09-11  7:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-10 16:11 [U-Boot] [PATCH v3 0/5] Add get_alt_function ops Patrice Chotard
2018-09-10 16:11 ` [U-Boot] [PATCH v3 1/5] dm: gpio: " Patrice Chotard
2018-09-10 16:11 ` [U-Boot] [PATCH v3 2/5] gpio: stm32f7: Add ops get_function Patrice Chotard
2018-09-10 16:11 ` [U-Boot] [PATCH v3 3/5] gpio: stm32f7: Add ops get_alt_function Patrice Chotard
2018-09-10 16:11 ` [U-Boot] [PATCH v3 4/5] gpio: sandbox: Rename GPIOF_(OUTPUT|HIGH|ODR) to SANDBOX_GPIO_(OUTPUT|HIGH|ODR) Patrice Chotard
2018-09-10 16:11 ` [U-Boot] [PATCH v3 5/5] test: dm: Add gpio get_alt_function ops test Patrice Chotard
2018-09-11  5:51 ` [U-Boot] [PATCH v3 0/5] Add get_alt_function ops Michal Simek
2018-09-11  7:31   ` Patrice CHOTARD [this message]
2018-09-11 10:24     ` Michal Simek
2018-09-11 11:12       ` Patrice CHOTARD
2018-09-11 12:17         ` Michal Simek
2018-09-11 13:31           ` [U-Boot] [Uboot-stm32] " Patrice CHOTARD
2018-09-11 13:45             ` Michal Simek
2018-09-11 17:03     ` [U-Boot] " Stephen Warren
2018-09-12  7:09       ` Patrice CHOTARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=af4058ba-fb38-4e16-c454-3be663fce51a@st.com \
    --to=patrice.chotard@st.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.