From patchwork Sun Mar 17 19:37:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayush Singh X-Patchwork-Id: 13594825 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 4CBC0C54E67 for ; Sun, 17 Mar 2024 19:38:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Yki4jy4HOYv2+zZ2XYjkIpKAZud+Q6Lj3xBf37alfLo=; b=JK2OqLh1l+3a6Z gKtst7Jyq+2Fi9mWDhNWWtMIpAhLhuM4LdBdJsbEmlCzPuEd8x9ktBVqGXFMI/9a4WyF9K5xce/1/ CI534694LfVNXyy/KHLUMe18/1d65lOurKcuTBugVphqdhYxHrJ+V3TQ2zm5XDUVhEHbElbYRLDYg +/BQ5xjRXJzzv+C+KvhSApMFD9gcFWUsmTjEbXBHi5mJ9l5T/vl9cwYIWZhE4DDxSXGF7roBU4y1U XxDq18NRTVQG9YiQR060NomBJdu9fSPmloqK71+ethRu2e5cgn2kQ93f88isowetw0HX4LZSB8wdQ +TqpLMmTKV48K8/Da3uA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rlwKe-00000006Dy6-0UhK; Sun, 17 Mar 2024 19:38:08 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rlwKa-00000006DxX-25eR for linux-arm-kernel@lists.infradead.org; Sun, 17 Mar 2024 19:38:06 +0000 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6e6b3dc3564so3088065b3a.2 for ; Sun, 17 Mar 2024 12:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710704282; x=1711309082; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hOuQoK+aCpD9BndP2a56795Q5pkcrTD7MkJhQYgQRRE=; b=iWoWjt5aayhqAqLhXcOJ3PYA91Su3ML52nnIrp0QAg4g5E2POiu9Z1lylsroR2OybE 9gEoRCRaWXcQ3UqV+7zT/bBQFeoSGbza16mvtJFaBjP/Bzh4MI9F2C29jxmjTahGZTDs eb5vh/AJwkg+RUZOSW1rGO7rNP0xM5+rHylEY0B1g4q+lqNbf3bUvuZMcuSFHg6ZfkkK JG2yHerrgkmDHWgK9XjUF4wll5yxheJMePSh7g87ojpQUgTTT2MjGAIJX3fy2EsUPfkj gvfzfD8boyOTvdjI6SJLlda9GkcM+gDyioaW7PuHnP6xtyVZ38/vtTPDlv7q6tEh44OP G4uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710704282; x=1711309082; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hOuQoK+aCpD9BndP2a56795Q5pkcrTD7MkJhQYgQRRE=; b=TQ2PuQ4qV8eYYk45xFVqj41xqiEpE7NABQmgE5aMnxV3O57YQO6J9X4kwMJrtrofAm SUsgDWOtuB0ZzY5iPvoL7XdTZnffGgp98ass3W+ktmIAKsF07xZM3kxOYLzawI53i159 6GqESve80nQP/JfxqaAkGLAMwqZOka3x4pYY3S6bS2VJf4do1YYY0wOnNAjoR4QKaed8 uFtwDeIyEEwKh4JgCpfBdqwBa+G2Jw3fuJUlemqaBR92EDsUlbqTAfme1wbE/56I6uPf F+c0qSRK64Zs7T/vLHc49Mg8UGHK+KL+qLPCC5yYit4guDqCUnlumazHU7PRdH94D1Js vFxw== X-Forwarded-Encrypted: i=1; AJvYcCUn49Ayj5T+QFZ0ncXXrbGr6cfak6O3GWamNTHrxCMl2SSr5MndSk2sku1U7HkzjNBCIP2jNSmR67Y0pEENrs7pCJMJQhnzETU4Kk5mDYVZBovT53E= X-Gm-Message-State: AOJu0YxH33DddNX9Ut7MPMEBjvULKCHz0+9YcdTT4K3yS1dZ/F6B/MAY iBdD06GA44OmSEnZre6suZSiHyWavpVwHKbLrW0ETf7vpZxn2bks X-Google-Smtp-Source: AGHT+IF36PtWXGUyktoxAgcK72f91CpSjqHRlGCFk/zUs9CV8FTiGRE9UbHnhk653DcJjP0P++a9rA== X-Received: by 2002:a05:6a21:3945:b0:1a3:5f13:e43d with SMTP id ac5-20020a056a21394500b001a35f13e43dmr2179598pzc.25.1710704281676; Sun, 17 Mar 2024 12:38:01 -0700 (PDT) Received: from toolbox.iitism.net ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id st6-20020a17090b1fc600b0029bbdc920besm6125995pjb.44.2024.03.17.12.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 12:38:01 -0700 (PDT) From: Ayush Singh To: linux-kernel@vger.kernel.org (open list) Cc: Ayush Singh , jkridner@beagleboard.org, robertcnelson@beagleboard.org, lorforlinux@beagleboard.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Vaishnav M A , Mark Brown , Johan Hovold , Alex Elder , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/TEXAS INSTRUMENTS K3 ARCHITECTURE), linux-spi@vger.kernel.org (open list:SPI SUBSYSTEM), greybus-dev@lists.linaro.org (moderated list:GREYBUS SUBSYSTEM) Subject: [PATCH v4 0/5] misc: Add mikroBUS driver Date: Mon, 18 Mar 2024 01:07:08 +0530 Message-ID: <20240317193714.403132-1-ayushdevel1325@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240317_123804_819164_DE8A0195 X-CRM114-Status: GOOD ( 15.64 ) 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 MikroBUS is an open standard developed by MikroElektronika for connecting add-on boards to microcontrollers or microprocessors. It essentially allows you to easily expand the functionality of your main boards using these add-on boards. This patchset adds mikroBUS as a Linux bus type and provides a driver to parse and register the mikroBUS board using mikroBUS manifest. The patchset is based on work originally done by Vaishnav. Link: https://www.mikroe.com/mikrobus Link: https://docs.beagleboard.org/latest/boards/beagleplay/ Link: https://lore.kernel.org/lkml/20240315184908.500352-1-ayushdevel1325@gmail.com/ Patch v3 Changes v4: - Better commit messages - Remove clickID, serdev, pwm, regulator, clocks etc. Just the basic mikroBUS driver. - Fix a lot of memory leaks, unused variables, etc. - Create accompanying PR in Greybus Spec repository - Switch to 80 columns formatting - Some other fixes pointed out in v3 Changes in v3: - Use phandle instead of busname for spi - Use spi board info for registering new device - Convert dt bindings to yaml - Add support for clickID - Code cleanup and style changes - Additions required to spi, serdev, w1 and regulator subsystems Changes in v2: - support for adding mikroBUS ports from DT overlays, - remove debug sysFS interface for adding mikrobus ports, - consider extended pin usage/deviations from mikrobus standard specifications - use greybus CPort protocol enum instead of new protocol enums - Fix cases of wrong indentation, ignoring return values, freeing allocated resources in case of errors and other style suggestions in v1 review. Ayush Singh (5): dt-bindings: misc: Add mikrobus-connector spi: Make of_find_spi_controller_by_node() available greybus: Add mikroBUS manifest types mikrobus: Add mikroBUS driver dts: ti: k3-am625-beagleplay: Add mikroBUS .../connector/mikrobus-connector.yaml | 113 +++ MAINTAINERS | 7 + .../arm64/boot/dts/ti/k3-am625-beagleplay.dts | 80 +- drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/mikrobus/Kconfig | 15 + drivers/misc/mikrobus/Makefile | 5 + drivers/misc/mikrobus/mikrobus_core.c | 696 ++++++++++++++++++ drivers/misc/mikrobus/mikrobus_core.h | 151 ++++ drivers/misc/mikrobus/mikrobus_manifest.c | 503 +++++++++++++ drivers/misc/mikrobus/mikrobus_manifest.h | 29 + drivers/spi/spi.c | 206 +++--- include/linux/greybus/greybus_manifest.h | 49 ++ include/linux/spi/spi.h | 4 + 14 files changed, 1750 insertions(+), 110 deletions(-) create mode 100644 Documentation/devicetree/bindings/connector/mikrobus-connector.yaml create mode 100644 drivers/misc/mikrobus/Kconfig create mode 100644 drivers/misc/mikrobus/Makefile create mode 100644 drivers/misc/mikrobus/mikrobus_core.c create mode 100644 drivers/misc/mikrobus/mikrobus_core.h create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.c create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.h base-commit: 61996c073c9b070922ad3a36c981ca6ddbea19a5