Welcome, Guest

Author Topic: Register Platform Device  (Read 1118 times)


  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Register Platform Device
« 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.


  • Full Member
  • ***
  • Posts: 180
  • Karma: +21/-0
    • Support my work
Re: Register Platform Device
« Reply #1 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