From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Subject: Re: [PATCH v2 0/2] eeprom: at25: SPI transfer improvements Date: Wed, 30 Jan 2019 16:08:39 +0100 Message-ID: <20190130160839.55f99e63@bbrezillon> References: <20190118140525.29189-1-geert+renesas@glider.be> <20190118230740.44239fcf@bbrezillon> <20190130145054.GA990@kroah.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Geert Uytterhoeven , Geert Uytterhoeven , Arnd Bergmann , MTD Maling List , Nguyen An Hoan , Linux Kernel Mailing List , linux-spi To: Greg Kroah-Hartman Return-path: In-Reply-To: <20190130145054.GA990@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-spi.vger.kernel.org Hi Greg, On Wed, 30 Jan 2019 15:50:54 +0100 Greg Kroah-Hartman wrote: > On Tue, Jan 29, 2019 at 08:02:37PM +0100, Geert Uytterhoeven wrote: > > Hi Boris, > > > > On Fri, Jan 18, 2019 at 11:07 PM Boris Brezillon wrote: > > > Did you consider converting this driver to spimem? Looks like the > > > protocol used to communicate with the memory resembles the one used on > > > SPI NANDs/NORs and fits pretty well in the spi_mem_op representation. > > > > > > By doing this conversion you'd allow people to connect an AT25 EEPROM > > > to an advanced SPI controller that does not support regular SPI > > > transfers and you wouldn't have to forge SPI messages manually. > > > > > > Here is a patch (only compile tested) doing that. The diffstat is not in > > > favor of this conversion, but I find the resulting code cleaner and more > > > future proof. > > > > Thanks, seems to work fine, with the 512-byte 25LC040 I have! > > > > Tested-by: Geert Uytterhoeven > > > > I did notice that the first two-byte transfer (command+offset) of each > > message is now split in two one-byte transfers, though. > > Ok, I'll drop this patch series and wait for the updated version to be > sent out :) I'd like to further simplify the patch by using the recently introduced devm_spi_mem_dirmap_create() function (queued to Mark's spi/for-5.1 branch), which means I'll have to wait v5.1-rc1 before sending a new version. I'll let you decide if it's worth applying Geert's patches in the meantime. Regards, Boris