Skip to content

Commit

Permalink
Add SC8238
Browse files Browse the repository at this point in the history
  • Loading branch information
dimerr committed Apr 20, 2024
1 parent b60eb30 commit 612247f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hal/xm.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static sensor_addr_t xm_possible_i2c_addrs[] = {{SENSOR_SONY, sony_addrs},
{SENSOR_BRIGATES, bg_addrs},
{0, NULL}};

int xm_open_sensor_fd() { return universal_open_sensor_fd("/dev/xm_i2c"); }
int xm_open_sensor_fd() { return universal_open_sensor_fd("/dev/i2c0"); }

int xm_sensor_read_register(int fd, unsigned char i2c_addr,
unsigned int reg_addr, unsigned int reg_width,
Expand Down Expand Up @@ -75,9 +75,9 @@ static void xm_hal_cleanup() { restore_printk(); }
void setup_hal_xm() {
disable_printk();
open_i2c_sensor_fd = xm_open_sensor_fd;
i2c_change_addr = dummy_sensor_i2c_change_addr;
i2c_read_register = xm_sensor_read_register;
i2c_write_register = xm_sensor_write_register;
// i2c_change_addr = dummy_sensor_i2c_change_addr;
// i2c_read_register = xm_sensor_read_register;
// i2c_write_register = xm_sensor_write_register;
possible_i2c_addrs = xm_possible_i2c_addrs;
hal_cleanup = xm_hal_cleanup;
#ifndef STANDALONE_LIBRARY
Expand Down
3 changes: 3 additions & 0 deletions src/sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,9 @@ static int detect_smartsens_sensor(sensor_ctx_t *ctx, int fd,
case 0xbd1e:
strcpy(ctx->sensor_id, "SC850SL");
return true;
case 0x8235:
strcpy(ctx->sensor_id, "SC8238");
return true;
case 0x9b3a:
strcpy(ctx->sensor_id, "SC2336P");
return true;
Expand Down

0 comments on commit 612247f

Please sign in to comment.