All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Geert Uytterhoeven <geert+renesas@linux-m68k.org>,
	linux-spi@vger.kernel.org, linux-mtd@lists.infradead.org,
	Sourav Poddar <sourav.poddar@ti.com>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH 2/4] mtd: m25p80: Set rx_nbits for Quad SPI transfers
Date: Tue, 21 Jan 2014 16:18:44 +0100	[thread overview]
Message-ID: <201401211618.44103.marex@denx.de> (raw)
In-Reply-To: <1390309159-19643-3-git-send-email-geert@linux-m68k.org>

On Tuesday, January 21, 2014 at 01:59:17 PM, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> When using the Quad Read opcode, SPI masters still use Single SPI
> transfers, as spi_transfer.rx_nbits defaults to SPI_NBITS_SINGLE.
> Use SPI_NBITS_QUAD to fix this.
> 
> While an earlier version of commit 3487a63955c34ea508bcf4ca5131ddd953876e2d
> ("drivers: mtd: m25p80: add quad read support") did this correctly, it was
> forgotten in the version that got merged.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> ---
>  drivers/mtd/devices/m25p80.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index 320c6a308630..ad1913909702 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -489,6 +489,16 @@ static inline int m25p80_dummy_cycles_read(struct m25p
> *flash) }
>  }
> 
> +static inline unsigned int m25p80_rx_nbits(const struct m25p *flash)
> +{
> +	switch (flash->flash_read) {
> +	case M25P80_QUAD:
> +		return 4;
> +	default:
> +		return 0;
> +	}
> +}
> +
>  /*
>   * Read an address range from the flash chip.  The address range
>   * may be any size provided it is within the physical boundaries.
> @@ -519,6 +529,7 @@ static int m25p80_read(struct mtd_info *mtd, loff_t
> from, size_t len, spi_message_add_tail(&t[0], &m);
> 
>  	t[1].rx_buf = buf;
> +	t[1].rx_nbits = m25p80_rx_nbits(flash);
>  	t[1].len = len;
>  	spi_message_add_tail(&t[1], &m);

Indeed.

Acked-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut

WARNING: multiple messages have this Message-ID (diff)
From: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
To: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Brian Norris
	<computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Geert Uytterhoeven
	<geert+renesas-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Subject: Re: [PATCH 2/4] mtd: m25p80: Set rx_nbits for Quad SPI transfers
Date: Tue, 21 Jan 2014 16:18:44 +0100	[thread overview]
Message-ID: <201401211618.44103.marex@denx.de> (raw)
In-Reply-To: <1390309159-19643-3-git-send-email-geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>

On Tuesday, January 21, 2014 at 01:59:17 PM, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
> 
> When using the Quad Read opcode, SPI masters still use Single SPI
> transfers, as spi_transfer.rx_nbits defaults to SPI_NBITS_SINGLE.
> Use SPI_NBITS_QUAD to fix this.
> 
> While an earlier version of commit 3487a63955c34ea508bcf4ca5131ddd953876e2d
> ("drivers: mtd: m25p80: add quad read support") did this correctly, it was
> forgotten in the version that got merged.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
> ---
>  drivers/mtd/devices/m25p80.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index 320c6a308630..ad1913909702 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -489,6 +489,16 @@ static inline int m25p80_dummy_cycles_read(struct m25p
> *flash) }
>  }
> 
> +static inline unsigned int m25p80_rx_nbits(const struct m25p *flash)
> +{
> +	switch (flash->flash_read) {
> +	case M25P80_QUAD:
> +		return 4;
> +	default:
> +		return 0;
> +	}
> +}
> +
>  /*
>   * Read an address range from the flash chip.  The address range
>   * may be any size provided it is within the physical boundaries.
> @@ -519,6 +529,7 @@ static int m25p80_read(struct mtd_info *mtd, loff_t
> from, size_t len, spi_message_add_tail(&t[0], &m);
> 
>  	t[1].rx_buf = buf;
> +	t[1].rx_nbits = m25p80_rx_nbits(flash);
>  	t[1].len = len;
>  	spi_message_add_tail(&t[1], &m);

Indeed.

Acked-by: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>

Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-01-21 15:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21 12:59 [PATCH 0/4] m25p80 Quad/Dual updates Geert Uytterhoeven
2014-01-21 12:59 ` Geert Uytterhoeven
2014-01-21 12:59 ` [PATCH 1/4] mtd: m25p80: Enable Quad SPI read transfers for s25fl512s Geert Uytterhoeven
2014-01-21 12:59   ` Geert Uytterhoeven
2014-01-21 15:13   ` Marek Vasut
2014-01-21 15:13     ` Marek Vasut
2014-01-21 12:59 ` [PATCH 2/4] mtd: m25p80: Set rx_nbits for Quad SPI transfers Geert Uytterhoeven
2014-01-21 12:59   ` Geert Uytterhoeven
2014-01-21 15:18   ` Marek Vasut [this message]
2014-01-21 15:18     ` Marek Vasut
2014-01-21 12:59 ` [PATCH 3/4] mtd: m25p80: Add dual read support Geert Uytterhoeven
2014-01-21 12:59   ` Geert Uytterhoeven
2014-01-21 15:42   ` Marek Vasut
2014-01-21 15:42     ` Marek Vasut
2014-01-21 12:59 ` [PATCH 4/4] mtd: m25p80: Enable Dual SPI read transfers for s25fl256s1 and s25fl512s Geert Uytterhoeven
2014-01-21 12:59   ` Geert Uytterhoeven
2014-01-21 15:42   ` Marek Vasut
2014-01-21 15:42     ` Marek Vasut
2014-01-21 15:58     ` Geert Uytterhoeven
2014-01-21 15:58       ` Geert Uytterhoeven
2014-01-21 16:10       ` Marek Vasut
2014-01-21 16:10         ` Marek Vasut
2014-01-23  2:01 ` [PATCH 0/4] m25p80 Quad/Dual updates Huang Shijie
2014-01-23  2:01   ` Huang Shijie
2014-01-25  9:06   ` Brian Norris
2014-01-25  9:06     ` Brian Norris
2014-01-28  5:26 ` Brian Norris
2014-01-28  5:26   ` Brian Norris

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=201401211618.44103.marex@denx.de \
    --to=marex@denx.de \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=geert+renesas@linux-m68k.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=sourav.poddar@ti.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.