Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1640436ybh; Thu, 16 Jul 2020 18:55:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsqiN1Nj7AXEu1yEsr9OB/D6n3vczDOAZEhH6OhZkCxwHF8Mdm2HEZCVGCjjwwWJF4Rpk1 X-Received: by 2002:a17:906:7005:: with SMTP id n5mr6117282ejj.130.1594950950921; Thu, 16 Jul 2020 18:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594950950; cv=none; d=google.com; s=arc-20160816; b=gvf15VdHVKABUAAbiuOTOR7VgNpHsWrE8qv4Tp0xe9rFBjMuKQ3/wpWYfVCuIsuyC9 iGvG9mqe17a4rWsXzu8nV66L6I1mSvXLLJKYdbAmekMUnoiYBsLxnNrpt0lMUZBFlR9r BO7L8Uvqmiuys+qKgf1j/mxQBOVvkDb5r4iTr+xhG+iFuJYu204SOuOMyISk6H27g8jb OIMosj0x6tdIe4mDBpmVcd9Rm9xctUs4NMMErqVqcQKCRpVmycFA7WK39NfBLkgqDNmi luFqoxYMPucAKy2109s/eOOdaUaYl8R1t4sz+r3Xk9XTJI+/Z9efenEh1amsfvBvv8hX /xzw== 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=utwcSM85KbI0f4yzUJ9b56CA3zKGU8VT3wRja5Jqy5LCUidxBGj4iKkNWZXqq85BES EYB4TZpYKQt6pcuIwm4sKjs1+FCh6OtwWUhokGSiV4Xv/ZqJ+/hVh8bHgWM17yQ+nrT5 7RpsHktUqyG4ZPO6o9q0Xcv/Z7n1PUCE0OiWz9mp9+wgZLbUW9CrKshAQRZxyQvIFpBL C7qEUPprypIpR/WJODlcO0maA8Wkookcg9mgECn6JjTnIG7tMsIfqgN6LdwCgxAYcdcW ISmehxSs4mvaNptGue+vLmgmEjlK56aC2JqZCMlPmuiuHRhn7vGdV+hEy6mAsXF1R2A4 095w== 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 bt9si4133672edb.536.2020.07.16.18.55.28; Thu, 16 Jul 2020 18:55:50 -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 S1726546AbgGQBwu (ORCPT + 99 others); Thu, 16 Jul 2020 21:52:50 -0400 Received: from lucky1.263xmail.com ([211.157.147.132]:34898 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgGQBwu (ORCPT ); Thu, 16 Jul 2020 21:52:50 -0400 Received: from localhost (unknown [192.168.167.69]) by lucky1.263xmail.com (Postfix) with ESMTP id 7396BEC3AB; Fri, 17 Jul 2020 09:52:47 +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 P18496T139713866360576S1594950764823899_; Fri, 17 Jul 2020 09:52:46 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <472f7c30acc06362d3fcfdbc3e8dc8ce> 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:43 +0800 Message-Id: <20200717015243.14149-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