Skip to contentSkip to conversation

Add pinctrl support for Sky1

PATCH Superseded Gary Yang 3 participants 33 messages Aug 27, 2025 – Sep 11, 2025

Subsystems (4)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Gary Yang

author maintainer
#0 lore raw

cover Add pinctrl support for Sky1

patch 1: add Cix pinctrl driver which needs to support pinmux and pinconfigs patch 2: add Cix pinctrl nodes and header file
patch 3: add yaml docs

Gary Yang (3):
pinctrl: cix: Add pin-controller support for sky1
dt-bindings: pinctrl: Add cix,sky1-pinctrl
arm64: dts: cix: Add pinctrl nodes for sky1

 .../bindings/pinctrl/cix,sky1-pinctrl.yaml    |  77 +++
 arch/arm64/boot/dts/cix/sky1-orion-o6.dts     |  28 +
 arch/arm64/boot/dts/cix/sky1.dtsi             |  10 +
 drivers/pinctrl/Kconfig                       |   1 +
 drivers/pinctrl/Makefile                      |   1 +
 drivers/pinctrl/cix/Kconfig                   |  14 +
 drivers/pinctrl/cix/Makefile                  |   4 +
 drivers/pinctrl/cix/pinctrl-sky1-base.c       | 622 ++++++++++++++++++
 drivers/pinctrl/cix/pinctrl-sky1.c            | 502 ++++++++++++++
 drivers/pinctrl/cix/pinctrl-sky1.h            |  55 ++
 include/dt-bindings/pinctrl/pads-sky1.h       | 592 +++++++++++++++++
 11 files changed, 1906 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml
 create mode 100644 drivers/pinctrl/cix/Kconfig
 create mode 100644 drivers/pinctrl/cix/Makefile
 create mode 100644 drivers/pinctrl/cix/pinctrl-sky1-base.c
 create mode 100644 drivers/pinctrl/cix/pinctrl-sky1.c
 create mode 100644 drivers/pinctrl/cix/pinctrl-sky1.h
 create mode 100644 include/dt-bindings/pinctrl/pads-sky1.h
Signature · 1 line
2.49.0
author maintainer
#1 lore raw

PATCH 1/3 pinctrl: cix: Add pin-controller support for sky1

Add the pin-controller driver for Sky1 platform

---
 drivers/pinctrl/Kconfig                 |   1 +
 drivers/pinctrl/Makefile                |   1 +
 drivers/pinctrl/cix/Kconfig             |  14 +
 drivers/pinctrl/cix/Makefile            |   4 +
 drivers/pinctrl/cix/pinctrl-sky1-base.c | 622 ++++++++++++++++++++++++
 drivers/pinctrl/cix/pinctrl-sky1.c      | 502 +++++++++++++++++++
 drivers/pinctrl/cix/pinctrl-sky1.h      |  55 +++
 7 files changed, 1199 insertions(+)
 create mode 100644 drivers/pinctrl/cix/Kconfig
 create mode 100644 drivers/pinctrl/cix/Makefile
 create mode 100644 drivers/pinctrl/cix/pinctrl-sky1-base.c
 create mode 100644 drivers/pinctrl/cix/pinctrl-sky1.c
 create mode 100644 drivers/pinctrl/cix/pinctrl-sky1.h
drivers/pinctrl/Kconfig +1 -0
index ddd11668457c..a5b7177be115 100644
@@ -653,6 +653,7 @@ source "drivers/pinctrl/aspeed/Kconfig"
 source "drivers/pinctrl/bcm/Kconfig"
 source "drivers/pinctrl/berlin/Kconfig"
 source "drivers/pinctrl/cirrus/Kconfig"
+source "drivers/pinctrl/cix/Kconfig"
 source "drivers/pinctrl/freescale/Kconfig"
 source "drivers/pinctrl/intel/Kconfig"
 source "drivers/pinctrl/mediatek/Kconfig"
drivers/pinctrl/Makefile +1 -0
index 909ab89a56d2..8f353fc38e0e 100644
@@ -67,6 +67,7 @@ obj-$(CONFIG_ARCH_ASPEED)	+= aspeed/
 obj-y				+= bcm/
 obj-$(CONFIG_PINCTRL_BERLIN)	+= berlin/
 obj-y				+= cirrus/
+obj-y				+= cix/
 obj-y				+= freescale/
 obj-$(CONFIG_X86)		+= intel/
 obj-y				+= mediatek/
drivers/pinctrl/cix/Kconfig new file +14 -0
new file mode 100644
index 000000000000..42e064b6e7a2
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config PINCTRL_SKY1_BASE
+	tristate
+	select GENERIC_PINCTRL_GROUPS
+	select GENERIC_PINMUX_FUNCTIONS
+	select GENERIC_PINCONF
+	select REGMAP
+
+config PINCTRL_SKY1
+	tristate "Cix Sky1 pinctrl driver"
+	depends on ARCH_CIX
+	select PINCTRL_SKY1_BASE
+	help
+	  Say Y here to enable the sky1 pinctrl driver
drivers/pinctrl/cix/Makefile new file +4 -0
new file mode 100644
index 000000000000..22685d6a107b
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+# Cix Sky1 pin control drivers
+obj-$(CONFIG_PINCTRL_SKY1_BASE)	+= pinctrl-sky1-base.o
+obj-$(CONFIG_PINCTRL_SKY1)	+= pinctrl-sky1.o
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +622 -0

622 lines not on this page · raw message

drivers/pinctrl/cix/pinctrl-sky1.c new file +502 -0

502 lines not on this page · raw message

drivers/pinctrl/cix/pinctrl-sky1.h new file +55 -0

55 lines not on this page · raw message

Signature · 1 line
2.49.0
#2 lore raw

Re: [PATCH 1/3] pinctrl: cix: Add pin-controller support for sky1

Quoted 107 lines · Gary Yang
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +107 -0
+
+static int sky1_pinctrl_probe_dt(struct platform_device *pdev,
+				struct sky1_pinctrl *spctl)
+{
+	struct device_node *np = pdev->dev.of_node;
+	struct device_node *child;
+	struct pinctrl_dev *pctl = spctl->pctl;
+	u32 nfuncs = 0;
+	u32 i = 0;
+	bool flat_funcs;
+
+	if (!np)
+		return -ENODEV;
+
+	flat_funcs = sky1_pinctrl_dt_is_flat_functions(np);
+	if (flat_funcs) {
+		nfuncs = 1;
+	} else {
+		nfuncs = of_get_child_count(np);
+		if (nfuncs == 0) {
+			dev_err(&pdev->dev, "no functions defined\n");
+			return -EINVAL;
+		}
+	}
+
+	for (i = 0; i < nfuncs; i++) {
+		struct function_desc *function;
+
+		function = devm_kzalloc(&pdev->dev, sizeof(*function),
+					GFP_KERNEL);
+		if (!function)
+			return -ENOMEM;
+
+		mutex_lock(&spctl->mutex);
+		radix_tree_insert(&pctl->pin_function_tree, i, function);
+		mutex_unlock(&spctl->mutex);
+	}
+	pctl->num_functions = nfuncs;
+
+	spctl->group_index = 0;
+	if (flat_funcs) {
+		pctl->num_groups = of_get_child_count(np);
+	} else {
+		pctl->num_groups = 0;
+		for_each_child_of_node(np, child)
+			pctl->num_groups += of_get_child_count(child);
+	}
+
+	if (flat_funcs) {
+		sky1_pinctrl_parse_functions(np, spctl, 0);
+	} else {
+		i = 0;
+		for_each_child_of_node(np, child)
+			sky1_pinctrl_parse_functions(child, spctl, i++);
+	}
+
+	return 0;
+}
+
+int sky1_base_pinctrl_probe(struct platform_device *pdev,
+		      const struct sky1_pinctrl_soc_info *info)
+{
+	struct pinctrl_desc *sky1_pinctrl_desc;
+	struct sky1_pinctrl *spctl;
+	int ret, i;
+
+	if (!info || !info->pins || !info->npins) {
+		dev_err(&pdev->dev, "wrong pinctrl info\n");
+		return -EINVAL;
+	}
+
+	/* Create state holders etc for this driver */
+	spctl = devm_kzalloc(&pdev->dev, sizeof(*spctl), GFP_KERNEL);
+	if (!spctl)
+		return -ENOMEM;
+
+	spctl->pin_regs = devm_kmalloc_array(&pdev->dev, info->npins,
+					    sizeof(*spctl->pin_regs),
+					    GFP_KERNEL);
+	if (!spctl->pin_regs)
+		return -ENOMEM;
+
+	for (i = 0; i < info->npins; i++)
+		spctl->pin_regs[i] = -1;
+
+	spctl->base = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(spctl->base))
+		return PTR_ERR(spctl->base);
+
+	sky1_pinctrl_desc = devm_kzalloc(&pdev->dev, sizeof(*sky1_pinctrl_desc),
+					GFP_KERNEL);
+	if (!sky1_pinctrl_desc)
+		return -ENOMEM;
+
+	sky1_pinctrl_desc->name = dev_name(&pdev->dev);
+	sky1_pinctrl_desc->pins = info->pins;
+	sky1_pinctrl_desc->npins = info->npins;
+	sky1_pinctrl_desc->pctlops = &sky1_pctrl_ops;
+	sky1_pinctrl_desc->pmxops = &sky1_pmx_ops;
+	sky1_pinctrl_desc->confops = &sky1_pinconf_ops;
+	sky1_pinctrl_desc->owner = THIS_MODULE;
+
+	mutex_init(&spctl->mutex);
+
+	spctl->info = info;
+	spctl->dev = &pdev->dev;
+	platform_set_drvdata(pdev, spctl);

drivers/pinctrl/cix/pinctrl-sky1-base.c line 606

Quoted 10 lines
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +10 -0
+	ret = devm_pinctrl_register_and_init(&pdev->dev,
+					     sky1_pinctrl_desc, spctl,
+					     &spctl->pctl);
+	if (ret) {
+		dev_err(&pdev->dev, "could not register SKY1 pinctrl driver\n");
+		return ret;
+	}
+
+	ret = sky1_pinctrl_probe_dt(pdev, spctl);
+

No blank line here.

Review

Quoted 2 lines
(quoted diff) +2 -0
+	if (ret) {
+		dev_err(&pdev->dev, "fail to probe dt properties\n");

You are printing same error twice. Drop this and just handle error printing in sky1_pinctrl_probe_dt().
Especially that you now print errors on ENOMEM.

drivers/pinctrl/cix/pinctrl-sky1-base.c line 613

Quoted 5 lines
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +5 -0
+		return ret;
+	}
+
+	pinctrl_provide_dummies();
+	dev_info(&pdev->dev, "initialized SKY1 pinctrl driver\n");

No, please drop. Drivers should be silent on success.

Quoted 5 lines
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +5 -0
+
+	return pinctrl_enable(spctl->pctl);
+}
+EXPORT_SYMBOL_GPL(sky1_base_pinctrl_probe);
+

..

drivers/pinctrl/cix/pinctrl-sky1.c line 488

Quoted 5 lines
drivers/pinctrl/cix/pinctrl-sky1.c new file +5 -0
+
+static struct platform_driver sky1_pinctrl_driver = {
+	.driver = {
+		.name = "sky1-pinctrl",
+		.of_match_table = of_match_ptr(sky1_pinctrl_of_match),

You have a warning here - please drop of_match_ptr.

Quoted 20 lines
drivers/pinctrl/cix/pinctrl-sky1.c new file +14 -0
+		.pm = &sky1_pinctrl_pm_ops,
+	},
+	.probe = sky1_pinctrl_probe,
+};
+
+static int __init sky1_pinctrl_init(void)
+{
+	return platform_driver_register(&sky1_pinctrl_driver);
+}
+arch_initcall(sky1_pinctrl_init);
+
+MODULE_AUTHOR("Jerry Zhu <[email protected]>");
+MODULE_DESCRIPTION("Cix Sky1 pinctrl driver");
+MODULE_LICENSE("GPL");
drivers/pinctrl/cix/pinctrl-sky1.h new file +0 -0
new file mode 100644
index 000000000000..09b25dbb6db3

drivers/pinctrl/cix/pinctrl-sky1.h line 10

Quoted 10 lines
drivers/pinctrl/cix/pinctrl-sky1.h new file +10 -0
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Author: Jerry Zhu <[email protected]>
+ */
+
+#ifndef __DRIVERS_PINCTRL_SKY1_H
+#define __DRIVERS_PINCTRL_SKY1_H
+
+#include <linux/pinctrl/pinconf-generic.h>
+#include <linux/pinctrl/pinmux.h>

Are you sure you use both headers in this header?

Best regards,
Krzysztof

author maintainer
#3 lore raw

回复: [PATCH 1/3] pinctrl: cix: Add pin-controller support for sky1

Hi Krzysztof,

Quoted 114 lines · Gary Yang
Quoted 78 lines
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +78 -0
+
+static int sky1_pinctrl_probe_dt(struct platform_device *pdev,
+                             struct sky1_pinctrl *spctl) {
+     struct device_node *np = pdev->dev.of_node;
+     struct device_node *child;
+     struct pinctrl_dev *pctl = spctl->pctl;
+     u32 nfuncs = 0;
+     u32 i = 0;
+     bool flat_funcs;
+
+     if (!np)
+             return -ENODEV;
+
+     flat_funcs = sky1_pinctrl_dt_is_flat_functions(np);
+     if (flat_funcs) {
+             nfuncs = 1;
+     } else {
+             nfuncs = of_get_child_count(np);
+             if (nfuncs == 0) {
+                     dev_err(&pdev->dev, "no functions defined\n");
+                     return -EINVAL;
+             }
+     }
+
+     for (i = 0; i < nfuncs; i++) {
+             struct function_desc *function;
+
+             function = devm_kzalloc(&pdev->dev, sizeof(*function),
+                                     GFP_KERNEL);
+             if (!function)
+                     return -ENOMEM;
+
+             mutex_lock(&spctl->mutex);
+             radix_tree_insert(&pctl->pin_function_tree, i, function);
+             mutex_unlock(&spctl->mutex);
+     }
+     pctl->num_functions = nfuncs;
+
+     spctl->group_index = 0;
+     if (flat_funcs) {
+             pctl->num_groups = of_get_child_count(np);
+     } else {
+             pctl->num_groups = 0;
+             for_each_child_of_node(np, child)
+                     pctl->num_groups += of_get_child_count(child);
+     }
+
+     if (flat_funcs) {
+             sky1_pinctrl_parse_functions(np, spctl, 0);
+     } else {
+             i = 0;
+             for_each_child_of_node(np, child)
+                     sky1_pinctrl_parse_functions(child, spctl, i++);
+     }
+
+     return 0;
+}
+
+int sky1_base_pinctrl_probe(struct platform_device *pdev,
+                   const struct sky1_pinctrl_soc_info *info) {
+     struct pinctrl_desc *sky1_pinctrl_desc;
+     struct sky1_pinctrl *spctl;
+     int ret, i;
+
+     if (!info || !info->pins || !info->npins) {
+             dev_err(&pdev->dev, "wrong pinctrl info\n");
+             return -EINVAL;
+     }
+
+     /* Create state holders etc for this driver */
+     spctl = devm_kzalloc(&pdev->dev, sizeof(*spctl), GFP_KERNEL);
+     if (!spctl)
+             return -ENOMEM;
+
+     spctl->pin_regs = devm_kmalloc_array(&pdev->dev, info->npins,
+                                         sizeof(*spctl->pin_regs),
+                                         GFP_KERNEL);
+     if (!spctl->pin_regs)

drivers/pinctrl/cix/pinctrl-sky1-base.c

Quoted 10 lines
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +10 -0
+             return -ENOMEM;
+
+     for (i = 0; i < info->npins; i++)
+             spctl->pin_regs[i] = -1;
+
+     spctl->base = devm_platform_ioremap_resource(pdev, 0);
+     if (IS_ERR(spctl->base))
+             return PTR_ERR(spctl->base);
+
+     sky1_pinctrl_desc = devm_kzalloc(&pdev->dev,

sizeof(*sky1_pinctrl_desc),

Quoted 12 lines
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +12 -0
+                                     GFP_KERNEL);
+     if (!sky1_pinctrl_desc)
+             return -ENOMEM;
+
+     sky1_pinctrl_desc->name = dev_name(&pdev->dev);
+     sky1_pinctrl_desc->pins = info->pins;
+     sky1_pinctrl_desc->npins = info->npins;
+     sky1_pinctrl_desc->pctlops = &sky1_pctrl_ops;
+     sky1_pinctrl_desc->pmxops = &sky1_pmx_ops;
+     sky1_pinctrl_desc->confops = &sky1_pinconf_ops;
+     sky1_pinctrl_desc->owner = THIS_MODULE;
+

drivers/pinctrl/cix/pinctrl-sky1-base.c

Quoted 10 lines
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +10 -0
+     mutex_init(&spctl->mutex);
+
+     spctl->info = info;
+     spctl->dev = &pdev->dev;
+     platform_set_drvdata(pdev, spctl);
+     ret = devm_pinctrl_register_and_init(&pdev->dev,
+                                          sky1_pinctrl_desc, spctl,
+                                          &spctl->pctl);
+     if (ret) {
+             dev_err(&pdev->dev, "could not register SKY1 pinctrl

driver\n");

Quoted 7 lines

drivers/pinctrl/cix/pinctrl-sky1-base.c line 606

Quoted 5 lines
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +5 -0
+             return ret;
+     }
+
+     ret = sky1_pinctrl_probe_dt(pdev, spctl);
+

No blank line here.

OK, we will delete this blank line next version

Quoted 8 lines

Review

Quoted 3 lines
(quoted diff) +2 -0
+     if (ret) {
+             dev_err(&pdev->dev, "fail to probe dt properties\n");

You are printing same error twice. Drop this and just handle error printing in sky1_pinctrl_probe_dt().
Especially that you now print errors on ENOMEM.

Sorry, this print message is only once, not twice, please give more information

Quoted 9 lines

drivers/pinctrl/cix/pinctrl-sky1-base.c line 613

Quoted 5 lines
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +5 -0
+             return ret;
+     }
+
+     pinctrl_provide_dummies();
+     dev_info(&pdev->dev, "initialized SKY1 pinctrl driver\n");

No, please drop. Drivers should be silent on success.

Ok, replace dev_info with dev_dbg next version

Quoted 9 lines
Quoted 4 lines
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +4 -0
+
+     return pinctrl_enable(spctl->pctl); }
+EXPORT_SYMBOL_GPL(sky1_base_pinctrl_probe);
+

..

Quoted 9 lines

drivers/pinctrl/cix/pinctrl-sky1.c line 488

Quoted 5 lines
drivers/pinctrl/cix/pinctrl-sky1.c new file +5 -0
+
+static struct platform_driver sky1_pinctrl_driver = {
+     .driver = {
+             .name = "sky1-pinctrl",
+             .of_match_table = of_match_ptr(sky1_pinctrl_of_match),

You have a warning here - please drop of_match_ptr.

We will delete it on next version

Quoted 22 lines
Quoted 22 lines
drivers/pinctrl/cix/pinctrl-sky1.c new file +12 -0
+             .pm = &sky1_pinctrl_pm_ops,
+     },
+     .probe = sky1_pinctrl_probe,
+};
+
+static int __init sky1_pinctrl_init(void) {
+     return platform_driver_register(&sky1_pinctrl_driver);
+}
+arch_initcall(sky1_pinctrl_init);
+
+MODULE_AUTHOR("Jerry Zhu <[email protected]>");
+MODULE_DESCRIPTION("Cix Sky1 pinctrl driver"); MODULE_LICENSE("GPL");
drivers/pinctrl/cix/pinctrl-sky1.h new file +3 -0
new file mode 100644
index 000000000000..09b25dbb6db3
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Author: Jerry Zhu <[email protected]>  */
Quoted 9 lines

drivers/pinctrl/cix/pinctrl-sky1.h

Quoted 6 lines
drivers/pinctrl/cix/pinctrl-sky1.h new file +6 -0
+
+#ifndef __DRIVERS_PINCTRL_SKY1_H
+#define __DRIVERS_PINCTRL_SKY1_H
+
+#include <linux/pinctrl/pinconf-generic.h> #include
+<linux/pinctrl/pinmux.h>

Are you sure you use both headers in this header?

We will delete them on next version

Quoted 2 lines

Best regards,
Krzysztof

Best wishes
Gary

#4 lore raw

Re: 回复: [PATCH 1/3] pinctrl: cix: Add pin-controller support for sky1

Quoted 10 lines · Gary Yang
Quoted 8 lines

Review

Quoted 3 lines
(quoted diff) +2 -0
+     if (ret) {
+             dev_err(&pdev->dev, "fail to probe dt properties\n");

You are printing same error twice. Drop this and just handle error printing in sky1_pinctrl_probe_dt().
Especially that you now print errors on ENOMEM.

Sorry, this print message is only once, not twice, please give more information

Trigger the error and check how many error messages you see. I see two. You should know your code better than me...

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +5 -0
+             return ret;
+     }
+
+     pinctrl_provide_dummies();
+     dev_info(&pdev->dev, "initialized SKY1 pinctrl driver\n");
Quoted 4 lines
Quoted 2 lines

No, please drop. Drivers should be silent on success.

Ok, replace dev_info with dev_dbg next version

No, it is completely redundant. You are duplicating existing mechanism for no gain at all.

Best regards,
Krzysztof

author maintainer
#5 lore raw

回复: 回复: [PATCH 1/3] pinctrl: cix: Add pin-controller support for sky1

Hi Krzysztof,

Quoted 11 lines · Gary Yang
Quoted 9 lines
Quoted 8 lines

Review

Quoted 3 lines
(quoted diff) +2 -0
+     if (ret) {
+             dev_err(&pdev->dev, "fail to probe dt properties\n");

You are printing same error twice. Drop this and just handle error printing in sky1_pinctrl_probe_dt().
Especially that you now print errors on ENOMEM.

Quoted 6 lines
Quoted 2 lines

Sorry, this print message is only once, not twice, please give more information

Trigger the error and check how many error messages you see. I see two. You should know your code better than me...

There are two pin-controller on sky1. They share the same driver. The probe is called twice.

So we see the print message twice.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +5 -0
+             return ret;
+     }
+
+     pinctrl_provide_dummies();
+     dev_info(&pdev->dev, "initialized SKY1 pinctrl driver\n");
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

No, please drop. Drivers should be silent on success.

Ok, replace dev_info with dev_dbg next version

No, it is completely redundant. You are duplicating existing mechanism for no gain at all.

OK, we delete it on next version

Quoted 2 lines

Best regards,
Krzysztof

Best wishes
Gary

#6 lore raw

Re: 回复: 回复: [PATCH 1/3] pinctrl: cix: Add pin-controller support for sky1

Quoted 16 lines · Gary Yang

Hi Krzysztof,

Quoted 14 lines · Gary Yang
Quoted 11 lines
Quoted 8 lines

Review

Quoted 3 lines
(quoted diff) +2 -0
+     if (ret) {
+             dev_err(&pdev->dev, "fail to probe dt properties\n");

You are printing same error twice. Drop this and just handle error printing in sky1_pinctrl_probe_dt().
Especially that you now print errors on ENOMEM.

Sorry, this print message is only once, not twice, please give more information

Quoted 7 lines
Quoted 3 lines

Trigger the error and check how many error messages you see. I see two. You should know your code better than me...

There are two pin-controller on sky1. They share the same driver. The probe is called twice.

So we see the print message twice.

No, you don't really understand how this works. Test your code and its error paths and you will see FOR ONE BIND more than one error message. Plus my second comment which you completely ignored.

I am sorry, but this is basic C.

Best regards,
Krzysztof

author maintainer
#7 lore raw

回复: 回复: 回复: [PATCH 1/3] pinctrl: cix: Add pin-controller support for sky1

Hi Krzysztof,

Quoted 26 lines · Gary Yang
Quoted 14 lines

Hi Krzysztof,

Quoted 12 lines · Gary Yang
Quoted 10 lines
Quoted 9 lines

Review

Quoted 4 lines
(quoted diff) +3 -0
+     if (ret) {
+             dev_err(&pdev->dev, "fail to probe dt
+ properties\n");

You are printing same error twice. Drop this and just handle error printing in sky1_pinctrl_probe_dt().
Especially that you now print errors on ENOMEM.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Sorry, this print message is only once, not twice, please give more information

Trigger the error and check how many error messages you see. I see two. You should know your code better than me...

There are two pin-controller on sky1. They share the same driver. The probe

is called twice.

Quoted 1 line
Quoted 9 lines
Quoted 1 line

So we see the print message twice.

No, you don't really understand how this works. Test your code and its error paths and you will see FOR ONE BIND more than one error message. Plus my second comment which you completely ignored.

I am sorry, but this is basic C.

In order to trigger a error, we add a sentence in sky1_pinctrl_probe_dt() as follow:

static int sky1_pinctrl_probe_dt(struct platform_device *pdev,
struct sky1_pinctrl *spctl)
{

+         return -ENODEV;
          .......
}

dmesg shows as following:

[    0.812780] /soc@0/pinctrl@4170000: Fixed dependency cycle(s) with /soc@0/pinctrl@4170000/hog-pins
[    0.821920] sky1-pinctrl 4170000.pinctrl: fail to probe dt properties
[    0.828503] /soc@0/pinctrl@16007000: Fixed dependency cycle(s) with /soc@0/pinctrl@16007000/hog-s5-pins
[    0.838058] sky1-pinctrl 16007000.pinctrl: fail to probe dt properties

I don't see the error message twice per one. There are two pin-controller. One is /soc@0/pinctrl@4170000. Other is /soc@0/pinctrl@16007000.

So you see the twice, once per one pin-controller. BTW as you suggested before, we will print the value of ret in the error message.

If I miss any information, please kindly remind me. Thanks

Quoted 2 lines

Best regards,
Krzysztof

Best wishes
Gary

#8 lore raw

Re: 回复: 回复: 回复: [PATCH 1/3] pinctrl: cix: Add pin-controller support for sky1

Quoted 47 lines · Gary Yang

Hi Krzysztof,

Quoted 26 lines · Gary Yang
Quoted 14 lines

Hi Krzysztof,

Quoted 12 lines · Gary Yang
Quoted 10 lines
Quoted 9 lines

Review

Quoted 4 lines
(quoted diff) +3 -0
+     if (ret) {
+             dev_err(&pdev->dev, "fail to probe dt
+ properties\n");

You are printing same error twice. Drop this and just handle error printing in sky1_pinctrl_probe_dt().
Especially that you now print errors on ENOMEM.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Sorry, this print message is only once, not twice, please give more information

Trigger the error and check how many error messages you see. I see two. You should know your code better than me...

There are two pin-controller on sky1. They share the same driver. The probe

is called twice.

Quoted 1 line
Quoted 9 lines
Quoted 1 line

So we see the print message twice.

No, you don't really understand how this works. Test your code and its error paths and you will see FOR ONE BIND more than one error message. Plus my second comment which you completely ignored.

I am sorry, but this is basic C.

In order to trigger a error, we add a sentence in sky1_pinctrl_probe_dt() as follow:

static int sky1_pinctrl_probe_dt(struct platform_device *pdev,
struct sky1_pinctrl *spctl)
{

+         return -ENODEV;
          .......
}
Quoted 8 lines

dmesg shows as following:

[    0.812780] /soc@0/pinctrl@4170000: Fixed dependency cycle(s) with /soc@0/pinctrl@4170000/hog-pins
[    0.821920] sky1-pinctrl 4170000.pinctrl: fail to probe dt properties
[    0.828503] /soc@0/pinctrl@16007000: Fixed dependency cycle(s) with /soc@0/pinctrl@16007000/hog-s5-pins
[    0.838058] sky1-pinctrl 16007000.pinctrl: fail to probe dt properties

I don't see the error message twice per one. There are two pin-controller. One is /soc@0/pinctrl@4170000. Other is /soc@0/pinctrl@16007000.

And the next error case from sky1_pinctrl_probe_dt? ... and then the next one? And another one?

Really, either you didn't read your own code or you just push the same poor code, regardless of review, because you want it to get merged?

This will lead you nowhere.

You have:

+static int sky1_pinctrl_probe_dt(struct platform_device *pdev,
+ struct sky1_pinctrl *spctl)
...
+ if (!function)
+ return -ENOMEM;
...
+ if (ret) {
+ dev_err(&pdev->dev, "fail to probe dt properties\n");
+ return ret;
+ }

That's a clear NAK.

Then you have:

+ if (nfuncs == 0) {
+ dev_err(&pdev->dev, "no functions defined\n");
+ return -EINVAL;
...
+ if (ret) {
+ dev_err(&pdev->dev, "fail to probe dt properties\n");
+ return ret;
+ }

that's useless duplicated message. TWICE.

You could easily spot it yourself instead of keep bugging the reviewer for such trivial stuff.

NAK, please remember to never waste reviewers time.

Quoted 4 lines

So you see the twice, once per one pin-controller. BTW as you suggested before, we will print the value of ret in the error message.

If I miss any information, please kindly remind me. Thanks

You still ignored my second comment.

Best regards,
Krzysztof

author maintainer
#9 lore raw

回复: 回复: 回复: 回复: [PATCH 1/3] pinctrl: cix: Add pin-controller support for sky1

Hi Krzysztof,

Quoted 105 lines · Gary Yang
Quoted 33 lines

Hi Krzysztof,

Quoted 32 lines · Gary Yang
Quoted 17 lines

Hi Krzysztof,

Quoted 15 lines · Gary Yang
Quoted 12 lines
Quoted 9 lines

Review

Quoted 4 lines
(quoted diff) +3 -0
+     if (ret) {
+             dev_err(&pdev->dev, "fail to probe dt
+ properties\n");

You are printing same error twice. Drop this and just handle error printing in sky1_pinctrl_probe_dt(). Especially that you now print errors on ENOMEM.

Sorry, this print message is only once, not twice, please give more information

Quoted 6 lines
Quoted 3 lines

Trigger the error and check how many error messages you see. I see two. You should know your code better than me...

There are two pin-controller on sky1. They share the same driver. The probe

is called twice.

Quoted 2 lines

So we see the print message twice.

No, you don't really understand how this works. Test your code and its error paths and you will see FOR ONE BIND more than one error

message.

Quoted 6 lines
Quoted 4 lines

Plus my second comment which you completely ignored.

I am sorry, but this is basic C.

In order to trigger a error, we add a sentence in sky1_pinctrl_probe_dt() as

follow:

Quoted 11 lines

static int sky1_pinctrl_probe_dt(struct platform_device *pdev,

                                 struct sky1_pinctrl *spctl) {
+         return -ENODEV;
          .......
}

dmesg shows as following:

[    0.812780] /soc@0/pinctrl@4170000: Fixed dependency cycle(s) with

/soc@0/pinctrl@4170000/hog-pins

Quoted 2 lines
[    0.821920] sky1-pinctrl 4170000.pinctrl: fail to probe dt properties
[    0.828503] /soc@0/pinctrl@16007000: Fixed dependency cycle(s) with

/soc@0/pinctrl@16007000/hog-s5-pins

Quoted 3 lines
[    0.838058] sky1-pinctrl 16007000.pinctrl: fail to probe dt properties

I don't see the error message twice per one. There are two pin-controller.

One is /soc@0/pinctrl@4170000. Other is /soc@0/pinctrl@16007000.

And the next error case from sky1_pinctrl_probe_dt? ... and then the next one? And another one?

Really, either you didn't read your own code or you just push the same poor code, regardless of review, because you want it to get merged?

This will lead you nowhere.

You have:

(quoted diff) +8 -0
+static int sky1_pinctrl_probe_dt(struct platform_device *pdev,
+                               struct sky1_pinctrl *spctl)
...
+               if (!function)
+                       return -ENOMEM;
...
+       if (ret) {
+               dev_err(&pdev->dev, "fail to probe dt properties\n");
+               return ret;
+       }

That's a clear NAK.

Then you have:

(quoted diff) +7 -0
+               if (nfuncs == 0) {
+                       dev_err(&pdev->dev, "no functions defined\n");
+                       return -EINVAL;
...
+       if (ret) {
+               dev_err(&pdev->dev, "fail to probe dt properties\n");
+               return ret;
+       }

that's useless duplicated message. TWICE.

You could easily spot it yourself instead of keep bugging the reviewer for such trivial stuff.

NAK, please remember to never waste reviewers time.

Quoted 1 line
Quoted 7 lines
Quoted 1 line

So you see the twice, once per one pin-controller. BTW as you suggested

before, we will print the value of ret in the error message.

Quoted 2 lines

If I miss any information, please kindly remind me. Thanks

You still ignored my second comment.

First you wrote " You are printing same error twice ", please pay attention to the "same error" strings, it makes me confuse, I misunderstand your thinking until you took the example above. So the discussion is needed, not waste our time.

Second the return value of sky1_pinctrl_probe_dt() is not only ENOMEM, it can also return ENODEV and EINVAL. Although I don't think this is a bug, take our time consider, I will delete the print sentence in sky1_pinctrl_probe_dt(). It makes the error message only once.

Third Although the author is not me, I really read all driver codes before take my courage to submit this patch. Maybe the codes comes from old example, we can update these codes to support the newest standard.

Fourth I work as an kernel engineer many years. But I first push patches to Linux kernel. If I make some stupid mistake, please kindly remind me. Maybe your kind make me more courage on doing this valuable work.

If miss any information, please let me know. Thanks for your understanding.

Quoted 3 lines

Best regards,
Krzysztof

Best wishes
Gary

#10 lore raw

Re: 回复: 回复: 回复: 回复: [PATCH 1/3] pinctrl: cix: Add pin-controller support for sky1

Quoted 7 lines · Gary Yang
Quoted 7 lines
Quoted 2 lines

So you see the twice, once per one pin-controller. BTW as you suggested

before, we will print the value of ret in the error message.

Quoted 2 lines

If I miss any information, please kindly remind me. Thanks

You still ignored my second comment.

^^^ That was second time here I reminded about ENOMEM comment.

Quoted 6 lines
Quoted 1 line

First you wrote " You are printing same error twice ", please pay attention to the "same error" strings, it makes me confuse, I misunderstand your thinking until you took the example above. So the discussion is needed, not waste our time.

Second the return value of sky1_pinctrl_probe_dt() is not only ENOMEM, it can also return ENODEV and EINVAL. Although I don't think this is a bug, take our

The problem is that you ignored the ENOMEM comment and it clearly should direct you to the problem and solution ("If I cannot have error on ENOMEM, I will move my error msgs to the called function").

Best regards,
Krzysztof

#11 lore raw

Re: [PATCH 1/3] pinctrl: cix: Add pin-controller support for sky1

In reply to Krzysztof Kozlowski
Quoted 7 lines · Krzysztof Kozlowski

drivers/pinctrl/cix/pinctrl-sky1-base.c line 613

Quoted 2 lines · Gary Yang
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +2 -0
+     pinctrl_provide_dummies();
+     dev_info(&pdev->dev, "initialized SKY1 pinctrl driver\n");

No, please drop. Drivers should be silent on success.

I usually think this is a matter of taste.

I suppose the reason why a lot of drivers have some "hello world" message is that missing probe calls is sometimes an issue.

If you mistakenly disable the driver in Kconfig (or due to other Kconfig changes that just happen ...), how do you know from the dmesg what error you made, when comparing it to a successful boot. There are no *error* messages from the driver either, just the same silence as when it's enabled. With pinctrl, random completely unrelated stuff just stops working.

If you see that the "hello world" from that driver is missing, you know it isn't probing, instead of finding it out after combing through the .config for the third time.

But I know a lot of people are dmesg minimalists, because it's just too much information and they just want errors there. It makes sense in a way too.

So as subsystem maintainer I have no hard opinion on it.

Yours,
Linus Walleij

#12 lore raw

Re: [PATCH 1/3] pinctrl: cix: Add pin-controller support for sky1

Quoted 10 lines · Linus Walleij
Quoted 7 lines · Krzysztof Kozlowski

drivers/pinctrl/cix/pinctrl-sky1-base.c line 613

Quoted 2 lines · Gary Yang
drivers/pinctrl/cix/pinctrl-sky1-base.c new file +2 -0
+     pinctrl_provide_dummies();
+     dev_info(&pdev->dev, "initialized SKY1 pinctrl driver\n");

No, please drop. Drivers should be silent on success.

I usually think this is a matter of taste.

It's actually coding style:
https://elixir.bootlin.com/linux/v6.15-rc1/source/Documentation/process/coding-style.rst#L913

https://elixir.bootlin.com/linux/v6.15-rc1/source/Documentation/process/debugging/driver_development_debugging_guide.rst#L79

https://lore.kernel.org/all/[email protected]/

Quoted 11 lines

I suppose the reason why a lot of drivers have some "hello world" message is that missing probe calls is sometimes an issue.

If you mistakenly disable the driver in Kconfig (or due to other Kconfig changes that just happen ...), how do you know from the dmesg what error you made, when comparing it to a successful boot. There are no *error* messages from the driver either, just the same silence as when it's enabled. With pinctrl, random completely unrelated stuff just stops working.

Quoted 3 lines

If you see that the "hello world" from that driver is missing, you know it isn't probing, instead of finding it out after combing through the .config for the third time.

Any tests for driver success should be checking in sysfs, not in dmesg. Most of platforms have smaller or bigger tests for that.

Quoted 6 lines

But I know a lot of people are dmesg minimalists, because it's just too much information and they just want errors there. It makes sense in a way too.

So as subsystem maintainer I have no hard opinion on it.

Best regards,
Krzysztof

#13 lore raw

Re: [PATCH 1/3] pinctrl: cix: Add pin-controller support for sky1

Quoted 6 lines · Krzysztof Kozlowski
Quoted 3 lines

If you see that the "hello world" from that driver is missing, you know it isn't probing, instead of finding it out after combing through the .config for the third time.

Any tests for driver success should be checking in sysfs, not in dmesg. Most of platforms have smaller or bigger tests for that.

Yeah I understand the thinking.

The typical symptom of a non-probed pin control driver is however eg that the system does not mount root because some pins connected to the eMMC are not muxed right.

People find the problem sooner or later anyway, it's just that the print makes it sooner. And the mistake is pretty common (or at least for me, but I'm not the best developer...)

Yours,
Linus Walleij

author maintainer
#14 lore raw

PATCH 2/3 dt-bindings: pinctrl: Add cix,sky1-pinctrl

In reply to Gary Yang

Add dt-bindings docs

---
 .../bindings/pinctrl/cix,sky1-pinctrl.yaml    |  77 +++
 include/dt-bindings/pinctrl/pads-sky1.h       | 592 ++++++++++++++++++
 2 files changed, 669 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml
 create mode 100644 include/dt-bindings/pinctrl/pads-sky1.h
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +77 -0
new file mode 100644
index 000000000000..10a4a292188e
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/cix,sky1-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cix Sky1 Pin Controller
+
+maintainers:
+  - Gary Yang <[email protected]>
+
+description:
+  Please refer to pinctrl-bindings.txt in this directory for common
+  binding part and usage.
+
+properties:
+  compatible:
+    enum:
+      - cix,sky1-iomuxc
+      - cix,sky1-iomuxc-s5
+
+  reg:
+    maxItems: 1
+
+# Client device subnode's properties
+patternProperties:
+  '-pins$':
+    type: object
+    description:
+      Pinctrl node's client devices use subnodes for desired pin configuration.
+      Client device subnodes use below standard properties.
+
+    properties:
+      cix,pins:
+        description:
+          each entry consists of 3 integers and represents the mux and config
+          setting for one pin. The first 2 integers <mux_reg func_num> are
+          specified using a CIX_PAD_* macro.The last integer CONFIG is the pad
+          setting value like pull-up on this pin.
+        $ref: /schemas/types.yaml#/definitions/uint32-matrix
+        items:
+          items:
+            - description: |
+                "mux_reg" indicates the offset of register.
+            - description: |
+                "func_num" indicates the mux value to be applied.
+            - description: |
+                "pad_setting" indicates the pad configuration value to be
+                applied.
+
+    required:
+      - cix,pins
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: pinctrl.yaml#
+
+additionalProperties: false
+
+examples:
+  # Pinmux controller node
+  - |
+    #include <dt-bindings/pinctrl/pads-sky1.h>
+    iomuxc: pinctrl@4170000 {
+        compatible = "cix,sky1-iomuxc";
+        reg = <0x4170000 0x1000>;
+
+        pinctrl_hog: hog-pins {
+            cix,pins =
+                <CIX_PAD_GPIO144_FUNC_GPIO144 (PULL_DOWN|DS_LEVEL4)>;
+        };
+    };
include/dt-bindings/pinctrl/pads-sky1.h new file +592 -0

592 lines not on this page · raw message

Signature · 1 line
2.49.0
#15 lore raw

Re: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

Quoted 1 line · Gary Yang

Add dt-bindings docs

For what? Describe the hardware here in one, two sentences.

Quoted 19 lines
---
 .../bindings/pinctrl/cix,sky1-pinctrl.yaml    |  77 +++
 include/dt-bindings/pinctrl/pads-sky1.h       | 592 ++++++++++++++++++
 2 files changed, 669 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml
 create mode 100644 include/dt-bindings/pinctrl/pads-sky1.h
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +4 -0
new file mode 100644
index 000000000000..10a4a292188e
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/cix,sky1-pinctrl.yaml#

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml line 14

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +10 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cix Sky1 Pin Controller
+
+maintainers:
+  - Gary Yang <[email protected]>
+
+description:
+  Please refer to pinctrl-bindings.txt in this directory for common
+  binding part and usage.

Drop description, not desired really.

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml line 20

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +6 -0
+
+properties:
+  compatible:
+    enum:
+      - cix,sky1-iomuxc
+      - cix,sky1-iomuxc-s5

Whats the difference between? You have entire description field to explain this but instead you said something obvious there.

Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +4 -0
+
+  reg:
+    maxItems: 1
+

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml line 34

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +10 -0
+# Client device subnode's properties
+patternProperties:
+  '-pins$':
+    type: object
+    description:
+      Pinctrl node's client devices use subnodes for desired pin configuration.
+      Client device subnodes use below standard properties.
+
+    properties:
+      cix,pins:

No, use generic properties from pinmux schema.

You should also reference it.

Quoted 29 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +29 -0
+        description:
+          each entry consists of 3 integers and represents the mux and config
+          setting for one pin. The first 2 integers <mux_reg func_num> are
+          specified using a CIX_PAD_* macro.The last integer CONFIG is the pad
+          setting value like pull-up on this pin.
+        $ref: /schemas/types.yaml#/definitions/uint32-matrix
+        items:
+          items:
+            - description: |
+                "mux_reg" indicates the offset of register.
+            - description: |
+                "func_num" indicates the mux value to be applied.
+            - description: |
+                "pad_setting" indicates the pad configuration value to be
+                applied.
+
+    required:
+      - cix,pins
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: pinctrl.yaml#
+
+additionalProperties: false

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml line 73

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +10 -0
+
+examples:
+  # Pinmux controller node
+  - |
+    #include <dt-bindings/pinctrl/pads-sky1.h>
+    iomuxc: pinctrl@4170000 {
+        compatible = "cix,sky1-iomuxc";
+        reg = <0x4170000 0x1000>;
+
+        pinctrl_hog: hog-pins {

Don't use hog.

include/dt-bindings/pinctrl/pads-sky1.h

Quoted 9 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +4 -0
+            cix,pins =
+                <CIX_PAD_GPIO144_FUNC_GPIO144 (PULL_DOWN|DS_LEVEL4)>;
+        };
+    };
include/dt-bindings/pinctrl/pads-sky1.h new file +0 -0
new file mode 100644
index 000000000000..44550e4105b3

Bindings follow compatible naming. See writing bindings.

include/dt-bindings/pinctrl/pads-sky1.h line 10

Quoted 11 lines
include/dt-bindings/pinctrl/pads-sky1.h new file +10 -0
@@ -0,0 +1,592 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright 2024-2025 Cix Technology Group Co., Ltd.
+ */
+
+#ifndef __SKY1_PADS_H
+#define __SKY1_PADS_H
+
+#define CIX_PAD_GPIO001_OFFSET			0x0
+#define CIX_PAD_GPIO002_OFFSET			0x4

Not bindings. Drop all this.

Best regards,
Krzysztof

author maintainer
#16 lore raw

回复: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

Hi Krzysztof,

Thanks for your comments

Quoted 6 lines · Gary Yang
Quoted 1 line

Add dt-bindings docs

For what? Describe the hardware here in one, two sentences.

OK, we will add some description for it next version

Quoted 26 lines
Quoted 5 lines
---
 .../bindings/pinctrl/cix,sky1-pinctrl.yaml    |  77 +++
 include/dt-bindings/pinctrl/pads-sky1.h       | 592

++++++++++++++++++

Quoted 20 lines
 2 files changed, 669 insertions(+)
 create mode 100644
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml
 create mode 100644 include/dt-bindings/pinctrl/pads-sky1.h

diff --git a/Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file mode 100644
index 000000000000..10a4a292188e

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +7 -0
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/cix,sky1-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cix Sky1 Pin Controller
+
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml line 14

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +6 -0
+maintainers:
+  - Gary Yang <[email protected]>
+
+description:
+  Please refer to pinctrl-bindings.txt in this directory for common
+  binding part and usage.

Drop description, not desired really.

Ok, this yaml file comes from other yaml file. If not needed, we remove it next version

Quoted 10 lines

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml line 20

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +6 -0
+
+properties:
+  compatible:
+    enum:
+      - cix,sky1-iomuxc
+      - cix,sky1-iomuxc-s5

Whats the difference between? You have entire description field to explain this but instead you said something obvious there.

Cix sky1 has three power states. S0 means work state. S3 means STR state. S5 means SD state.

The pin-controller on sky1 has two power states. They are S0 and S5.

Quoted 11 lines

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +10 -0
+
+  reg:
+    maxItems: 1
+
+# Client device subnode's properties
+patternProperties:
+  '-pins$':
+    type: object
+    description:
+      Pinctrl node's client devices use subnodes for desired pin

configuration.

Quoted 8 lines

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml line 34

Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +4 -0
+      Client device subnodes use below standard properties.
+
+    properties:
+      cix,pins:

No, use generic properties from pinmux schema.

You should also reference it.

Did you suggest us to refer to Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml?

Make us support drive-strength, bias-pull-down properties?

Quoted 36 lines

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml line 35

Quoted 3 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +2 -0
+        description:
+          each entry consists of 3 integers and represents the mux and

config

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml line 37

Quoted 2 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +2 -0
+          setting for one pin. The first 2 integers <mux_reg func_num> are
+          specified using a CIX_PAD_* macro.The last integer CONFIG is

the pad

Quoted 29 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +29 -0
+          setting value like pull-up on this pin.
+        $ref: /schemas/types.yaml#/definitions/uint32-matrix
+        items:
+          items:
+            - description: |
+                "mux_reg" indicates the offset of register.
+            - description: |
+                "func_num" indicates the mux value to be applied.
+            - description: |
+                "pad_setting" indicates the pad configuration value to be
+                applied.
+
+    required:
+      - cix,pins
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: pinctrl.yaml#
+
+additionalProperties: false
+
+examples:
+  # Pinmux controller node
+  - |
Quoted 8 lines

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml line 73

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +6 -0
+    #include <dt-bindings/pinctrl/pads-sky1.h>
+    iomuxc: pinctrl@4170000 {
+        compatible = "cix,sky1-iomuxc";
+        reg = <0x4170000 0x1000>;
+
+        pinctrl_hog: hog-pins {

Don't use hog.

OK, we use other group instead of it

Quoted 4 lines

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml line 74

Quoted 3 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +2 -0
+            cix,pins =
+                <CIX_PAD_GPIO144_FUNC_GPIO144

(PULL_DOWN|DS_LEVEL4)>;

Quoted 11 lines

include/dt-bindings/pinctrl/pads-sky1.h

Quoted 8 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +2 -0
+        };
+    };
include/dt-bindings/pinctrl/pads-sky1.h new file +0 -0
new file mode 100644
index 000000000000..44550e4105b3

Bindings follow compatible naming. See writing bindings.

Did you suggest rename it to pinctrl-sky1.h ?

Quoted 5 lines
Quoted 5 lines
include/dt-bindings/pinctrl/pads-sky1.h new file +4 -0
@@ -0,0 +1,592 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright 2024-2025 Cix Technology Group Co., Ltd.
+ */
Quoted 9 lines

include/dt-bindings/pinctrl/pads-sky1.h line 10

Quoted 6 lines
include/dt-bindings/pinctrl/pads-sky1.h new file +6 -0
+
+#ifndef __SKY1_PADS_H
+#define __SKY1_PADS_H
+
+#define CIX_PAD_GPIO001_OFFSET                       0x0
+#define CIX_PAD_GPIO002_OFFSET                       0x4

Not bindings. Drop all this.

Do you mean those macros not used need to delete?

Quoted 4 lines

Best regards,
Krzysztof

Best wishes
Gary

#17 lore raw

Re: 回复: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

Quoted 61 lines · Gary Yang

Hi Krzysztof,

Thanks for your comments

Quoted 6 lines · Gary Yang
Quoted 1 line

Add dt-bindings docs

For what? Describe the hardware here in one, two sentences.

OK, we will add some description for it next version

Quoted 26 lines
Quoted 5 lines
---
 .../bindings/pinctrl/cix,sky1-pinctrl.yaml    |  77 +++
 include/dt-bindings/pinctrl/pads-sky1.h       | 592

++++++++++++++++++

Quoted 20 lines
 2 files changed, 669 insertions(+)
 create mode 100644
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml
 create mode 100644 include/dt-bindings/pinctrl/pads-sky1.h

diff --git a/Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file mode 100644
index 000000000000..10a4a292188e

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +7 -0
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/cix,sky1-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cix Sky1 Pin Controller
+
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml line 14

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +6 -0
+maintainers:
+  - Gary Yang <[email protected]>
+
+description:
+  Please refer to pinctrl-bindings.txt in this directory for common
+  binding part and usage.

Drop description, not desired really.

Ok, this yaml file comes from other yaml file. If not needed, we remove it next version

Quoted 10 lines

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml line 20

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +6 -0
+
+properties:
+  compatible:
+    enum:
+      - cix,sky1-iomuxc
+      - cix,sky1-iomuxc-s5

Whats the difference between? You have entire description field to explain this but instead you said something obvious there.

Quoted 3 lines

Cix sky1 has three power states. S0 means work state. S3 means STR state. S5 means SD state.

The pin-controller on sky1 has two power states. They are S0 and S5.

State != device. Please create bindings for devices, not states.

Quoted 17 lines
Quoted 17 lines

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml

Quoted 11 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +10 -0
+
+  reg:
+    maxItems: 1
+
+# Client device subnode's properties
+patternProperties:
+  '-pins$':
+    type: object
+    description:
+      Pinctrl node's client devices use subnodes for desired pin

configuration.

Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +4 -0
+      Client device subnodes use below standard properties.
+
+    properties:
+      cix,pins:
Quoted 7 lines
Quoted 3 lines

No, use generic properties from pinmux schema.

You should also reference it.

Did you suggest us to refer to Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml?

Make us support drive-strength, bias-pull-down properties?

and pinmux. There is a standard pins property.

...

Quoted 11 lines
Quoted 9 lines

include/dt-bindings/pinctrl/pads-sky1.h

Quoted 6 lines
include/dt-bindings/pinctrl/pads-sky1.h new file +0 -0
new file mode 100644
index 000000000000..44550e4105b3

Bindings follow compatible naming. See writing bindings.

Did you suggest rename it to pinctrl-sky1.h ?

No. I suggest to be named EXACTLY like compatible.

Quoted 16 lines
Quoted 15 lines

include/dt-bindings/pinctrl/pads-sky1.h line 10

Quoted 12 lines
include/dt-bindings/pinctrl/pads-sky1.h new file +10 -0
@@ -0,0 +1,592 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright 2024-2025 Cix Technology Group Co., Ltd.
+ */
+
+#ifndef __SKY1_PADS_H
+#define __SKY1_PADS_H
+
+#define CIX_PAD_GPIO001_OFFSET                       0x0
+#define CIX_PAD_GPIO002_OFFSET                       0x4

Not bindings. Drop all this.

Quoted 1 line

Do you mean those macros not used need to delete?

Really, what is unlcear in "drop all this"? Drop means to remove.

You ask for confirmation for some really obvious comments.

BTW, if you disagree provide arguments (in terms of bindings) why these are bindings.

author maintainer
#18 lore raw

回复: 回复: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

Hi Krzysztof,

Quoted 64 lines · Gary Yang
Quoted 63 lines

Hi Krzysztof,

Thanks for your comments

Quoted 6 lines · Gary Yang
Quoted 1 line

Add dt-bindings docs

For what? Describe the hardware here in one, two sentences.

OK, we will add some description for it next version

Quoted 27 lines
Quoted 5 lines
---
 .../bindings/pinctrl/cix,sky1-pinctrl.yaml    |  77 +++
 include/dt-bindings/pinctrl/pads-sky1.h       | 592

++++++++++++++++++

Quoted 21 lines
 2 files changed, 669 insertions(+)
 create mode 100644
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml
 create mode 100644 include/dt-bindings/pinctrl/pads-sky1.h

diff --git a/Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file mode 100644
index 000000000000..10a4a292188e

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yam new file +8 -0
+++ l
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/cix,sky1-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cix Sky1 Pin Controller
+
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yam line 13

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yam new file +6 -0
+maintainers:
+  - Gary Yang <[email protected]>
+
+description:
+  Please refer to pinctrl-bindings.txt in this directory for common
+  binding part and usage.

Drop description, not desired really.

Ok, this yaml file comes from other yaml file. If not needed, we remove it next version

Quoted 10 lines

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yam line 19

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yam new file +6 -0
+
+properties:
+  compatible:
+    enum:
+      - cix,sky1-iomuxc
+      - cix,sky1-iomuxc-s5

Whats the difference between? You have entire description field to explain this but instead you said something obvious there.

Quoted 8 lines
Quoted 1 line

Cix sky1 has three power states. S0 means work state. S3 means STR state.

S5 means SD state.

Quoted 2 lines

The pin-controller on sky1 has two power states. They are S0 and S5.

State != device. Please create bindings for devices, not states.

Sorry, maybe I didn't explain it correctly before, and then make you misunderstand

There are two pin-controller on sky1. One is used under s0 state, other is used under s5 state.

They are two devices

Quoted 19 lines
Quoted 19 lines
Quoted 19 lines

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yam line 29

Quoted 11 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yam new file +10 -0
+
+  reg:
+    maxItems: 1
+
+# Client device subnode's properties
+patternProperties:
+  '-pins$':
+    type: object
+    description:
+      Pinctrl node's client devices use subnodes for desired pin

configuration.

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yam line 33

Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yam new file +4 -0
+      Client device subnodes use below standard properties.
+
+    properties:
+      cix,pins:

No, use generic properties from pinmux schema.

Quoted 9 lines
Quoted 3 lines
Quoted 1 line

You should also reference it.

Did you suggest us to refer to

Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml?

Quoted 2 lines

Make us support drive-strength, bias-pull-down properties?

and pinmux. There is a standard pins property.

Ok, I see, try our best to support standard

Quoted 13 lines

...

Quoted 10 lines
Quoted 9 lines

include/dt-bindings/pinctrl/pads-sky1.h

Quoted 6 lines
include/dt-bindings/pinctrl/pads-sky1.h new file +0 -0
new file mode 100644
index 000000000000..44550e4105b3

Bindings follow compatible naming. See writing bindings.

Quoted 4 lines
Quoted 1 line

Did you suggest rename it to pinctrl-sky1.h ?

No. I suggest to be named EXACTLY like compatible.

OK, I see

Quoted 16 lines
Quoted 16 lines
Quoted 15 lines

include/dt-bindings/pinctrl/pads-sky1.h line 10

Quoted 12 lines
include/dt-bindings/pinctrl/pads-sky1.h new file +10 -0
@@ -0,0 +1,592 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright 2024-2025 Cix Technology Group Co., Ltd.
+ */
+
+#ifndef __SKY1_PADS_H
+#define __SKY1_PADS_H
+
+#define CIX_PAD_GPIO001_OFFSET                       0x0
+#define CIX_PAD_GPIO002_OFFSET                       0x4

Not bindings. Drop all this.

Quoted 8 lines
Quoted 1 line

Do you mean those macros not used need to delete?

Really, what is unlcear in "drop all this"? Drop means to remove.

You ask for confirmation for some really obvious comments.

BTW, if you disagree provide arguments (in terms of bindings) why these are bindings.

Sorry, make you misunderstand again. I know drop means remove. I want to know whether "all this" mean all macros in the file or not. These macros will be used by client in the dtsi and dts file. If remove them, maybe add them again when they are used in the further. It looks like the file which locate include/dt-bindings/pinctrl/pads-imx8qm.h

Best wishes
Gary

#19 lore raw

Re: 回复: 回复: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

Quoted 18 lines · Gary Yang
Quoted 18 lines
Quoted 17 lines
Quoted 15 lines

include/dt-bindings/pinctrl/pads-sky1.h line 10

Quoted 12 lines
include/dt-bindings/pinctrl/pads-sky1.h new file +10 -0
@@ -0,0 +1,592 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright 2024-2025 Cix Technology Group Co., Ltd.
+ */
+
+#ifndef __SKY1_PADS_H
+#define __SKY1_PADS_H
+
+#define CIX_PAD_GPIO001_OFFSET                       0x0
+#define CIX_PAD_GPIO002_OFFSET                       0x4

Not bindings. Drop all this.

Do you mean those macros not used need to delete?

Quoted 8 lines
Quoted 6 lines

Really, what is unlcear in "drop all this"? Drop means to remove.

You ask for confirmation for some really obvious comments.

BTW, if you disagree provide arguments (in terms of bindings) why these are bindings.

Sorry, make you misunderstand again. I know drop means remove. I want to know whether "all this" mean all macros in the file or not.

All of these defines are not suitable for bindings, because they do not represent any ABI for Linux.

Quoted 2 lines

These macros will be used by client in the dtsi and dts file. If remove them, maybe add them again when they are used in the further. It looks like the file which locate include/dt-bindings/pinctrl/pads-imx8qm.h

Please take the newest contributions as example, not something 10 year old.

Best regards,
Krzysztof

#20 lore raw

Re: 回复: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

In reply to Gary Yang

Hi Gary,

thanks for your patch!

Quoted 11 lines · Gary Yang
Quoted 11 lines · Gary Yang
Quoted 5 lines
Quoted 4 lines

Whats the difference between? You have entire description field to explain this but instead you said something obvious there.

Cix sky1 has three power states. S0 means work state. S3 means STR state.

S5 means SD state.

Quoted 2 lines

The pin-controller on sky1 has two power states. They are S0 and S5.

Quoted 8 lines
Quoted 2 lines

State != device. Please create bindings for devices, not states.

Sorry, maybe I didn't explain it correctly before, and then make you misunderstand

There are two pin-controller on sky1. One is used under s0 state, other is used under s5 state.

They are two devices

Just explain this in the description: and everyone will understand what is going on. Since "S0" and "S5" can be easy to confuse for "states" it is extra helpful with some extended descriptions.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+    properties:
+      cix,pins:

No, use generic properties from pinmux schema.

You should also reference it.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Did you suggest us to refer to

Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml?

Quoted 2 lines

Make us support drive-strength, bias-pull-down properties?

and pinmux. There is a standard pins property.

Ok, I see, try our best to support standard

Unfortunately many pin controllers have forged ahead with custom foo,pins = <....>; settings where they set up mux and electrical config by OR:in together different bits, and then they just poke this into some registers.

This isn't very helpful for users.

I initially wanted all functions and groups to be strings and then to associate groups with functions using strings in the device tree.

But I have realized (though much pain) that many developers don't like this. They want a magic number to write to a register to configure a pin, because their hardware has one (or several) register for each pin.

So nowadays the most common is to use a compromise.

A magic number in the pinmux property to set up the muxing.

For example:

arch/arm/boot/dts/mediatek/mt7623.dtsi:
pinmux = <MT7623_PIN_75_SDA0_FUNC_SDA0>,

               <MT7623_PIN_76_SCL0_FUNC_SCL0>;

Then the electric properties like bias-pull-down; to set these on the state:

        i2c0_pins_a: i2c0-default {
                pins-i2c0 {
                        pinmux = <MT7623_PIN_75_SDA0_FUNC_SDA0>,
                                 <MT7623_PIN_76_SCL0_FUNC_SCL0>;
                        bias-disable;
                };
        };

This is a good compromis becaus it looks similar on all SoCs and you see immediately what is going on: we enable SDA0 And SCL0 and disable bias, so there must be external pull-up resistors on this bus since I2C is open drain. Very easy for an electronics engineer to grasp, they don't need to be computer engineers or device tree experts.

Yours,
Linus Walleij

author maintainer
#21 lore raw

回复: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

Hi Linus,

Thanks for your comments!

Sorry for delay reply

Quoted 20 lines · Gary Yang
Quoted 6 lines
Quoted 6 lines · Gary Yang
Quoted 5 lines
Quoted 4 lines

Whats the difference between? You have entire description field to explain this but instead you said something obvious there.

Cix sky1 has three power states. S0 means work state. S3 means STR

state.

Quoted 11 lines
Quoted 7 lines

S5 means SD state.

Quoted 2 lines

The pin-controller on sky1 has two power states. They are S0 and S5.

State != device. Please create bindings for devices, not states.

Sorry, maybe I didn't explain it correctly before, and then make you misunderstand

Quoted 9 lines
Quoted 1 line

There are two pin-controller on sky1. One is used under s0 state, other is

used under s5 state.

Quoted 2 lines

They are two devices

Just explain this in the description: and everyone will understand what is going on. Since "S0" and "S5" can be easy to confuse for "states"
it is extra helpful with some extended descriptions.

Yes, I have realized this problem, Thanks for your remind.

Quoted 49 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+    properties:
+      cix,pins:

No, use generic properties from pinmux schema.

You should also reference it.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Did you suggest us to refer to

Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml?

Quoted 2 lines

Make us support drive-strength, bias-pull-down properties?

and pinmux. There is a standard pins property.

Ok, I see, try our best to support standard

Unfortunately many pin controllers have forged ahead with custom foo,pins = <....>; settings where they set up mux and electrical config by OR:in together different bits, and then they just poke this into some registers.

This isn't very helpful for users.

I initially wanted all functions and groups to be strings and then to associate groups with functions using strings in the device tree.

But I have realized (though much pain) that many developers don't like this. They want a magic number to write to a register to configure a pin, because their hardware has one (or several) register for each pin.

So nowadays the most common is to use a compromise.

A magic number in the pinmux property to set up the muxing.

For example:

arch/arm/boot/dts/mediatek/mt7623.dtsi:
pinmux = <MT7623_PIN_75_SDA0_FUNC_SDA0>,

               <MT7623_PIN_76_SCL0_FUNC_SCL0>;

Then the electric properties like bias-pull-down; to set these on the state:

        i2c0_pins_a: i2c0-default {
                pins-i2c0 {
                        pinmux = <MT7623_PIN_75_SDA0_FUNC_SDA0>,
                                 <MT7623_PIN_76_SCL0_FUNC_SCL0>;
                        bias-disable;
                };
        };
Quoted 6 lines

This is a good compromis becaus it looks similar on all SoCs and you see immediately what is going on: we enable
SDA0 And SCL0 and disable bias, so there must be external pull-up resistors on this bus since I2C is open drain. Very easy for an electronics engineer to grasp, they don't need to be computer engineers or device tree experts.

I appreciate your comments. You are very kind and nice.

I understand your thinking and try to support the standard referred to above.

I only need to spend some time to research this scheme and debug it on Radax O6 board.

If miss any information, please remind me. Thanks for your kind again.

Quoted 2 lines

Yours,
Linus Walleij

Best wishes
Gary

#22 lore raw

Re: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

Quoted 3 lines · Gary Yang

I understand your thinking and try to support the standard referred to above.

I only need to spend some time to research this scheme and debug it on Radax O6 board.

Thanks Gary, I have this board too so I hope to be able to test it directly.

I haven't figured out how to boot it using device tree, everything I have going is using ACPI right now, but once I know how to boot it with device tree, I will be happy to test!

Yours,
Linus Walleij

author maintainer
#23 lore raw

回复: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

Hi Linus,

Quoted 14 lines · Gary Yang
Quoted 4 lines

I understand your thinking and try to support the standard referred to above.

I only need to spend some time to research this scheme and debug it on

Radax O6 board.

Thanks Gary, I have this board too so I hope to be able to test it directly.

I haven't figured out how to boot it using device tree, everything I have going is using ACPI right now, but once I know how to boot it with device tree, I will be happy to test!

I'm glad to see your interesting on Radax board.

I have understanded the new scheme. I start to debug it on Radax board yesterday.

Of course, If you want to test, please follow these steps:

First select "Cix Sky1 on Orion O6 (Device Tree) " option on grub UI

Second press "Ctrl+x" to continue boot, and use "root" user to login

Third plug ethernet and execute shell commands:
1) mount /dev/nvme0n1p1 /mnt
2) scp arch/arm64/boot/Image /mnt/Image-pinctrl
3) scp arch/arm64/boot/dts/cix/sky1-orion-o6.dtb /mnt/sky1-orion-o6-pinctrl.dtb
4) umount /mnt
5) reboot

Fourth select "Cix Sky1 on Orion O6 (Device Tree) " option on grub UI and edit it,

and then replace your dtb and image with sky1-orion-o6-pinctrl.dtb and Image-pinctrl

Please note: add clk_ignore_unused=1 config in grub

Finally press "Ctrl+x" to continue boot, then you can see what expected.

If you have any questions, please ping me any time. Thanks

Quoted 2 lines

Yours,
Linus Walleij

Best wishes
Gary

#24 lore raw

Re: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

In reply to Gary Yang

Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml

Quoted 15 lines · Gary Yang

Add dt-bindings docs

---
 .../bindings/pinctrl/cix,sky1-pinctrl.yaml    |  77 +++
 include/dt-bindings/pinctrl/pads-sky1.h       | 592 ++++++++++++++++++
 2 files changed, 669 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml
 create mode 100644 include/dt-bindings/pinctrl/pads-sky1.h
Documentation/devicetree/bindings/pinctrl/cix,sky1-pinctrl.yaml new file +0 -0
new file mode 100644
index 000000000000..10a4a292188e

Also: Filename based on compatible

Bot reports here some warnings, so please confirm: did you test your bindings and there are no errors reported by the toolset?

Best regards,
Krzysztof

#25 lore raw

Re: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

In reply to Gary Yang
Quoted 3 lines · Gary Yang

Add dt-bindings docs

I saw Krzysztof reacted to this:

Quoted 1 line

+++ b/include/dt-bindings/pinctrl/pads-sky1.h

(...)

Quoted 2 lines
include/dt-bindings/pinctrl/pads-sky1.h new file +2 -0
+#define CIX_PAD_GPIO001_OFFSET                 0x0
+#define CIX_PAD_GPIO002_OFFSET                 0x4

(...)

Quoted 2 lines
include/dt-bindings/pinctrl/pads-sky1.h new file +2 -0
+#define CIX_PAD_GPIO001_FUNC_GPIO001                              0x0
+#define CIX_PAD_GPIO002_FUNC_GPIO002                              0x0

(...)

include/dt-bindings/pinctrl/pads-sky1.h line 577

Quoted 5 lines
include/dt-bindings/pinctrl/pads-sky1.h new file +5 -0
+#define PULL_UP                (1 << 6)
+#define PULL_DOWN      (1 << 5)
+#define ST             (1 << 4)
+#define DS_LEVEL1      0x1
+#define DS_LEVEL2      0x2

(...)

As stated, this isn't part of bindings so it should not be include/dt-bindings/pinctrl/*.

If you are using the pinmux = <...>: property, what you can do however is to put the same defines into arch/arm64/boot/dts/cix/sky1-pinmux-props.dtsi
and use it the same way.

Then it is not bindings, just some DT data.

Sometimes this distinction isn't clear, and the kernel contain many offenders to this rule.

Yours,
Linus Walleij

author maintainer
#26 lore raw

回复: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

Hi Linus,

Quoted 29 lines · Gary Yang
Quoted 4 lines

Add dt-bindings docs

I saw Krzysztof reacted to this:

Quoted 1 line

+++ b/include/dt-bindings/pinctrl/pads-sky1.h

(...)

Quoted 2 lines
include/dt-bindings/pinctrl/pads-sky1.h new file +2 -0
+#define CIX_PAD_GPIO001_OFFSET                 0x0
+#define CIX_PAD_GPIO002_OFFSET                 0x4

(...)

Quoted 1 line

+#define CIX_PAD_GPIO001_FUNC_GPIO001

0x0

Quoted 1 line

+#define CIX_PAD_GPIO002_FUNC_GPIO002

0x0
(...)

include/dt-bindings/pinctrl/pads-sky1.h line 577

Quoted 5 lines
include/dt-bindings/pinctrl/pads-sky1.h new file +5 -0
+#define PULL_UP                (1 << 6)
+#define PULL_DOWN      (1 << 5)
+#define ST             (1 << 4)
+#define DS_LEVEL1      0x1
+#define DS_LEVEL2      0x2

(...)

As stated, this isn't part of bindings so it should not be include/dt-bindings/pinctrl/*.

Quoted 9 lines

If you are using the pinmux = <...>: property, what you can do however is to put the same defines into arch/arm64/boot/dts/cix/sky1-pinmux-props.dtsi and use it the same way.

Then it is not bindings, just some DT data.

Sometimes this distinction isn't clear, and the kernel contain many offenders to this rule.

First share a good news with you. It's that We have verified the new scheme pass on Radax O6 board.

We just have a question before submit new patchs. As you know, there are some macros defines in dts/dtsi file.

Where should these defines locate? We found these defines locate in include/dt-bindings/pinctrl/

mt7623-pinfunc.h on MT7623 platform. We don't find arch/arm64/boot/dts/*/* -pinmux-props.dtsi.

What's your suggestion? Please kindly remind me if I misunderstand and miss anything.

Thanks

Quoted 2 lines

Yours,
Linus Walleij

Best wishes
Gary

#27 lore raw

Re: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

Hi Gary!

Quoted 1 line · Gary Yang

First share a good news with you. It's that We have verified the new scheme pass on Radax O6 board.

That's great!

Quoted 7 lines

We just have a question before submit new patchs. As you know, there are some macros defines in dts/dtsi file.

Where should these defines locate? We found these defines locate in include/dt-bindings/pinctrl/

mt7623-pinfunc.h on MT7623 platform. We don't find arch/arm64/boot/dts/*/* -pinmux-props.dtsi.

What's your suggestion? Please kindly remind me if I misunderstand and miss anything.

Yes these are old habits from Mediatek platforms which are bad.

Since they are not bindings, just convenience defines, I would suggest you move the stuff from
include/dt-bindings/pinctrl/pads-sky1.h

Into
arch/arm64/boot/dts/cix/pads-sky1[.h|.dtsi]

I am not aware that using .h or .dtsi has any semantic difference, maybe the DT experts can tell. Maybe use pads-sky1.h to be on the safe side.

Yours,
Linus Walleij

author maintainer
#28 lore raw

回复: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

Hi Linus,

Quoted 21 lines · Gary Yang
Quoted 2 lines

First share a good news with you. It's that We have verified the new scheme

pass on Radax O6 board.

That's great!

Quoted 1 line

We just have a question before submit new patchs. As you know, there are

some macros defines in dts/dtsi file.

Quoted 5 lines

Where should these defines locate? We found these defines locate in include/dt-bindings/pinctrl/

mt7623-pinfunc.h on MT7623 platform. We don't find

arch/arm64/boot/dts/*/* -pinmux-props.dtsi.

Quoted 2 lines

What's your suggestion? Please kindly remind me if I misunderstand and

miss anything.

Yes these are old habits from Mediatek platforms which are bad.

Quoted 9 lines

Since they are not bindings, just convenience defines, I would suggest you move the stuff from include/dt-bindings/pinctrl/pads-sky1.h

Into
arch/arm64/boot/dts/cix/pads-sky1[.h|.dtsi]

I am not aware that using .h or .dtsi has any semantic difference, maybe the DT experts can tell. Maybe use pads-sky1.h to be on the safe side.

Yes, I understand your thinking now. we also find some examples under arch/arm64/boot/dts/*/*.h.

for example: arch/arm64/boot/dts/freescale/imx8mp-pinfunc.h and arch/arm64/boot/dts/mediatek/mt8516-pinfunc.h

We will take them as example, and create arch/arm64/boot/dts/cix/sky1-pinfunc.h. All right?

Thanks for your suggestion.

If miss any information, please kindly remind me.

Quoted 2 lines

Yours,
Linus Walleij

Best wishes
Gary

#29 lore raw

Re: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl

Quoted 5 lines · Gary Yang

Yes, I understand your thinking now. we also find some examples under arch/arm64/boot/dts/*/*.h.

for example: arch/arm64/boot/dts/freescale/imx8mp-pinfunc.h and arch/arm64/boot/dts/mediatek/mt8516-pinfunc.h

We will take them as example, and create arch/arm64/boot/dts/cix/sky1-pinfunc.h. All right?

Yes go ahead with this!

Yours,
Linus Walleij

author maintainer
#30 lore raw

PATCH 3/3 arm64: dts: cix: Add pinctrl nodes for sky1

In reply to Gary Yang

Add the pin-controller nodes for Sky1 platform.

---
 arch/arm64/boot/dts/cix/sky1-orion-o6.dts | 28 +++++++++++++++++++++++
 arch/arm64/boot/dts/cix/sky1.dtsi         | 10 ++++++++
 2 files changed, 38 insertions(+)
arch/arm64/boot/dts/cix/sky1-orion-o6.dts +28 -0
index d74964d53c3b..8fab0c3b36b3 100644
@@ -7,6 +7,9 @@
 /dts-v1/;
 
 #include "sky1.dtsi"
+
+#include <dt-bindings/pinctrl/pads-sky1.h>
+
 / {
 	model = "Radxa Orion O6";
 	compatible = "radxa,orion-o6", "cix,sky1";
@@ -34,6 +37,31 @@ linux,cma {
 
 };
 
+&iomuxc {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_hog>;
+
+	pinctrl_hog: hog-pins {
+		cix,pins = <
+			CIX_PAD_GPIO144_OFFSET CIX_PAD_GPIO144_FUNC_GPIO144 (PULL_DOWN|DS_LEVEL4)
+			CIX_PAD_GPIO145_OFFSET CIX_PAD_GPIO145_FUNC_GPIO145 (PULL_DOWN|DS_LEVEL4)
+			CIX_PAD_GPIO146_OFFSET CIX_PAD_GPIO146_FUNC_GPIO146 (PULL_DOWN|DS_LEVEL4)
+			CIX_PAD_GPIO147_OFFSET CIX_PAD_GPIO147_FUNC_GPIO147 (PULL_DOWN|DS_LEVEL4)
+		>;
+	};
+};
+
+&iomuxc_s5 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_hog_s5>;
+
+	pinctrl_hog_s5: hog-s5-pins {
+		cix,pins = <
+			CIX_PAD_GPIO014_OFFSET CIX_PAD_GPIO014_FUNC_GPIO014  (PULL_UP|DS_LEVEL4)
+		>;
+	};
+};
+
 &uart2 {
 	status = "okay";
 };
arch/arm64/boot/dts/cix/sky1.dtsi +10 -0
index 7dfe7677e649..bfe34e5311e8 100644
@@ -316,6 +316,16 @@ ppi_partition1: interrupt-partition-1 {
 				};
 			};
 		};
+
+		iomuxc: pinctrl@4170000 {
+			compatible = "cix,sky1-iomuxc";
+			reg = <0x0 0x04170000 0x0 0x1000>;
+		};
+
+		iomuxc_s5: pinctrl@16007000 {
+			compatible = "cix,sky1-iomuxc-s5";
+			reg = <0x0 0x16007000 0x0 0x1000>;
+		};
 	};
 
 	timer {
Signature · 1 line
2.49.0
#31 lore raw

Re: [PATCH 3/3] arm64: dts: cix: Add pinctrl nodes for sky1

arch/arm64/boot/dts/cix/sky1.dtsi ppi_partition1: interrupt-partition-1 { · line 325

Quoted 9 lines · Gary Yang
arch/arm64/boot/dts/cix/sky1.dtsi +7 -0
 			};
 		};
+
+		iomuxc: pinctrl@4170000 {
+			compatible = "cix,sky1-iomuxc";
+			reg = <0x0 0x04170000 0x0 0x1000>;
+		};
+
+		iomuxc_s5: pinctrl@16007000 {

Are you sure you follow DTS coding style for ordering of nodes? Looks like you just keep adding things to the end...

arch/arm64/boot/dts/cix/sky1.dtsi ppi_partition1: interrupt-partition-1 { · line 331

Quoted 6 lines
arch/arm64/boot/dts/cix/sky1.dtsi +3 -0
+			compatible = "cix,sky1-iomuxc-s5";
+			reg = <0x0 0x16007000 0x0 0x1000>;
+		};
 	};
 
 	timer {

Best regards,
Krzysztof

author maintainer
#32 lore raw

回复: [PATCH 3/3] arm64: dts: cix: Add pinctrl nodes for sky1

Hi Krzysztof,

Quoted 5 lines · Gary Yang
Quoted 4 lines
                      };
              };
arch/arm64/boot/dts/cix/sky1.dtsi +2 -0
+
+             iomuxc: pinctrl@4170000 {
Quoted 8 lines

arch/arm64/boot/dts/cix/sky1.dtsi ppi_partition1: interrupt-partition-1 { · line 325

Quoted 5 lines
arch/arm64/boot/dts/cix/sky1.dtsi +5 -0
+                     compatible = "cix,sky1-iomuxc";
+                     reg = <0x0 0x04170000 0x0 0x1000>;
+             };
+
+             iomuxc_s5: pinctrl@16007000 {

Are you sure you follow DTS coding style for ordering of nodes? Looks like you just keep adding things to the end...

Sorry, I see, we will correct it next version. Thanks for your comments

Quoted 11 lines

arch/arm64/boot/dts/cix/sky1.dtsi ppi_partition1: interrupt-partition-1 { · line 331

Quoted 7 lines
arch/arm64/boot/dts/cix/sky1.dtsi +3 -0
+                     compatible = "cix,sky1-iomuxc-s5";
+                     reg = <0x0 0x16007000 0x0 0x1000>;
+             };
      };
 
      timer {

Best regards,
Krzysztof

Best wishes
Gary