diff options
author | Hoegeun Kwon <hoegeun.kwon@samsung.com> | 2016-10-04 16:49:16 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2016-10-05 00:17:03 -0700 |
commit | 7006556bf269cfcf24e6f685f3f7ef7198f0cba5 (patch) | |
tree | 97a95fc3151ce6d5d0fe99c9e54b50b567f3acb7 | |
parent | 6c07ccc5cbdc66d647dc78da29b8b410b9e7adfd (diff) | |
download | linux-exynos-7006556bf269cfcf24e6f685f3f7ef7198f0cba5.tar.gz linux-exynos-7006556bf269cfcf24e6f685f3f7ef7198f0cba5.tar.bz2 linux-exynos-7006556bf269cfcf24e6f685f3f7ef7198f0cba5.zip |
sensors: brcm: fix not to send commands to not initialized mcu
The suspend and resume errors happen when sensorhub mcu was not
initialized. So it needs to check the sensorhub mcu state.
Change-Id: I7d738d2316bbe20922df39c6ddfdf3573bc8984d
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
-rw-r--r-- | drivers/sensors/brcm/ssp_dev.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/sensors/brcm/ssp_dev.c b/drivers/sensors/brcm/ssp_dev.c index 3aab02f6ca60..2f5817012c16 100644 --- a/drivers/sensors/brcm/ssp_dev.c +++ b/drivers/sensors/brcm/ssp_dev.c @@ -491,6 +491,9 @@ static int ssp_suspend(struct device *dev) struct spi_device *spi = to_spi_device(dev); struct ssp_data *data = spi_get_drvdata(spi); + if (data->uSensorState == NORMAL_SENSOR_STATE_K) + return 0; + func_dbg(); if (SUCCESS != ssp_send_cmd(data, MSG2SSP_AP_STATUS_SUSPEND, 0)) @@ -511,6 +514,9 @@ static int ssp_resume(struct device *dev) struct spi_device *spi = to_spi_device(dev); struct ssp_data *data = spi_get_drvdata(spi); + if (data->uSensorState == NORMAL_SENSOR_STATE_K) + return 0; + func_dbg(); enable_debug_timer(data); |