新しいシリアルデバイスバスを使用して(カーネル4.11rc6を使用して)GPIOドライバを使用してMFDドライバを作成しようとしています。Linuxのserdev mfdドライバがプローブされていません
私は腕のデバイス用のqemuの下で実行していると私はarch/arm/boot/dts/versatile-ab.dts
を変更しているので、UART2は読む:
uart2: [email protected] {
compatible = "arm,pl011", "arm,primecell";
reg = <0x101f3000 0x1000>;
interrupts = <14>;
clocks = <&xtal24mhz>, <&pclk>;
clock-names = "uartclk", "apb_pclk";
fcd16999 {
compatible = "ev,fcd16999";
fcd16999gpio: fcd16999-gpio {
compatible = "ev,fcd16999-gpio";
};
};
};
/proc/device-tree/amba/[email protected]/fcd16999/compatible
はev,fcd16999
を読み取り、子ノードfcd16999-gpio/compatible
はev,fcd16999-gpio
です。
まだ両方のデバイスのinit関数が呼び出されますが、プローブ関数は呼び出されません。私はここで何かを見逃していますか?互換性のあるフラグが一致し、デバイスツリーがロードされるので、正しく動作するはずです。
以下のファイル。
ドライバ/ MFD/fcd16999.c
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/mfd/core.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/serdev.h>
#include <linux/slab.h>
/*#include <linux/mfd/tps6507x.h>*/
static const struct mfd_cell fcd16999_devs[] = {
{
.name = "fcd16999-gpio",
.of_compatible = "ev,fcd16999-gpio",
},
/*
{
.name = "fcd16999-adc",
},
{
.name = "fcd16999-thermometer",
},
*/
};
static int fcd16999_serdev_probe(struct serdev_device *serdev)
{
dev_warn(&serdev->dev, "fcd16999_serdev_probe\n");
return devm_mfd_add_devices(&serdev->dev, 1, fcd16999_devs,
ARRAY_SIZE(fcd16999_devs), NULL, 0, NULL);
}
void fcd16999_serdev_remove(struct serdev_device *serdev)
{
dev_warn(&serdev->dev, "fcd16999_serdev_remove\n");
}
static const struct of_device_id fcd16999_of_match[] = {
{.compatible = "ev,fcd16999", },
{},
};
MODULE_DEVICE_TABLE(of, fcd16999_of_match);
static struct serdev_device_driver fcd16999_driver = {
.driver = {
.name = "fcd16999",
.of_match_table = of_match_ptr(fcd16999_of_match),
},
.probe = fcd16999_serdev_probe,
.remove = fcd16999_serdev_remove,
};
static int __init fcd16999_serdev_init(void)
{
int ret = 101;
printk("Hello from fcd16999!\n");
ret = serdev_device_driver_register(&fcd16999_driver);
printk("serdev_device_driver_register returned %d\n", ret);
return ret;
}
/* init early so consumer devices can complete system boot */
subsys_initcall(fcd16999_serdev_init);
static void __exit fcd16999_serdev_exit(void)
{
printk("Goodbye from fcd16999!\n");
serdev_device_driver_unregister(&fcd16999_driver);
}
module_exit(fcd16999_serdev_exit);
ドライバ/ GPIO/GPIO-fcd16999.c
#include <linux/bitops.h>
#include <linux/gpio.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
/* #include <linux/mfd/stmpe.h> */
static int fcd16999_gpio_probe(struct platform_device *pdev)
{
printk("Hellow, fcd16999\n");
dev_warn(&pdev->dev, "fcd16999_gpio probing...\n");
return 0;
}
static struct platform_driver fcd16999_gpio_driver = {
.driver = {
.suppress_bind_attrs = true,
.name = "fcd16999-gpio",
},
.probe = fcd16999_gpio_probe,
};
static int __init fcd16999_gpio_init(void)
{
printk("Init Hellow, gpio-fcd16999\n");
return platform_driver_register(&fcd16999_gpio_driver);
}
subsys_initcall(fcd16999_gpio_init);
static void __exit fcd16999_gpio_exit(void)
{
printk("Goodbye from gpio-fcd16999!\n");
platform_driver_unregister(&fcd16999_gpio_driver);
}
module_exit(fcd16999_gpio_exit);
UARTドライバ(プローブと初期化部品)の表示に失敗しました。 Githubまたは類似のリポジトリを使用してリンクを共有する方がよい – 0andriy
私はそれについて考えたことはありませんでしたが、私はその部分に全く触れていません。私はそれがデフォルトのqemuアームドライバであるので、それは良いはずだと思っています。 – evading