summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Yu <jackcwyu@google.com>2021-06-01 21:01:09 +0800
committerJack Yu <jackcwyu@google.com>2021-06-01 21:01:09 +0800
commit1f88df31f141efe1857c96b1dd28d527691013cf (patch)
tree0654bf08f5dce8e79c2404c6cb0ccd2a47644d4f
parent75fe7a09907fb2119890cb43901f730cf38aa9cb (diff)
downloadnfc-1f88df31f141efe1857c96b1dd28d527691013cf.tar.gz
Fix the st33spi state is not correctly updated. Bug: 189819988 Test: st33spi state is updated correctly via sysfs. Signed-off-by: Jack Yu <jackcwyu@google.com> Change-Id: Ib7d5a112fb4335c37f4cd35f20910eca604032d7
-rw-r--r--ese/st33spi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ese/st33spi.c b/ese/st33spi.c
index f07d441..825d186 100644
--- a/ese/st33spi.c
+++ b/ese/st33spi.c
@@ -196,10 +196,11 @@ static ssize_t st33spi_state_store(struct device *dev,
return -ENODEV;
if (!kstrtoint(buf, 10, &new_spi_state)) {
- st33spi->spi_state = new_spi_state;
if (new_spi_state == 0) {
+ st33spi->spi_state = 0;
st33spi_pinctrl_configure(st33spi, false);
} else if (new_spi_state == 33) {
+ st33spi->spi_state = 1;
st33spi_pinctrl_configure(st33spi, true);
} else {
dev_err(dev, "%s: incorrect parameter\n", __func__);