From 612247f716d7cc67451806754041d4f2c02cc253 Mon Sep 17 00:00:00 2001 From: Dmitry Ermakov Date: Sat, 20 Apr 2024 13:24:00 +0300 Subject: [PATCH] Add SC8238 --- src/hal/xm.c | 8 ++++---- src/sensors.c | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/hal/xm.c b/src/hal/xm.c index 2d0dc6f..40dbe78 100644 --- a/src/hal/xm.c +++ b/src/hal/xm.c @@ -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, @@ -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 diff --git a/src/sensors.c b/src/sensors.c index 40d9013..42a612f 100644 --- a/src/sensors.c +++ b/src/sensors.c @@ -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;