From 2f385335951d406f7bb705b2a4da4a447e5b5c0f Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 13 Dec 2015 00:14:50 +0000 Subject: [PATCH] [armhf] Add support for Odroid-XU4 (Closes: #804850) --- debian/changelog | 5 + ...ort-odroid-xu4-board-for-exynos5422-.patch | 294 ++++++++++++++++++ ...r-off-method-for-exynos5422-odroidxu.patch | 35 +++ ...dio-configuration-to-separate-exynos.patch | 185 +++++++++++ ...manual-shutdown-method-for-odroid-xu.patch | 116 +++++++ debian/patches/series | 4 + 6 files changed, 639 insertions(+) create mode 100644 debian/patches/features/arm/arm-dts-add-support-odroid-xu4-board-for-exynos5422-.patch create mode 100644 debian/patches/features/arm/arm-dts-fix-power-off-method-for-exynos5422-odroidxu.patch create mode 100644 debian/patches/features/arm/arm-dts-split-audio-configuration-to-separate-exynos.patch create mode 100644 debian/patches/features/arm/mfd-s2mps11-add-manual-shutdown-method-for-odroid-xu.patch diff --git a/debian/changelog b/debian/changelog index dd297550d..f4524cc29 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,11 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium * [x86] input: Enable KEYBOARD_GPIO, INPUT_SOC_BUTTON_ARRAY (Closes: #804864) * [x86] nouveau: bios: return actual size of the buffer retrieved via _ROM (Closes: #772716) + * [armhf] Add support for Odroid-XU4 (Closes: #804850) + - mfd: s2mps11: Add manual shutdown method for Odroid XU3 + - dts: Fix power off method for exynos5422-odroidxu3-common + - dts: Split audio configuration to separate exynos5422-odroidxu3-audio + - dts: Add support Odroid XU4 board for exynos5422-odroidxu4 -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 diff --git a/debian/patches/features/arm/arm-dts-add-support-odroid-xu4-board-for-exynos5422-.patch b/debian/patches/features/arm/arm-dts-add-support-odroid-xu4-board-for-exynos5422-.patch new file mode 100644 index 000000000..d969e5916 --- /dev/null +++ b/debian/patches/features/arm/arm-dts-add-support-odroid-xu4-board-for-exynos5422-.patch @@ -0,0 +1,294 @@ +From: Krzysztof Kozlowski +Date: Wed, 16 Sep 2015 08:37:11 +0900 +Subject: [3/3] ARM: dts: Add support Odroid XU4 board for exynos5422-odroidxu4 +Origin: https://git.kernel.org/linus/6658356014cbf772c7f11154adc0c46717b3322b +Bug-Debian: https://bugs.debian.org/804850 + +Add Hardkernel Odroid XU4 board Device Tree sources. The board differs +from Odroid XU3 and XU3-Lite by: +1. No green and red LEDs (except standard red power LED). +2. Only two PWM outputs are used (fan and blue LED) +3. No audio codec. +4. Two USB3 ports in host mode (no micro USB3 connector for OTG). +5. Realtek RTL8153-CG gigabit network adapter (instead of SMSC9514). +6. Additional connector with IO ports (I2S_0, I2C_5). +7. No DisplayPort (like XU3-Lite). +8. No TI INA231 power measurement sensors (like XU3-Lite). + +Signed-off-by: Krzysztof Kozlowski +Reviewed-by: Javier Martinez Canillas +Signed-off-by: Kukjin Kim +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 50 +--------------------- + arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts | 50 ++++++++++++++++++++++ + arch/arm/boot/dts/exynos5422-odroidxu3.dts | 50 ++++++++++++++++++++++ + arch/arm/boot/dts/exynos5422-odroidxu4.dts | 48 +++++++++++++++++++++ + 5 files changed, 150 insertions(+), 49 deletions(-) + create mode 100644 arch/arm/boot/dts/exynos5422-odroidxu4.dts + +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index 233159d..3d27fe3 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -123,6 +123,7 @@ dtb-$(CONFIG_ARCH_EXYNOS5) += \ + exynos5420-smdk5420.dtb \ + exynos5422-odroidxu3.dtb \ + exynos5422-odroidxu3-lite.dtb \ ++ exynos5422-odroidxu4.dtb \ + exynos5440-sd5v1.dtb \ + exynos5440-ssdk5440.dtb \ + exynos5800-peach-pi.dtb +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +index 2f0fb86..a83d569 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +@@ -46,40 +46,6 @@ + reset-gpios = <&gpd1 0 1>; + }; + +- pwmleds { +- compatible = "pwm-leds"; +- +- greenled { +- label = "green:mmc0"; +- pwms = <&pwm 1 2000000 0>; +- pwm-names = "pwm1"; +- /* +- * Green LED is much brighter than the others +- * so limit its max brightness +- */ +- max_brightness = <127>; +- linux,default-trigger = "mmc0"; +- }; +- +- blueled { +- label = "blue:heartbeat"; +- pwms = <&pwm 2 2000000 0>; +- pwm-names = "pwm2"; +- max_brightness = <255>; +- linux,default-trigger = "heartbeat"; +- }; +- }; +- +- gpioleds { +- compatible = "gpio-leds"; +- redled { +- label = "red:microSD"; +- gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>; +- default-state = "off"; +- linux,default-trigger = "mmc1"; +- }; +- }; +- + fan0: pwm-fan { + compatible = "pwm-fan"; + pwms = <&pwm 0 20972 0>; +@@ -417,18 +383,6 @@ + }; + }; + +-&pwm { +- /* +- * PWM 0 -- fan +- * PWM 1 -- Green LED +- * PWM 2 -- Blue LED +- * PWM 3 -- on MIPI connector for backlight +- */ +- pinctrl-0 = <&pwm0_out &pwm1_out &pwm2_out &pwm3_out>; +- pinctrl-names = "default"; +- status = "okay"; +-}; +- + &tmu_cpu0 { + vtmu-supply = <&ldo7_reg>; + status = "okay"; +@@ -464,9 +418,7 @@ + dr_mode = "host"; + }; + +-&usbdrd_dwc3_1 { +- dr_mode = "otg"; +-}; ++/* usbdrd_dwc3_1 mode customized in each board */ + + &usbdrd3_0 { + vdd33-supply = <&ldo9_reg>; +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts +index 9c0cea9..b1b3608 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts +@@ -18,4 +18,54 @@ + / { + model = "Hardkernel Odroid XU3 Lite"; + compatible = "hardkernel,odroid-xu3-lite", "samsung,exynos5800", "samsung,exynos5"; ++ ++ pwmleds { ++ compatible = "pwm-leds"; ++ ++ greenled { ++ label = "green:mmc0"; ++ pwms = <&pwm 1 2000000 0>; ++ pwm-names = "pwm1"; ++ /* ++ * Green LED is much brighter than the others ++ * so limit its max brightness ++ */ ++ max_brightness = <127>; ++ linux,default-trigger = "mmc0"; ++ }; ++ ++ blueled { ++ label = "blue:heartbeat"; ++ pwms = <&pwm 2 2000000 0>; ++ pwm-names = "pwm2"; ++ max_brightness = <255>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ }; ++ ++ gpioleds { ++ compatible = "gpio-leds"; ++ redled { ++ label = "red:microSD"; ++ gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>; ++ default-state = "off"; ++ linux,default-trigger = "mmc1"; ++ }; ++ }; ++}; ++ ++&pwm { ++ /* ++ * PWM 0 -- fan ++ * PWM 1 -- Green LED ++ * PWM 2 -- Blue LED ++ * PWM 3 -- on MIPI connector for backlight ++ */ ++ pinctrl-0 = <&pwm0_out &pwm1_out &pwm2_out &pwm3_out>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3_1 { ++ dr_mode = "otg"; + }; +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts +index d8647a4..0c0bbdb 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts +@@ -17,6 +17,40 @@ + / { + model = "Hardkernel Odroid XU3"; + compatible = "hardkernel,odroid-xu3", "samsung,exynos5800", "samsung,exynos5"; ++ ++ pwmleds { ++ compatible = "pwm-leds"; ++ ++ greenled { ++ label = "green:mmc0"; ++ pwms = <&pwm 1 2000000 0>; ++ pwm-names = "pwm1"; ++ /* ++ * Green LED is much brighter than the others ++ * so limit its max brightness ++ */ ++ max_brightness = <127>; ++ linux,default-trigger = "mmc0"; ++ }; ++ ++ blueled { ++ label = "blue:heartbeat"; ++ pwms = <&pwm 2 2000000 0>; ++ pwm-names = "pwm2"; ++ max_brightness = <255>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ }; ++ ++ gpioleds { ++ compatible = "gpio-leds"; ++ redled { ++ label = "red:microSD"; ++ gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>; ++ default-state = "off"; ++ linux,default-trigger = "mmc1"; ++ }; ++ }; + }; + + &i2c_0 { +@@ -50,3 +84,19 @@ + shunt-resistor = <10000>; + }; + }; ++ ++&pwm { ++ /* ++ * PWM 0 -- fan ++ * PWM 1 -- Green LED ++ * PWM 2 -- Blue LED ++ * PWM 3 -- on MIPI connector for backlight ++ */ ++ pinctrl-0 = <&pwm0_out &pwm1_out &pwm2_out &pwm3_out>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3_1 { ++ dr_mode = "otg"; ++}; +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu4.dts b/arch/arm/boot/dts/exynos5422-odroidxu4.dts +new file mode 100644 +index 0000000..2faf886 +--- /dev/null ++++ b/arch/arm/boot/dts/exynos5422-odroidxu4.dts +@@ -0,0 +1,48 @@ ++/* ++ * Hardkernel Odroid XU4 board device tree source ++ * ++ * Copyright (c) 2015 Krzysztof Kozlowski ++ * Copyright (c) 2014 Collabora Ltd. ++ * Copyright (c) 2013-2015 Samsung Electronics Co., Ltd. ++ * http://www.samsung.com ++ * ++ * 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. ++*/ ++ ++/dts-v1/; ++#include "exynos5422-odroidxu3-common.dtsi" ++ ++/ { ++ model = "Hardkernel Odroid XU4"; ++ compatible = "hardkernel,odroid-xu4", "samsung,exynos5800", \ ++ "samsung,exynos5"; ++ ++ pwmleds { ++ compatible = "pwm-leds"; ++ ++ blueled { ++ label = "blue:heartbeat"; ++ pwms = <&pwm 2 2000000 0>; ++ pwm-names = "pwm2"; ++ max_brightness = <255>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ }; ++}; ++ ++&pwm { ++ /* ++ * PWM 0 -- fan ++ * PWM 2 -- Blue LED ++ */ ++ pinctrl-0 = <&pwm0_out &pwm2_out>; ++ pinctrl-names = "default"; ++ samsung,pwm-outputs = <0>, <2>; ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3_1 { ++ dr_mode = "host"; ++}; diff --git a/debian/patches/features/arm/arm-dts-fix-power-off-method-for-exynos5422-odroidxu.patch b/debian/patches/features/arm/arm-dts-fix-power-off-method-for-exynos5422-odroidxu.patch new file mode 100644 index 000000000..3da6c730d --- /dev/null +++ b/debian/patches/features/arm/arm-dts-fix-power-off-method-for-exynos5422-odroidxu.patch @@ -0,0 +1,35 @@ +From: Krzysztof Kozlowski +Date: Mon, 17 Aug 2015 08:55:51 +0900 +Subject: [1/3] ARM: dts: Fix power off method for exynos5422-odroidxu3-common +Origin: https://git.kernel.org/linus/0fb033bb3a384fdf1c08bcfaf429ca6431de91c7 +Bug-Debian: https://bugs.debian.org/804850 + +The Odroid XU3 family boards have ACOKB pin of PMIC grounded, instead of +pulled up as usual. This means that PMIC must manually set PWRHOLD field +in its CTRL1 register to low before initiating power down. + +This fixes Odroid XU3 powering off: +[ 25.966053] reboot: Power down +[ 25.967679] Power down. +[ 26.070174] Power down failed, please power off system manually. + +Signed-off-by: Krzysztof Kozlowski +Reported-by: Anand Moon +Reviewed-by: Javier Martinez Canillas +Signed-off-by: Kukjin Kim +--- + arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +index 3b43e57..90d298d 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +@@ -160,6 +160,7 @@ + s2mps11,buck2-ramp-enable = <1>; + s2mps11,buck3-ramp-enable = <1>; + s2mps11,buck4-ramp-enable = <1>; ++ samsung,s2mps11-acokb-ground; + + interrupt-parent = <&gpx0>; + interrupts = <4 IRQ_TYPE_EDGE_FALLING>; diff --git a/debian/patches/features/arm/arm-dts-split-audio-configuration-to-separate-exynos.patch b/debian/patches/features/arm/arm-dts-split-audio-configuration-to-separate-exynos.patch new file mode 100644 index 000000000..4605a6086 --- /dev/null +++ b/debian/patches/features/arm/arm-dts-split-audio-configuration-to-separate-exynos.patch @@ -0,0 +1,185 @@ +From: Krzysztof Kozlowski +Date: Wed, 16 Sep 2015 08:37:07 +0900 +Subject: [2/3] ARM: dts: Split audio configuration to separate + exynos5422-odroidxu3-audio +Origin: https://git.kernel.org/linus/8cec734904f55d5551ac97fa9910752ef521a673 +Bug-Debian: https://bugs.debian.org/804850 + +The Odroid XU4 board does not have audio codec so before adding DTS +for new board split the audio codec to separate DTSI file. Include +the audio codec DTSI in Odroid XU3 and XU3-Lite boards. + +Signed-off-by: Krzysztof Kozlowski +Reviewed-by: Javier Martinez Canillas +Signed-off-by: Kukjin Kim +--- + arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi | 61 ++++++++++++++++++++++ + arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 47 ----------------- + arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts | 1 + + arch/arm/boot/dts/exynos5422-odroidxu3.dts | 1 + + 4 files changed, 63 insertions(+), 47 deletions(-) + create mode 100644 arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi + +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi +new file mode 100644 +index 0000000..9493923 +--- /dev/null ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi +@@ -0,0 +1,61 @@ ++/* ++ * Hardkernel Odroid XU3 Audio Codec device tree source ++ * ++ * Copyright (c) 2015 Krzysztof Kozlowski ++ * Copyright (c) 2014 Collabora Ltd. ++ * Copyright (c) 2013 Samsung Electronics Co., Ltd. ++ * http://www.samsung.com ++ * ++ * 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. ++*/ ++ ++/ { ++ sound: sound { ++ compatible = "simple-audio-card"; ++ ++ simple-audio-card,name = "Odroid-XU3"; ++ simple-audio-card,widgets = ++ "Headphone", "Headphone Jack", ++ "Speakers", "Speakers"; ++ simple-audio-card,routing = ++ "Headphone Jack", "HPL", ++ "Headphone Jack", "HPR", ++ "Headphone Jack", "MICBIAS", ++ "IN1", "Headphone Jack", ++ "Speakers", "SPKL", ++ "Speakers", "SPKR"; ++ ++ simple-audio-card,format = "i2s"; ++ simple-audio-card,bitclock-master = <&link0_codec>; ++ simple-audio-card,frame-master = <&link0_codec>; ++ ++ simple-audio-card,cpu { ++ sound-dai = <&i2s0 0>; ++ system-clock-frequency = <19200000>; ++ }; ++ ++ link0_codec: simple-audio-card,codec { ++ sound-dai = <&max98090>; ++ clocks = <&i2s0 CLK_I2S_CDCLK>; ++ }; ++ }; ++}; ++ ++&hsi2c_5 { ++ status = "okay"; ++ max98090: max98090@10 { ++ compatible = "maxim,max98090"; ++ reg = <0x10>; ++ interrupt-parent = <&gpx3>; ++ interrupts = <2 0>; ++ clocks = <&i2s0 CLK_I2S_CDCLK>; ++ clock-names = "mclk"; ++ #sound-dai-cells = <0>; ++ }; ++}; ++ ++&i2s0 { ++ status = "okay"; ++}; +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +index 90d298d..2f0fb86 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +@@ -80,36 +80,6 @@ + }; + }; + +- sound: sound { +- compatible = "simple-audio-card"; +- +- simple-audio-card,name = "Odroid-XU3"; +- simple-audio-card,widgets = +- "Headphone", "Headphone Jack", +- "Speakers", "Speakers"; +- simple-audio-card,routing = +- "Headphone Jack", "HPL", +- "Headphone Jack", "HPR", +- "Headphone Jack", "MICBIAS", +- "IN1", "Headphone Jack", +- "Speakers", "SPKL", +- "Speakers", "SPKR"; +- +- simple-audio-card,format = "i2s"; +- simple-audio-card,bitclock-master = <&link0_codec>; +- simple-audio-card,frame-master = <&link0_codec>; +- +- simple-audio-card,cpu { +- sound-dai = <&i2s0 0>; +- system-clock-frequency = <19200000>; +- }; +- +- link0_codec: simple-audio-card,codec { +- sound-dai = <&max98090>; +- clocks = <&i2s0 CLK_I2S_CDCLK>; +- }; +- }; +- + fan0: pwm-fan { + compatible = "pwm-fan"; + pwms = <&pwm 0 20972 0>; +@@ -376,19 +346,6 @@ + }; + }; + +-&hsi2c_5 { +- status = "okay"; +- max98090: max98090@10 { +- compatible = "maxim,max98090"; +- reg = <0x10>; +- interrupt-parent = <&gpx3>; +- interrupts = <2 0>; +- clocks = <&i2s0 CLK_I2S_CDCLK>; +- clock-names = "mclk"; +- #sound-dai-cells = <0>; +- }; +-}; +- + &i2c_2 { + samsung,i2c-sda-delay = <100>; + samsung,i2c-max-bus-freq = <66000>; +@@ -400,10 +357,6 @@ + }; + }; + +-&i2s0 { +- status = "okay"; +-}; +- + &mfc { + samsung,mfc-r = <0x43000000 0x800000>; + samsung,mfc-l = <0x51000000 0x800000>; +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts +index c06882b..9c0cea9 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts +@@ -13,6 +13,7 @@ + + /dts-v1/; + #include "exynos5422-odroidxu3-common.dtsi" ++#include "exynos5422-odroidxu3-audio.dtsi" + + / { + model = "Hardkernel Odroid XU3 Lite"; +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts +index 78e6a50..d8647a4 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts +@@ -12,6 +12,7 @@ + + /dts-v1/; + #include "exynos5422-odroidxu3-common.dtsi" ++#include "exynos5422-odroidxu3-audio.dtsi" + + / { + model = "Hardkernel Odroid XU3"; diff --git a/debian/patches/features/arm/mfd-s2mps11-add-manual-shutdown-method-for-odroid-xu.patch b/debian/patches/features/arm/mfd-s2mps11-add-manual-shutdown-method-for-odroid-xu.patch new file mode 100644 index 000000000..331d1dc02 --- /dev/null +++ b/debian/patches/features/arm/mfd-s2mps11-add-manual-shutdown-method-for-odroid-xu.patch @@ -0,0 +1,116 @@ +From: Krzysztof Kozlowski +Date: Mon, 14 Sep 2015 21:12:45 +0900 +Subject: mfd: s2mps11: Add manual shutdown method for Odroid XU3 +Origin: https://git.kernel.org/linus/d785334a0d5deff30a487c74324b842d2179553d +Bug-Debian: https://bugs.debian.org/804850 + +On Odroid XU3 board (with S2MPS11 PMIC) the PWRHOLD bit in CTRL1 +register must be manually set to 0 before initiating power off sequence. + +One of usual power down methods for Exynos based devices looks like: +1. PWRHOLD pin of PMIC is connected to PSHOLD of Exynos SoC. +2. Exynos holds up this pin during system operation. +3. ACOKB pin of PMIC is pulled up to VBATT and optionally to pin in + other device. +4. When PWRHOLD/PSHOLD goes low, the PMIC will turn off the power if + ACOKB goes high. + +On Odroid XU3 family the difference is in (3) - the ACOKB is grounded. +This means that PMIC must manually set PWRHOLD field to low and then +wait for signal from Application Processor (the usual change in +PWRHOLD/PSHOLD pin will actually cut off the power). + +The patch adds respective binding allowing Odroid XU3 device to be +powered off. + +Signed-off-by: Krzysztof Kozlowski +Reported-by: Anand Moon +Tested-by: Anand Moon +Reviewed-by: Javier Martinez Canillas +Signed-off-by: Lee Jones +--- + drivers/mfd/sec-core.c | 30 ++++++++++++++++++++++++++++++ + include/linux/mfd/samsung/core.h | 2 ++ + include/linux/mfd/samsung/s2mps11.h | 1 + + 3 files changed, 33 insertions(+) + +diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c +index d206a3e..2d1137a 100644 +--- a/drivers/mfd/sec-core.c ++++ b/drivers/mfd/sec-core.c +@@ -278,6 +278,8 @@ static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata( + * not parsed here. + */ + ++ pd->manual_poweroff = of_property_read_bool(dev->of_node, ++ "samsung,s2mps11-acokb-ground"); + return pd; + } + #else +@@ -440,6 +442,33 @@ static int sec_pmic_remove(struct i2c_client *i2c) + return 0; + } + ++static void sec_pmic_shutdown(struct i2c_client *i2c) ++{ ++ struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c); ++ unsigned int reg, mask; ++ ++ if (!sec_pmic->pdata->manual_poweroff) ++ return; ++ ++ switch (sec_pmic->device_type) { ++ case S2MPS11X: ++ reg = S2MPS11_REG_CTRL1; ++ mask = S2MPS11_CTRL1_PWRHOLD_MASK; ++ break; ++ default: ++ /* ++ * Currently only one board with S2MPS11 needs this, so just ++ * ignore the rest. ++ */ ++ dev_warn(sec_pmic->dev, ++ "Unsupported device %lu for manual power off\n", ++ sec_pmic->device_type); ++ return; ++ } ++ ++ regmap_update_bits(sec_pmic->regmap_pmic, reg, mask, 0); ++} ++ + #ifdef CONFIG_PM_SLEEP + static int sec_pmic_suspend(struct device *dev) + { +@@ -491,6 +520,7 @@ static struct i2c_driver sec_pmic_driver = { + }, + .probe = sec_pmic_probe, + .remove = sec_pmic_remove, ++ .shutdown = sec_pmic_shutdown, + .id_table = sec_pmic_id, + }; + +diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h +index 7511538..aa78957 100644 +--- a/include/linux/mfd/samsung/core.h ++++ b/include/linux/mfd/samsung/core.h +@@ -132,6 +132,8 @@ struct sec_platform_data { + int buck2_init; + int buck3_init; + int buck4_init; ++ /* Whether or not manually set PWRHOLD to low during shutdown. */ ++ bool manual_poweroff; + }; + + /** +diff --git a/include/linux/mfd/samsung/s2mps11.h b/include/linux/mfd/samsung/s2mps11.h +index 7981a9d..b288965 100644 +--- a/include/linux/mfd/samsung/s2mps11.h ++++ b/include/linux/mfd/samsung/s2mps11.h +@@ -179,6 +179,7 @@ enum s2mps11_regulators { + #define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1) + #define S2MPS11_RAMP_DELAY 25000 /* uV/us */ + ++#define S2MPS11_CTRL1_PWRHOLD_MASK BIT(4) + + #define S2MPS11_BUCK2_RAMP_SHIFT 6 + #define S2MPS11_BUCK34_RAMP_SHIFT 4 diff --git a/debian/patches/series b/debian/patches/series index 803c64b6e..f37662c18 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -99,3 +99,7 @@ bugfix/x86/drm-i915-shut-up-gen8-sde-irq-dmesg-noise.patch bugfix/arm/arm-dts-kirkwood-fix-qnap-ts219-power-off.patch bugfix/x86/drm-i915-mark-uneven-memory-banks-on-gen4-desktop-as.patch bugfix/x86/bios-return-actual-size-of-the-buffer-retrieved-via-_rom.patch +features/arm/mfd-s2mps11-add-manual-shutdown-method-for-odroid-xu.patch +features/arm/arm-dts-fix-power-off-method-for-exynos5422-odroidxu.patch +features/arm/arm-dts-split-audio-configuration-to-separate-exynos.patch +features/arm/arm-dts-add-support-odroid-xu4-board-for-exynos5422-.patch