All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Cyrille Pitchen <cyrille.pitchen@microchip.com>
Cc: "Yogesh Gaur" <yogeshnarayan.gaur@nxp.com>,
	"Vignesh R" <vigneshr@ti.com>,
	"Kamal Dasu" <kdasu.kdev@gmail.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	linux-spi@vger.kernel.org, "Peter Pan" <peterpansjtu@gmail.com>,
	"Marek Vasut" <marek.vasut@gmail.com>,
	"Frieder Schrempf" <frieder.schrempf@exceet.de>,
	"Mark Brown" <broonie@kernel.org>,
	linux-mtd@lists.infradead.org,
	"Cyrille Pitchen" <cyrille.pitchen@wedev4u.fr>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	"Maxime Chevallier" <maxime.chevallier@bootlin.com>,
	"Brian Norris" <computersforpeace@gmail.com>,
	"David Woodhouse" <dwmw2@infradead.org>
Subject: Re: [PATCH v4 6/7] mtd: spi-nor: Use the spi_mem_xx() API
Date: Wed, 23 May 2018 20:06:11 +0200	[thread overview]
Message-ID: <20180523200611.77cab6e5@bbrezillon> (raw)
In-Reply-To: <6a39f071-186e-7009-994d-af845ce3f75d@microchip.com>

Hi Cyrille,

On Wed, 23 May 2018 17:44:32 +0200
Cyrille Pitchen <cyrille.pitchen@microchip.com> wrote:

> > +					  SPI_MEM_OP_DATA_OUT(len, buf, 1));
> >  
> > -	return spi_write(spi, flash->command, len + 1);
> > +	return spi_mem_exec_op(flash->spimem, &op);
> >  }
> >  
> >  static ssize_t m25p80_write(struct spi_nor *nor, loff_t to, size_t len,
> >  			    const u_char *buf)
> >  {
> >  	struct m25p *flash = nor->priv;
> > -	struct spi_device *spi = flash->spi;
> > -	unsigned int inst_nbits, addr_nbits, data_nbits, data_idx;
> > -	struct spi_transfer t[3] = {};
> > -	struct spi_message m;
> > -	int cmd_sz = m25p_cmdsz(nor);
> > -	ssize_t ret;
> > +	struct spi_mem_op op =
> > +			SPI_MEM_OP(SPI_MEM_OP_CMD(nor->program_opcode, 1),
> > +				   SPI_MEM_OP_ADDR(nor->addr_width, to, 1),
> > +				   SPI_MEM_OP_DUMMY(0, 1),  
> 
> Why do you use SPI_MEM_OP_DUMMY(0, 1) here instead of SPI_MEM_OP_NO_DUMMY() ?

I guess I just copied the definition from m25p80_read() and modified
the definition without noticing this one could be replaced by
SPI_MEM_OP_NO_DUMMY. Not a big deal though, since SPI_MEM_OP_DUMMY(0,
1) still means "no dummy cycles".

Do you plan to send a patch to change that, or should I?

Regards,

Boris

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Cyrille Pitchen <cyrille.pitchen@microchip.com>
Cc: "David Woodhouse" <dwmw2@infradead.org>,
	"Brian Norris" <computersforpeace@gmail.com>,
	"Marek Vasut" <marek.vasut@gmail.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Cyrille Pitchen" <cyrille.pitchen@wedev4u.fr>,
	linux-mtd@lists.infradead.org,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Mark Brown" <broonie@kernel.org>,
	linux-spi@vger.kernel.org,
	"Yogesh Gaur" <yogeshnarayan.gaur@nxp.com>,
	"Vignesh R" <vigneshr@ti.com>,
	"Kamal Dasu" <kdasu.kdev@gmail.com>,
	"Maxime Chevallier" <maxime.chevallier@bootlin.com>,
	"Peter Pan" <peterpansjtu@gmail.com>,
	"Frieder Schrempf" <frieder.schrempf@exceet.de>,
	"Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH v4 6/7] mtd: spi-nor: Use the spi_mem_xx() API
Date: Wed, 23 May 2018 20:06:11 +0200	[thread overview]
Message-ID: <20180523200611.77cab6e5@bbrezillon> (raw)
In-Reply-To: <6a39f071-186e-7009-994d-af845ce3f75d@microchip.com>

Hi Cyrille,

On Wed, 23 May 2018 17:44:32 +0200
Cyrille Pitchen <cyrille.pitchen@microchip.com> wrote:

> > +					  SPI_MEM_OP_DATA_OUT(len, buf, 1));
> >  
> > -	return spi_write(spi, flash->command, len + 1);
> > +	return spi_mem_exec_op(flash->spimem, &op);
> >  }
> >  
> >  static ssize_t m25p80_write(struct spi_nor *nor, loff_t to, size_t len,
> >  			    const u_char *buf)
> >  {
> >  	struct m25p *flash = nor->priv;
> > -	struct spi_device *spi = flash->spi;
> > -	unsigned int inst_nbits, addr_nbits, data_nbits, data_idx;
> > -	struct spi_transfer t[3] = {};
> > -	struct spi_message m;
> > -	int cmd_sz = m25p_cmdsz(nor);
> > -	ssize_t ret;
> > +	struct spi_mem_op op =
> > +			SPI_MEM_OP(SPI_MEM_OP_CMD(nor->program_opcode, 1),
> > +				   SPI_MEM_OP_ADDR(nor->addr_width, to, 1),
> > +				   SPI_MEM_OP_DUMMY(0, 1),  
> 
> Why do you use SPI_MEM_OP_DUMMY(0, 1) here instead of SPI_MEM_OP_NO_DUMMY() ?

I guess I just copied the definition from m25p80_read() and modified
the definition without noticing this one could be replaced by
SPI_MEM_OP_NO_DUMMY. Not a big deal though, since SPI_MEM_OP_DUMMY(0,
1) still means "no dummy cycles".

Do you plan to send a patch to change that, or should I?

Regards,

Boris

  parent reply	other threads:[~2018-05-23 18:06 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26 16:18 [PATCH v4 0/7] spi: Extend the framework to generically support memory devices Boris Brezillon
2018-04-26 16:18 ` Boris Brezillon
2018-04-26 16:18 ` [PATCH v4 1/7] spi: Extend the core to ease integration of SPI memory controllers Boris Brezillon
2018-04-26 16:18   ` Boris Brezillon
2018-05-03 18:40   ` Frieder Schrempf
2018-05-03 18:40     ` Frieder Schrempf
2018-04-26 16:18 ` [PATCH v4 2/7] spi: Make support for regular transfers optional when ->mem_ops != NULL Boris Brezillon
2018-04-26 16:18   ` Boris Brezillon
2018-05-03 18:40   ` Frieder Schrempf
2018-05-03 18:40     ` Frieder Schrempf
2018-04-26 16:18 ` [PATCH v4 3/7] spi: bcm-qspi: Implement the spi_mem interface Boris Brezillon
2018-04-26 16:18   ` Boris Brezillon
2018-04-26 16:18 ` [PATCH v4 4/7] spi: bcm53xx: " Boris Brezillon
2018-04-26 16:18   ` Boris Brezillon
2018-04-26 16:18 ` [PATCH v4 5/7] spi: ti-qspi: " Boris Brezillon
2018-04-26 16:18   ` Boris Brezillon
2018-04-30  7:51   ` Vignesh R
2018-04-30  7:51     ` Vignesh R
2018-05-11  2:55   ` Applied "spi: ti-qspi: Implement the spi_mem interface" to the spi tree Mark Brown
2018-05-11  2:55     ` Mark Brown
2018-04-26 16:18 ` [PATCH v4 6/7] mtd: spi-nor: Use the spi_mem_xx() API Boris Brezillon
2018-04-26 16:18   ` Boris Brezillon
2018-05-03 18:40   ` Frieder Schrempf
2018-05-03 18:40     ` Frieder Schrempf
2018-05-23 15:44   ` Cyrille Pitchen
2018-05-23 15:44     ` Cyrille Pitchen
2018-05-23 15:56     ` Cyrille Pitchen
2018-05-23 15:56       ` Cyrille Pitchen
2018-05-24  7:43       ` Geert Uytterhoeven
2018-05-24  7:43         ` Geert Uytterhoeven
2018-05-23 18:06     ` Boris Brezillon [this message]
2018-05-23 18:06       ` Boris Brezillon
2018-04-26 16:18 ` [PATCH v4 7/7] spi: Get rid of the spi_flash_read() API Boris Brezillon
2018-04-26 16:18   ` Boris Brezillon
2018-05-03 18:40   ` Frieder Schrempf
2018-05-03 18:40     ` Frieder Schrempf
2018-05-03 18:40 ` [PATCH v4 0/7] spi: Extend the framework to generically support memory devices Frieder Schrempf
2018-05-03 18:40   ` Frieder Schrempf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180523200611.77cab6e5@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=broonie@kernel.org \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@microchip.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=dwmw2@infradead.org \
    --cc=frieder.schrempf@exceet.de \
    --cc=kdasu.kdev@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=peterpansjtu@gmail.com \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    --cc=yogeshnarayan.gaur@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.