Thread (25 messages) 25 messages, 9 authors, 2018-09-06

Re: [PATCH 1/7] spi: add slave device size in spi_device struct

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2018-08-31 11:41:22
Also in: linux-arm-kernel, linux-spi, lkml

Hi Yogesh,

Thanks for your patch!

On Fri, Aug 31, 2018 at 12:33 PM Yogesh Gaur [off-list ref] wrote:
Add 'size' data variable in spi_device struct.
This is to save the size of the connected slave device.
What is the "size" of an SPI slave device?
After slave device scan, spi_nor_scan, size being assigned to this
from MTD layer.
Ah, this is MTD specific?
SFDP read is being requested before completion of spi_nor_scan()
routine, thus populate device size before making read request
to the SPI controller.

Signed-off-by: Yogesh Gaur <redacted>
quoted hunk ↗ jump to hunk
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -127,6 +127,7 @@ void spi_statistics_add_transfer_stats(struct spi_statistics *stats,
  *     for driver coldplugging, and in uevents used for hotplugging
  * @cs_gpio: gpio number of the chipselect line (optional, -ENOENT when
  *     not using a GPIO line)
+ * @size: size of the connected slave device
Please document what is the meaning of "size".
quoted hunk ↗ jump to hunk
  *
  * @statistics: statistics for the spi_device
  *
@@ -168,6 +169,7 @@ struct spi_device {
        void                    *controller_data;
        char                    modalias[SPI_NAME_SIZE];
        int                     cs_gpio;        /* chip select gpio */
+       u32                     size;           /* size of slave device */

        /* the statistics */
        struct spi_statistics   statistics;
Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help