From patchwork Fri Nov 24 09:30:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 840999 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="CaOOOf1y"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bOxMOZRK"; 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 3yjrY52Hypz9s03 for ; Fri, 24 Nov 2017 20:31:19 +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: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:In-Reply-To: References:List-Owner; bh=9g7ecwtMr6Zk/gSVW9E1hEujYbUESwKFRtil1LkLoBI=; b=CaO OOf1yKdLwqCNH2VrFNHe1vmv8c9jw3aI+GTEPBNdZitirQLtI8D4RUbE+A3Rw43bs4+2dHVeAd7lw WAgoYwMNX7KgOx+SPtZXjvvxXPg5reEsXwKL5bbBPQmfaAdhQ4RqIJiRlyvEiSsL6ymq6/ZS/lhee ByGPS8vchG2fdh1fwsMm1nSDp68uK+6O1dWn0xVXXIknd3Dtieowa5KhX6rXeRIDaSmwTRYDK+TMJ Hcxd/Tl4iKQiTYfSTpiBIikOMo86sxKyd1sU2nQLR9FzpTri2krDR9Z3o2pDWPDL2P0uQheId2F+i aot3dwWMHEDKLDp2Pcwg1OrsNBYH10A==; 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 1eIAKI-0006Vj-N5; Fri, 24 Nov 2017 09:31:14 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eIAKE-0006HL-Tb for linux-arm-kernel@lists.infradead.org; Fri, 24 Nov 2017 09:31:13 +0000 Received: by mail-lf0-x244.google.com with SMTP id k66so24748558lfg.3 for ; Fri, 24 Nov 2017 01:30:50 -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; bh=mHZpyvWrtgRtmU/uY5CBhLiRm+iBrWLkoW2QAhZrBrY=; b=bOxMOZRKZodvJDFvWEG91ScLt0Yb65EBuiVJAJQTXcQPFP5x45gJYadUKIV8Ek+ulb VgjLO03Ut/tCZrnh4D/0D6zdTD4NFU/ihOTZUpMU//xONS6yIKgBdAvkGQ73VvGk8ZJ4 LVipK8eZiWnBIIUTUPD+MQL/1XBtlTr/g58/w= 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; bh=mHZpyvWrtgRtmU/uY5CBhLiRm+iBrWLkoW2QAhZrBrY=; b=RUbDpwjkm0f1SD/3QjVjifolu31VuJPpR43+OtEuPt63VHNU1B0ra9JYNil+o1Qzyd biz0Vavt5gqVAzrqmHo7klySWmT6EIs6WK60tDHVWIXD9PndhqVyXV6euBkP7R9EWq0w w96jReDfh+L3eQZ08IPcBVpnGGJmiE3gs/GPhvdWEEomJc5ijNy7MMb+UjfRoRQZsCZb MHh+vV3oide6rN9n5U5aFNr0kHzHcGZLYKibvWvXLFeknuPL3cns6JV4cC9w/h1ng67e gjOHC9sR0gSivEmU0XZBa/zrwykwN6HU65teLA4MjRGvF0P2MZoQ5yBzGqgU+TumhfVu IAGQ== X-Gm-Message-State: AJaThX4GJaLdlBZ8fKr+bNjUoCSLvN0ZZCpxvCLcpGnS40nzjxJT/3Vb ++gYFLP9Z0D2bcc5ZgEv0geLPA== X-Google-Smtp-Source: AGs4zMbeOavi61l0ynM0DxrBzWVQu0sIg9Urex0lxrrPZZSNrmnKc0h7ovh5bqPObNx2hS35ujsYmQ== X-Received: by 10.25.141.6 with SMTP id p6mr10366227lfd.10.1511515848319; Fri, 24 Nov 2017 01:30:48 -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.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Nov 2017 01:30:47 -0800 (PST) From: Linus Walleij To: Dmitry Torokhov , linux-input@vger.kernel.org Subject: [PATCH 0/5] Make gpio_keys accept board descriptors Date: Fri, 24 Nov 2017 10:30:40 +0100 Message-Id: <20171124093045.5961-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171124_013111_147489_F37E079A X-CRM114-Status: GOOD ( 13.40 ) 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:244 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 goal I'm working toward is to rid the kernel of the global GPIO numberspace. This means GPIO lines should be references by the local offset on the GPIO chip. This patch set starts to move gpio_keys toward using GPIO look-up tables instead of global GPIO numbers to find their GPIOs. As an example I did (I think) the necessary patches to convert DaVinci and i.MX to use this. There are several users also x86 platform devices. Strategy: - Merge the patch to input/keyboard/gpio_keys* to support using descriptors from board files. - Refactor the whole universe to get proper names on GPIO chips, and reference the GPIO lines with local offsets using tables, as in the example patches in this series. These can trickle in after the first patch is merged in Input. The work to be done can be seen if you type: git grep gpio_keys_platform_data - When all are refactored, remove the "gpio" and "active low" members from the platform data and delete the associated legacy GPIO handling in the input driver for gpio_keys. Posting this with the examples to get buy-in from Dmitry before I go and spend time refactoring the world. I.e. I'm happy if patch 1 gets merged, the rest I will push through ARM SoC etc, or if nothing else works (like nonresponsive maintainers) I can push it through the GPIO tree without bothering Dmitry. Linus Walleij (5): Input: gpio-keys: Support getting descriptors from board gpio: pca953x: Name the gpiochip after the I2C address ARM: davinci: Switch DA850EVM to use GPIO descriptors ARM: imx: Give all GPIO chips a unique name ARM: imx: Use GPIO descriptors for gpio_keys arch/arm/mach-davinci/board-da850-evm.c | 57 ++++++++++++++--- 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 ++++++++++++++++++++++++----- arch/arm/mach-imx/mm-imx21.c | 12 ++-- arch/arm/mach-imx/mm-imx27.c | 12 ++-- arch/arm/mach-imx/mm-imx3.c | 12 ++-- drivers/gpio/gpio-pca953x.c | 17 ++++- drivers/input/keyboard/gpio_keys.c | 14 +++- drivers/input/keyboard/gpio_keys_polled.c | 10 +++ 11 files changed, 259 insertions(+), 71 deletions(-)