mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
nvadsp: Added new commands support to adsp console
- Added suspend, reusme and stop abilities to adsp console Bug 3596981 Change-Id: I867a85130bb2abf7feb5a3a78ebb2b343272a32a Signed-off-by: Akash Kollipara <akollipara@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2723711 (cherry picked from commit 046f4f8874a1fc8c7af88c44ad08114e489f3302) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2695477 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Viswanath L <viswanathl@nvidia.com> Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Laxman Dewangan
parent
913a409fe5
commit
3a6d714aa7
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* adsp mailbox console driver
|
* adsp mailbox console driver
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014-2020, NVIDIA Corporation. All rights reserved.
|
* Copyright (C) 2014-2022, NVIDIA Corporation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This software is licensed under the terms of the GNU General Public
|
* This software is licensed under the terms of the GNU General Public
|
||||||
* License version 2, as published by the Free Software Foundation, and
|
* License version 2, as published by the Free Software Foundation, and
|
||||||
@@ -161,6 +161,7 @@ adsp_consol_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
|
|||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
if ((_IOC_NR(cmd) != _IOC_NR(ADSP_CNSL_LOAD)) &&
|
if ((_IOC_NR(cmd) != _IOC_NR(ADSP_CNSL_LOAD)) &&
|
||||||
|
(_IOC_NR(cmd) != _IOC_NR(ADSP_CNSL_RESUME)) &&
|
||||||
(!drv_data->adsp_os_running)) {
|
(!drv_data->adsp_os_running)) {
|
||||||
dev_info(dev, "adsp_consol: os not running.");
|
dev_info(dev, "adsp_consol: os not running.");
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
@@ -197,6 +198,23 @@ adsp_consol_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
|
|||||||
pr_err("adsp_consol: Failed to init adsp_consol send mailbox");
|
pr_err("adsp_consol: Failed to init adsp_consol send mailbox");
|
||||||
memset(mbox, 0, sizeof(struct nvadsp_mbox));
|
memset(mbox, 0, sizeof(struct nvadsp_mbox));
|
||||||
break;
|
break;
|
||||||
|
case _IOC_NR(ADSP_CNSL_SUSPEND):
|
||||||
|
ret = nvadsp_os_suspend();
|
||||||
|
if (ret)
|
||||||
|
dev_info(dev, "adsp_consol: OS Suspend Failed.");
|
||||||
|
break;
|
||||||
|
case _IOC_NR(ADSP_CNSL_STOP):
|
||||||
|
nvadsp_os_stop();
|
||||||
|
break;
|
||||||
|
case _IOC_NR(ADSP_CNSL_RESUME):
|
||||||
|
if (!drv_data->adsp_os_suspended) {
|
||||||
|
dev_info(dev, "adsp_consol: OS is not suspended to perform resume.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ret = nvadsp_os_start();
|
||||||
|
if (ret)
|
||||||
|
dev_info(dev, "adsp_consol: OS Resume Failed.");
|
||||||
|
break;
|
||||||
case _IOC_NR(ADSP_CNSL_RUN_APP):
|
case _IOC_NR(ADSP_CNSL_RUN_APP):
|
||||||
if (!ACCESS_OK(uarg, sizeof(struct adsp_consol_run_app_arg_t)))
|
if (!ACCESS_OK(uarg, sizeof(struct adsp_consol_run_app_arg_t)))
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
|
|||||||
Reference in New Issue
Block a user