| Michał Kępień | 2f9f26b | 2016-01-22 15:27:13 +0100 | [diff] [blame] | 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 | |
| 16 | #ifndef _DELL_SMBIOS_H_ |
| 17 | #define _DELL_SMBIOS_H_ |
| 18 | |
| Hans de Goede | 504b025 | 2017-03-16 11:55:32 +0100 | [diff] [blame] | 19 | struct notifier_block; |
| 20 | |
| Michał Kępień | 2f9f26b | 2016-01-22 15:27:13 +0100 | [diff] [blame] | 21 | /* This structure will be modified by the firmware when we enter |
| 22 | * system management mode, hence the volatiles */ |
| 23 | |
| 24 | struct calling_interface_buffer { |
| Mario Limonciello | f35a8ef | 2017-11-01 14:25:22 -0500 | [diff] [blame^] | 25 | u16 cmd_class; |
| 26 | u16 cmd_select; |
| Michał Kępień | 2f9f26b | 2016-01-22 15:27:13 +0100 | [diff] [blame] | 27 | volatile u32 input[4]; |
| 28 | volatile u32 output[4]; |
| 29 | } __packed; |
| 30 | |
| 31 | struct calling_interface_token { |
| 32 | u16 tokenID; |
| 33 | u16 location; |
| 34 | union { |
| 35 | u16 value; |
| 36 | u16 stringlength; |
| 37 | }; |
| 38 | }; |
| 39 | |
| Michał Kępień | 0db2180 | 2016-03-04 14:09:07 +0100 | [diff] [blame] | 40 | int dell_smbios_error(int value); |
| Michał Kępień | e8edf53 | 2016-03-04 14:09:06 +0100 | [diff] [blame] | 41 | |
| Michał Kępień | bc2104c | 2016-01-22 15:27:20 +0100 | [diff] [blame] | 42 | struct calling_interface_buffer *dell_smbios_get_buffer(void); |
| Michał Kępień | b6aa7e1 | 2016-01-22 15:27:15 +0100 | [diff] [blame] | 43 | void dell_smbios_clear_buffer(void); |
| Michał Kępień | cb16176 | 2016-01-22 15:27:16 +0100 | [diff] [blame] | 44 | void dell_smbios_release_buffer(void); |
| Michał Kępień | c42831c | 2016-01-22 15:27:19 +0100 | [diff] [blame] | 45 | void dell_smbios_send_request(int class, int select); |
| Michał Kępień | 2f9f26b | 2016-01-22 15:27:13 +0100 | [diff] [blame] | 46 | |
| Michał Kępień | 96f7ef9 | 2016-01-22 15:27:22 +0100 | [diff] [blame] | 47 | struct calling_interface_token *dell_smbios_find_token(int tokenid); |
| Hans de Goede | 504b025 | 2017-03-16 11:55:32 +0100 | [diff] [blame] | 48 | |
| 49 | enum dell_laptop_notifier_actions { |
| 50 | DELL_LAPTOP_KBD_BACKLIGHT_BRIGHTNESS_CHANGED, |
| 51 | }; |
| 52 | |
| 53 | int dell_laptop_register_notifier(struct notifier_block *nb); |
| 54 | int dell_laptop_unregister_notifier(struct notifier_block *nb); |
| 55 | void dell_laptop_call_notifier(unsigned long action, void *data); |
| 56 | |
| Michał Kępień | 2f9f26b | 2016-01-22 15:27:13 +0100 | [diff] [blame] | 57 | #endif |