linux-device-driver

Building a i2c device controller

心不动则不痛 提交于 2019-12-13 14:45:25
问题 I am building a PCB that will communicate via a i2c bus with a UDOO x86 running ubuntu 18.04 with two accesible i2c buses and multiple GPIO the device has 3 i2c chips on it i2c-mux-pca954x PCA9543 - level shifting bus switch SC18IS602B - i2c to SPI Bus master SC16IS741A - i2c to uart each of which has a kernel driver module(i2c-mux-pca954x,spi-sc18is602,sc16is7xx) both the SC18IS602B and SC16IS741A are connected to one channel of the PCA9543 and corresponding interrupt. the second channel for

Linux device driver for a RS232 device in embedded system

陌路散爱 提交于 2019-12-13 12:29:47
问题 I have recently started learning to write Linux device drivers for a specific project that I am working on. Previously most of the work I have done has been with devices running no OS so Linux drivers and development is somewhat new to me. For the project I am working on I have an embedded system running a Linux based operating system. I have an external device with is controlled via RS232 that I need to write a driver for. Questions: 1) Is there a way to access serial ports from withing

Network device driver [closed]

末鹿安然 提交于 2019-12-13 07:56:51
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I want to write Linux device driver for network based device. This network device is just Input output control only and also this device connects through Ethernet port via ethernet cable. How can i write driver?

How to gracefully disable the interrupt line without a kernel crash?

给你一囗甜甜゛ 提交于 2019-12-13 05:02:41
问题 I have implemented a program that reads from the keyboad, and scans code and put it into the tasklet. The tasklet unblocks the read(). Thus, my QT-application can read the data and if it finds the scan code of l, it fires a callback to Qt-webkit. However, when I am doing rmmod of my character driver. The entire kernel crashes. What is the problem in my character driver. #include <linux/init.h> #include <linux/module.h> /** needed by all modules **/ #include <linux/kernel.h> /** This is for

linux device driver for pure ipv6 device

China☆狼群 提交于 2019-12-13 04:11:36
问题 I am currently designing a linux driver for a pure IPv6 driver. Is there any way to make the kernel module only support IPv6 and can only be assigned IPv6 address? What is the commands in linux to set the address? Thanks 回答1: Adding IP: Using ip command: $sudo /sbin/ip -6 addr add 2001:0db8:0:f101::1/64 dev eth0 Using ifconfig command: $sudo /sbin/ifconfig eth0 inet6 add 2001:0db8:0:f101::1/64 Deleting IP: Using ip $sudo /sbin/ip -6 addr del 2001:0db8:0:f101::1/64 dev eth0 Using ifconfig

Getting access to the input handler from the IRQ lane

喜你入骨 提交于 2019-12-13 03:51:30
问题 Whilst researching the input event system in the kernel, I came across the need to access the input handlers that have already been registered with an IRQ lane given only the irq lane (just the integer). Is there a method to access ALL event handlers associated with an IRQ? I am looking to map each list of handlers from a given input device (say mouse) to each possible event that the device could make. Not sure if it matters, but I am working with the AOSP for ARM devices. 回答1: There is an

Why is the probe function in my kernel module not being called?

会有一股神秘感。 提交于 2019-12-13 02:35:21
问题 While following, among others, this tutorial ([http://tali.admingilde.org/linux-docbook/writing_usb_driver.pdf][1]) and reading certain chapters in the linux device drivers book, I cannot get the pr_debug statements in the probe function to show any output in dmesg. Here's my code: #include <linux/module.h> /*included for all kernel modules*/ #include <linux/kernel.h> /*included for KERN_DEBUG*/ #include <linux/init.h> /*included for __init and __exit macros*/ #include <linux/usb.h> #include

pins to control screen rotation, which API for linux kernel<->userspace to choose?

旧巷老猫 提交于 2019-12-13 01:19:14
问题 I have lcd screen connected to arm cpu, and there are two pins on this lcd screen to control where is left,top corner on the screen (2 pins = 4 variants). And I don't know which API to use to control left,top corner from userspace? The most simple one just export this pins via gpio sysfs interface, but I don't like this solution, because of user app should not know such details, as gpio number connected to lcd panel. The another solution modify fbdev video driver and add paramter to control

How should a uio_dmem_genirq driver be configured via the device tree

时间秒杀一切 提交于 2019-12-12 19:22:00
问题 The uio_dmem_genirq driver is backwards compatible with the uio_pdrv_genirq driver but with the addition that it dynamically allocates continuous memory. How do the device tree entries have to be defined to load the dmem driver? The working configuration for the pdrv version consists of the following device tree entry: spw0@7aa00000 { compatible = "generic-uio"; reg = <0x7aa00000 0x10000>; interrupts = <0x0 0x1D 0x4>; interrupt-parent = <0x3>; clocks = <0x1>; }; and changing the bootargs to

Printing CPU number similar to ftrace

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 18:44:31
问题 I want to print CPU number on which the current process or function is executing similar to ftrace like this: TASK-PID CPU# TIMESTAMP FUNCTION | | | | | <idle>-0 [002] 23636.756054: ttwu_do_activate.constprop.89 <-try_to_wake_up <idle>-0 [002] 23636.756054: activate_task <-ttwu_do_activate.constprop.89 <idle>-0 [002] 23636.756055: enqueue_task <-activate_task How do I get that value? I suppose its there in some function of start_kernel function. Can we print its value? I am using linux-4.1