From patchwork Fri Nov 24 09:30:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 841001 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UyxqNc+j"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="RTavoLep"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yjrZx5tvwz9s03 for ; Fri, 24 Nov 2017 20:32:57 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=8UXMn6a/BswCn35Vq1nk96+Wz7z0HG6+3UBYZ6pNNzI=; b=UyxqNc+jaJkaxxC1vOCdyHg3Vu RpA73Vq1Ym78StITTvQVXm+aPI7F0SwCphD8FqFyz+KLoYlfSVMlxP6vvpBGipEKYxsD84ipXQwAw ZbsaLIejTdPCHrLrd7axqjseDQk0r0pSCOa2f3hV/wOM8QKQw/DIYWWY87rH5UhgsL/Z9LZLzDA0z sNC9vBcb9v6AC3wdsuj1SblXSWdfSo+ay1vlqHmF7pyGfReeUkb70WdIJyFHMFVSSH8sqNf3Xt5eO hhEeDzh9YOKF7x1tT+A2eRk8IPZBWXmnHxCON0GO6Ifp6yVSMzuokRB29057p5PRqqNGNSpzo7lSX sHqFNrvg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eIALv-00087b-Tt; Fri, 24 Nov 2017 09:32:55 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eIAKK-0006I9-Go for linux-arm-kernel@lists.infradead.org; Fri, 24 Nov 2017 09:31:29 +0000 Received: by mail-lf0-x243.google.com with SMTP id w23so24707355lfd.11 for ; Fri, 24 Nov 2017 01:30:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uWr10+NzL1BqSwGiDT41HpkblX7lII/QBqSLImqAID4=; b=RTavoLepnGb5l23gl5Vkv1hWkd5fs8tqE43a6I+JHfZgm4ezq2P0lTpnI6K0BQioTu vWFWaxJHlByE3AEM1qay7HqUqPHqaowbono3h1FTPTIFVMbu9G39XgW5YBwLa/PjYz5m Qg4cRrhEbTMSgVnz7mO1ICSjcZjuGmtEcVd10= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uWr10+NzL1BqSwGiDT41HpkblX7lII/QBqSLImqAID4=; b=RO3ZEwSq55cnHIVXDwvV/vxTJFXpUQjfanhSd7QB890S/vALfK1gtRVogG2YeOXzg/ SbhPnFO8sWdAnXrDVN/SHWb6QQ0FaFgFRWKFD69QxCEgr3Mk0DwvW7qS2ZkxChUyIuTL NnCF776mATANqvw7MmRCKvJfRQHbEJ0MSjzLbOMdZozh4HXzmgGEFIFF5OGTunBRuahx 54yh5OmqYsFVCsrMqNBuyumaO+EahqQARRx3/6hx6skiOp6uIt8cmSVrx2grbsLoNOQb /XIrDmVcdQqUECOeZrayTp/gNiE8cLr2cq0yMpTISMzEPQw3jcDsnJiAVVdPS1zDfvdw jqlA== X-Gm-Message-State: AJaThX6AScj39T9SbDEGrh5ArgwZL4EOTgb/z4Qvki1jYj3sGBPaHK6v SbWpYzryD3uPrlPBuyC+SsRrnWEpd+U= X-Google-Smtp-Source: AGs4zMYwpILg2MlnJ4RqApvlZ+XCblO/8+UcUhK34DPamguLtUUrU4OTOqrgZNxYsm6huYaQ/7oorQ== X-Received: by 10.46.91.79 with SMTP id p76mr11005006ljb.22.1511515857773; Fri, 24 Nov 2017 01:30:57 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 19sm4476608ljx.58.2017.11.24.01.30.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Nov 2017 01:30:57 -0800 (PST) From: Linus Walleij To: Dmitry Torokhov , linux-input@vger.kernel.org Subject: [PATCH 5/5] ARM: imx: Use GPIO descriptors for gpio_keys Date: Fri, 24 Nov 2017 10:30:45 +0100 Message-Id: <20171124093045.5961-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171124093045.5961-1-linus.walleij@linaro.org> References: <20171124093045.5961-1-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171124_013117_403338_825F3BB3 X-CRM114-Status: GOOD ( 20.37 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4010:c07:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Reilly , Linus Walleij , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org This switches all relevant i.MX boards still using boardfiles to using GPIO descriptors to look up the GPIO lines for gpio_keys. Most conversions were straight-forward, I dropped comments on how the offsets are looked up where appropriate. The VPR200 board was seemingly incorrect. It assigned the members of struct gpio_keys_button with the direct, non-C99 syntax like so: #define VPR_KEY_DEBOUNCE 500 static struct gpio_keys_button vpr200_gpio_keys_table[] = { {KEY_F2, GPIO_BUTTON1, 1, "vpr-keys: F2", 0, VPR_KEY_DEBOUNCE}, {KEY_F3, GPIO_BUTTON2, 1, "vpr-keys: F3", 0, VPR_KEY_DEBOUNCE}, (...) This is confusing as it seems to have been wrong already when the patch was merged. The members are assigned in order: struct gpio_keys_button { unsigned int code; int gpio; int active_low; const char *desc; unsigned int type; int wakeup; int debounce_interval; bool can_disable; (...) Meaning KEY_XX, GPIO_BUTTON1, 1, "key name", type us right, then comes wakeup capability and this should be 0 or 1, but is instead assigned VPR_KEY_DEBOUNCE which is 500. I have corrected the code to do what I think the author intended. I consider this a non-critical fix because I bet it works (or the board is completely unused), but add the fixing tag for reference. Cc: Marc Reilly Fixes: 00c89c1d1831 ("Introduce VPR200 board.") Signed-off-by: Linus Walleij --- arch/arm/mach-imx/mach-armadillo5x0.c | 19 ++++-- arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 26 ++++++-- arch/arm/mach-imx/mach-pcm037_eet.c | 52 +++++++++++---- arch/arm/mach-imx/mach-vpr200.c | 99 ++++++++++++++++++++++++----- 4 files changed, 155 insertions(+), 41 deletions(-) diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c index 17a97ba2cecf..829a252eaa2a 100644 --- a/arch/arm/mach-imx/mach-armadillo5x0.c +++ b/arch/arm/mach-imx/mach-armadillo5x0.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -265,14 +266,10 @@ static struct i2c_board_info armadillo5x0_i2c_rtc = { static struct gpio_keys_button armadillo5x0_buttons[] = { { .code = KEY_ENTER, /*28*/ - .gpio = IOMUX_TO_GPIO(MX31_PIN_SCLK0), - .active_low = 1, .desc = "menu", .wakeup = 1, }, { .code = KEY_BACK, /*158*/ - .gpio = IOMUX_TO_GPIO(MX31_PIN_SRST0), - .active_low = 1, .desc = "back", .wakeup = 1, } @@ -284,6 +281,19 @@ static const struct gpio_keys_platform_data .nbuttons = ARRAY_SIZE(armadillo5x0_buttons), }; +static struct gpiod_lookup_table armadillo5x0_buttons_gpios_table = { + .dev_id = "gpio-keys", + .table = { + /* + * These are GPIOs M31_PIN_SCLK0 and MX31_PIN_SRSR0, + * global GPIO numbers 66 and 67, with 32 GPIOs per chip + * these are chip 2 offsets 2 and 3 + */ + GPIO_LOOKUP("imx31-gpio-2", 2, "menu", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("imx31-gpio-2", 3, "back", GPIO_ACTIVE_LOW), + }, +}; + /* * NAND Flash */ @@ -525,6 +535,7 @@ static void __init armadillo5x0_late(void) gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_0)); platform_add_devices(devices, ARRAY_SIZE(devices)); + gpiod_add_lookup_table(&armadillo5x0_buttons_gpios_table); imx_add_gpio_keys(&armadillo5x0_button_data); /* SMSC9118 IRQ pin */ diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c index 5169dfba9718..97c6e163ef36 100644 --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -274,25 +275,19 @@ static struct gpio_keys_button visstrim_gpio_keys[] = { { .type = EV_KEY, .code = KEY_RESTART, - .gpio = (GPIO_PORTC + 15), .desc = "Default config", - .active_low = 0, .wakeup = 1, }, { .type = EV_KEY, .code = KEY_RECORD, - .gpio = (GPIO_PORTF + 14), .desc = "Record", - .active_low = 0, .wakeup = 1, }, { .type = EV_KEY, .code = KEY_STOP, - .gpio = (GPIO_PORTF + 13), .desc = "Stop", - .active_low = 0, .wakeup = 1, } }; @@ -303,6 +298,24 @@ static const struct gpio_keys_platform_data .nbuttons = ARRAY_SIZE(visstrim_gpio_keys), }; +static struct gpiod_lookup_table visstrim_gpio_keys_gpios_table = { + .dev_id = "gpio-keys", + .table = { + /* + * These keys are on "PORT E" offset 15 and "PORT F" + * offsets 14 and 13. This corresponds to imx21-gpio-4 + * and imx21-gpio-5, as this SoC has the i.MX21 GPIO + * block. + */ + GPIO_LOOKUP("imx21-gpio-4", 15, "Default config", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx21-gpio-5", 14, "Record", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx21-gpio-5", 13, "Stop", + GPIO_ACTIVE_HIGH), + }, +}; + /* led */ static const struct gpio_led visstrim_m10_leds[] __initconst = { { @@ -563,6 +576,7 @@ static void __init visstrim_m10_late_init(void) if (ret) pr_err("Failed to request gpios (%d)\n", ret); + gpiod_add_lookup_table(&visstrim_gpio_keys_gpios_table); imx_add_gpio_keys(&visstrim_gpio_keys_platform_data); imx_add_platform_device("mx27vis", 0, NULL, 0, &snd_mx27vis_pdata, diff --git a/arch/arm/mach-imx/mach-pcm037_eet.c b/arch/arm/mach-imx/mach-pcm037_eet.c index 95bd97710494..9b3d0246ed63 100644 --- a/arch/arm/mach-imx/mach-pcm037_eet.c +++ b/arch/arm/mach-imx/mach-pcm037_eet.c @@ -7,6 +7,7 @@ * published by the Free Software Foundation. */ #include +#include #include #include #include @@ -68,85 +69,71 @@ static struct gpio_keys_button pcm037_gpio_keys[] = { { .type = EV_KEY, .code = KEY_L, - .gpio = 0, .desc = "Wheel Manual", .wakeup = 0, }, { .type = EV_KEY, .code = KEY_A, - .gpio = 1, .desc = "Wheel AF", .wakeup = 0, }, { .type = EV_KEY, .code = KEY_V, - .gpio = 2, .desc = "Wheel View", .wakeup = 0, }, { .type = EV_KEY, .code = KEY_M, - .gpio = 3, .desc = "Wheel Menu", .wakeup = 0, }, { .type = EV_KEY, .code = KEY_UP, - .gpio = 32, .desc = "Nav Pad Up", .wakeup = 0, }, { .type = EV_KEY, .code = KEY_RIGHT, - .gpio = 33, .desc = "Nav Pad Right", .wakeup = 0, }, { .type = EV_KEY, .code = KEY_DOWN, - .gpio = 34, .desc = "Nav Pad Down", .wakeup = 0, }, { .type = EV_KEY, .code = KEY_LEFT, - .gpio = 35, .desc = "Nav Pad Left", .wakeup = 0, }, { .type = EV_KEY, .code = KEY_ENTER, - .gpio = 38, .desc = "Nav Pad Ok", .wakeup = 0, }, { .type = EV_KEY, .code = KEY_O, - .gpio = 39, .desc = "Wheel Off", .wakeup = 0, }, { .type = EV_KEY, .code = BTN_FORWARD, - .gpio = 50, .desc = "Focus Forward", .wakeup = 0, }, { .type = EV_KEY, .code = BTN_BACK, - .gpio = 51, .desc = "Focus Backward", .wakeup = 0, }, { .type = EV_KEY, .code = BTN_MIDDLE, - .gpio = 52, .desc = "Release Half", .wakeup = 0, }, { .type = EV_KEY, .code = BTN_EXTRA, - .gpio = 53, .desc = "Release Full", .wakeup = 0, }, @@ -159,6 +146,42 @@ static const struct gpio_keys_platform_data .rep = 0, /* No auto-repeat */ }; +static struct gpiod_lookup_table pcm037_gpio_keys_gpios_table = { + .dev_id = "gpio-keys", + .table = { + /* These are on the first GPIO chip */ + GPIO_LOOKUP("imx31-gpio-0", 0, "Wheel Manual", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx31-gpio-0", 1, "Wheel AF", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx31-gpio-0", 2, "Wheel View", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx31-gpio-0", 3, "Wheel Menu", + GPIO_ACTIVE_HIGH), + /* GPIOs 32..62 are simply offsets 0..31 on chip 1 */ + GPIO_LOOKUP("imx31-gpio-1", 0, "Nav Pad Up", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx31-gpio-1", 1, "Nav Pad Right", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx31-gpio-1", 2, "Nav Pad Down", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx31-gpio-1", 3, "Nav Pad Left", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx31-gpio-1", 6, "Nav Pad Ok", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx31-gpio-1", 7, "Wheel Off", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx31-gpio-1", 18, "Focus Forward", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx31-gpio-1", 19, "Focus Backward", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx31-gpio-1", 20, "Release Half", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("imx31-gpio-1", 21, "Release Full", + GPIO_ACTIVE_HIGH), + }, +}; + int __init pcm037_eet_init_devices(void) { if (pcm037_variant() != PCM037_EET) @@ -171,6 +194,7 @@ int __init pcm037_eet_init_devices(void) spi_register_board_info(pcm037_spi_dev, ARRAY_SIZE(pcm037_spi_dev)); imx31_add_spi_imx0(&pcm037_spi1_pdata); + gpiod_add_lookup_table(&pcm037_gpio_keys_gpios_table); imx_add_gpio_keys(&pcm037_gpio_keys_platform_data); return 0; diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c index 5ff154c9a086..e8ca1a7b55fc 100644 --- a/arch/arm/mach-imx/mach-vpr200.c +++ b/arch/arm/mach-imx/mach-vpr200.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -41,15 +42,6 @@ #define GPIO_LCDPWR IMX_GPIO_NR(1, 2) #define GPIO_PMIC_INT IMX_GPIO_NR(2, 0) -#define GPIO_BUTTON1 IMX_GPIO_NR(1, 4) -#define GPIO_BUTTON2 IMX_GPIO_NR(1, 5) -#define GPIO_BUTTON3 IMX_GPIO_NR(1, 7) -#define GPIO_BUTTON4 IMX_GPIO_NR(1, 8) -#define GPIO_BUTTON5 IMX_GPIO_NR(1, 9) -#define GPIO_BUTTON6 IMX_GPIO_NR(1, 10) -#define GPIO_BUTTON7 IMX_GPIO_NR(1, 11) -#define GPIO_BUTTON8 IMX_GPIO_NR(1, 12) - static const struct fb_videomode fb_modedb[] = { { /* 800x480 @ 60 Hz */ @@ -119,16 +111,66 @@ static const struct mxc_nand_platform_data .flash_bbt = 1, }; +#define GPIO_BUTTON1 IMX_GPIO_NR(1, 4) +#define GPIO_BUTTON2 IMX_GPIO_NR(1, 5) +#define GPIO_BUTTON3 IMX_GPIO_NR(1, 7) +#define GPIO_BUTTON4 IMX_GPIO_NR(1, 8) +#define GPIO_BUTTON5 IMX_GPIO_NR(1, 9) +#define GPIO_BUTTON6 IMX_GPIO_NR(1, 10) +#define GPIO_BUTTON7 IMX_GPIO_NR(1, 11) +#define GPIO_BUTTON8 IMX_GPIO_NR(1, 12) + + #define VPR_KEY_DEBOUNCE 500 static struct gpio_keys_button vpr200_gpio_keys_table[] = { - {KEY_F2, GPIO_BUTTON1, 1, "vpr-keys: F2", 0, VPR_KEY_DEBOUNCE}, - {KEY_F3, GPIO_BUTTON2, 1, "vpr-keys: F3", 0, VPR_KEY_DEBOUNCE}, - {KEY_F4, GPIO_BUTTON3, 1, "vpr-keys: F4", 0, VPR_KEY_DEBOUNCE}, - {KEY_F5, GPIO_BUTTON4, 1, "vpr-keys: F5", 0, VPR_KEY_DEBOUNCE}, - {KEY_F6, GPIO_BUTTON5, 1, "vpr-keys: F6", 0, VPR_KEY_DEBOUNCE}, - {KEY_F7, GPIO_BUTTON6, 1, "vpr-keys: F7", 0, VPR_KEY_DEBOUNCE}, - {KEY_F8, GPIO_BUTTON7, 1, "vpr-keys: F8", 1, VPR_KEY_DEBOUNCE}, - {KEY_F9, GPIO_BUTTON8, 1, "vpr-keys: F9", 1, VPR_KEY_DEBOUNCE}, + { + .code = KEY_F2, + .desc = "vpr-keys: F2", + .type = 0, + .debounce_interval = VPR_KEY_DEBOUNCE, + }, + { + .code = KEY_F3, + .desc = "vpr-keys: F3", + .type = 0, + .debounce_interval = VPR_KEY_DEBOUNCE, + }, + { + .code = KEY_F4, + .desc = "vpr-keys: F4", + .type = 0, + .debounce_interval = VPR_KEY_DEBOUNCE, + }, + { + .code = KEY_F5, + .desc = "vpr-keys: F5", + .type = 0, + .debounce_interval = VPR_KEY_DEBOUNCE, + }, + { + .code = KEY_F6, + .desc = "vpr-keys: F6", + .type = 0, + .debounce_interval = VPR_KEY_DEBOUNCE, + }, + { + .code = KEY_F7, + .desc = "vpr-keys: F7", + .type = 0, + .debounce_interval = VPR_KEY_DEBOUNCE, + }, + { + .code = KEY_F8, + .desc = "vpr-keys: F8", + .type = 1, + .debounce_interval = VPR_KEY_DEBOUNCE, + }, + { + .code = KEY_F9, + .desc = "vpr-keys: F9", + .type = 1, + .debounce_interval = VPR_KEY_DEBOUNCE, + }, }; static const struct gpio_keys_platform_data @@ -137,6 +179,28 @@ static const struct gpio_keys_platform_data .nbuttons = ARRAY_SIZE(vpr200_gpio_keys_table), }; +static struct gpiod_lookup_table vpr200_gpio_keys_gpios_table = { + .dev_id = "gpio-keys", + .table = { + GPIO_LOOKUP("imx35-gpio-0", 4, "vpr-keys: F2", + GPIO_ACTIVE_LOW), + GPIO_LOOKUP("imx35-gpio-0", 5, "vpr-keys: F3", + GPIO_ACTIVE_LOW), + GPIO_LOOKUP("imx35-gpio-0", 7, "vpr-keys: F4", + GPIO_ACTIVE_LOW), + GPIO_LOOKUP("imx35-gpio-0", 8, "vpr-keys: F5", + GPIO_ACTIVE_LOW), + GPIO_LOOKUP("imx35-gpio-0", 9, "vpr-keys: F6", + GPIO_ACTIVE_LOW), + GPIO_LOOKUP("imx35-gpio-0", 10, "vpr-keys: F7", + GPIO_ACTIVE_LOW), + GPIO_LOOKUP("imx35-gpio-0", 11, "vpr-keys: F8", + GPIO_ACTIVE_LOW), + GPIO_LOOKUP("imx35-gpio-0", 12, "vpr-keys: F9", + GPIO_ACTIVE_LOW), + }, +}; + static struct mc13xxx_platform_data vpr200_pmic = { .flags = MC13XXX_USE_ADC | MC13XXX_USE_TOUCHSCREEN, }; @@ -284,6 +348,7 @@ static void __init vpr200_board_init(void) static void __init vpr200_late_init(void) { + gpiod_add_lookup_table(&vpr200_gpio_keys_gpios_table); imx_add_gpio_keys(&vpr200_gpio_keys_data); platform_add_devices(devices, ARRAY_SIZE(devices));