From patchwork Wed Mar 30 12:09:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jackie Liu X-Patchwork-Id: 12795735 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF656C433FE for ; Wed, 30 Mar 2022 12:28:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234807AbiC3M37 (ORCPT ); Wed, 30 Mar 2022 08:29:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346346AbiC3MXR (ORCPT ); Wed, 30 Mar 2022 08:23:17 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E10A29EE02 for ; Wed, 30 Mar 2022 05:09:45 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1648642182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oCxFaMTEXV7tOHotZ8HirDBqY5mnMWXp+mUY/8HQN4s=; b=XIOcrZURF8VbRVBNRo3oQAqhWlewoNofTloMfDKDsVZnGBEzcLMo/95L0IOZjj57mgFqQB BcOZjdjspksYyK4RDxKttMAJR3stJ9NMFZpXJ6JXgvchXgm77RSI/ke5MpcmNOsWRbDZEx IJU4hQya7lZ0xvOB70T3H9wA5aG84Yw= From: Jackie Liu To: linus.walleij@linaro.org, ralf@linux-mips.org, tsbogend@alpha.franken.de Cc: linux-mips@vger.kernel.org, jic23@kernel.org, andy.shevchenko@gmail.com, sergei.shtylyov@gmail.com, liu.yun@linux.dev Subject: [PATCH v4] MIPS: rb532: move GPIOD definition into C-files Date: Wed, 30 Mar 2022 20:09:21 +0800 Message-Id: <20220330120921.1920941-1-liu.yun@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org From: Jackie Liu My kernel robot reports build error from drivers/iio/adc/da9150-gpadc.c, drivers/iio/adc/da9150-gpadc.c:254:13: error: ‘DA9150_GPADC_CHAN_0x08’ undeclared here (not in a function); did you mean ‘DA9150_GPADC_CHAN_TBAT’? 254 | .channel = DA9150_GPADC_CHAN_##_id, We define GPIOD in rb.h, in fact it should only be used in gpio.c, but it affects the driver da9150-gpadc.c which goes against the original intention of the design, just move it to its scope. Fixes: 1b432840d0a4 ("MIPS: RB532: GPIO register offsets are relative to GPIOBASE") Suggested-by: Jonathan Cameron Suggested-by: Andy Shevchenko Reported-by: k2ci Signed-off-by: Jackie Liu --- v1->v2: Keep GPIONMIEN and IMASK6 as hardware document. v2->v3: s/he/it/. v3->v4: s/his/its/. arch/mips/include/asm/mach-rc32434/rb.h | 9 --------- arch/mips/rb532/gpio.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/mips/include/asm/mach-rc32434/rb.h b/arch/mips/include/asm/mach-rc32434/rb.h index 34d179ca020b..dd9d4b026e62 100644 --- a/arch/mips/include/asm/mach-rc32434/rb.h +++ b/arch/mips/include/asm/mach-rc32434/rb.h @@ -29,15 +29,6 @@ #define DEV3TC 0x01003C #define BTCS 0x010040 #define BTCOMPARE 0x010044 -#define GPIOBASE 0x050000 -/* Offsets relative to GPIOBASE */ -#define GPIOFUNC 0x00 -#define GPIOCFG 0x04 -#define GPIOD 0x08 -#define GPIOILEVEL 0x0C -#define GPIOISTAT 0x10 -#define GPIONMIEN 0x14 -#define IMASK6 0x38 #define LO_WPX (1 << 0) #define LO_ALE (1 << 1) #define LO_CLE (1 << 2) diff --git a/arch/mips/rb532/gpio.c b/arch/mips/rb532/gpio.c index 94f02ada4082..29c21b9d42da 100644 --- a/arch/mips/rb532/gpio.c +++ b/arch/mips/rb532/gpio.c @@ -37,6 +37,16 @@ #include #include +#define GPIOBASE 0x050000 +/* Offsets relative to GPIOBASE */ +#define GPIOFUNC 0x00 +#define GPIOCFG 0x04 +#define GPIOD 0x08 +#define GPIOILEVEL 0x0C +#define GPIOISTAT 0x10 +#define GPIONMIEN 0x14 +#define IMASK6 0x38 + struct rb532_gpio_chip { struct gpio_chip chip; void __iomem *regbase;