Message ID | 20230118-mt8365-spi-support-v1-2-842a21e50494@baylibre.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp426348wrn; Thu, 19 Jan 2023 08:35:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXvrBXWQJJu1OXYmhMUfsEf/bF1J1ABBrMgSA//t3q0QiZ3wNOCrSRGW85UcZ5tOtUOTk4NZ X-Received: by 2002:a05:6402:2686:b0:46d:c288:e798 with SMTP id w6-20020a056402268600b0046dc288e798mr15865939edd.21.1674146110143; Thu, 19 Jan 2023 08:35:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674146110; cv=none; d=google.com; s=arc-20160816; b=jYKbNnTagl+b9OuVK5wWxnUZNj7uY9bDbCQLeJL0vCLyS41ooov4F5Wb7hl6maOnsI nv4xKqhhGpBjukUChTtVq2P7LU+7z2Zo5aSiJqEbnRTxY0UY1L9/N4dlo/Y80T5mBrAE N/RDqzhiQsCgSSvEhg5sEW9k20Mgu3FV2vEA/jSFX5lWihpwWSkd+FC64yXwvzQ2gMcd ys77uWpIxUK6+dfXzOzyloV5ji8Ujst2zALvfWfdEFNaKnk1OyDfoVS83re98+RD+G61 jncxa5DENOdWYwGUAuBXideddMBG7amQfJ2BiJF9oJ8RjyMmvg+lJKtwsbrCpMrzlo0X Au/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=1V+AlAQyMB4Uszzz/3gFiK+c3DQOnNxo0R2UN0oOwaA=; b=Wam2B3mVg6ZP7GBOoT2G3OucRvGvSFW9T6Zi/nYL/GHC0GGK/2mFDfMVED+JKfqUyA 0m9tX5KRXPSboO0yAtDiB4lEPaYJUxbPHTW12/tEZEpHEfmi6v7onJZKqu7jj5EpP86h hxPlQO2ISLHpEt5nAFM3JtQI1EMqlamdL0gguZu8WYJIA5EfTafN4bXIySt5M0O8vV77 +03rcQf1NFmSqglc6Mysh99VGdk6cNdv3Qafmceku9jNGDoCuR5j798LICq57Dt9/lD7 EaykWJvDzEJMp7jbI5jIs8DQQBQOHyWCQMdrxIYJDqvEbB1Vq1J7rk1Zkq2CNAuZ+sZk Om5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=1Ii3UICP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a056402240800b004872d72e769si39411518eda.632.2023.01.19.08.34.45; Thu, 19 Jan 2023 08:35:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=1Ii3UICP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230106AbjASQ3Z (ORCPT <rfc822;pfffrao@gmail.com> + 99 others); Thu, 19 Jan 2023 11:29:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbjASQ3C (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 19 Jan 2023 11:29:02 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B5443583 for <linux-kernel@vger.kernel.org>; Thu, 19 Jan 2023 08:29:00 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id d2so2389307wrp.8 for <linux-kernel@vger.kernel.org>; Thu, 19 Jan 2023 08:29:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; 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=1V+AlAQyMB4Uszzz/3gFiK+c3DQOnNxo0R2UN0oOwaA=; b=1Ii3UICPWS2xk2szN6TKxNtVqLxXZpXAyWJe4bS/rXv8cLPHGvbHaQzOUnUh3Lzbt8 i7YVIBNfBGGGHisVBzp91eiLHjEorjIYfxIvxen4O6YtGtSglKYnpD+QeXdX5tJDdGOU W0SQ4HjqbOP6VFjjxdzGMHuKth2IEb1qPpZJ/+qTsQZufHnsLBhsLZUqHzNYHWTsegkn qhLdJMHLeT23BOgcm8b9IPTJcp88V1e8LLqkQaEe7LKeNqxnxbDVqB7AB8KfQXI/Y8sZ WWqLe3JaPHlVGyBrfsPDLDkDhhLqUkPMyukhTwrcH17yKCjv1f5QfhEJAyZ5iXcL1xhE 7tMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=1V+AlAQyMB4Uszzz/3gFiK+c3DQOnNxo0R2UN0oOwaA=; b=a1RMK+ru7WAQwbjJJ9ozSQVXXemovNhE6gFccBcEFGkSTrTqeTmCTxOuuQwS7ESlmQ bMAyGvwhIYnKqRHlchjkFGFL7pLkRKW0dpxG0RVo8e5lPHnWj7QdmfkedK+99uziZbty jtYYyAW/nMBdEZ/QXaEeXCAEiqMG5ERx06Gp+Eeh0n0DjGy33sPao/UM62RrBKIUumaC 9RBdiFhaZTsG6855QkWrFEKOWJBr9W1eUeGW6SQKPSnYiitWUKJzc/3tMNtZ2a0AgGA0 b0Qqxr1ZAHoHPDaa2XWJYh7PgGNL2XiK4dh6MkvThT9XskZw/I8hIatO98wdCLAdzBu5 UFOQ== X-Gm-Message-State: AFqh2kpOJSR+daycP4cOyINq5i0d5z8Uzq8g5ORucHCjHIsdjSO4ArGJ bleDVrgI/MhGbM9qNXJ5yK2ndg5Nr2K+CCoX X-Received: by 2002:a05:6000:3c2:b0:2bd:beff:9c47 with SMTP id b2-20020a05600003c200b002bdbeff9c47mr11873335wrg.67.1674145738767; Thu, 19 Jan 2023 08:28:58 -0800 (PST) Received: from [127.0.1.1] (158.22.5.93.rev.sfr.net. [93.5.22.158]) by smtp.googlemail.com with ESMTPSA id f7-20020a5d6647000000b002bbeb700c38sm29008771wrw.91.2023.01.19.08.28.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 08:28:58 -0800 (PST) From: Alexandre Mergnat <amergnat@baylibre.com> Date: Thu, 19 Jan 2023 17:28:50 +0100 Subject: [PATCH 2/2] spi: spidev: add new mediatek support MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230118-mt8365-spi-support-v1-2-842a21e50494@baylibre.com> References: <20230118-mt8365-spi-support-v1-0-842a21e50494@baylibre.com> In-Reply-To: <20230118-mt8365-spi-support-v1-0-842a21e50494@baylibre.com> To: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com> Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, Alexandre Mergnat <amergnat@baylibre.com>, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1039; i=amergnat@baylibre.com; h=from:subject:message-id; bh=jaqhN6R1aKzEEALosy8O3LyQm4i6Ldhz0IJK2z+QDNY=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjyW/GtkBwodHdGFmD9EQ72UZXLlxvUINHBPmmk0JC B+idxumJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY8lvxgAKCRArRkmdfjHURdICD/ 9F9RCFLu01N7iObG0wc8Tgvr5yA0aeHOWo2PIKNnIBPbNRGJo2GxkqaMVB/N4zsqUTyTbkZGeehH5f VbjrNWVxt8+z0YswLnMqAW/z5ENprKNWCRVYJ1h11Zs0EoOGJuH6YqlxqRf68Rnhg6cmIz4RNvxJYL vo+JgnI0jjNzSIgTD7hBxJ2g36GAXmUiZSHpy1JphA5cwICG1HXyhZtEbXFPusY7PAMLypd3fpC2O6 rPUXwaXMorjnQ31ggwFU52/6ttIIfTs2j+UkrYGijX+SWGJ26kc2KHk9GATC4x0AfiJFge/hKmlHOV NXgmZ/Xer7iVmC7KByc+Q7RXWJPX1WThxL5jKUaOKJ0bhI2l7KHmY8atkfagQEVE8icPHwbwXqyrKH tXj4/hHHMrtdzK4ClyxLro3M7Vp03EZbQHT5Xt4gRauxQmz4eAyBaFy9t5ufMTiuykTunPUM4PXe2S oO5IYllFbAsyvws5IsWV5bvX40KwhtaYFXk7f68WqFY9repyroyxJlMYW+z7tiSBgxvRYPxiHh8EJX 2an0sHMp3l9BOItxi1zUkjz5Wy48aEsYg/lm9P0I1ZtnaS0k/Wu/eJRbZ5C2C/W/TzGvFT6VFm3Cax f3oCaF6jsSD6Nvly3kvqP+sbaCX8xg91a6zvWkBv6ABz6VV1+RxmB/0V5seQ== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755469431895742045?= X-GMAIL-MSGID: =?utf-8?q?1755469431895742045?= |
Series |
Add MediaTek MT8365 SPI support
|
|
Commit Message
Alexandre Mergnat
Jan. 19, 2023, 4:28 p.m. UTC
Add the "mediatek,genio" compatible string to support Mediatek
SPI controller on the genio boards.
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
drivers/spi/spidev.c | 2 ++
1 file changed, 2 insertions(+)
Comments
On Thu, Jan 19, 2023 at 05:28:50PM +0100, Alexandre Mergnat wrote: > Add the "mediatek,genio" compatible string to support Mediatek > SPI controller on the genio boards. > { .compatible = "cisco,spi-petra", .data = &spidev_of_check }, > { .compatible = "micron,spi-authenta", .data = &spidev_of_check }, > + { .compatible = "mediatek,genio", .data = &spidev_of_check }, We need a matching update to the binding document. This does also seem like a terribly generic name - Google suggests that this is actually a series of numbered products (eg, Genio 700), perhaps we should be using the specific numbers here? I guess users would care which they're talking to. It really parses as being "generic I/O" which would be an end run around describing the actual product though it's not actually that.
On 19/01/2023 17:28, Alexandre Mergnat wrote: > Add the "mediatek,genio" compatible string to support Mediatek > SPI controller on the genio boards. > > Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> > --- > drivers/spi/spidev.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c > index 6313e7d0cdf8..e23b825b8d30 100644 > --- a/drivers/spi/spidev.c > +++ b/drivers/spi/spidev.c > @@ -702,6 +702,7 @@ static const struct spi_device_id spidev_spi_ids[] = { > { .name = "m53cpld" }, > { .name = "spi-petra" }, > { .name = "spi-authenta" }, > + { .name = "genio" }, > {}, > }; > MODULE_DEVICE_TABLE(spi, spidev_spi_ids); > @@ -728,6 +729,7 @@ static const struct of_device_id spidev_dt_ids[] = { > { .compatible = "menlo,m53cpld", .data = &spidev_of_check }, > { .compatible = "cisco,spi-petra", .data = &spidev_of_check }, > { .compatible = "micron,spi-authenta", .data = &spidev_of_check }, > + { .compatible = "mediatek,genio", .data = &spidev_of_check }, > {}, > }; > MODULE_DEVICE_TABLE(of, spidev_dt_ids); >
On 19/01/2023 17:28, Alexandre Mergnat wrote: > Add the "mediatek,genio" compatible string to support Mediatek > SPI controller on the genio boards. > > Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com> > --- > drivers/spi/spidev.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c > index 6313e7d0cdf8..e23b825b8d30 100644 > --- a/drivers/spi/spidev.c > +++ b/drivers/spi/spidev.c > @@ -702,6 +702,7 @@ static const struct spi_device_id spidev_spi_ids[] = { > { .name = "m53cpld" }, > { .name = "spi-petra" }, > { .name = "spi-authenta" }, > + { .name = "genio" }, > {}, > }; > MODULE_DEVICE_TABLE(spi, spidev_spi_ids); > @@ -728,6 +729,7 @@ static const struct of_device_id spidev_dt_ids[] = { > { .compatible = "menlo,m53cpld", .data = &spidev_of_check }, > { .compatible = "cisco,spi-petra", .data = &spidev_of_check }, > { .compatible = "micron,spi-authenta", .data = &spidev_of_check }, > + { .compatible = "mediatek,genio", .data = &spidev_of_check }, Please run scripts/checkpatch.pl and fix reported warnings. Best regards, Krzysztof
Le jeu. 19 janv. 2023 à 17:49, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> a écrit : > > On 19/01/2023 17:28, Alexandre Mergnat wrote: > > { .compatible = "micron,spi-authenta", .data = &spidev_of_check }, > > + { .compatible = "mediatek,genio", .data = &spidev_of_check }, > > Please run scripts/checkpatch.pl and fix reported warnings. Actually I did. I saw: "WARNING: DT compatible string "mediatek,genio" appears un-documented -- check ./Documentation/devicetree/bindings/" But there are no bindings for spidev. I've made some grep on already supported compatible devices like "micron,spi-authenta", but I didn't find documentation to add "mediatek,genio". Do you know where I should document it please ? Regards, Alex
On 19/01/2023 20:18, Alexandre Mergnat wrote: > Le jeu. 19 janv. 2023 à 17:49, Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> a écrit : >> >> On 19/01/2023 17:28, Alexandre Mergnat wrote: >>> { .compatible = "micron,spi-authenta", .data = &spidev_of_check }, >>> + { .compatible = "mediatek,genio", .data = &spidev_of_check }, >> >> Please run scripts/checkpatch.pl and fix reported warnings. > > Actually I did. > I saw: "WARNING: DT compatible string "mediatek,genio" appears > un-documented -- check ./Documentation/devicetree/bindings/" > But there are no bindings for spidev. There are. Just some other people were as well ignoring warnings. What is the purpose of having tools if people keep ignoring the warnings, sigh... Best regards, Krzysztof
On 19/01/2023 20:18, Alexandre Mergnat wrote: > Le jeu. 19 janv. 2023 à 17:49, Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> a écrit : >> >> On 19/01/2023 17:28, Alexandre Mergnat wrote: >>> { .compatible = "micron,spi-authenta", .data = &spidev_of_check }, >>> + { .compatible = "mediatek,genio", .data = &spidev_of_check }, >> >> Please run scripts/checkpatch.pl and fix reported warnings. > > Actually I did. > I saw: "WARNING: DT compatible string "mediatek,genio" appears > un-documented -- check ./Documentation/devicetree/bindings/" > But there are no bindings for spidev. I've made some grep on already > supported compatible devices like "micron,spi-authenta", but I didn't > find documentation to add "mediatek,genio". Another point - why is this after "micron"? Don't add entries to the end but in order. Best regards, Krzysztof
On 20/01/2023 08:44, Krzysztof Kozlowski wrote: > On 19/01/2023 20:18, Alexandre Mergnat wrote: >> Le jeu. 19 janv. 2023 à 17:49, Krzysztof Kozlowski >> <krzysztof.kozlowski@linaro.org> a écrit : >>> >>> On 19/01/2023 17:28, Alexandre Mergnat wrote: >>>> { .compatible = "micron,spi-authenta", .data = &spidev_of_check }, >>>> + { .compatible = "mediatek,genio", .data = &spidev_of_check }, >>> >>> Please run scripts/checkpatch.pl and fix reported warnings. >> >> Actually I did. >> I saw: "WARNING: DT compatible string "mediatek,genio" appears >> un-documented -- check ./Documentation/devicetree/bindings/" >> But there are no bindings for spidev. > > There are. Just some other people were as well ignoring warnings. What > is the purpose of having tools if people keep ignoring the warnings, sigh... I documented the missing ones. Best regards, Krzysztof
From: Alexandre Mergnat <amergnat@baylibre.com> > Add the "mediatek,genio" compatible string to support Mediatek > SPI controller on the genio boards. What is the use case of having the spidev? What if I want to connect a device with a linux driver to it? It seems like you just want to expose the SPI bus on the pin header. There was a similar discussion for a mikrobus connector [1]. -michael [1] https://lore.kernel.org/linux-devicetree/YmFo+EntwxIsco%2Ft@robh.at.kernel.org/
Le ven. 20 janv. 2023 à 09:20, Michael Walle <michael@walle.cc> a écrit : > > From: Alexandre Mergnat <amergnat@baylibre.com> > > > Add the "mediatek,genio" compatible string to support Mediatek > > SPI controller on the genio boards. > > What is the use case of having the spidev? What if I want to > connect a device with a linux driver to it? It seems like you > just want to expose the SPI bus on the pin header. There was a > similar discussion for a mikrobus connector [1]. > Hi Michael, Yes I want to expose the SPI on the pin header for two reasons: - It's an Evaluation Kit board, I believe exposing SPI helps new customers to try/understand it. - This board will join the KernelCI soon, this setup will help to do SPI non regression tests for a fixed default configuration. AFAII from [1] , you can easily modify the current spidev@0 (If you don't want to keep userspace interface) or simply add (in the DTS or overlay) another node foo@1 with a different compatible (and so on) according to the chip you plug on the header pin. Regards, Alex [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/spi/spi-controller.yaml
Because there are no logical order: { .compatible = "rohm,dh2228fv", .data = &spidev_of_check }, { .compatible = "lineartechnology,ltc2488", .data = &spidev_of_check }, { .compatible = "semtech,sx1301", .data = &spidev_of_check }, { .compatible = "lwn,bk4", .data = &spidev_of_check }, { .compatible = "dh,dhcom-board", .data = &spidev_of_check }, { .compatible = "menlo,m53cpld", .data = &spidev_of_check }, { .compatible = "cisco,spi-petra", .data = &spidev_of_check }, { .compatible = "micron,spi-authenta", .data = &spidev_of_check }, { .compatible = "mediatek,genio", .data = &spidev_of_check }, I can put it first then before "rohm", or before "micron,spi-authenta" you prefer. I can also introduce another patch in my serie to re-order everything. Le ven. 20 janv. 2023 à 08:47, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> a écrit : > > On 19/01/2023 20:18, Alexandre Mergnat wrote: > > Le jeu. 19 janv. 2023 à 17:49, Krzysztof Kozlowski > > <krzysztof.kozlowski@linaro.org> a écrit : > >> > >> On 19/01/2023 17:28, Alexandre Mergnat wrote: > >>> { .compatible = "micron,spi-authenta", .data = &spidev_of_check }, > >>> + { .compatible = "mediatek,genio", .data = &spidev_of_check }, > >> > >> Please run scripts/checkpatch.pl and fix reported warnings. > > > > Actually I did. > > I saw: "WARNING: DT compatible string "mediatek,genio" appears > > un-documented -- check ./Documentation/devicetree/bindings/" > > But there are no bindings for spidev. I've made some grep on already > > supported compatible devices like "micron,spi-authenta", but I didn't > > find documentation to add "mediatek,genio". > > Another point - why is this after "micron"? Don't add entries to the end > but in order. > > Best regards, > Krzysztof >
Hi, Am 2023-01-23 10:37, schrieb Alexandre Mergnat: > Le ven. 20 janv. 2023 à 09:20, Michael Walle <michael@walle.cc> a écrit > : >> >> From: Alexandre Mergnat <amergnat@baylibre.com> >> >> > Add the "mediatek,genio" compatible string to support Mediatek >> > SPI controller on the genio boards. >> >> What is the use case of having the spidev? What if I want to >> connect a device with a linux driver to it? It seems like you >> just want to expose the SPI bus on the pin header. There was a >> similar discussion for a mikrobus connector [1]. >> > Yes I want to expose the SPI on the pin header for two reasons: Then "mediatek,genio" doesn't really describe the hardware, does it? If you read that linked thread, NXP was also trying exposing the SPI bus on a pin header. IMHO this is just misusing the userspace spi-dev. That being said, exposing something on a pinheader (or on a standardized connector) seems like a common thing and we should be working towards a good solution. I still think Robs proposal for the mikrobus connector makes also sense for your case. -michael
On Mon, Jan 23, 2023 at 10:37:58AM +0100, Alexandre Mergnat wrote: > Yes I want to expose the SPI on the pin header for two reasons: > - It's an Evaluation Kit board, I believe exposing SPI helps new > customers to try/understand it. That's not how this works. Anyone connecting something to the SPI header will need to update the DT to reflect whatever they have connected, if that is something that should be controlled with spidev then they should add the compatible for that thing to the driver. If that is something that has a regular driver then the regular driver will be used.
Le lun. 23 janv. 2023 à 11:44, Michael Walle <michael@walle.cc> a écrit : > > Hi, > > Am 2023-01-23 10:37, schrieb Alexandre Mergnat: > > Le ven. 20 janv. 2023 à 09:20, Michael Walle <michael@walle.cc> a écrit > > : > >> > >> From: Alexandre Mergnat <amergnat@baylibre.com> > >> > >> > Add the "mediatek,genio" compatible string to support Mediatek > >> > SPI controller on the genio boards. > >> > >> What is the use case of having the spidev? What if I want to > >> connect a device with a linux driver to it? It seems like you > >> just want to expose the SPI bus on the pin header. There was a > >> similar discussion for a mikrobus connector [1]. > >> > > Yes I want to expose the SPI on the pin header for two reasons: > > Then "mediatek,genio" doesn't really describe the hardware, does it? > If you read that linked thread, NXP was also trying exposing the SPI > bus on a pin header. IMHO this is just misusing the userspace spi-dev. > > That being said, exposing something on a pinheader (or on a standardized > connector) seems like a common thing and we should be working towards > a good solution. I still think Robs proposal for the mikrobus connector > makes also sense for your case. > I don't think this is the same case. For the mikrobus case, it's consistent to have a connector because it fit with other "add-on" board which can be plug on the "mother board". Here I've just a simple debug pin header. I've taken a look at raspberry pi and Beaglebone black DTS, they don't use connector, but DTS overlay to enable SPI. I think you're right when you say that I'm misusing the userspace spi-dev.
Le lun. 23 janv. 2023 à 13:19, Mark Brown <broonie@kernel.org> a écrit : > > On Mon, Jan 23, 2023 at 10:37:58AM +0100, Alexandre Mergnat wrote: > > > Yes I want to expose the SPI on the pin header for two reasons: > > - It's an Evaluation Kit board, I believe exposing SPI helps new > > customers to try/understand it. > > That's not how this works. Anyone connecting something to the > SPI header will need to update the DT to reflect whatever they > have connected, if that is something that should be controlled > with spidev then they should add the compatible for that thing > to the driver. If that is something that has a regular driver > then the regular driver will be used. Got it. I think this series should be dropped then. If someone needs the SPI, then he should use overlay (or modify the DTS locally). I thought I could use spidev to bring SPI into the userspace, to help future users play with it ("/dev/spidev0.0").
On 23/01/2023 11:06, Alexandre Mergnat wrote: > Because there are no logical order: > { .compatible = "rohm,dh2228fv", .data = &spidev_of_check }, > { .compatible = "lineartechnology,ltc2488", .data = &spidev_of_check }, > { .compatible = "semtech,sx1301", .data = &spidev_of_check }, > { .compatible = "lwn,bk4", .data = &spidev_of_check }, > { .compatible = "dh,dhcom-board", .data = &spidev_of_check }, > { .compatible = "menlo,m53cpld", .data = &spidev_of_check }, > { .compatible = "cisco,spi-petra", .data = &spidev_of_check }, > { .compatible = "micron,spi-authenta", .data = &spidev_of_check }, > { .compatible = "mediatek,genio", .data = &spidev_of_check }, > > I can put it first then before "rohm", or before > "micron,spi-authenta" you prefer. Yeah, I noticed it afterwards. > > I can also introduce another patch in my serie to re-order everything. I already sent a patch for it. Best regards, Krzysztof
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 6313e7d0cdf8..e23b825b8d30 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -702,6 +702,7 @@ static const struct spi_device_id spidev_spi_ids[] = { { .name = "m53cpld" }, { .name = "spi-petra" }, { .name = "spi-authenta" }, + { .name = "genio" }, {}, }; MODULE_DEVICE_TABLE(spi, spidev_spi_ids); @@ -728,6 +729,7 @@ static const struct of_device_id spidev_dt_ids[] = { { .compatible = "menlo,m53cpld", .data = &spidev_of_check }, { .compatible = "cisco,spi-petra", .data = &spidev_of_check }, { .compatible = "micron,spi-authenta", .data = &spidev_of_check }, + { .compatible = "mediatek,genio", .data = &spidev_of_check }, {}, }; MODULE_DEVICE_TABLE(of, spidev_dt_ids);