linux-device-driver

More than two SPI devices on an Arm board that supports only two?

余生颓废 提交于 2019-11-30 18:47:40
问题 The Arm processor on one of our boards has an spi port with two chip select lines. It is mentioned in the processor's datasheet that it can control upto two spi devices. Is it possible to use a GPIO as a slave select for an additional spi device? How to modify the existing libraries/device drivers to support this change? So far i've found a file in the kernel's source which contains the addresses of SPI port pins. Can anyone plz tell in which direction should i proceed? 回答1: You don't mention

how to find if unregister_chrdev() call was successful

落爺英雄遲暮 提交于 2019-11-30 17:52:59
unregister_chrdev() call from [linux\fs.h] used to return 0 if successful and <0 other wise. But now, in newer kernel versions, the return value of the function has been changed to void so it no longer returns any thing. Question: Is there any way to find out if the unregister_chrdev() call was successful or not? The return of void was done by changeset: e53252d97e670a38b1d2e9723b48077bba11ddda commit e53252d97e670a38b1d2e9723b48077bba11ddda Author: Akinobu Mita Date: Thu Jul 19 01:47:51 2007 -0700 unregister_chrdev() return void unregister_chrdev() does not return meaningful value. This patch

how to find if unregister_chrdev() call was successful

半世苍凉 提交于 2019-11-30 16:45:57
问题 unregister_chrdev() call from [linux\fs.h] used to return 0 if successful and <0 other wise. But now, in newer kernel versions, the return value of the function has been changed to void so it no longer returns any thing. Question: Is there any way to find out if the unregister_chrdev() call was successful or not? 回答1: The return of void was done by changeset: e53252d97e670a38b1d2e9723b48077bba11ddda commit e53252d97e670a38b1d2e9723b48077bba11ddda Author: Akinobu Mita Date: Thu Jul 19 01:47:51

tty_flip_buffer_push() sends data back to itself

回眸只為那壹抹淺笑 提交于 2019-11-30 16:44:04
I am trying to run tiny_tty in LDD3. When I use "cat /dev/ttty0" to read from it, there is no output and the command is blocked. Checking the trace, I notice both tty_insert_flip_char() and tty_flip_buffer_push() are called. However, the data is not sent to the user by tty core. Instead, it is sent back to the tiny_tty driver's tiny_write() callback function. What is wrong there? The kernel version is 2.6.32-61-generic. Here is the trace tiny_open() tiny_timer() tty_flip_buffer_push() tiny_write - 48 Here is code static void tiny_timer(unsigned long timer_data) { struct tiny_serial *tiny =

tty_flip_buffer_push() sends data back to itself

淺唱寂寞╮ 提交于 2019-11-30 16:20:23
问题 I am trying to run tiny_tty in LDD3. When I use "cat /dev/ttty0" to read from it, there is no output and the command is blocked. Checking the trace, I notice both tty_insert_flip_char() and tty_flip_buffer_push() are called. However, the data is not sent to the user by tty core. Instead, it is sent back to the tiny_tty driver's tiny_write() callback function. What is wrong there? The kernel version is 2.6.32-61-generic. Here is the trace tiny_open() tiny_timer() tty_flip_buffer_push() tiny

Capturing Display / Monitor Images, Sending Keyboard Input on Linux

情到浓时终转凉″ 提交于 2019-11-30 16:08:33
问题 I need to process images sent to my laptop's video display, and I need to send keyboard input to my Linux system, using a C++ or shell program. My goal is to process images that are part of an FPS game, then taking action inside that game (hence the keyboard input) based on these images. Instead of trying to understand (if it's even possible) how to interface to game X or Y, using some API, I figured this is the quickest way to interface to any game, hijacking Linux input and output somehow.

Capturing Display / Monitor Images, Sending Keyboard Input on Linux

穿精又带淫゛_ 提交于 2019-11-30 16:08:31
I need to process images sent to my laptop's video display, and I need to send keyboard input to my Linux system, using a C++ or shell program. My goal is to process images that are part of an FPS game, then taking action inside that game (hence the keyboard input) based on these images. Instead of trying to understand (if it's even possible) how to interface to game X or Y, using some API, I figured this is the quickest way to interface to any game, hijacking Linux input and output somehow. Is there any way to do this without any kernel, or device driver hacking? I used recordmydesktop to

How to prevent “error: 'symbol' undeclared here” despite EXPORT_SYMBOL in a Linux kernel module?

旧时模样 提交于 2019-11-30 14:35:05
I'm embedding some driver into a Linux kernel when I get this error (I'm adding the device in the board file and registering it): error: 'kxtf9_get_slave_descr' undeclared here (not in a function) I located the function above in a driver file struct ext_slave_descr *kxtf9_get_slave_descr(void) { return &kxtf9_descr; } EXPORT_SYMBOL(kxtf9_get_slave_descr); Shouldn't it made "visible" by EXPORT_SYMBOL? The C file containing the code above has no header file (I didn't write it, I just found it here and I'm implementing. They say it's tested so I assume an header is not needed? The rest of the

How can I get Linux device with FTDI D2XX driver API

扶醉桌前 提交于 2019-11-30 14:25:19
问题 I am using FTDI D2XX driver API to communicate with a FTDI device. It gives me some information about the device like locid, serialnumber, description but it is not enough. How can I get the device number ( /dev/ttyUSBXX ) or bus or port with this API. thanks 回答1: As the D2XX Programmer's Guide tells in the Introduction: For Linux, Mac OS X (10.4 and later) and Windows CE (4.2 and later) the D2XX driver and VCP driver are mutually exclusive options as only one driver type may be installed at

Why is make printing “make: Nothing to be done for `all'.”?

这一生的挚爱 提交于 2019-11-30 14:04:40
问题 This is a "Hello.c" module and "Makefile". After executing make from the woking directory I get the following message: make: Nothing to be done for `all'. This is the "Hello.c" file: #include <linux/module.h> // included for all kernel modules #include <linux/kernel.h> // included for KERN_INFO #include <linux/init.h> // included for __init and __exit macros MODULE_LICENSE("GPL"); MODULE_AUTHOR("Lakshmanan"); MODULE_DESCRIPTION("A Simple Hello World module"); static int __init hello_init(void