blob: eec7928ff8fe043a9d10e790a184a908aa14cb4e [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Anatolij Gustschin06b45012011-07-25 17:13:27 -07002/*
3 * Module: eeprom_93xx46
4 * platform description for 93xx46 EEPROMs.
5 */
Fabio Estevame0552572017-07-19 23:35:29 -03006#include <linux/gpio/consumer.h>
Cory Tusar3ca9b1a2016-02-10 14:32:08 -05007
Anatolij Gustschin06b45012011-07-25 17:13:27 -07008struct eeprom_93xx46_platform_data {
9 unsigned char flags;
10#define EE_ADDR8 0x01 /* 8 bit addr. cfg */
11#define EE_ADDR16 0x02 /* 16 bit addr. cfg */
12#define EE_READONLY 0x08 /* forbid writing */
13
Cory Tusare1379b52016-02-10 14:32:07 -050014 unsigned int quirks;
15/* Single word read transfers only; no sequential read. */
16#define EEPROM_93XX46_QUIRK_SINGLE_WORD_READ (1 << 0)
17/* Instructions such as EWEN are (addrlen + 2) in length. */
18#define EEPROM_93XX46_QUIRK_INSTRUCTION_LENGTH (1 << 1)
19
Anatolij Gustschin06b45012011-07-25 17:13:27 -070020 /*
21 * optional hooks to control additional logic
22 * before and after spi transfer.
23 */
24 void (*prepare)(void *);
25 void (*finish)(void *);
Cory Tusar3ca9b1a2016-02-10 14:32:08 -050026 struct gpio_desc *select;
Anatolij Gustschin06b45012011-07-25 17:13:27 -070027};