From patchwork Thu Oct 12 12:40:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 115625 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp1893521qgn; Thu, 12 Oct 2017 05:41:05 -0700 (PDT) X-Received: by 10.159.218.67 with SMTP id x3mr135692plv.336.1507812065538; Thu, 12 Oct 2017 05:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507812065; cv=none; d=google.com; s=arc-20160816; b=eNz3pbZf0ayNOd6IM01QzYvRI3B6JY86kHTcAyZ/yMJdDwKdNdpxaeQvSlwLajRzjv xBt5rbqs8gQAIRtEHzI3YEj9bupLsAm7tQ+R17UPRuK11HuH5bF+lUjwMhJWaRypizBF 7Y6C7Csu226PUK7Mojc6EQRZa4ZMYc0FEljwO1d0sKWY/lBGOsx6WiL1UIN+F9F38i3Y i8kDRzZ2fQE7ek4A7xA8aff3H02bzW+TgFnewltEXUQ4hrGF7Tc+41IlDKFEScnloVRj W7QLKy6w07TNLvfxDxEHuuy2xwt8LRKqEJfRHzk4C2O/GLzAJhbXdJdTRm9+tcetSkog cKwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=APenANja4SCTQMHOUk7NY4JP0T2wuD1zR+35LvNEIQc=; b=PnBwygkM/NBTmIRA+ir6QGue6u0h7wKvsV9SlkGHZX5u+UK15lOAt7L8CuRVG896mB gFwoMo2OSBZ/ilrirebx80V77F0DyPvIdjD0B6gRdRrgjv7/FNebRifT8Bhp3Uk7g06/ dXh3bU4nT1FnsIeLQ4eKh5XEin5Yel3JE+7tCNVBaqrdNIVLJ5ZbFNRlCBqbh8G3gD6t PAe3A4Jn8R4YfNOZbRSl/vAtP0oFG/74cG7lGb4rmXyyrwK1+Fk/UJ3Yy/ur4/ze4fmH jyfFzK4wzUzNoUf24wE4Z8SkSvjMZjaF7PUCqtY+jqRrEYQCS/BXbktzXtEH7DbrHCBI XliQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=zgfDSl2O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j30si11642323pga.620.2017.10.12.05.41.05; Thu, 12 Oct 2017 05:41:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=zgfDSl2O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755716AbdJLMlD (ORCPT + 27 others); Thu, 12 Oct 2017 08:41:03 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:48788 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751921AbdJLMkf (ORCPT ); Thu, 12 Oct 2017 08:40:35 -0400 Received: by mail-wm0-f47.google.com with SMTP id i124so12724206wmf.3 for ; Thu, 12 Oct 2017 05:40:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=APenANja4SCTQMHOUk7NY4JP0T2wuD1zR+35LvNEIQc=; b=zgfDSl2OUe8zTY8wO9773a0+JH5J4ZjNzVR6TwSnzXSb47yNrUU2PVVhLv2n1YzMT1 kjNVNYboUEkDyUuyFNMw+j+7fgQIJ/6U1EifTi8jIozcpa3qRsuuaCjEdgedt8uppFDs NWmwLIYfYF421R0NDjt6le4yo0ciOMN5+OgZytmXB3/duqbZe9LqdmP4mQ+NkBRdSAd4 jdJHlxVRQ0Gady/YkBjqDyVOGRP7QCR1lJyGtWq3nIpB3qRtlHOTe3Ng1yqrflLtSfcB kis3V7rrdMUooz9T+5griJGN36Zp+sQyCCcqtC8SVjTmcwqH+/DJFKgA7Z9KzCo8KcRV 97Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=APenANja4SCTQMHOUk7NY4JP0T2wuD1zR+35LvNEIQc=; b=qSSQBGM569BCHFitOIh+YZ/UmQw8N9EnHJGdx737UYbm1mmOQl0fGVPJe7OxZ/F0og J60sS9HrYG8mKdkBhQCZN0V7Romna5sv7l9LUHYlpwwNdjFU1OXnaFTKZ2dZnQe2x6zp WLr7zrL5nZZ8xNjhICj7L0roLnnzzUc5tghG2Z9aA1Kv7QyIALf/kpnFwqDJ28EMZ2wz NLvQLqanYeekmLu9U80ISFwOcd/H1/Rq5gNLcLdpPZXSkuja6buBBB6l/FLpTlWK8O04 +xkRrsCeu4zEGJzsCDG5/HSVmp0uWxAGk96W3vP8TGhvXvjPIVQjmI5pUF23qbX4mUKj 2xJA== X-Gm-Message-State: AMCzsaUxkuAryw4mp5t3CWf3yaYLSXgQxPtpKIPd/JFVz7ow8oLlHiEf aibozXjcriROPaX4nL6cmLVkwEMt X-Google-Smtp-Source: AOwi7QAp3nlt70jpLAnzWMwP9VFTCM/IFrPt8SJF+6MK/+pqnyxzYTB5OstvNzzNIl6U+iCnDWtm4Q== X-Received: by 10.223.148.162 with SMTP id 31mr2265773wrr.149.1507812033881; Thu, 12 Oct 2017 05:40:33 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id y29sm9203245wrd.3.2017.10.12.05.40.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Oct 2017 05:40:33 -0700 (PDT) From: Jerome Brunet To: Linus Walleij , Kevin Hilman , Carlo Caione Cc: Jerome Brunet , linux-gpio@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] pinctrl: meson: separate soc drivers Date: Thu, 12 Oct 2017 14:40:25 +0200 Message-Id: <20171012124026.2111-2-jbrunet@baylibre.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171012124026.2111-1-jbrunet@baylibre.com> References: <20171012124026.2111-1-jbrunet@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Neil Armstrong Reviewed-by: Kevin Hilman Signed-off-by: Jerome Brunet --- drivers/pinctrl/Kconfig | 11 +----- drivers/pinctrl/meson/Kconfig | 34 +++++++++++++++++++ drivers/pinctrl/meson/Makefile | 8 +++-- drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 25 ++++++++++++-- drivers/pinctrl/meson/pinctrl-meson-gxl.c | 25 ++++++++++++-- drivers/pinctrl/meson/pinctrl-meson.c | 54 +++--------------------------- drivers/pinctrl/meson/pinctrl-meson.h | 11 ++---- drivers/pinctrl/meson/pinctrl-meson8.c | 25 ++++++++++++-- drivers/pinctrl/meson/pinctrl-meson8b.c | 25 ++++++++++++-- 9 files changed, 139 insertions(+), 79 deletions(-) create mode 100644 drivers/pinctrl/meson/Kconfig -- 2.13.6 diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 034822c7144d..c0294958405d 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -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 diff --git a/drivers/pinctrl/meson/Kconfig b/drivers/pinctrl/meson/Kconfig new file mode 100644 index 000000000000..2795a31eb04a --- /dev/null +++ b/drivers/pinctrl/meson/Kconfig @@ -0,0 +1,34 @@ +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 diff --git a/drivers/pinctrl/meson/Makefile b/drivers/pinctrl/meson/Makefile index 27c5b5126008..dc3b73f8039a 100644 --- a/drivers/pinctrl/meson/Makefile +++ b/drivers/pinctrl/meson/Makefile @@ -1,3 +1,5 @@ -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 diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c index 1881d4a0eca2..a87bdb17414b 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c +++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c @@ -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); diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c index 3a14ecae9f31..088ac94f76b0 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c +++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c @@ -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); diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c index 71bccb7acbf8..525e8b17d471 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.c +++ b/drivers/pinctrl/meson/pinctrl-meson.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -481,42 +482,6 @@ static int meson_gpio_get(struct gpio_chip *chip, unsigned gpio) return !!(val & BIT(bit)); } -static const struct of_device_id meson_pinctrl_dt_match[] = { - { - .compatible = "amlogic,meson8-cbus-pinctrl", - .data = &meson8_cbus_pinctrl_data, - }, - { - .compatible = "amlogic,meson8b-cbus-pinctrl", - .data = &meson8b_cbus_pinctrl_data, - }, - { - .compatible = "amlogic,meson8-aobus-pinctrl", - .data = &meson8_aobus_pinctrl_data, - }, - { - .compatible = "amlogic,meson8b-aobus-pinctrl", - .data = &meson8b_aobus_pinctrl_data, - }, - { - .compatible = "amlogic,meson-gxbb-periphs-pinctrl", - .data = &meson_gxbb_periphs_pinctrl_data, - }, - { - .compatible = "amlogic,meson-gxbb-aobus-pinctrl", - .data = &meson_gxbb_aobus_pinctrl_data, - }, - { - .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 int meson_gpiolib_register(struct meson_pinctrl *pc) { int ret; @@ -624,9 +589,8 @@ static int meson_pinctrl_parse_dt(struct meson_pinctrl *pc, return 0; } -static int meson_pinctrl_probe(struct platform_device *pdev) +int meson_pinctrl_probe(struct platform_device *pdev) { - const struct of_device_id *match; struct device *dev = &pdev->dev; struct meson_pinctrl *pc; int ret; @@ -636,10 +600,9 @@ static int meson_pinctrl_probe(struct platform_device *pdev) return -ENOMEM; pc->dev = dev; - match = of_match_node(meson_pinctrl_dt_match, pdev->dev.of_node); - pc->data = (struct meson_pinctrl_data *) match->data; + pc->data = (struct meson_pinctrl_data *) of_device_get_match_data(dev); - ret = meson_pinctrl_parse_dt(pc, pdev->dev.of_node); + ret = meson_pinctrl_parse_dt(pc, dev->of_node); if (ret) return ret; @@ -659,12 +622,3 @@ static int meson_pinctrl_probe(struct platform_device *pdev) return meson_gpiolib_register(pc); } - -static struct platform_driver meson_pinctrl_driver = { - .probe = meson_pinctrl_probe, - .driver = { - .name = "meson-pinctrl", - .of_match_table = meson_pinctrl_dt_match, - }, -}; -builtin_platform_driver(meson_pinctrl_driver); diff --git a/drivers/pinctrl/meson/pinctrl-meson.h b/drivers/pinctrl/meson/pinctrl-meson.h index 7ed0a80fd9dc..284157d43612 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.h +++ b/drivers/pinctrl/meson/pinctrl-meson.h @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -165,11 +166,5 @@ struct meson_pinctrl { #define MESON_PIN(x) PINCTRL_PIN(x, #x) -extern struct meson_pinctrl_data meson8_cbus_pinctrl_data; -extern struct meson_pinctrl_data meson8_aobus_pinctrl_data; -extern struct meson_pinctrl_data meson8b_cbus_pinctrl_data; -extern struct meson_pinctrl_data meson8b_aobus_pinctrl_data; -extern struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data; -extern struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data; -extern struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data; -extern struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data; +/* Common probe function */ +int meson_pinctrl_probe(struct platform_device *pdev); diff --git a/drivers/pinctrl/meson/pinctrl-meson8.c b/drivers/pinctrl/meson/pinctrl-meson8.c index fbf8ecd1c2b6..68b345fc105a 100644 --- a/drivers/pinctrl/meson/pinctrl-meson8.c +++ b/drivers/pinctrl/meson/pinctrl-meson8.c @@ -1044,7 +1044,7 @@ static struct meson_bank meson8_aobus_banks[] = { BANK("AO", GPIOAO_0, GPIO_TEST_N, 0, 13, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), }; -struct meson_pinctrl_data meson8_cbus_pinctrl_data = { +static struct meson_pinctrl_data meson8_cbus_pinctrl_data = { .name = "cbus-banks", .pins = meson8_cbus_pins, .groups = meson8_cbus_groups, @@ -1056,7 +1056,7 @@ struct meson_pinctrl_data meson8_cbus_pinctrl_data = { .num_banks = ARRAY_SIZE(meson8_cbus_banks), }; -struct meson_pinctrl_data meson8_aobus_pinctrl_data = { +static struct meson_pinctrl_data meson8_aobus_pinctrl_data = { .name = "ao-bank", .pins = meson8_aobus_pins, .groups = meson8_aobus_groups, @@ -1067,3 +1067,24 @@ struct meson_pinctrl_data meson8_aobus_pinctrl_data = { .num_funcs = ARRAY_SIZE(meson8_aobus_functions), .num_banks = ARRAY_SIZE(meson8_aobus_banks), }; + +static const struct of_device_id meson8_pinctrl_dt_match[] = { + { + .compatible = "amlogic,meson8-cbus-pinctrl", + .data = &meson8_cbus_pinctrl_data, + }, + { + .compatible = "amlogic,meson8-aobus-pinctrl", + .data = &meson8_aobus_pinctrl_data, + }, + { }, +}; + +static struct platform_driver meson8_pinctrl_driver = { + .probe = meson_pinctrl_probe, + .driver = { + .name = "meson8-pinctrl", + .of_match_table = meson8_pinctrl_dt_match, + }, +}; +builtin_platform_driver(meson8_pinctrl_driver); diff --git a/drivers/pinctrl/meson/pinctrl-meson8b.c b/drivers/pinctrl/meson/pinctrl-meson8b.c index 7af296db48c8..4d61df09bc3f 100644 --- a/drivers/pinctrl/meson/pinctrl-meson8b.c +++ b/drivers/pinctrl/meson/pinctrl-meson8b.c @@ -904,7 +904,7 @@ static struct meson_bank meson8b_aobus_banks[] = { BANK("AO", GPIOAO_0, GPIO_TEST_N, 0, 13, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), }; -struct meson_pinctrl_data meson8b_cbus_pinctrl_data = { +static struct meson_pinctrl_data meson8b_cbus_pinctrl_data = { .name = "cbus-banks", .pins = meson8b_cbus_pins, .groups = meson8b_cbus_groups, @@ -916,7 +916,7 @@ struct meson_pinctrl_data meson8b_cbus_pinctrl_data = { .num_banks = ARRAY_SIZE(meson8b_cbus_banks), }; -struct meson_pinctrl_data meson8b_aobus_pinctrl_data = { +static struct meson_pinctrl_data meson8b_aobus_pinctrl_data = { .name = "aobus-banks", .pins = meson8b_aobus_pins, .groups = meson8b_aobus_groups, @@ -927,3 +927,24 @@ struct meson_pinctrl_data meson8b_aobus_pinctrl_data = { .num_funcs = ARRAY_SIZE(meson8b_aobus_functions), .num_banks = ARRAY_SIZE(meson8b_aobus_banks), }; + +static const struct of_device_id meson8b_pinctrl_dt_match[] = { + { + .compatible = "amlogic,meson8b-cbus-pinctrl", + .data = &meson8b_cbus_pinctrl_data, + }, + { + .compatible = "amlogic,meson8b-aobus-pinctrl", + .data = &meson8b_aobus_pinctrl_data, + }, + { }, +}; + +static struct platform_driver meson8b_pinctrl_driver = { + .probe = meson_pinctrl_probe, + .driver = { + .name = "meson8b-pinctrl", + .of_match_table = meson8b_pinctrl_dt_match, + }, +}; +builtin_platform_driver(meson8b_pinctrl_driver);