Thread (34 messages) 34 messages, 8 authors, 2013-12-18
STALE4561d
Revisions (12)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v1 [diff vs current]
  4. v1 [diff vs current]
  5. v2 [diff vs current]
  6. v2 [diff vs current]
  7. v2 [diff vs current]
  8. v2 [diff vs current]
  9. v3 [diff vs current]
  10. v3 [diff vs current]
  11. v3 [diff vs current]
  12. v3 current

[PATCH v3 2/7] mtd: spi-nor: add the basic data structures

From: marex@denx.de (Marek Vasut)
Date: 2013-12-17 15:16:56
Also in: linux-spi

On Tuesday, December 17, 2013 at 02:49:25 PM, Huang Shijie wrote:
On Tue, Dec 17, 2013 at 02:05:55PM +0100, Marek Vasut wrote:
quoted
On Monday, December 16, 2013 at 09:58:45 AM, Huang Shijie wrote:
quoted
+struct spi_nor { > > +	struct mtd_info		*mtd;
+	struct mutex		lock;
+
+	/* pointer to a spi device */
+	struct device		*dev;
+	u32			page_size;
+	u8			addr_width;
+	u8			erase_opcode;
+	u8			read_opcode;
+	u8			read_dummy;
+	u8			program_opcode;
+	enum read_mode		flash_read;
+	bool			sst_write_second;
+	struct spi_nor_xfer_cfg	cfg;
You do want to split the function pointers below and the device
configuration above into separate structures.
sorry, i prefer to keep them in one data structrue, just like the
nand_chip{} does.
Can you explain why?
quoted
quoted
+	/* for write_reg */
+	u8			cmd_buf[SPI_NOR_MAX_CMD_SIZE];
+
+	/*
+	 * Do some work before or after we run these operations:
+	 *   read/write/erese/lock/unlock
Proper kernel-doc style comments for this structure would be nice.
Do you mean the style used by nand_chip{}?
Yes. See Documentation/kernel-doc-nano-HOWTO.txt

Best regards,
Marek Vasut
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help