Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754680AbYBELdk (ORCPT ); Tue, 5 Feb 2008 06:33:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751438AbYBELdU (ORCPT ); Tue, 5 Feb 2008 06:33:20 -0500 Received: from zm1.veloxia.com ([213.149.227.2]:48415 "HELO zm1.veloxia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750895AbYBELdT (ORCPT ); Tue, 5 Feb 2008 06:33:19 -0500 Message-ID: <47A84979.5080004@hvsistemas.es> Date: Tue, 05 Feb 2008 12:33:13 +0100 From: Javier Herrero User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Vojtech Pavlik CC: Bryan Wu , Will Newton , dmitry.torokhov@gmail.com, linux-input@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1 try#2] [INPUT] keypad driver: Added support for OpenCores Keyboard Controller References: <1201686610-31458-1-git-send-email-bryan.wu@analog.com> <87a5b0800801300353l196b39bekad6af6ccdbd49d5b@mail.gmail.com> <1201713502.8345.1.camel@roc-laptop> <20080205104242.GA11437@suse.cz> <47A845F7.8030102@hvsistemas.es> <20080205112242.GA5398@suse.cz> In-Reply-To: <20080205112242.GA5398@suse.cz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2808 Lines: 68 Vojtech Pavlik escribi?: > On Tue, Feb 05, 2008 at 12:18:15PM +0100, Javier Herrero wrote: >> Dear Vojtech, >> >> I think that a 1:1 mapping between linux keycodes and what keyboard sends >> is right, because the scan code to key code conversion is already >> programmed and done inside the FPGA code. > > And the FPGA code changes with different keyboards attached? > The original OpenCores keyboard controller is a 6 rows x 12 cols keyboard controller that can be customized for other row/col sizes modifiying Constants.vhd VHDL file, in which also the translation table is defined, and for different key disposition schemes both the number of rows and cols can be changed. We are currently using this controller with a 4x4 key matrix, and with a different key mapping values, so I thought that it would be preferable to have the driver mapping fixed to 1:1 and do the mapping in the VHDL, since in most cases the keyboard using this controller would be different to the default keyboard defined in the original Contants.vhd VHDL file. Regards, Javier >> Best regards, >> >> Javier >> >> Vojtech Pavlik escribi?: >>> On Thu, Jan 31, 2008 at 01:18:22AM +0800, Bryan Wu wrote: >>> >>>> +static irqreturn_t opencores_kbd_isr(int irq, void *dev_id) >>>> +{ >>>> + unsigned char c; >>>> + struct platform_device *pdev = dev_id; >>>> + struct opencores_kbd *opencores_kbd = platform_get_drvdata(pdev); >>>> + struct input_dev *input = opencores_kbd->input; >>>> + >>>> + c = readb(opencores_kbd->addr_res->start); >>>> + input_report_key(input, c & 0x7f, c & 0x80 ? 0 : 1); >>>> + input_sync(input); >>>> + >>>> + return IRQ_HANDLED; >>>> +} >>> This looks utterly wrong: It assumes 1:1 mapping between Linux keycodes >>> and what the keyboard sends, which I can't believe is the case. >>> >> -- >> ------------------------------------------------------------------------ >> Javier Herrero EMAIL: jherrero@hvsistemas.com >> HV Sistemas S.L. PHONE: +34 949 336 806 >> Los Charcones, 17A FAX: +34 949 336 792 >> 19170 El Casar - Guadalajara - Spain WEB: http://www.hvsistemas.com > -- ------------------------------------------------------------------------ Javier Herrero EMAIL: jherrero@hvsistemas.com HV Sistemas S.L. PHONE: +34 949 336 806 Los Charcones, 17A FAX: +34 949 336 792 19170 El Casar - Guadalajara - Spain WEB: http://www.hvsistemas.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/