From patchwork Thu Jun 27 16:26:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayush Singh X-Patchwork-Id: 13714796 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 BAB48C30653 for ; Thu, 27 Jun 2024 16:29:07 +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: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: 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=WUpdxD/vt8vb3o0iHNh6vpn1Bo9wZjlrsPnUUEvSog8=; b=4gJhsI0nsd+8iC hOPTxmDS+HBWp1jmXi9pukWSOhbv3badXNmtBswQApgztVPH9NJnnHocLvln17WWfxoc3sgPpwyqG 6vEni5rwc6/k1CkFfUi3L3TcNIaMJZZ7ein45FrIOuSRQOTchNovdgrJcVzoQd9uXy+GT5zp4G9wF oR7t5OaGwi8vTLfjYwuURwnlvLNMe3iUB4BHapfHZ7/huf24qDEttogdVaI9PCdRkuFXRmQEBqOGM XfyUVZHAT6cdejVFKjanavEr8Qor1DiSQkuPq81SALCISuUWOQ7xC/7ip0WLCH8q3ZWq0OxqoixDU U05JCGOCwMlr14a/GiQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMrzV-0000000B2eS-0ldL; Thu, 27 Jun 2024 16:28:57 +0000 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMrzM-0000000B2co-1zuB for linux-arm-kernel@lists.infradead.org; Thu, 27 Jun 2024 16:28:50 +0000 Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-7f3d2f12d26so6024639f.1 for ; Thu, 27 Jun 2024 09:28:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1719505727; x=1720110527; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=WUpdxD/vt8vb3o0iHNh6vpn1Bo9wZjlrsPnUUEvSog8=; b=wx/Zd3yB36CoNOTXzsgtBwpeNMrFasgKXVpoqBVLI7HKYzKakV1pi6PdPHpawmrn8x qeIjZkaMh60CV6GdkUHBpruLuAxxQnUhple8QF1DuC4YCEYNPW8+42rnuhRbH9eeZXrE ngjfio0DpWM09V1YSgw5q1gnPLW2zmQO2a1LA7ZkAbDYUpHKU+SzE29V5xhO3IV268Iv 4V4YCFzZxdrKiu5Rn/qCsA2S+szEDntRkEyHydlo1vsUIaBVBK2T47NnciVBcgLSybJt 73hbRd6nnnKWf35qI5+0N8VMK+FLokfaZLjmronLjwbBe3sFeAHyLLdPMhG/nyHrJ36o FFeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719505727; x=1720110527; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WUpdxD/vt8vb3o0iHNh6vpn1Bo9wZjlrsPnUUEvSog8=; b=aKZXxTxBNAttqyHyDzMSC/3QNQj8AJLWCcDaffur2JRDYQSGYxKBYtzZipCFw9E1VP ItTan/fJu+F5VXjYInGaw31GzcBbJEuPYSGV37Cl3lwKnR1yb3ktRopbsSspeILlQ/ZW cd9T1oUopRsvjlpQGIMlxlcFNcxE1IOBUiRfeCMpWZ4Uqv4bLM6/XyND9l4gD4mgN90w 8xGGPkSA2Q5MYFObOKPuzq3el3N5ZjfmbT1S/0H6qUyQyFqsilDTDpZNm3yuxe4rp2Uc 5SP35EKaI1tSkgrCk5qK/qUPrzQQ9FHVBcbkEzbwmbt7OafTIBP0vK3UARl/FgYOLUmg 6tWA== X-Forwarded-Encrypted: i=1; AJvYcCW2V4LbyXy4J0lUZQMiTQx3Fa2RjvoL+kDsh9d5OL53/P/JH56D400pHIhRxkA5yyR6VrIryGNz9j9foyGCHsQFwFfNDw4AjK8ZsQNn0N2wzhpq/sI= X-Gm-Message-State: AOJu0YzCGo9cttygS/BFTHYrKgjUlWTijebXbocQ7Xg8P4ihkR02H1gh oQj+mznv9H9QAt8TMOiLrHQOacPalihQfmsy1CHdFEGuAGz7Woq1FaZA0Frvcg== X-Google-Smtp-Source: AGHT+IG/NP7Q9ndMN8U8905daJyfOiw/jL6qOK9LSfylvJLbvyGyykC23VR8Ye7SCw/wI8bu8sqT2w== X-Received: by 2002:a05:6e02:b21:b0:378:cf86:357b with SMTP id e9e14a558f8ab-378cf8636b9mr52805245ab.3.1719505726976; Thu, 27 Jun 2024 09:28:46 -0700 (PDT) Received: from [127.0.0.1] ([2401:4900:1f3e:18b0:e4e6:ed1:4c03:dcec]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-706b4a58dbdsm1560739b3a.198.2024.06.27.09.28.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 09:28:46 -0700 (PDT) From: Ayush Singh Subject: [PATCH v5 0/7] misc: Add mikroBUS driver Date: Thu, 27 Jun 2024 21:56:10 +0530 Message-Id: <20240627-mikrobus-scratch-spi-v5-0-9e6c148bf5f0@beagleboard.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAKKSfWYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyTHUUlJIzE vPSU3UzU4B8JSMDIxMDMyNz3dzM7KL8pNJi3eLkosSS5Azd4oJM3cQUi2RLi5TkVCCpBNRaUJS allkBNjY6trYWAHPgoiJmAAAA To: Mark Brown , Vaishnav M A , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Michael Walle , Andrew Lunn , jkridner@beagleboard.org, robertcnelson@beagleboard.org Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ayush Singh , Ayush Singh X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3133; i=ayush@beagleboard.org; h=from:subject:message-id; bh=6L0Sq0uGdlO6s0H2kQb8Zs+pOHHRT5L1lBZlRrwLdjw=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBmfZMosT+CUWXVSMJGjq9tKbgX5wbQOfkFSHJzJ M6Lpr4lSvKJAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZn2TKAAKCRAFzvXHieVa dDPSEADOhdIzmUBFnxSIcJR4m04KytgV7RKB4+4aOmzBOCQ7VbkwIT81Iz7boFGgeAa4jyTCiSc BkNR12LanbOTWCLkV1LBNUKuSz6HbOY1oGPFZl4HlM2e7mmUQofdR1/59gdzgUU53CKYzeIF2F8 CcmRMxr9L9SxQsw/N8UQqfBdUovt4BqvYzSeV9J3GBgNHe8BIh0Cpi/ZK7ubJ38dy4Wte+W+HbV uthvOaVphSnAB5kPxQ0oeBYzLSt0eHod2xXB/Q7jEg+aTNdqztzUWkx2FK2OMDXSybaUC1evOjb xLaZoEBZJe2wAynuaKCLIR0PfLyJJCZxNbZC+0Oyc8cnD0K+3gJbt0QYS0OFwWCLN6GqicWarxR OdTbbehcht4bkdVdRpOJ5sI+B7ojEj9HWcrKkKyGPaRinXy83u6E5DlzEXooBXI4zwE7/8bn9WL WllGzUnfMWKs2ElMR183ajbsrftcKrRdFPJ/u80J+RhvLscW0FQrwIRycBybfajWIGPzHs6Qs7y ibm3pVSLRjeI4H6xMH1kXScjNPXaBEUTfip3vAnakuPgNnfwWZXswoGMlWNxeWQm6sIKEevE0vJ K7qmP0BOR0U/wcjPq6By7XGtmUXcYosrbrHYx925AwpbbQLhgqxJPRUw8cG2N3qrEtQ8F651cOO IoSKa6byTSTFmnQ== 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-20240627_092848_708101_3363B3C5 X-CRM114-Status: GOOD ( 15.46 ) 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 device tree infrastructure. 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/all/20240317193714.403132-1-ayushdevel1325@gmail.com/ Patch v4 Changes v5 - Complete rewrite to use device tree instead of mikroBUS manifest. - Only support for SPI. - Adds `mikrobus,spi` compatible property. 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. Signed-off-by: Ayush Singh --- Ayush Singh (7): dt-bindings: connector: Add mikrobus-connector dt-bindings: mikrobus: Add mikrobus board base dt-bindings: mikrobus: Add mikrobus-spi binding spi: Make of_find_spi_controller_by_node() available spi: Make of_register_spi_device() available mikrobus: Add mikroBUS driver dts: ti: k3-am625-beagleplay: Add mikroBUS .../bindings/connector/mikrobus-connector.yaml | 107 ++++++ .../bindings/mikrobus/mikrobus-board.yaml | 20 ++ .../devicetree/bindings/mikrobus/mikrobus-spi.yaml | 37 +++ MAINTAINERS | 9 + arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts | 94 +++++- drivers/misc/Kconfig | 16 + drivers/misc/Makefile | 1 + drivers/misc/mikrobus.c | 361 +++++++++++++++++++++ drivers/spi/spi.c | 209 ++++++------ include/linux/spi/spi.h | 7 + 10 files changed, 750 insertions(+), 111 deletions(-) --- base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7 change-id: 20240627-mikrobus-scratch-spi-ad8c98dcec98 Best regards,