[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240911-mikrobus-dt-v1-3-3ded4dc879e7@beagleboard.org>
Date: Wed, 11 Sep 2024 19:57:20 +0530
From: Ayush Singh <ayush@...gleboard.org>
To: fabien.parent@...aro.org, d-gole@...com, lorforlinux@...gleboard.org,
jkridner@...gleboard.org, robertcnelson@...gleboard.org,
Andrew Davis <afd@...com>, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Derek Kiernan <derek.kiernan@....com>,
Dragan Cvetic <dragan.cvetic@....com>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Nishanth Menon <nm@...com>,
Vignesh Raghavendra <vigneshr@...com>, Tero Kristo <kristo@...nel.org>
Cc: linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
Ayush Singh <ayush@...gleboard.org>
Subject: [PATCH 3/8] mikrobus: Add mikrobus driver
A simple platform driver for now that does nothing. This is required
because without a platform driver, the mikrobus_gpio0 nexus node cannot
be used.
In future, this driver will also allow for dynamic board detection using
1-wire eeprom in new mikrobus boards.
Signed-off-by: Ayush Singh <ayush@...gleboard.org>
---
MAINTAINERS | 1 +
drivers/misc/Kconfig | 17 +++++++++++++++++
drivers/misc/Makefile | 1 +
drivers/misc/mikrobus.rs | 32 ++++++++++++++++++++++++++++++++
4 files changed, 51 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 0cc27446b18a..d0c18bd7b558 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15433,6 +15433,7 @@ MIKROBUS CONNECTOR
M: Ayush Singh <ayush@...gleboard.org>
S: Maintained
F: Documentation/devicetree/bindings/connector/mikrobus-connector.yaml
+F: drivers/misc/mikrobus.rs
MIKROTIK CRS3XX 98DX3236 BOARD SUPPORT
M: Luka Kovacic <luka.kovacic@...tura.hr>
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 3fe7e2a9bd29..30defb522e98 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -610,6 +610,23 @@ config MARVELL_CN10K_DPI
To compile this driver as a module, choose M here: the module
will be called mrvl_cn10k_dpi.
+menuconfig MIKROBUS
+ tristate "Module for instantiating devices on mikroBUS ports"
+ help
+ This option enables the mikroBUS driver. mikroBUS is an add-on
+ board socket standard that offers maximum expandability with
+ the smallest number of pins. The mikroBUS driver instantiates
+ devices on a mikroBUS port described by identifying data present
+ in an add-on board resident EEPROM, more details on the mikroBUS
+ driver support and discussion can be found in this eLinux wiki :
+ elinux.org/Mikrobus
+
+
+ Say Y here to enable support for this driver.
+
+ To compile this code as a module, chose M here: the module
+ will be called mikrobus.ko
+
source "drivers/misc/c2port/Kconfig"
source "drivers/misc/eeprom/Kconfig"
source "drivers/misc/cb710/Kconfig"
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index a9f94525e181..86ea188e3cf9 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -72,3 +72,4 @@ obj-$(CONFIG_TPS6594_PFSM) += tps6594-pfsm.o
obj-$(CONFIG_NSM) += nsm.o
obj-$(CONFIG_MARVELL_CN10K_DPI) += mrvl_cn10k_dpi.o
obj-y += keba/
+obj-$(CONFIG_MIKROBUS) += mikrobus.o
diff --git a/drivers/misc/mikrobus.rs b/drivers/misc/mikrobus.rs
new file mode 100644
index 000000000000..a52268efd71b
--- /dev/null
+++ b/drivers/misc/mikrobus.rs
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0
+
+//! MikroBUS driver
+
+use kernel::c_str;
+use kernel::platform::{self, DeviceId};
+use kernel::prelude::*;
+
+kernel::module_platform_driver! {
+ driver: MikrobusDriver,
+ of_table: [DeviceId::new(c_str!("mikrobus-connector"))],
+ name: "mikrobus",
+ author: "Ayush Singh <ayush@...gleboard.org>",
+ description: "MikroBUS connector Driver",
+ license: "GPL",
+}
+
+struct MikrobusDriver;
+
+#[vtable]
+impl platform::Driver for MikrobusDriver {
+ const NAME: &'static CStr = c_str!("MikroBUS");
+
+ fn probe(_dev: &mut platform::Device) -> Result {
+ pr_debug!("Mikrobus Driver (probe)\n");
+ Ok(())
+ }
+
+ fn remove(_dev: &mut platform::Device) {
+ pr_debug!("Mikrobus Driver (remove)\n");
+ }
+}
--
2.46.0
Powered by blists - more mailing lists