All of lore.kernel.org
 help / color / mirror / Atom feed
From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: Can one  set GPIO direction in pinmux definition?
Date: Wed, 22 Aug 2012 17:18:16 -0600	[thread overview]
Message-ID: <503568B8.4080501@wwwdotorg.org> (raw)
In-Reply-To: <503558B8.4010603@grid-net.com>

On 08/22/2012 04:10 PM, Subodh Nijsure wrote:
> On 08/22/2012 12:52 PM, Stephen Warren wrote:
>> On 08/22/2012 09:37 AM, Subodh Nijsure wrote:
>>> For a MX28 based hardware I am working with I need to use AUART4
>>>
>>> I need to configure this AUART4 as uart only when necessary and at all
>>> other times pins associated with AUART4 need to be configured as inputs.
>> Out of curiosity, why?
>
> Our hardware is connected to external equipment, electric meter via this
> UART.
> This electricity meter can also be read externally by an optical reader.
> Since this is a shared bus, we can't be sitting on that bus with our
> interface configured as UART as it prevents optical reader from talking
> to the meter. There are ways we can tell is optical meter is connected,
> if we detect that its connected we configure these pins as input else
> configure them for UART functionality.

OK, I guess it was something like that. Can the optical be
plugged/unplugged at run-time, or is it a one-off thing? pinctrl would
be appropriate for runtime. Maybe not so much for one-off detection at
boot-time.

I wonder whether making the UART driver do the switching is the right
thing though. I assume that:

* The UART driver can be used on systems (boards) that never have this
HW configuration, and don't care about this at all.

* The detection of optical meter presence is entirely unrelated to the UART.

So probably, the muxing can be seen as completely external and unrelated
to the UART HW module itself. Would it be better represented as a
completely standalone and custom "RS232 bus mux" node/device instead of
tacking this into the UART driver?

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Subodh Nijsure <snijsure-4jo+YWezP1RWk0Htik3J/w@public.gmane.org>
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Dong Aisheng
	<dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: Can one  set GPIO direction in pinmux definition?
Date: Wed, 22 Aug 2012 17:18:16 -0600	[thread overview]
Message-ID: <503568B8.4080501@wwwdotorg.org> (raw)
In-Reply-To: <503558B8.4010603-4jo+YWezP1RWk0Htik3J/w@public.gmane.org>

On 08/22/2012 04:10 PM, Subodh Nijsure wrote:
> On 08/22/2012 12:52 PM, Stephen Warren wrote:
>> On 08/22/2012 09:37 AM, Subodh Nijsure wrote:
>>> For a MX28 based hardware I am working with I need to use AUART4
>>>
>>> I need to configure this AUART4 as uart only when necessary and at all
>>> other times pins associated with AUART4 need to be configured as inputs.
>> Out of curiosity, why?
>
> Our hardware is connected to external equipment, electric meter via this
> UART.
> This electricity meter can also be read externally by an optical reader.
> Since this is a shared bus, we can't be sitting on that bus with our
> interface configured as UART as it prevents optical reader from talking
> to the meter. There are ways we can tell is optical meter is connected,
> if we detect that its connected we configure these pins as input else
> configure them for UART functionality.

OK, I guess it was something like that. Can the optical be
plugged/unplugged at run-time, or is it a one-off thing? pinctrl would
be appropriate for runtime. Maybe not so much for one-off detection at
boot-time.

I wonder whether making the UART driver do the switching is the right
thing though. I assume that:

* The UART driver can be used on systems (boards) that never have this
HW configuration, and don't care about this at all.

* The detection of optical meter presence is entirely unrelated to the UART.

So probably, the muxing can be seen as completely external and unrelated
to the UART HW module itself. Would it be better represented as a
completely standalone and custom "RS232 bus mux" node/device instead of
tacking this into the UART driver?

  reply	other threads:[~2012-08-22 23:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 15:37 Can one set GPIO direction in pinmux definition? Subodh Nijsure
2012-08-22 15:37 ` Subodh Nijsure
2012-08-22 19:52 ` Stephen Warren
2012-08-22 19:52   ` Stephen Warren
2012-08-22 22:10   ` Subodh Nijsure
2012-08-22 22:10     ` Subodh Nijsure
2012-08-22 23:18     ` Stephen Warren [this message]
2012-08-22 23:18       ` Stephen Warren
2012-08-23  1:32     ` Shawn Guo
2012-08-23  1:32       ` Shawn Guo
2012-08-23  0:17 ` Matt Sealey
2012-08-23  0:17   ` Matt Sealey

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=503568B8.4080501@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.