Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4762

Device Tree • Re: PWM driver questions

$
0
0
You could write a book on some of those, and I'm not going to, but I'll try and give you some pointers:
Where are GPIO pins and pin functions enumerated/documented for both legacy and RP1 style?
The rp1-datasheet lists them for Pi 5 (https://datasheets.raspberrypi.com/rp1/ ... herals.pdf). Similarly, BCM2711 is covered by https://datasheets.raspberrypi.com/bcm2 ... herals.pdf, and BCM2835 by https://datasheets.raspberrypi.com/bcm2 ... herals.pdf .

Alternatively run:

Code:

$ pinctrl -c rp1 funcs$ pinctrl -c bcm2711 funcs$ pinctrl -c bcm2835 funcs
In general, how do you know what property name and values to use?
These are called Device Tree bindings, and are documented in the kernel tree: https://github.com/raspberrypi/linux/tr ... e/bindings
For each subject you'll tend to find generic/common documentation (e.g. pwm.txt - https://github.com/raspberrypi/linux/bl ... wm/pwm.txt) and device-specific information (https://github.com/raspberrypi/linux/bl ... m-rp1.yaml). You'll notice that the latter is written in a machine-readable format (how long with that phrase survive in the LLM age?) - sorry about that.
Is there reason the kmalloc should be used even for drivers that are only created once?
Good question - I'm not sure. I suppose it would allow a module to be loaded but for the memory for it not to be allocated until it is initialised/probed. If your device is definitely a singleton, I wouldn't worry about it.

Statistics: Posted by PhilE — Wed Mar 13, 2024 6:05 pm



Viewing all articles
Browse latest Browse all 4762

Trending Articles