Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1639645ybh; Thu, 16 Jul 2020 18:53:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd/x3DdzvIRhz3kTyTH6BzY/bPQUiPYxXXLn5yvWDlZuDN9BJ0wdpinWE0S5ga3BLR4omf X-Received: by 2002:a05:6402:b84:: with SMTP id cf4mr6881747edb.21.1594950828542; Thu, 16 Jul 2020 18:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594950828; cv=none; d=google.com; s=arc-20160816; b=LA0ybRVD++M5/6Jl4cDFfnWILhMfSPMAL0mJCxeOQ1He1LtuzpLyruvC6RCWkRzuLZ 5Hz2hPCQGTEMRXWmJ7zznprvtxerStc+G3IKFGQ54VwbZFDGBClg/4HDeEuqofoCVSRH YBn5+WonYhlIF1ug24n3ldX4N12ZKVoDwnKhIL4Dm8+qw6D43l+857gmEmxADhlKqau5 4vAaizdDyM4pODH3z27Iq2XIP8fkew8T48gHKWAvemkjoftoEGjMSW0ejoZOo/xoW03X pS5QqDE+PMlgBT9dDco2lxte5fbd5+Bs8xjwnSwmWpApIMGmVEmi216AlbUDt5sK5Su7 hdtQ== 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=2BvOQSoGs/OGf69emxqb57v7z2d3x+4iWoyE4GKxdOk=; b=txn/cvtuoW7tQYvc4nRNTC77R1jhPbmzyQyVyntqAIsVHjV+ccjfDZ4MllmRATGi1W /W4cjgAS2fUM5wLp49Fo9ytPAbpcCxjkYk7MBD2GGK0dQYfhfLP1yi1lAb4V6VU+M/Is +mHdWW7y/BalEKx/Emxk6NH2SXJH/iPO5GKN5k53dhcsPSJvmgsGFjR6m95jJuexuBOZ YX5XOLhcGSAI5gaDEAJbItghCqAtQah0z0R115RUmArhRHuaysyQyju0VvhoDMETNmJX osKnGecYV0l2qnYttKuOXDguYGVAm+ufpDkkVqI9nQfG149qi/SsbOhi/P9St/ntX9Ut 3rfg== 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 bi3si4263321edb.391.2020.07.16.18.53.25; Thu, 16 Jul 2020 18:53:48 -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 S1726698AbgGQBwi (ORCPT + 99 others); Thu, 16 Jul 2020 21:52:38 -0400 Received: from lucky1.263xmail.com ([211.157.147.132]:34418 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbgGQBwh (ORCPT ); Thu, 16 Jul 2020 21:52:37 -0400 Received: from localhost (unknown [192.168.167.209]) by lucky1.263xmail.com (Postfix) with ESMTP id 8D32DEC08D; Fri, 17 Jul 2020 09:52:35 +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 P17009T140099633260288S1594950754349190_; Fri, 17 Jul 2020 09:52:35 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <4339edc153396fc21e5612d10d58466a> 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 06/13] pinctrl: rockchip: do codingstyle Date: Fri, 17 Jul 2020 09:52:32 +0800 Message-Id: <20200717015232.14099-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 RK3399 definitions to separate from other SoCs. Signed-off-by: Jianqun Xu --- drivers/pinctrl/pinctrl-rockchip.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 1be4627f3877..71335ed003b3 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -2050,6 +2050,9 @@ 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 static void rk3399_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, int pin_num, struct regmap **regmap, @@ -2062,22 +2065,22 @@ static void rk3399_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, *regmap = info->regmap_pmu; *reg = RK3399_PULL_PMU_OFFSET; - *reg += bank->bank_num * RK3188_PULL_BANK_STRIDE; + *reg += bank->bank_num * RK3399_PULL_BANK_STRIDE; - *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 / RK3399_PULL_PINS_PER_REG) * 4); + *bit = pin_num % RK3399_PULL_PINS_PER_REG; + *bit *= RK3399_PULL_BITS_PER_PIN; } else { *regmap = info->regmap_base; *reg = RK3399_PULL_GRF_OFFSET; /* correct the offset, as we're starting with the 3rd bank */ *reg -= 0x20; - *reg += bank->bank_num * RK3188_PULL_BANK_STRIDE; - *reg += ((pin_num / RK3188_PULL_PINS_PER_REG) * 4); + *reg += bank->bank_num * RK3399_PULL_BANK_STRIDE; + *reg += ((pin_num / RK3399_PULL_PINS_PER_REG) * 4); - *bit = (pin_num % RK3188_PULL_PINS_PER_REG); - *bit *= RK3188_PULL_BITS_PER_PIN; + *bit = (pin_num % RK3399_PULL_PINS_PER_REG); + *bit *= RK3399_PULL_BITS_PER_PIN; } } -- 2.17.1