[Bugfix][T108][bug-view-1924]Fix LOG Error in gsw_hwpin
Only Configure: No
Affected branch: GSW_V1453
Affected module: gsw_hwpin
Is it affected on IC: only ASR
Self-test: yes
Doc Update: no
Change-Id: I40921e1c03f1eec85b68b6b5f645c24022c0752d
diff --git a/mbtk/libgsw_lib/gsw_hwpin_interface.c b/mbtk/libgsw_lib/gsw_hwpin_interface.c
index af452ac..8b55b6c 100755
--- a/mbtk/libgsw_lib/gsw_hwpin_interface.c
+++ b/mbtk/libgsw_lib/gsw_hwpin_interface.c
@@ -9,94 +9,11 @@
#include "gsw_hwpin_interface.h"
#include "gsw_hal_errcode.h"
+#include "gsw_log_interface.h"
-#ifndef LOG_ERR_LEVEL
-#define LOG_ERR_LEVEL 3 /* error conditions */
-#endif
-#ifndef LOG_WARN_LEVEL
-#define LOG_WARN_LEVEL 4 /* warning conditions */
-#endif
-#ifndef LOG_INFO_LEVEL
-#define LOG_INFO_LEVEL 6 /* informational */
-#endif
-#ifndef LOG_DEBUG_LEVEL
-#define LOG_DEBUG_LEVEL 7 /* debug-level messages */
-#endif
-#ifndef LOG_VERBOSE_LEVEL
-#define LOG_VERBOSE_LEVEL 8
-#endif
#define GSW_GPIO "[HAL][GSW_GPIO]"
-#define LOGV(fmt, args ...) \
- do{ \
- char *file_ptr_1001 = __FILE__; \
- char *ptr_1001 = file_ptr_1001 + strlen(file_ptr_1001) - 1; \
- char line_1001[10] = {0}; \
- sprintf(line_1001, "%d", __LINE__); \
- while(ptr_1001 >= file_ptr_1001 && *ptr_1001){ \
- if(*ptr_1001 == '/') \
- break; \
- ptr_1001--; \
- } \
- fun_ptr_log(LOG_VERBOSE_LEVEL, "%s#%s: "GSW_GPIO"" fmt, ptr_1001 + 1, line_1001, ##args); \
- } while(0)
-
-#define LOGI(fmt, args...) \
- do{ \
- char *file_ptr_1001 = __FILE__; \
- char *ptr_1001 = file_ptr_1001 + strlen(file_ptr_1001) - 1; \
- char line_1001[10] = {0}; \
- sprintf(line_1001, "%d", __LINE__); \
- while(ptr_1001 >= file_ptr_1001 && *ptr_1001){ \
- if(*ptr_1001 == '/') \
- break; \
- ptr_1001--; \
- } \
- fun_ptr_log(LOG_INFO_LEVEL, "%s#%s: "GSW_GPIO"" fmt, ptr_1001 + 1, line_1001, ##args); \
- } while(0)
-
-#define LOGD(fmt, args...) \
- do{ \
- char *file_ptr_1001 = __FILE__; \
- char *ptr_1001 = file_ptr_1001 + strlen(file_ptr_1001) - 1; \
- char line_1001[10] = {0}; \
- sprintf(line_1001, "%d", __LINE__); \
- while(ptr_1001 >= file_ptr_1001 && *ptr_1001){ \
- if(*ptr_1001 == '/') \
- break; \
- ptr_1001--; \
- } \
- fun_ptr_log(LOG_DEBUG_LEVEL, "%s#%s: "GSW_GPIO"" fmt, ptr_1001 + 1, line_1001, ##args); \
- } while(0)
-
-#define LOGW(fmt, args...) \
- do{ \
- char *file_ptr_1001 = __FILE__; \
- char *ptr_1001 = file_ptr_1001 + strlen(file_ptr_1001) - 1; \
- char line_1001[10] = {0}; \
- sprintf(line_1001, "%d", __LINE__); \
- while(ptr_1001 >= file_ptr_1001 && *ptr_1001){ \
- if(*ptr_1001 == '/') \
- break; \
- ptr_1001--; \
- } \
- fun_ptr_log(LOG_WARN_LEVEL, "%s#%s: "GSW_GPIO"" fmt, ptr_1001 + 1, line_1001, ##args); \
- } while(0)
-
-#define LOGE(fmt, args...) \
- do{ \
- char *file_ptr_1001 = __FILE__; \
- char *ptr_1001 = file_ptr_1001 + strlen(file_ptr_1001) - 1; \
- char line_1001[10] = {0}; \
- sprintf(line_1001, "%d", __LINE__); \
- while(ptr_1001 >= file_ptr_1001 && *ptr_1001){ \
- if(*ptr_1001 == '/') \
- break; \
- ptr_1001--; \
- } \
- fun_ptr_log(LOG_ERR_LEVEL, "%s#%s: "GSW_GPIO"" fmt, ptr_1001 + 1, line_1001, ##args); \
- } while(0)
#define wakeout 117
@@ -120,10 +37,9 @@
GSW_HAL_USB_DISCONNECTED,
GSW_HAL_USB_CONNECTED,
}gsw_hal_usbStatus;
-typedef void (*mbtk_log)(int level, const char *format,...);
-static mbtk_log fun_ptr_log = NULL;
-void *dlHandle_gpio = NULL;
-char *lynqLib_gpio = "/lib/libmbtk_lib.so";
+//typedef void (*mbtk_log)(int level, const char *format,...);
+//static mbtk_log fun_ptr_log = NULL;
+
int gpio_check(int gpio)
{
@@ -133,19 +49,6 @@
return access(buffer , F_OK);
}
-static int handle()
-{
- if(dlHandle_gpio == NULL || fun_ptr_log == NULL)
- {
- dlHandle_gpio = dlopen(lynqLib_gpio, RTLD_NOW);
- fun_ptr_log = (mbtk_log)dlsym(dlHandle_gpio, "mbtk_log");
- if(fun_ptr_log == NULL || dlHandle_gpio == NULL)
- {
- return GSW_HAL_NORMAL_FAIL;
- }
- }
- return GSW_HAL_SUCCESS;
-}
static int gpio_export(int gpio)
{
@@ -155,14 +58,14 @@
if (gpio_check(gpio) == 0)
{
- LOGE("export has been add\n");
+ LOGE(GSW_GPIO, "export has been add\n");
return 0;
}
file = open("/sys/class/gpio/export",O_WRONLY);
if(file == -1)
{
- LOGE("Open gpio export file fail.");
+ LOGE(GSW_GPIO, "Open gpio export file fail.");
return -1;
}
@@ -170,7 +73,7 @@
result = write(file,pin_index_buffer,strlen(pin_index_buffer));
if(result < 0)
{
- LOGE("Gpio[%d] export fail.", gpio);
+ LOGE(GSW_GPIO, "Gpio[%d] export fail.", gpio);
close(file);
return -1;
}
@@ -186,14 +89,14 @@
char pin_index_buffer[5]= {0};
if (gpio_check(gpio) == -1)
{
- LOGE("export has been not add\n");
+ LOGE(GSW_GPIO, "export has been not add\n");
return -1;
}
file = open("/sys/class/gpio/unexport",O_WRONLY);
if(file == -1)
{
- LOGE("Open gpio unexport file fail.");
+ LOGE(GSW_GPIO, "Open gpio unexport file fail.");
return -1;
}
@@ -202,7 +105,7 @@
if(result < 0)
{
close(file);
- LOGE("Gpio[%d] unexport fail.", gpio);
+ LOGE(GSW_GPIO, "Gpio[%d] unexport fail.", gpio);
return -1;
}
close(file);
@@ -217,12 +120,10 @@
int result =-1;
char direction[10] = {0};
memset(buffer,0,128);
- if (handle())
- return GSW_HAL_NORMAL_FAIL;
-
+
if (gpio_check(gpioNum) == -1)
{
- LOGD("in dir export has been not add\n");
+ LOGD(GSW_GPIO, "in dir export has been not add\n");
gpio_export(gpioNum);
}
@@ -231,7 +132,7 @@
file = open(buffer, O_WRONLY);
if(file == -1)
{
- LOGE("Open gpio[%d] direct fail.", gpioNum);
+ LOGE(GSW_GPIO, "Open gpio[%d] direct fail.", gpioNum);
return -1;
}
if (dir == GSW_HAL_PINDIR_IN)
@@ -242,7 +143,7 @@
result = write(file,direction,strlen(direction));
if(result != strlen(direction))
{
- LOGE("Set gpio[%d] direct fail.", gpioNum);
+ LOGE(GSW_GPIO, "Set gpio[%d] direct fail.", gpioNum);
close(file);
gpio_unexport(gpioNum);
return GSW_HAL_NORMAL_FAIL;
@@ -260,25 +161,23 @@
int result =-1;
memset(path,0,sizeof(path));
memset(buffer,0,sizeof(buffer));
- if (handle())
- return GSW_HAL_NORMAL_FAIL;
if (gpio_check(gpioNum) == -1)
{
- LOGD("in get value export has been not add\n");
+ LOGD(GSW_GPIO, "in get value export has been not add\n");
gpio_export(gpioNum);
}
sprintf(path,"/sys/class/gpio/gpio%u/value", gpioNum);
file = open(path,O_RDONLY);
if(file == -1)
{
- LOGE("Open gpio[%d] fail.", gpioNum);
+ LOGE(GSW_GPIO, "Open gpio[%d] fail.", gpioNum);
return -1;
}
result = read(file,buffer,50);
if(result <= 0)
{
- LOGE("Get gpio[%d] value fail", gpioNum);
+ LOGE(GSW_GPIO, "Get gpio[%d] value fail", gpioNum);
close(file);
gpio_unexport(gpioNum);
return GSW_HAL_NORMAL_FAIL;
@@ -294,12 +193,10 @@
int file =-1;
int result =-1;
memset(buffer,0,50);
- if (handle())
- return GSW_HAL_NORMAL_FAIL;
if (gpio_check(gpioNum) == -1)
{
- LOGD("in set value export has been not add\n");
+ LOGD(GSW_GPIO, "in set value export has been not add\n");
gpio_export(gpioNum);
}
@@ -307,7 +204,7 @@
file = open(buffer,O_WRONLY);
if(file == -1)
{
- LOGE("Open gpio[%d] value fail.", gpioNum);
+ LOGE(GSW_GPIO, "Open gpio[%d] value fail.", gpioNum);
return -1;
}
if(level == GSW_HAL_LEVEL_LOW) {
@@ -317,7 +214,7 @@
}
if(result != 1)
{
- LOGE("Set gpio[%d] value fail err =%d.", gpioNum, errno);
+ LOGE(GSW_GPIO, "Set gpio[%d] value fail err =%d.", gpioNum, errno);
close(file);
gpio_unexport(gpioNum);
return GSW_HAL_NORMAL_FAIL;
@@ -330,36 +227,33 @@
int32_t gsw_gpio_Init(uint32_t gpioNum, gsw_hal_pinDirection dir, gsw_hal_pinLevel level, gsw_hal_pinPullSel pullsel)
{
- if (handle())
- return GSW_HAL_NORMAL_FAIL;
-
if (dir != 1 && dir != 0)
{
- LOGE("[lynq_gpio_init] direction fail.");
+ LOGE(GSW_GPIO, "[lynq_gpio_init] direction fail.");
return -1;
}
if (level != 1 && level != 0)
{
- LOGE("[lynq_gpio_init] value fail.");
+ LOGE(GSW_GPIO, "[lynq_gpio_init] value fail.");
return GSW_HAL_NORMAL_FAIL;
}
if(gpio_export(gpioNum))
{
- LOGE("[lynq_gpio_init]gpio_export fail.");
+ LOGE(GSW_GPIO, "[lynq_gpio_init]gpio_export fail.");
return GSW_HAL_NORMAL_FAIL;
}
if(gsw_gpio_SetDirection(gpioNum, dir))
{
- LOGE("[lynq_gpio_init]gpio_direct_set fail.");
+ LOGE(GSW_GPIO, "[lynq_gpio_init]gpio_direct_set fail.");
return GSW_HAL_NORMAL_FAIL;
}
if(dir == 1 && (gsw_gpio_SetLevel(gpioNum, level) != 0))
{
- LOGE("[lynq_gpio_init]gpio_value_set fail.");
+ LOGE(GSW_GPIO, "[lynq_gpio_init]gpio_value_set fail.");
return GSW_HAL_NORMAL_FAIL;
}
return GSW_HAL_SUCCESS;
@@ -371,13 +265,11 @@
char tmp_rsp[20] = {0};
//char *CONNECTED = "configured";
char *DISCONNECTED = "not attached";
- if (handle())
- return GSW_HAL_NORMAL_FAIL;
sprintf(cmd,"cat /sys/devices/platform/soc/d4200000.axi/c0000000.usb/udc/c0000000.usb/state");
fp=popen(cmd, "r");
if (fgets(tmp_rsp,sizeof(tmp_rsp),fp) == NULL)
- LOGE("gsw_hwpin_is_usb_connected fail.");
+ LOGE(GSW_GPIO, "gsw_hwpin_is_usb_connected fail.");
pclose(fp);
if (strncmp(tmp_rsp,DISCONNECTED,strlen(DISCONNECTED)) == 0)
return GSW_HAL_USB_DISCONNECTED;
@@ -408,21 +300,21 @@
{
if (0 != gsw_gpio_Init(MDM_RESET_MCU, GSW_HAL_PINDIR_OUT, GSW_HAL_LEVEL_LOW, GSW_HAL_PULL_DOWN))
{
- LOGE("init GPIO %d fail!", MDM_RESET_MCU);
+ LOGE(GSW_GPIO, "init GPIO %d fail!", MDM_RESET_MCU);
return GSW_HAL_NORMAL_FAIL;
}
usleep(1000);
if (0 != gsw_gpio_SetLevel(MDM_RESET_MCU, GSW_HAL_LEVEL_HIGH))
{
- LOGE("set GPIO %d : %d fail!", MDM_RESET_MCU, GSW_HAL_LEVEL_HIGH);
+ LOGE(GSW_GPIO, "set GPIO %d : %d fail!", MDM_RESET_MCU, GSW_HAL_LEVEL_HIGH);
return GSW_HAL_NORMAL_FAIL;
}
usleep(100000);
if (0 != gsw_gpio_SetLevel(MDM_RESET_MCU, GSW_HAL_LEVEL_LOW))
{
- LOGE("set GPIO %d : %d fail!", MDM_RESET_MCU, GSW_HAL_LEVEL_LOW);
+ LOGE(GSW_GPIO, "set GPIO %d : %d fail!", MDM_RESET_MCU, GSW_HAL_LEVEL_LOW);
return GSW_HAL_NORMAL_FAIL;
}
@@ -434,14 +326,14 @@
{
if (0 != gsw_gpio_Init(MDM_BOOT_MCU_CTRL, GSW_HAL_PINDIR_OUT, GSW_HAL_LEVEL_LOW, GSW_HAL_PULL_DOWN))
{
- LOGE("init GPIO %d fail!", MDM_BOOT_MCU_CTRL);
+ LOGE(GSW_GPIO, "init GPIO %d fail!", MDM_BOOT_MCU_CTRL);
return GSW_HAL_NORMAL_FAIL;
}
usleep(1000);
if (0 != gsw_gpio_SetLevel(MDM_BOOT_MCU_CTRL, GSW_HAL_LEVEL_HIGH))
{
- LOGE("set GPIO %d : %d fail!", MDM_BOOT_MCU_CTRL, GSW_HAL_LEVEL_HIGH);
+ LOGE(GSW_GPIO, "set GPIO %d : %d fail!", MDM_BOOT_MCU_CTRL, GSW_HAL_LEVEL_HIGH);
return GSW_HAL_NORMAL_FAIL;
}
@@ -453,14 +345,14 @@
{
if (0 != gsw_gpio_Init(MDM_BOOT_MCU_CTRL, GSW_HAL_PINDIR_OUT, GSW_HAL_LEVEL_LOW, GSW_HAL_PULL_DOWN))
{
- LOGE("init GPIO %d fail!", MDM_BOOT_MCU_CTRL);
+ LOGE(GSW_GPIO, "init GPIO %d fail!", MDM_BOOT_MCU_CTRL);
return GSW_HAL_NORMAL_FAIL;
}
usleep(1000);
if (0 != gsw_gpio_SetLevel(MDM_BOOT_MCU_CTRL, GSW_HAL_LEVEL_LOW))
{
- LOGE("set GPIO %d : %d fail!", MDM_BOOT_MCU_CTRL, GSW_HAL_LEVEL_LOW);
+ LOGE(GSW_GPIO, "set GPIO %d : %d fail!", MDM_BOOT_MCU_CTRL, GSW_HAL_LEVEL_LOW);
return GSW_HAL_NORMAL_FAIL;
}
@@ -482,14 +374,14 @@
{
if (0 != gsw_gpio_Init(MDM_PWRMDM_EN, GSW_HAL_PINDIR_OUT, GSW_HAL_LEVEL_LOW, GSW_HAL_PULL_DOWN))
{
- LOGE("init GPIO %d fail!", MDM_BOOT_MCU_CTRL);
+ LOGE(GSW_GPIO, "init GPIO %d fail!", MDM_BOOT_MCU_CTRL);
return GSW_HAL_NORMAL_FAIL;
}
usleep(1000);
if (0 != gsw_gpio_SetLevel(MDM_PWRMDM_EN, GSW_HAL_LEVEL_HIGH))
{
- LOGE("set GPIO %d : %d fail!", MDM_PWRMDM_EN, GSW_HAL_LEVEL_HIGH);
+ LOGE(GSW_GPIO, "set GPIO %d : %d fail!", MDM_PWRMDM_EN, GSW_HAL_LEVEL_HIGH);
return GSW_HAL_NORMAL_FAIL;
}
@@ -508,7 +400,7 @@
{
if (0 != gsw_setWakeupLevel(GSW_HAL_LEVEL_HIGH))
{
- LOGE("wakeup mcu fail!");
+ LOGE(GSW_GPIO, "wakeup mcu fail!");
return GSW_HAL_NORMAL_FAIL;
}
@@ -519,7 +411,7 @@
{
if (0 != gsw_setWakeupLevel(GSW_HAL_LEVEL_LOW))
{
- LOGE("wakeup mcu set low fail!");
+ LOGE(GSW_GPIO, "wakeup mcu set low fail!");
return GSW_HAL_NORMAL_FAIL;
}
@@ -532,7 +424,7 @@
int ret = 0;
fd = open(file, O_RDONLY);
if(fd <= 0) {
- LOGE("[hwpin] open file error %d,%s", fd, file);
+ LOGE(GSW_GPIO, "[hwpin] open file error %d,%s", fd, file);
return GSW_HAL_ERROR_FILE_OPEN;
}
if(value && len > 0) {
@@ -540,7 +432,7 @@
}
close(fd);
if(ret < 0) {
- LOGE("[hwpin] read file error %d,%s",ret, file);
+ LOGE(GSW_GPIO, "[hwpin] read file error %d,%s",ret, file);
}
return ret;
}
@@ -551,7 +443,7 @@
int ret = 0;
fd = open(file, O_WRONLY);
if(fd <= 0) {
- LOGE("[hwpin] open file error %d,%s", fd, file);
+ LOGE(GSW_GPIO, "[hwpin] open file error %d,%s", fd, file);
return GSW_HAL_ERROR_FILE_OPEN;
}
if(value) {
@@ -559,7 +451,7 @@
}
close(fd);
if(ret < 0) {
- LOGE("[hwpin] write file error %d,%s",ret, file);
+ LOGE(GSW_GPIO, "[hwpin] write file error %d,%s",ret, file);
}
return ret;
}
@@ -584,31 +476,31 @@
{
if (true == g_aging_flag)
{
- LOGI("green on LED file fail g_aging_flag = %d", g_aging_flag);
+ LOGI(GSW_GPIO, "green on LED file fail g_aging_flag = %d", g_aging_flag);
return GSW_HAL_SUCCESS;
}
if (access(SYS_LED_DEV_TRIGGER_NODE, W_OK) != 0)
{
- LOGE("green_on LED file fail %s", SYS_LED_DEV_TRIGGER_NODE);
+ LOGE(GSW_GPIO, "green_on LED file fail %s", SYS_LED_DEV_TRIGGER_NODE);
return GSW_HAL_NORMAL_FAIL;
}
if (_file_write(SYS_LED_DEV_TRIGGER_NODE, "none") <= 0)
{
- LOGE("green_on LED write fail %s", SYS_LED_DEV_TRIGGER_NODE);
+ LOGE(GSW_GPIO, "green_on LED write fail %s", SYS_LED_DEV_TRIGGER_NODE);
return GSW_HAL_NORMAL_FAIL;
}
if (access(SYS_LED_DEV_BRIGHTNES_NODE, W_OK) != 0)
{
- LOGE("green_on LED file fail %s", SYS_LED_DEV_BRIGHTNES_NODE);
+ LOGE(GSW_GPIO, "green_on LED file fail %s", SYS_LED_DEV_BRIGHTNES_NODE);
return GSW_HAL_NORMAL_FAIL;
}
if (_file_write(SYS_LED_DEV_BRIGHTNES_NODE, "1") <= 0)
{
- LOGE("green_on LED write fail %s", SYS_LED_DEV_BRIGHTNES_NODE);
+ LOGE(GSW_GPIO, "green_on LED write fail %s", SYS_LED_DEV_BRIGHTNES_NODE);
return GSW_HAL_NORMAL_FAIL;
}
return GSW_HAL_SUCCESS;
@@ -618,31 +510,31 @@
{
if (true == g_aging_flag)
{
- LOGI("green off LED file fail g_aging_flag = %d", g_aging_flag);
+ LOGI(GSW_GPIO, "green off LED file fail g_aging_flag = %d", g_aging_flag);
return GSW_HAL_SUCCESS;
}
if (access(SYS_LED_DEV_TRIGGER_NODE, W_OK) != 0)
{
- LOGE("green_on LED file fail %s", SYS_LED_DEV_TRIGGER_NODE);
+ LOGE(GSW_GPIO, "green_on LED file fail %s", SYS_LED_DEV_TRIGGER_NODE);
return GSW_HAL_NORMAL_FAIL;
}
if (_file_write(SYS_LED_DEV_TRIGGER_NODE, "none") <= 0)
{
- LOGE("green_on LED write fail %s", SYS_LED_DEV_TRIGGER_NODE);
+ LOGE(GSW_GPIO, "green_on LED write fail %s", SYS_LED_DEV_TRIGGER_NODE);
return GSW_HAL_NORMAL_FAIL;
}
if (access(SYS_LED_DEV_BRIGHTNES_NODE, W_OK) != 0)
{
- LOGE("green_on LED file fail %s", SYS_LED_DEV_BRIGHTNES_NODE);
+ LOGE(GSW_GPIO, "green_on LED file fail %s", SYS_LED_DEV_BRIGHTNES_NODE);
return GSW_HAL_NORMAL_FAIL;
}
if (_file_write(SYS_LED_DEV_BRIGHTNES_NODE, "0") <= 0)
{
- LOGE("green_on LED write fail %s", SYS_LED_DEV_BRIGHTNES_NODE);
+ LOGE(GSW_GPIO, "green_on LED write fail %s", SYS_LED_DEV_BRIGHTNES_NODE);
return GSW_HAL_NORMAL_FAIL;
}
@@ -655,45 +547,45 @@
if (true == g_aging_flag)
{
- LOGI("green blink LED file fail g_aging_flag = %d", g_aging_flag);
+ LOGI(GSW_GPIO, "green blink LED file fail g_aging_flag = %d", g_aging_flag);
return GSW_HAL_SUCCESS;
}
if (access(SYS_LED_DEV_TRIGGER_NODE, W_OK) != 0)
{
- LOGE("green_on LED file fail %s", SYS_LED_DEV_TRIGGER_NODE);
+ LOGE(GSW_GPIO, "green_on LED file fail %s", SYS_LED_DEV_TRIGGER_NODE);
return GSW_HAL_NORMAL_FAIL;
}
if (_file_write(SYS_LED_DEV_TRIGGER_NODE, "timer") <= 0)
{
- LOGE("green_on LED write fail %s", SYS_LED_DEV_TRIGGER_NODE);
+ LOGE(GSW_GPIO, "green_on LED write fail %s", SYS_LED_DEV_TRIGGER_NODE);
return GSW_HAL_NORMAL_FAIL;
}
if (access(SYS_LED_DEV_DELAY_OFF_NODE, W_OK) != 0)
{
- LOGE("green_on LED file fail %s", SYS_LED_DEV_DELAY_OFF_NODE);
+ LOGE(GSW_GPIO, "green_on LED file fail %s", SYS_LED_DEV_DELAY_OFF_NODE);
return GSW_HAL_NORMAL_FAIL;
}
sprintf(buf, "%d", delay_off);
if (_file_write(SYS_LED_DEV_DELAY_OFF_NODE, buf) <= 0)
{
- LOGE("green_on LED write fail %s", SYS_LED_DEV_DELAY_OFF_NODE);
+ LOGE(GSW_GPIO, "green_on LED write fail %s", SYS_LED_DEV_DELAY_OFF_NODE);
return GSW_HAL_NORMAL_FAIL;
}
if (access(SYS_LED_DEV_DELAY_ON_NODE, W_OK) != 0)
{
- LOGE("green_on LED file fail %s", SYS_LED_DEV_DELAY_ON_NODE);
+ LOGE(GSW_GPIO, "green_on LED file fail %s", SYS_LED_DEV_DELAY_ON_NODE);
return GSW_HAL_NORMAL_FAIL;
}
sprintf(buf, "%d", delay_on);
if (_file_write(SYS_LED_DEV_DELAY_ON_NODE, buf) <= 0)
{
- LOGE("green_on LED write fail %s", SYS_LED_DEV_DELAY_ON_NODE);
+ LOGE(GSW_GPIO, "green_on LED write fail %s", SYS_LED_DEV_DELAY_ON_NODE);
return GSW_HAL_NORMAL_FAIL;
}
@@ -740,26 +632,26 @@
int gsw_hwpin_factorytest_ctrl_led(bool aging_flag, int delay_on, int delay_off)
{
- LOGI("[hwpin] factory test ctrl led entry");
+ LOGI(GSW_GPIO, "[hwpin] factory test ctrl led entry");
if (false == g_aging_flag)
{
if (false == aging_flag)
{
- LOGI("[hwpin] factory test ctrl led aging_flag = %d", aging_flag);
+ LOGI(GSW_GPIO, "[hwpin] factory test ctrl led aging_flag = %d", aging_flag);
return GSW_HAL_SUCCESS;
}
g_aging_flag = aging_flag;
- LOGI("g_aging_flag 1 value %d", g_aging_flag);
+ LOGI(GSW_GPIO, "g_aging_flag 1 value %d", g_aging_flag);
}
else if (false == aging_flag)
{
g_aging_flag = aging_flag;
- LOGI("g_aging_flag 2 value %d", g_aging_flag);
+ LOGI(GSW_GPIO, "g_aging_flag 2 value %d", g_aging_flag);
}
gsw_hwpin_led_green_blink(delay_on, delay_off);
- LOGI("[hwpin] factory test ctrl led exit");
+ LOGI(GSW_GPIO, "[hwpin] factory test ctrl led exit");
return GSW_HAL_SUCCESS;
}
@@ -775,14 +667,14 @@
if(!emmc_path || access(emmc_path, F_OK) != 0)
{
- LOGE("Invalid path : %s", emmc_path);
+ LOGE(GSW_GPIO, "Invalid path : %s", emmc_path);
return ret;
}
sprintf(cmd, "fstrim -v %s", emmc_path);
ret = system(cmd);
- LOGI("command %s, ret : %d", cmd, ret);
+ LOGI(GSW_GPIO, "command %s, ret : %d", cmd, ret);
return GSW_HAL_SUCCESS;
}
\ No newline at end of file