1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/root/target/linux/brcm2708/patches-4.14/0247-overlays-Add-sc16is752-i2c-overlay.patch
2018-03-23 21:58:08 +01:00

105 lines
3.4 KiB
Diff

From 5739f6bb7f03d1d0c34333b8f893d1ee3747afda Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 20 Feb 2018 17:32:02 +0000
Subject: [PATCH 247/277] overlays: Add sc16is752-i2c overlay
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
---
arch/arm/boot/dts/overlays/Makefile | 1 +
arch/arm/boot/dts/overlays/README | 15 ++++++--
.../boot/dts/overlays/sc16is752-i2c-overlay.dts | 40 ++++++++++++++++++++++
3 files changed, 53 insertions(+), 3 deletions(-)
create mode 100644 arch/arm/boot/dts/overlays/sc16is752-i2c-overlay.dts
diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile
index fd5698cb4092..b543b2f478ab 100644
--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -100,6 +100,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
rpi-tv.dtbo \
rra-digidac1-wm8741-audio.dtbo \
sc16is750-i2c.dtbo \
+ sc16is752-i2c.dtbo \
sc16is752-spi1.dtbo \
sdhost.dtbo \
sdio.dtbo \
diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README
index 5d5167169d43..4c3047a324cc 100644
--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -1447,14 +1447,23 @@ Params: <None>
Name: sc16is750-i2c
Info: Overlay for the NXP SC16IS750 UART with I2C Interface
- Enables the chip on I2C1 at 0x48. To select another address,
- please refer to table 10 in reference manual.
-
+ Enables the chip on I2C1 at 0x48 (or the "addr" parameter value). To
+ select another address, please refer to table 10 in reference manual.
Load: dtoverlay=sc16is750-i2c,<param>=<val>
Params: int_pin GPIO used for IRQ (default 24)
addr Address (default 0x48)
+Name: sc16is752-i2c
+Info: Overlay for the NXP SC16IS752 dual UART with I2C Interface
+ Enables the chip on I2C1 at 0x48 (or the "addr" parameter value). To
+ select another address, please refer to table 10 in reference manual.
+Load: dtoverlay=sc16is752-i2c,<param>=<val>
+Params: int_pin GPIO used for IRQ (default 24)
+ addr Address (default 0x48)
+ xtal On-board crystal frequency (default 14745600)
+
+
Name: sc16is752-spi1
Info: Overlay for the NXP SC16IS752 Dual UART with SPI Interface
Enables the chip on SPI1.
diff --git a/arch/arm/boot/dts/overlays/sc16is752-i2c-overlay.dts b/arch/arm/boot/dts/overlays/sc16is752-i2c-overlay.dts
new file mode 100644
index 000000000000..e43e81d5a28f
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/sc16is752-i2c-overlay.dts
@@ -0,0 +1,40 @@
+/dts-v1/;
+/plugin/;
+
+/ {
+ compatible = "brcm,bcm2835";
+
+ fragment@0 {
+ target = <&i2c1>;
+
+ frag1: __overlay__ {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ sc16is752: sc16is752@48 {
+ compatible = "nxp,sc16is752";
+ reg = <0x48>; // i2c address
+ clocks = <&sc16is752_clk>;
+ interrupt-parent = <&gpio>;
+ interrupts = <24 0x2>; /* IRQ_TYPE_EDGE_FALLING */
+ gpio-controller;
+ #gpio-cells = <0>;
+ i2c-max-frequency = <400000>;
+ status = "okay";
+
+ sc16is752_clk: sc16is752_clk {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <14745600>;
+ };
+ };
+ };
+ };
+
+ __overrides__ {
+ int_pin = <&sc16is752>,"interrupts:0";
+ addr = <&sc16is752>,"reg:0";
+ xtal = <&sc16is752>,"clock-frequency:0";
+ };
+};
--
2.16.1