Skip to content

Commit

Permalink
Fix i2c bus selection on hisilicon devices
Browse files Browse the repository at this point in the history
  • Loading branch information
dimerr committed Jan 14, 2025
1 parent ab934f9 commit 929840d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hal/hisi/hal_hisi.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ static sensor_addr_t my_possible_i2c_addrs[] = {

static float hisi_get_temp();

static int hisi_open_i2c_fd() {
int adapter_nr = 0; /* probably dynamically determined */
static int hisi_open_i2c_fd(int i2c_adapter_nr) {
char filename[FILENAME_MAX];

snprintf(filename, sizeof(filename), "/dev/i2c-%d", adapter_nr);
snprintf(filename, sizeof(filename), "/dev/i2c-%d", i2c_adapter_nr);

return universal_open_sensor_fd(filename);
}
Expand Down

0 comments on commit 929840d

Please sign in to comment.