tzh
2024-08-15 d4a1bd480003f3e1a0590bc46fbcb24f05652ca7
android/hardware/aic/libbt/src/upio.c
....@@ -1,6 +1,6 @@
11 /******************************************************************************
22 *
3
- * Copyright (C) 2019-2027 AIC Corporation
3
+ * Copyright (C) 2019-2021 Aicsemi Corporation
44 *
55 * Licensed under the Apache License, Version 2.0 (the "License");
66 * you may not use this file except in compliance with the License.
....@@ -33,7 +33,7 @@
3333 #include <errno.h>
3434 #include <string.h>
3535 #include <cutils/properties.h>
36
-#include "bt_vendor_aicbt.h"
36
+#include "bt_vendor_aic.h"
3737 #include "upio.h"
3838 #include "userial_vendor.h"
3939 #include <stdio.h>
....@@ -77,15 +77,14 @@
7777 * the bluesleep LPM code. The current value used in bluesleep is 10sec.
7878 */
7979 #ifndef PROC_BTWRITE_TIMER_TIMEOUT_MS
80
-#define PROC_BTWRITE_TIMER_TIMEOUT_MS 4000
80
+#define PROC_BTWRITE_TIMER_TIMEOUT_MS 0
8181 #else
8282 #undef PROC_BTWRITE_TIMER_TIMEOUT_MS
83
-#define PROC_BTWRITE_TIMER_TIMEOUT_MS 4000
83
+#define PROC_BTWRITE_TIMER_TIMEOUT_MS 0
8484 #endif
8585
8686 /* lpm proc control block */
87
-typedef struct
88
-{
87
+typedef struct {
8988 uint8_t btwrite_active;
9089 uint8_t timer_created;
9190 timer_t timer_id;
....@@ -100,7 +99,6 @@
10099 ******************************************************************************/
101100
102101 static uint8_t upio_state[UPIO_MAX_COUNT];
103
-static int rfkill_id = -1;
104102 static int bt_emul_enable = 0;
105103 static char *rfkill_state_path = NULL;
106104
....@@ -155,7 +153,7 @@
155153 char path[64];
156154 char buf[16];
157155 int fd, sz, id;
158
- const char *basepath = "/sys/devices/platform/aic-bt/rfkill";
156
+ const char *basepath = "/sys/devices/platform/aic-bsp/rfkill";
159157
160158 DIR *d;
161159 struct dirent *de;
....@@ -329,7 +327,7 @@
329327 return 0;
330328 #endif
331329
332
- if (rfkill_id == -1) {
330
+ if (rfkill_state_path == NULL) {
333331 if (init_rfkill())
334332 return ret;
335333 }