sec_battery_misc.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * sec_battery_misc.h
  3. * Samsung Mobile Battery Misc Driver
  4. * Author: Yeongmi Ha <[email protected]>
  5. * Copyright (C) 2018 Samsung Electronics
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __LINUX_SEC_BATTERY_MISC_H__
  13. #define __LINUX_SEC_BATTERY_MISC_H__
  14. // Samsung Wireless Authentication Message
  15. enum swam_data_type {
  16. TYPE_SHORT = 0,
  17. TYPE_LONG,
  18. };
  19. enum swam_direction_type {
  20. DIR_OUT = 0,
  21. DIR_IN,
  22. };
  23. struct swam_data {
  24. unsigned short pid; /* Product ID */
  25. char type; /* swam_data_type */
  26. char dir; /* swam_direction_type */
  27. unsigned int size; /* data size */
  28. void __user *pData; /* data pointer */
  29. };
  30. struct sec_bat_misc_dev {
  31. struct swam_data u_data;
  32. atomic_t open_excl;
  33. atomic_t ioctl_excl;
  34. int (*swam_write)(void *data, int size);
  35. int (*swam_read)(void *data);
  36. int (*swam_ready)(void);
  37. void (*swam_close)(void);
  38. };
  39. #define sec_bat_misc_dev_t \
  40. struct sec_bat_misc_dev
  41. #endif