linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
To: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: linux-arm-kernel@lists.arm.linux.org.uk, linux-input@vger.kernel.org
Subject: Re: [PATCH] Tosa keyboard support
Date: Thu, 3 Jan 2008 11:51:11 -0500	[thread overview]
Message-ID: <d120d5000801030851j6629e4f0m102939aff412df5b@mail.gmail.com> (raw)
In-Reply-To: <20071223232914.GA28932@doriath.ww600.siemens.net>

Hi Dmitry,

Sorry for the slow response.

On Dec 23, 2007 6:29 PM, Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:
> > From b213bef91e3f98c6104138050ad4eaa0a54e765d Mon Sep 17 00:00:00 2001
> From: Dmitry Baryshkov <dbaryshkov@gmail.com>
> Date: Mon, 24 Dec 2007 02:15:34 +0300
> Subject: [PATCH] Tosa keyboard support
>
> Support keyboard on tosa (Sharp Zaurus SL-6000x).
> Largely based on patches by Dirk Opfer.
> This is the final version that supports switching between
> full keycode range and range available to the console and
> keyb Kdrive driver.
>

The driver looks very nice, just a couple minor comments:

> +
> +#ifdef CONFIG_PM
> +static int tosakbd_suspend(struct platform_device *dev, pm_message_t state)
> +{
> +       /* Nothing yet */

Stop the polling timer here?

> +
> +       return 0;
> +}
> +
...

> +
> +       tosakbd->input = input_dev;
> +
> +       input_dev->private = tosakbd;

Please use input_set_drvdata(). I am about to commit the change
removing private from input_dev structure.

> +       input_dev->name = "Tosa Keyboard";
> +       input_dev->phys = "tosakbd/input0";
> +       input_dev->cdev.dev = &pdev->dev;

Please use input_dev->dev.parent. cdev is going away.

> +
> +       input_dev->id.bustype = BUS_HOST;
> +       input_dev->id.vendor = 0x0001;
> +       input_dev->id.product = 0x0001;
> +       input_dev->id.version = 0x0100;
> +
> +       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
> +       input_dev->keycode = tosakbd->keycode;
> +       input_dev->keycodesize = sizeof(unsigned int);
> +       input_dev->keycodemax = ARRAY_SIZE(tosakbd_keycode);
> +
> +       memcpy(tosakbd->keycode, tosakbd_keycode, sizeof(tosakbd_keycode));
> +
> +       for (i = 0; i < ARRAY_SIZE(tosakbd_keycode); i++)
> +               set_bit(tosakbd->keycode[i], input_dev->keybit);
> +       clear_bit(0, input_dev->keybit);

Might want to switch to __set_bit to save couple of bytes. We dont
need atomicity here.

> +
> +#define TOSA_KEY_SYNC          KEY_102ND /* ??? */
> +
> +
> +#ifndef CONFIG_KEYBOARD_TOSA_USE_EXT_KEYCODES
> +#define TOSA_KEY_RECORD                KEY_YEN
> +#define TOSA_KEY_ADDRESSBOOK   KEY_KATAKANA
> +#define TOSA_KEY_CANCEL                KEY_ESC
> +#define TOSA_KEY_CENTER                KEY_HIRAGANA
> +#define TOSA_KEY_OK            KEY_HENKAN
> +#define TOSA_KEY_CALENDAR      KEY_KATAKANAHIRAGANA
> +#define TOSA_KEY_HOMEPAGE      KEY_HANGEUL
> +#define TOSA_KEY_LIGHT         KEY_MUHENKAN
> +#define TOSA_KEY_MENU          KEY_HANJA
> +#define TOSA_KEY_FN            KEY_RIGHTALT
> +#define TOSA_KEY_MAIL          KEY_ZENKAKUHANKAKU
> +#else
> +#define TOSA_KEY_RECORD                KEY_RECORD
> +#define TOSA_KEY_ADDRESSBOOK   KEY_ADDRESSBOOK
> +#define TOSA_KEY_CANCEL                KEY_CANCEL
> +#define TOSA_KEY_CENTER                KEY_SELECT /* ??? */
> +#define TOSA_KEY_OK            KEY_OK
> +#define TOSA_KEY_CALENDAR      KEY_CALENDAR
> +#define TOSA_KEY_HOMEPAGE      KEY_HOMEPAGE
> +#define TOSA_KEY_LIGHT         KEY_SWITCHVIDEOMODE /* ??? */

KEY_ILLUMTOGGLE maybe? SWITCHWIDEOMODE is for cycling between outputs...

Also, I'd put these defines rigth in tosakbd.c.

Thanks.

-- 
Dmitry

  reply	other threads:[~2008-01-03 16:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-23 23:29 [PATCH] Tosa keyboard support Dmitry Baryshkov
2008-01-03 16:51 ` Dmitry Torokhov [this message]
2008-01-03 23:01   ` Dmitry Baryshkov
2008-01-03 23:08     ` Dmitry Baryshkov
2008-01-11 14:56     ` Dmitry Torokhov
2008-01-11 16:38       ` Dmitry Baryshkov
2008-01-11 20:52         ` Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2007-12-11 15:23 Dmitry Baryshkov
2007-12-11 15:38 ` Dmitry Baryshkov
2007-12-16 10:29   ` Russell King - ARM Linux
2007-12-16 10:52     ` Dmitry
2007-12-16 10:51   ` Dmitry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d120d5000801030851j6629e4f0m102939aff412df5b@mail.gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=dbaryshkov@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).