Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752660AbbKKTK3 (ORCPT ); Wed, 11 Nov 2015 14:10:29 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34842 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751591AbbKKTK0 (ORCPT ); Wed, 11 Nov 2015 14:10:26 -0500 Date: Wed, 11 Nov 2015 11:10:23 -0800 From: Brian Norris To: Han Xu Cc: Yuan Yao-B46683 , Fabio Estevam , David Woodhouse , Li Yang-Leo-R58472 , Wood Scott-B07421 , "linux-mtd@lists.infradead.org" , linux-kernel , devicetree@vger.kernel.org Subject: Re: [PATCH] mtd: spi-nor: fsl-quadspi: add big-endian support Message-ID: <20151111191023.GF12143@google.com> References: <1445586797-38383-1-git-send-email-yao.yuan@freescale.com> <20151111175112.GA30612@chopperman.am.freescale.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151111175112.GA30612@chopperman.am.freescale.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2047 Lines: 54 + devicetree On Wed, Nov 11, 2015 at 11:51:13AM -0600, Han Xu wrote: > On Fri, Oct 30, 2015 at 04:49:41AM -0500, Yuan Yao-B46683 wrote: (BTW Yuan, replying on top doesn't make the conversation as easy to follow) > > Although it is possible to add the endianness support in the > > regmap_mmio driver, we don't see too much value in using it > > especially > > > > So we think: > > static void qspi_writel(struct fsl_qspi *q, u32 val, void __iomem > > *addr) { > > if (q->big_endian) > > iowrite32be(val, addr); > > else > > iowrite32(val, addr); > > } > > This way is an easier, more effective solution to do the endian issue. > > > > How about your think? > > I think the implement is fine, but I prefer to use quirk rather than > read from dts? Please also rebase the patch to latest l2-mtd code. If it really is just a endianness difference, then I think it makes sense to use the existing DT bindings for it, rather than relying on a new compatible string / quirk option. That doesn't mean you can't have a new SoC-inspired compatible property in addition... > > Best Regards, > > Yuan Yao > > > > On Sat, Oct 24, 2015 at 11:47 PM, Fabio Estevam wrote: > > > I suggest you to implement regmap support for this driver instead. > > > > > > Take a look at drivers/watchdog/imx2_wdt.c for a reference. > > > > > > Then you only need to pass 'big-endian' as a property for the qspi in the .dtsi > > > file and regmap core will take care of endianness. To use the standard binding also means that whether or not you choose to use regmap right now, it's an easy option in the future, and the core code will already handle it for you. That's really one of the main reasons for using standardized bindings in the first place. Brian -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/