dell-smbios.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Common functions for kernel modules using Dell SMBIOS
  3. *
  4. * Copyright (c) Red Hat <mjg@redhat.com>
  5. * Copyright (c) 2014 Gabriele Mazzotta <gabriele.mzt@gmail.com>
  6. * Copyright (c) 2014 Pali Rohár <pali.rohar@gmail.com>
  7. *
  8. * Based on documentation in the libsmbios package:
  9. * Copyright (C) 2005-2014 Dell Inc.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #ifndef _DELL_SMBIOS_H_
  16. #define _DELL_SMBIOS_H_
  17. struct notifier_block;
  18. /* This structure will be modified by the firmware when we enter
  19. * system management mode, hence the volatiles */
  20. struct calling_interface_buffer {
  21. u16 class;
  22. u16 select;
  23. volatile u32 input[4];
  24. volatile u32 output[4];
  25. } __packed;
  26. struct calling_interface_token {
  27. u16 tokenID;
  28. u16 location;
  29. union {
  30. u16 value;
  31. u16 stringlength;
  32. };
  33. };
  34. int dell_smbios_error(int value);
  35. struct calling_interface_buffer *dell_smbios_get_buffer(void);
  36. void dell_smbios_clear_buffer(void);
  37. void dell_smbios_release_buffer(void);
  38. void dell_smbios_send_request(int class, int select);
  39. struct calling_interface_token *dell_smbios_find_token(int tokenid);
  40. enum dell_laptop_notifier_actions {
  41. DELL_LAPTOP_KBD_BACKLIGHT_BRIGHTNESS_CHANGED,
  42. };
  43. int dell_laptop_register_notifier(struct notifier_block *nb);
  44. int dell_laptop_unregister_notifier(struct notifier_block *nb);
  45. void dell_laptop_call_notifier(unsigned long action, void *data);
  46. #endif