I am using a custom board based on the AGX Xavier.
Currently, I am trying to ignore i2c write execution by using the skip-mux-detect option in DT.
However, even when using the option, the i2c write still executes, printing ‘probe failed’.
When I checked the pca954x_probe function in the i2c-mux-pca954x.c code, I found the following sequence:
In Jetpack 4, it was as follows:
-
goto pca954x_probe_skip_detect
-
i2c_smbus_write_byte
-
pca954x_probe_skip_detect:
I confirmed that starting with Jetpack 5, it has changed as follows:
- goto pca954x_probe_skip_detect
- pca954x_probe_skip_detect:
- pca954x_init
- i2c_smbus_write_byte
I am currently using this with the execution order changed, just like in Jetpack 4.
However, I have a few questions.
I am curious about the reason for changing the execution order in Jetpack 5 and whether this change was intentional.
Also, please confirm if there have been any related issues.
Jetpack 4.6.5
fskip = of_property_read_bool(client->dev.of_node, "skip_mux_detect"); if (fskip) { dev_info(&client->dev, "device detect skipped.\\n"); goto pca954x_probe_skip_detect; } /\* Write the mux register at addr to verify \* that the mux is in fact present. This also \* initializes the mux to disconnected state. \*/ if (i2c_smbus_write_byte(client, 0) < 0) { dev_warn(&client->dev, "probe failed\\n"); return -ENODEV; } pca954x_probe_skip_detect: match = of_match_device(of_match_ptr(pca954x_of_match), &client->dev); if (match) data->chip = of_device_get_match_data(&client->dev); else data->chip = &chips\[id->driver_data\]; data->last_chan = 0; /\* force the first selection \*/ idle_disconnect_dt = of_node && of_property_read_bool(of_node, "i2c-mux-idle-disconnect");Jetpack 5.0.2
fskip = of_property_read_bool(client->dev.of_node, "skip_mux_detect"); if (fskip) { dev_info(&client->dev, "device detect skipped.\\n"); goto pca954x_probe_skip_detect; } pca954x_probe_skip_detect: data->chip = device_get_match_data(dev); if (!data->chip) data->chip = &chips\[id->driver_data\]; data->last_chan = 0; /\* force the first selection \*/ if (data->chip->id.manufacturer_id != I2C_DEVICE_ID_NONE) { struct i2c_device_identity id; ret = i2c_get_device_id(client, &id); if (ret && ret != -EOPNOTSUPP) return ret; if (!ret && (id.manufacturer_id != data->chip->id.manufacturer_id || id.part_id != data->chip->id.part_id)) { dev_warn(dev, "unexpected device id %03x-%03x-%x\\n", id.manufacturer_id, id.part_id, id.die_revision); return -ENODEV; } } data->idle_state = MUX_IDLE_AS_IS; if (device_property_read_u32(dev, "idle-state", &data->idle_state)) { if (device_property_read_bool(dev, "i2c-mux-idle-disconnect")) data->idle_state = MUX_IDLE_DISCONNECT; } /\* \* Write the mux register at addr to verify \* that the mux is in fact present. This also \* initializes the mux to a channel \* or disconnected state. \*/ ret = pca954x_init(client, data); if (ret < 0) { dev_warn(dev, "probe failed\\n"); goto fail_cleanup; }