Skip to content

Commit

Permalink
eeprom: at25: allow page sizes greater than 16 bit
Browse files Browse the repository at this point in the history
Storage technologies like FRAM have no "write pages", the whole chip can
be written within one SPI transfer. For these chips, the page size can
be set equal to the device size. Currently available devices are already
bigger than 64 kiB.

Signed-off-by: Christian Eggers <ceggers@arri.de>
Link: https://lore.kernel.org/r/20200727111218.26926-1-ceggers@arri.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Christian Eggers authored and Greg Kroah-Hartman committed Aug 28, 2020
1 parent d162219 commit d3cd007
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/misc/eeprom/at25.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static int at25_fw_to_chip(struct device *dev, struct spi_eeprom *chip)

if (device_property_read_u32(dev, "pagesize", &val) == 0 ||
device_property_read_u32(dev, "at25,page-size", &val) == 0) {
chip->page_size = (u16)val;
chip->page_size = val;
} else {
dev_err(dev, "Error: missing \"pagesize\" property\n");
return -ENODEV;
Expand Down
2 changes: 1 addition & 1 deletion include/linux/spi/eeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
struct spi_eeprom {
u32 byte_len;
char name[10];
u16 page_size; /* for writes */
u32 page_size; /* for writes */
u16 flags;
#define EE_ADDR1 0x0001 /* 8 bit addrs */
#define EE_ADDR2 0x0002 /* 16 bit addrs */
Expand Down

0 comments on commit d3cd007

Please sign in to comment.