-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os/driver/input/ist415: Change to power off when touch disabling #6697
Conversation
Please add the ist415_forced_release function when you turn off the ist415 power. |
37c52fb
to
5db5b60
Compare
os/drivers/input/ist415.c
Outdated
@@ -568,6 +573,11 @@ static int ist415_resume_device(struct touchscreen_s *upper) | |||
ASSERT(get_errno() == EINTR); | |||
} | |||
|
|||
if (dev->forcedoff) { | |||
sem_post(&dev->sem); | |||
return EPERM; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EPERM is tightly related to permission, so I think ESHUTDOWN or ENXIO is good for this situation, I prefer ESHUTDOWN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for suggestion. Updated
|
||
if (dev->forcedoff) { | ||
ist415_power_off(dev); | ||
} else if (dev->suspend) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if both of forceoff & suspend never set as true, I think you can define enum regarding state and use dev->state instead of these 3 states.
Change to tunr off ist415 power when touch is disabled from apps for reduce power consumption. Signed-off-by: eunwoo.nam <[email protected]>
5db5b60
to
7d339fb
Compare
@@ -568,6 +573,11 @@ static int ist415_resume_device(struct touchscreen_s *upper) | |||
ASSERT(get_errno() == EINTR); | |||
} | |||
|
|||
if (dev->forcedoff) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about checking this at start of the function? Then, you don't need to take the sem.
@@ -534,6 +534,11 @@ static int ist415_suspend_device(struct touchscreen_s *upper) | |||
ASSERT(get_errno() == EINTR); | |||
} | |||
|
|||
if (dev->forcedoff) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as previous
Change to tunr off ist415 power when touch is disabled from apps for reduce power consumption.