android_kernel_oneplus_msm8998/drivers/soc/qcom/qdsp6v2/apr_v3.c
Laxminath Kasam 6494d49985 ASoC: apr: add API to read subsys state
As audio DSP can be running in lpass or modem
based on chipset, add API to get the subsys state
from apr_v2(lpass) and apr_v3(modem) accordingly.

Change-Id: I7a2b6f12574edcc5f609ce8ddf684a840f86d676
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2016-03-23 21:18:22 -07:00

53 lines
1.3 KiB
C

/*
* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/types.h>
#include <linux/uaccess.h>
#include <linux/spinlock.h>
#include <linux/kernel.h>
#include <linux/qdsp6v2/apr.h>
#include <linux/qdsp6v2/apr_tal.h>
#include <linux/qdsp6v2/dsp_debug.h>
#define DEST_ID APR_DEST_MODEM
enum apr_subsys_state apr_get_subsys_state(void)
{
return apr_get_modem_state();
}
void apr_set_subsys_state(void)
{
apr_set_modem_state(APR_SUBSYS_DOWN);
}
uint16_t apr_get_data_src(struct apr_hdr *hdr)
{
return DEST_ID;
}
int apr_get_dest_id(char *dest)
{
return DEST_ID;
}
void subsys_notif_register(struct notifier_block *mod_notif,
struct notifier_block *lp_notif)
{
subsys_notif_register_notifier("modem", mod_notif);
}
uint16_t apr_get_reset_domain(uint16_t proc)
{
return APR_DEST_QDSP6;
}