linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 pinctrl-next 0/1] add blink and activity functions to SGPIO
@ 2021-12-29  0:37 Colin Foster
  2021-12-29  0:37 ` [PATCH v1 pinctrl-next 1/1] pinctrl: microchip-sgpio: add activity and blink functionality Colin Foster
  2021-12-29  9:30 ` [PATCH v1 pinctrl-next 0/1] add blink and activity functions to SGPIO Andrew Lunn
  0 siblings, 2 replies; 4+ messages in thread
From: Colin Foster @ 2021-12-29  0:37 UTC (permalink / raw)
  To: linux-kernel, linux-gpio, linux-arm-kernel
  Cc: Linus Walleij, UNGLinuxDriver, Steen Hegelund, Lars Povlsen

Expose a debugfs / devicetree interface for Microsemi SGPIO controllers.
By writing values of 2-5, the SGPIO pins can be configured for either
automatic blinking or activity.

The implementation is modeled after the code in
/drivers/pinctrl/pinctrl-ocelot.c.

I have only tested this with currently out-of-tree patches for the
VSC7512 that I hope to get in soon. They are not needed for VSC7513 /
VSC7514, SPARX5, or LUTON - but I don't have any hardware to test.

Of note: the 7512 chip has a discrepancy between the datasheet and the
registers. The datahseet claims 20Hz blink default frequency, the
registers claim 5 Hz default frequency for BMODE_0. I override the
OCELOT registers to correct for this. I don't know if that is needed for
LUTON or SPARX, but having two blink modes at the same frequency isn't
beneficial. As such, I make the blink modes match the 5Hz / 20Hz for the
two modes.

Tested with VSC7512 by way of:
echo SGPIO_O_p1b0 {blink0,blink1,activity0,activity1} > 
/sys/kernel/debug/pinctrl/pinctrl-sgpio-pinctrl-sgpio-output/pinmux-select

LEDs blink!


Colin Foster (1):
  pinctrl: microchip-sgpio: add activity and blink functionality

 drivers/pinctrl/pinctrl-microchip-sgpio.c | 135 +++++++++++++++++++++-
 1 file changed, 130 insertions(+), 5 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2021-12-29 19:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-29  0:37 [PATCH v1 pinctrl-next 0/1] add blink and activity functions to SGPIO Colin Foster
2021-12-29  0:37 ` [PATCH v1 pinctrl-next 1/1] pinctrl: microchip-sgpio: add activity and blink functionality Colin Foster
2021-12-29  9:30 ` [PATCH v1 pinctrl-next 0/1] add blink and activity functions to SGPIO Andrew Lunn
2021-12-29 19:08   ` Colin Foster

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).