blob: 730d963ab966c713302db1efe4994357f1bf6cf6 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Nikita Kiryanovaa9e6042016-04-16 17:55:03 +03002/*
3 * (C) Copyright 2009-2016 CompuLab, Ltd.
4 *
5 * Authors: Nikita Kiryanov <nikita@compulab.co.il>
6 * Igor Grinberg <grinberg@compulab.co.il>
Nikita Kiryanovaa9e6042016-04-16 17:55:03 +03007 */
8
9#ifndef _LAYOUT_
10#define _LAYOUT_
11
12#define RESERVED_FIELDS NULL
13#define LAYOUT_VERSION_UNRECOGNIZED -1
14#define LAYOUT_VERSION_AUTODETECT -2
15
16struct eeprom_layout {
17 struct eeprom_field *fields;
18 int num_of_fields;
19 int layout_version;
20 unsigned char *data;
21 int data_size;
22 void (*print)(const struct eeprom_layout *eeprom_layout);
23 int (*update)(struct eeprom_layout *eeprom_layout, char *field_name,
24 char *new_data);
25};
26
27void eeprom_layout_setup(struct eeprom_layout *layout, unsigned char *buf,
28 unsigned int buf_size, int layout_version);
29__weak void __eeprom_layout_assign(struct eeprom_layout *layout,
30 int layout_version);
31
32#endif