From patchwork Thu Sep 6 07:58:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10589977 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50EBD920 for ; Thu, 6 Sep 2018 07:59:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3593F2A4B5 for ; Thu, 6 Sep 2018 07:59:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29D502A503; Thu, 6 Sep 2018 07:59:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F07AD2A4B5 for ; Thu, 6 Sep 2018 07:59:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727720AbeIFMdX (ORCPT ); Thu, 6 Sep 2018 08:33:23 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:37941 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727676AbeIFMdX (ORCPT ); Thu, 6 Sep 2018 08:33:23 -0400 Received: by mail-lj1-f194.google.com with SMTP id p6-v6so8531747ljc.5 for ; Thu, 06 Sep 2018 00:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=jNgOsz6F4ieIfL8x9CQ3Gar51SEND0caSlAro8GCOJA=; b=A/JELcH2m7NB+Ka57UDN6DFJOssI2o78JSWD9S3flz1VIu0DtpKHMtsnORn7VJ/jgJ VqBnIvJX3qKIX3V8gBf3i/oFW0bd4FOh3qa7WlkqZkL7kjGQTv7O/yf/IYA8gr+xYRm/ 3mcZ0g3I3Up1toGFi3zDHU3u3D04PRbTtubTI= 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=jNgOsz6F4ieIfL8x9CQ3Gar51SEND0caSlAro8GCOJA=; b=OnkzvMN7PckZdaOZQ0oj9Guh+iopu1IOTFKGkOTFLhrd33ext2kwcioN7dJg20HIOO jwAeosKOtQSxrnV6IBGaq4u5tvWTQNcGjNXj6b6p5hpCOsIDouaea6x/nsM/82hxKCka sANfMJ7GG6nf9OKgfKinebncA8tYEWieZ2aRpHLA905QHNTAFE7+utYUVStBRoiLC3hK bikXpQCDjhZTNI4HQ2q+8UBkQNob5eTHRMRBUzBryvMv0XjuKHQSCgrP/nRh/+AFZ+CJ DA2LxG7ATIckb8ifeMWjzJXtLb9W9Z0TVvDtvi0Q2iJF36/TDIq3FDFqbG7gR66kUIGc BeWA== X-Gm-Message-State: APzg51AQQeUxECTXesdzq3JZNz95u8I2l/LvqH7aqWTpD+iA6F47O0dt gqokR+toqqbUV4PglS5oHtms5w== X-Google-Smtp-Source: ANB0VdaWJN3t51SKxUNIzt5UnAv/8adOFLhEs5weaiKuz3svdl1Oe8f6jbnWeIaFSLAe6Rf+8KYCug== X-Received: by 2002:a2e:954e:: with SMTP id t14-v6mr1013744ljh.68.1536220750319; Thu, 06 Sep 2018 00:59:10 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id f129-v6sm690869lff.37.2018.09.06.00.59.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Sep 2018 00:59:09 -0700 (PDT) From: Linus Walleij To: Dmitry Torokhov , linux-input@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Andy Shevchenko , "Rafael J . Wysocki" , Sakari Ailus , Linus Walleij Subject: [PATCH 0/3] gpio_keys from machine desc tables Date: Thu, 6 Sep 2018 09:58:59 +0200 Message-Id: <20180906075902.31240-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch series builds on an idea from Dmitry to make devm_fwnode_get_gpiod_from_child() provide GPIO descriptors even from board look-up tables and thus make the API more helpful for consumers, gpio_keys in particular. We need to change the gpio_keys to always try fwnode first of course, but apart from that no changes are needed in gpio_keys. Using this we can convert users over to use machine descriptor tables and eventually drop the use of the old GPIO API from gpio_keys, and consequently remove .gpio and .active_low from struct gpio_keys_button altogether. But that would be for the next kernel iterations and can be done step-wise. I also include a patch illustrating how this will look in a boardfile, by adding keys to a platform that has no DT or ACPI support. (Just an illustration.) Linus Walleij (3): gpio: fwnode: Obtains descs from machine tables Input: gpio_keys - always try fwnode first RFC: ARM: simone: Hacked in keys arch/arm/mach-ep93xx/simone.c | 50 ++++++++++++++++++++++++++++++ drivers/gpio/devres.c | 4 +-- drivers/gpio/gpiolib.c | 47 ++++++++++++++++++++-------- drivers/input/keyboard/gpio_keys.c | 47 ++++++++++++++++------------ include/linux/gpio/consumer.h | 19 +++++++++--- 5 files changed, 129 insertions(+), 38 deletions(-)