linux-device-driver

Device Tree dependency between two nodes

随声附和 提交于 2021-02-10 14:35:04
问题 I have two device tree nodes, one sets a gpio pin and the other one configures one i2c bus, ex: &gpio2 { en-gpio { gpio-hog; gpios = <5 0>; output-high; }; }; &i2c1 { gpiom1: gpio@27 { compatible = "microchip,mcp23008"; gpio-controller; #gpio-cells = <2>; reg = <0x27>; }; }; How can i add a dependency between the i2c node and gpio one? What i want to achieve is that the gpio pin should be set before the devices on i2c are initialized. 回答1: Short answer You can't provide dependency between

How correctly wake up process inside interrupt handlers

一个人想着一个人 提交于 2021-02-10 07:14:00
问题 Briefly, in a read method i check if a variable is 0 and if it's i put the current process to sleep: static ssize_t soc2e_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) { ... struct soc2e_dev *soc2e = (struct soc2e_dev *)filp->private_data; if (soc2e->bytes == 0) { if (wait_event_interruptible(soc2e->wlist, (soc2e->bytes > 0))) return -ERESTARTSYS; } ... } I must wake up the process in an interrupt handler: static irqreturn_t soc2e_irq_handler(int irq, void *dev) { ...

How correctly wake up process inside interrupt handlers

假装没事ソ 提交于 2021-02-10 07:12:27
问题 Briefly, in a read method i check if a variable is 0 and if it's i put the current process to sleep: static ssize_t soc2e_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) { ... struct soc2e_dev *soc2e = (struct soc2e_dev *)filp->private_data; if (soc2e->bytes == 0) { if (wait_event_interruptible(soc2e->wlist, (soc2e->bytes > 0))) return -ERESTARTSYS; } ... } I must wake up the process in an interrupt handler: static irqreturn_t soc2e_irq_handler(int irq, void *dev) { ...

How correctly wake up process inside interrupt handlers

雨燕双飞 提交于 2021-02-10 07:11:41
问题 Briefly, in a read method i check if a variable is 0 and if it's i put the current process to sleep: static ssize_t soc2e_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) { ... struct soc2e_dev *soc2e = (struct soc2e_dev *)filp->private_data; if (soc2e->bytes == 0) { if (wait_event_interruptible(soc2e->wlist, (soc2e->bytes > 0))) return -ERESTARTSYS; } ... } I must wake up the process in an interrupt handler: static irqreturn_t soc2e_irq_handler(int irq, void *dev) { ...

Replace kernel builtin module with a loadable one

我与影子孤独终老i 提交于 2021-02-08 18:47:56
问题 I have developped a kernel module to manage a nf4 tag as a char device. I have developped this module outside of the kernel and tested it compiled as a loadable kernel module (i.e. .ko) during the development phase. Once the driver has been functional and stable enough I have inserted it into linux kernel source (v4.9.30) using patches so it's built as part of the kernel. Here I'm in the situation where the module is loaded probed at boot by kernel as it's builtin and it appears into the

Replace kernel builtin module with a loadable one

给你一囗甜甜゛ 提交于 2021-02-08 18:40:12
问题 I have developped a kernel module to manage a nf4 tag as a char device. I have developped this module outside of the kernel and tested it compiled as a loadable kernel module (i.e. .ko) during the development phase. Once the driver has been functional and stable enough I have inserted it into linux kernel source (v4.9.30) using patches so it's built as part of the kernel. Here I'm in the situation where the module is loaded probed at boot by kernel as it's builtin and it appears into the

Replace kernel builtin module with a loadable one

谁都会走 提交于 2021-02-08 18:38:20
问题 I have developped a kernel module to manage a nf4 tag as a char device. I have developped this module outside of the kernel and tested it compiled as a loadable kernel module (i.e. .ko) during the development phase. Once the driver has been functional and stable enough I have inserted it into linux kernel source (v4.9.30) using patches so it's built as part of the kernel. Here I'm in the situation where the module is loaded probed at boot by kernel as it's builtin and it appears into the

Replace kernel builtin module with a loadable one

左心房为你撑大大i 提交于 2021-02-08 18:35:45
问题 I have developped a kernel module to manage a nf4 tag as a char device. I have developped this module outside of the kernel and tested it compiled as a loadable kernel module (i.e. .ko) during the development phase. Once the driver has been functional and stable enough I have inserted it into linux kernel source (v4.9.30) using patches so it's built as part of the kernel. Here I'm in the situation where the module is loaded probed at boot by kernel as it's builtin and it appears into the

Replace kernel builtin module with a loadable one

余生长醉 提交于 2021-02-08 18:32:46
问题 I have developped a kernel module to manage a nf4 tag as a char device. I have developped this module outside of the kernel and tested it compiled as a loadable kernel module (i.e. .ko) during the development phase. Once the driver has been functional and stable enough I have inserted it into linux kernel source (v4.9.30) using patches so it's built as part of the kernel. Here I'm in the situation where the module is loaded probed at boot by kernel as it's builtin and it appears into the

How to acess the physical address from linux kernel space?

旧时模样 提交于 2021-02-07 08:21:33
问题 I am working on rasberry pi board. Is it possible to directly access the GPIO physical address from linux kernel space using inb(), outb()... ?. If yes how ?. GPIO register address link Page 90 http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf Thank you 回答1: Yes. Get a virtual address mapping setup to the registers in question using ioremap Use readl/writel to manipulate the physical memory. Beware that ARM processors will fault on unaligned accesses. Linux