Register Platform Device

Started by kschan, July 19, 2017, 03:44:35 AM

Previous topic - Next topic

kschan

I am trying to use the pps-gpio module for an NTP time server and am trying to figure out how to register a gpio pin as a platform device. I've gathered from lots of googling that there is a specific struct I have to construct and then use  platform_device_register() with that struct to create the new device entry. I understand that this is usually done with the rest of the init calls on the device during startup. I thought this would go in imx23_olinuxino_init(void) or something similar (this is also what I found on google), but with kernel version 4.10.2 from https://github.com/RobertCNelson/armv5_devel I can't seem to find where all this initialization code lives. Any help is appreciated, not even sure if I am approaching this correctly.

lambda

Hi,

mainline kernels don't use device initialization code anymore. Nowadays devices are created by reading the data from devicetree. See https://www.mjmwired.net/kernel/Documentation/devicetree/bindings/pps/pps-gpio.txt

HTH,
Harald