Skip to content

Commit

Permalink
pinctrl: microchip-sgpio: allow sgpio driver to be used as a module
Browse files Browse the repository at this point in the history
As the commit message suggests, this simply adds the ability to select
SGPIO pinctrl as a module. This becomes more practical when the SGPIO
hardware exists on an external chip, controlled indirectly by I2C or SPI.
This commit enables that level of control.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20220905162132.2943088-5-colin.foster@in-advantage.com
  • Loading branch information
Colin Foster authored and Lee Jones committed Sep 9, 2022
1 parent 181f604 commit 2f65923
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion drivers/pinctrl/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ config PINCTRL_MCP23S08
corresponding interrupt-controller.

config PINCTRL_MICROCHIP_SGPIO
bool "Pinctrl driver for Microsemi/Microchip Serial GPIO"
tristate "Pinctrl driver for Microsemi/Microchip Serial GPIO"
depends on OF
depends on HAS_IOMEM
select GPIOLIB
Expand All @@ -310,6 +310,9 @@ config PINCTRL_MICROCHIP_SGPIO
connect control signals from SFP modules and to act as an
LED controller.

If compiled as a module, the module name will be
pinctrl-microchip-sgpio.

config PINCTRL_OCELOT
tristate "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs"
depends on OF
Expand Down
6 changes: 5 additions & 1 deletion drivers/pinctrl/pinctrl-microchip-sgpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ static const struct of_device_id microchip_sgpio_gpio_of_match[] = {
/* sentinel */
}
};
MODULE_DEVICE_TABLE(of, microchip_sgpio_gpio_of_match);

static struct platform_driver microchip_sgpio_pinctrl_driver = {
.driver = {
Expand All @@ -1008,4 +1009,7 @@ static struct platform_driver microchip_sgpio_pinctrl_driver = {
},
.probe = microchip_sgpio_probe,
};
builtin_platform_driver(microchip_sgpio_pinctrl_driver);
module_platform_driver(microchip_sgpio_pinctrl_driver);

MODULE_DESCRIPTION("Microchip SGPIO Pinctrl Driver");
MODULE_LICENSE("GPL");

0 comments on commit 2f65923

Please sign in to comment.