Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp291354imm; Tue, 18 Sep 2018 22:04:07 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaSj8UxCoFXv5dA4DLsGZF8aqhoffQsHwbApg86tcxk/HBJyW5qBvG2dZ2YQ4hDqH/HwsFV X-Received: by 2002:a63:28c7:: with SMTP id o190-v6mr30679861pgo.84.1537333446972; Tue, 18 Sep 2018 22:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537333446; cv=none; d=google.com; s=arc-20160816; b=UGqQfUV/imlSJA4fafRfj1ydpO1lZtFyEZhdnlVqAuQALMHhF1SQwhlNsOcN0vCxOa 0HJBMCfr+C5Opgx31OlO0BBov7l00cIxbXpsz1HD4s0orap+5vj2Wiw4P6xg+g8mDyag cTgc1yy6gDBMne7AB7GorBN0N2R3Eq6yqXbOwJk6rhOjoJa+XXnasSX/xjfg4Lcz6Dqt g/H+5WGFe8wP1S+RoP9qU0VaeEKwCI7cOgRc0BrfL29MoRkIrrPOYdAaZvgXL/dHO+Kt ekzuZZ0UOMC4oX0O27cJvKjJx6INtl2UNLyGP7UMqpZiSCunZcl9bWnlZuJqc6WIoCfJ tS/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=NTNgFT/KLaAcUBILpix8F48SuVxZhf3RH0/o4O+I8Js=; b=f24xzzgrtxhQe8L8eeBQYZn6NtSGFlpdI3V8o7J9BwyRGRclxq5cHNS3/ndNznYNyJ XOB1rLSqh+TTdDeZSIL0R846Y9+W3uBpj6Hchile9lDpXvSSyKoCo4k7wwELUYbqp016 uXRr0gcAYKxAJZzKB+CZo+kFNxHmJ2GuYbhjkjoejre2jeOfSRlSN9F4/Oa4Y+p8unIg 9jocq7zlGEDdea2p015uz1iiaaihUdvW+fk4XtF5aLQFxSC3KcpvYXJAxnGzWV7JFX2X 4LFZaJYorBcD0+cYtkc5WDyp7anrAb4tUZcUC9xWvB7eePNbbGiTO+vVvWtQ5HFHO2Wz LJ9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=i56RBHBo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l6-v6si20123287pgi.534.2018.09.18.22.03.51; Tue, 18 Sep 2018 22:04:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@ti.com header.s=ti-com-17Q1 header.b=i56RBHBo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730883AbeISKi7 (ORCPT + 99 others); Wed, 19 Sep 2018 06:38:59 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:37024 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbeISKi7 (ORCPT ); Wed, 19 Sep 2018 06:38:59 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id w8J52ncX047043; Wed, 19 Sep 2018 00:02:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1537333369; bh=NTNgFT/KLaAcUBILpix8F48SuVxZhf3RH0/o4O+I8Js=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=i56RBHBorVmLBnJ7OkHc8IxDho9N52wD6zwaIAl9OG+2W1pchRSRj7JVp8qn2twIB N8pZcWyobzW6NqUw6gz4+48/DF/EL3/Xtc8x1ImSu7T3iHs45qQkLdS9KDPOlOd6up E60W+lX7YBJsW1K68it6kwuKJM+Sudn5beATQeIk= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w8J52nVk026043; Wed, 19 Sep 2018 00:02:49 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 19 Sep 2018 00:02:49 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 19 Sep 2018 00:02:49 -0500 Received: from [172.24.191.45] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w8J52ki3018367; Wed, 19 Sep 2018 00:02:47 -0500 Subject: Re: [PATCH 5/5] gpio: davinci: Move driver local definitions to driver To: "Andrew F. Davis" , Sekhar Nori , Kevin Hilman , Linus Walleij CC: , References: <20180831191326.25106-1-afd@ti.com> <20180831191326.25106-5-afd@ti.com> From: Keerthy Message-ID: Date: Wed, 19 Sep 2018 10:32:46 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180831191326.25106-5-afd@ti.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Saturday 01 September 2018 12:43 AM, Andrew F. Davis wrote: > These defines, structs and inline functions are used only internally by > the driver, they do not belong in platform_data. Move them. Tested for gpio interrupts on k2g and da850-lcdk Tested-by: Keerthy Acked-by: Keerthy > > Signed-off-by: Andrew F. Davis > --- > drivers/gpio/gpio-davinci.c | 28 ++++++++++++++++++++++ > include/linux/platform_data/gpio-davinci.h | 28 ---------------------- > 2 files changed, 28 insertions(+), 28 deletions(-) > > diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c > index 121a7948f785..5c1564fcc24e 100644 > --- a/drivers/gpio/gpio-davinci.c > +++ b/drivers/gpio/gpio-davinci.c > @@ -9,6 +9,7 @@ > * the Free Software Foundation; either version 2 of the License, or > * (at your option) any later version. > */ > + > #include > #include > #include > @@ -24,6 +25,12 @@ > #include > #include > #include > +#include > + > +#include > + > +#define MAX_REGS_BANKS 5 > +#define MAX_INT_PER_BANK 32 > > struct davinci_gpio_regs { > u32 dir; > @@ -45,6 +52,27 @@ typedef struct irq_chip *(*gpio_get_irq_chip_cb_t)(unsigned int irq); > static void __iomem *gpio_base; > static unsigned int offset_array[5] = {0x10, 0x38, 0x60, 0x88, 0xb0}; > > +struct davinci_gpio_irq_data { > + void __iomem *regs; > + struct davinci_gpio_controller *chip; > + int bank_num; > +}; > + > +struct davinci_gpio_controller { > + struct gpio_chip chip; > + struct irq_domain *irq_domain; > + /* Serialize access to GPIO registers */ > + spinlock_t lock; > + void __iomem *regs[MAX_REGS_BANKS]; > + int gpio_unbanked; > + int irqs[MAX_INT_PER_BANK]; > +}; > + > +static inline u32 __gpio_mask(unsigned gpio) > +{ > + return 1 << (gpio % 32); > +} > + > static inline struct davinci_gpio_regs __iomem *irq2regs(struct irq_data *d) > { > struct davinci_gpio_regs __iomem *g; > diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h > index 47695b342883..f92a47e18034 100644 > --- a/include/linux/platform_data/gpio-davinci.h > +++ b/include/linux/platform_data/gpio-davinci.h > @@ -16,40 +16,12 @@ > #ifndef __DAVINCI_GPIO_PLATFORM_H > #define __DAVINCI_GPIO_PLATFORM_H > > -#include > -#include > - > -#include > - > -#define MAX_REGS_BANKS 5 > -#define MAX_INT_PER_BANK 32 > - > struct davinci_gpio_platform_data { > u32 ngpio; > u32 gpio_unbanked; > }; > > -struct davinci_gpio_irq_data { > - void __iomem *regs; > - struct davinci_gpio_controller *chip; > - int bank_num; > -}; > - > -struct davinci_gpio_controller { > - struct gpio_chip chip; > - struct irq_domain *irq_domain; > - /* Serialize access to GPIO registers */ > - spinlock_t lock; > - void __iomem *regs[MAX_REGS_BANKS]; > - int gpio_unbanked; > - int irqs[MAX_INT_PER_BANK]; > -}; > - > /* Convert GPIO signal to GPIO pin number */ > #define GPIO_TO_PIN(bank, gpio) (16 * (bank) + (gpio)) > > -static inline u32 __gpio_mask(unsigned gpio) > -{ > - return 1 << (gpio % 32); > -} > #endif >