mirror of
https://github.com/wessel-novacustom/clevo-keyboard.git
synced 2024-11-15 11:43:59 +01:00
clevo_interfaces: Export method and ID interface
This commit is contained in:
parent
1f8b5a66b3
commit
bea8621bdb
|
@ -56,5 +56,7 @@ struct clevo_interface_t {
|
||||||
|
|
||||||
u32 clevo_keyboard_add_interface(struct clevo_interface_t *new_interface);
|
u32 clevo_keyboard_add_interface(struct clevo_interface_t *new_interface);
|
||||||
u32 clevo_keyboard_remove_interface(struct clevo_interface_t *interface);
|
u32 clevo_keyboard_remove_interface(struct clevo_interface_t *interface);
|
||||||
|
u32 clevo_evaluate_method(u8 cmd, u32 arg, u32 *result);
|
||||||
|
u32 clevo_get_active_interface_id(char **id_str);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -287,7 +287,7 @@ static ssize_t show_hasextra_fs(struct device *child,
|
||||||
return sprintf(buffer, "%d\n", kbd_led_state.has_extra);
|
return sprintf(buffer, "%d\n", kbd_led_state.has_extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 clevo_evaluate_method(u8 cmd, u32 arg, u32 *result)
|
u32 clevo_evaluate_method(u8 cmd, u32 arg, u32 *result)
|
||||||
{
|
{
|
||||||
if (IS_ERR_OR_NULL(active_clevo_interface)) {
|
if (IS_ERR_OR_NULL(active_clevo_interface)) {
|
||||||
pr_err("clevo_keyboard: no active interface\n");
|
pr_err("clevo_keyboard: no active interface\n");
|
||||||
|
@ -295,6 +295,21 @@ static u32 clevo_evaluate_method(u8 cmd, u32 arg, u32 *result)
|
||||||
}
|
}
|
||||||
return active_clevo_interface->method_call(cmd, arg, result);
|
return active_clevo_interface->method_call(cmd, arg, result);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(clevo_evaluate_method);
|
||||||
|
|
||||||
|
u32 clevo_get_active_interface_id(char **id_str)
|
||||||
|
{
|
||||||
|
if (IS_ERR_OR_NULL(active_clevo_interface)) {
|
||||||
|
pr_err("clevo_keyboard: no active interface\n");
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IS_ERR_OR_NULL(id_str))
|
||||||
|
*id_str = active_clevo_interface->string_id;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(clevo_get_active_interface_id);
|
||||||
|
|
||||||
static void set_brightness(u8 brightness)
|
static void set_brightness(u8 brightness)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue