summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Eggers <ceggers@arri.de>2020-01-27 08:41:15 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-01-27 14:01:34 +0100
commit9423e5b3208b372fd77987ed0cd04082c615b14f (patch)
tree3b98b71b72e0d347212131cefe5f1849891942c3
parent960352f2dab113b92e88958722e80477abc49191 (diff)
downloadbarebox-9423e5b3208b372fd77987ed0cd04082c615b14f.tar.gz
eeprom: at25: Allow page sizes greater than 16 bit
For FRAM devices the page size is usually equal to the device size. Some available devices are greater than 64kB, so a 32 bit variable must be used. The same change has to be done for the Linux driver. I'll try to upstream this as soon as possible. Signed-off-by: Christian Eggers <ceggers@arri.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/eeprom/at25.c2
-rw-r--r--include/spi/eeprom.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/eeprom/at25.c b/drivers/eeprom/at25.c
index 1c9ef12321..56168c216d 100644
--- a/drivers/eeprom/at25.c
+++ b/drivers/eeprom/at25.c
@@ -259,7 +259,7 @@ static int at25_np_to_chip(struct device_d *dev,
if (of_property_read_u32(np, "pagesize", &val) == 0 ||
of_property_read_u32(np, "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;
diff --git a/include/spi/eeprom.h b/include/spi/eeprom.h
index 15495e59f5..137718f026 100644
--- a/include/spi/eeprom.h
+++ b/include/spi/eeprom.h
@@ -10,7 +10,7 @@
*/
struct spi_eeprom {
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 */