linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] drivers/pinctrl: Add pinctrl-ast2400
@ 2016-05-06  6:20 Andrew Jeffery
  2016-05-06  6:20 ` Andrew Jeffery
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Jeffery @ 2016-05-06  6:20 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-kernel, linux-gpio, Benjamin Herrenschmidt,
	Milton Miller II, Joel Stanley, Jeremy Kerr

Hi all,

This is a patch partially implementing a pinctrl/pinmux driver for the Aspeed
AST2400 ARM SoC, complementing Joel Stanley's recent series[1] adding the core
support for the chip. With additional integration patches there's enough pinmux
to boot the SoC and configure a number of i2c busses, but not much more.

I'm posting it as an RFC for several reasons:

* This is my first attempt at a pinmux driver (and first significant kernel
  patch) and so I've probably made mistakes and overlooked useful interfaces or
  patterns

* The hardware seems funky and makes things tedious. Configuring a
  mux function often requires writing multiple bits to multiple registers,
  sometimes for each pin in a bus

* I've added a fair bit of commentary to the implementation to explain the
  approach. Likely some of it is considered common knowledge and can be
  stripped out, so thoughts there would be appreciated. Maybe it's too verbose
  and is more confusing than helpful. The datasheet isn't publicly available so
  I went with more-is-better.

* It makes heavy use of macros to "simplify" the pin/function declarations.
  Maybe it's too much of a macro hell. Maybe there's an alternative
  representation that's less dependent on interlinked structures. Maybe more
  should be pushed into devicetree? In any case, I've kernel-doc'ed the
  high-level macros to describe their use.

As mentioned the driver not complete and the patch doesn't integrate it in any
way, the implementation only describes a subset of the functions and pins
available and pinconf isn't yet handled. To be useful in the system I'm testing
against (an OpenPOWER Palmetto BMC) we need more pins configured as GPIO, but I
held off on implementing functionality for all required pins in order to first
get some feedback on the approach.

Cheers,

Andrew

[1] http://www.spinics.net/lists/arm-kernel/msg498895.html

Andrew Jeffery (1):
  drivers/pinctrl: Add pinctrl-ast2400

 drivers/pinctrl/pinctrl-ast2400.c | 1488 +++++++++++++++++++++++++++++++++++++
 1 file changed, 1488 insertions(+)
 create mode 100644 drivers/pinctrl/pinctrl-ast2400.c

-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-26  9:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-06  6:20 [RFC PATCH] drivers/pinctrl: Add pinctrl-ast2400 Andrew Jeffery
2016-05-06  6:20 ` Andrew Jeffery
2016-05-23 12:38   ` Linus Walleij
2016-05-25  5:22     ` Andrew Jeffery
2016-05-26  9:24       ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).