summaryrefslogtreecommitdiff
path: root/include/linux/eeprom_93xx46.h
diff options
context:
space:
mode:
authorCory Tusar <cory.tusar@pid1solutions.com>2016-02-10 22:32:07 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-12 06:23:28 +0300
commite1379b56e9e88653fcb58cbaa71cd6b1cc304918 (patch)
tree4c95727d77b5300877148d3782e23b66494c8c16 /include/linux/eeprom_93xx46.h
parentcf09d6428de3aa6bb6a8164d86bc1cc0cd678d8e (diff)
downloadlinux-e1379b56e9e88653fcb58cbaa71cd6b1cc304918.tar.xz
misc: eeprom_93xx46: Add quirks to support Atmel AT93C46D device.
Atmel devices in this family have some quirks not found in other similar chips - they do not support a sequential read of the entire EEPROM contents, and the control word sent at the start of each operation varies in bit length. This commit adds quirk support to the driver and modifies the read implementation to support non-sequential reads for consistency with other misc/eeprom drivers. Tested on a custom Freescale VF610-based platform, with an AT93C46D device attached via dspi2. The spi-gpio driver was used to allow the necessary non-byte-sized transfers. Signed-off-by: Cory Tusar <cory.tusar@pid1solutions.com> Tested-by: Chris Healy <chris.healy@zii.aero> Reviewed-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/eeprom_93xx46.h')
-rw-r--r--include/linux/eeprom_93xx46.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/eeprom_93xx46.h b/include/linux/eeprom_93xx46.h
index 06791811e49d..92fa4c37ac1f 100644
--- a/include/linux/eeprom_93xx46.h
+++ b/include/linux/eeprom_93xx46.h
@@ -9,6 +9,12 @@ struct eeprom_93xx46_platform_data {
#define EE_ADDR16 0x02 /* 16 bit addr. cfg */
#define EE_READONLY 0x08 /* forbid writing */
+ unsigned int quirks;
+/* Single word read transfers only; no sequential read. */
+#define EEPROM_93XX46_QUIRK_SINGLE_WORD_READ (1 << 0)
+/* Instructions such as EWEN are (addrlen + 2) in length. */
+#define EEPROM_93XX46_QUIRK_INSTRUCTION_LENGTH (1 << 1)
+
/*
* optional hooks to control additional logic
* before and after spi transfer.