Need a Special driver compiled -- kernel module help

Asked by Pythonator

Trying to get keyboard working on my Pepper Pad 3 ( http://www.pepper.com/ ).
The PepperPad3's split keyboard requires a special driver that must be compiled and installed as a kernel module (.ko file).

The driver is opensource & GPL'd, and it was originally compiled and deployed in Pepper Linux (Fedora Core 4 / kernel 2.6.12).
Now I'd like to compile it on Ubuntu.

I don't have much to work with, just the files:

pad3_kypd.c
Kconfig
Makefile

1. How to compile these source files on Ubuntu ?

2. How to plug the finished (.ko) module into the Ubuntu Kernel ?

I'd love to keep using Ubuntu on my PepperPad3.
Thanks in Advance!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Pythonator
Solved:
Last query:
Last reply:
Revision history for this message
Markus Thielmann (thielmann) said :
#1

Thanks for your question.

1) Cross fingers that you don't need to change anything
2) open a command line, change to the driver directory and run: make
3) if it works without a error message try: make install
4) Reboot and hope it worked.

Revision history for this message
Pythonator (john-schnittker) said :
#2

After entering the driver directory and typing make,

It says:

make: *** No targets. Stop.

From which folder (full path please) must one invoke the "make" command ?

Thank you!

Revision history for this message
Markus Thielmann (thielmann) said :
#3

Could you please make the driver package available, so we may have a look at it?

Revision history for this message
Pythonator (john-schnittker) said :
#4

Here's the driver source code zipped up in a little file (contains all the files in the kernel source tree at /drivers/input/keyboard/):

http://ubuntuforums.org/attachment.php?attachmentid=34352&d=1181005089

If you need the whole [Pepper Linux] kernel source tree, it is stored here:

http://updates.pepper.com/pub/pepperpad/sources/pepperpad3/3.1.0/kernel-2.6.12-71.src.rpm

Pepper Linux makes all of its source code available here:

http://updates.pepper.com/pub/pepperpad/sources/pepperpad3/3.1.0/

Thank you!

Revision history for this message
Cesare Tirabassi (norsetto) said :
#5

The problem is not how to build the module, but that you will need to modify the module source code to be compatible with the ubuntu kernel tree. To start with, in ubuntu there is no cim, ergo no cim_rtns.h header.
Are you prepared to make the necessary changes to the source code to make it buildable?

Revision history for this message
Pythonator (john-schnittker) said :
#6

Thanks for clarifying.

I'm gathering more knowledge about this module and about cim, as my personal time allows.

Your insights are very helpful.

Thank you!

Revision history for this message
Launchpad Janitor (janitor) said :
#7

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Pythonator (john-schnittker) said :
#8

As a kernel neophyte, I want to cooperate with anyone who can help me get this driver integrated into Ubuntu.

Is it possible to compile this kernel module in isolation, or do I need to compile the entire ubuntu kernel (including this module) at one time ?

Revision history for this message
Markus Thielmann (thielmann) said :
#9

It is possible to build a kernel module which linux is able to load at runtime. So generally there's no need to recompile the whole kernel to get a driver to work.

BUT

The driver is based on a quite outdated kernel. In order to compile it, you'll need to check what changed at the kernel source code and make the appropriate changes to the driver source code. So you won't have much success without familiarizing yourself with kernel driver development.
Before that, you should think on filing a feature request on the bug tracker, to get the attention of a kernel developer.

Revision history for this message
Pythonator (john-schnittker) said :
#10

Thanks Markus! After massaging the .C source, I got it to compile and load.

In order to make it compile (and not crash), I had to comment-out the device registration logic -- it doesn't seem to work in Ubuntu's current kernel.

I added some debug code to the source, so it DOES write all keycodes from all keypress events into the kernel log file. But it crashes upon calling input_report_key

Hopefully there is an expert who can help bring this to the next step.

Revision history for this message
Rouben (rouben) said :
#11

Hi Pythonator, have you tried discussing this on the Ubuntu forums or the IRC channels?

Revision history for this message
Pythonator (john-schnittker) said :
#12

Yes, I had.

This driver was written before kernel 2.6.20 so it calls workqueue API functions the old pre-2.6.20 way.
That is why it won't presently work.

Are there any experts familiar with the workque API in kernel 2.6.20 ?
If they can help me change a few lines of code that would help me retrofit this driver so it works.

Thanks!

Revision history for this message
Pythonator (john-schnittker) said :
#13

Article about the changes made to the Workqueue API in kernel 2.6.20 that have caused breakage in many device drivers:

http://lwn.net/Articles/211279/

Revision history for this message
Pythonator (john-schnittker) said :
#14

This driver has been fixed, released and tested for kernel >=2.6.24

Revision history for this message
Chris Halse Rogers (raof) said :
#15

Please read the attached letter and get back to my office for more details to proceed further.

Thanks and have a very nice day.

Revision history for this message
Chris Halse Rogers (raof) said :
#16

Dear customer!

The courier company was not able to deliver your parcel by your address.

You may pickup the parcel at our post office personaly.

The shipping label is attached to this e-mail.
Please print this label to get this package at our post office.

Thank you for attention.
DHL Express Services.

Revision history for this message
Chris Halse Rogers (raof) said :
#17

Dear customer!

The courier company was not able to deliver your parcel by your address.

You may pickup the parcel at our post office personaly.

The shipping label is attached to this e-mail.
Please print this label to get this package at our post office.

Thank you for attention.
DHL Express Services.

Revision history for this message
Chris Halse Rogers (raof) said :
#18
Revision history for this message
Chris Halse Rogers (raof) said :
#19
Revision history for this message
Chris Halse Rogers (raof) said :
#20