All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/5] mvebu cleanups and preparation for Armada 7k/8k
@ 2017-01-13 11:02 ` Russell King - ARM Linux
  0 siblings, 0 replies; 27+ messages in thread
From: Russell King - ARM Linux @ 2017-01-13 11:02 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Andrew Lunn, Gregory Clement, Jason Cooper, linux-gpio,
	Sebastian Hesselbarth, Thomas Petazzoni, linux-arm-kernel

(Resend including linux-arm-kernel)

This patch series cleans up the mvebu pin controller implementation
such that we can support multiple pin controllers as found in Armada
7k and 8k SoCs.

Currently, in order to do that, we would have to have static variables
and multiple implementations of functions whose only purpose is to
read from the correct static variable.  This is caused by a lack of
driver private data passed into the mvebu pin controller's methods.

Most mvebu pin controllers methods are performing exactly the same
action, so it makes sense to generalise the methods, which in turn
lets us come up with a fairly standardised set of methods.

Another important side effect of these changes is that the structures
with function pointers are now marked const - as they should be in
today's security concious kernel programming environment.

I've included everything except the 7k and 8k drivers, which, before
Thomas went away, he suggested changes to these, so they aren't ready
for submission yet.  However, the rest of the ground work is, and I'd
like users of this code to test it - I don't have all these platforms!

I'm aware of other mvebu SoC support, so I think it's probably a good
idea to get these patches out there and known about, so folk can
consider how they'd like to order merging the changes - obviously new
SoCs with new pinctrl files will need updates somewhere...

The cleanup side of these patches (without the last adding the regmap
support) shows a reduction in code size:

 drivers/pinctrl/mvebu/pinctrl-armada-370.c | 24 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-375.c | 24 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-38x.c | 24 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-39x.c | 24 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-xp.c  | 35 +++--------
 drivers/pinctrl/mvebu/pinctrl-dove.c       | 96 +++++++++++++++++-------------
 drivers/pinctrl/mvebu/pinctrl-kirkwood.c   | 32 +++-------
 drivers/pinctrl/mvebu/pinctrl-mvebu.c      | 77 +++++++++++++++++++++---
 drivers/pinctrl/mvebu/pinctrl-mvebu.h      | 51 +++++++---------
 drivers/pinctrl/mvebu/pinctrl-orion.c      |  8 ++-
 10 files changed, 183 insertions(+), 212 deletions(-)

Adding regmap support increases the code size again:

 drivers/pinctrl/mvebu/pinctrl-armada-370.c |  24 +----
 drivers/pinctrl/mvebu/pinctrl-armada-375.c |  24 +----
 drivers/pinctrl/mvebu/pinctrl-armada-38x.c |  24 +----
 drivers/pinctrl/mvebu/pinctrl-armada-39x.c |  24 +----
 drivers/pinctrl/mvebu/pinctrl-armada-xp.c  |  35 ++------
 drivers/pinctrl/mvebu/pinctrl-dove.c       |  96 +++++++++++---------
 drivers/pinctrl/mvebu/pinctrl-kirkwood.c   |  32 ++-----
 drivers/pinctrl/mvebu/pinctrl-mvebu.c      | 137 +++++++++++++++++++++++++++--
 drivers/pinctrl/mvebu/pinctrl-mvebu.h      |  65 ++++++++------
 drivers/pinctrl/mvebu/pinctrl-orion.c      |   8 +-
 10 files changed, 257 insertions(+), 212 deletions(-)

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 27+ messages in thread
* [PATCH RFC 0/5] mvebu cleanups and preparation for Armada 7k/8k
@ 2017-01-13 10:28 Russell King - ARM Linux
  2017-01-13 10:29 ` [PATCH RFC 1/5] pinctrl: mvebu: constify mvebu_mpp_ctrl structures Russell King
  0 siblings, 1 reply; 27+ messages in thread
From: Russell King - ARM Linux @ 2017-01-13 10:28 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Andrew Lunn, Gregory Clement, Jason Cooper, linux-gpio,
	Sebastian Hesselbarth, Thomas Petazzoni

This patch series cleans up the mvebu pin controller implementation
such that we can support multiple pin controllers as found in Armada
7k and 8k SoCs.

Currently, in order to do that, we would have to have static variables
and multiple implementations of functions whose only purpose is to
read from the correct static variable.  This is caused by a lack of
driver private data passed into the mvebu pin controller's methods.

Most mvebu pin controllers methods are performing exactly the same
action, so it makes sense to generalise the methods, which in turn
lets us come up with a fairly standardised set of methods.

Another important side effect of these changes is that the structures
with function pointers are now marked const - as they should be in
today's security concious kernel programming environment.

I've included everything except the 7k and 8k drivers, which, before
Thomas went away, he suggested changes to these, so they aren't ready
for submission yet.  However, the rest of the ground work is, and I'd
like users of this code to test it - I don't have all these platforms!

I'm aware of other mvebu SoC support, so I think it's probably a good
idea to get these patches out there and known about, so folk can
consider how they'd like to order merging the changes - obviously new
SoCs with new pinctrl files will need updates somewhere...

The cleanup side of these patches (without the last adding the regmap
support) shows a reduction in code size:

 drivers/pinctrl/mvebu/pinctrl-armada-370.c | 24 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-375.c | 24 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-38x.c | 24 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-39x.c | 24 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-xp.c  | 35 +++--------
 drivers/pinctrl/mvebu/pinctrl-dove.c       | 96 +++++++++++++++++-------------
 drivers/pinctrl/mvebu/pinctrl-kirkwood.c   | 32 +++-------
 drivers/pinctrl/mvebu/pinctrl-mvebu.c      | 77 +++++++++++++++++++++---
 drivers/pinctrl/mvebu/pinctrl-mvebu.h      | 51 +++++++---------
 drivers/pinctrl/mvebu/pinctrl-orion.c      |  8 ++-
 10 files changed, 183 insertions(+), 212 deletions(-)

Adding regmap support increases the code size again:

 drivers/pinctrl/mvebu/pinctrl-armada-370.c |  24 +----
 drivers/pinctrl/mvebu/pinctrl-armada-375.c |  24 +----
 drivers/pinctrl/mvebu/pinctrl-armada-38x.c |  24 +----
 drivers/pinctrl/mvebu/pinctrl-armada-39x.c |  24 +----
 drivers/pinctrl/mvebu/pinctrl-armada-xp.c  |  35 ++------
 drivers/pinctrl/mvebu/pinctrl-dove.c       |  96 +++++++++++---------
 drivers/pinctrl/mvebu/pinctrl-kirkwood.c   |  32 ++-----
 drivers/pinctrl/mvebu/pinctrl-mvebu.c      | 137 +++++++++++++++++++++++++++--
 drivers/pinctrl/mvebu/pinctrl-mvebu.h      |  65 ++++++++------
 drivers/pinctrl/mvebu/pinctrl-orion.c      |   8 +-
 10 files changed, 257 insertions(+), 212 deletions(-)

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

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

end of thread, other threads:[~2017-01-18 10:54 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-13 11:02 [PATCH RFC 0/5] mvebu cleanups and preparation for Armada 7k/8k Russell King - ARM Linux
2017-01-13 11:02 ` Russell King - ARM Linux
2017-01-13 11:03 ` [PATCH RFC 1/5] pinctrl: mvebu: constify mvebu_mpp_ctrl structures Russell King
2017-01-13 11:03   ` Russell King
2017-01-18  8:53   ` Linus Walleij
2017-01-18  8:53     ` Linus Walleij
2017-01-13 11:03 ` [PATCH RFC 2/5] pinctrl: mvebu: provide per-control private data Russell King
2017-01-13 11:03   ` Russell King
2017-01-18  8:55   ` Linus Walleij
2017-01-18  8:55     ` Linus Walleij
2017-01-13 11:03 ` [PATCH RFC 3/5] pinctrl: mvebu: provide generic simple mmio-based implementation Russell King
2017-01-13 11:03   ` Russell King
2017-01-13 11:03 ` [PATCH RFC 4/5] pinctrl: mvebu: switch drivers to generic simple mmio Russell King
2017-01-13 11:03   ` Russell King
2017-01-18  8:57   ` Linus Walleij
2017-01-18  8:57     ` Linus Walleij
2017-01-13 11:03 ` [PATCH RFC 5/5] pinctrl: mvebu: add simple regmap based pinctrl implementation Russell King
2017-01-13 11:03   ` Russell King
2017-01-18  8:58   ` Linus Walleij
2017-01-18  8:58     ` Linus Walleij
2017-01-13 11:28 ` [PATCH RFC 0/5] mvebu cleanups and preparation for Armada 7k/8k Russell King - ARM Linux
2017-01-13 11:28   ` Russell King - ARM Linux
2017-01-18  8:52   ` Linus Walleij
2017-01-18  8:52     ` Linus Walleij
2017-01-18 10:54     ` Thomas Petazzoni
2017-01-18 10:54       ` Thomas Petazzoni
  -- strict thread matches above, loose matches on Subject: below --
2017-01-13 10:28 Russell King - ARM Linux
2017-01-13 10:29 ` [PATCH RFC 1/5] pinctrl: mvebu: constify mvebu_mpp_ctrl structures Russell King

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.