-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load USB firmware through ioctl interface
- Loading branch information
Sebastien Bourdeauducq
committed
Feb 26, 2012
1 parent
8c38036
commit c3efab5
Showing
4 changed files
with
73 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Flickernoise | ||
* Copyright (C) 2012 Sebastien Bourdeauducq | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include <assert.h> | ||
#include <sys/ioctl.h> | ||
#include <sys/types.h> | ||
#include <sys/stat.h> | ||
#include <fcntl.h> | ||
#include <unistd.h> | ||
#include <rtems.h> | ||
#include <bsp/milkymist_usbinput.h> | ||
|
||
#include "usbfirmware.h" | ||
|
||
static const unsigned char input_firmware[] = { | ||
#include <softusb-input.h> | ||
}; | ||
|
||
static struct usbinput_firmware_description firmware_desc = { | ||
.data = input_firmware, | ||
.length = sizeof(input_firmware) | ||
}; | ||
|
||
void load_usb_firmware(void) | ||
{ | ||
int fd; | ||
|
||
fd = open("/dev/usbinput", O_RDONLY); | ||
ioctl(fd, USBINPUT_LOAD_FIRMWARE, &firmware_desc); | ||
assert(fd != -1); | ||
close(fd); | ||
} |
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,23 @@ | ||
/* | ||
* Flickernoise | ||
* Copyright (C) 2012 Sebastien Bourdeauducq | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef __USBFIRMWARE_H | ||
#define __USBFIRMWARE_H | ||
|
||
void load_usb_firmware(void); | ||
|
||
#endif /* __USBFIRMWARE_H */ |