From owner-freebsd-hackers@FreeBSD.ORG Tue May 13 22:04:23 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 681FA281 for ; Tue, 13 May 2014 22:04:23 +0000 (UTC) Received: from mail-we0-x235.google.com (mail-we0-x235.google.com [IPv6:2a00:1450:400c:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 036FC23B9 for ; Tue, 13 May 2014 22:04:22 +0000 (UTC) Received: by mail-we0-f181.google.com with SMTP id w61so1070675wes.12 for ; Tue, 13 May 2014 15:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=c4Q++OERQWVnBSvo9H54ff0vc/PKoTfGbOfAbLAOLY8=; b=AshuE6OaPbqfHtHAebPjHcaQCuk/ZqrheR2I6ghLuVqz4gFJXAGz3HhUXEO3+W20FZ dV1eAS9BSKye2TRPzquh3e6ZYuY9yqOFr0LdJtMKacsctA1VFwexvrUn/J3mhbEqUucW PIKVD2A93Uq2KojEvGj0uzizfwGkr3xH+1QQag+02e4CiT60Ab7Su1ND3dXNSIM2mvNe 2jHc04KIlH/+PeTL34quvJCIeWt0qWKEvLvDKbT57fqQIWexJLoqROLN+L0uYdSRd63C U6cJ79WzriQHtTA/udwuW3pW2XWBQZVoosZVawwUPhM8mnQV5OEHZvA25kHIciO1ghSR edBQ== X-Received: by 10.180.74.78 with SMTP id r14mr441370wiv.2.1400018661288; Tue, 13 May 2014 15:04:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.163.231 with HTTP; Tue, 13 May 2014 15:04:01 -0700 (PDT) In-Reply-To: References: <20140513084008.GA71115@machdep.com> From: Maxim Ignatenko Date: Tue, 13 May 2014 23:04:01 +0100 Message-ID: Subject: Re: Keyboard drivers, polling vs. non-polling mode To: Ruslan Bukin Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 22:04:23 -0000 On 13 May 2014 22:26, Maxim Ignatenko wrote: > On 13 May 2014 11:17, Maxim Ignatenko wrote: >> On 13 May 2014 09:40, Ruslan Bukin wrote: >>> On Sun, May 11, 2014 at 11:33:42PM +0100, Maxim Ignatenko wrote: >>>> Hello, >>>> >>>> I'm trying trying to get keyboard working in DDB on HP Chromebook 11 (ARM). >>>> br@ said that it doesn't work there because polling mode is not implemented yet. >>>> Where can I read about the difference between polling and non-polling >>>> modes (and about keyboard drivers in general)? >>>> sys/dev/kbd/kbdreg.h describes some structures and method signatures, >>>> but I have no clue what is the expected behaviour of those methods. >>>> >>>> My current guess is that in polling mode keyboard driver just queues >>>> up all the input coming from keyboard and then gives it to consumer >>>> upon request, while in non-polling mode it invokes some callback >>>> instead of queueing. But I cannot find any documentation to confirm or >>>> disprove that. >>>> >>> >>> Chrome Embedded Controller (EC) provides interrupt (KB_GPIO_INT pin, active low) >>> reporting that there are pending data and you need to read the data using >>> ec_command(..). After all data was read, pin comes to 1 (not active). >>> >>> We have no interrupts in KDB, so you have to check pin status manually and >>> if status == 0 (active) then read new data. >>> >>> Probably you can start with patch attached (I did't tested). >> >> Thanks, I've tried something like that, except with invoking >> ec_command immediately and comparing returned state to previous one >> rather than reading status bit from GPIO pin. >> I keep getting "fdb0: i2c transfer returned 6" and none of the printfs >> I've added to iicbus_transfer_gen in sys/dev/iicbus/iiconf.c. > > Here's what I have now. After booting kernel from flash drive I get > kdb prompt (because of panic() call in exynos5_ehci.c) and when I > press any key - screen gets spammed with "fdb0: i2c transfer returned > 6". printfs added to dev/iicbus/*.c are not triggered. Any ideas? Sorry, it's "fbd0", not "fdb0". -- Best regards, Maxim