From patchwork Wed Sep 11 14:27:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayush Singh X-Patchwork-Id: 13800700 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18BCDEE49BC for ; Wed, 11 Sep 2024 14:37:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oJxb1Dd/nqjN3jOGEzjCvMjgouASIZ/qDf2nqdmTCpQ=; b=as3SUGLNuqEDyZZNvPXEhXo7uO AV8nC+iMTl/7toKo6ZfAztT/G/6/09kFpre57qzH8CyieMHwmX5BeyADUmgMokPymu9abChjT+S3s O+LQv1vQhpx5UMv5v7vCsIw/K3/PinajRThMZ3aH1FKIdxh8LvXsknoUEtcML/EdjGIh7COyd7UpL n4+4TdkyiZ1/hOSJ10/UpXNEBl9hj3plo1RmxQqsOX20f/QlYpSGHm7pgXHLrPNgPETX4dLQqr5GB 4DvpNa4+ljrAoYq/BI5HhUKX+6gUQY7vbkc8iedmrqA+Cyk4hMpbN5KhnzG192i9kLJ2iVibJvg0G f2raCIHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1soOSu-00000009wmg-3ZM4; Wed, 11 Sep 2024 14:37:04 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1soOKN-00000009tyX-0aGo for linux-arm-kernel@lists.infradead.org; Wed, 11 Sep 2024 14:28:16 +0000 Received: by mail-pg1-x543.google.com with SMTP id 41be03b00d2f7-7163489149eso5646591a12.1 for ; Wed, 11 Sep 2024 07:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1726064894; x=1726669694; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=oJxb1Dd/nqjN3jOGEzjCvMjgouASIZ/qDf2nqdmTCpQ=; b=zpI4zwdr0mqfrWG9I8craWijL0VPn6zY8vYKxFzFalsnklIuCTM2ReOTeqUHL4jb8g t8bnMw/RSH0pFamoz1zrFj2+zOteB7CS64GJnBjplqYJd4jzyMkhK12fWJcx8+6WvA6d IBAeAy1i0imXTU1d0WYlxyi9DXnZMbWmSyg5nn2xngyCReHiMwDoCT+agF6vKjEVwTf/ p9rg9aVo/cL9KjN81gxFxksb6bGQZZ3NgyiUinSvs5Lxx9lqObIESPT+45s+dVSzAde7 Aj/JYHpdf7wJLV3gVYDarq6/u2cxojzk/zQtKlda+n08XXfRYZcDUtGVlYQ+XKUyxp1p XWJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726064894; x=1726669694; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oJxb1Dd/nqjN3jOGEzjCvMjgouASIZ/qDf2nqdmTCpQ=; b=IsMe1igJ4NF27JfTep008ucjIvaYYA+G9Jzb7Tg8g+O3TnW5sAgXEO7keNJRINWc/I yQKw1HABYF2IBjLJfj2tiIA31JiuWga4sCW74CPm+fgZt+QfkN6imHLWV7qsBeGCxrSe ODtgsNd1c902CYeokmpcmdu1v8xzOzxSCQedsUujqvKM+GT0Dx8hYt1lCxJOq4cIOvk8 zs3NizsECONKCdrX261hq0r0T3p4mamh1XhMTBabc8dD12kyiyc8/Sw6ZcdfuAvvFfeo BR7TaepfGRWmp69WYzQHHkIWghRXTQGZNs3w27yoQYbpqHwLKIIsKOeEVaHBMEj06f8F e98g== X-Forwarded-Encrypted: i=1; AJvYcCX8XI4jOTIHLyyCjOdQYTTE56LM4ekheL0p6o7jSg8B7GG2OFGDaRc+UMlAjqI5HnbLuMJQXjOfttMAkAZZPdRn@lists.infradead.org X-Gm-Message-State: AOJu0YzWtnD3ebAz8xEuBpmuxKYAxTbIAi+6rOLALfmp+9R/vb58HCV3 U7eKv+akG+NichkDM++ZBgKiT/nl+t88j2KovmbJ3tfiY6z5G2bxKDqD8NckCA== X-Google-Smtp-Source: AGHT+IHE/LplC/CkwydHVCAYEN6XSx/BzJK9oOj9hYZByiPJ0HRu5OTmb9W9Vhmyyzp/B1ZaF4eEjQ== X-Received: by 2002:a05:6a21:2d84:b0:1cf:506f:9d3a with SMTP id adf61e73a8af0-1cf5e1d0c8fmr6113767637.46.1726064893948; Wed, 11 Sep 2024 07:28:13 -0700 (PDT) Received: from [172.16.118.100] ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dadbfe46c9sm10639116a91.11.2024.09.11.07.28.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 07:28:13 -0700 (PDT) From: Ayush Singh Date: Wed, 11 Sep 2024 19:57:20 +0530 Subject: [PATCH 3/8] mikrobus: Add mikrobus driver MIME-Version: 1.0 Message-Id: <20240911-mikrobus-dt-v1-3-3ded4dc879e7@beagleboard.org> References: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> In-Reply-To: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> To: fabien.parent@linaro.org, d-gole@ti.com, lorforlinux@beagleboard.org, jkridner@beagleboard.org, robertcnelson@beagleboard.org, Andrew Davis , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ayush Singh X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3469; i=ayush@beagleboard.org; h=from:subject:message-id; bh=aIC1K2aHkAKySeXczfO9TX+qUogWDRqxMHBmhbZrBWs=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBm4ajWa7wjGCZ2pwHW97n8mcSyzAy8uGIDEWwCe PlMnb28cjuJAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZuGo1gAKCRAFzvXHieVa dGtwD/wK0GDxUstHZk9/X3B2dO3mcSFAHK2I87pzLlM/z9OLe1Oh9Bvxa7pIm/b34irjEaCKPZB 0weGY8nzbMXoshz0VVrhsDP2cgDhQ2+jnn5bhrLdW5fSpjwmncQCiE6SY9UhC7+YSPotD0/Wgvu oe91TYvLZ7hBpbJceOOXCCnQI5bLGsuO1wVGXUmnXLdhfA/7/+Uaa7LG2uiHpziq2blWQLxgWpe NfNfzXIBZ6WxeyIG7es4PMSHV7cNxOeAqvI+N451kdxz4/0lXFQeTP6tuSxiL0GbFC/TUSFchas 3w7XuaEgSQebABxomUtx67jw9V3TRhg31f2Vwp2yr9SaGyL7dzhFQnpy78D0KNitbhicVlpCvxP 4OpAqS+KDs1+6McuHpMavxF1XIoctnOuBgUi4Vd0oIwhxMQkS6EOnbHuhNVo6Mul2A5LW47SVIt 3BC/4tbB/+pglWxsY9H5XkYmU4cAsFp3f5Wk7XbgQLUj0RrkOParX2gY3Yd8Bi/QlsH9lgKE9jr 7Iun31RsKGi/Fv6/yrUUZpIeGjUvzRVXkG0qqCEYpW3wqT5+VkVb6lF6XEhP3zyFxg/VGA995sP +byFalejshGQE4aYErw2Owqwah7UzhA0cTC0TOq9Pk5yK+uve4o2yqDNAdK9Eo30G60g968rdY4 sniJ3PiTe5qhtUg== X-Developer-Key: i=ayush@beagleboard.org; a=openpgp; fpr=DFCC131EF24F2D656FA504D605CEF5C789E55A74 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240911_072815_227345_093ABAE9 X-CRM114-Status: GOOD ( 18.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 S: Maintained F: Documentation/devicetree/bindings/connector/mikrobus-connector.yaml +F: drivers/misc/mikrobus.rs MIKROTIK CRS3XX 98DX3236 BOARD SUPPORT M: Luka Kovacic 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 ", + 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"); + } +}