Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1680198ybh; Thu, 16 Jul 2020 20:29:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzF1tklunWiwFNWVqh3CkItEU0U6LLTojstMzLD4RYmCM/cPB18mVe+wMFLC6wo2bdDOAC3 X-Received: by 2002:a17:906:abc9:: with SMTP id kq9mr6849325ejb.493.1594956585060; Thu, 16 Jul 2020 20:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594956585; cv=none; d=google.com; s=arc-20160816; b=IF5pua//F7FtFUyrW2B5jzSnXwKlo664BBNlEfVtHHV2HLX8K0qrpAg12GRfkO62uI 5L/usfMlIwDRa0I/bSng6I9rejoMZb7Am3HLhRdjHPUsp0kNxyLIGQUMYNRmidtsAZsF BONRS9ZDgXrTA8BRhBa0hNVE+dEVwFHfMLsQpEkUw8ZbBfG+Vqdxjeqv1Lp4QRp3TfhR EH+2eLdDZhQsFfGeKV85i5VMvvWvHDL1xC4lQcxDS07qk+Z980tWDjadpuM+N+jlYVlI EDrj8JyOWDiERQJdMYEUQjYUFkmk+PXs7uh/zOZNg2kBs2yrXqKbxlGD6Goe3MWlROFP za5Q== 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=LHMk2OpFk6ciJycc5JJLXbnGiZ7A0KczlBjAer8mC6JGA+NBskhlLdNPcassOuLn4C 45ZbuFwhbN0HbZKsPd0gKscxJxJCAfegonT2aV3YnpAfqdEKkCRxU/C5aaacuk3b6Jxs 9uSVwvvKCd8Fv/5spIVbPeD7p+AbSy717aml29vFoexJRU1ueJo4/S7DgAwHoZ7ZHX49 sxC+tv+TinvSJjpii6i2GsHhRuyttr4tzf55ndsYwSTMEOX7zX9OMoTL8d72Zkw2kJDx ykeETFtt24tYIE33s2oD4991yA+QGEN9EcN6FzcD1GhU8nOCt56A4k1IyBhLqXQ+BtRP Za7A== 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 lx8si4568638ejb.415.2020.07.16.20.29.22; Thu, 16 Jul 2020 20:29:45 -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 S1726907AbgGQD1A (ORCPT + 99 others); Thu, 16 Jul 2020 23:27:00 -0400 Received: from lucky1.263xmail.com ([211.157.147.135]:37638 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726141AbgGQD1A (ORCPT ); Thu, 16 Jul 2020 23:27:00 -0400 Received: from localhost (unknown [192.168.167.235]) by lucky1.263xmail.com (Postfix) with ESMTP id 4E067A16A1; Fri, 17 Jul 2020 11:26:57 +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 P26706T140360686741248S1594956416195231_; Fri, 17 Jul 2020 11:26:57 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <322c868209d0feb0f3e1eff5d8ecd0eb> 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: Add RK3368 definitions to separate from other SoCs Date: Fri, 17 Jul 2020 11:26:54 +0800 Message-Id: <20200717032654.18177-1-jay.xu@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200717032411.17654-1-jay.xu@rock-chips.com> References: <20200717032411.17654-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