From patchwork Tue Nov 13 13:50:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 997117 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="LCyGpzxC"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42vTYR6Xr2z9s3q for ; Wed, 14 Nov 2018 00:51:07 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733227AbeKMXtU (ORCPT ); Tue, 13 Nov 2018 18:49:20 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40505 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733208AbeKMXtU (ORCPT ); Tue, 13 Nov 2018 18:49:20 -0500 Received: by mail-wm1-f68.google.com with SMTP id q26so1466398wmf.5 for ; Tue, 13 Nov 2018 05:51:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JjpgGaYWzkrTyqB9MlsAxGRgdPqZmjwayR/Z33XA7DA=; b=LCyGpzxCXNaHTsgP+0aiXMct89jOJgFzoIGgviOzwMHkS3ZoxxuhBUFjBn2EYyEEc0 xnZuzAXtgfBfLK6EDuxqMrJImPBQgsg2S+hngfZx8S+kP6BMUDXAeLsjqqTV04cmbWhm qPGeVI7zxITjuIR268WI6dDn4XBypn2pD0jTwjNdfkRTFQ9pZsyJs4jT4o/rqsabMbEt UGODXs9wSmpkNtF7Dqrab6RXrtSWItou9qG4an28Xo39d1aVr8nHLT8MBYv7QfzOvs62 OYrTBehFLnrEhxUr+jvEyMYegqYfbUqbr4dlRmwh8Mdb3wTS4CQ1450akVZs+CtSfUgX kXDg== 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:mime-version:content-transfer-encoding; bh=JjpgGaYWzkrTyqB9MlsAxGRgdPqZmjwayR/Z33XA7DA=; b=YYOQRayOjldnN0ZOGiJXr4mwLvKPyZwdLhjdD/m3SzDn0QV6U6vO1PrUk7OW/uYoAZ anpDpLBH46uD9wECBmrWmFfLaC3JfQAEFyD/7NTFYLggYR6YxHRCKqr+Jr242onnBKNG RjBkSv5NoXvUg4Ub7fF2dndQRAT4E1GwOz2HCHkOn4kZbFg4iBOM2Rk7XIjF/MrRnjiG w8BI9wEF0OhWadUqBdw2Hb6pJX0oI5jkuKaVZ0jawSJtOYi0YpxGWNuZ8dT+/7/rS9c+ gQQ6HEb6mcjOqgWcF77tHqqAH4/ssmdhWi6/r9+EG85H27GWoFBaTeQ5/UVALNc8N2bW X8Cg== X-Gm-Message-State: AGRZ1gJHQsAieBO7PWgN3b6oMLo4wKZKpPKvbuhrxbWLbIffMmBdIyW4 leZ3z1EcsVAe6vCAEyqJp8+MFA== X-Google-Smtp-Source: AJdET5fVtnAHQ/TYlu0JxEcW90ac3CiqkyfkMxw1Yc1qD/RYO4G0m9rleq5hkuqSsnaV7oe0/JZifg== X-Received: by 2002:a1c:aacf:: with SMTP id t198-v6mr3472108wme.108.1542117064742; Tue, 13 Nov 2018 05:51:04 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id j40-v6sm15170050wre.48.2018.11.13.05.51.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 05:51:04 -0800 (PST) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , Keerthy , Linus Walleij , Grygorii Strashko Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Bartosz Golaszewski , stable@vger.kernel.org Subject: [PATCH 2/3] gpio: davinci: restore a way to manually specify the GPIO base Date: Tue, 13 Nov 2018 14:50:50 +0100 Message-Id: <20181113135051.15308-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181113135051.15308-1-brgl@bgdev.pl> References: <20181113135051.15308-1-brgl@bgdev.pl> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Bartosz Golaszewski Commit 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection") broke the network support in legacy boot mode for da850-evm since we can no longer request the MDIO clock GPIO. Other boards may be broken too, which I haven't tested. The problem is in the fact that most board files still use the legacy GPIO API where lines are requested by numbers rather than descriptors. While this should be fixed eventually, in order to unbreak the board for now - provide a way to manually specify the GPIO base in platform data. Fixes: 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection") Cc: stable@vger.kernel.org Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij --- drivers/gpio/gpio-davinci.c | 2 +- include/linux/platform_data/gpio-davinci.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index 5c1564fcc24e..bdb29e51b417 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c @@ -258,7 +258,7 @@ static int davinci_gpio_probe(struct platform_device *pdev) chips->chip.set = davinci_gpio_set; chips->chip.ngpio = ngpio; - chips->chip.base = -1; + chips->chip.base = pdata->no_auto_base ? pdata->base : -1; #ifdef CONFIG_OF_GPIO chips->chip.of_gpio_n_cells = 2; diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h index f92a47e18034..a93841bfb9f7 100644 --- a/include/linux/platform_data/gpio-davinci.h +++ b/include/linux/platform_data/gpio-davinci.h @@ -17,6 +17,8 @@ #define __DAVINCI_GPIO_PLATFORM_H struct davinci_gpio_platform_data { + bool no_auto_base; + u32 base; u32 ngpio; u32 gpio_unbanked; };