Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1679981ybh; Thu, 16 Jul 2020 20:29:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXFfx42MqB1I3FoKkjh2mS6Ky7tDXDZb5cFAgKqNJ1rD/Z1EmY63gQ/s91HGG1ROcoyLr0 X-Received: by 2002:a17:906:2f17:: with SMTP id v23mr6582626eji.343.1594956558835; Thu, 16 Jul 2020 20:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594956558; cv=none; d=google.com; s=arc-20160816; b=Ttn0NSBAVwQSmuGqO+xwcS2PZnq0jsXPKP/xEwbHXXfYvkxyN1wRE5rgsFSdZuFqZ8 buIOqR+/mLDvVVR00xcEv+UOGeOTBQG++cDx+9lGdccu6U6AdnLcB/LiaYb6oRXrpHbm nY7thSUFUANvCEhV3ymq5HZGJwxxCs4MgR69cpWpNOjPyz82pomARZ+Djs25hqvSrhP7 3yS+sEneJiUVC6pBojRkC3Q63APhSgX+EBbEoNiRLyzRLa0ZuVz/OYxEc9JyTzbxEyMD y7a5iblSSo2A/JATcBRwu1Ukgw1oX2Qf1Axbiu4YwAySurMjYQXoqLgPpG6YTqCQAnc6 yoVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=YQ0oQ3spFtwStbLW0A+wDG3JCg0AN+vZuv1mDfPh+W0=; b=oTHL7aLJnq2pSHEEi4OMIWEraPScGHqb2Xh/Jn6VewHH30lXwA7LKiW/9mM6b8Tou4 pf5A38qhC78A2wcL6VxT3n4uOAOKmr8wL8K3XzJ4QYA3qqnG5s/tbna/NDkMkjqkf8am ke77Lpr5oTzYcbLLhNahT52Nb7IjwPxyYq2xshPm7GdHnNaZCkoeDwOz/JjPGqzExo/2 NLsRajUccouaXhaWEefL8GXE1o5XbwEOdSGyBKRB95+BYKHOumCSBPx/1mGOp6eGzGFN pZNB6yFdo2rWdZ+x3ukyKl7Bu0EbT0054d1xLOLfUeVynJmiqnB/3mjWtc+oZpbHxOGd ce6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r1si4298266edw.10.2020.07.16.20.28.55; Thu, 16 Jul 2020 20:29:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727786AbgGQD1e (ORCPT + 99 others); Thu, 16 Jul 2020 23:27:34 -0400 Received: from lucky1.263xmail.com ([211.157.147.134]:42232 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbgGQD1e (ORCPT ); Thu, 16 Jul 2020 23:27:34 -0400 Received: from localhost (unknown [192.168.167.209]) by lucky1.263xmail.com (Postfix) with ESMTP id EF17CC0BD5; Fri, 17 Jul 2020 11:27:31 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P17009T140099819927296S1594956450998637_; Fri, 17 Jul 2020 11:27:32 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: jay.xu@rock-chips.com X-SENDER: xjq@rock-chips.com X-LOGIN-NAME: jay.xu@rock-chips.com X-FST-TO: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 From: Jianqun Xu To: heiko@sntech.de, linus.walleij@linaro.org Cc: linux-gpio@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kever.yang@rock-chips.com, david.wu@rock-chips.com, Jianqun Xu Subject: [PATCH 12/13] pinctrl: rockchip: define common codes without special chip name Date: Fri, 17 Jul 2020 11:27:29 +0800 Message-Id: <20200717032729.18435-1-jay.xu@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200717032411.17654-1-jay.xu@rock-chips.com> References: <20200717032411.17654-1-jay.xu@rock-chips.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Modify RK3399_DRV_3BITS_PER_PIN to ROCKCHIP_DRV_3BITS_PER_PIN, and modify RK3288_DRV_BITS_PER_PIN to ROCKCHIP_DRV_BITS_PER_PIN. Signed-off-by: Jianqun Xu --- drivers/pinctrl/pinctrl-rockchip.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 3b74455dcdb2..71a367896297 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -75,6 +75,9 @@ enum rockchip_pinctrl_type { #define IOMUX_WIDTH_3BIT BIT(4) #define IOMUX_WIDTH_2BIT BIT(5) +#define ROCKCHIP_DRV_3BITS_PER_PIN (3) +#define ROCKCHIP_DRV_BITS_PER_PIN (2) + /** * @type: iomux variant using IOMUX_* constants * @offset: if initialized to -1 it will be autocalculated, by specifying @@ -2074,7 +2077,6 @@ static void rk3368_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, #define RK3399_PULL_GRF_OFFSET 0xe040 #define RK3399_PULL_PMU_OFFSET 0x40 -#define RK3399_DRV_3BITS_PER_PIN 3 #define RK3399_PULL_BITS_PER_PIN 2 #define RK3399_PULL_PINS_PER_REG 8 #define RK3399_PULL_BANK_STRIDE 16 @@ -2154,7 +2156,7 @@ static int rockchip_get_drive_perpin(struct rockchip_pin_bank *bank, switch (drv_type) { case DRV_TYPE_IO_1V8_3V0_AUTO: case DRV_TYPE_IO_3V3_ONLY: - rmask_bits = RK3399_DRV_3BITS_PER_PIN; + rmask_bits = ROCKCHIP_DRV_3BITS_PER_PIN; switch (bit) { case 0 ... 12: /* regular case, nothing to do */ @@ -2197,7 +2199,7 @@ static int rockchip_get_drive_perpin(struct rockchip_pin_bank *bank, case DRV_TYPE_IO_DEFAULT: case DRV_TYPE_IO_1V8_OR_3V0: case DRV_TYPE_IO_1V8_ONLY: - rmask_bits = RK3288_DRV_BITS_PER_PIN; + rmask_bits = ROCKCHIP_DRV_BITS_PER_PIN; break; default: dev_err(info->dev, "unsupported pinctrl drive type: %d\n", @@ -2251,7 +2253,7 @@ static int rockchip_set_drive_perpin(struct rockchip_pin_bank *bank, switch (drv_type) { case DRV_TYPE_IO_1V8_3V0_AUTO: case DRV_TYPE_IO_3V3_ONLY: - rmask_bits = RK3399_DRV_3BITS_PER_PIN; + rmask_bits = ROCKCHIP_DRV_3BITS_PER_PIN; switch (bit) { case 0 ... 12: /* regular case, nothing to do */ @@ -2291,7 +2293,7 @@ static int rockchip_set_drive_perpin(struct rockchip_pin_bank *bank, case DRV_TYPE_IO_DEFAULT: case DRV_TYPE_IO_1V8_OR_3V0: case DRV_TYPE_IO_1V8_ONLY: - rmask_bits = RK3288_DRV_BITS_PER_PIN; + rmask_bits = ROCKCHIP_DRV_BITS_PER_PIN; break; default: dev_err(info->dev, "unsupported pinctrl drive type: %d\n", -- 2.17.1