Loading drivers/misc/qcom/qdsp6v2/ultrasound/usf.c +12 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <linux/uaccess.h> #include <linux/time.h> #include <linux/kmemleak.h> #include <linux/wakelock.h> #include <sound/apr_audio.h> #include <linux/qdsp6v2/usf.h> #include "q6usm.h" Loading Loading @@ -67,6 +68,9 @@ #define BITS_IN_BYTE 8 /* Time to stay awake after tx read event (e.g., proximity) */ #define STAY_AWAKE_AFTER_READ_MSECS 3000 /* The driver states */ enum usf_state_type { USF_IDLE_STATE, Loading Loading @@ -171,6 +175,8 @@ static const int s_button_map[] = { /* The opened devices container */ static int s_opened_devs[MAX_DEVS_NUMBER]; static struct wakeup_source usf_wakeup_source; #define USF_NAME_PREFIX "usf_" #define USF_NAME_PREFIX_SIZE 4 Loading Loading @@ -435,6 +441,10 @@ static void usf_tx_cb(uint32_t opcode, uint32_t token, switch (opcode) { case Q6USM_EVENT_READ_DONE: pr_debug("%s: acquiring %d msec wake lock\n", __func__, STAY_AWAKE_AFTER_READ_MSECS); __pm_wakeup_event(&usf_wakeup_source, STAY_AWAKE_AFTER_READ_MSECS); if (token == USM_WRONG_TOKEN) usf_xx->usf_state = USF_ERROR_STATE; usf_xx->new_region = token; Loading Loading @@ -2285,6 +2295,7 @@ static int usf_open(struct inode *inode, struct file *file) pr_err("%s:usf allocation failed\n", __func__); return -ENOMEM; } wakeup_source_init(&usf_wakeup_source, "usf"); file->private_data = usf; usf->dev_ind = dev_ind; Loading Loading @@ -2312,6 +2323,7 @@ static int usf_release(struct inode *inode, struct file *file) s_opened_devs[usf->dev_ind] = 0; wakeup_source_trash(&usf_wakeup_source); kfree(usf); pr_debug("%s: release exit\n", __func__); return 0; Loading Loading
drivers/misc/qcom/qdsp6v2/ultrasound/usf.c +12 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <linux/uaccess.h> #include <linux/time.h> #include <linux/kmemleak.h> #include <linux/wakelock.h> #include <sound/apr_audio.h> #include <linux/qdsp6v2/usf.h> #include "q6usm.h" Loading Loading @@ -67,6 +68,9 @@ #define BITS_IN_BYTE 8 /* Time to stay awake after tx read event (e.g., proximity) */ #define STAY_AWAKE_AFTER_READ_MSECS 3000 /* The driver states */ enum usf_state_type { USF_IDLE_STATE, Loading Loading @@ -171,6 +175,8 @@ static const int s_button_map[] = { /* The opened devices container */ static int s_opened_devs[MAX_DEVS_NUMBER]; static struct wakeup_source usf_wakeup_source; #define USF_NAME_PREFIX "usf_" #define USF_NAME_PREFIX_SIZE 4 Loading Loading @@ -435,6 +441,10 @@ static void usf_tx_cb(uint32_t opcode, uint32_t token, switch (opcode) { case Q6USM_EVENT_READ_DONE: pr_debug("%s: acquiring %d msec wake lock\n", __func__, STAY_AWAKE_AFTER_READ_MSECS); __pm_wakeup_event(&usf_wakeup_source, STAY_AWAKE_AFTER_READ_MSECS); if (token == USM_WRONG_TOKEN) usf_xx->usf_state = USF_ERROR_STATE; usf_xx->new_region = token; Loading Loading @@ -2285,6 +2295,7 @@ static int usf_open(struct inode *inode, struct file *file) pr_err("%s:usf allocation failed\n", __func__); return -ENOMEM; } wakeup_source_init(&usf_wakeup_source, "usf"); file->private_data = usf; usf->dev_ind = dev_ind; Loading Loading @@ -2312,6 +2323,7 @@ static int usf_release(struct inode *inode, struct file *file) s_opened_devs[usf->dev_ind] = 0; wakeup_source_trash(&usf_wakeup_source); kfree(usf); pr_debug("%s: release exit\n", __func__); return 0; Loading