element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Achievement Levels
    • Benefits of Membership
    • Feedback and Support
    • Members Area
    • Personal Blogs
    • What's New on element14
  • Learn
    Learn
    • eBooks
    • Learning Center
    • Learning Groups
    • STEM Academy
    • Webinars, Training and Events
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Arduino Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Project Groups
    • Raspberry Pi Projects
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Or 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet 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
Avnet Boards Forums requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 0 replies
  • Subscribers 173 subscribers
  • Views 186 views
  • Users 0 members are here
Related

Building linux kernel module

Former Member
Former Member over 7 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 © 2023 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.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube