Motor: ztm620: add motor status interface 13/232613/3
authorjeongsup.jeong <jeongsup.jeong@samsung.com>
Thu, 13 Jun 2019 04:36:32 +0000 (13:36 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 11 May 2020 00:41:06 +0000 (00:41 +0000)
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>
drivers/motor/ztm620_motor.c
include/linux/ztm620_motor.h

index 1fad3cf464e6268f2832d05a5b941bc77d5b52ce..0003ec0e98da0d436ea8a332565b50e22ec7bc75 100644 (file)
@@ -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,
index 97c8dc67f192eed83e8fc1ccb3180ad536d42970..0111b06e0ed5d619dc51f11bf9669d6081d4cb5e 100644 (file)
@@ -154,5 +154,6 @@ struct ztm620_motor_data {
 };
 
 int ztm620_motor_reset_handler(void);
+bool ztm620_motor_is_running(void);
 
 #endif