From b4161f0bb5f815ca6d8108062b8e3b650c18fe39 Mon Sep 17 00:00:00 2001 From: Ivo Sieben Date: Wed, 18 Apr 2012 08:29:34 +0200 Subject: Support M95040 SPI EEPROM Updated the generic SPI EEPROM driver AT25 for support of an additional address bit in the instruction byte. Certain EEPROMS have a size that is larger than the number of address bytes would allow (e.g. like M95040 from ST that has 512 Byte size but uses only one address byte (A0 to A7) for addressing.) For the extra address bit (A8, A16 or A24) bit 3 of the instruction byte is used. This instruction bit is normally defined as don't care for other AT25 like chips. Reviewed-by: Wolfram Sang Signed-off-by: Ivo Sieben Acked-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- include/linux/spi/eeprom.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/linux') diff --git a/include/linux/spi/eeprom.h b/include/linux/spi/eeprom.h index 306e7b1c69ed..403e007aef68 100644 --- a/include/linux/spi/eeprom.h +++ b/include/linux/spi/eeprom.h @@ -20,6 +20,16 @@ struct spi_eeprom { #define EE_ADDR3 0x0004 /* 24 bit addrs */ #define EE_READONLY 0x0008 /* disallow writes */ + /* + * Certain EEPROMS have a size that is larger than the number of address + * bytes would allow (e.g. like M95040 from ST that has 512 Byte size + * but uses only one address byte (A0 to A7) for addressing.) For + * the extra address bit (A8, A16 or A24) bit 3 of the instruction byte + * is used. This instruction bit is normally defined as don't care for + * other AT25 like chips. + */ +#define EE_INSTR_BIT3_IS_ADDR 0x0010 + /* for exporting this chip's data to other kernel code */ void (*setup)(struct memory_accessor *mem, void *context); void *context; -- cgit v1.2.3