Skip to contentSkip to conversation

i2c: slave-eeprom: Make it possible to pre-load eeprom data

PATCH Wolfram Sang 1 participant 1 message Apr 20, 2020 1 message not in the archive I2C subsystem host drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 4 lines · Björn Ardö

If the slave eeprom has a "firmware-name" in devicetree, then pre-load the data in the eeprom with this file.

Sorry that it got postponed so many times :(

Quoted 1 line

+static int i2c_slave_preload_eeprom_data(struct eeprom_data *eeprom, struct i2c_client *client, unsigned int size)

I totally agree with merging the patch "i2c: slave-eeprom: initialize empty eeprom properly" [1] into this one, so we get proper memory init at the end of this function. It should be renamed to "i2c_slave_init_eeprom_data" then, probably...

Review

Quoted 5 lines
(quoted diff) +5 -0
+{
+	if (client->dev.of_node) {
+		const struct firmware *fw;
+		const char *eeprom_data;
+		if (!of_property_read_string(client->dev.of_node, "firmware-name", &eeprom_data)) {

Can you switch to device_property_read_string() and friends? I think the ACPI world may also be interested in this feature.

All the rest looks good, thanks!