Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1639809ybh; Thu, 16 Jul 2020 18:54:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYPsUVYgAqUjrkIYr/9d+TgfLPPNz3CYCSbmtoZ1aFtHp981oExhyEKX+P/IUnWxLFS73/ X-Received: by 2002:a17:906:2c02:: with SMTP id e2mr6219013ejh.64.1594950849796; Thu, 16 Jul 2020 18:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594950849; cv=none; d=google.com; s=arc-20160816; b=SumGAsw0fC4k/3oQnJHboEjxLERRS9f22cQSKVI6yq7Q9iEYx/CQ1OHuOgitFkCG5D yrA1ZIAaOk8rProvcSA4i2nI7/PMfpfemZ5Lsqm1cYq3LN4Is1WMSJpl+2uWs6pKdsno KQlxVK48B/UEdRjZp+R+xa98E11bUnX2zARKSsqVSE3srsrvEwFfjDdYIrfKO5g52Vs2 OHC6MQgqBWae0NdAPNe3zeLwDI2HNGPu/siK0Ht9+aovS9GAcgoTIUD9zxqux1fi3kHl NxOnlDB4VerPqpxB5PULiMQq9t+1gC+SOT9C/0pk0+0L4VPoDZl6SE97rVuEw90cOZdq YVPg== 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=+OnW07gM4wJPJ6RkZoN3xetdkmQCshvkCnsYPmiCTbQ=; b=M7lyt/uXNa4TFfJdScTXdRDuv0kCTtelFRAenFSgq3AVZkZXmqO3OIqGs7HHvzddyy cihtMASd79sV9jx3BfCl4yAn3ZmNSgYeQbROm/z9yUmVqdNlW/ypI2GMBrTLxwAllwmP KBD/TaK2RMgMtrAYAV2jzLuomEmOUbsGI3RnDDJnb1ZOfOKSpzE4/L8sxuIoz9ivMO5H KQXpXKcncNdOQu2lq2NfubcwQeAtBShS1EGj8oIJy6pxD4j1cxUT4OfIEgnsctiBIjY1 Na7qlKQyVoiAtKcLncQfc8Mn258Q9GZSU+nS0b6dOFVSOsSu31JmJrHzquLA5cV81i5P m7Tw== 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 a8si4481838edr.123.2020.07.16.18.53.46; Thu, 16 Jul 2020 18:54:09 -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 S1726786AbgGQBxM (ORCPT + 99 others); Thu, 16 Jul 2020 21:53:12 -0400 Received: from lucky1.263xmail.com ([211.157.147.135]:39852 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgGQBxM (ORCPT ); Thu, 16 Jul 2020 21:53:12 -0400 Received: from localhost (unknown [192.168.167.209]) by lucky1.263xmail.com (Postfix) with ESMTP id CB4D7A157F; Fri, 17 Jul 2020 09:53:08 +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 P17009T140099932980992S1594950787566122_; Fri, 17 Jul 2020 09:53:08 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <918b3b7cdf0ed7d2ab8dc91c94b75d1a> 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 07/13] pinctrl: rockchip: do codingstyle Date: Fri, 17 Jul 2020 09:53:05 +0800 Message-Id: <20200717015305.14202-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 RK3368 definitions to separate from other SoCs. Signed-off-by: Jianqun Xu --- drivers/pinctrl/pinctrl-rockchip.c | 34 ++++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 71335ed003b3..8e3fa9011165 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -1987,6 +1987,9 @@ static void rk3308_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, #define RK3368_PULL_GRF_OFFSET 0x100 #define RK3368_PULL_PMU_OFFSET 0x10 +#define RK3368_PULL_BITS_PER_PIN 2 +#define RK3368_PULL_PINS_PER_REG 8 +#define RK3368_PULL_BANK_STRIDE 16 static void rk3368_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, int pin_num, struct regmap **regmap, @@ -1999,25 +2002,28 @@ static void rk3368_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, *regmap = info->regmap_pmu; *reg = RK3368_PULL_PMU_OFFSET; - *reg += ((pin_num / RK3188_PULL_PINS_PER_REG) * 4); - *bit = pin_num % RK3188_PULL_PINS_PER_REG; - *bit *= RK3188_PULL_BITS_PER_PIN; + *reg += ((pin_num / RK3368_PULL_PINS_PER_REG) * 4); + *bit = pin_num % RK3368_PULL_PINS_PER_REG; + *bit *= RK3368_PULL_BITS_PER_PIN; } else { *regmap = info->regmap_base; *reg = RK3368_PULL_GRF_OFFSET; /* correct the offset, as we're starting with the 2nd bank */ *reg -= 0x10; - *reg += bank->bank_num * RK3188_PULL_BANK_STRIDE; - *reg += ((pin_num / RK3188_PULL_PINS_PER_REG) * 4); + *reg += bank->bank_num * RK3368_PULL_BANK_STRIDE; + *reg += ((pin_num / RK3368_PULL_PINS_PER_REG) * 4); - *bit = (pin_num % RK3188_PULL_PINS_PER_REG); - *bit *= RK3188_PULL_BITS_PER_PIN; + *bit = (pin_num % RK3368_PULL_PINS_PER_REG); + *bit *= RK3368_PULL_BITS_PER_PIN; } } #define RK3368_DRV_PMU_OFFSET 0x20 #define RK3368_DRV_GRF_OFFSET 0x200 +#define RK3368_DRV_BITS_PER_PIN 2 +#define RK3368_DRV_PINS_PER_REG 8 +#define RK3368_DRV_BANK_STRIDE 16 static void rk3368_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, int pin_num, struct regmap **regmap, @@ -2030,20 +2036,20 @@ static void rk3368_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, *regmap = info->regmap_pmu; *reg = RK3368_DRV_PMU_OFFSET; - *reg += ((pin_num / RK3288_DRV_PINS_PER_REG) * 4); - *bit = pin_num % RK3288_DRV_PINS_PER_REG; - *bit *= RK3288_DRV_BITS_PER_PIN; + *reg += ((pin_num / RK3368_DRV_PINS_PER_REG) * 4); + *bit = pin_num % RK3368_DRV_PINS_PER_REG; + *bit *= RK3368_DRV_BITS_PER_PIN; } else { *regmap = info->regmap_base; *reg = RK3368_DRV_GRF_OFFSET; /* correct the offset, as we're starting with the 2nd bank */ *reg -= 0x10; - *reg += bank->bank_num * RK3288_DRV_BANK_STRIDE; - *reg += ((pin_num / RK3288_DRV_PINS_PER_REG) * 4); + *reg += bank->bank_num * RK3368_DRV_BANK_STRIDE; + *reg += ((pin_num / RK3368_DRV_PINS_PER_REG) * 4); - *bit = (pin_num % RK3288_DRV_PINS_PER_REG); - *bit *= RK3288_DRV_BITS_PER_PIN; + *bit = (pin_num % RK3368_DRV_PINS_PER_REG); + *bit *= RK3368_DRV_BITS_PER_PIN; } } -- 2.17.1