All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Tomasz Figa <tomasz.figa@gmail.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org,
	Kukjin Kim <kgene@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	javier@osg.samsung.com, Linus Walleij <linus.walleij@linaro.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>
Subject: [PATCH v3 01/17] pinctrl: dt-bindings: samsung: Add header with values used for configuration
Date: Sun,  4 Sep 2016 13:04:04 +0200	[thread overview]
Message-ID: <1472987060-28293-2-git-send-email-krzk@kernel.org> (raw)
In-Reply-To: <1472987060-28293-1-git-send-email-krzk@kernel.org>

From: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Hard-coded pinctrl configuration values are scattered through DTS files.
The numbers are difficult to decode by human, especially without the
datasheet.  Additionally the drive strength differs between S3C64xx,
S5PV210 and Exynos SoC families increasing the confusion.

The header will help making this more readable and maintainable.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>

---

Changes since v2:
1. Rename double-include protection (suggested by Bartlomiej).
2. Squash here:
   pinctrl: dt-bindings: samsung: Add macros for S3C64xx pin configuration
   http://www.spinics.net/lists/arm-kernel/msg528016.html
3. Add Javier's reviewed-by.
4. Extend MAINTAINERS entry with bindings documentation
---
 MAINTAINERS                           |  2 ++
 include/dt-bindings/pinctrl/samsung.h | 57 +++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 include/dt-bindings/pinctrl/samsung.h

diff --git a/MAINTAINERS b/MAINTAINERS
index d8e81b1dde30..be3dcca8439a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9318,6 +9318,8 @@ L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:	linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
 S:	Maintained
 F:	drivers/pinctrl/samsung/
+F:	include/dt-bindings/pinctrl/samsung.h
+F:	Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
 
 PIN CONTROLLER - SINGLE
 M:	Tony Lindgren <tony@atomide.com>
diff --git a/include/dt-bindings/pinctrl/samsung.h b/include/dt-bindings/pinctrl/samsung.h
new file mode 100644
index 000000000000..6276eb785e2b
--- /dev/null
+++ b/include/dt-bindings/pinctrl/samsung.h
@@ -0,0 +1,57 @@
+/*
+ * Samsung's Exynos pinctrl bindings
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ * Author: Krzysztof Kozlowski <krzk@kernel.org>
+ *
+ * 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.
+*/
+
+#ifndef __DT_BINDINGS_PINCTRL_SAMSUNG_H__
+#define __DT_BINDINGS_PINCTRL_SAMSUNG_H__
+
+#define EXYNOS_PIN_PULL_NONE		0
+#define EXYNOS_PIN_PULL_DOWN		1
+#define EXYNOS_PIN_PULL_UP		3
+
+#define S3C64XX_PIN_PULL_NONE		0
+#define S3C64XX_PIN_PULL_DOWN		1
+#define S3C64XX_PIN_PULL_UP		2
+
+/* Pin function in power down mode */
+#define EXYNOS_PIN_PDN_OUT0		0
+#define EXYNOS_PIN_PDN_OUT1		1
+#define EXYNOS_PIN_PDN_INPUT		2
+#define EXYNOS_PIN_PDN_PREV		3
+
+/* Drive strengths for Exynos3250, Exynos4 (all) and Exynos5250 */
+#define EXYNOS4_PIN_DRV_LV1		0
+#define EXYNOS4_PIN_DRV_LV2		2
+#define EXYNOS4_PIN_DRV_LV3		1
+#define EXYNOS4_PIN_DRV_LV4		3
+
+/* Drive strengths for Exynos5260 */
+#define EXYNOS5260_PIN_DRV_LV1		0
+#define EXYNOS5260_PIN_DRV_LV2		1
+#define EXYNOS5260_PIN_DRV_LV4		2
+#define EXYNOS5260_PIN_DRV_LV6		3
+
+/* Drive strengths for Exynos5410, Exynos542x and Exynos5800 */
+#define EXYNOS5420_PIN_DRV_LV1		0
+#define EXYNOS5420_PIN_DRV_LV2		1
+#define EXYNOS5420_PIN_DRV_LV3		2
+#define EXYNOS5420_PIN_DRV_LV4		3
+
+#define EXYNOS_PIN_FUNC_INPUT		0
+#define EXYNOS_PIN_FUNC_OUTPUT		1
+#define EXYNOS_PIN_FUNC_2		2
+#define EXYNOS_PIN_FUNC_3		3
+#define EXYNOS_PIN_FUNC_4		4
+#define EXYNOS_PIN_FUNC_5		5
+#define EXYNOS_PIN_FUNC_6		6
+#define EXYNOS_PIN_FUNC_F		0xf
+
+#endif /* __DT_BINDINGS_PINCTRL_SAMSUNG_H__ */
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: krzk@kernel.org (Krzysztof Kozlowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 01/17] pinctrl: dt-bindings: samsung: Add header with values used for configuration
Date: Sun,  4 Sep 2016 13:04:04 +0200	[thread overview]
Message-ID: <1472987060-28293-2-git-send-email-krzk@kernel.org> (raw)
In-Reply-To: <1472987060-28293-1-git-send-email-krzk@kernel.org>

From: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Hard-coded pinctrl configuration values are scattered through DTS files.
The numbers are difficult to decode by human, especially without the
datasheet.  Additionally the drive strength differs between S3C64xx,
S5PV210 and Exynos SoC families increasing the confusion.

The header will help making this more readable and maintainable.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>

---

Changes since v2:
1. Rename double-include protection (suggested by Bartlomiej).
2. Squash here:
   pinctrl: dt-bindings: samsung: Add macros for S3C64xx pin configuration
   http://www.spinics.net/lists/arm-kernel/msg528016.html
3. Add Javier's reviewed-by.
4. Extend MAINTAINERS entry with bindings documentation
---
 MAINTAINERS                           |  2 ++
 include/dt-bindings/pinctrl/samsung.h | 57 +++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 include/dt-bindings/pinctrl/samsung.h

diff --git a/MAINTAINERS b/MAINTAINERS
index d8e81b1dde30..be3dcca8439a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9318,6 +9318,8 @@ L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
 L:	linux-samsung-soc at vger.kernel.org (moderated for non-subscribers)
 S:	Maintained
 F:	drivers/pinctrl/samsung/
+F:	include/dt-bindings/pinctrl/samsung.h
+F:	Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
 
 PIN CONTROLLER - SINGLE
 M:	Tony Lindgren <tony@atomide.com>
diff --git a/include/dt-bindings/pinctrl/samsung.h b/include/dt-bindings/pinctrl/samsung.h
new file mode 100644
index 000000000000..6276eb785e2b
--- /dev/null
+++ b/include/dt-bindings/pinctrl/samsung.h
@@ -0,0 +1,57 @@
+/*
+ * Samsung's Exynos pinctrl bindings
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ * Author: Krzysztof Kozlowski <krzk@kernel.org>
+ *
+ * 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.
+*/
+
+#ifndef __DT_BINDINGS_PINCTRL_SAMSUNG_H__
+#define __DT_BINDINGS_PINCTRL_SAMSUNG_H__
+
+#define EXYNOS_PIN_PULL_NONE		0
+#define EXYNOS_PIN_PULL_DOWN		1
+#define EXYNOS_PIN_PULL_UP		3
+
+#define S3C64XX_PIN_PULL_NONE		0
+#define S3C64XX_PIN_PULL_DOWN		1
+#define S3C64XX_PIN_PULL_UP		2
+
+/* Pin function in power down mode */
+#define EXYNOS_PIN_PDN_OUT0		0
+#define EXYNOS_PIN_PDN_OUT1		1
+#define EXYNOS_PIN_PDN_INPUT		2
+#define EXYNOS_PIN_PDN_PREV		3
+
+/* Drive strengths for Exynos3250, Exynos4 (all) and Exynos5250 */
+#define EXYNOS4_PIN_DRV_LV1		0
+#define EXYNOS4_PIN_DRV_LV2		2
+#define EXYNOS4_PIN_DRV_LV3		1
+#define EXYNOS4_PIN_DRV_LV4		3
+
+/* Drive strengths for Exynos5260 */
+#define EXYNOS5260_PIN_DRV_LV1		0
+#define EXYNOS5260_PIN_DRV_LV2		1
+#define EXYNOS5260_PIN_DRV_LV4		2
+#define EXYNOS5260_PIN_DRV_LV6		3
+
+/* Drive strengths for Exynos5410, Exynos542x and Exynos5800 */
+#define EXYNOS5420_PIN_DRV_LV1		0
+#define EXYNOS5420_PIN_DRV_LV2		1
+#define EXYNOS5420_PIN_DRV_LV3		2
+#define EXYNOS5420_PIN_DRV_LV4		3
+
+#define EXYNOS_PIN_FUNC_INPUT		0
+#define EXYNOS_PIN_FUNC_OUTPUT		1
+#define EXYNOS_PIN_FUNC_2		2
+#define EXYNOS_PIN_FUNC_3		3
+#define EXYNOS_PIN_FUNC_4		4
+#define EXYNOS_PIN_FUNC_5		5
+#define EXYNOS_PIN_FUNC_6		6
+#define EXYNOS_PIN_FUNC_F		0xf
+
+#endif /* __DT_BINDINGS_PINCTRL_SAMSUNG_H__ */
-- 
2.7.4

  reply	other threads:[~2016-09-04 11:04 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-04 11:04 [PATCH v3 00/17] pinctrl: exynos/samsung: Add header with values used for configuration Krzysztof Kozlowski
2016-09-04 11:04 ` Krzysztof Kozlowski
2016-09-04 11:04 ` Krzysztof Kozlowski
2016-09-04 11:04 ` Krzysztof Kozlowski [this message]
2016-09-04 11:04   ` [PATCH v3 01/17] pinctrl: dt-bindings: samsung: " Krzysztof Kozlowski
2016-09-07 21:18   ` Linus Walleij
2016-09-07 21:18     ` Linus Walleij
2016-09-07 21:18     ` Linus Walleij
     [not found]     ` <CGME20160916075624eucas1p23a12de912f92f0c557f17fbd394b186e@eucas1p2.samsung.com>
2016-09-16  7:56       ` Krzysztof Kozlowski
2016-09-16  7:56         ` Krzysztof Kozlowski
2016-09-16  7:56         ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 02/17] pinctrl: dt-bindings: samsung: Update documentation with new macros Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-07 21:19   ` Linus Walleij
2016-09-07 21:19     ` Linus Walleij
2016-09-07 21:19     ` Linus Walleij
2016-09-12 16:10   ` Rob Herring
2016-09-12 16:10     ` Rob Herring
2016-09-12 16:10     ` Rob Herring
2016-09-04 11:04 ` [PATCH v3 03/17] ARM: dts: exynos: Use common macros for pinctrl configuration Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 04/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos3250 Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 05/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos4210 Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 06/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos4x12 Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 07/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos4415 Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 08/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos5250 Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 09/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos5260 Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 10/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos5410 Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 11/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos542x/exynos5800 Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 12/17] ARM: dts: exynos: Fix mismatched value for SD4 pull up/down configuration on exynos4210 Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 13/17] ARM: dts: exynos: Fix mismatched values of SD drive strengh configuration on exynos4415 Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 14/17] ARM: dts: s3c64xx: Use common macros for pinctrl configuration Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 15/17] ARM: dts: s5pv210: Use " Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 16/17] ARM: dts: s3c2416: " Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-09-04 11:04 ` [PATCH v3 17/17] ARM: dts: s3c64xx: " Krzysztof Kozlowski
2016-09-04 11:04   ` Krzysztof Kozlowski
2016-10-09  7:04 ` [PATCH v3 00/17] pinctrl: exynos/samsung: Add header with values used for configuration Tomasz Figa
2016-10-09  7:04   ` Tomasz Figa
2016-10-09  7:04   ` Tomasz Figa
2016-10-09 16:39   ` Krzysztof Kozlowski
2016-10-09 16:39     ` Krzysztof Kozlowski
2016-10-09 16:39     ` Krzysztof Kozlowski
2016-10-09 17:49     ` Tomasz Figa
2016-10-09 17:49       ` Tomasz Figa
2016-10-09 17:49       ` Tomasz Figa
2016-10-09 17:52       ` Krzysztof Kozlowski
2016-10-09 17:52         ` Krzysztof Kozlowski
2016-10-09 17:52         ` Krzysztof Kozlowski
2016-10-21  9:02 ` Linus Walleij
2016-10-21  9:02   ` Linus Walleij
2016-10-21  9:02   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472987060-28293-2-git-send-email-krzk@kernel.org \
    --to=krzk@kernel.org \
    --cc=arnd@arndb.de \
    --cc=b.zolnierkie@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=javier@osg.samsung.com \
    --cc=k.kozlowski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=tomasz.figa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.