xref: /openbmc/linux/include/linux/eeprom_93xx46.h (revision 3ca9b1ac)
106b4501eSAnatolij Gustschin /*
206b4501eSAnatolij Gustschin  * Module: eeprom_93xx46
306b4501eSAnatolij Gustschin  * platform description for 93xx46 EEPROMs.
406b4501eSAnatolij Gustschin  */
506b4501eSAnatolij Gustschin 
63ca9b1acSCory Tusar struct gpio_desc;
73ca9b1acSCory Tusar 
806b4501eSAnatolij Gustschin struct eeprom_93xx46_platform_data {
906b4501eSAnatolij Gustschin 	unsigned char	flags;
1006b4501eSAnatolij Gustschin #define EE_ADDR8	0x01		/*  8 bit addr. cfg */
1106b4501eSAnatolij Gustschin #define EE_ADDR16	0x02		/* 16 bit addr. cfg */
1206b4501eSAnatolij Gustschin #define EE_READONLY	0x08		/* forbid writing */
1306b4501eSAnatolij Gustschin 
14e1379b56SCory Tusar 	unsigned int	quirks;
15e1379b56SCory Tusar /* Single word read transfers only; no sequential read. */
16e1379b56SCory Tusar #define EEPROM_93XX46_QUIRK_SINGLE_WORD_READ		(1 << 0)
17e1379b56SCory Tusar /* Instructions such as EWEN are (addrlen + 2) in length. */
18e1379b56SCory Tusar #define EEPROM_93XX46_QUIRK_INSTRUCTION_LENGTH		(1 << 1)
19e1379b56SCory Tusar 
2006b4501eSAnatolij Gustschin 	/*
2106b4501eSAnatolij Gustschin 	 * optional hooks to control additional logic
2206b4501eSAnatolij Gustschin 	 * before and after spi transfer.
2306b4501eSAnatolij Gustschin 	 */
2406b4501eSAnatolij Gustschin 	void (*prepare)(void *);
2506b4501eSAnatolij Gustschin 	void (*finish)(void *);
263ca9b1acSCory Tusar 	struct gpio_desc *select;
2706b4501eSAnatolij Gustschin };
28