Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1640388ybh; Thu, 16 Jul 2020 18:55:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycY8dGylCeqo8bN0uzdPFQ6cV6ybFe+khhBmugQaeqQEFI+8+ZY8YzXnfnSATlaIuOV5Q/ X-Received: by 2002:a17:907:405e:: with SMTP id ns22mr6374013ejb.6.1594950941324; Thu, 16 Jul 2020 18:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594950941; cv=none; d=google.com; s=arc-20160816; b=DIMG7HweuMi11bN/RjZeMzF7CeHVumnw2jYBGROjTiOQTAQJe9aBKG09M1+m6T439E 16BlSanadeebYOXjmBh5rojoQCT/tCLhqbXIMzYLx+zfqcfCcUBJd3tZtpK14aENMffp QbR7dlvCkzpHShHfY0Efp+edoJdmPYXELimnHoV02jIKx7rqe6qNGXWYW1H6c0SaRm4w bLZ8aWQXG3CD2Cwca7R01XYV3G6IG02AZcTHqyWttlh4a/FBz8Ple31c4Yt4WuGK7ZlS YptxoV1At4FVnp2LwvnYuE1HKkY9V9uaoIXNYKzzdN1B64NxjxShoPQpPe4l+mZxBOsB G++A== 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=WbZ7/qfCQVNrqO8XWQBFin4apYcX4o43uA5qkyU+NoahfAO0vY5V8mXOHE/irGqTJD pyukntiNN/2tgjYcfzA7DjLq4tLuKPZwxfz51YliMdUDD0eX7xgAI7noJNCATmicQgZL zkQy80op4C/q4/jNvoqYQq+LlKaWQaeE21CGUB6wS8GGfX0MOrzyOxymJmccbfwLchLc LAKUKvd2jPlq6j11RsKc90UE33SaXvTjLhSvJ2fauOdqhSvqPKQV4nL3htihRNmJpxAv Vsq2iBzPUK1xGCNrcI+oEYdpKdkUQFU6fYkHwHX+29UWc5LqEuguegeJbxeSkAgD6VWJ ZgeA== 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 y5si4452441edw.306.2020.07.16.18.55.18; Thu, 16 Jul 2020 18:55:41 -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 S1726960AbgGQBxx (ORCPT + 99 others); Thu, 16 Jul 2020 21:53:53 -0400 Received: from lucky1.263xmail.com ([211.157.147.134]:47204 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726231AbgGQBxx (ORCPT ); Thu, 16 Jul 2020 21:53:53 -0400 Received: from localhost (unknown [192.168.167.16]) by lucky1.263xmail.com (Postfix) with ESMTP id 0B7B8C0A63; Fri, 17 Jul 2020 09:53:50 +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 P18585T140686961395456S1594950827543475_; Fri, 17 Jul 2020 09:53:48 +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 09:53:46 +0800 Message-Id: <20200717015346.14502-1-jay.xu@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200717014908.13914-1-jay.xu@rock-chips.com> References: <20200717014908.13914-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