Loading drivers/soc/qcom/bgcom_interface.c +1 −0 Original line number Diff line number Diff line Loading @@ -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: Loading drivers/soc/qcom/bgcom_spi.c +11 −0 Original line number Diff line number Diff line Loading @@ -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*/ Loading Loading @@ -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); Loading Loading
drivers/soc/qcom/bgcom_interface.c +1 −0 Original line number Diff line number Diff line Loading @@ -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: Loading
drivers/soc/qcom/bgcom_spi.c +11 −0 Original line number Diff line number Diff line Loading @@ -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*/ Loading Loading @@ -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); Loading