From patchwork Fri Nov 24 09:30:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 841000 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="saYqXftx"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="NM80WJlT"; 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 3yjrZg65tjz9s03 for ; Fri, 24 Nov 2017 20:32:43 +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=QRnjUGGgHTeinfhrmBCPYEYJldtUVqgLMwOcXurRYrA=; b=saYqXftxw4dOCe3u9Jcq3xj6Yj NtAacdGLYeoMPSApoKd7V5UXmIdRQEbsyD2h6azcruTVn3XDssHXqEg0GlDuW0kBPwoS22wo0owiW yFkcMXLJClX1f1SFFvImWCCIJsRyb7mlN5zwISSoUOmJCtB+D1JzCD2j3Ybjyfsl0peQk6x7bPSUT k4mWMT7/5TCM3p8471rUwYHoUNpQAxT560H6jrB1cYBBYNJPJIV9rYZqmy3bNMfiCeULHuS/hbi6L mJk2kN/9fNpO0z+r1OUp5t8AbYA+mJRRj6mPF/KYp7TxbB1f1C8p/drEnjz4auQmzIg0pJTtExHo8 W+QcqV/Q==; 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 1eIALa-0007mv-V1; Fri, 24 Nov 2017 09:32:35 +0000 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eIAKM-0006Hy-0z for linux-arm-kernel@lists.infradead.org; Fri, 24 Nov 2017 09:31:28 +0000 Received: by mail-lf0-x241.google.com with SMTP id f131so16721333lff.12 for ; Fri, 24 Nov 2017 01:30:57 -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=FfCbL7POz2zTVSA27EZCFb4JYkm59xgZeWdYnwsfK6I=; b=NM80WJlTMnTFTzwL/a64VfAqTDuQ0YCQlvTQSrnxhgW0zWUb4AeelvO8Gl4wGNEum4 o+3XDRyF5IdWAJZVY+EfPU3HOayyDYv1kC82cOKHkn9S++oqmHaMVIbrYj93Ll8in9L9 Ulv8CnAPtaCP5batWbT+lPunCGg9Je4aIYDew= 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=FfCbL7POz2zTVSA27EZCFb4JYkm59xgZeWdYnwsfK6I=; b=RKpcGx4XsMqhj3Km2KHivCnioUcetqMLU97G3x7vgO3aWQ5Q9DDKJgHMoyP7bzaljJ L5P8TIHo+LtTRa0ZY3AQlDf86lv23mm6QPkEGzAoYD7OrMf0Q4u9VxR+H9cYs+8pS+cw ivF+oca4EXje/2Ct0B2+HtR8jSKy6FBTYu+eKst8cN4urbbio5LJm9Mq1HGa3lXqsNWX cIm/+pD26YBRg+yt3Uq8pVGbxI3I0+kCzSZ+dxAM5z06qgDtHjZ3bMjujYC7c0RjQpJa XIfEuDl3HnR9GyRbHt5srDgWs/maOd/eMwLrewM2er3rS/1BD5V5DA/Kpb4I1j8rdCTp PRlw== X-Gm-Message-State: AJaThX6w++kdwdN4T7kty3rSbF31PaLBr+CtPNs2Dzj5t7nK9lsxqoN4 b1wm1PXNTJEblHX8EVsr1nM1Lw== X-Google-Smtp-Source: AGs4zMYey4JnLOhBjXr5kVBTZgFGK+baPnEfU2i/0nMqWeD8+scXG3LYUlWd/If5t2GByp2tY4B60A== X-Received: by 10.46.9.14 with SMTP id 14mr7460706ljj.175.1511515856013; Fri, 24 Nov 2017 01:30:56 -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.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Nov 2017 01:30:55 -0800 (PST) From: Linus Walleij To: Dmitry Torokhov , linux-input@vger.kernel.org Subject: [PATCH 4/5] ARM: imx: Give all GPIO chips a unique name Date: Fri, 24 Nov 2017 10:30:44 +0100 Message-Id: <20171124093045.5961-5-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_013118_708171_BB50FFCA X-CRM114-Status: GOOD ( 10.59 ) 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:241 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: 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 The name/label of the GPIO chips is used in GPIO lookup tables so these need to be unique per chip. Suffix each GPIO chip with an instance number so these lookups will work as expected. Signed-off-by: Linus Walleij --- arch/arm/mach-imx/mm-imx21.c | 12 ++++++------ arch/arm/mach-imx/mm-imx27.c | 12 ++++++------ arch/arm/mach-imx/mm-imx3.c | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c index 2e91ab2ca378..9e7ec6f17d01 100644 --- a/arch/arm/mach-imx/mm-imx21.c +++ b/arch/arm/mach-imx/mm-imx21.c @@ -84,12 +84,12 @@ void __init imx21_soc_init(void) mxc_arch_reset_init(MX21_IO_ADDRESS(MX21_WDOG_BASE_ADDR)); mxc_device_init(); - mxc_register_gpio("imx21-gpio", 0, MX21_GPIO1_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); - mxc_register_gpio("imx21-gpio", 1, MX21_GPIO2_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); - mxc_register_gpio("imx21-gpio", 2, MX21_GPIO3_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); - mxc_register_gpio("imx21-gpio", 3, MX21_GPIO4_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); - mxc_register_gpio("imx21-gpio", 4, MX21_GPIO5_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); - mxc_register_gpio("imx21-gpio", 5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); + mxc_register_gpio("imx21-gpio-0", 0, MX21_GPIO1_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); + mxc_register_gpio("imx21-gpio-1", 1, MX21_GPIO2_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); + mxc_register_gpio("imx21-gpio-2", 2, MX21_GPIO3_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); + mxc_register_gpio("imx21-gpio-3", 3, MX21_GPIO4_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); + mxc_register_gpio("imx21-gpio-4", 4, MX21_GPIO5_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); + mxc_register_gpio("imx21-gpio-5", 5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); pinctrl_provide_dummies(); imx_add_imx_dma("imx21-dma", MX21_DMA_BASE_ADDR, diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c index 862b9b7762c7..e2eb5dec659e 100644 --- a/arch/arm/mach-imx/mm-imx27.c +++ b/arch/arm/mach-imx/mm-imx27.c @@ -85,12 +85,12 @@ void __init imx27_soc_init(void) mxc_device_init(); /* i.mx27 has the i.mx21 type gpio */ - mxc_register_gpio("imx21-gpio", 0, MX27_GPIO1_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); - mxc_register_gpio("imx21-gpio", 1, MX27_GPIO2_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); - mxc_register_gpio("imx21-gpio", 2, MX27_GPIO3_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); - mxc_register_gpio("imx21-gpio", 3, MX27_GPIO4_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); - mxc_register_gpio("imx21-gpio", 4, MX27_GPIO5_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); - mxc_register_gpio("imx21-gpio", 5, MX27_GPIO6_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); + mxc_register_gpio("imx21-gpio-0", 0, MX27_GPIO1_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); + mxc_register_gpio("imx21-gpio-1", 1, MX27_GPIO2_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); + mxc_register_gpio("imx21-gpio-2", 2, MX27_GPIO3_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); + mxc_register_gpio("imx21-gpio-3", 3, MX27_GPIO4_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); + mxc_register_gpio("imx21-gpio-4", 4, MX27_GPIO5_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); + mxc_register_gpio("imx21-gpio-5", 5, MX27_GPIO6_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); pinctrl_provide_dummies(); imx_add_imx_dma("imx27-dma", MX27_DMA_BASE_ADDR, diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c index 7638a35b3b36..9568300f7554 100644 --- a/arch/arm/mach-imx/mm-imx3.c +++ b/arch/arm/mach-imx/mm-imx3.c @@ -188,9 +188,9 @@ void __init imx31_soc_init(void) mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR)); mxc_device_init(); - mxc_register_gpio("imx31-gpio", 0, MX31_GPIO1_BASE_ADDR, SZ_16K, MX31_INT_GPIO1, 0); - mxc_register_gpio("imx31-gpio", 1, MX31_GPIO2_BASE_ADDR, SZ_16K, MX31_INT_GPIO2, 0); - mxc_register_gpio("imx31-gpio", 2, MX31_GPIO3_BASE_ADDR, SZ_16K, MX31_INT_GPIO3, 0); + mxc_register_gpio("imx31-gpio-0", 0, MX31_GPIO1_BASE_ADDR, SZ_16K, MX31_INT_GPIO1, 0); + mxc_register_gpio("imx31-gpio-1", 1, MX31_GPIO2_BASE_ADDR, SZ_16K, MX31_INT_GPIO2, 0); + mxc_register_gpio("imx31-gpio-2", 2, MX31_GPIO3_BASE_ADDR, SZ_16K, MX31_INT_GPIO3, 0); pinctrl_provide_dummies(); @@ -298,9 +298,9 @@ void __init imx35_soc_init(void) mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR)); mxc_device_init(); - mxc_register_gpio("imx35-gpio", 0, MX35_GPIO1_BASE_ADDR, SZ_16K, MX35_INT_GPIO1, 0); - mxc_register_gpio("imx35-gpio", 1, MX35_GPIO2_BASE_ADDR, SZ_16K, MX35_INT_GPIO2, 0); - mxc_register_gpio("imx35-gpio", 2, MX35_GPIO3_BASE_ADDR, SZ_16K, MX35_INT_GPIO3, 0); + mxc_register_gpio("imx35-gpio-0", 0, MX35_GPIO1_BASE_ADDR, SZ_16K, MX35_INT_GPIO1, 0); + mxc_register_gpio("imx35-gpio-1", 1, MX35_GPIO2_BASE_ADDR, SZ_16K, MX35_INT_GPIO2, 0); + mxc_register_gpio("imx35-gpio-2", 2, MX35_GPIO3_BASE_ADDR, SZ_16K, MX35_INT_GPIO3, 0); pinctrl_provide_dummies(); if (to_version == 1) { 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));