summaryrefslogtreecommitdiff
path: root/utils/nwztools/plattools/nwz_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/nwztools/plattools/nwz_lib.c')
-rw-r--r--utils/nwztools/plattools/nwz_lib.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/utils/nwztools/plattools/nwz_lib.c b/utils/nwztools/plattools/nwz_lib.c
index ebfe488a7d..4f49bec909 100644
--- a/utils/nwztools/plattools/nwz_lib.c
+++ b/utils/nwztools/plattools/nwz_lib.c
@@ -483,3 +483,22 @@ int nwz_power_is_fully_charged(int fd)
483 return -1; 483 return -1;
484 return status; 484 return status;
485} 485}
486
487int nwz_pminfo_open(void)
488{
489 return open(NWZ_PMINFO_DEV, O_RDONLY);
490}
491
492void nwz_pminfo_close(int fd)
493{
494 close(fd);
495}
496
497unsigned int nwz_pminfo_get_factor(int fd)
498{
499 unsigned int val;
500 if(ioctl(fd, NWZ_PMINFO_GET_FACTOR, &val) < 0)
501 return 0;
502 else
503 return val;
504}