summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeongsup.jeong <jeongsup.jeong@samsung.com>2019-06-13 13:36:32 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2020-05-11 00:41:06 +0000
commitdbf66c0cc1fa40f5fd9a9ad98c8ba8aa8cd021d0 (patch)
tree7d6bd86b621a2300cc82d4133bc9d29e81d1b5b6
parent369116e2550a19bf0a1e2e771e3da610c6dfa3ee (diff)
downloadlinux-4.9-exynos9110-dbf66c0cc1fa40f5fd9a9ad98c8ba8aa8cd021d0.tar.gz
linux-4.9-exynos9110-dbf66c0cc1fa40f5fd9a9ad98c8ba8aa8cd021d0.tar.bz2
linux-4.9-exynos9110-dbf66c0cc1fa40f5fd9a9ad98c8ba8aa8cd021d0.zip
Motor: ztm620: add motor status interface
Add exported ztm620_motor_is_running() function to inform the motor state to outside of ztm620 device driver. Change-Id: If9e1b42755d0b2c7d8c1f10d78746be58d011b6b Signed-off-by: jeongsup.jeong <jeongsup.jeong@samsung.com> [cw00.choi: Add commit-msg as the public style] Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
-rw-r--r--drivers/motor/ztm620_motor.c8
-rw-r--r--include/linux/ztm620_motor.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/motor/ztm620_motor.c b/drivers/motor/ztm620_motor.c
index 1fad3cf464e6..0003ec0e98da 100644
--- a/drivers/motor/ztm620_motor.c
+++ b/drivers/motor/ztm620_motor.c
@@ -729,6 +729,14 @@ int ztm620_motor_reset_handler(void)
return 0;
}
+bool ztm620_motor_is_running(void)
+{
+ if (g_Ztm620MotorData)
+ return g_Ztm620MotorData->running;
+ else
+ return false;
+}
+
static struct regmap_config ztm620_motor_i2c_regmap = {
.reg_bits = 8,
.val_bits = 8,
diff --git a/include/linux/ztm620_motor.h b/include/linux/ztm620_motor.h
index 97c8dc67f192..0111b06e0ed5 100644
--- a/include/linux/ztm620_motor.h
+++ b/include/linux/ztm620_motor.h
@@ -154,5 +154,6 @@ struct ztm620_motor_data {
};
int ztm620_motor_reset_handler(void);
+bool ztm620_motor_is_running(void);
#endif