Blame view
include/i2c_eeprom.h
1.4 KB
83d290c56 SPDX: Convert all... |
1 |
/* SPDX-License-Identifier: GPL-2.0+ */ |
20142019a dm: Add a simple ... |
2 3 |
/* * Copyright (c) 2014 Google, Inc |
20142019a dm: Add a simple ... |
4 5 6 7 8 9 10 11 12 |
*/ #ifndef __I2C_EEPROM #define __I2C_EEPROM struct i2c_eeprom_ops { int (*read)(struct udevice *dev, int offset, uint8_t *buf, int size); int (*write)(struct udevice *dev, int offset, const uint8_t *buf, int size); |
033e18b47 misc: i2c_eeprom:... |
13 |
int (*size)(struct udevice *dev); |
20142019a dm: Add a simple ... |
14 15 16 |
}; struct i2c_eeprom { |
d7e28918a i2c_eeprom: Add r... |
17 18 19 20 |
/* The EEPROM's page size in byte */ unsigned long pagesize; /* The EEPROM's page width in bits (pagesize = 2^pagewidth) */ unsigned pagewidth; |
033e18b47 misc: i2c_eeprom:... |
21 22 |
/* The EEPROM's capacity in bytes */ unsigned long size; |
20142019a dm: Add a simple ... |
23 |
}; |
8880efbd1 i2c_eeprom: add r... |
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
/* * i2c_eeprom_read() - read bytes from an I2C EEPROM chip * * @dev: Chip to read from * @offset: Offset within chip to start reading * @buf: Place to put data * @size: Number of bytes to read * * @return 0 on success, -ve on failure */ int i2c_eeprom_read(struct udevice *dev, int offset, uint8_t *buf, int size); /* * i2c_eeprom_write() - write bytes to an I2C EEPROM chip * * @dev: Chip to write to * @offset: Offset within chip to start writing * @buf: Buffer containing data to write * @size: Number of bytes to write * * @return 0 on success, -ve on failure */ int i2c_eeprom_write(struct udevice *dev, int offset, uint8_t *buf, int size); |
033e18b47 misc: i2c_eeprom:... |
47 48 49 50 51 52 53 54 |
/* * i2c_eeprom_size() - get size of I2C EEPROM chip * * @dev: Chip to query * * @return +ve size in bytes on success, -ve on failure */ int i2c_eeprom_size(struct udevice *dev); |
20142019a dm: Add a simple ... |
55 |
#endif |