I'm working on building a kernel module for an input device, and I noticed that in the module source, there's a couple calls to input_get_keycode(data->input_dev, scancode, &keycode); When I was compiling I was getting errors that there's no function with that prototype.

Looking into the input/input.c source code, this is the definition of input_get_keycode:

int input_get_keycode(struct input_dev *dev, struct input_keymap_entry *ke)

I tried to look online, and I found a couple obscure references to changing the kernel to be able to deal with large keymaps better, and apparently this function was changed to better handle that. Looking at an older source from input/input.c, the input_get_keycode function was defined as

int input_get_keycode(struct input_dev *dev, unsigned int scancode, unsigned int *keycode)

My question is, when was this changed. Is there notes on the change? I'm building the ubuntu natty kernel from git which is from my understanding from the 2.6.37-rc3 branch.

Is this a ubuntu specific change? Or is this a change in the mainline kernel. I also have the maverick source from git which has the old style (3 input) function.

1 Answer 1


If you are working on a kernel module, I very much recommend that you get a git tree. Obviously Linus's tree is mandatory - I also get the stable trees. Since you are working on Ubuntu, I'd check to see if they have a tree with their changes you can pull from.

Using the git tree, I was able to checkout master and run git blame drivers/input/input.c to see that the function signature for input_get_keycode was last changed in commit 8613e4c2.

Running git show 8613e4c2 gives me the commit message for that change (the notes that you wanted) as well as the patch that implements the change. I can see that the change was made on 2010-09-09.

Starting up gitk (a graphical git viewer) and telling it to go to that commit I can see that the commit precedes v2.6.37-rc1, telling me it was merged into that release. Following the branch up to when Linus merged it, I can see it was merged on 2010-10-26 in commit 3a99c631.

This is all mainline without looking at Ubuntu patches, so it looks like the change has nothing to do with Ubuntu.

  • I guess my question was whether there was information on specifically this change to this function. I'm new to kernel development, but I would think there would be something specific to this function.
    – Falmarri
    Jan 30, 2011 at 2:42
  • Falmarri: I've added a link to the commit. Is this the sort of info you wanted? Otherwise, you can search the kernel mailing list for any discussion.
    – camh
    Jan 30, 2011 at 2:50
  • I guess I just need to get more familiar with the kernel and kernel process. I think I was maybe expecting too much documentation =P
    – Falmarri
    Jan 30, 2011 at 8:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .