From patchwork Wed Nov 21 09:35:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1001007 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="uPXTR+ST"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 430HWf2Rr7z9s7T for ; Wed, 21 Nov 2018 20:36:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729622AbeKUUJY (ORCPT ); Wed, 21 Nov 2018 15:09:24 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40813 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728324AbeKUUJW (ORCPT ); Wed, 21 Nov 2018 15:09:22 -0500 Received: by mail-wm1-f68.google.com with SMTP id q26so4981556wmf.5 for ; Wed, 21 Nov 2018 01:35:37 -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=bXvrUaCBdXRbbMq56OlspLiruOVYgLTKU+757JvGY/Y=; b=uPXTR+STqxwJMGYpDPDRUiAfVOY+2bUeXFfbslIMcgr1f9Kyf0jIO2hT8E/9IACLVi lLk0X8Cfqbz/cWnOS9Hc3Ey6wpZpKtd5UBsDUXDOllZQlJrCbf0Qm0ZaGCRRvpsyuJ6S 3pXpwC91rjuMXO0HrEeUmxZg9p66fy0Np4B5AktfwQrGyNZ0/jIPdhrCzvIgf6+Xa4eI EhYeEXKBrImBEzy4XBKGTzGntDT9dAD1wF1WatGdBUEqOmePy0ewuVv/am5TD7j30Vfm EGKjP1DvvYON2dphvZhkIuxHAipYiR1cE+9a2fEcZMdE6/+AVR/jV3VohItd29tj49bv O4xQ== 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=bXvrUaCBdXRbbMq56OlspLiruOVYgLTKU+757JvGY/Y=; b=WchywFHyJZx91Y18yeZvEFliT0ltfuEqomF/NLn6Xs/CV0PWCPDyI0ZWNQYrNslDNp SZkNs+wNkndQfGDe9OjWrNOVJ9lc2L857JIw7AcFoLA27AUWCi8bWFj6auMBQTMxMW9k bfdqbUZnjTGrIAI20C1vn60nEqkG8IKHSU8cp88rfaqwrZX/kZ5RacEgLwJsOFJ6KOOi P8qNOvXLNJIV480TkZmsN7HPcrT+aoHm+mJA/iEfOVB7Qz25DNFT5S511zEOZ/yau6sZ frIxHKWxYXwyEadNcYisGWeiovZ3Ko1fgYhcAzGwRDY5aApPhRnOgtG0iofgf4OYne/0 Z/Hg== X-Gm-Message-State: AA+aEWbqbeoXDufgAiY4umXJFpXwyciUJBjrhgsJsluoKglW122q111X 2es6lkXXh4D6LptMSTw3+yPh5w== X-Google-Smtp-Source: AFSGD/USrGD/UxF5KngQm5Y5Z9/vKtMVcBlQCojsUJSNcGeM+y0KeQAaSW5lUKF3TyX2mfL071BstA== X-Received: by 2002:a1c:adc9:: with SMTP id w192-v6mr5228413wme.103.1542792937190; Wed, 21 Nov 2018 01:35:37 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id o8sm10443785wrx.15.2018.11.21.01.35.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Nov 2018 01:35:36 -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 06/12] gpio: davinci: restore a way to manually specify the GPIO base Date: Wed, 21 Nov 2018 10:35:17 +0100 Message-Id: <20181121093523.12503-7-brgl@bgdev.pl> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181121093523.12503-1-brgl@bgdev.pl> References: <20181121093523.12503-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; };