Merge branch 'master' of https://github.com/armbian/build
This commit is contained in:
commit
e05419b6e5
@ -11,7 +11,7 @@ KERNEL_TARGET="next,dev"
|
||||
CLI_TARGET=""
|
||||
DESKTOP_TARGET=""
|
||||
|
||||
CLI_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="xenial:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
#
|
||||
RECOMMENDED="Ubuntu_xenial_dev_nightly:33,Ubuntu_xenial_dev_desktop_nightly:33"
|
||||
|
||||
@ -3261,6 +3261,7 @@ CONFIG_REGULATOR_PWM=m
|
||||
# CONFIG_REGULATOR_TPS6524X is not set
|
||||
CONFIG_REGULATOR_VCTRL=m
|
||||
CONFIG_CEC_CORE=m
|
||||
CONFIG_CEC_NOTIFIER=y
|
||||
CONFIG_MEDIA_SUPPORT=y
|
||||
|
||||
#
|
||||
@ -3272,7 +3273,7 @@ CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
|
||||
CONFIG_MEDIA_RADIO_SUPPORT=y
|
||||
CONFIG_MEDIA_SDR_SUPPORT=y
|
||||
CONFIG_MEDIA_RC_SUPPORT=y
|
||||
# CONFIG_MEDIA_CEC_SUPPORT is not set
|
||||
CONFIG_MEDIA_CEC_SUPPORT=y
|
||||
CONFIG_MEDIA_CEC_RC=y
|
||||
CONFIG_MEDIA_CONTROLLER=y
|
||||
# CONFIG_MEDIA_CONTROLLER_DVB is not set
|
||||
@ -3489,10 +3490,17 @@ CONFIG_VIDEO_EM28XX_RC=m
|
||||
CONFIG_USB_AIRSPY=m
|
||||
CONFIG_USB_HACKRF=m
|
||||
CONFIG_USB_MSI2500=m
|
||||
|
||||
#
|
||||
# USB HDMI CEC adapters
|
||||
#
|
||||
# CONFIG_USB_PULSE8_CEC is not set
|
||||
# CONFIG_USB_RAINSHADOW_CEC is not set
|
||||
# CONFIG_V4L_PLATFORM_DRIVERS is not set
|
||||
# CONFIG_V4L_MEM2MEM_DRIVERS is not set
|
||||
# CONFIG_V4L_TEST_DRIVERS is not set
|
||||
# CONFIG_DVB_PLATFORM_DRIVERS is not set
|
||||
# CONFIG_CEC_PLATFORM_DRIVERS is not set
|
||||
# CONFIG_SDR_PLATFORM_DRIVERS is not set
|
||||
|
||||
#
|
||||
@ -3914,7 +3922,7 @@ CONFIG_DRM_KMS_CMA_HELPER=y
|
||||
#
|
||||
# ACP (Audio CoProcessor) Configuration
|
||||
#
|
||||
# CONFIG_DRM_VGEM is not set
|
||||
CONFIG_DRM_VGEM=m
|
||||
# CONFIG_DRM_EXYNOS is not set
|
||||
# CONFIG_DRM_UDL is not set
|
||||
# CONFIG_DRM_ARMADA is not set
|
||||
@ -3959,6 +3967,7 @@ CONFIG_DRM_DUMB_VGA_DAC=m
|
||||
CONFIG_DRM_DW_HDMI=m
|
||||
CONFIG_DRM_DW_HDMI_AHB_AUDIO=m
|
||||
CONFIG_DRM_DW_HDMI_I2S_AUDIO=m
|
||||
CONFIG_DRM_DW_HDMI_CEC=m
|
||||
# CONFIG_DRM_STI is not set
|
||||
# CONFIG_DRM_ARCPGU is not set
|
||||
# CONFIG_DRM_MXSFB is not set
|
||||
|
||||
@ -4265,7 +4265,7 @@ CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
# CONFIG_FSL_ERRATUM_A008585 is not set
|
||||
CONFIG_FSL_ERRATUM_A008585=y
|
||||
# CONFIG_HISILICON_ERRATUM_161010101 is not set
|
||||
# CONFIG_ARM64_ERRATUM_858921 is not set
|
||||
# CONFIG_ARM_TIMER_SP804 is not set
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# Linux/arm64 4.13.2 Kernel Configuration
|
||||
# Linux/arm64 4.13.4 Kernel Configuration
|
||||
#
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_64BIT=y
|
||||
@ -1422,7 +1422,7 @@ CONFIG_DMA_CMA=y
|
||||
#
|
||||
# Default contiguous memory area size:
|
||||
#
|
||||
CONFIG_CMA_SIZE_MBYTES=16
|
||||
CONFIG_CMA_SIZE_MBYTES=128
|
||||
CONFIG_CMA_SIZE_SEL_MBYTES=y
|
||||
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
|
||||
# CONFIG_CMA_SIZE_SEL_MIN is not set
|
||||
@ -1918,6 +1918,7 @@ CONFIG_USB_VL600=m
|
||||
CONFIG_USB_NET_CH9200=m
|
||||
CONFIG_WLAN=y
|
||||
# CONFIG_WLAN_VENDOR_ADMTEK is not set
|
||||
# CONFIG_WLAN_VENDOR_XRADIO is not set
|
||||
CONFIG_ATH_COMMON=m
|
||||
CONFIG_WLAN_VENDOR_ATH=y
|
||||
# CONFIG_ATH_DEBUG is not set
|
||||
@ -2007,6 +2008,8 @@ CONFIG_RTL8XXXU_UNTESTED=y
|
||||
# CONFIG_WLAN_VENDOR_TI is not set
|
||||
# CONFIG_WLAN_VENDOR_ZYDAS is not set
|
||||
CONFIG_WLAN_VENDOR_QUANTENNA=y
|
||||
CONFIG_RTL8723DU=m
|
||||
CONFIG_RTL8812AU=m
|
||||
# CONFIG_MAC80211_HWSIM is not set
|
||||
CONFIG_USB_NET_RNDIS_WLAN=m
|
||||
|
||||
@ -2927,6 +2930,8 @@ CONFIG_REGULATOR_S2MPS11=y
|
||||
# CONFIG_REGULATOR_TPS65132 is not set
|
||||
# CONFIG_REGULATOR_TPS6524X is not set
|
||||
# CONFIG_REGULATOR_VCTRL is not set
|
||||
CONFIG_CEC_CORE=m
|
||||
CONFIG_CEC_NOTIFIER=y
|
||||
CONFIG_MEDIA_SUPPORT=m
|
||||
|
||||
#
|
||||
@ -2938,7 +2943,8 @@ CONFIG_MEDIA_CAMERA_SUPPORT=y
|
||||
# CONFIG_MEDIA_RADIO_SUPPORT is not set
|
||||
# CONFIG_MEDIA_SDR_SUPPORT is not set
|
||||
CONFIG_MEDIA_RC_SUPPORT=y
|
||||
# CONFIG_MEDIA_CEC_SUPPORT is not set
|
||||
CONFIG_MEDIA_CEC_SUPPORT=y
|
||||
CONFIG_MEDIA_CEC_RC=y
|
||||
# CONFIG_MEDIA_CONTROLLER is not set
|
||||
CONFIG_VIDEO_DEV=m
|
||||
CONFIG_VIDEO_V4L2=m
|
||||
@ -3059,10 +3065,17 @@ CONFIG_VIDEO_EM28XX=m
|
||||
CONFIG_VIDEO_EM28XX_V4L2=m
|
||||
CONFIG_VIDEO_EM28XX_ALSA=m
|
||||
CONFIG_VIDEO_EM28XX_RC=m
|
||||
|
||||
#
|
||||
# USB HDMI CEC adapters
|
||||
#
|
||||
# CONFIG_USB_PULSE8_CEC is not set
|
||||
# CONFIG_USB_RAINSHADOW_CEC is not set
|
||||
CONFIG_V4L_PLATFORM_DRIVERS=y
|
||||
# CONFIG_SOC_CAMERA is not set
|
||||
# CONFIG_V4L_MEM2MEM_DRIVERS is not set
|
||||
# CONFIG_V4L_TEST_DRIVERS is not set
|
||||
# CONFIG_CEC_PLATFORM_DRIVERS is not set
|
||||
|
||||
#
|
||||
# Supported MMC/SDIO adapters
|
||||
@ -3144,6 +3157,8 @@ CONFIG_DRM_KMS_FB_HELPER=y
|
||||
CONFIG_DRM_FBDEV_EMULATION=y
|
||||
CONFIG_DRM_FBDEV_OVERALLOC=100
|
||||
CONFIG_DRM_LOAD_EDID_FIRMWARE=y
|
||||
CONFIG_DRM_GEM_CMA_HELPER=y
|
||||
CONFIG_DRM_KMS_CMA_HELPER=y
|
||||
|
||||
#
|
||||
# I2C encoder or helper chips
|
||||
@ -3157,9 +3172,14 @@ CONFIG_DRM_LOAD_EDID_FIRMWARE=y
|
||||
#
|
||||
# ACP (Audio CoProcessor) Configuration
|
||||
#
|
||||
# CONFIG_DRM_VGEM is not set
|
||||
CONFIG_DRM_VGEM=m
|
||||
# CONFIG_DRM_UDL is not set
|
||||
# CONFIG_DRM_RCAR_DW_HDMI is not set
|
||||
CONFIG_DRM_SUN4I=m
|
||||
CONFIG_DRM_SUN4I_HDMI=m
|
||||
CONFIG_DRM_SUN4I_BACKEND=m
|
||||
CONFIG_DRM_SUN8I_DW_HDMI=m
|
||||
CONFIG_DRM_SUN8I_MIXER=m
|
||||
# CONFIG_DRM_VIRTIO_GPU is not set
|
||||
CONFIG_DRM_PANEL=y
|
||||
|
||||
@ -3189,6 +3209,10 @@ CONFIG_DRM_ANALOGIX_ANX78XX=m
|
||||
# CONFIG_DRM_TOSHIBA_TC358767 is not set
|
||||
# CONFIG_DRM_TI_TFP410 is not set
|
||||
# CONFIG_DRM_I2C_ADV7511 is not set
|
||||
CONFIG_DRM_DW_HDMI=m
|
||||
CONFIG_DRM_DW_HDMI_AHB_AUDIO=m
|
||||
CONFIG_DRM_DW_HDMI_I2S_AUDIO=m
|
||||
CONFIG_DRM_DW_HDMI_CEC=m
|
||||
# CONFIG_DRM_ARCPGU is not set
|
||||
# CONFIG_DRM_HISI_KIRIN is not set
|
||||
# CONFIG_DRM_MXSFB is not set
|
||||
@ -3285,6 +3309,8 @@ CONFIG_SOUND=y
|
||||
CONFIG_SND=y
|
||||
CONFIG_SND_TIMER=m
|
||||
CONFIG_SND_PCM=m
|
||||
CONFIG_SND_PCM_ELD=y
|
||||
CONFIG_SND_PCM_IEC958=y
|
||||
CONFIG_SND_DMAENGINE_PCM=m
|
||||
CONFIG_SND_HWDEP=m
|
||||
CONFIG_SND_SEQ_DEVICE=m
|
||||
@ -3399,6 +3425,7 @@ CONFIG_SND_SOC_I2C_AND_SPI=m
|
||||
# CONFIG_SND_SOC_CS4349 is not set
|
||||
# CONFIG_SND_SOC_CS53L30 is not set
|
||||
# CONFIG_SND_SOC_DIO2125 is not set
|
||||
CONFIG_SND_SOC_HDMI_CODEC=m
|
||||
# CONFIG_SND_SOC_ES7134 is not set
|
||||
# CONFIG_SND_SOC_ES8316 is not set
|
||||
# CONFIG_SND_SOC_ES8328_I2C is not set
|
||||
@ -4249,7 +4276,7 @@ CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
# CONFIG_FSL_ERRATUM_A008585 is not set
|
||||
CONFIG_FSL_ERRATUM_A008585=y
|
||||
# CONFIG_HISILICON_ERRATUM_161010101 is not set
|
||||
# CONFIG_ARM64_ERRATUM_858921 is not set
|
||||
# CONFIG_ARM_TIMER_SP804 is not set
|
||||
|
||||
@ -58,4 +58,10 @@ family_tweaks_bsp()
|
||||
{
|
||||
install -m 755 $SRC/packages/bsp/odroid/c2_init.sh $destination/usr/lib/armbian/c2_init.sh
|
||||
cp $SRC/packages/bsp/odroid/odroid-c2-hdmi.service $destination/lib/systemd/system/
|
||||
if [[ $BRANCH != default ]]; then
|
||||
mkdir -p $destination/etc/udev/rules.d
|
||||
mkdir -p $destination/usr/local/bin
|
||||
cp $SRC/packages/bsp/rockchip/hdmi.rules $destination/etc/udev/rules.d
|
||||
install -m 755 $SRC/packages/bsp/rockchip/hdmi-hotplug $destination/usr/local/bin
|
||||
fi
|
||||
}
|
||||
|
||||
@ -57,3 +57,13 @@ family_tweaks()
|
||||
echo "fdt_file=rk3288-miniarm.dtb" >> $SDCARD/boot/armbianEnv.txt
|
||||
fi
|
||||
}
|
||||
|
||||
family_tweaks_bsp()
|
||||
{
|
||||
if [[ $BRANCH != default ]]; then
|
||||
mkdir -p $destination/etc/udev/rules.d
|
||||
mkdir -p $destination/usr/local/bin
|
||||
cp $SRC/packages/bsp/rockchip/hdmi.rules $destination/etc/udev/rules.d
|
||||
install -m 755 $SRC/packages/bsp/rockchip/hdmi-hotplug $destination/usr/local/bin
|
||||
fi
|
||||
}
|
||||
|
||||
15
packages/bsp/rockchip/hdmi-hotplug
Normal file
15
packages/bsp/rockchip/hdmi-hotplug
Normal file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
USER="$(who | grep :0\) | cut -f 1 -d ' ')"
|
||||
export XAUTHORITY=/home/$USER/.Xauthority
|
||||
export DISPLAY=:0
|
||||
HDMI_STATUS="$(cat /sys/class/drm/card0-HDMI-A-1/status)"
|
||||
|
||||
# Check to see if HDMI connected or not and toggle if change
|
||||
if [ "${HDMI_STATUS}" = connected ]; then
|
||||
xrandr
|
||||
xrandr --output HDMI-1 --auto
|
||||
else
|
||||
xrandr --output HDMI-1 --off
|
||||
fi
|
||||
|
||||
exit 0
|
||||
1
packages/bsp/rockchip/hdmi.rules
Normal file
1
packages/bsp/rockchip/hdmi.rules
Normal file
@ -0,0 +1 @@
|
||||
SUBSYSTEM=="drm", ACTION=="change", RUN+="/usr/local/bin/hdmi-hotplug"
|
||||
@ -1,32 +1,20 @@
|
||||
From ef9ca67d03cd6b18c03f69cd0141d63a672bc330 Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.io>
|
||||
Date: Tue, 1 Aug 2017 21:12:58 +0800
|
||||
Subject: [PATCH] ARM: sun8i: h3: add display engine pipeline barebone
|
||||
|
||||
As we have already the support for the DE2 on Allwinner H3, add the
|
||||
display engine pipeline device tree nodes to its DTSI file.
|
||||
|
||||
The H5 pipeline has some differences and will be enabled later.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
---
|
||||
arch/arm/boot/dts/sun8i-h3.dtsi | 170 ++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 170 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
index b36f9f423c39d..75ad7b65a7fcd 100644
|
||||
--- a/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
+++ b/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
@@ -41,6 +41,8 @@
|
||||
diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
|
||||
index 11240a83..ccde3a00 100644
|
||||
--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
|
||||
+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
|
||||
@@ -40,9 +40,11 @@
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "sunxi-h3-h5.dtsi"
|
||||
+#include <dt-bindings/clock/sun8i-de2.h>
|
||||
#include <dt-bindings/clock/sun8i-h3-ccu.h>
|
||||
#include <dt-bindings/clock/sun8i-r-ccu.h>
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
+#include <dt-bindings/reset/sun8i-de2.h>
|
||||
#include <dt-bindings/reset/sun8i-h3-ccu.h>
|
||||
#include <dt-bindings/reset/sun8i-r-ccu.h>
|
||||
|
||||
/ {
|
||||
cpus {
|
||||
@@ -72,6 +74,174 @@
|
||||
@@ -79,12 +81,98 @@
|
||||
};
|
||||
};
|
||||
|
||||
@ -37,9 +25,14 @@ index b36f9f423c39d..75ad7b65a7fcd 100644
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
+ soc {
|
||||
soc {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
|
||||
+ display_clocks: clock@1000000 {
|
||||
+ compatible = "allwinner,sun8i-a83t-de2-clk";
|
||||
+ /* compatible is in per SoC .dtsi file */
|
||||
+ reg = <0x01000000 0x100000>;
|
||||
+ clocks = <&ccu CLK_BUS_DE>,
|
||||
+ <&ccu CLK_DE>;
|
||||
@ -92,7 +85,7 @@ index b36f9f423c39d..75ad7b65a7fcd 100644
|
||||
+ <&display_clocks CLK_MIXER1>;
|
||||
+ clock-names = "bus",
|
||||
+ "mod";
|
||||
+ resets = <&display_clocks RST_WB>;
|
||||
+ /* resets is in per SoC .dtsi file */
|
||||
+ status = "disabled";
|
||||
+
|
||||
+ ports {
|
||||
@ -117,6 +110,13 @@ index b36f9f423c39d..75ad7b65a7fcd 100644
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
syscon: syscon@1c00000 {
|
||||
compatible = "allwinner,sun8i-h3-system-controller",
|
||||
"syscon";
|
||||
@@ -100,6 +188,86 @@
|
||||
#dma-cells = <1>;
|
||||
};
|
||||
|
||||
+ tcon0: lcd-controller@1c0c000 {
|
||||
+ compatible = "allwinner,sun8i-h3-tcon";
|
||||
+ reg = <0x01c0c000 0x1000>;
|
||||
@ -196,8 +196,7 @@ index b36f9f423c39d..75ad7b65a7fcd 100644
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
timer {
|
||||
compatible = "arm,armv7-timer";
|
||||
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
|
||||
mmc0: mmc@01c0f000 {
|
||||
/* compatible and clocks are in per SoC .dtsi file */
|
||||
reg = <0x01c0f000 0x1000>;
|
||||
19
patch/kernel/sunxi-next/07-2-add-H3-DE2-DT-nodes.patch
Normal file
19
patch/kernel/sunxi-next/07-2-add-H3-DE2-DT-nodes.patch
Normal file
@ -0,0 +1,19 @@
|
||||
diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
index b36f9f42..b2896427 100644
|
||||
--- a/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
+++ b/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
@@ -85,6 +85,14 @@
|
||||
compatible = "allwinner,sun8i-h3-ccu";
|
||||
};
|
||||
|
||||
+&display_clocks {
|
||||
+ compatible = "allwinner,sun8i-a83t-de2-clk";
|
||||
+};
|
||||
+
|
||||
+&mixer1 {
|
||||
+ resets = <&display_clocks RST_WB>;
|
||||
+};
|
||||
+
|
||||
&mmc0 {
|
||||
compatible = "allwinner,sun7i-a20-mmc";
|
||||
clocks = <&ccu CLK_BUS_MMC0>,
|
||||
32
patch/kernel/sunxi-next/07-3-add-H5-DE2-DT-nodes.patch
Normal file
32
patch/kernel/sunxi-next/07-3-add-H5-DE2-DT-nodes.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From d2259cb25f16b469b558d3b8d652862a7c5ddef5 Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.io>
|
||||
Date: Tue, 15 Aug 2017 21:35:39 +0800
|
||||
Subject: [PATCH] arm64: allwinner: h5: support display pipelines
|
||||
|
||||
As we have extracted the display pipelines to the H3/H5 common DTSI, we
|
||||
can now support the display pipelines on H5.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
---
|
||||
arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
|
||||
index d9a720bff05d3..305f7a28ba03c 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
|
||||
@@ -98,6 +98,14 @@
|
||||
compatible = "allwinner,sun50i-h5-ccu";
|
||||
};
|
||||
|
||||
+&display_clocks {
|
||||
+ compatible = "allwinner,sun50i-h5-de2-clk";
|
||||
+};
|
||||
+
|
||||
+&mixer1 {
|
||||
+ resets = <&display_clocks RST_MIXER1>;
|
||||
+};
|
||||
+
|
||||
&mmc0 {
|
||||
compatible = "allwinner,sun50i-h5-mmc",
|
||||
"allwinner,sun50i-a64-mmc";
|
||||
@ -0,0 +1,25 @@
|
||||
From 6f873f5d2d72a9a9779f0c26fc756ef5528ee2aa Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.io>
|
||||
Date: Sat, 6 May 2017 16:03:20 +0800
|
||||
Subject: [PATCH] drm/sun4i: allow to build for arm64
|
||||
|
||||
As the sun4i-drm driver already gained support for some AArch64-capable
|
||||
Allwinner SoCs, allow it to be built on arm64 platform.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
---
|
||||
drivers/gpu/drm/sun4i/Kconfig | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/sun4i/Kconfig b/drivers/gpu/drm/sun4i/Kconfig
|
||||
index 6f860ece37754..369a31f834390 100644
|
||||
--- a/drivers/gpu/drm/sun4i/Kconfig
|
||||
+++ b/drivers/gpu/drm/sun4i/Kconfig
|
||||
@@ -1,6 +1,6 @@
|
||||
config DRM_SUN4I
|
||||
tristate "DRM Support for Allwinner A10 Display Engine"
|
||||
- depends on DRM && ARM && COMMON_CLK
|
||||
+ depends on DRM && (ARM || ARM64) && COMMON_CLK
|
||||
depends on ARCH_SUNXI || COMPILE_TEST
|
||||
select DRM_GEM_CMA_HELPER
|
||||
select DRM_KMS_HELPER
|
||||
@ -1,24 +1,8 @@
|
||||
From dac5aed0eb680ea0c3de541a3bc06398b52ba5fa Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.io>
|
||||
Date: Tue, 1 Aug 2017 21:13:03 +0800
|
||||
Subject: [PATCH] ARM: sun8i: h3: Add DesignWare HDMI controller node
|
||||
|
||||
The H3 SoC has a DesignWare HDMI controller with some Allwinner-specific
|
||||
glue.
|
||||
|
||||
Add the related device nodes.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
---
|
||||
arch/arm/boot/dts/sun8i-h3.dtsi | 41 +++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 41 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
index 75ad7b65a7fcd..e0fbab75aca10 100644
|
||||
--- a/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
+++ b/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
@@ -97,6 +97,42 @@
|
||||
diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
|
||||
index ccde3a00..44ae22a9 100644
|
||||
--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
|
||||
+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
|
||||
@@ -109,6 +109,42 @@
|
||||
assigned-clock-rates = <432000000>;
|
||||
};
|
||||
|
||||
@ -61,7 +45,7 @@ index 75ad7b65a7fcd..e0fbab75aca10 100644
|
||||
mixer0: mixer@1100000 {
|
||||
compatible = "allwinner,sun8i-h3-de2-mixer0";
|
||||
reg = <0x01100000 0x100000>;
|
||||
@@ -197,6 +233,11 @@
|
||||
@@ -224,6 +260,11 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <1>;
|
||||
|
||||
@ -1,18 +1,31 @@
|
||||
From 7cb1a6f881abdd1c39ec020d997aa665461f354e Mon Sep 17 00:00:00 2001
|
||||
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
Date: Tue, 5 Sep 2017 22:05:25 +0200
|
||||
Subject: [PATCH] ARM: sun8i: h3: Add nodes for HDMI audio
|
||||
|
||||
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
---
|
||||
arch/arm/boot/dts/sun8i-h3.dtsi | 30 ++++++++++++++++++++++++++++++
|
||||
1 file changed, 30 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
index e0fbab75aca10..a698ab23bec03 100644
|
||||
--- a/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
+++ b/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
@@ -98,6 +98,7 @@
|
||||
diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
|
||||
index 8aa2befc..d3d70eac 100644
|
||||
--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
|
||||
+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
|
||||
@@ -53,6 +53,22 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
+ sound_hdmi: sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,format = "i2s";
|
||||
+ simple-audio-card,name = "allwinner,hdmi";
|
||||
+ simple-audio-card,mclk-fs = <256>;
|
||||
+ status = "disabled";
|
||||
+
|
||||
+ simple-audio-card,codec {
|
||||
+ sound-dai = <&hdmi>;
|
||||
+ };
|
||||
+
|
||||
+ simple-audio-card,cpu {
|
||||
+ sound-dai = <&i2s2>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
clocks {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
@@ -110,6 +126,7 @@
|
||||
};
|
||||
|
||||
hdmi: hdmi@1ee0000 {
|
||||
@ -20,8 +33,8 @@ index e0fbab75aca10..a698ab23bec03 100644
|
||||
compatible = "allwinner,sun8i-h3-dw-hdmi";
|
||||
reg = <0x01ee0000 0x10000>,
|
||||
<0x01ef0000 0x10000>;
|
||||
@@ -133,6 +134,19 @@
|
||||
};
|
||||
@@ -685,6 +702,19 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
+ i2s2: i2s@1c22800 {
|
||||
@ -37,29 +50,6 @@ index e0fbab75aca10..a698ab23bec03 100644
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
mixer0: mixer@1100000 {
|
||||
compatible = "allwinner,sun8i-h3-de2-mixer0";
|
||||
reg = <0x01100000 0x100000>;
|
||||
@@ -197,6 +211,22 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ sound_hdmi: sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,format = "i2s";
|
||||
+ simple-audio-card,name = "allwinner,hdmi";
|
||||
+ simple-audio-card,mclk-fs = <256>;
|
||||
+ status = "disabled";
|
||||
+
|
||||
+ simple-audio-card,codec {
|
||||
+ sound-dai = <&hdmi>;
|
||||
+ };
|
||||
+
|
||||
+ simple-audio-card,cpu {
|
||||
+ sound-dai = <&i2s2>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
tcon0: lcd-controller@1c0c000 {
|
||||
compatible = "allwinner,sun8i-h3-tcon";
|
||||
reg = <0x01c0c000 0x1000>;
|
||||
codec: codec@01c22c00 {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "allwinner,sun8i-h3-codec";
|
||||
|
||||
@ -0,0 +1,126 @@
|
||||
From ffa650ca191b8acbe70bf26b10080ab7c73a6908 Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.io>
|
||||
Date: Sat, 6 May 2017 16:13:47 +0800
|
||||
Subject: [PATCH] arm64: allwinner: h5: enable HDMI output on Orange Pi PC2
|
||||
|
||||
Orange Pi PC2 features a HDMI connector connected to the HDMI controller
|
||||
on H5 SoC.
|
||||
|
||||
Enable the HDMI output.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
---
|
||||
arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
|
||||
index a8296feee8841..5a1443911d760 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
|
||||
@@ -121,6 +121,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&de {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ehci0 {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -146,6 +150,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ir {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&ir_pins_a>;
|
||||
@@ -159,6 +167,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&mixer0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&mmc0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
|
||||
@@ -184,6 +196,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&tcon0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&uart0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart0_pins_a>;
|
||||
From 3acaae324e966dd769ec1a3fd297d0fb12082a78 Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.io>
|
||||
Date: Sat, 6 May 2017 16:14:36 +0800
|
||||
Subject: [PATCH] arm64: allwinner: h5: enable HDMI output on Orange Pi Prime
|
||||
|
||||
Orange Pi Prime features a HDMI connector connected to the HDMI controller
|
||||
on H5 SoC.
|
||||
|
||||
Enable the HDMI output.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
---
|
||||
.../boot/dts/allwinner/sun50i-h5-orangepi-prime.dts | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
|
||||
index d906b302cbcdc..e21567d7fc7f0 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
|
||||
@@ -128,6 +128,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&de {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ehci0 {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -153,6 +157,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ir {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&ir_pins_a>;
|
||||
@@ -166,6 +174,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&mixer0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&mmc0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
|
||||
@@ -201,6 +213,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&tcon0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&uart0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart0_pins_a>;
|
||||
@ -0,0 +1,52 @@
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
|
||||
index 2503d333..9d41a9d5 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
|
||||
@@ -144,6 +144,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&i2s2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ir {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&ir_pins_a>;
|
||||
@@ -179,6 +183,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&sound_hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&tcon0 {
|
||||
status = "okay";
|
||||
};
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
|
||||
index 16c004b4..623014f2 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
|
||||
@@ -151,6 +151,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&i2s2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ir {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&ir_pins_a>;
|
||||
@@ -196,6 +200,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&sound_hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&tcon0 {
|
||||
status = "okay";
|
||||
};
|
||||
@ -0,0 +1,108 @@
|
||||
From e84b8d75ac116e67ac3bdb23cafbd03430aa50b9 Mon Sep 17 00:00:00 2001
|
||||
From: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
Date: Mon, 31 Jul 2017 15:29:41 +0100
|
||||
Subject: drm/bridge: dw-hdmi: add cec notifier support
|
||||
|
||||
Add CEC notifier support to the HDMI bridge driver, so that the CEC
|
||||
part of the IP can receive its physical address.
|
||||
|
||||
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
||||
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
|
||||
Signed-off-by: Archit Taneja <architt@codeaurora.org>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/E1dcBhV-00088e-8x@rmk-PC.armlinux.org.uk
|
||||
---
|
||||
drivers/gpu/drm/bridge/synopsys/Kconfig | 1 +
|
||||
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 22 +++++++++++++++++++++-
|
||||
2 files changed, 22 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/Kconfig b/drivers/gpu/drm/bridge/synopsys/Kconfig
|
||||
index a2fb939..7281681 100644
|
||||
--- a/drivers/gpu/drm/bridge/synopsys/Kconfig
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/Kconfig
|
||||
@@ -2,6 +2,7 @@ config DRM_DW_HDMI
|
||||
tristate
|
||||
select DRM_KMS_HELPER
|
||||
select REGMAP_MMIO
|
||||
+ select CEC_CORE if CEC_NOTIFIER
|
||||
|
||||
config DRM_DW_HDMI_AHB_AUDIO
|
||||
tristate "Synopsys Designware AHB Audio interface"
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
index 60faf2d..67b4af0 100644
|
||||
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
@@ -36,7 +36,10 @@
|
||||
#include "dw-hdmi.h"
|
||||
#include "dw-hdmi-audio.h"
|
||||
|
||||
+#include <media/cec-notifier.h>
|
||||
+
|
||||
#define DDC_SEGMENT_ADDR 0x30
|
||||
+
|
||||
#define HDMI_EDID_LEN 512
|
||||
|
||||
enum hdmi_datamap {
|
||||
@@ -175,6 +178,8 @@ struct dw_hdmi {
|
||||
struct regmap *regm;
|
||||
void (*enable_audio)(struct dw_hdmi *hdmi);
|
||||
void (*disable_audio)(struct dw_hdmi *hdmi);
|
||||
+
|
||||
+ struct cec_notifier *cec_notifier;
|
||||
};
|
||||
|
||||
#define HDMI_IH_PHY_STAT0_RX_SENSE \
|
||||
@@ -1896,6 +1901,7 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
|
||||
hdmi->sink_is_hdmi = drm_detect_hdmi_monitor(edid);
|
||||
hdmi->sink_has_audio = drm_detect_monitor_audio(edid);
|
||||
drm_mode_connector_update_edid_property(connector, edid);
|
||||
+ cec_notifier_set_phys_addr_from_edid(hdmi->cec_notifier, edid);
|
||||
ret = drm_add_edid_modes(connector, edid);
|
||||
/* Store the ELD */
|
||||
drm_edid_to_eld(connector, edid);
|
||||
@@ -2119,11 +2125,16 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id)
|
||||
* ask the source to re-read the EDID.
|
||||
*/
|
||||
if (intr_stat &
|
||||
- (HDMI_IH_PHY_STAT0_RX_SENSE | HDMI_IH_PHY_STAT0_HPD))
|
||||
+ (HDMI_IH_PHY_STAT0_RX_SENSE | HDMI_IH_PHY_STAT0_HPD)) {
|
||||
__dw_hdmi_setup_rx_sense(hdmi,
|
||||
phy_stat & HDMI_PHY_HPD,
|
||||
phy_stat & HDMI_PHY_RX_SENSE);
|
||||
|
||||
+ if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0)
|
||||
+ cec_notifier_set_phys_addr(hdmi->cec_notifier,
|
||||
+ CEC_PHYS_ADDR_INVALID);
|
||||
+ }
|
||||
+
|
||||
if (intr_stat & HDMI_IH_PHY_STAT0_HPD) {
|
||||
dev_dbg(hdmi->dev, "EVENT=%s\n",
|
||||
phy_int_pol & HDMI_PHY_HPD ? "plugin" : "plugout");
|
||||
@@ -2376,6 +2387,12 @@ __dw_hdmi_probe(struct platform_device *pdev,
|
||||
if (ret)
|
||||
goto err_iahb;
|
||||
|
||||
+ hdmi->cec_notifier = cec_notifier_get(dev);
|
||||
+ if (!hdmi->cec_notifier) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto err_iahb;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* To prevent overflows in HDMI_IH_FC_STAT2, set the clk regenerator
|
||||
* N and cts values before enabling phy
|
||||
@@ -2452,6 +2469,9 @@ err_iahb:
|
||||
hdmi->ddc = NULL;
|
||||
}
|
||||
|
||||
+ if (hdmi->cec_notifier)
|
||||
+ cec_notifier_put(hdmi->cec_notifier);
|
||||
+
|
||||
clk_disable_unprepare(hdmi->iahb_clk);
|
||||
err_isfr:
|
||||
clk_disable_unprepare(hdmi->isfr_clk);
|
||||
--
|
||||
cgit v1.1
|
||||
|
||||
@ -0,0 +1,96 @@
|
||||
From 7cc4ab225ae30bd9ec9239e7dba5b2937f526ccc Mon Sep 17 00:00:00 2001
|
||||
From: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
Date: Mon, 31 Jul 2017 15:29:46 +0100
|
||||
Subject: drm/bridge: dw-hdmi: add better clock disable control
|
||||
|
||||
The video setup path aways sets the clock disable register to a specific
|
||||
value, which has the effect of disabling the CEC engine. When we add the
|
||||
CEC driver, this becomes a problem.
|
||||
|
||||
Fix this by only setting/clearing the bits that the video path needs to.
|
||||
|
||||
Reviewed-by: Jose Abreu <joabreu@synopsys.com>
|
||||
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
||||
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
|
||||
Signed-off-by: Archit Taneja <architt@codeaurora.org>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/E1dcBha-00088l-DE@rmk-PC.armlinux.org.uk
|
||||
---
|
||||
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 29 ++++++++++++++++++-----------
|
||||
1 file changed, 18 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
index 67b4af0..f8171cd 100644
|
||||
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
@@ -166,6 +166,7 @@ struct dw_hdmi {
|
||||
bool bridge_is_on; /* indicates the bridge is on */
|
||||
bool rxsense; /* rxsense state */
|
||||
u8 phy_mask; /* desired phy int mask settings */
|
||||
+ u8 mc_clkdis; /* clock disable register */
|
||||
|
||||
spinlock_t audio_lock;
|
||||
struct mutex audio_mutex;
|
||||
@@ -551,8 +552,11 @@ EXPORT_SYMBOL_GPL(dw_hdmi_set_sample_rate);
|
||||
|
||||
static void hdmi_enable_audio_clk(struct dw_hdmi *hdmi, bool enable)
|
||||
{
|
||||
- hdmi_modb(hdmi, enable ? 0 : HDMI_MC_CLKDIS_AUDCLK_DISABLE,
|
||||
- HDMI_MC_CLKDIS_AUDCLK_DISABLE, HDMI_MC_CLKDIS);
|
||||
+ if (enable)
|
||||
+ hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_AUDCLK_DISABLE;
|
||||
+ else
|
||||
+ hdmi->mc_clkdis |= HDMI_MC_CLKDIS_AUDCLK_DISABLE;
|
||||
+ hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
|
||||
}
|
||||
|
||||
static void dw_hdmi_ahb_audio_enable(struct dw_hdmi *hdmi)
|
||||
@@ -1574,8 +1578,6 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
|
||||
/* HDMI Initialization Step B.4 */
|
||||
static void dw_hdmi_enable_video_path(struct dw_hdmi *hdmi)
|
||||
{
|
||||
- u8 clkdis;
|
||||
-
|
||||
/* control period minimum duration */
|
||||
hdmi_writeb(hdmi, 12, HDMI_FC_CTRLDUR);
|
||||
hdmi_writeb(hdmi, 32, HDMI_FC_EXCTRLDUR);
|
||||
@@ -1587,17 +1589,21 @@ static void dw_hdmi_enable_video_path(struct dw_hdmi *hdmi)
|
||||
hdmi_writeb(hdmi, 0x21, HDMI_FC_CH2PREAM);
|
||||
|
||||
/* Enable pixel clock and tmds data path */
|
||||
- clkdis = 0x7F;
|
||||
- clkdis &= ~HDMI_MC_CLKDIS_PIXELCLK_DISABLE;
|
||||
- hdmi_writeb(hdmi, clkdis, HDMI_MC_CLKDIS);
|
||||
+ hdmi->mc_clkdis |= HDMI_MC_CLKDIS_HDCPCLK_DISABLE |
|
||||
+ HDMI_MC_CLKDIS_CSCCLK_DISABLE |
|
||||
+ HDMI_MC_CLKDIS_AUDCLK_DISABLE |
|
||||
+ HDMI_MC_CLKDIS_PREPCLK_DISABLE |
|
||||
+ HDMI_MC_CLKDIS_TMDSCLK_DISABLE;
|
||||
+ hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_PIXELCLK_DISABLE;
|
||||
+ hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
|
||||
|
||||
- clkdis &= ~HDMI_MC_CLKDIS_TMDSCLK_DISABLE;
|
||||
- hdmi_writeb(hdmi, clkdis, HDMI_MC_CLKDIS);
|
||||
+ hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_TMDSCLK_DISABLE;
|
||||
+ hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
|
||||
|
||||
/* Enable csc path */
|
||||
if (is_color_space_conversion(hdmi)) {
|
||||
- clkdis &= ~HDMI_MC_CLKDIS_CSCCLK_DISABLE;
|
||||
- hdmi_writeb(hdmi, clkdis, HDMI_MC_CLKDIS);
|
||||
+ hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_CSCCLK_DISABLE;
|
||||
+ hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
|
||||
}
|
||||
|
||||
/* Enable color space conversion if needed */
|
||||
@@ -2272,6 +2278,7 @@ __dw_hdmi_probe(struct platform_device *pdev,
|
||||
hdmi->disabled = true;
|
||||
hdmi->rxsense = true;
|
||||
hdmi->phy_mask = (u8)~(HDMI_PHY_HPD | HDMI_PHY_RX_SENSE);
|
||||
+ hdmi->mc_clkdis = 0x7f;
|
||||
|
||||
mutex_init(&hdmi->mutex);
|
||||
mutex_init(&hdmi->audio_mutex);
|
||||
--
|
||||
cgit v1.1
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
From e383bf85d32b5953f34fa0e3d619886ec49413b1 Mon Sep 17 00:00:00 2001
|
||||
From: Hans Verkuil <hverkuil@xs4all.nl>
|
||||
Date: Mon, 7 Aug 2017 09:20:35 +0200
|
||||
Subject: drm/bridge: dw-hdmi: add missing cec_notifier_put
|
||||
|
||||
The __dw_hdmi_remove() function was missing a call to cec_notifier_put
|
||||
to balance the cec_notifier_get in the probe function.
|
||||
|
||||
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
||||
Signed-off-by: Archit Taneja <architt@codeaurora.org>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/a7688d13-2d61-ed16-f2df-28cbb5007f38@xs4all.nl
|
||||
---
|
||||
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
index f8171cd..a24ec4a 100644
|
||||
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
@@ -2496,6 +2496,9 @@ static void __dw_hdmi_remove(struct dw_hdmi *hdmi)
|
||||
/* Disable all interrupts */
|
||||
hdmi_writeb(hdmi, ~0, HDMI_IH_MUTE_PHY_STAT0);
|
||||
|
||||
+ if (hdmi->cec_notifier)
|
||||
+ cec_notifier_put(hdmi->cec_notifier);
|
||||
+
|
||||
clk_disable_unprepare(hdmi->iahb_clk);
|
||||
clk_disable_unprepare(hdmi->isfr_clk);
|
||||
|
||||
--
|
||||
cgit v1.1
|
||||
|
||||
522
patch/kernel/sunxi-next/20-04-dw-hdmi-add-cec-driver.patch
Normal file
522
patch/kernel/sunxi-next/20-04-dw-hdmi-add-cec-driver.patch
Normal file
@ -0,0 +1,522 @@
|
||||
From a616e63c56ef35365b781f08c7d437840f56940f Mon Sep 17 00:00:00 2001
|
||||
From: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
Date: Wed, 2 Aug 2017 20:41:07 +0200
|
||||
Subject: drm/bridge: dw-hdmi: add cec driver
|
||||
|
||||
Add a CEC driver for the dw-hdmi hardware.
|
||||
|
||||
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
[hans.verkuil: unsigned -> unsigned int]
|
||||
[hans.verkuil: cec_transmit_done -> cec_transmit_attempt_done]
|
||||
[hans.verkuil: add missing CEC_CAP_PASSTHROUGH]
|
||||
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
|
||||
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
|
||||
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
||||
Signed-off-by: Archit Taneja <architt@codeaurora.org>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/20170802184108.7913-4-hverkuil@xs4all.nl
|
||||
---
|
||||
drivers/gpu/drm/bridge/synopsys/Kconfig | 9 +
|
||||
drivers/gpu/drm/bridge/synopsys/Makefile | 1 +
|
||||
drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 327 ++++++++++++++++++++++++++
|
||||
drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.h | 19 ++
|
||||
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 42 +++-
|
||||
drivers/gpu/drm/bridge/synopsys/dw-hdmi.h | 1 +
|
||||
6 files changed, 398 insertions(+), 1 deletion(-)
|
||||
create mode 100644 drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
|
||||
create mode 100644 drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.h
|
||||
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/Kconfig b/drivers/gpu/drm/bridge/synopsys/Kconfig
|
||||
index 7281681..3cc53b4 100644
|
||||
--- a/drivers/gpu/drm/bridge/synopsys/Kconfig
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/Kconfig
|
||||
@@ -22,3 +22,12 @@ config DRM_DW_HDMI_I2S_AUDIO
|
||||
help
|
||||
Support the I2S Audio interface which is part of the Synopsys
|
||||
Designware HDMI block.
|
||||
+
|
||||
+config DRM_DW_HDMI_CEC
|
||||
+ tristate "Synopsis Designware CEC interface"
|
||||
+ depends on DRM_DW_HDMI
|
||||
+ select CEC_CORE
|
||||
+ select CEC_NOTIFIER
|
||||
+ help
|
||||
+ Support the CE interface which is part of the Synopsys
|
||||
+ Designware HDMI block.
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/Makefile b/drivers/gpu/drm/bridge/synopsys/Makefile
|
||||
index 5f57d36..5dad97d 100644
|
||||
--- a/drivers/gpu/drm/bridge/synopsys/Makefile
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/Makefile
|
||||
@@ -3,3 +3,4 @@
|
||||
obj-$(CONFIG_DRM_DW_HDMI) += dw-hdmi.o
|
||||
obj-$(CONFIG_DRM_DW_HDMI_AHB_AUDIO) += dw-hdmi-ahb-audio.o
|
||||
obj-$(CONFIG_DRM_DW_HDMI_I2S_AUDIO) += dw-hdmi-i2s-audio.o
|
||||
+obj-$(CONFIG_DRM_DW_HDMI_CEC) += dw-hdmi-cec.o
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
|
||||
new file mode 100644
|
||||
index 0000000..6c32351
|
||||
--- /dev/null
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
|
||||
@@ -0,0 +1,327 @@
|
||||
+/*
|
||||
+ * Designware HDMI CEC driver
|
||||
+ *
|
||||
+ * Copyright (C) 2015-2017 Russell King.
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ */
|
||||
+#include <linux/interrupt.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/sched.h>
|
||||
+#include <linux/slab.h>
|
||||
+
|
||||
+#include <drm/drm_edid.h>
|
||||
+
|
||||
+#include <media/cec.h>
|
||||
+#include <media/cec-notifier.h>
|
||||
+
|
||||
+#include "dw-hdmi-cec.h"
|
||||
+
|
||||
+enum {
|
||||
+ HDMI_IH_CEC_STAT0 = 0x0106,
|
||||
+ HDMI_IH_MUTE_CEC_STAT0 = 0x0186,
|
||||
+
|
||||
+ HDMI_CEC_CTRL = 0x7d00,
|
||||
+ CEC_CTRL_START = BIT(0),
|
||||
+ CEC_CTRL_FRAME_TYP = 3 << 1,
|
||||
+ CEC_CTRL_RETRY = 0 << 1,
|
||||
+ CEC_CTRL_NORMAL = 1 << 1,
|
||||
+ CEC_CTRL_IMMED = 2 << 1,
|
||||
+
|
||||
+ HDMI_CEC_STAT = 0x7d01,
|
||||
+ CEC_STAT_DONE = BIT(0),
|
||||
+ CEC_STAT_EOM = BIT(1),
|
||||
+ CEC_STAT_NACK = BIT(2),
|
||||
+ CEC_STAT_ARBLOST = BIT(3),
|
||||
+ CEC_STAT_ERROR_INIT = BIT(4),
|
||||
+ CEC_STAT_ERROR_FOLL = BIT(5),
|
||||
+ CEC_STAT_WAKEUP = BIT(6),
|
||||
+
|
||||
+ HDMI_CEC_MASK = 0x7d02,
|
||||
+ HDMI_CEC_POLARITY = 0x7d03,
|
||||
+ HDMI_CEC_INT = 0x7d04,
|
||||
+ HDMI_CEC_ADDR_L = 0x7d05,
|
||||
+ HDMI_CEC_ADDR_H = 0x7d06,
|
||||
+ HDMI_CEC_TX_CNT = 0x7d07,
|
||||
+ HDMI_CEC_RX_CNT = 0x7d08,
|
||||
+ HDMI_CEC_TX_DATA0 = 0x7d10,
|
||||
+ HDMI_CEC_RX_DATA0 = 0x7d20,
|
||||
+ HDMI_CEC_LOCK = 0x7d30,
|
||||
+ HDMI_CEC_WKUPCTRL = 0x7d31,
|
||||
+};
|
||||
+
|
||||
+struct dw_hdmi_cec {
|
||||
+ struct dw_hdmi *hdmi;
|
||||
+ const struct dw_hdmi_cec_ops *ops;
|
||||
+ u32 addresses;
|
||||
+ struct cec_adapter *adap;
|
||||
+ struct cec_msg rx_msg;
|
||||
+ unsigned int tx_status;
|
||||
+ bool tx_done;
|
||||
+ bool rx_done;
|
||||
+ struct cec_notifier *notify;
|
||||
+ int irq;
|
||||
+};
|
||||
+
|
||||
+static void dw_hdmi_write(struct dw_hdmi_cec *cec, u8 val, int offset)
|
||||
+{
|
||||
+ cec->ops->write(cec->hdmi, val, offset);
|
||||
+}
|
||||
+
|
||||
+static u8 dw_hdmi_read(struct dw_hdmi_cec *cec, int offset)
|
||||
+{
|
||||
+ return cec->ops->read(cec->hdmi, offset);
|
||||
+}
|
||||
+
|
||||
+static int dw_hdmi_cec_log_addr(struct cec_adapter *adap, u8 logical_addr)
|
||||
+{
|
||||
+ struct dw_hdmi_cec *cec = cec_get_drvdata(adap);
|
||||
+
|
||||
+ if (logical_addr == CEC_LOG_ADDR_INVALID)
|
||||
+ cec->addresses = 0;
|
||||
+ else
|
||||
+ cec->addresses |= BIT(logical_addr) | BIT(15);
|
||||
+
|
||||
+ dw_hdmi_write(cec, cec->addresses & 255, HDMI_CEC_ADDR_L);
|
||||
+ dw_hdmi_write(cec, cec->addresses >> 8, HDMI_CEC_ADDR_H);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int dw_hdmi_cec_transmit(struct cec_adapter *adap, u8 attempts,
|
||||
+ u32 signal_free_time, struct cec_msg *msg)
|
||||
+{
|
||||
+ struct dw_hdmi_cec *cec = cec_get_drvdata(adap);
|
||||
+ unsigned int i, ctrl;
|
||||
+
|
||||
+ switch (signal_free_time) {
|
||||
+ case CEC_SIGNAL_FREE_TIME_RETRY:
|
||||
+ ctrl = CEC_CTRL_RETRY;
|
||||
+ break;
|
||||
+ case CEC_SIGNAL_FREE_TIME_NEW_INITIATOR:
|
||||
+ default:
|
||||
+ ctrl = CEC_CTRL_NORMAL;
|
||||
+ break;
|
||||
+ case CEC_SIGNAL_FREE_TIME_NEXT_XFER:
|
||||
+ ctrl = CEC_CTRL_IMMED;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < msg->len; i++)
|
||||
+ dw_hdmi_write(cec, msg->msg[i], HDMI_CEC_TX_DATA0 + i);
|
||||
+
|
||||
+ dw_hdmi_write(cec, msg->len, HDMI_CEC_TX_CNT);
|
||||
+ dw_hdmi_write(cec, ctrl | CEC_CTRL_START, HDMI_CEC_CTRL);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static irqreturn_t dw_hdmi_cec_hardirq(int irq, void *data)
|
||||
+{
|
||||
+ struct cec_adapter *adap = data;
|
||||
+ struct dw_hdmi_cec *cec = cec_get_drvdata(adap);
|
||||
+ unsigned int stat = dw_hdmi_read(cec, HDMI_IH_CEC_STAT0);
|
||||
+ irqreturn_t ret = IRQ_HANDLED;
|
||||
+
|
||||
+ if (stat == 0)
|
||||
+ return IRQ_NONE;
|
||||
+
|
||||
+ dw_hdmi_write(cec, stat, HDMI_IH_CEC_STAT0);
|
||||
+
|
||||
+ if (stat & CEC_STAT_ERROR_INIT) {
|
||||
+ cec->tx_status = CEC_TX_STATUS_ERROR;
|
||||
+ cec->tx_done = true;
|
||||
+ ret = IRQ_WAKE_THREAD;
|
||||
+ } else if (stat & CEC_STAT_DONE) {
|
||||
+ cec->tx_status = CEC_TX_STATUS_OK;
|
||||
+ cec->tx_done = true;
|
||||
+ ret = IRQ_WAKE_THREAD;
|
||||
+ } else if (stat & CEC_STAT_NACK) {
|
||||
+ cec->tx_status = CEC_TX_STATUS_NACK;
|
||||
+ cec->tx_done = true;
|
||||
+ ret = IRQ_WAKE_THREAD;
|
||||
+ }
|
||||
+
|
||||
+ if (stat & CEC_STAT_EOM) {
|
||||
+ unsigned int len, i;
|
||||
+
|
||||
+ len = dw_hdmi_read(cec, HDMI_CEC_RX_CNT);
|
||||
+ if (len > sizeof(cec->rx_msg.msg))
|
||||
+ len = sizeof(cec->rx_msg.msg);
|
||||
+
|
||||
+ for (i = 0; i < len; i++)
|
||||
+ cec->rx_msg.msg[i] =
|
||||
+ dw_hdmi_read(cec, HDMI_CEC_RX_DATA0 + i);
|
||||
+
|
||||
+ dw_hdmi_write(cec, 0, HDMI_CEC_LOCK);
|
||||
+
|
||||
+ cec->rx_msg.len = len;
|
||||
+ smp_wmb();
|
||||
+ cec->rx_done = true;
|
||||
+
|
||||
+ ret = IRQ_WAKE_THREAD;
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static irqreturn_t dw_hdmi_cec_thread(int irq, void *data)
|
||||
+{
|
||||
+ struct cec_adapter *adap = data;
|
||||
+ struct dw_hdmi_cec *cec = cec_get_drvdata(adap);
|
||||
+
|
||||
+ if (cec->tx_done) {
|
||||
+ cec->tx_done = false;
|
||||
+ cec_transmit_attempt_done(adap, cec->tx_status);
|
||||
+ }
|
||||
+ if (cec->rx_done) {
|
||||
+ cec->rx_done = false;
|
||||
+ smp_rmb();
|
||||
+ cec_received_msg(adap, &cec->rx_msg);
|
||||
+ }
|
||||
+ return IRQ_HANDLED;
|
||||
+}
|
||||
+
|
||||
+static int dw_hdmi_cec_enable(struct cec_adapter *adap, bool enable)
|
||||
+{
|
||||
+ struct dw_hdmi_cec *cec = cec_get_drvdata(adap);
|
||||
+
|
||||
+ if (!enable) {
|
||||
+ dw_hdmi_write(cec, ~0, HDMI_CEC_MASK);
|
||||
+ dw_hdmi_write(cec, ~0, HDMI_IH_MUTE_CEC_STAT0);
|
||||
+ dw_hdmi_write(cec, 0, HDMI_CEC_POLARITY);
|
||||
+
|
||||
+ cec->ops->disable(cec->hdmi);
|
||||
+ } else {
|
||||
+ unsigned int irqs;
|
||||
+
|
||||
+ dw_hdmi_write(cec, 0, HDMI_CEC_CTRL);
|
||||
+ dw_hdmi_write(cec, ~0, HDMI_IH_CEC_STAT0);
|
||||
+ dw_hdmi_write(cec, 0, HDMI_CEC_LOCK);
|
||||
+
|
||||
+ dw_hdmi_cec_log_addr(cec->adap, CEC_LOG_ADDR_INVALID);
|
||||
+
|
||||
+ cec->ops->enable(cec->hdmi);
|
||||
+
|
||||
+ irqs = CEC_STAT_ERROR_INIT | CEC_STAT_NACK | CEC_STAT_EOM |
|
||||
+ CEC_STAT_DONE;
|
||||
+ dw_hdmi_write(cec, irqs, HDMI_CEC_POLARITY);
|
||||
+ dw_hdmi_write(cec, ~irqs, HDMI_CEC_MASK);
|
||||
+ dw_hdmi_write(cec, ~irqs, HDMI_IH_MUTE_CEC_STAT0);
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct cec_adap_ops dw_hdmi_cec_ops = {
|
||||
+ .adap_enable = dw_hdmi_cec_enable,
|
||||
+ .adap_log_addr = dw_hdmi_cec_log_addr,
|
||||
+ .adap_transmit = dw_hdmi_cec_transmit,
|
||||
+};
|
||||
+
|
||||
+static void dw_hdmi_cec_del(void *data)
|
||||
+{
|
||||
+ struct dw_hdmi_cec *cec = data;
|
||||
+
|
||||
+ cec_delete_adapter(cec->adap);
|
||||
+}
|
||||
+
|
||||
+static int dw_hdmi_cec_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct dw_hdmi_cec_data *data = dev_get_platdata(&pdev->dev);
|
||||
+ struct dw_hdmi_cec *cec;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!data)
|
||||
+ return -ENXIO;
|
||||
+
|
||||
+ /*
|
||||
+ * Our device is just a convenience - we want to link to the real
|
||||
+ * hardware device here, so that userspace can see the association
|
||||
+ * between the HDMI hardware and its associated CEC chardev.
|
||||
+ */
|
||||
+ cec = devm_kzalloc(&pdev->dev, sizeof(*cec), GFP_KERNEL);
|
||||
+ if (!cec)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ cec->irq = data->irq;
|
||||
+ cec->ops = data->ops;
|
||||
+ cec->hdmi = data->hdmi;
|
||||
+
|
||||
+ platform_set_drvdata(pdev, cec);
|
||||
+
|
||||
+ dw_hdmi_write(cec, 0, HDMI_CEC_TX_CNT);
|
||||
+ dw_hdmi_write(cec, ~0, HDMI_CEC_MASK);
|
||||
+ dw_hdmi_write(cec, ~0, HDMI_IH_MUTE_CEC_STAT0);
|
||||
+ dw_hdmi_write(cec, 0, HDMI_CEC_POLARITY);
|
||||
+
|
||||
+ cec->adap = cec_allocate_adapter(&dw_hdmi_cec_ops, cec, "dw_hdmi",
|
||||
+ CEC_CAP_LOG_ADDRS | CEC_CAP_TRANSMIT |
|
||||
+ CEC_CAP_RC | CEC_CAP_PASSTHROUGH,
|
||||
+ CEC_MAX_LOG_ADDRS);
|
||||
+ if (IS_ERR(cec->adap))
|
||||
+ return PTR_ERR(cec->adap);
|
||||
+
|
||||
+ /* override the module pointer */
|
||||
+ cec->adap->owner = THIS_MODULE;
|
||||
+
|
||||
+ ret = devm_add_action(&pdev->dev, dw_hdmi_cec_del, cec);
|
||||
+ if (ret) {
|
||||
+ cec_delete_adapter(cec->adap);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = devm_request_threaded_irq(&pdev->dev, cec->irq,
|
||||
+ dw_hdmi_cec_hardirq,
|
||||
+ dw_hdmi_cec_thread, IRQF_SHARED,
|
||||
+ "dw-hdmi-cec", cec->adap);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ cec->notify = cec_notifier_get(pdev->dev.parent);
|
||||
+ if (!cec->notify)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ ret = cec_register_adapter(cec->adap, pdev->dev.parent);
|
||||
+ if (ret < 0) {
|
||||
+ cec_notifier_put(cec->notify);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * CEC documentation says we must not call cec_delete_adapter
|
||||
+ * after a successful call to cec_register_adapter().
|
||||
+ */
|
||||
+ devm_remove_action(&pdev->dev, dw_hdmi_cec_del, cec);
|
||||
+
|
||||
+ cec_register_cec_notifier(cec->adap, cec->notify);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int dw_hdmi_cec_remove(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct dw_hdmi_cec *cec = platform_get_drvdata(pdev);
|
||||
+
|
||||
+ cec_unregister_adapter(cec->adap);
|
||||
+ cec_notifier_put(cec->notify);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static struct platform_driver dw_hdmi_cec_driver = {
|
||||
+ .probe = dw_hdmi_cec_probe,
|
||||
+ .remove = dw_hdmi_cec_remove,
|
||||
+ .driver = {
|
||||
+ .name = "dw-hdmi-cec",
|
||||
+ },
|
||||
+};
|
||||
+module_platform_driver(dw_hdmi_cec_driver);
|
||||
+
|
||||
+MODULE_AUTHOR("Russell King <rmk+kernel@armlinux.org.uk>");
|
||||
+MODULE_DESCRIPTION("Synopsys Designware HDMI CEC driver for i.MX");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+MODULE_ALIAS(PLATFORM_MODULE_PREFIX "dw-hdmi-cec");
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.h b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.h
|
||||
new file mode 100644
|
||||
index 0000000..cf4dc12
|
||||
--- /dev/null
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.h
|
||||
@@ -0,0 +1,19 @@
|
||||
+#ifndef DW_HDMI_CEC_H
|
||||
+#define DW_HDMI_CEC_H
|
||||
+
|
||||
+struct dw_hdmi;
|
||||
+
|
||||
+struct dw_hdmi_cec_ops {
|
||||
+ void (*write)(struct dw_hdmi *hdmi, u8 val, int offset);
|
||||
+ u8 (*read)(struct dw_hdmi *hdmi, int offset);
|
||||
+ void (*enable)(struct dw_hdmi *hdmi);
|
||||
+ void (*disable)(struct dw_hdmi *hdmi);
|
||||
+};
|
||||
+
|
||||
+struct dw_hdmi_cec_data {
|
||||
+ struct dw_hdmi *hdmi;
|
||||
+ const struct dw_hdmi_cec_ops *ops;
|
||||
+ int irq;
|
||||
+};
|
||||
+
|
||||
+#endif
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
index a24ec4a..6aae581 100644
|
||||
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "dw-hdmi.h"
|
||||
#include "dw-hdmi-audio.h"
|
||||
+#include "dw-hdmi-cec.h"
|
||||
|
||||
#include <media/cec-notifier.h>
|
||||
|
||||
@@ -133,6 +134,7 @@ struct dw_hdmi {
|
||||
unsigned int version;
|
||||
|
||||
struct platform_device *audio;
|
||||
+ struct platform_device *cec;
|
||||
struct device *dev;
|
||||
struct clk *isfr_clk;
|
||||
struct clk *iahb_clk;
|
||||
@@ -1794,7 +1796,6 @@ static void initialize_hdmi_ih_mutes(struct dw_hdmi *hdmi)
|
||||
hdmi_writeb(hdmi, 0xff, HDMI_AUD_HBR_MASK);
|
||||
hdmi_writeb(hdmi, 0xff, HDMI_GP_MASK);
|
||||
hdmi_writeb(hdmi, 0xff, HDMI_A_APIINTMSK);
|
||||
- hdmi_writeb(hdmi, 0xff, HDMI_CEC_MASK);
|
||||
hdmi_writeb(hdmi, 0xff, HDMI_I2CM_INT);
|
||||
hdmi_writeb(hdmi, 0xff, HDMI_I2CM_CTLINT);
|
||||
|
||||
@@ -2236,6 +2237,29 @@ static int dw_hdmi_detect_phy(struct dw_hdmi *hdmi)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
+static void dw_hdmi_cec_enable(struct dw_hdmi *hdmi)
|
||||
+{
|
||||
+ mutex_lock(&hdmi->mutex);
|
||||
+ hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_CECCLK_DISABLE;
|
||||
+ hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
|
||||
+ mutex_unlock(&hdmi->mutex);
|
||||
+}
|
||||
+
|
||||
+static void dw_hdmi_cec_disable(struct dw_hdmi *hdmi)
|
||||
+{
|
||||
+ mutex_lock(&hdmi->mutex);
|
||||
+ hdmi->mc_clkdis |= HDMI_MC_CLKDIS_CECCLK_DISABLE;
|
||||
+ hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
|
||||
+ mutex_unlock(&hdmi->mutex);
|
||||
+}
|
||||
+
|
||||
+static const struct dw_hdmi_cec_ops dw_hdmi_cec_ops = {
|
||||
+ .write = hdmi_writeb,
|
||||
+ .read = hdmi_readb,
|
||||
+ .enable = dw_hdmi_cec_enable,
|
||||
+ .disable = dw_hdmi_cec_disable,
|
||||
+};
|
||||
+
|
||||
static const struct regmap_config hdmi_regmap_8bit_config = {
|
||||
.reg_bits = 32,
|
||||
.val_bits = 8,
|
||||
@@ -2258,6 +2282,7 @@ __dw_hdmi_probe(struct platform_device *pdev,
|
||||
struct device_node *np = dev->of_node;
|
||||
struct platform_device_info pdevinfo;
|
||||
struct device_node *ddc_node;
|
||||
+ struct dw_hdmi_cec_data cec;
|
||||
struct dw_hdmi *hdmi;
|
||||
struct resource *iores = NULL;
|
||||
int irq;
|
||||
@@ -2462,6 +2487,19 @@ __dw_hdmi_probe(struct platform_device *pdev,
|
||||
hdmi->audio = platform_device_register_full(&pdevinfo);
|
||||
}
|
||||
|
||||
+ if (config0 & HDMI_CONFIG0_CEC) {
|
||||
+ cec.hdmi = hdmi;
|
||||
+ cec.ops = &dw_hdmi_cec_ops;
|
||||
+ cec.irq = irq;
|
||||
+
|
||||
+ pdevinfo.name = "dw-hdmi-cec";
|
||||
+ pdevinfo.data = &cec;
|
||||
+ pdevinfo.size_data = sizeof(cec);
|
||||
+ pdevinfo.dma_mask = 0;
|
||||
+
|
||||
+ hdmi->cec = platform_device_register_full(&pdevinfo);
|
||||
+ }
|
||||
+
|
||||
/* Reset HDMI DDC I2C master controller and mute I2CM interrupts */
|
||||
if (hdmi->i2c)
|
||||
dw_hdmi_i2c_init(hdmi);
|
||||
@@ -2492,6 +2530,8 @@ static void __dw_hdmi_remove(struct dw_hdmi *hdmi)
|
||||
{
|
||||
if (hdmi->audio && !IS_ERR(hdmi->audio))
|
||||
platform_device_unregister(hdmi->audio);
|
||||
+ if (!IS_ERR(hdmi->cec))
|
||||
+ platform_device_unregister(hdmi->cec);
|
||||
|
||||
/* Disable all interrupts */
|
||||
hdmi_writeb(hdmi, ~0, HDMI_IH_MUTE_PHY_STAT0);
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h
|
||||
index c59f87e..69644c8 100644
|
||||
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h
|
||||
@@ -555,6 +555,7 @@ enum {
|
||||
|
||||
/* CONFIG0_ID field values */
|
||||
HDMI_CONFIG0_I2S = 0x10,
|
||||
+ HDMI_CONFIG0_CEC = 0x02,
|
||||
|
||||
/* CONFIG1_ID field values */
|
||||
HDMI_CONFIG1_AHB = 0x01,
|
||||
--
|
||||
cgit v1.1
|
||||
|
||||
76
patch/kernel/sunxi-next/20-05-dw-hdmi-cleanup.patch
Normal file
76
patch/kernel/sunxi-next/20-05-dw-hdmi-cleanup.patch
Normal file
@ -0,0 +1,76 @@
|
||||
From 2356c573ba0eca736ec156b82ca6a6b37b8fe609 Mon Sep 17 00:00:00 2001
|
||||
From: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
Date: Wed, 2 Aug 2017 20:41:08 +0200
|
||||
Subject: drm/bridge: dw-hdmi: remove CEC engine register definitions
|
||||
|
||||
We don't need the CEC engine register definitions, so let's remove them.
|
||||
|
||||
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
|
||||
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
|
||||
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
||||
Signed-off-by: Archit Taneja <architt@codeaurora.org>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/20170802184108.7913-5-hverkuil@xs4all.nl
|
||||
---
|
||||
drivers/gpu/drm/bridge/synopsys/dw-hdmi.h | 45 -------------------------------
|
||||
1 file changed, 45 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h
|
||||
index 69644c8..9d90eb9 100644
|
||||
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h
|
||||
@@ -478,51 +478,6 @@
|
||||
#define HDMI_A_PRESETUP 0x501A
|
||||
#define HDMI_A_SRM_BASE 0x5020
|
||||
|
||||
-/* CEC Engine Registers */
|
||||
-#define HDMI_CEC_CTRL 0x7D00
|
||||
-#define HDMI_CEC_STAT 0x7D01
|
||||
-#define HDMI_CEC_MASK 0x7D02
|
||||
-#define HDMI_CEC_POLARITY 0x7D03
|
||||
-#define HDMI_CEC_INT 0x7D04
|
||||
-#define HDMI_CEC_ADDR_L 0x7D05
|
||||
-#define HDMI_CEC_ADDR_H 0x7D06
|
||||
-#define HDMI_CEC_TX_CNT 0x7D07
|
||||
-#define HDMI_CEC_RX_CNT 0x7D08
|
||||
-#define HDMI_CEC_TX_DATA0 0x7D10
|
||||
-#define HDMI_CEC_TX_DATA1 0x7D11
|
||||
-#define HDMI_CEC_TX_DATA2 0x7D12
|
||||
-#define HDMI_CEC_TX_DATA3 0x7D13
|
||||
-#define HDMI_CEC_TX_DATA4 0x7D14
|
||||
-#define HDMI_CEC_TX_DATA5 0x7D15
|
||||
-#define HDMI_CEC_TX_DATA6 0x7D16
|
||||
-#define HDMI_CEC_TX_DATA7 0x7D17
|
||||
-#define HDMI_CEC_TX_DATA8 0x7D18
|
||||
-#define HDMI_CEC_TX_DATA9 0x7D19
|
||||
-#define HDMI_CEC_TX_DATA10 0x7D1a
|
||||
-#define HDMI_CEC_TX_DATA11 0x7D1b
|
||||
-#define HDMI_CEC_TX_DATA12 0x7D1c
|
||||
-#define HDMI_CEC_TX_DATA13 0x7D1d
|
||||
-#define HDMI_CEC_TX_DATA14 0x7D1e
|
||||
-#define HDMI_CEC_TX_DATA15 0x7D1f
|
||||
-#define HDMI_CEC_RX_DATA0 0x7D20
|
||||
-#define HDMI_CEC_RX_DATA1 0x7D21
|
||||
-#define HDMI_CEC_RX_DATA2 0x7D22
|
||||
-#define HDMI_CEC_RX_DATA3 0x7D23
|
||||
-#define HDMI_CEC_RX_DATA4 0x7D24
|
||||
-#define HDMI_CEC_RX_DATA5 0x7D25
|
||||
-#define HDMI_CEC_RX_DATA6 0x7D26
|
||||
-#define HDMI_CEC_RX_DATA7 0x7D27
|
||||
-#define HDMI_CEC_RX_DATA8 0x7D28
|
||||
-#define HDMI_CEC_RX_DATA9 0x7D29
|
||||
-#define HDMI_CEC_RX_DATA10 0x7D2a
|
||||
-#define HDMI_CEC_RX_DATA11 0x7D2b
|
||||
-#define HDMI_CEC_RX_DATA12 0x7D2c
|
||||
-#define HDMI_CEC_RX_DATA13 0x7D2d
|
||||
-#define HDMI_CEC_RX_DATA14 0x7D2e
|
||||
-#define HDMI_CEC_RX_DATA15 0x7D2f
|
||||
-#define HDMI_CEC_LOCK 0x7D30
|
||||
-#define HDMI_CEC_WKUPCTRL 0x7D31
|
||||
-
|
||||
/* I2C Master Registers (E-DDC) */
|
||||
#define HDMI_I2CM_SLAVE 0x7E00
|
||||
#define HDMI_I2CM_ADDRESS 0x7E01
|
||||
--
|
||||
cgit v1.1
|
||||
|
||||
12
patch/kernel/sunxi-next/enable-fsl-timer-errata.patch
Normal file
12
patch/kernel/sunxi-next/enable-fsl-timer-errata.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
||||
index 02c0385f..db616e73 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
||||
@@ -105,6 +110,7 @@
|
||||
|
||||
timer {
|
||||
compatible = "arm,armv8-timer";
|
||||
+ fsl,erratum-a008585;
|
||||
interrupts = <GIC_PPI 13
|
||||
(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
|
||||
<GIC_PPI 14
|
||||
Loading…
Reference in New Issue
Block a user