Quantcast
Viewing all articles
Browse latest Browse all 5391

Device Tree • Re: PWM driver questions

1. Are you building your driver as a module?
2. How are you installing it?
3. What output do you get from the following command?
1) Yes "make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules". I did't know there are other options. What options should I research?
2) By installing it do you mean loading or initializing? Installing with Open Firmware (compatible parameter of the dtoverlay in williespwm platform device) and initialized currently module_init() function (but I have also tried platform device probe function but it never was called).
3) wkeeling@pi5dev:~ $ grep williespwm /lib/modules/$(uname -r)/modules.alias
alias of:N*T*CwilliespwmC* pwm_driver
alias of:N*T*Cwilliespwm pwm_driver


Here is the Open Firmware code I am using and the platform device struct I tried in pwm_driver:

Code:

/* open firmware match table  */ static struct of_device_id my_match_table[] = {     {             .compatible = "williespwm",     },     {},};MODULE_DEVICE_TABLE(of, my_match_table);/*  platform device struct -- not sure how kernel knows about this struct?  */static struct platform_driver my_platform_driver = {    .probe = my_probe,    .remove = my_remove,    .driver = {        .name = "williesdriver",        .owner = THIS_MODULE,        .of_match_table = of_match_ptr(my_match_table),    },};

Statistics: Posted by wkeeling — Mon Mar 11, 2024 12:46 am



Viewing all articles
Browse latest Browse all 5391

Trending Articles