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

Commit 3c9d5397 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: bgcom: add bg ssr ramdump"

parents 761e73c9 a0cd7f82
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -285,6 +285,7 @@ static int ssr_bg_cb(struct notifier_block *this,
	switch (opcode) {
	case SUBSYS_BEFORE_SHUTDOWN:
		bge.e_type = BG_BEFORE_POWER_DOWN;
		bgcom_set_spi_state(BGCOM_SPI_BUSY);
		send_uevent(&bge);
		break;
	case SUBSYS_AFTER_POWERUP:
+11 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@

#define BG_SPI_MAX_WORDS (0x3FFFFFFD)
#define BG_SPI_MAX_REGS (0x0A)
#define SLEEP_IN_STATE_CHNG 2000

enum bgcom_state {
	/*BGCOM Staus ready*/
@@ -90,9 +91,19 @@ static enum bgcom_spi_state spi_state;

int bgcom_set_spi_state(enum bgcom_spi_state state)
{
	struct bg_spi_priv *bg_spi = container_of(bg_com_drv,
						struct bg_spi_priv, lhandle);
	if (state < 0 || state > 1)
		return -EINVAL;

	if (state == spi_state)
		return 0;

	mutex_lock(&bg_spi->xfer_mutex);
	spi_state = state;
	if (spi_state == BGCOM_SPI_BUSY)
		msleep(SLEEP_IN_STATE_CHNG);
	mutex_unlock(&bg_spi->xfer_mutex);
	return 0;
}
EXPORT_SYMBOL(bgcom_set_spi_state);