element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet & Tria Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Software Application Development Building linux kernel module
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 0 replies
  • Subscribers 362 subscribers
  • Views 496 views
  • Users 0 members are here
Related

Building linux kernel module

e14 Contributor
e14 Contributor over 10 years ago

I'm currently trying to build one of linux drivers as module (pmod oled driver from Digilent). My board is Zedboard, and I want to make work OLED screen that is onboard. I have chosen Analog Devices kernel tree, because of additional drivers that ADV added there to support HDMI, and audio codec. Here is what I did:

git clone github.com/.../linux.git
make zynq_xcomm_adv7511_defconfig
make menuconfig -> marked divers/spi/GPIO_bitbang as builtin (this is dependency of pmodoled), and drivers/staging/pmods/pmodoled1 as module
make uImage LOADADDR=0x00008000

 

And everything builded fine, except my OLED module didn't built. I directory /drivers/staging/pmods I only found one, small object file: built-in.o. So here is my first question: why did it happened, and how to make this module build automatically with the kernel?

Actually, I found workaround on this. I did:

make modules SUBDIRS=drivers/staging/pmods/

 

and module pmodoled-gpio.ko appeared. So I copied it to devicetree, together with scripts for loading pictures to screen, but when I booted linux, and insmoded this module, I get error:

platform spi_gpio.2: spi_busnum_to_master(2) returned NULL
pmodoled-gpio zed_oled: add_gpio_pmodoled_device_to_bus failed: -38
Device 'spi_gpio.2' does not have a release() function, it is broken and must be fixed.

 

I also tried to make it builtin, and this way it works, so it is not devicetree fault. I could leave it like that, but but when I halt system, driver should do specific poweroff sequence on OLED screen, and when driver is builtin it does not do it, and when it is module, it does (in Out-Of-The-Box image it works like that). The fact that it works as builtin also proves that this driver is compatible with this kernel.

 

So, what could I do to avoid error message above? And maybe there is a way to invoke this poweroff code, when driver is builtin? That would be perfect, as I prefer it to be builtin.

 

Link to the driver (in linux tree it is on drivers/staging/pmods): https://github.com/analogdevicesinc/linux/blob/xcomm_zynq/drivers/staging/pmods/pmodoled-gpio.c

And link to the documentation on it: https://github.com/analogdevicesinc/linux/blob/xcomm_zynq/Documentation/pmods/pmodoled.txt

  • Sign in to reply
  • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube