Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51fd240d authored by Ajit Kumar's avatar Ajit Kumar Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: bgdaemon: add interface to get TWM exit flag



Add an interface to find if the device bootup is after traditional
watch mode exit.

Change-Id: I174850bf09a8c91c2265c4675d4df735292d7fde
Signed-off-by: default avatarAjit Kumar <kajit@codeaurora.org>
Signed-off-by: default avatarRamesh Yadav Javadi <javadi@codeaurora.org>
parent 7bcb1bb4
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ struct device *dev_ret;
static  dev_t                    bg_dev;
static  int                      device_open;
static  void                     *handle;
static	bool                     twm_exit;
static  struct   bgcom_open_config_type   config_type;
static DECLARE_COMPLETION(bg_modem_down_wait);

@@ -360,6 +361,10 @@ static long bg_com_ioctl(struct file *filp,
	case BG_MODEM_DOWN2_BG_DONE:
		ret = modem_down2_bg();
		break;
	case BG_TWM_EXIT:
		twm_exit = true;
		ret = 0;
		break;
	default:
		ret = -ENOIOCTLCMD;
	}
@@ -555,6 +560,16 @@ static int ssr_modem_cb(struct notifier_block *this,
	return NOTIFY_DONE;
}

bool is_twm_exit(void)
{
	if (twm_exit) {
		twm_exit = false;
		return true;
	}
	return false;
}
EXPORT_SYMBOL(is_twm_exit);

static struct notifier_block ssr_modem_nb = {
	.notifier_call = ssr_modem_cb,
	.priority = 0,
+8 −1
Original line number Diff line number Diff line
@@ -13,10 +13,17 @@
#ifndef BGCOM_INTERFACE_H
#define BGCOM_INTERFACE_H

/**
/*
 * bg_soft_reset() - soft reset Blackghost
 * Return 0 on success or -Ve on error
 */
int bg_soft_reset(void);

/*
 * is_twm_exit()
 * Return true if device is booting up on TWM exit.
 * value is auto cleared once read.
 */
bool is_twm_exit(void);

#endif /* BGCOM_INTERFACE_H */
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#define BGCOM_REG_WRITE  5
#define BGCOM_SOFT_RESET  6
#define BGCOM_MODEM_DOWN2_BG  7
#define BGCOM_TWM_EXIT  8
#define EXCHANGE_CODE  'V'

struct bg_ui_data {
@@ -57,6 +58,9 @@ enum bg_event_type {
#define BG_SOFT_RESET \
	_IOWR(EXCHANGE_CODE, BGCOM_SOFT_RESET, \
	struct bg_ui_data)
#define BG_TWM_EXIT \
	_IOWR(EXCHANGE_CODE, BGCOM_TWM_EXIT, \
	struct bg_ui_data)
#define BG_MODEM_DOWN2_BG_DONE \
	_IOWR(EXCHANGE_CODE, BGCOM_MODEM_DOWN2_BG, \
	struct bg_ui_data)