From patchwork Thu Oct 19 13:18:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 116394 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp489228qgn; Thu, 19 Oct 2017 06:18:35 -0700 (PDT) X-Received: by 10.159.195.7 with SMTP id bd7mr1548306plb.366.1508419115199; Thu, 19 Oct 2017 06:18:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508419115; cv=none; d=google.com; s=arc-20160816; b=xSFC8vmDarUCJOA2sr5JeKcIUOE3Kx688xesPxDYc+/QnYGMQDRoI8uXEEP+DDzG4k vr9q5IbhI1YGbYkUibaWQYRWHEwK6/SFPMi6SMyGGjOCXHb7LSiO8p+sYsVsxEKltcce o6t9ExYVZz6vVWGqsQEWawpkpcXZfHUFoYCcwzMZXwKWuL3Pfst7Hi/IdKT3qmXPPKp/ UfPn8SIN4dM+tlDGm/hjjDDJX9/fonspHVsSHeqRaKa/fiHmdAEZoq7k2Px5hX+wiknu nztbfPEgUoNmvEZM77kZM9Vvs4yyXdSXBlO2rIhANPCEUcmjD4k1WwoFz8JROIZXy6vt GLWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=KXuEj9YPaWBLPTJyXvdLmXHJVFwNdHuPCwUFOMagbF0=; b=q3bVky6fH/fz/zkBXNus/jiZ1tMVs44EpGr44tRZevwH88FwybiRX22BIQ2XAY2X60 mRO0l+WrNbFVyG+Xq4jwNBJW0CbqhfTC6Jjnso05IW3UvwJqVosZlPj/Lm6Cs9mAoJ4L lA67vNPZWBE1CooMiyaAbPmPte+QZ0bQf+BmRt5aG/0uEuybvtRX04Znz5tv2Jo8WDum +OqS82H1He4tTKnRjssHeDafXq4ceoFwIJisIC6zPR3dimF5ibe2tFLtlOrBcXsFRzB4 qUXcCrwFmExigXkAEnRcbOz2s45jL8+Qmy53a+KXNb20LqCEZ8GT4nkehBTahOdYrH5v 4i5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DefOipH3; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si2815390pfj.448.2017.10.19.06.18.34; Thu, 19 Oct 2017 06:18:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DefOipH3; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752677AbdJSNSe (ORCPT + 6 others); Thu, 19 Oct 2017 09:18:34 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:46920 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752639AbdJSNSd (ORCPT ); Thu, 19 Oct 2017 09:18:33 -0400 Received: by mail-lf0-f68.google.com with SMTP id g70so9586673lfl.3 for ; Thu, 19 Oct 2017 06:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Qh0Aj4zONrHB1wBS2ObncjbfnckpVDKpW578vEpTRao=; b=DefOipH33Bh0L8WhnlWjE9Ly/CFRHGEkfFr7Z2reIj5dwhennxvGCGrbwzXUThLCNp GhjllBJNVEnp2UzLlXOmZ5LpdMYUtfcnD7LZHroLDslRN7IVfui/Tbc2tnV8HlN8a44e v8eiVzb5Skzo0ZJD4Mv6OIO7KJQ1Y1irRc+3g= 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; bh=Qh0Aj4zONrHB1wBS2ObncjbfnckpVDKpW578vEpTRao=; b=Rr+dPVcPRzZ2eQHfDBEVvjfTbAiErbYonPYzpXvZm3x5xG/Kvm6zi839gn8U8JXaYR xzLzbE8jrzmu4T0ohQUtVtB3k67FiT1r4Hs1qhhNVhYfrN9SejhHQu3QZRCpQjIFyvX2 zVE1oKOVmYwuUp5HuYV2jjh6F9kCURpjHiDFg/v2HWLm3izeKB+ft/f9sM0xfjtqJOwD ahe0TbUyvUhs8vo2dXeqSe+6AiEvwjFh35YySaRoFMc2u5PGIpPFrDoG7aR4pGelKfRE BLP9Jo3dt/nuWcFKa47f5K0ZJ0kezq/aNN0/cuAFBJvE86AsjXEhOjzAw4xkJGCpxFgU 0yeg== X-Gm-Message-State: AMCzsaX/aD/uCT4Kzt6KZifwgGyjESJ5iZocHA+C0kp+9oFkbjWMNCsH XkA+4ksoA8baPXSndhxaW0x++KNWpZ0= X-Google-Smtp-Source: ABhQp+R/hk9G0GwIN55CQIbhmylmfKjL3Y59ybNAb9/4wxeWzRQ2MO4eIFUBlyTKTO/WptczV1+FfQ== X-Received: by 10.46.7.68 with SMTP id i4mr714393ljd.150.1508419111795; Thu, 19 Oct 2017 06:18:31 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 129sm3106557ljj.9.2017.10.19.06.18.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2017 06:18:31 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Steven Miao , Huanhuan Feng Subject: [PATCH 1/2] pinctrl: adi2: Fix Kconfig build problem Date: Thu, 19 Oct 2017 15:18:26 +0200 Message-Id: <20171019131826.28584-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.6 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The build robot is complaining on Blackfin: drivers/pinctrl/pinctrl-adi2.c: In function 'port_setup': >> drivers/pinctrl/pinctrl-adi2.c:221:21: error: dereferencing pointer to incomplete type 'struct gpio_port_t' writew(readw(®s->port_fer) & ~BIT(offset), ^~ drivers/pinctrl/pinctrl-adi2.c: In function 'adi_gpio_ack_irq': >> drivers/pinctrl/pinctrl-adi2.c:266:18: error: dereferencing pointer to incomplete type 'struct bfin_pint_regs' if (readl(®s->invert_set) & pintbit) ^~ It seems the driver need to include and to compile. The Blackfin architecture was re-defining the Kconfig PINCTRL symbol which is not OK, so replaced this with PINCTRL_BLACKFIN_ADI2 which selects PINCTRL and PINCTRL_ADI2 just like most arches do. Further, the old GPIO driver symbol GPIO_ADI was possible to select at the same time as selecting PINCTRL. This was not working because the arch-local header contains an explicit #ifndef PINCTRL clause making compilation break if you combine them. The same is true for DEBUG_MMRS. Make sure the ADI2 pinctrl driver is not selected at the same time as the old GPIO implementation. (This should be converted to use gpiolib or pincontrol and move to drivers/...) Also make sure the old GPIO_ADI driver or DEBUG_MMRS is not selected at the same time as the new PINCTRL implementation, and only make PINCTRL_ADI2 selectable for the Blackfin families that actually have it. This way it is still possible to add e.g. I2C-based pin control expanders on the Blackfin. Cc: Steven Miao Cc: Huanhuan Feng Signed-off-by: Linus Walleij --- arch/blackfin/Kconfig | 7 +++++-- arch/blackfin/Kconfig.debug | 1 + drivers/pinctrl/Kconfig | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) -- 2.13.6 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index 89bdb8264305..6cd804e16a94 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig @@ -320,11 +320,14 @@ config BF53x config GPIO_ADI def_bool y + depends on !PINCTRL depends on (BF51x || BF52x || BF53x || BF538 || BF539 || BF561) -config PINCTRL +config PINCTRL_BLACKFIN_ADI2 def_bool y - depends on BF54x || BF60x + depends on (BF54x || BF60x) + select PINCTRL + select PINCTRL_ADI2 config MEM_MT48LC64M4A2FB_7E bool diff --git a/arch/blackfin/Kconfig.debug b/arch/blackfin/Kconfig.debug index f3337ee03621..a93cf06a4d6f 100644 --- a/arch/blackfin/Kconfig.debug +++ b/arch/blackfin/Kconfig.debug @@ -17,6 +17,7 @@ config DEBUG_VERBOSE config DEBUG_MMRS tristate "Generate Blackfin MMR tree" + depends on !PINCTRL select DEBUG_FS help Create a tree of Blackfin MMRs via the debugfs tree. If diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index c0294958405d..5b4939e709ac 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -32,7 +32,8 @@ config DEBUG_PINCTRL config PINCTRL_ADI2 bool "ADI pin controller driver" - depends on BLACKFIN + depends on (BF54x || BF60x) + depends on !GPIO_ADI select PINMUX select IRQ_DOMAIN help From patchwork Thu Oct 19 13:18:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 116395 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp489369qgn; Thu, 19 Oct 2017 06:18:43 -0700 (PDT) X-Received: by 10.98.223.72 with SMTP id u69mr1548133pfg.305.1508419123349; Thu, 19 Oct 2017 06:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508419123; cv=none; d=google.com; s=arc-20160816; b=Fk+me0shhIxhWWYp+rboy1Ap16El/lqwXyvF2rAFjAIiSdK9QUxP06XM1jHkgQgWXI thODpqcoBzQjTlMmZMu4lmUTwAPti+JQZOc3DtDfX2EaO+QvaAMYe3liFTwZjJnb9TCS wxt7uOXYBhxCQGCAFrnglPfxDymtVbEJ+jePiM+DhlEWmR35Xd45QGrrDWP6Po0PmZo1 +Q9FAx5XqOvROKCKXG7StWE3OzjuxmIYSbkLeDAl8rX915LWBp3ZMKFR677b2q0kmQYx O7d73qHcAsbMlgCHDGwPnfHagdOi4NixAxnEm26FbLhD6jqJ9mapeq8oQcjCslMJZE+A XIww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=gdhIeKxj3dDOSzyFFx3c2+Q0wmBPZIi16Hbbsbpd+Gs=; b=NSKmaRCwFSuYLSxotQ8o88Gv7XuOdFbL6eu9z04WUUAWr0FKfyBRguMwP04ytWX0kb +pCXGvPOT1QFM2FMRjRE5Qbo5fKLkKK43I/3PxM9e/9XdSHq0ibmMXhR94FwWNkpHwdu W+cdSEMNTedYx8zPqtnSmGa1zg64iahgETmk7ei+kebjrHcJzqaH9j4W5f9CC113CmZI MBwGAYOs55l8J4CgXu2Lnyoiu9yDQNU2p/1bhSfdf4dGF6eB2nsuBAp5kMPbmfftt7mr kKDXKB2Ttc45X/EifshpbN9qFCVditSNTjlY2nmchxrhSioMKRHFS7nFYce0DvsIeBej j+Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PJrVZ63g; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si2815390pfj.448.2017.10.19.06.18.43; Thu, 19 Oct 2017 06:18:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PJrVZ63g; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752278AbdJSNSm (ORCPT + 6 others); Thu, 19 Oct 2017 09:18:42 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:52854 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752639AbdJSNSl (ORCPT ); Thu, 19 Oct 2017 09:18:41 -0400 Received: by mail-lf0-f65.google.com with SMTP id b190so9557670lfg.9 for ; Thu, 19 Oct 2017 06:18:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=KsPcMU2bKwAgDCSevwjqgy5t94fNTxtFJPJWxGrtCyI=; b=PJrVZ63grCbfcZCJ1TWGik+vuKMC6Ro+iMR5z3shu9O6s0VHUtz618RtWs1Ed6NTOd 8RhchJ7SrgUnuCUCc+ZUfMirrT5OFEDMmdnW5WmcCtZwk0zJZ3xVI93MpBvHb95kVGjl QTxHZ7RwoAa5/T/8I3Sz8JehNrpV//WQ/wL/I= 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; bh=KsPcMU2bKwAgDCSevwjqgy5t94fNTxtFJPJWxGrtCyI=; b=t4XdMA8ezcpRFsiRuP+sReDB7uFQ9bMF4zG+IGV5UjfD845a0XTndYbdai+EuCJifX Y2VUtEJ98irxiI/Mqnr9RJ0lZhHlOocCaEWl2YortJJvZO1+pipvBkPx1HC6PGF1jWe9 gtiElGmEg9TOph28ZagcXaog3LGBjR6A9YkvfgNcenmLK7ykrJSQwPuXELoHhGl+bYiu dTLZSsIXN5tDDQyqXIrAWHKzQDR1bpfjdbBrwHl++pTITwgPmYnImqVkwmD3o06t7w+m AxSqKl+OdBzL6G4Fz4js/XZ616c4mGc08gtLgz+xhkruGCSZQPHs0TkYy5oDmGyQPjzC LsFQ== X-Gm-Message-State: AMCzsaUVV5XmJ/cL9ZMpoNBji2gRsp11aT4B/lHr4ZRKlYkmRpTHRc3i u39GMkc7tEMYJ95YTPcVeiKCOBtYTiw= X-Google-Smtp-Source: ABhQp+QVysYiOIAROoX4iFEWmZZMOycqs1hPkOaMjNufMwTyN0CguOqIc/EOgbEm+5ecmHyZAcWfEA== X-Received: by 10.25.143.156 with SMTP id s28mr661223lfk.236.1508419119993; Thu, 19 Oct 2017 06:18:39 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id b12sm411895ljf.60.2017.10.19.06.18.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2017 06:18:39 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Steven Miao , Huanhuan Feng Subject: [PATCH 2/2] blackfin: Fix local includes Date: Thu, 19 Oct 2017 15:18:36 +0200 Message-Id: <20171019131836.28634-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.6 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org When making the pin control submenu globally visible, all kinds of oddities appear, in blackfin a few files were #including and relying on that to pull in . This was not working when pin control but not GPIOLIB was selected resulting in a breakage in allmodconfig. The code these files were using was still there and defined in just not pulle in from just including Simply add the required includes explicitly in the blackfin kernel core and everything compiles fine. Delete the use of the incorrect where possible. Add stubs to for the functions called from PM: these should probably also depend on !PINCTRL but since the global CONFIG_PM symbol is used to compile PM support, we need some more intrusive thing here, to be tested by Blackfin maintainers. Cc: Steven Miao Cc: Huanhuan Feng Signed-off-by: Linus Walleij --- arch/blackfin/include/asm/gpio.h | 20 ++++++++++++++++++++ arch/blackfin/kernel/bfin_gpio.c | 3 +++ arch/blackfin/kernel/debug-mmrs.c | 2 +- arch/blackfin/mach-common/ints-priority.c | 2 +- arch/blackfin/mach-common/pm.c | 2 +- 5 files changed, 26 insertions(+), 3 deletions(-) -- 2.13.6 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h index 99d338ca2ea4..a2579321c7f1 100644 --- a/arch/blackfin/include/asm/gpio.h +++ b/arch/blackfin/include/asm/gpio.h @@ -183,6 +183,26 @@ static inline int irq_to_gpio(unsigned irq) { return irq - GPIO_IRQ_BASE; } + +#else /* CONFIG_PINCTRL */ + +/* + * CONFIG_PM is not working with pin control and should probably + * avoid being selected when pin control is active, but so far, + * these stubs are here to make allyesconfig and allmodconfig + * compile properly. These functions are normally backed by the + * CONFIG_ADI_GPIO custom GPIO implementation. + */ + +static inline int bfin_pm_standby_setup(void) +{ + return 0; +} + +static inline void bfin_pm_standby_restore(void) +{ +} + #endif /* CONFIG_PINCTRL */ #include diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index c5d31287de01..63da80bbadf6 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c @@ -15,6 +15,9 @@ /* FIXME: consumer API required for gpio_set_value() etc, get rid of this */ #include #include +#include +#include +#include #if ANOMALY_05000311 || ANOMALY_05000323 enum { diff --git a/arch/blackfin/kernel/debug-mmrs.c b/arch/blackfin/kernel/debug-mmrs.c index f31ace221392..194773ce109e 100644 --- a/arch/blackfin/kernel/debug-mmrs.c +++ b/arch/blackfin/kernel/debug-mmrs.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include @@ -20,6 +19,7 @@ #include #include #include +#include /* Common code defines PORT_MUX on us, so redirect the MMR back locally */ #ifdef BFIN_PORT_MUX diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index 13e94bf9d8ba..e81a5b7dabdc 100644 --- a/arch/blackfin/mach-common/ints-priority.c +++ b/arch/blackfin/mach-common/ints-priority.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #ifdef CONFIG_IPIPE #include @@ -28,6 +27,7 @@ #include #include #include +#include /* * NOTES: diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c index 5ece38a5b758..f57b5fe5355e 100644 --- a/arch/blackfin/mach-common/pm.c +++ b/arch/blackfin/mach-common/pm.c @@ -15,12 +15,12 @@ #include #include #include -#include #include #include #include #include +#include #ifdef CONFIG_BF60x struct bfin_cpu_pm_fns *bfin_cpu_pm;