Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1639994ybh; Thu, 16 Jul 2020 18:54:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCdoWOXM7ZzuBAH+W3oHfzU2ZJkTD61vbVFUljJTWjkKzFMbd5nLFpe/e4+T3xT+BpHvRZ X-Received: by 2002:a17:906:38d6:: with SMTP id r22mr4005357ejd.219.1594950879285; Thu, 16 Jul 2020 18:54:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594950879; cv=none; d=google.com; s=arc-20160816; b=a1yroNZRldiW+0nrw3sZWa1KszBZBRcJtXjpKCYZde4rYAe45EuSApEwL8bFQ1d2zk wVIZ6OkuQvJhVOGWIbqLyXFZvzyYMQkQKpLPNrLNJ3itByEMGOTurPh+dJLW/Fg42Zqw AMlAlF/MsNeC5MiPkUU/PMy80UXn8N1p1hh1wQKF+ccz0qmzupnUAIhpmDBx3KtyvZ6+ Sl5vw37RudghtQenfdvwCmJfOR1m1YDhEKVuwlz7sWSa4FVS/VhHwzTYXRJY33Pe6PmJ pzjER23hoHkz7HFclRJvzlL+XY7o5qBp3Julg+ZrYkT8PITDuojk0PWAo0699g9wfBDQ Cq0g== 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=KkuwjDLRjk8CK7EVbzki0czkFO/8+j+uqC/7sVztOnI=; b=l/EyRhGWgb68yeA+fkxnUszf5o36HjogDQZz7lY06exkU8PZSL3tJlziHRerLhdtcn t2/wOmnNtk34LRDZJtujoAwxxTJ69LGmOAj9AS59lHCwdRHQRNZeRXh7In9w3rufGFID X9Yc/I9irAil0AZYNCci4YiCRNMSL0aOyQPr72CyIfQpHmMF9o1bB+BiPabxiydVYzaf GpY6oC2Jux4PLL2K+93LaKq3Ewu5HYVHfu+c1AHIqRiS2YWOuU1HVLhbIT6YzlRVN7T6 N/zSYi73uHGUUgBxnNPqTdC+jARkMcd4yzZbBRlvP7jMPAJXj/zgk4Lh4WxLGduauE15 8Fcg== 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 p13si4280588edh.504.2020.07.16.18.54.17; Thu, 16 Jul 2020 18:54:39 -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 S1726811AbgGQBx3 (ORCPT + 99 others); Thu, 16 Jul 2020 21:53:29 -0400 Received: from lucky1.263xmail.com ([211.157.147.133]:39464 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726442AbgGQBx3 (ORCPT ); Thu, 16 Jul 2020 21:53:29 -0400 Received: from localhost (unknown [192.168.167.235]) by lucky1.263xmail.com (Postfix) with ESMTP id 44809C5D6B; Fri, 17 Jul 2020 09:53:26 +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 P26706T140361238066944S1594950804654023_; Fri, 17 Jul 2020 09:53:25 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <6045a8117473b967c7cacb8c546d06de> 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 09/13] pinctrl: rockchip: do codingstyle Date: Fri, 17 Jul 2020 09:53:23 +0800 Message-Id: <20200717015323.14323-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 Add RK3228 definitions to separate from other SoCs. Signed-off-by: Jianqun Xu --- drivers/pinctrl/pinctrl-rockchip.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 44f051af97c6..ec6a1a08f8b1 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -1918,6 +1918,9 @@ static void rk3288_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, } #define RK3228_PULL_OFFSET 0x100 +#define RK3228_PULL_BITS_PER_PIN 2 +#define RK3228_PULL_PINS_PER_REG 8 +#define RK3228_PULL_BANK_STRIDE 16 static void rk3228_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, int pin_num, struct regmap **regmap, @@ -1927,14 +1930,17 @@ static void rk3228_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, *regmap = info->regmap_base; *reg = RK3228_PULL_OFFSET; - *reg += bank->bank_num * RK3188_PULL_BANK_STRIDE; - *reg += ((pin_num / RK3188_PULL_PINS_PER_REG) * 4); + *reg += bank->bank_num * RK3228_PULL_BANK_STRIDE; + *reg += ((pin_num / RK3228_PULL_PINS_PER_REG) * 4); - *bit = (pin_num % RK3188_PULL_PINS_PER_REG); - *bit *= RK3188_PULL_BITS_PER_PIN; + *bit = (pin_num % RK3228_PULL_PINS_PER_REG); + *bit *= RK3228_PULL_BITS_PER_PIN; } #define RK3228_DRV_GRF_OFFSET 0x200 +#define RK3228_DRV_BITS_PER_PIN 2 +#define RK3228_DRV_PINS_PER_REG 8 +#define RK3228_DRV_BANK_STRIDE 16 static void rk3228_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, int pin_num, struct regmap **regmap, @@ -1944,11 +1950,11 @@ static void rk3228_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, *regmap = info->regmap_base; *reg = RK3228_DRV_GRF_OFFSET; - *reg += bank->bank_num * RK3288_DRV_BANK_STRIDE; - *reg += ((pin_num / RK3288_DRV_PINS_PER_REG) * 4); + *reg += bank->bank_num * RK3228_DRV_BANK_STRIDE; + *reg += ((pin_num / RK3228_DRV_PINS_PER_REG) * 4); - *bit = (pin_num % RK3288_DRV_PINS_PER_REG); - *bit *= RK3288_DRV_BITS_PER_PIN; + *bit = (pin_num % RK3228_DRV_PINS_PER_REG); + *bit *= RK3228_DRV_BITS_PER_PIN; } #define RK3308_PULL_OFFSET 0xa0 -- 2.17.1