From mboxrd@z Thu Jan 1 00:00:00 1970 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 C6321C433EF for ; Thu, 16 Dec 2021 08:08:33 +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:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mBihTtU2/Hkbk6y2WoNovvKPPx0sVzcWsfIZxCn1Q7s=; b=fgxllp9oYnKb3J xc1arOxQVd9md4LeicvziwUq3WOsWQHfFjRxymljez/k4D9b7KVnd+PUmTxbJOlnXAZ9gnlMXTN1b Tx0oN7P6oTvOXNhyGJhxr+nw/th2Br8UmXtxEUunUbSTopi+gJdofj0IAAV0hzaPPSIPmDCtXy/jl 4xFSepytUXWulXqM6nRFKKt0Aw26FJ4M7mq+Z4Rhpcwlx4W3dj3pY/d7MLKhzucot7pkzJjMkmM1u imKbn0UXy0vlmC/1dOyBgS2Oi4rUojsOEWQmHWUe3RMectwDXbVmn9298lj+RBGlv7D6piP43Vnan WDd3cSaWH05th1WaIUIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxlnl-0043K2-0T; Thu, 16 Dec 2021 08:07:45 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxlni-0043G3-SF for linux-mtd@lists.infradead.org; Thu, 16 Dec 2021 08:07:44 +0000 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 78D2CE0009; Thu, 16 Dec 2021 08:07:31 +0000 (UTC) Date: Thu, 16 Dec 2021 09:07:30 +0100 From: Miquel Raynal To: Mark Brown Cc: Boris Brezillon , Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus , Pratyush Yadav , Michael Walle , linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org, Julien Su , Jaime Liao , Thomas Petazzoni , Xiangsheng Hou Subject: Re: [PATCH v5 12/13] spi: mxic: Use spi_mem_generic_supports_op() Message-ID: <20211216090730.17cc5619@xps13> In-Reply-To: References: <20211214114140.54629-1-miquel.raynal@bootlin.com> <20211214114140.54629-13-miquel.raynal@bootlin.com> <20211214172410.2b26c17e@collabora.com> <20211215184426.67fd3912@xps13> <20211215200548.75630b61@collabora.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211216_000743_073901_33C72A62 X-CRM114-Status: GOOD ( 13.33 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org SGkgQm9yaXMsIE1hcmssCgpicm9vbmllQGtlcm5lbC5vcmcgd3JvdGUgb24gV2VkLCAxNSBEZWMg MjAyMSAxOToxOToxMSArMDAwMDoKCj4gT24gV2VkLCBEZWMgMTUsIDIwMjEgYXQgMDg6MDU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fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fCkxpbnV4IE1URCBkaXNjdXNzaW9uIG1haWxpbmcgbGlzdApodHRw Oi8vbGlzdHMuaW5mcmFkZWFkLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2xpbnV4LW10ZC8K From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8BCFC433EF for ; Thu, 16 Dec 2021 08:07:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234711AbhLPIHh convert rfc822-to-8bit (ORCPT ); Thu, 16 Dec 2021 03:07:37 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:60421 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230324AbhLPIHg (ORCPT ); Thu, 16 Dec 2021 03:07:36 -0500 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 78D2CE0009; Thu, 16 Dec 2021 08:07:31 +0000 (UTC) Date: Thu, 16 Dec 2021 09:07:30 +0100 From: Miquel Raynal To: Mark Brown Cc: Boris Brezillon , Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus , Pratyush Yadav , Michael Walle , linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org, Julien Su , Jaime Liao , Thomas Petazzoni , Xiangsheng Hou Subject: Re: [PATCH v5 12/13] spi: mxic: Use spi_mem_generic_supports_op() Message-ID: <20211216090730.17cc5619@xps13> In-Reply-To: References: <20211214114140.54629-1-miquel.raynal@bootlin.com> <20211214114140.54629-13-miquel.raynal@bootlin.com> <20211214172410.2b26c17e@collabora.com> <20211215184426.67fd3912@xps13> <20211215200548.75630b61@collabora.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Hi Boris, Mark, broonie@kernel.org wrote on Wed, 15 Dec 2021 19:19:11 +0000: > On Wed, Dec 15, 2021 at 08:05:48PM +0100, Boris Brezillon wrote: > > > There's also a second option that doesn't involve patching existing > > users: add a spi_mem_controller_caps to the spi_controller struct, and > > check this instance in your spi_mem_default_supports_op() > > implementation. Note that the buswidth check done in the generic > > helper is already based on caps exposed by the controller > > through spi_controller.mode_bits ({RX/TX}_{DUAL,QUAD,OCTAL} bits). > > This approach is quite nice for things like this - having things as data > rather than code. The only issue is if any of the caps end up varying > by operation and we need different capabilities but that doesn't look > too likely here I think? Sure, that's a good idea, I'll look into it. Thanks, Miquèl