From patchwork Wed Oct 19 05:33:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J, KEERTHY" X-Patchwork-Id: 683963 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3szLH64Lj3z9srZ for ; Wed, 19 Oct 2016 16:34:42 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752948AbcJSFel (ORCPT ); Wed, 19 Oct 2016 01:34:41 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:34022 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750800AbcJSFel (ORCPT ); Wed, 19 Oct 2016 01:34:41 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id u9J5YcFU031242; Wed, 19 Oct 2016 00:34:38 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u9J5YcAr023298; Wed, 19 Oct 2016 00:34:38 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Wed, 19 Oct 2016 00:34:37 -0500 Received: from ula0393675.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u9J5YQkx017393; Wed, 19 Oct 2016 00:34:34 -0500 From: Keerthy To: CC: , , , , , , , , Subject: [PATCH 2/5] drivers: gpio: Add support for multiple IPs Date: Wed, 19 Oct 2016 11:03:56 +0530 Message-ID: <1476855239-32730-3-git-send-email-j-keerthy@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476855239-32730-1-git-send-email-j-keerthy@ti.com> References: <1476855239-32730-1-git-send-email-j-keerthy@ti.com> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Lokesh Vutla Update GPIO driver to support Multiple GPIO IPs. Signed-off-by: Lokesh Vutla Signed-off-by: Keerthy --- drivers/gpio/gpio-davinci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index 419cfaf..2654dae 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c @@ -183,6 +183,7 @@ static int davinci_gpio_probe(struct platform_device *pdev) struct davinci_gpio_regs __iomem *regs; struct device *dev = &pdev->dev; struct resource *res; + static int bank_base; pdata = davinci_gpio_get_pdata(pdev); if (!pdata) { @@ -226,7 +227,8 @@ static int davinci_gpio_probe(struct platform_device *pdev) chips[i].chip.direction_output = davinci_direction_out; chips[i].chip.set = davinci_gpio_set; - chips[i].chip.base = base; + chips[i].chip.base = bank_base; + bank_base += 32; chips[i].chip.ngpio = ngpio - base; if (chips[i].chip.ngpio > 32) chips[i].chip.ngpio = 32;