Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1640846ybh; Thu, 16 Jul 2020 18:57:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYvVTVq1R4CU6Qc1sH89Jato4nZo2h/H0yv3fNWCfujdr3RcmSNH/nswm1IZwcyQvncpdR X-Received: by 2002:aa7:d446:: with SMTP id q6mr7160313edr.218.1594951023236; Thu, 16 Jul 2020 18:57:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594951023; cv=none; d=google.com; s=arc-20160816; b=Rb/sTzLEzqpbLAvcOk24zpqAQVuYA5Qa9MlSKVOOlnnDI+8mTTJ1C8BP5pwhruHJTU KTpPLJBvc/mwvybggjbF9+tNUU31yKBNFpKhvxyxrGkVwuqJwuIOHH8CzkkiLSar/9Lo d00HNL5+V2zRGolx4BXvSGEatmJSE3DvcldEHF0/oYMsi/fDDmARUq8j6+mvJBOp2Ly0 +hy+y8NhZ3ZydN2Tg8Y8f60BTMM680jEgMJd/0kTwc1bCC0pjlwhJFqze+0q3y9dyh/g w/H7UmaJGGSvhbbV6eW8U6HvGAACrV5rkEpq+gIyePqUBSfiS6jF+REfWJiSQtUqy2Zl GB7w== 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=Hw+tLMLR9yoXf7xSdUVP0qveVEi7ELe1wtab7RXfbuk=; b=SdBkIx3Mq1eYUTqpvMpF70p4Fi40RgygIpHEZeTKMtrTLfSiMCoIF/nLQgtgD7G2sA cBzGV9Zu+gd8IH7hNEiSKCEZIGDsL7yF/Jo7ieprusBB7brUHiPzBdIippcNPk/PjHr4 UU4StvAsjsXNqyc5HrzZNZJLcxhL4bN37t/Z/GzQ8/rZGhx7G+hdYt2z531RoXTQTZD9 4S/hpiDGMIrA/LcBY1aXUfDk5QTBXi7RAa6CrJvg+KLNEjcjVl07HIZIISnKWsFzZbhs lWIjtfp+jE84irtiVWa4SRuY3EAZ34Cr5KURzhNdLy1YFsw7WMAiccl+rdjc0aMglws5 OrMw== 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 f16si4216746ejb.557.2020.07.16.18.56.40; Thu, 16 Jul 2020 18:57:03 -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 S1726890AbgGQBxi (ORCPT + 99 others); Thu, 16 Jul 2020 21:53:38 -0400 Received: from lucky1.263xmail.com ([211.157.147.130]:43028 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726231AbgGQBxh (ORCPT ); Thu, 16 Jul 2020 21:53:37 -0400 Received: from localhost (unknown [192.168.167.13]) by lucky1.263xmail.com (Postfix) with ESMTP id C8F58CA817; Fri, 17 Jul 2020 09:53:34 +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 P17843T139820223420160S1594950813542175_; Fri, 17 Jul 2020 09:53:34 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <2cd34631c355ac32b25d606a1e33602c> 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 10/13] pinctrl: rockchip: do codingstyle Date: Fri, 17 Jul 2020 09:53:32 +0800 Message-Id: <20200717015332.14383-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 RK3288 definitons to separate from other SoCs. Signed-off-by: Jianqun Xu --- drivers/pinctrl/pinctrl-rockchip.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index ec6a1a08f8b1..04e7027ec8e1 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -1855,6 +1855,11 @@ static void rk3188_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, } #define RK3288_PULL_OFFSET 0x140 +#define RK3288_PULL_PMU_OFFSET 0x64 +#define RK3288_PULL_BITS_PER_PIN 2 +#define RK3288_PULL_PINS_PER_REG 8 +#define RK3288_PULL_BANK_STRIDE 16 + static void rk3288_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, int pin_num, struct regmap **regmap, int *reg, u8 *bit) @@ -1864,22 +1869,22 @@ static void rk3288_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, /* The first 24 pins of the first bank are located in PMU */ if (bank->bank_num == 0) { *regmap = info->regmap_pmu; - *reg = RK3188_PULL_PMU_OFFSET; + *reg = RK3288_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 / RK3288_PULL_PINS_PER_REG) * 4); + *bit = pin_num % RK3288_PULL_PINS_PER_REG; + *bit *= RK3288_PULL_BITS_PER_PIN; } else { *regmap = info->regmap_base; *reg = RK3288_PULL_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 * RK3288_PULL_BANK_STRIDE; + *reg += ((pin_num / RK3288_PULL_PINS_PER_REG) * 4); - *bit = (pin_num % RK3188_PULL_PINS_PER_REG); - *bit *= RK3188_PULL_BITS_PER_PIN; + *bit = (pin_num % RK3288_PULL_PINS_PER_REG); + *bit *= RK3288_PULL_BITS_PER_PIN; } } -- 2.17.1