Skip to contentSkip to conversation

c8sectpfe: Various fixups

PATCH Superseded Peter Griffin 4 participants 20 messages Aug 28, 2015 – Sep 2, 2015

Subsystems (2)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover c8sectpfe: Various fixups

Hi Mauro,

This series includes a couple of fixes for the c8sectpfe Linux dvb driver.

One was caused by omitting a patch from the original c8sectpfe series which defined the ssc2 and ssc3 dt nodes, which was then used by the later DT patch. This patch is included, along with the original patch which you reverted.

Also Valentin Rothberg spotted LIBELF32 Kconfig symbol I was selecting in the Kconfig, this isn't required upstream and is left over legacy so I've removed it.

Also included are some fixups spotted by Lee Jones.

Changes since v2:
- Add some "\n" and other formatting fixes
- 'Suggested by' should be in chronological order
- Simplify load_slim_core_fw loop

Changes since v1:
- Various formating patches to DT node
- Update to reset-gpios
- Use GPIO_ACTIVE_HIGH, GIC_SPI and IRQ_TYPE_NONE defines

kind regards,

Peter.

Peter Griffin (6):
ARM: DT: STi: stihxxx-b2120: Add pulse-width properties to ssc2 & ssc3
ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node. [media] c8sectpfe: Remove select on undefined LIBELF_32 [media] c8sectpfe: Update binding to reset-gpios
[media] c8sectpfe: Update DT binding doc with some minor fixes [media] c8sectpfe: Simplify for loop in load_slim_core_fw

 .../bindings/media/stih407-c8sectpfe.txt           | 20 +++++-----
 arch/arm/boot/dts/stihxxx-b2120.dtsi               | 45 +++++++++++++++++++++-
 drivers/media/platform/sti/c8sectpfe/Kconfig       |  1 -
 .../media/platform/sti/c8sectpfe/c8sectpfe-core.c  |  9 +++--
 4 files changed, 58 insertions(+), 17 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v3 1/6 ARM: DT: STi: stihxxx-b2120: Add pulse-width properties to ssc2 & ssc3

Adding these properties makes the I2C bus to the demodulators much more reliable, and we no longer suffer from I2C errors when tuning.

---
 arch/arm/boot/dts/stihxxx-b2120.dtsi | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
arch/arm/boot/dts/stihxxx-b2120.dtsi +8 -2
index f589fe4..62994ae 100644
@@ -27,12 +27,18 @@
 			};
 		};
 
-		i2c at 9842000 {
+		ssc2: i2c at 9842000 {
 			status = "okay";
+			clock-frequency = <100000>;
+			st,i2c-min-scl-pulse-width-us = <0>;
+			st,i2c-min-sda-pulse-width-us = <5>;
 		};
 
-		i2c at 9843000 {
+		ssc3: i2c at 9843000 {
 			status = "okay";
+			clock-frequency = <100000>;
+			st,i2c-min-scl-pulse-width-us = <0>;
+			st,i2c-min-sda-pulse-width-us = <5>;
 		};
 
 		i2c at 9844000 {
Signature · 1 line
1.9.1
#2 lore raw

PATCH v3 2/6 ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node.

In reply to Peter Griffin

This patch adds in the required DT node for the c8sectpfe Linux DVB demux driver which allows the tsin channels to be used on an upstream kernel.

---
 arch/arm/boot/dts/stihxxx-b2120.dtsi | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
arch/arm/boot/dts/stihxxx-b2120.dtsi +35 -0
index 62994ae..f9fca10 100644
@@ -6,6 +6,9 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
+#include <dt-bindings/clock/stih407-clks.h>
+#include <dt-bindings/media/c8sectpfe.h>
 / {
 	soc {
 		sbc_serial0: serial at 9530000 {
@@ -85,5 +88,37 @@
 			status = "okay";
 		};
 
+		demux at 08a20000 {
+			compatible	= "st,stih407-c8sectpfe";
+			status		= "okay";
+			reg		= <0x08a20000 0x10000>,
+					  <0x08a00000 0x4000>;
+			reg-names	= "c8sectpfe", "c8sectpfe-ram";
+			interrupts	= <GIC_SPI 34 IRQ_TYPE_NONE>,
+					  <GIC_SPI 35 IRQ_TYPE_NONE>;
+			interrupt-names	= "c8sectpfe-error-irq",
+					  "c8sectpfe-idle-irq";
+			pinctrl-0	= <&pinctrl_tsin0_serial>;
+			pinctrl-1	= <&pinctrl_tsin0_parallel>;
+			pinctrl-2	= <&pinctrl_tsin3_serial>;
+			pinctrl-3	= <&pinctrl_tsin4_serial_alt3>;
+			pinctrl-4	= <&pinctrl_tsin5_serial_alt1>;
+			pinctrl-names	= "tsin0-serial",
+					  "tsin0-parallel",
+					  "tsin3-serial",
+					  "tsin4-serial",
+					  "tsin5-serial";
+			clocks		= <&clk_s_c0_flexgen CLK_PROC_STFE>;
+			clock-names	= "c8sectpfe";
+
+			/* tsin0 is TSA on NIMA */
+			tsin0: port at 0 {
+				tsin-num	= <0>;
+				serial-not-parallel;
+				i2c-bus		= <&ssc2>;
+				rst-gpio	= <&pio15 4 GPIO_ACTIVE_HIGH>;
+				dvb-card	= <STV0367_TDA18212_NIMA_1>;
+			};
+		};
 	};
 };
Signature · 1 line
1.9.1
Acked-by on v3 2/6
#3 lore raw

Re: [PATCH v3 2/6] ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node.

Quoted 8 lines · Peter Griffin

This patch adds in the required DT node for the c8sectpfe Linux DVB demux driver which allows the tsin channels to be used on an upstream kernel.

---
 arch/arm/boot/dts/stihxxx-b2120.dtsi | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
Quoted 52 lines
arch/arm/boot/dts/stihxxx-b2120.dtsi +35 -0
index 62994ae..f9fca10 100644
@@ -6,6 +6,9 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
+#include <dt-bindings/clock/stih407-clks.h>
+#include <dt-bindings/media/c8sectpfe.h>
 / {
 	soc {
 		sbc_serial0: serial at 9530000 {
@@ -85,5 +88,37 @@
 			status = "okay";
 		};
 
+		demux at 08a20000 {
+			compatible	= "st,stih407-c8sectpfe";
+			status		= "okay";
+			reg		= <0x08a20000 0x10000>,
+					  <0x08a00000 0x4000>;
+			reg-names	= "c8sectpfe", "c8sectpfe-ram";
+			interrupts	= <GIC_SPI 34 IRQ_TYPE_NONE>,
+					  <GIC_SPI 35 IRQ_TYPE_NONE>;
+			interrupt-names	= "c8sectpfe-error-irq",
+					  "c8sectpfe-idle-irq";
+			pinctrl-0	= <&pinctrl_tsin0_serial>;
+			pinctrl-1	= <&pinctrl_tsin0_parallel>;
+			pinctrl-2	= <&pinctrl_tsin3_serial>;
+			pinctrl-3	= <&pinctrl_tsin4_serial_alt3>;
+			pinctrl-4	= <&pinctrl_tsin5_serial_alt1>;
+			pinctrl-names	= "tsin0-serial",
+					  "tsin0-parallel",
+					  "tsin3-serial",
+					  "tsin4-serial",
+					  "tsin5-serial";
+			clocks		= <&clk_s_c0_flexgen CLK_PROC_STFE>;
+			clock-names	= "c8sectpfe";
+
+			/* tsin0 is TSA on NIMA */
+			tsin0: port at 0 {
+				tsin-num	= <0>;
+				serial-not-parallel;
+				i2c-bus		= <&ssc2>;
+				rst-gpio	= <&pio15 4 GPIO_ACTIVE_HIGH>;
+				dvb-card	= <STV0367_TDA18212_NIMA_1>;
+			};
+		};
 	};
 };
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#4 lore raw

PATCH v3 3/6 c8sectpfe: Remove select on undefined LIBELF_32

In reply to Peter Griffin

LIBELF_32 is not defined in Kconfig, and is left over legacy which is not required in the upstream driver, so remove it.

---
 drivers/media/platform/sti/c8sectpfe/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/media/platform/sti/c8sectpfe/Kconfig +0 -1
index d1bfd4c..b9ec667 100644
@@ -1,7 +1,6 @@
 config DVB_C8SECTPFE
 	tristate "STMicroelectronics C8SECTPFE DVB support"
 	depends on DVB_CORE && I2C && (ARCH_STI || ARCH_MULTIPLATFORM)
-	select LIBELF_32
 	select FW_LOADER
 	select FW_LOADER_USER_HELPER_FALLBACK
 	select DEBUG_FS
Signature · 1 line
1.9.1
#5 lore raw

PATCH v3 4/6 c8sectpfe: Update binding to reset-gpios

In reply to Peter Griffin

gpio.txt documents that GPIO properties should be named "[<name>-]gpios", with <name> being the purpose of this GPIO for the device.

This change has been done as one atomic commit.

---
 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++---
 arch/arm/boot/dts/stihxxx-b2120.dtsi                          | 4 ++--
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c         | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +3 -3
index d4def76..e70d840 100644
@@ -35,7 +35,7 @@ Required properties (tsin (child) node):
 
 - tsin-num	: tsin id of the InputBlock (must be between 0 to 6)
 - i2c-bus	: phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected.
-- rst-gpio	: reset gpio for this tsin channel.
+- reset-gpios	: reset gpio for this tsin channel.
 
 Optional properties (tsin (child) node):
 
@@ -75,7 +75,7 @@ Example:
 			tsin-num		= <0>;
 			serial-not-parallel;
 			i2c-bus			= <&ssc2>;
-			rst-gpio		= <&pio15 4 0>;
+			reset-gpios		= <&pio15 4 GPIO_ACTIVE_HIGH>;
 			dvb-card		= <STV0367_TDA18212_NIMA_1>;
 		};
 
@@ -83,7 +83,7 @@ Example:
 			tsin-num		= <3>;
 			serial-not-parallel;
 			i2c-bus			= <&ssc3>;
-			rst-gpio		= <&pio15 7 0>;
+			reset-gpios		= <&pio15 7 GPIO_ACTIVE_HIGH>;
 			dvb-card		= <STV0367_TDA18212_NIMB_1>;
 		};
 	};
arch/arm/boot/dts/stihxxx-b2120.dtsi +2 -2
index f9fca10..0b7592e 100644
@@ -6,8 +6,8 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
 #include <dt-bindings/clock/stih407-clks.h>
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/media/c8sectpfe.h>
 / {
 	soc {
@@ -116,7 +116,7 @@
 				tsin-num	= <0>;
 				serial-not-parallel;
 				i2c-bus		= <&ssc2>;
-				rst-gpio	= <&pio15 4 GPIO_ACTIVE_HIGH>;
+				reset-gpios	= <&pio15 4 GPIO_ACTIVE_HIGH>;
 				dvb-card	= <STV0367_TDA18212_NIMA_1>;
 			};
 		};
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +1 -1
index 3a91093..c691e13 100644
@@ -822,7 +822,7 @@ static int c8sectpfe_probe(struct platform_device *pdev)
 		}
 		of_node_put(i2c_bus);
 
-		tsin->rst_gpio = of_get_named_gpio(child, "rst-gpio", 0);
+		tsin->rst_gpio = of_get_named_gpio(child, "reset-gpios", 0);
 
 		ret = gpio_is_valid(tsin->rst_gpio);
 		if (!ret) {
Signature · 1 line
1.9.1
#6 lore raw

Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios

Quoted 5 lines · Peter Griffin

gpio.txt documents that GPIO properties should be named "[<name>-]gpios", with <name> being the purpose of this GPIO for the device.

This change has been done as one atomic commit.

dtb and kernel updates are not necessarily atomic, so you are breaking compatibility with older dtbs. You should certainly highlight that in the commit message. I only point this out. I'll leave it to platform maintainers whether or not this breakage is acceptable.

Rob

Quoted 84 lines
---
 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++---
 arch/arm/boot/dts/stihxxx-b2120.dtsi                          | 4 ++--
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c         | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +3 -3
index d4def76..e70d840 100644
@@ -35,7 +35,7 @@ Required properties (tsin (child) node):
 
 - tsin-num     : tsin id of the InputBlock (must be between 0 to 6)
 - i2c-bus      : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected.
-- rst-gpio     : reset gpio for this tsin channel.
+- reset-gpios  : reset gpio for this tsin channel.
 
 Optional properties (tsin (child) node):
 
@@ -75,7 +75,7 @@ Example:
                        tsin-num                = <0>;
                        serial-not-parallel;
                        i2c-bus                 = <&ssc2>;
-                       rst-gpio                = <&pio15 4 0>;
+                       reset-gpios             = <&pio15 4 GPIO_ACTIVE_HIGH>;
                        dvb-card                = <STV0367_TDA18212_NIMA_1>;
                };
 
@@ -83,7 +83,7 @@ Example:
                        tsin-num                = <3>;
                        serial-not-parallel;
                        i2c-bus                 = <&ssc3>;
-                       rst-gpio                = <&pio15 7 0>;
+                       reset-gpios             = <&pio15 7 GPIO_ACTIVE_HIGH>;
                        dvb-card                = <STV0367_TDA18212_NIMB_1>;
                };
        };
arch/arm/boot/dts/stihxxx-b2120.dtsi +2 -2
index f9fca10..0b7592e 100644
@@ -6,8 +6,8 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
 #include <dt-bindings/clock/stih407-clks.h>
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/media/c8sectpfe.h>
 / {
        soc {
@@ -116,7 +116,7 @@
                                tsin-num        = <0>;
                                serial-not-parallel;
                                i2c-bus         = <&ssc2>;
-                               rst-gpio        = <&pio15 4 GPIO_ACTIVE_HIGH>;
+                               reset-gpios     = <&pio15 4 GPIO_ACTIVE_HIGH>;
                                dvb-card        = <STV0367_TDA18212_NIMA_1>;
                        };
                };
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +1 -2
index 3a91093..c691e13 100644
@@ -822,7 +822,7 @@ static int c8sectpfe_probe(struct platform_device *pdev)
                }
                of_node_put(i2c_bus);
 
-               tsin->rst_gpio = of_get_named_gpio(child, "rst-gpio", 0);
+               tsin->rst_gpio = of_get_named_gpio(child, "reset-gpios", 0);
 
                ret = gpio_is_valid(tsin->rst_gpio);
                if (!ret) {
--

1.9.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#7 lore raw

Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios

Quoted 11 lines · Rob Herring
Quoted 5 lines · Peter Griffin

gpio.txt documents that GPIO properties should be named "[<name>-]gpios", with <name> being the purpose of this GPIO for the device.

This change has been done as one atomic commit.

dtb and kernel updates are not necessarily atomic, so you are breaking compatibility with older dtbs. You should certainly highlight that in the commit message.

Good idea.

Quoted 2 lines

I only point this out. I'll leave it to platform maintainers whether or not this breakage is acceptable.

This driver is new. The 'original' bindings are in next. So this binding is not even close to being ABI.

[...]

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#8 lore raw

Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios

In reply to Rob Herring

Hi Rob,

Quoted 6 lines · Rob Herring
Quoted 4 lines · Peter Griffin

gpio.txt documents that GPIO properties should be named "[<name>-]gpios", with <name> being the purpose of this GPIO for the device.

Quoted 6 lines
Quoted 1 line

This change has been done as one atomic commit.

dtb and kernel updates are not necessarily atomic, so you are breaking compatibility with older dtbs. You should certainly highlight that in the commit message. I only point this out. I'll leave it to platform maintainers whether or not this breakage is acceptable.

Ok I will highlight that in the commit message of the next version.

regards,

Peter.

#9 lore raw

Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios

In reply to Peter Griffin

Hello Peter,

Quoted 19 lines · Peter Griffin

gpio.txt documents that GPIO properties should be named "[<name>-]gpios", with <name> being the purpose of this GPIO for the device.

This change has been done as one atomic commit.

---
 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++---
 arch/arm/boot/dts/stihxxx-b2120.dtsi                          | 4 ++--
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c         | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +0 -0
index d4def76..e70d840 100644

Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt Required properties (tsin (child) node): · line 38

Quoted 5 lines
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +1 -1
@@ -35,7 +35,7 @@ Required properties (tsin (child) node):
 
 - tsin-num     : tsin id of the InputBlock (must be between 0 to 6)
 - i2c-bus      : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected.
-- rst-gpio     : reset gpio for this tsin channel.
+- reset-gpios  : reset gpio for this tsin channel.

The documentation is a bit outdated, the GPIO subsystem supports both -gpio and -gpios, see commit:

dd34c37aa3e8 ("gpio: of: Allow -gpio suffix for property names")

So it makes sense to me to use -gpio instead of -gpios in this case since is a single GPIO. Also rst is already a descriptive name since that's how many datasheets name a reset pin. I'm not saying I'm against this patch, just pointing out since the commit message is a bit misleading.

Best regards,
Javier

#10 lore raw

Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios

Quoted 29 lines · Javier Martinez Canillas
Quoted 19 lines · Peter Griffin

gpio.txt documents that GPIO properties should be named "[<name>-]gpios", with <name> being the purpose of this GPIO for the device.

This change has been done as one atomic commit.

---
 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++---
 arch/arm/boot/dts/stihxxx-b2120.dtsi                          | 4 ++--
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c         | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +0 -0
index d4def76..e70d840 100644

Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt Required properties (tsin (child) node): · line 38

Quoted 5 lines
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +1 -1
@@ -35,7 +35,7 @@ Required properties (tsin (child) node):
 
 - tsin-num     : tsin id of the InputBlock (must be between 0 to 6)
 - i2c-bus      : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected.
-- rst-gpio     : reset gpio for this tsin channel.
+- reset-gpios  : reset gpio for this tsin channel.

The documentation is a bit outdated, the GPIO subsystem supports both -gpio and -gpios, see commit:

Quoted 7 lines

dd34c37aa3e8 ("gpio: of: Allow -gpio suffix for property names")

So it makes sense to me to use -gpio instead of -gpios in this case since is a single GPIO. Also rst is already a descriptive name since that's how many datasheets name a reset pin. I'm not saying I'm against this patch, just pointing out since the commit message is a bit misleading.

As I suggested this patch, I feel I must comment.

My order of preference would be:

reset-gpio
reset-gpios
rst-gpio
rst-gpios

This current patch is No2, so it's okay to stay IMHO.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#11 lore raw

Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios

Hello Lee,

Quoted 40 lines · Lee Jones
Quoted 29 lines · Javier Martinez Canillas
Quoted 19 lines · Peter Griffin

gpio.txt documents that GPIO properties should be named "[<name>-]gpios", with <name> being the purpose of this GPIO for the device.

This change has been done as one atomic commit.

---
 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++---
 arch/arm/boot/dts/stihxxx-b2120.dtsi                          | 4 ++--
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c         | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +0 -0
index d4def76..e70d840 100644

Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt Required properties (tsin (child) node): · line 38

Quoted 5 lines
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +1 -1
@@ -35,7 +35,7 @@ Required properties (tsin (child) node):
 
 - tsin-num     : tsin id of the InputBlock (must be between 0 to 6)
 - i2c-bus      : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected.
-- rst-gpio     : reset gpio for this tsin channel.
+- reset-gpios  : reset gpio for this tsin channel.

The documentation is a bit outdated, the GPIO subsystem supports both -gpio and -gpios, see commit:

Quoted 7 lines

dd34c37aa3e8 ("gpio: of: Allow -gpio suffix for property names")

So it makes sense to me to use -gpio instead of -gpios in this case since is a single GPIO. Also rst is already a descriptive name since that's how many datasheets name a reset pin. I'm not saying I'm against this patch, just pointing out since the commit message is a bit misleading.

As I suggested this patch, I feel I must comment.

Quoted 9 lines

My order of preference would be:

reset-gpio
reset-gpios
rst-gpio
rst-gpios

This current patch is No2, so it's okay to stay IMHO.

If the property is being changed anyways, why not going with No1 then?

As I said, I'm not against the patch but I think the commit message has to be reworded since implies that the problem is that the -gpio sufix is being used instead of -gpios. But since both are supported by the GPIO subsystem, the commit should mention that "reset" is more clear and easier to read than "rst" or something along those lines.

BTW, I just posted a patch for the GPIO doc to mention that -gpio is also supported:

https://patchwork.kernel.org/patch/7103761/

Quoted 5 lines

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

Best regards,
Javier

#12 lore raw

Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios

Quoted 61 lines · Javier Martinez Canillas

Hello Lee,

Quoted 40 lines · Lee Jones
Quoted 29 lines · Javier Martinez Canillas
Quoted 19 lines · Peter Griffin

gpio.txt documents that GPIO properties should be named "[<name>-]gpios", with <name> being the purpose of this GPIO for the device.

This change has been done as one atomic commit.

---
 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++---
 arch/arm/boot/dts/stihxxx-b2120.dtsi                          | 4 ++--
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c         | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +0 -0
index d4def76..e70d840 100644

Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt Required properties (tsin (child) node): · line 38

Quoted 5 lines
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +1 -1
@@ -35,7 +35,7 @@ Required properties (tsin (child) node):
 
 - tsin-num     : tsin id of the InputBlock (must be between 0 to 6)
 - i2c-bus      : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected.
-- rst-gpio     : reset gpio for this tsin channel.
+- reset-gpios  : reset gpio for this tsin channel.

The documentation is a bit outdated, the GPIO subsystem supports both -gpio and -gpios, see commit:

Quoted 7 lines

dd34c37aa3e8 ("gpio: of: Allow -gpio suffix for property names")

So it makes sense to me to use -gpio instead of -gpios in this case since is a single GPIO. Also rst is already a descriptive name since that's how many datasheets name a reset pin. I'm not saying I'm against this patch, just pointing out since the commit message is a bit misleading.

As I suggested this patch, I feel I must comment.

Quoted 9 lines

My order of preference would be:

reset-gpio
reset-gpios
rst-gpio
rst-gpios

This current patch is No2, so it's okay to stay IMHO.

If the property is being changed anyways, why not going with No1 then?

As I said, I'm not against the patch but I think the commit message has to be reworded since implies that the problem is that the -gpio sufix is being used instead of -gpios. But since both are supported by the GPIO subsystem, the commit should mention that "reset" is more clear and easier to read than "rst" or something along those lines.

Quoted 4 lines

BTW, I just posted a patch for the GPIO doc to mention that -gpio is also supported:

https://patchwork.kernel.org/patch/7103761/

Noted. Thanks for the heads-up.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#13 lore raw

Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios

In reply to Javier Martinez Canillas

Hi Javier,

Quoted 40 lines · Javier Martinez Canillas

Hello Lee,

Quoted 37 lines · Lee Jones
Quoted 36 lines · Javier Martinez Canillas
Quoted 19 lines · Peter Griffin

gpio.txt documents that GPIO properties should be named "[<name>-]gpios", with <name> being the purpose of this GPIO for the device.

This change has been done as one atomic commit.

---
 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++---
 arch/arm/boot/dts/stihxxx-b2120.dtsi                          | 4 ++--
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c         | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +0 -0
index d4def76..e70d840 100644

Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt Required properties (tsin (child) node): · line 38

Quoted 5 lines
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +1 -1
@@ -35,7 +35,7 @@ Required properties (tsin (child) node):
 
 - tsin-num     : tsin id of the InputBlock (must be between 0 to 6)
 - i2c-bus      : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected.
-- rst-gpio     : reset gpio for this tsin channel.
+- reset-gpios  : reset gpio for this tsin channel.

The documentation is a bit outdated, the GPIO subsystem supports both -gpio and -gpios, see commit:

dd34c37aa3e8 ("gpio: of: Allow -gpio suffix for property names")

So it makes sense to me to use -gpio instead of -gpios in this case since is a single GPIO. Also rst is already a descriptive name since that's how many datasheets name a reset pin. I'm not saying I'm against this patch, just pointing out since the commit message is a bit misleading.

Ok thanks for pointing that out. It's nice to know the original binding was actually OK.

Quoted 10 lines
Quoted 10 lines

As I suggested this patch, I feel I must comment.

My order of preference would be:

reset-gpio
reset-gpios
rst-gpio
rst-gpios

Quoted 4 lines
Quoted 2 lines

This current patch is No2, so it's okay to stay IMHO.

If the property is being changed anyways, why not going with No1 then?

I've changed to No1 in v4.

Quoted 6 lines

As I said, I'm not against the patch but I think the commit message has to be reworded since implies that the problem is that the -gpio sufix is being used instead of -gpios. But since both are supported by the GPIO subsystem, the commit should mention that "reset" is more clear and easier to read than "rst" or something along those lines.

I've re-worded the commit message like you suggest in v4

Quoted 5 lines

BTW, I just posted a patch for the GPIO doc to mention that -gpio is also supported:

https://patchwork.kernel.org/patch/7103761/

Ok thanks for the pointer.

regards,

Peter.

#14 lore raw

Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios

Quoted 34 lines · Peter Griffin
Quoted 33 lines · Javier Martinez Canillas
Quoted 32 lines · Lee Jones
Quoted 31 lines · Javier Martinez Canillas
Quoted 19 lines · Peter Griffin

gpio.txt documents that GPIO properties should be named "[<name>-]gpios", with <name> being the purpose of this GPIO for the device.

This change has been done as one atomic commit.

---
 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++---
 arch/arm/boot/dts/stihxxx-b2120.dtsi                          | 4 ++--
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c         | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +0 -0
index d4def76..e70d840 100644

Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt Required properties (tsin (child) node): · line 38

Quoted 5 lines
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +1 -1
@@ -35,7 +35,7 @@ Required properties (tsin (child) node):
 
 - tsin-num     : tsin id of the InputBlock (must be between 0 to 6)
 - i2c-bus      : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected.
-- rst-gpio     : reset gpio for this tsin channel.
+- reset-gpios  : reset gpio for this tsin channel.

The documentation is a bit outdated, the GPIO subsystem supports both -gpio and -gpios, see commit:

dd34c37aa3e8 ("gpio: of: Allow -gpio suffix for property names")

Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

So it makes sense to me to use -gpio instead of -gpios in this case since is a single GPIO. Also rst is already a descriptive name since that's how many datasheets name a reset pin. I'm not saying I'm against this patch, just pointing out since the commit message is a bit misleading.

Ok thanks for pointing that out. It's nice to know the original binding was actually OK.

By luck, rather than judgement. ;)

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

As I suggested this patch, I feel I must comment.

My order of preference would be:

reset-gpio
reset-gpios
rst-gpio
rst-gpios

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

This current patch is No2, so it's okay to stay IMHO.

If the property is being changed anyways, why not going with No1 then?

I've changed to No1 in v4.

Nice! Thanks for fixing up.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#15 lore raw

Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios

In reply to Javier Martinez Canillas
Quoted 31 lines · Javier Martinez Canillas

Hello Peter,

Quoted 19 lines · Peter Griffin

gpio.txt documents that GPIO properties should be named "[<name>-]gpios", with <name> being the purpose of this GPIO for the device.

This change has been done as one atomic commit.

---
 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++---
 arch/arm/boot/dts/stihxxx-b2120.dtsi                          | 4 ++--
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c         | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +0 -0
index d4def76..e70d840 100644

Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt Required properties (tsin (child) node): · line 38

Quoted 5 lines
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +1 -1
@@ -35,7 +35,7 @@ Required properties (tsin (child) node):
 
 - tsin-num     : tsin id of the InputBlock (must be between 0 to 6)
 - i2c-bus      : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected.
-- rst-gpio     : reset gpio for this tsin channel.
+- reset-gpios  : reset gpio for this tsin channel.

The documentation is a bit outdated, the GPIO subsystem supports both -gpio and -gpios, see commit:

Quoted 1 line

dd34c37aa3e8 ("gpio: of: Allow -gpio suffix for property names")

Yes, because we have lots of them.

Quoted 5 lines

So it makes sense to me to use -gpio instead of -gpios in this case since is a single GPIO. Also rst is already a descriptive name since that's how many datasheets name a reset pin. I'm not saying I'm against this patch, just pointing out since the commit message is a bit misleading.

I believe that this has been discussed at length and it was decided that new bindings should use "-gpios" even for 1. Just like "clocks" is always plural.

Rob

#16 lore raw

Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios

[adding GPIO maintainers to cc list]

Hello Rob,

Quoted 33 lines · Rob Herring
Quoted 31 lines · Javier Martinez Canillas

Hello Peter,

Quoted 19 lines · Peter Griffin

gpio.txt documents that GPIO properties should be named "[<name>-]gpios", with <name> being the purpose of this GPIO for the device.

This change has been done as one atomic commit.

---
 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++---
 arch/arm/boot/dts/stihxxx-b2120.dtsi                          | 4 ++--
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c         | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +0 -0
index d4def76..e70d840 100644

Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt Required properties (tsin (child) node): · line 38

Quoted 5 lines
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +1 -1
@@ -35,7 +35,7 @@ Required properties (tsin (child) node):
 
 - tsin-num     : tsin id of the InputBlock (must be between 0 to 6)
 - i2c-bus      : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected.
-- rst-gpio     : reset gpio for this tsin channel.
+- reset-gpios  : reset gpio for this tsin channel.

The documentation is a bit outdated, the GPIO subsystem supports both -gpio and -gpios, see commit:

Quoted 4 lines
Quoted 1 line

dd34c37aa3e8 ("gpio: of: Allow -gpio suffix for property names")

Yes, because we have lots of them.

Yes, I know that was the motivation for that change.

Quoted 10 lines
Quoted 5 lines

So it makes sense to me to use -gpio instead of -gpios in this case since is a single GPIO. Also rst is already a descriptive name since that's how many datasheets name a reset pin. I'm not saying I'm against this patch, just pointing out since the commit message is a bit misleading.

I believe that this has been discussed at length and it was decided that new bindings should use "-gpios" even for 1. Just like "clocks" is always plural.

The documentation doesn't reflect that decision though. If new bindings are supposed to be using -gpios rather than -gpio even when a single GPIO is used, then Documentation/devicetree/bindings/gpio/gpio.txt and Documentation/gpio/board.txt should say that <function>-gpio is also supported for backward compatibility but that is deprecated and should not be used.

Otherwise when looking the code it seems that is just that the documentation is outdated and that both -gpio or -gpios can be used.

Quoted 1 line

Rob

Best regards,
Javier

#17 lore raw

Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios

In reply to Rob Herring

Hi Rob,

Quoted 43 lines · Rob Herring
Quoted 31 lines · Javier Martinez Canillas

Hello Peter,

Quoted 19 lines · Peter Griffin

gpio.txt documents that GPIO properties should be named "[<name>-]gpios", with <name> being the purpose of this GPIO for the device.

This change has been done as one atomic commit.

---
 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++---
 arch/arm/boot/dts/stihxxx-b2120.dtsi                          | 4 ++--
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c         | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +0 -0
index d4def76..e70d840 100644

Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt Required properties (tsin (child) node): · line 38

Quoted 5 lines
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +1 -1
@@ -35,7 +35,7 @@ Required properties (tsin (child) node):
 
 - tsin-num     : tsin id of the InputBlock (must be between 0 to 6)
 - i2c-bus      : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected.
-- rst-gpio     : reset gpio for this tsin channel.
+- reset-gpios  : reset gpio for this tsin channel.

The documentation is a bit outdated, the GPIO subsystem supports both -gpio and -gpios, see commit:

Quoted 1 line

dd34c37aa3e8 ("gpio: of: Allow -gpio suffix for property names")

Yes, because we have lots of them.

Quoted 5 lines

So it makes sense to me to use -gpio instead of -gpios in this case since is a single GPIO. Also rst is already a descriptive name since that's how many datasheets name a reset pin. I'm not saying I'm against this patch, just pointing out since the commit message is a bit misleading.

Quoted 3 lines

I believe that this has been discussed at length and it was decided that new bindings should use "-gpios" even for 1. Just like "clocks" is always plural.

Doh! Ok I will change back again to 'reset-gpios'.

regards,

Peter.

#18 lore raw

PATCH v3 5/6 c8sectpfe: Update DT binding doc with some minor fixes

In reply to Peter Griffin
---
 .../devicetree/bindings/media/stih407-c8sectpfe.txt        | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +7 -7
index e70d840..cc51b1f 100644
@@ -55,20 +55,20 @@ Example:
 		status = "okay";
 		reg = <0x08a20000 0x10000>, <0x08a00000 0x4000>;
 		reg-names = "stfe", "stfe-ram";
-		interrupts = <0 34 0>, <0 35 0>;
+		interrupts = <GIC_SPI 34 IRQ_TYPE_NONE>, <GIC_SPI 35 IRQ_TYPE_NONE>;
 		interrupt-names = "stfe-error-irq", "stfe-idle-irq";
-
-		pinctrl-names	= "tsin0-serial", "tsin0-parallel", "tsin3-serial",
-				"tsin4-serial", "tsin5-serial";
-
 		pinctrl-0	= <&pinctrl_tsin0_serial>;
 		pinctrl-1	= <&pinctrl_tsin0_parallel>;
 		pinctrl-2	= <&pinctrl_tsin3_serial>;
 		pinctrl-3	= <&pinctrl_tsin4_serial_alt3>;
 		pinctrl-4	= <&pinctrl_tsin5_serial_alt1>;
-
+		pinctrl-names	= "tsin0-serial",
+				  "tsin0-parallel",
+				  "tsin3-serial",
+				  "tsin4-serial",
+				  "tsin5-serial";
 		clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>;
-		clock-names = "stfe";
+		clock-names = "c8sectpfe";
 
 		/* tsin0 is TSA on NIMA */
 		tsin0: port at 0 {
Signature · 1 line
1.9.1
#19 lore raw

PATCH v3 6/6 c8sectpfe: Simplify for loop in load_slim_core_fw

In reply to Peter Griffin
---
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +4 -3
index c691e13..ce72ffb 100644
@@ -1096,7 +1096,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context)
 	Elf32_Ehdr *ehdr;
 	Elf32_Phdr *phdr;
 	u8 __iomem *dst;
-	int err, i;
+	int err = 0, i;
 
 	if (!fw || !context)
 		return -EINVAL;
@@ -1105,7 +1105,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context)
 	phdr = (Elf32_Phdr *)(fw->data + ehdr->e_phoff);
 
 	/* go through the available ELF segments */
-	for (i = 0; i < ehdr->e_phnum && !err; i++, phdr++) {
+	for (i = 0; i < ehdr->e_phnum; i++, phdr++) {
 
 		/* Only consider LOAD segments */
 		if (phdr->p_type != PT_LOAD)
@@ -1118,7 +1118,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context)
 			dev_err(fei->dev,
 				"Segment %d is outside of firmware file\n", i);
 			err = -EINVAL;
-			break;
+			goto err;
 		}
 
 		/*
@@ -1146,6 +1146,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context)
 		}
 	}
 
+err:
 	release_firmware(fw);
 	return err;
 }
Signature · 1 line
1.9.1