Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6cc88425 authored by Sudheer Papothi's avatar Sudheer Papothi Committed by Laxminath Kasam
Browse files

hal: get wsa881x temperature zone names using key value pair

Use key value pair config parameters to set wsa881x temperature
zone sensor names in speaker protection module for getting
corresponding temperature zone handles.

Change-Id: I90d52a015c4cfc3937605d821cbc574ab0c2a75e
parent d9b48c67
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -187,6 +187,9 @@ int get_tzn(const char *sensor_name)
    char name[MAX_PATH] = {0};
    char cwd[MAX_PATH] = {0};

    if (!sensor_name)
        return found;

    if (!getcwd(cwd, sizeof(cwd)))
        return found;

@@ -210,11 +213,12 @@ int get_tzn(const char *sensor_name)
            if (strcmp(tzdirent->d_name, "type"))
                continue;
            snprintf(name, MAX_PATH, TZ_TYPE, tzn);
            ALOGD("Opening %s\n", name);
            ALOGV("Opening %s\n", name);
            read_line_from_file(name, buf, sizeof(buf));
            if (strlen(buf) > 0)
                buf[strlen(buf) - 1] = '\0';
            if (!strcmp(buf, sensor_name)) {
                ALOGD(" spkr tz name found, %s\n", name);
                found = 1;
                break;
            }