linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] Support more devices on rockchip rv1108
@ 2017-07-31 10:04 Andy Yan
  2017-07-31 10:10 ` [PATCH 03/14] pinctrl: rockchip: add input schmitt support for rv1108 Andy Yan
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Yan @ 2017-07-31 10:04 UTC (permalink / raw)
  To: heiko
  Cc: devicetree, linus.walleij, mturquette, linux-gpio, sboyd, broonie,
	linux-clk, linux-kernel, wsa, linux-rockchip, robh+dt, linux-i2c,
	shawn.lin, linux-spi, zhangqing, linux-arm-kernel, Andy Yan


This series try to support i2c/spi/pwm/saradc/pmic/watchdog and
the full clk tree on rockchip rv1108 soc.


Andy Yan (12):
  pinctrl: rockchip: add input schmitt support for rv1108
  dt-bindings: i2c: rk3x: add support for rv1108
  i2c: rk3x: add support for rv1108
  ARM: dts: rockchip: add i2c dt node for rv1108
  spi: rockchip: add compatible string for rv1108 spi
  ARM: dts: rockchip: add spi dt node for rv1108
  ARM: dts: rockchip: add pwm dt node for rv1108
  ARM: dts: rockchip: add watchdog dt node for rv1108
  ARM: dts: rockchip: add saradc support for rv1108
  ARM: dts: rockchip: add pwm backlight for rv1108 evb
  ARM: dts: rockchip: add pmic rk805 dt node for rv1108 evb
  ARM: dts: rockchip: add accelerometer bma250e dt node for rv1108 evb

Elaine Zhang (2):
  clk: rockchip: add more clk ids for rv1108
  clk: rockchip: support more clks for rv1108

 Documentation/devicetree/bindings/i2c/i2c-rk3x.txt |   1 +
 .../devicetree/bindings/spi/spi-rockchip.txt       |   1 +
 arch/arm/boot/dts/rv1108-evb.dts                   | 158 +++++++
 arch/arm/boot/dts/rv1108.dtsi                      | 249 ++++++++++
 drivers/clk/rockchip/clk-rv1108.c                  | 513 ++++++++++++++++-----
 drivers/i2c/busses/i2c-rk3x.c                      |   9 +
 drivers/pinctrl/pinctrl-rockchip.c                 |  31 ++
 drivers/spi/spi-rockchip.c                         |   1 +
 include/dt-bindings/clock/rv1108-cru.h             | 128 ++++-
 9 files changed, 964 insertions(+), 127 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 03/14] pinctrl: rockchip: add input schmitt support for rv1108
  2017-07-31 10:04 [PATCH 00/14] Support more devices on rockchip rv1108 Andy Yan
@ 2017-07-31 10:10 ` Andy Yan
  2017-07-31 11:26   ` Heiko Stübner
       [not found]   ` <1501495822-21503-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Yan @ 2017-07-31 10:10 UTC (permalink / raw)
  To: heiko, linus.walleij
  Cc: devicetree, linux-clk, linux-kernel, linux-rockchip, linux-gpio,
	Andy Yan

Some pins like i2c SCL/SDA need the schmitt input function
to avoid crosstalk problems.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
---

 drivers/pinctrl/pinctrl-rockchip.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index e831647..868cb9c 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -1084,6 +1084,36 @@ static void rv1108_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank,
 	*bit *= RV1108_DRV_BITS_PER_PIN;
 }
 
+#define RV1108_SCHMITT_PMU_OFFSET		0x30
+#define RV1108_SCHMITT_GRF_OFFSET		0x388
+#define RV1108_SCHMITT_BANK_STRIDE		8
+#define RV1108_SCHMITT_PINS_PER_GRF_REG		16
+#define RV1108_SCHMITT_PINS_PER_PMU_REG		8
+
+static int rv1108_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank,
+					   int pin_num,
+					   struct regmap **regmap,
+					   int *reg, u8 *bit)
+{
+	struct rockchip_pinctrl *info = bank->drvdata;
+	int pins_per_reg;
+
+	if (bank->bank_num == 0) {
+		*regmap = info->regmap_pmu;
+		*reg = RV1108_SCHMITT_PMU_OFFSET;
+		pins_per_reg = RV1108_SCHMITT_PINS_PER_PMU_REG;
+	} else {
+		*regmap = info->regmap_base;
+		*reg = RV1108_SCHMITT_GRF_OFFSET;
+		pins_per_reg = RV1108_SCHMITT_PINS_PER_GRF_REG;
+		*reg += (bank->bank_num  - 1) * RV1108_SCHMITT_BANK_STRIDE;
+	}
+	*reg += ((pin_num / pins_per_reg) * 4);
+	*bit = pin_num % pins_per_reg;
+
+	return 0;
+}
+
 #define RK2928_PULL_OFFSET		0x118
 #define RK2928_PULL_PINS_PER_REG	16
 #define RK2928_PULL_BANK_STRIDE		8
@@ -3017,6 +3047,7 @@ static struct rockchip_pin_ctrl rv1108_pin_ctrl = {
 	.pmu_mux_offset		= 0x0,
 	.pull_calc_reg		= rv1108_calc_pull_reg_and_bit,
 	.drv_calc_reg		= rv1108_calc_drv_reg_and_bit,
+	.schmitt_calc_reg	= rv1108_calc_schmitt_reg_and_bit,
 };
 
 static struct rockchip_pin_bank rk2928_pin_banks[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 03/14] pinctrl: rockchip: add input schmitt support for rv1108
  2017-07-31 10:10 ` [PATCH 03/14] pinctrl: rockchip: add input schmitt support for rv1108 Andy Yan
@ 2017-07-31 11:26   ` Heiko Stübner
       [not found]   ` <1501495822-21503-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Heiko Stübner @ 2017-07-31 11:26 UTC (permalink / raw)
  To: Andy Yan
  Cc: linus.walleij, devicetree, linux-clk, linux-kernel,
	linux-rockchip, linux-gpio

Am Montag, 31. Juli 2017, 18:10:22 CEST schrieb Andy Yan:
> Some pins like i2c SCL/SDA need the schmitt input function
> to avoid crosstalk problems.
> 
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 03/14] pinctrl: rockchip: add input schmitt support for rv1108
       [not found]   ` <1501495822-21503-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
@ 2017-08-07  8:49     ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2017-08-07  8:49 UTC (permalink / raw)
  To: Andy Yan
  Cc: Heiko Stübner,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-clk,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	open list:ARM/Rockchip SoC...,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Mon, Jul 31, 2017 at 12:10 PM, Andy Yan <andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org> wrote:

> Some pins like i2c SCL/SDA need the schmitt input function
> to avoid crosstalk problems.
>
> Signed-off-by: Andy Yan <andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

Patch applied with Heiko's review tag.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-07  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-31 10:04 [PATCH 00/14] Support more devices on rockchip rv1108 Andy Yan
2017-07-31 10:10 ` [PATCH 03/14] pinctrl: rockchip: add input schmitt support for rv1108 Andy Yan
2017-07-31 11:26   ` Heiko Stübner
     [not found]   ` <1501495822-21503-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-08-07  8:49     ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).