forked from atar-axis/xpadneo
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xpadneo, keyboard: Add keyboard support
Signed-off-by: Kai Krakow <[email protected]>
- Loading branch information
Showing
4 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* xpadneo keyboard driver | ||
* | ||
* Copyright (c) 2021 Kai Krakow <[email protected]> | ||
*/ | ||
|
||
#include "../xpadneo.h" | ||
|
||
extern int xpadneo_init_keyboard(struct xpadneo_devdata *xdata) | ||
{ | ||
struct hid_device *hdev = xdata->hdev; | ||
int ret, synth = 0; | ||
|
||
if (!xdata->keyboard) { | ||
synth = 1; | ||
ret = xpadneo_init_synthetic(xdata, "Keyboard", &xdata->keyboard); | ||
if (ret || !xdata->keyboard) | ||
return ret; | ||
} | ||
|
||
if (synth) { | ||
ret = input_register_device(xdata->keyboard); | ||
if (ret) { | ||
hid_err(hdev, "failed to register keyboard\n"); | ||
return ret; | ||
} | ||
|
||
hid_info(hdev, "keyboard added\n"); | ||
} | ||
|
||
return 0; | ||
} |