Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: kschan on July 19, 2017, 03:44:35 am

Title: Register Platform Device
Post by: kschan on July 19, 2017, 03:44:35 am
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.
Title: Re: Register Platform Device
Post by: lambda on July 20, 2017, 07:55:21 pm

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