
저는 장치 트리를 사용하지만 프로브 기능을 호출하지 않는 것 같은 비글본(현재 Ubuntu를 실행하는 가상 머신에서 실행 중)용 간단한 플랫폼 드라이버를 개발 중입니다.
compatible
제가 이해한 바에 따르면, 프로브를 호출하려면 (드라이버 및 장치 트리 파일에) 일치하는 값이 있어야 하고 플랫폼 드라이버를 등록해야 합니다. 내가 무엇을 놓쳤을까요?
struct of_device_id dt_match[] =
{
{.compatible = "A1x"},
{.compatible = "B2x"}
};
struct platform_driver platform_driver_struct =
{
.probe = platform_driver_probe,
.remove = platform_driver_remove,
.id_table = pcdevs_ids,
.driver = {
.name = "pseudo-char-device",
.of_match_table = dt_match
}
};
static int __init platform_driver_init(void)
{
platform_driver_register(&platform_driver_struct);
return 0;
}
// dtsi file
/ {
pcd-dev1 {
compatible = "A1x";
org,size=<512>;
org,perm=<0x15>;
};
pcd-dev2 {
compatible = "B2x";
org,size=<256>;
org,perm=<0x11>;
};
};
그런 다음 위의 DTSI 파일을 am335x-boneblack.dts
.그런 다음 다음을 사용하여 바이너리를 만들었습니다.
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am33x-boneblack.dtb
문자열이 일치하는지 여부에 따라 해당 프로브 기능을 호출하기 arch/arm/boot/dts
위해 커널이 사용하는 디렉터리의 장치 트리 파일이 아닌가요 ?compatible