Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 277d14eb authored by Jerome Brunet's avatar Jerome Brunet Committed by Linus Walleij
Browse files

pinctrl: meson: separate soc drivers



When meson pinctrl is enabled, all meson platforms pinctrl drivers are
built in the kernel, with a significant amount of data.

This leads to situation where pinctrl drivers targeting an architecture
are also compiled and shipped on another one (ex: meson8 - ARM - compiled
and shipped on ARM64 builds). This is a waste of memory we can easily
avoid.

This change makes 4 pinctrl drivers (1 per SoC) out the original single
driver, allowing to compile and ship only the ones required.

Reviewed-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Reviewed-by: default avatarKevin Hilman <khilman@baylibre.com>
Signed-off-by: default avatarJerome Brunet <jbrunet@baylibre.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent fbe87498
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -167,16 +167,6 @@ config PINCTRL_MCP23S08
	  This provides a GPIO interface supporting inputs and outputs.
	  The I2C versions of the chips can be used as interrupt-controller.

config PINCTRL_MESON
	bool
	depends on OF
	select PINMUX
	select PINCONF
	select GENERIC_PINCONF
	select GPIOLIB
	select OF_GPIO
	select REGMAP_MMIO

config PINCTRL_OXNAS
	bool
	depends on OF
@@ -369,6 +359,7 @@ source "drivers/pinctrl/uniphier/Kconfig"
source "drivers/pinctrl/vt8500/Kconfig"
source "drivers/pinctrl/mediatek/Kconfig"
source "drivers/pinctrl/zte/Kconfig"
source "drivers/pinctrl/meson/Kconfig"

config PINCTRL_XWAY
	bool
+34 −0
Original line number Diff line number Diff line
menuconfig PINCTRL_MESON
	bool "Amlogic SoC pinctrl drivers"
	depends on ARCH_MESON
	depends on OF
	select PINMUX
	select PINCONF
	select GENERIC_PINCONF
	select GPIOLIB
	select OF_GPIO
	select REGMAP_MMIO

if PINCTRL_MESON

config PINCTRL_MESON8
	bool "Meson 8 SoC pinctrl driver"
	depends on ARM
	default y

config PINCTRL_MESON8B
	bool "Meson 8b SoC pinctrl driver"
	depends on ARM
	default y

config PINCTRL_MESON_GXBB
	bool "Meson gxbb SoC pinctrl driver"
	depends on ARM64
	default y

config PINCTRL_MESON_GXL
	bool "Meson gxl SoC pinctrl driver"
	depends on ARM64
	default y

endif
+5 −3
Original line number Diff line number Diff line
obj-y	+= pinctrl-meson8.o pinctrl-meson8b.o
obj-y	+= pinctrl-meson-gxbb.o pinctrl-meson-gxl.o
obj-y	+= pinctrl-meson.o
obj-$(CONFIG_PINCTRL_MESON) += pinctrl-meson.o
obj-$(CONFIG_PINCTRL_MESON8) += pinctrl-meson8.o
obj-$(CONFIG_PINCTRL_MESON8B) += pinctrl-meson8b.o
obj-$(CONFIG_PINCTRL_MESON_GXBB) += pinctrl-meson-gxbb.o
obj-$(CONFIG_PINCTRL_MESON_GXL) += pinctrl-meson-gxl.o
+23 −2
Original line number Diff line number Diff line
@@ -824,7 +824,7 @@ static struct meson_bank meson_gxbb_aobus_banks[] = {
	BANK("AO",   GPIOAO_0,  GPIOAO_13, 0, 13, 0,  0,  0, 16,  0,  0,  0, 16,  1,  0),
};

struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = {
static struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = {
	.name		= "periphs-banks",
	.pins		= meson_gxbb_periphs_pins,
	.groups		= meson_gxbb_periphs_groups,
@@ -836,7 +836,7 @@ struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = {
	.num_banks	= ARRAY_SIZE(meson_gxbb_periphs_banks),
};

struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = {
static struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = {
	.name		= "aobus-banks",
	.pins		= meson_gxbb_aobus_pins,
	.groups		= meson_gxbb_aobus_groups,
@@ -847,3 +847,24 @@ struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = {
	.num_funcs	= ARRAY_SIZE(meson_gxbb_aobus_functions),
	.num_banks	= ARRAY_SIZE(meson_gxbb_aobus_banks),
};

static const struct of_device_id meson_gxbb_pinctrl_dt_match[] = {
	{
		.compatible = "amlogic,meson-gxbb-periphs-pinctrl",
		.data = &meson_gxbb_periphs_pinctrl_data,
	},
	{
		.compatible = "amlogic,meson-gxbb-aobus-pinctrl",
		.data = &meson_gxbb_aobus_pinctrl_data,
	},
	{ },
};

static struct platform_driver meson_gxbb_pinctrl_driver = {
	.probe		= meson_pinctrl_probe,
	.driver = {
		.name	= "meson-gxbb-pinctrl",
		.of_match_table = meson_gxbb_pinctrl_dt_match,
	},
};
builtin_platform_driver(meson_gxbb_pinctrl_driver);
+23 −2
Original line number Diff line number Diff line
@@ -809,7 +809,7 @@ static struct meson_bank meson_gxl_aobus_banks[] = {
	BANK("AO",   GPIOAO_0,  GPIOAO_9, 0, 9, 0,  0,  0, 16,  0,  0,  0, 16,  1,  0),
};

struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = {
static struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = {
	.name		= "periphs-banks",
	.pins		= meson_gxl_periphs_pins,
	.groups		= meson_gxl_periphs_groups,
@@ -821,7 +821,7 @@ struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = {
	.num_banks	= ARRAY_SIZE(meson_gxl_periphs_banks),
};

struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data = {
static struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data = {
	.name		= "aobus-banks",
	.pins		= meson_gxl_aobus_pins,
	.groups		= meson_gxl_aobus_groups,
@@ -832,3 +832,24 @@ struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data = {
	.num_funcs	= ARRAY_SIZE(meson_gxl_aobus_functions),
	.num_banks	= ARRAY_SIZE(meson_gxl_aobus_banks),
};

static const struct of_device_id meson_gxl_pinctrl_dt_match[] = {
	{
		.compatible = "amlogic,meson-gxl-periphs-pinctrl",
		.data = &meson_gxl_periphs_pinctrl_data,
	},
	{
		.compatible = "amlogic,meson-gxl-aobus-pinctrl",
		.data = &meson_gxl_aobus_pinctrl_data,
	},
	{ },
};

static struct platform_driver meson_gxl_pinctrl_driver = {
	.probe		= meson_pinctrl_probe,
	.driver = {
		.name	= "meson-gxl-pinctrl",
		.of_match_table = meson_gxl_pinctrl_dt_match,
	},
};
builtin_platform_driver(meson_gxl_pinctrl_driver);
Loading