build/patch/kernel/archive/odroidxu4-5.15/0020-ODROID-XU4-Add-support-for-SPI1-on-the-40-pin-header.patch

64 lines
1.8 KiB
Diff

From 9349f2329d3072932c9069474fbc8fbbda5a5bc4 Mon Sep 17 00:00:00 2001
From: Yang Deokgyu <secugyu@gmail.com>
Date: Thu, 14 Nov 2019 13:45:22 +0900
Subject: [PATCH 20/75] ODROID-XU4: Add support for SPI1 on the 40 pin header
Signed-off-by: Yang Deokgyu <secugyu@gmail.com>
Change-Id: I0b1d16b0f445838509eeb0cc8093239fa1805605
---
arch/arm/boot/dts/exynos5422-odroidxu4.dts | 20 ++++++++++++++++++++
drivers/spi/spidev.c | 2 ++
2 files changed, 22 insertions(+)
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu4.dts b/arch/arm/boot/dts/exynos5422-odroidxu4.dts
index 499c338fdd6e..91716b1e33b6 100644
--- a/arch/arm/boot/dts/exynos5422-odroidxu4.dts
+++ b/arch/arm/boot/dts/exynos5422-odroidxu4.dts
@@ -11,6 +11,7 @@
/dts-v1/;
#include <dt-bindings/sound/samsung-i2s.h>
#include "exynos5422-odroidxu3-common.dtsi"
+#include <dt-bindings/gpio/gpio.h>
/ {
model = "Hardkernel Odroid XU4";
@@ -103,3 +104,22 @@ &hsi2c_5 {
samsung,hs-mode;
clock-frequency = <400000>;
};
+
+&spi_1 {
+ status = "okay";
+ samsung,spi-src-clk = <0>;
+ num-cs = <2>;
+ cs-gpios = <&gpa2 5 GPIO_ACTIVE_HIGH>, <&gpx2 1 GPIO_ACTIVE_HIGH>;
+
+ spidev: spidev@0 {
+ status = "okay";
+ reg = <0>;
+ compatible = "odroid,spidev";
+ spi-max-frequency = <1000000>;
+
+ controller-data {
+ cs-gpio = <&gpa2 5 GPIO_ACTIVE_HIGH>;
+ samsung,spi-feedback-delay = <0>;
+ };
+ };
+};
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 1bd73e322b7b..494d2a56d02c 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -696,6 +696,8 @@ static const struct of_device_id spidev_dt_ids[] = {
{ .compatible = "menlo,m53cpld" },
{ .compatible = "cisco,spi-petra" },
{ .compatible = "micron,spi-authenta" },
+ /* ODROID Modification */
+ { .compatible = "odroid,spidev" },
{},
};
MODULE_DEVICE_TABLE(of, spidev_dt_ids);
--
2.25.1