Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90c6e353 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski
Browse files

ARM: dts: exynos: Use common macros for pinctrl configuration



Replace duplicated macros in each DTSI file with a common macro coming
from header.  Include the header in each pinctrl DTSI so further changes
could use it.

Although PIN_FUNC_SPC_2 does not bring much information about the
function itself, it still is more descriptive then hard-coded
number <2>.

Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent c0fee590
Loading
Loading
Loading
Loading
+32 −44
Original line number Diff line number Diff line
@@ -12,42 +12,30 @@
 * published by the Free Software Foundation.
*/

#define PIN_PULL_NONE		0
#define PIN_PULL_DOWN		1
#define PIN_PULL_UP		3

#define PIN_DRV_LV1		0
#define PIN_DRV_LV2		2
#define PIN_DRV_LV3		1
#define PIN_DRV_LV4		3

#define PIN_PDN_OUT0		0
#define PIN_PDN_OUT1		1
#define PIN_PDN_INPUT		2
#define PIN_PDN_PREV		3
#include <dt-bindings/pinctrl/samsung.h>

#define PIN_IN(_pin, _pull, _drv)					\
	_pin {								\
		samsung,pins = #_pin;					\
		samsung,pin-function = <0>;		\
		samsung,pin-pud = <PIN_PULL_ ##_pull>;	\
		samsung,pin-drv = <PIN_DRV_ ##_drv>;	\
		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;		\
		samsung,pin-pud = <EXYNOS_PIN_PULL_ ##_pull>;		\
		samsung,pin-drv = <EXYNOS4_PIN_DRV_ ##_drv>;		\
	}

#define PIN_OUT(_pin, _drv)						\
	_pin {								\
		samsung,pins = #_pin;					\
		samsung,pin-function = <1>;		\
		samsung,pin-pud = <0>;			\
		samsung,pin-drv = <PIN_DRV_ ##_drv>;	\
		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;	\
		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;		\
		samsung,pin-drv = <EXYNOS4_PIN_DRV_ ##_drv>;		\
	}

#define PIN_OUT_SET(_pin, _val, _drv)					\
	_pin {								\
		samsung,pins = #_pin;					\
		samsung,pin-function = <1>;		\
		samsung,pin-pud = <0>;			\
		samsung,pin-drv = <PIN_DRV_ ##_drv>;	\
		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;	\
		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;		\
		samsung,pin-drv = <EXYNOS4_PIN_DRV_ ##_drv>;		\
		samsung,pin-val = <_val>;				\
	}

@@ -55,15 +43,15 @@
	_pin {								\
		samsung,pins = #_pin;					\
		samsung,pin-function = <_sel>;				\
		samsung,pin-pud = <PIN_PULL_ ##_pull>;	\
		samsung,pin-drv = <PIN_DRV_ ##_drv>;	\
		samsung,pin-pud = <EXYNOS_PIN_PULL_ ##_pull>;		\
		samsung,pin-drv = <EXYNOS4_PIN_DRV_ ##_drv>;		\
	}

#define PIN_SLP(_pin, _mode, _pull)					\
	_pin {								\
		samsung,pins = #_pin;					\
		samsung,pin-con-pdn = <PIN_PDN_ ##_mode>;	\
		samsung,pin-pud-pdn = <PIN_PULL_ ##_pull>;	\
		samsung,pin-con-pdn = <EXYNOS_PIN_PDN_ ##_mode>;	\
		samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_ ##_pull>;	\
	}

&pinctrl_0 {
+2 −0
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@
 * published by the Free Software Foundation.
*/

#include <dt-bindings/pinctrl/samsung.h>

/ {
	pinctrl@11400000 {
		gpa0: gpa0 {
+2 −0
Original line number Diff line number Diff line
@@ -11,6 +11,8 @@
 * published by the Free Software Foundation.
*/

#include <dt-bindings/pinctrl/samsung.h>

&pinctrl_0 {
	gpa0: gpa0 {
		gpio-controller;
+7 −14
Original line number Diff line number Diff line
@@ -12,20 +12,13 @@
 * published by the Free Software Foundation.
*/

#define PIN_PULL_NONE		0
#define PIN_PULL_DOWN		1
#define PIN_PULL_UP		3

#define PIN_PDN_OUT0		0
#define PIN_PDN_OUT1		1
#define PIN_PDN_INPUT		2
#define PIN_PDN_PREV		3
#include <dt-bindings/pinctrl/samsung.h>

#define PIN_SLP(_pin, _mode, _pull)					\
	_pin {								\
		samsung,pins = #_pin;					\
		samsung,pin-con-pdn = <PIN_PDN_ ##_mode>;	\
		samsung,pin-pud-pdn = <PIN_PULL_ ##_pull>;	\
		samsung,pin-con-pdn = <EXYNOS_PIN_PDN_ ##_mode>;	\
		samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_ ##_pull>;	\
	}

/ {
+2 −0
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@
 * published by the Free Software Foundation.
*/

#include <dt-bindings/pinctrl/samsung.h>

&pinctrl_0 {
	gpa0: gpa0 {
		gpio-controller;
Loading