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

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

soc: qcom: bgcom: Use shared_ee property for spi



Use shared_ee property for bg spi. Call pm runtime
APIs to suspend the spi driver.

Change-Id: If670311cddae8fab70a5673b38ec5d5149c4d38b
Signed-off-by: default avatarAjit Kumar <kajit@codeaurora.org>
parent 1e32a780
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@

#define MPPS_DOWN_EVENT_TO_BG_TIMEOUT 3000
#define ADSP_DOWN_EVENT_TO_BG_TIMEOUT 3000
#define SLEEP_FOR_SPI_BUS 2000

enum {
	SSR_DOMAIN_BG,
@@ -401,8 +400,6 @@ static long bg_com_ioctl(struct file *filp,
		break;
	case SET_SPI_BUSY:
		ret = bgcom_set_spi_state(BGCOM_SPI_BUSY);
		/* Add sleep for  SPI Bus to release*/
		msleep(SLEEP_FOR_SPI_BUS);
		break;
	case BG_SOFT_RESET:
		ret = bg_soft_reset();
@@ -619,8 +616,6 @@ static int ssr_bg_cb(struct notifier_block *this,
		send_uevent(&bge);
		break;
	case SUBSYS_AFTER_SHUTDOWN:
		/* Add sleep for  SPI Bus to release*/
		msleep(SLEEP_FOR_SPI_BUS);
		if (dev->pending_bg_twm_wear_load) {
			/* Load bg-twm-wear */
			dev->pending_bg_twm_wear_load = false;
+3 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include <linux/of_gpio.h>
#include <linux/kthread.h>
#include <linux/dma-mapping.h>
#include <linux/pm_runtime.h>
#include "bgcom.h"
#include "bgrsb.h"
#include "bgcom_interface.h"
@@ -263,7 +264,9 @@ static int bgcom_transfer(void *handle, uint8_t *tx_buf,
		tx_xfer->rx_buf = rx_buf;

	tx_xfer->len = txn_len;
	pm_runtime_get_sync(bg_spi->spi->controller->dev.parent);
	ret = spi_sync(spi, &bg_spi->msg1);
	pm_runtime_put_sync_suspend(bg_spi->spi->controller->dev.parent);
	mutex_unlock(&bg_spi->xfer_mutex);

	if (ret)