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: 10680671 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C0C141709 for ; Tue, 13 Nov 2018 13:52:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE1742A898 for ; Tue, 13 Nov 2018 13:52:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A234A2A8A5; Tue, 13 Nov 2018 13:52:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 449312A898 for ; Tue, 13 Nov 2018 13:52:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P53PxcOAO07f+tEYXMTrKIJFanG+2tuIXFIWByTbngo=; b=bvbkcSSbTBUCWD owNBmX3pYb0eqWX1+8KOP17MGlcPsaD/5oXFcUD79fBe3NpIRueUDlpQxGdWFSNEkQWfGWi72cN9B Le/xvBeBmWL7hKHPZQRFFWd4sDT0PosKjogX9FOAWdVrgTmvpbUvY1WgbHnLuKbnYgA3Auy15aFWN msbdGJqR4sio05v9d/VAbIIYG8kB+zbLKKyon7EPz/VByESP1R+BE+J8/BOJPlcZvOsj9F5XIFqEs KX4sFaQaY6Pnujy0ZBJjre10G4d+kB0vv+2qUcJ00WM1TkIMcMoVgXWjV9PE1QUSkHtLrSSWtwiIc ivmzMPb9yhfWp3MrxuBQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMZ6z-0001my-Gk; Tue, 13 Nov 2018 13:52:13 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMZ64-0000om-Jj for linux-arm-kernel@lists.infradead.org; Tue, 13 Nov 2018 13:51:24 +0000 Received: by mail-wm1-x342.google.com with SMTP id p2-v6so11449253wmc.2 for ; Tue, 13 Nov 2018 05:51:06 -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=ITov3E1h9cQlwO18uOfjlXM7Lga3DW89Wpmu7u33+SmVR0/Jcph8t6STA9qjgDkljx /iDxc9vxxU0cRUTpo2FHUSszE3fEzP8Sqy34yqKIVjL9lEGoarHxc33ZGEu1EOCP3yQX aBQpDI6Blz9CvCC/ivXyMgjo8LYgieC7uUum77Gg6XY+SxZT5pynRmE+S+Xp4Bf9aQAa 4A0QtRREwlp8aB3y/7rZphywD0C/vLIgFwcK5FMK1hiDgmjYCiNno1kobJKt/Tu+ESVe 8OIt+AEilhNmMuV2Czr6p8Csridp8+CmSOIGHCPH3XM5XCZCYHsNuxvxTkAVKiP9EPSy YsqA== X-Gm-Message-State: AGRZ1gJkgLYOtKRGVwS0selYhMDc/lzqKW0CyP8QqhsJ5UH/8aGjHu0r RNY+5o1jOIfdVUkE6BXdfJr1BQ== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181113_055116_669127_B8FBAC6E X-CRM114-Status: GOOD ( 13.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-gpio@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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; };