是否可以在一个平台驱动程序(设备树节点)中使用多个不同的平台设备
我正在为Beaglebone撰写内核驱动程序c。我的作业:编写一个UART驱动程序,该驱动程序从GPYO接收数据并将其发送给用户我有设备树,我必须使用两个平台设备: uart 和 gpio 这是DT的摘录:
uarts{
pinctrl-names = "default";
pinctrl-0 = <&user_uarts_s0>;
compatible = "serial";
:
:
&gpio_pins {
compatible = "gpio_device";
pinctrl-names = "default";
pinctrl-0 = <&gpio_pins>;
};
我可以使用一个平台设备(下面附有代码),但是我该如何使用两个?我应该在哪里放置“ gpio_device”
static struct platform_driver serial8250_driver = {
.driver = {
.name = "serial",
.owner = THIS_MODULE,
.of_match_table = hw_match_table},
.probe = Serial_probe,
.remove = Serial_remove
};
static struct of_device_id hw_match_table[] =
{
{
.compatible = "serial",
},
};
这是我的第一个驱动程序,所以请不要太严厉地判断并帮助我!
I am writing a kernel driver for beaglebone c. My assignment: write a uart driver that receives data from the gpyo and sends it to the user I have Device Tree and I have to use two platform devices: uart and gpio
here is an excerpt from DT:
uarts{
pinctrl-names = "default";
pinctrl-0 = <&user_uarts_s0>;
compatible = "serial";
:
:
&gpio_pins {
compatible = "gpio_device";
pinctrl-names = "default";
pinctrl-0 = <&gpio_pins>;
};
I can use one platform devices (code is attached below), but how can I use two? where should I put "gpio_device"
static struct platform_driver serial8250_driver = {
.driver = {
.name = "serial",
.owner = THIS_MODULE,
.of_match_table = hw_match_table},
.probe = Serial_probe,
.remove = Serial_remove
};
static struct of_device_id hw_match_table[] =
{
{
.compatible = "serial",
},
};
this is my first driver so please don't judge too harshly and help me!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论