From patchwork Mon Sep 3 08:15:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 145746 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2210784ljw; Mon, 3 Sep 2018 01:18:04 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaFMZcElUUKLxIO3jLgE2GImBH4zmDVs5j83gLT4nspSwABstA8DHPxvFSpUH3fcmV6DcvO X-Received: by 2002:a17:902:3a3:: with SMTP id d32-v6mr27144278pld.294.1535962683942; Mon, 03 Sep 2018 01:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535962683; cv=none; d=google.com; s=arc-20160816; b=KLbQqKEKt75znEISf1B/hDJbsV6IENS7Ow7hmLfsYHChkBNj8v/ISvuHJUyXmbblaK BYveMeA/YNW6fmEhNiTzBpbAp7ExkmZUBHT9uekNnR9KGkeBzGGRwJJD1iuG+2ruMjN8 lJp9c3fJZlVrgKBQ6mKS3PkE5tklLJtJ3fSqtmWiO9rsj6bluDBvDAL2bTG1w3uzK6R3 AmLNpXVEVH7toC40MNd98Rmk8QbRhAJbl5oo4rFOtwNG/rDJkAyM9BEL702U4M9i2cQs AfwWiZnf0m3NCTlFKNBbqR20Z8VZUc9mzcosa6qTKbWzdlBEAWk9RtGQhoz0+WZwFt2/ YxQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=91dY8eZ0QsuIyQ/4CaNzNoa660WIZSbZ+3ck/dPIN88=; b=eXDpR1t5EaAXUXoEWsNrZFoxaWBbPfk2VVwI7+l+2EH2BPhc9iF6+a3ispm0BLmsQ4 vSGQoIRn0aeOyo8rrQ/JcSzfUHUNQRDECqdtA5BmJuRzwIG/c+VNXtSFw1iM4337chk+ GQ/OzBQd0auRrHl9rLxxw9osM+118D6oHPA0lDKS5lTmIC7a+o2brVlN1HvTPwoS9QaP a9p1UPHC+B19jLyAM7VNQH47lqt75+vLeavKbero1jV4XHiHhnNnUL6G32IR6hPNdHam P6RQr5+Ug3bLy1Wv3HkYJq5Myxr3N921Egg0l8HRnoes1v+BK4/7qU9tMF4GapUyo+NR HSjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Opo7I8GZ; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z68-v6si19220548pfz.163.2018.09.03.01.18.03; Mon, 03 Sep 2018 01:18:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Opo7I8GZ; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725898AbeICMhE (ORCPT + 5 others); Mon, 3 Sep 2018 08:37:04 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38646 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725892AbeICMhE (ORCPT ); Mon, 3 Sep 2018 08:37:04 -0400 Received: by mail-lj1-f196.google.com with SMTP id p6-v6so14656972ljc.5 for ; Mon, 03 Sep 2018 01:18:01 -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=91dY8eZ0QsuIyQ/4CaNzNoa660WIZSbZ+3ck/dPIN88=; b=Opo7I8GZMBv+rKOcd6VqHbPZ6jeX4e5h42rihJ6QvwD97y/ZkCftMfOLbnwKFcwlEr Nvbr3BPbPoR7D3XcmQenxH7H1mpoosvfZ1q+2YPYdtMc/X1ZbNp5iTJ/uiK4MtqFedwC kS4xFDHcidpR1gjUFoMMLRxC124OnCTz3ayGQ= 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=91dY8eZ0QsuIyQ/4CaNzNoa660WIZSbZ+3ck/dPIN88=; b=dkTQx2JT5r0oXGeT0PnkbC3tQ0k8Vhc7m6jJLn5A36+P6gF8ykd+TdHKZjk2ASMGpt 0C7TQTnH0hW6J2gyrGuxf00m+H433s5HEZCU7i3lteQApLrBrYhuAgjWg9j1sTbFll4K 9lwlZt/82rvtuf9efmBlLXmKfCsg7q3sp8BHYldtS4S82XQu3HS0Rx/1XsX6M1NZiRtn 7cZC9CpY4GcuEmZfmL5bLCM1xq8JCmzSBcI3pxPDYtpnXMY/532Lk+HnW9JXD3rc51gz QSIfRedAn0XnhNa1qnnmCTBI2Cxr/IyPW/a9hNGtv12DUMUIQCPUQj4NYRHHo1J6+ArP vYvg== X-Gm-Message-State: APzg51AkBoahpzNRpIJ5o1ZNN2YlenHlSJMfKhKXM++1GdUhkRCexgua HS+WmHpPxhoYmkp79JnxpQfynXdKufh1Gg== X-Received: by 2002:a2e:5f93:: with SMTP id x19-v6mr16255888lje.60.1535962680529; Mon, 03 Sep 2018 01:18:00 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id r70-v6sm3316035lff.0.2018.09.03.01.17.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Sep 2018 01:17:59 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Tony Lindgren Subject: [PATCH 1/7] gpio: twl4030: Include the right header Date: Mon, 3 Sep 2018 10:15:50 +0200 Message-Id: <20180903081556.1411-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This is a GPIO driver so include only . Cc: Tony Lindgren Signed-off-by: Linus Walleij --- drivers/gpio/gpio-twl4030.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 Acked-by: Tony Lindgren diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c index 9b511df5450e..50b17814bd91 100644 --- a/drivers/gpio/gpio-twl4030.c +++ b/drivers/gpio/gpio-twl4030.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include From patchwork Mon Sep 3 08:15:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 145747 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2214028ljw; Mon, 3 Sep 2018 01:22:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYTAgf0OzilkUsB/ta6QVN0WCK9cVqWCvu8XlqIki33emNl+nYdM2ZyuYmTRT15XPSWS6vS X-Received: by 2002:a62:c406:: with SMTP id y6-v6mr28368613pff.161.1535962955898; Mon, 03 Sep 2018 01:22:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535962955; cv=none; d=google.com; s=arc-20160816; b=LngptvR2clJLDQfAIyLD64BjmBZpNKyPGVskyjDQq6/HkrZBLOzYwuJZy2wMN8/8dk IvpaD4SHRzxWYABLE/dxcIuTU/rnO+9Vm0KkxsL7iwvzEDs5jQX/qc2vygQ7QqwCUOry 32VLDtSseOfBy9OPczHNyEY62GU8mz1IgzyHyFUmOi2u4AjI/+VE6xpSsP+NLEXwiSM6 CwAHdnqSW9Tb8oRGfWkYr52rsxbzQplqYe1NdVsGw5nBNE8zYyyZyFnsiijF1EgaXDVZ 8SDO+TOBKcZvSKuePmtl2orK+aiR3tguKAN8ZWTgb63qaM9njAJRahyOE7Qyqgl0p+26 txYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=PH/DmlVTA2MiPVSaI9d3fP2bDm8/jU3HlUGgomwCPT4=; b=LhJogdOaLSWx4pfmTwH8Cu2g2VWwVsItL5eXthzTuixoM1fp0BITUkbiy0rs7bxL6t DDE74rM7Gr80lCgeY/dqVAX8xbm2lJzfFSqOsip3AaATduk6WGsLmzFBmpmCU1dUgCpW kr5HN0TEQ0N4SJTbSyHXO8JBa64LTZ7y2Lth/XCpHd2S/tVI6ueHSzqUOeqlIaBShomL dGIAvUWg4M1N2NdK6lttyJAL9azJIFX9UKO2SZWoxCiUu4nNEJ/HNjxqC8r3Pyw1Vez3 /RCs5TMs3AI7X9d7ei3S9zAOebQLCR7jICLFPu4xt4DuohWciT/GuejEOjp2YIrvtUUH M5jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WxY7AJFr; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x61-v6si18233629plb.216.2018.09.03.01.22.35; Mon, 03 Sep 2018 01:22:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WxY7AJFr; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725968AbeICMlh (ORCPT + 5 others); Mon, 3 Sep 2018 08:41:37 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:47054 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbeICMlh (ORCPT ); Mon, 3 Sep 2018 08:41:37 -0400 Received: by mail-lj1-f195.google.com with SMTP id 203-v6so14612721ljj.13 for ; Mon, 03 Sep 2018 01:22:33 -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:in-reply-to:references; bh=PH/DmlVTA2MiPVSaI9d3fP2bDm8/jU3HlUGgomwCPT4=; b=WxY7AJFrD/ZU0c2bO8Be4PxFhit0VLva86TmqHZP1wgMCEYEos7EmDHbSglIIGBuwW K8ldOci2wloFbQQHiYYmUGc22qIDWC0qz+84pvgCqGjuJMM0jItrbIVXIj+tZhHbOYBo jzbjvulcG394BpOmJFyytmxRdLGBQ+l8YxT2c= 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=PH/DmlVTA2MiPVSaI9d3fP2bDm8/jU3HlUGgomwCPT4=; b=bLR4l540XLLl8dAqcXiHn2ub18ES7goRlBKAoUnEpyRVttpLmV5PEv68qx+P0O8IKh jc7AEwWJyeQWRVMwQqb9HnGDFMY/b2RipQNYUU5XJy9T3Lh/Zn34wu8v1lCb95Nnhku8 u0uL1glknAJzp51xNYGsVkxG6k5gOFoVUYhmhMreRQyz1/yjO5+6NLJQHJcNwl7See1l jCKHZMr9zCMdsDcJszxRGMFTC/x4qHsI9JqxNEEpWEwObLr5XC1UAoG3rAeTMFGlpsWo Tau37MjZ9FUfbXv8GaiR3bcAKYXe3TL1fWzpJeZ0y7gyyRiDGVGZ6BsSQfB7QEL+1iMF nw0A== X-Gm-Message-State: APzg51CemZSVz65q4juJLSZSHF9tS75KvKCkwvBqKYfI0aD877lwN2/b u8AAiqpwh1SIHHh7V7EqAtYSYElEUJkdpg== X-Received: by 2002:a2e:9c0f:: with SMTP id s15-v6mr8770783lji.97.1535962952918; Mon, 03 Sep 2018 01:22:32 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id r70-v6sm3316035lff.0.2018.09.03.01.22.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Sep 2018 01:22:31 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Tony Lindgren Subject: [PATCH 2/7] gpio: twl4030: Cut down boilerplate Date: Mon, 3 Sep 2018 10:15:51 +0200 Message-Id: <20180903081556.1411-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180903081556.1411-1-linus.walleij@linaro.org> References: <20180903081556.1411-1-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Use the SPDX header to indicate the license for this driver. Cc: Tony Lindgren Signed-off-by: Linus Walleij --- drivers/gpio/gpio-twl4030.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) -- 2.17.1 diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c index 50b17814bd91..1e47ddff33f6 100644 --- a/drivers/gpio/gpio-twl4030.c +++ b/drivers/gpio/gpio-twl4030.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Access to GPIOs on TWL4030/TPS659x0 chips * @@ -9,20 +10,6 @@ * * Initial Code: * Andy Lowe / Nishanth Menon - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include From patchwork Mon Sep 3 08:15:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 145748 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2214052ljw; Mon, 3 Sep 2018 01:22:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZQO9JOid/orlaggC3ykN+uwyCdj0xkNCj2jwAhal0F08bGLAJBWX26YqT9iw3k2OF7ibNu X-Received: by 2002:a17:902:2804:: with SMTP id e4-v6mr27080506plb.327.1535962958918; Mon, 03 Sep 2018 01:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535962958; cv=none; d=google.com; s=arc-20160816; b=nk5xCNGuVB8HyABvz/ge/sJAV7w8QvA5aeGog4d60vV6oYWE8+XCN1plzt3NXScNUX 3vBNyod5ri28EUdbiEfhiBU1wKh62t5svkPzYMtn9KIRiSqsxLdE9JP3Z4P+JXwP+SlF cPggQ2kdi7prvNX3VDLu7sRqZ08ER9JgdAw4Y3+7IApZ/m+pcZaGeNXQT7SjItXavIcG 9UBhBLP8VLdcKNezmvRjd0AKYYGYMHdvH21nIE/WW8Zxc0NGQOCY+0PUI+Ufe0YiyVY+ ryf3QOHM3kBH3vgWCe7RWtHDWF6GchJCu25VeI2BKNAbMwmVIhjnTzTwSZcWaZiM7xT8 m8TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=XEcpm+3WaXTYPG5fNwNiSZCQyxPLqp3yFr9WS/uz8xg=; b=rcNJAJFYY5cBiJN3MmFkaNJA9V/MWVgCh8N7ghsZeWn/E9ZHKBIzwhVZZbLNT4r/Ve 7PirRgMok8loJheJqhmpTQiPzECtTGAnF+Q/s8oF89K/WXF3581JLNfQNn4yH2wK851S nZU6gl+po7t+E9UDAR9FvRrfaDKiNn/8YbVcn7B2pmrOLfmGtsp7Y2yTxvFCv4t7ft8j Oa3WNjRhGSLB8GwYKmILS4ziGqkBaZ9imGCWgTYL+vSWLhnlHA7MWRdLImrVoVZLyryw w933PqlaVimZkHkLJyEiOLAmTqe4ib/XUAkEf/9pKzhhKtFByGBEFaM4ubcFXbCTVih/ Sn9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HH18ON/s"; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x61-v6si18233629plb.216.2018.09.03.01.22.38; Mon, 03 Sep 2018 01:22:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HH18ON/s"; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725984AbeICMlk (ORCPT + 5 others); Mon, 3 Sep 2018 08:41:40 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:43430 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbeICMlk (ORCPT ); Mon, 3 Sep 2018 08:41:40 -0400 Received: by mail-lj1-f193.google.com with SMTP id m84-v6so14631119lje.10 for ; Mon, 03 Sep 2018 01:22:36 -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:in-reply-to:references; bh=XEcpm+3WaXTYPG5fNwNiSZCQyxPLqp3yFr9WS/uz8xg=; b=HH18ON/s6T1YZTJiYMlqlonpu6QUf+U4NoiECCsAz6rJrKr4cjqPubiv4dDduTMeLy rHpVgTvqQ07Tq6P0IXMsiomTY0AZ3m5E3tnmSSwckDrg8OZ+GoUHuwT2Mc/Jd1rEKfHW tTPX6e6M+0TvsGKs1Y4+JhMMY6fcYiETVe3r4= 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=XEcpm+3WaXTYPG5fNwNiSZCQyxPLqp3yFr9WS/uz8xg=; b=FbPtfDgY3lr7mOz+hcYyYxCrSbeNrdoU7uSbkD8OHB5EItoffO6lDcqwC41gI9mdqN dgLiEPDf/ALdRF7olP0wGE4rmHAjbZlX85FLJndkfP4UtmW206e5lwWIZFp6BUShujwC PJ7tUGEGChwPJUM+TZnsm1aDyB9/4/2FmWo85XylOHC1EvE/oASSPHA51xzWUjbUKF2P Fx+nxrRLxDxIapiw8DZbQXU2xwG7zr2sUkPB3GbBQh5UbB0QmnTwB+v1RL9hq5EN3vXO BRSOqT+iBp1hETbpvdi1VDoK8NPdAY2LMp1+AmHalsRUoVVcVmpQZaylaiJCcP46LWjk KdIQ== X-Gm-Message-State: APzg51BYdsy3pItQQYkKsfQDrwVdJNkMXXD9nj+X+aC7TjMiDSHlyVmJ VI8z82inyvd9dyl9Fi109YlFRt+eSMuutg== X-Received: by 2002:a2e:870b:: with SMTP id m11-v6mr18028425lji.2.1535962955918; Mon, 03 Sep 2018 01:22:35 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id r70-v6sm3316035lff.0.2018.09.03.01.22.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Sep 2018 01:22:34 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Tony Lindgren Subject: [PATCH 3/7] gpio: twl4030: Implement .get_direction() Date: Mon, 3 Sep 2018 10:15:52 +0200 Message-Id: <20180903081556.1411-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180903081556.1411-1-linus.walleij@linaro.org> References: <20180903081556.1411-1-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org It's nice to be able to read back the direction of the GPIO line from the hardware so implement .get_direction() for twl4030. Cc: Tony Lindgren Signed-off-by: Linus Walleij --- drivers/gpio/gpio-twl4030.c | 42 ++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c index 1e47ddff33f6..fbfb648d3502 100644 --- a/drivers/gpio/gpio-twl4030.c +++ b/drivers/gpio/gpio-twl4030.c @@ -154,6 +154,23 @@ static int twl4030_set_gpio_direction(int gpio, int is_input) return ret; } +static int twl4030_get_gpio_direction(int gpio) +{ + u8 d_bnk = gpio >> 3; + u8 d_msk = BIT(gpio & 0x7); + u8 base = REG_GPIODATADIR1 + d_bnk; + int ret = 0; + + ret = gpio_twl4030_read(base); + if (ret < 0) + return ret; + + /* 1 = output, but gpiolib semantics are inverse so invert */ + ret = !(ret & d_msk); + + return ret; +} + static int twl4030_set_gpio_dataout(int gpio, int enable) { u8 d_bnk = gpio >> 3; @@ -359,6 +376,28 @@ static int twl_direction_out(struct gpio_chip *chip, unsigned offset, int value) return ret; } +static int twl_get_direction(struct gpio_chip *chip, unsigned offset) +{ + struct gpio_twl4030_priv *priv = gpiochip_get_data(chip); + /* + * Default 0 = output + * LED GPIOs >= TWL4030_GPIO_MAX are always output + */ + int ret = 0; + + mutex_lock(&priv->mutex); + if (offset < TWL4030_GPIO_MAX) { + ret = twl4030_get_gpio_direction(offset); + if (ret) { + mutex_unlock(&priv->mutex); + return ret; + } + } + mutex_unlock(&priv->mutex); + + return ret; +} + static int twl_to_irq(struct gpio_chip *chip, unsigned offset) { struct gpio_twl4030_priv *priv = gpiochip_get_data(chip); @@ -374,8 +413,9 @@ static const struct gpio_chip template_chip = { .request = twl_request, .free = twl_free, .direction_input = twl_direction_in, - .get = twl_get, .direction_output = twl_direction_out, + .get_direction = twl_get_direction, + .get = twl_get, .set = twl_set, .to_irq = twl_to_irq, .can_sleep = true, From patchwork Mon Sep 3 08:15:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 145749 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2214073ljw; Mon, 3 Sep 2018 01:22:41 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYPJz6MXfLaIhEUxO24gvplJus1ddqyrou2wdOstERM8XBYzJ+nHYoo3HGMfR/9DUmno1mh X-Received: by 2002:a62:c60e:: with SMTP id m14-v6mr28353618pfg.40.1535962961105; Mon, 03 Sep 2018 01:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535962961; cv=none; d=google.com; s=arc-20160816; b=xpre8LulaBTMra4/lrpRDwZGlYJW+JZprHkF+QRElo5+PgY7kKssm0bHrw9Wj/iY/v TPRWAGcltoYzeyxqvXfvht93+n7UoFOrbDI42b/mQ9XJ/NIm2iPrJJQCyCyXkuQYlzt2 tzrDjOOyAebylRda1UCRA50N5pgoKwC7Yg7aFPEEJpR6wGKQM4o/NG73AjJUk8maWbFy snFo/gtKqKc80gCtm+p1bCy11mciMvCQNH1JdXsL6Zi+V2SgK+0qbI2kiQbBafQ9sURG krBsaGv+Rsn1VSdYbkvqY6+CBVn8I2q1DR3btTSjThzHMkr/pgzE9Il+13ywhDl4NfHl rfVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=6cCb2elKkRKebXqjgHqPsykDrj8UGVzv+zCto8xCKXI=; b=Rw2sxONzhw65INZIWCUUdpN9vKX1cxmtDN9ac/1RgSilEujIPZwlDHZA8u32EsIrL5 H/bhpFP01Qt213TVGCH4H6clzCisJmhpBvBPbVnSaa9AOkM4SZzYzx/FP5VB/Pg+xe/w SIyDsCOa9UtmZQdCQ7TuWuYbVLIGkIuIyRFCfKiTunwaomkPfLY7YO8IXGkUYckg7ajW WjmaIqAlDXyRyRMqRFb3ViA8tUw540Bz+0ATvUEIKwunoe2pZypBz1Wa2LRAbvuh0L6S WojwfbR3ZPdsN+DSZCaB3y0iyXgYj0zBCMQAVGvB1Vxc93l9c8fkR93SpSky49mXjlXw Gf1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A7Ghy59I; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x61-v6si18233629plb.216.2018.09.03.01.22.40; Mon, 03 Sep 2018 01:22:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A7Ghy59I; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725927AbeICMln (ORCPT + 5 others); Mon, 3 Sep 2018 08:41:43 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:42890 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbeICMlm (ORCPT ); Mon, 3 Sep 2018 08:41:42 -0400 Received: by mail-lf1-f68.google.com with SMTP id z11-v6so14482539lff.9 for ; Mon, 03 Sep 2018 01:22:39 -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:in-reply-to:references; bh=6cCb2elKkRKebXqjgHqPsykDrj8UGVzv+zCto8xCKXI=; b=A7Ghy59IxYvsv8iu3Q66h0T6h2f2c7rgv6ffvf/ciJDtMLG2E/PFHbsTKYBllfAQit RJhFDPZ+ImDRHBEDNcg7IZDV04cY8Np5MXo152GaeuaRzY1SHao5zX1HxK9pJMeNTMAy MTgJRZWMAsADpR9OSaaeesqJqXRazGu5VJLu0= 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=6cCb2elKkRKebXqjgHqPsykDrj8UGVzv+zCto8xCKXI=; b=OR+tFSGc+fhicy5LL74wPldqPLk0MeWQ5KMCdizmrzuOx8fbtbrQUmGNAqfjIvlzdj vdTlootIljbwoWJec4QZdkYpgyoX3DnjJ1A+JguBCHOO5l9RXK+m5KWbapEO8pFV84kc kzkkS4A8K3P3jgVcptuQyvcTdS7ss87cJYYqJai7BEQO2SdMA0ci3m0WzpU6zZI/GShl dvOTn2xSc7zbglTDfZh42awydld5cILDWSLYzYh1dZEB8vLP8T1ZcDBNYva0YA82fft3 BQTkD251UiFcrl9MA5NVsw8YSiKy7EfrpkK7BVijChUMryAwkMtt6tvveNjs0Ad2kPwk I9kw== X-Gm-Message-State: APzg51CK1u9aA4+6ZPX0DzMj2RqSVzF1hHoHxxPfeAItdt+/ofhTWpJn fo5PD4DoMB7UYnQjhTdJNLXg4EJZkB0iWg== X-Received: by 2002:a19:d808:: with SMTP id p8-v6mr10997995lfg.105.1535962958167; Mon, 03 Sep 2018 01:22:38 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id r70-v6sm3316035lff.0.2018.09.03.01.22.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Sep 2018 01:22:37 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Tony Lindgren Subject: [PATCH 4/7] gpio: twl6040: Include the right header Date: Mon, 3 Sep 2018 10:15:53 +0200 Message-Id: <20180903081556.1411-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180903081556.1411-1-linus.walleij@linaro.org> References: <20180903081556.1411-1-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This is a GPIO driver so include only . Cc: Tony Lindgren Signed-off-by: Linus Walleij --- drivers/gpio/gpio-twl6040.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/gpio/gpio-twl6040.c b/drivers/gpio/gpio-twl6040.c index dadeacf43e0c..095b20fd0315 100644 --- a/drivers/gpio/gpio-twl6040.c +++ b/drivers/gpio/gpio-twl6040.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include From patchwork Mon Sep 3 08:15:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 145750 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2214098ljw; Mon, 3 Sep 2018 01:22:43 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbprsiQK6MFOC23YqELH4W9qn5+05/rQ8+vvzbw88gAUBHB4baXoBiuo4InIj4vjYB1mneS X-Received: by 2002:a17:902:9883:: with SMTP id s3-v6mr27308685plp.194.1535962963404; Mon, 03 Sep 2018 01:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535962963; cv=none; d=google.com; s=arc-20160816; b=qjcr+N3ROXO09G6GJozSd9/HelhLr9BXILXQ8N/fzPLKIS7IPKWXEA/fbb6542u1/K 6S6gxLXHbrpwOrpn5Touq35zw41tlQjVjFQIFF7kJ6HnC2uC4qiVSq8UZnXWKSM/3rc0 R1E8can4npTj4v1VAaNes2EBtTGFcLMCcwvfJp8uUapPQ8pcOY0mBVriGeC8uwrV/t7h WenA75LPCDM20PV61cCOzA7kUtXl+BA8EJi16AMNPyHEB02xwfQ2oaBxShM+bTsnwVEg IP0ukFRWMZtnw0Hrxj8ab/4TY8I64KDva2Nt29+IwYjPCvpTjN7o7Tx/YYXmh0OQBuiY 6r9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=G/EXgWaNZjdEAywgIvVrYuNGaTaYllDgrPSXA7VlEPE=; b=Dz6QEdZgo0E8pnghUuLtIPSxQQ1/ryEoqHpDaTM3unQdFtnq4139aNirnLmz4Xjf71 N2uJebvhus2oeL0Gy2VTJcX1p+28Wu3nUUUeUf8azZAPDkRzQ2rJffUUgRECMBsKxi1K NlFZSWrLuS8/UUVSdA+bmaGkpL3MEr84e9bhDQjPP9eh6xhkKz/MfA6vI6fFx5psIbJu u6rDP3YX6t7LA+ZNAofgR01o4BsVIMu20TLrc0+Nup2cJwPQlqSMr1wnZXvRH81JmFBp yTWyA7D9sbYa4M+EywyTt1NTTm7HNtOeYKFEvYGw2WIWOMqC3ZdxnKMS5z1T7UbUxTFn qPnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bTqEV5Im; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x61-v6si18233629plb.216.2018.09.03.01.22.43; Mon, 03 Sep 2018 01:22:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bTqEV5Im; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726022AbeICMlp (ORCPT + 5 others); Mon, 3 Sep 2018 08:41:45 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:36435 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbeICMlp (ORCPT ); Mon, 3 Sep 2018 08:41:45 -0400 Received: by mail-lj1-f194.google.com with SMTP id v26-v6so14640289ljj.3 for ; Mon, 03 Sep 2018 01:22:41 -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:in-reply-to:references; bh=G/EXgWaNZjdEAywgIvVrYuNGaTaYllDgrPSXA7VlEPE=; b=bTqEV5ImYxyFn/Qi5DAdA01PmHFjnhTm42JXe6DJm1tBQ9926SK46jY0X5bxSSyDkg vCVzBXWgwxNTYSpkvti8yUkjZkJyfwCsHQ4zFC8lToPTgoIU3ZAF2FUVvj+t44fm30We O12KNifVCkcZ1DwYcKVZ0CvPZ5QnpJU7Sh8qk= 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=G/EXgWaNZjdEAywgIvVrYuNGaTaYllDgrPSXA7VlEPE=; b=tS8BH7phgmM7P9VuJI60OKaxV5ffmzYQCMBd1K00Qi7prT5qdTRBhOs46+dUmevWtU OCHk/e3j6HFzHeBNrbco24tMHwjjnPRT57wzQyfwr12qtmH0j98fjwiLtLhLdbzdM032 0YzhKWrtCKnsp3pX7U91g7nr3BKsqMpNmQ99W4PDTCeWEmX4cIpSqjLsdvnuVh9WTIBX VGO6gXw2SjQx2tN0LK863JSW0TsEKs6IZWr/z0y2papEq5u8eAenw2O+KDUaK55LieO0 qYGyOgPyQEASCsf25H53ylqfTU0PvlvCGt5PAGrzVYtnD9k6LStxXH5loMZVbgaVxXD2 9CTQ== X-Gm-Message-State: APzg51B5lVLl7V0MSzP9JCPmUj28qAVcLQWvpYILKZ281k10HWLyI2jm tNcfE5lez6GaXcm338IuDK8iegUNLFVTVw== X-Received: by 2002:a2e:92c4:: with SMTP id k4-v6mr17618237ljh.18.1535962960484; Mon, 03 Sep 2018 01:22:40 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id r70-v6sm3316035lff.0.2018.09.03.01.22.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Sep 2018 01:22:39 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Tony Lindgren Subject: [PATCH 5/7] gpio: twl6040: Cut down boilerplate Date: Mon, 3 Sep 2018 10:15:54 +0200 Message-Id: <20180903081556.1411-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180903081556.1411-1-linus.walleij@linaro.org> References: <20180903081556.1411-1-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Use the SPDX header to indicate the license for this driver. Cc: Tony Lindgren Signed-off-by: Linus Walleij --- drivers/gpio/gpio-twl6040.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) -- 2.17.1 diff --git a/drivers/gpio/gpio-twl6040.c b/drivers/gpio/gpio-twl6040.c index 095b20fd0315..c0c18c80abbd 100644 --- a/drivers/gpio/gpio-twl6040.c +++ b/drivers/gpio/gpio-twl6040.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Access to GPOs on TWL6040 chip * @@ -6,20 +7,6 @@ * Authors: * Sergio Aguirre * Peter Ujfalusi - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include From patchwork Mon Sep 3 08:15:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 145751 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2214128ljw; Mon, 3 Sep 2018 01:22:45 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdah+eV+0CVjmYi+BDvJMSmrTl4mtnrU9rZo85NhU+fiwqM/HF6lUZ82qQbZvBBwjEyjq17V X-Received: by 2002:a63:7c50:: with SMTP id l16-v6mr25166952pgn.311.1535962965527; Mon, 03 Sep 2018 01:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535962965; cv=none; d=google.com; s=arc-20160816; b=J0caKvfjnib2mmhr8jqKGo7CfqzleUjEzurxT/kgOp8KGy0mJfKGL2yU45XDwC+eGk IWpEvYbrqgwHi03b0ll+Y+ImiF5z2dOTBcwCaNAiKXoVj7sDaCNRwz59pJDC84Dab5Xp GoD6ZDiRK8jwKBm1qhMLX96i6VKXlrO/6K2kRp0jvAqLyVC3LsvvTjzAdTaDPm57H6Aa EWjWsh+45XKeOQTPjL2hpMKx8GZPir6tk9ug8iniITuek6f8HEwdIRo3gy9aapJh52UN 5XBhz63QyKWTbtVvZZyKzLJQKZFbxBLlY4kKId3ljk+hsOB+nBzfdCPvMtkhBmTJceFU JB1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=wp/cFSaqUx27cbG8PfuowEvaZnX1T1NgrzlKkdJ/buc=; b=Xs3fcNve0Pnvk2W5wblhYbARI3c/4CAHMaftuDasIOSdeC0y9yaYYbboSpvMsQE0rT usZf+y7MiT2AK7atQwSMCd98tqW6OVrq6yR/NLm1fd44fGH3q1Xb8j678DxUnGgpj5QS GtxFu03VT1tH2gb4kdpPthmov4lWazBO9xF1Ux/kJAHEaGWRbwDndo7TFgJH33EwbiFI eWVj7SefW2MLWgY6OEsBCWQsqFEBVFo2YTk7WmdFaOWTOInzgQNgoY+pJ+nDOIU9Fzhk Nt83cEY+8Yw0hgqlD9NL5pyNJaTKyZTWzZMCLwP2lnP1Vlj8ebXp2fHNL3uRdGrUp/uA N9Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VoZZTkDh; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x61-v6si18233629plb.216.2018.09.03.01.22.45; Mon, 03 Sep 2018 01:22:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VoZZTkDh; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726029AbeICMlr (ORCPT + 5 others); Mon, 3 Sep 2018 08:41:47 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:41757 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbeICMlr (ORCPT ); Mon, 3 Sep 2018 08:41:47 -0400 Received: by mail-lf1-f65.google.com with SMTP id l26-v6so14485988lfc.8 for ; Mon, 03 Sep 2018 01:22:43 -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:in-reply-to:references; bh=wp/cFSaqUx27cbG8PfuowEvaZnX1T1NgrzlKkdJ/buc=; b=VoZZTkDh2EFo6D0+eOd6yBo762G04Ze14eT1mifVLQCZUIvHhoCbCMIJYIbQ8VZ0IK Zu44KUf/H2ycPj8bJkyFJ2ppNGgXdtdx3di6z9Id9F6BhpSF15IQfpUW3OZL2eqQj5z9 HBmvkoyKZ00Irn2Wh+Hy0nzC4uNXF9P/rVwkA= 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=wp/cFSaqUx27cbG8PfuowEvaZnX1T1NgrzlKkdJ/buc=; b=KO/TXiqzk2+n7KvY0w8JX3PEqvdjLb+2OUjjvBOOyH4qgL61anhTvE3r3jdeTxnLhe QxdKq+RgJjkeVMGXVDVwK3yX4dSd9mHAeUMpHlqBC6b9g8+KXvuCXRaqgGesxt0WJ9se omvf/N/08qAbYyz86RHpiYZPgpl7uRiIQ/CsV9n4JoQzudjHiEkSArfeSs2Nj03bYCnF xcaO3a6aYSZJr4FlcNTIg508ZKnx1228H2nWazP2WCtcnIS0kpwR4o7/l4kKMUngwRcf KoZ7hAF6XzUat1XZTMjAUZU5R3yfY+3whbBZMnx4WR6GjpPOAODcisJ4U74vl53rPlO3 obfw== X-Gm-Message-State: APzg51AMGxPBN6V/P1hmfPLW8Em24xBweaZqf5WOvMWJoaVAsvvWAmI1 vHUpJq2EXScXDhhYRUzf100wsi3dOPfgxA== X-Received: by 2002:a19:9601:: with SMTP id y1-v6mr17404372lfd.91.1535962962545; Mon, 03 Sep 2018 01:22:42 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id r70-v6sm3316035lff.0.2018.09.03.01.22.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Sep 2018 01:22:41 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Tony Lindgren Subject: [PATCH 6/7] gpio: twl6040: Use bitops Date: Mon, 3 Sep 2018 10:15:55 +0200 Message-Id: <20180903081556.1411-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180903081556.1411-1-linus.walleij@linaro.org> References: <20180903081556.1411-1-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org It's nice to use BIT() macros rather than open coding the same. It's good practice as sometimes people use BIT(31) and forget that the constant must be cast unsigned long. Cc: Tony Lindgren Signed-off-by: Linus Walleij --- drivers/gpio/gpio-twl6040.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/gpio/gpio-twl6040.c b/drivers/gpio/gpio-twl6040.c index c0c18c80abbd..77d50542bf61 100644 --- a/drivers/gpio/gpio-twl6040.c +++ b/drivers/gpio/gpio-twl6040.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -28,7 +29,7 @@ static int twl6040gpo_get(struct gpio_chip *chip, unsigned offset) if (ret < 0) return ret; - return (ret >> offset) & 1; + return !!(ret & BIT(offset)); } static int twl6040gpo_direction_out(struct gpio_chip *chip, unsigned offset, @@ -49,9 +50,9 @@ static void twl6040gpo_set(struct gpio_chip *chip, unsigned offset, int value) return; if (value) - gpoctl = ret | (1 << offset); + gpoctl = ret | BIT(offset); else - gpoctl = ret & ~(1 << offset); + gpoctl = ret & ~BIT(offset); twl6040_reg_write(twl6040, TWL6040_REG_GPOCTL, gpoctl); } From patchwork Mon Sep 3 08:15:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 145752 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2214159ljw; Mon, 3 Sep 2018 01:22:47 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYNqAj4em3AO9+tdfwqvINP18cCcxDNtV/g1jTW4aBM3wVT+PhOQooT+gWyFPQsF8xOsszy X-Received: by 2002:a63:5204:: with SMTP id g4-v6mr24990294pgb.274.1535962967463; Mon, 03 Sep 2018 01:22:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535962967; cv=none; d=google.com; s=arc-20160816; b=pvBFiRpMwaIoUsSqW31SW+HXtM+CXlvJlO1Byfhbzrb6LDxQl2Rs8BVGOqoOJunkGZ 88F60e2nylbdCpBZ6+7HPUrAgCTT9hIIzsqkOeU2Gw0DrB4/PC9XB4s+NiF0MuEhLAh0 v2bs3SRkFPU85F4hz5BXIU0QRTyWjyA6SQiwqiYsJDUxV3zeWbUX6jqrahsnTYhjSoN0 kSrSJPFkBtbSoJIDwWpf3zg6JkBbp2Fw7P0HRpe+NMwTF77pealp/tr4mSl3qmJcbPcY e4sCWaOcLrqCcJVU3JzrVGhUbbfdRo1Q0GnoDyixymwL7mnEA1+WpKEEbM/l36ejZ6SP jIWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=RkAEzL9F/AJzDFsnOwjiJnYhAPrZ+GGRNAZxSD+T5Og=; b=e0du7L3/4DGI8BLYAiA6z0JVWPtuJsn9Y/03GZwr9hIRsbz5cQ1oDGOlL8kmZYfIvY 8ZntqmlI9zhuabiDyuPTptsaPKUX21IR+3Ild4h0LQF4ecITKvqG5mk+1gr3YV0bE+L7 eQwBy/JqTJkb1OVgFr/KPSMa/6cwNixJgIBZIBAUXFFfsK+Sm/XyNw5PGD/4g2kwr3I1 ORy5W025UEuyP5XRDxK+nUxxcfGxfqN7dlUWm4RmQ8plyViG93m795bSkcuHQrvkmr0V bRa7NrMnyU7y5jg9Pxzo+E/qlTrElVMHO64J9NnCjefkVw4FRMVRQla6BZETWiwm+VhW yX+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sgq0zeWu; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x61-v6si18233629plb.216.2018.09.03.01.22.47; Mon, 03 Sep 2018 01:22:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sgq0zeWu; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726046AbeICMlt (ORCPT + 5 others); Mon, 3 Sep 2018 08:41:49 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:35976 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbeICMlt (ORCPT ); Mon, 3 Sep 2018 08:41:49 -0400 Received: by mail-lf1-f67.google.com with SMTP id x207-v6so8808501lff.3 for ; Mon, 03 Sep 2018 01:22:45 -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:in-reply-to:references; bh=RkAEzL9F/AJzDFsnOwjiJnYhAPrZ+GGRNAZxSD+T5Og=; b=Sgq0zeWuQdO5omA1TlFNDQjD0xFqvPj5x8hRa04thS9pWj7oe0Z48fIC51me/CaUre /GNjKAGB8rfeTgiDaNWZhcsNVddrJZ2sx5ltDwwpdytfseJVKg+NOmA571SnBmJu5aXV /kFosWMy7YghUBBo9h9EaVoy2tTQiJwEWg1Yk= 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=RkAEzL9F/AJzDFsnOwjiJnYhAPrZ+GGRNAZxSD+T5Og=; b=YOqqfjrZ0QIU3XL4Yf8wmycKYg/oqrf0467GNisK4Hg2LILzmQgN6kwh2n3rUux3Lb 2kwmSgFoYOi7YQ5BCel66dRX1Up8RBK1eYC4Q1KawTwUiLaxSbA8sBomrGDtgxKcn7Sz bIiPOUqcfCenuNttBoAkR4xtBwRfPCqYRSP+RkvFfcDxijey3Zj3dRG5Wti2RwOmQm78 5Sb6JLgfvDKkOAYA5sed4QJdwNytFIJZs2CEDPs4qnPXVk5O5FxDu+mztQEQZ4xCogsZ 8zNrh2QXDF3t+6ixETAT8rkNP0AKqvsu5RbHkyAa1BheP0fTgxWszaPssh770oe7HpTK rk3A== X-Gm-Message-State: APzg51APpHsMgMWrXxyw940MCFs7A3PJnavWeeW3Dm0EGZyj0QfA+FtL kQ3FkHUs6Ka+WaIoRf8hOHl1cRJHvz2P8Q== X-Received: by 2002:a19:f015:: with SMTP id p21-v6mr6352220lfc.56.1535962964561; Mon, 03 Sep 2018 01:22:44 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id r70-v6sm3316035lff.0.2018.09.03.01.22.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Sep 2018 01:22:43 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Tony Lindgren Subject: [PATCH 7/7] gpio: twl6040: Implement .get_direction() Date: Mon, 3 Sep 2018 10:15:56 +0200 Message-Id: <20180903081556.1411-7-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180903081556.1411-1-linus.walleij@linaro.org> References: <20180903081556.1411-1-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The gpiolib cannot deduce the fact that every line is output by itself, implement a .get_direction() callback so we can inspect this. Cc: Tony Lindgren Signed-off-by: Linus Walleij --- drivers/gpio/gpio-twl6040.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.17.1 diff --git a/drivers/gpio/gpio-twl6040.c b/drivers/gpio/gpio-twl6040.c index 77d50542bf61..c845b2ff1f43 100644 --- a/drivers/gpio/gpio-twl6040.c +++ b/drivers/gpio/gpio-twl6040.c @@ -32,6 +32,12 @@ static int twl6040gpo_get(struct gpio_chip *chip, unsigned offset) return !!(ret & BIT(offset)); } +static int twl6040gpo_get_direction(struct gpio_chip *chip, unsigned offset) +{ + /* This means "out" */ + return 0; +} + static int twl6040gpo_direction_out(struct gpio_chip *chip, unsigned offset, int value) { @@ -62,6 +68,7 @@ static struct gpio_chip twl6040gpo_chip = { .owner = THIS_MODULE, .get = twl6040gpo_get, .direction_output = twl6040gpo_direction_out, + .get_direction = twl6040gpo_get_direction, .set = twl6040gpo_set, .can_sleep = true, };