linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/6] davinci: DT support for i2c0 and tps6507x
@ 2013-01-29  7:38 Vishwanathrao Badarkhe, Manish
  2013-01-29  7:38 ` [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit Vishwanathrao Badarkhe, Manish
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-01-29  7:38 UTC (permalink / raw)
  To: devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
	davinci-linux-open-source
  Cc: anilkumar, tony, hs, broonie, sameo, khilman, nsekhar,
	linus.walleij, linux, rob, rob.herring, grant.likely, manishv.b

This patch series enables device tree support for I2C0
and for regulator via tps6507x mfd device on da850-evm.

Applies on top of v3.8-rc5 of linus tree.

Tested on da850-evm device.

Test procedure followed as below:
Once device boots up, issue command as:

$for reg in /sys/class/regulator/*; do echo $reg `cat $reg/name`
 `cat $reg/state` `cat $reg/microvolts`; done

Depends on:
 - ARM: davinci: da850: add interrupt-parent property in soc node
   https://patchwork.kernel.org/patch/2044101/
 - ARM: davinci: da850: add pinctrl support
   http://comments.gmane.org/gmane.linux.davinci/25993

Changes since V1:
 - Updated i2c0 node name in da850 dts and dtsi file.
 - Removed interrupt parent from i2c0 node.
 - Updated name for da850 auxdata lookup.
 - Added a patch in series to update pin control driver
   registration.

Vishwanathrao Badarkhe, Manish (6):
  pinctrl: pinctrl-single: use arch_initcall and module_exit
  ARM: davinci: da850: add OF_DEV_AUXDATA entry for I2C0
  ARM: davinci: da850: add DT node for I2C0
  mfd: tps6507x: add device-tree support.
  ARM: regulator: add tps6507x device tree data
  ARM: davinci: da850: add tps6507x regulator DT data

 arch/arm/boot/dts/da850-evm.dts  |   68 ++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/da850.dtsi     |   15 ++++++++
 arch/arm/boot/dts/tps6507x.dtsi  |   47 ++++++++++++++++++++++++++
 arch/arm/mach-davinci/da8xx-dt.c |    8 ++++-
 drivers/mfd/tps6507x.c           |    9 +++++
 drivers/pinctrl/pinctrl-single.c |   12 ++++++-
 6 files changed, 157 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boot/dts/tps6507x.dtsi

-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit
  2013-01-29  7:38 [PATCH V2 0/6] davinci: DT support for i2c0 and tps6507x Vishwanathrao Badarkhe, Manish
@ 2013-01-29  7:38 ` Vishwanathrao Badarkhe, Manish
  2013-01-29 10:59   ` Linus Walleij
  2013-01-29  7:38 ` [PATCH V2 2/6] ARM: davinci: da850: add OF_DEV_AUXDATA entry for I2C0 Vishwanathrao Badarkhe, Manish
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-01-29  7:38 UTC (permalink / raw)
  To: devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
	davinci-linux-open-source
  Cc: anilkumar, tony, hs, broonie, sameo, khilman, nsekhar,
	linus.walleij, linux, rob, rob.herring, grant.likely, manishv.b

Currently, I2C driver gets probed before pinctrl driver.
To achieve I2C pin muxing via pinctrl driver before I2C
probe get called, register pinctrl driver in arch_initcall.
Also, add module_exit to unregister pinctrl driver.

Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
---
:100644 100644 f6a360b... 3a96390... M	drivers/pinctrl/pinctrl-single.c
 drivers/pinctrl/pinctrl-single.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index f6a360b..3a96390 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1089,7 +1089,17 @@ static struct platform_driver pcs_driver = {
 	},
 };
 
-module_platform_driver(pcs_driver);
+static int __init pcs_pinctrl_init(void)
+{
+	return platform_driver_register(&pcs_driver);
+}
+arch_initcall(pcs_pinctrl_init);
+
+static void __exit pcs_pinctrl_exit(void)
+{
+	platform_driver_unregister(&pcs_driver);
+}
+module_exit(pcs_pinctrl_exit);
 
 MODULE_AUTHOR("Tony Lindgren <tony@atomide.com>");
 MODULE_DESCRIPTION("One-register-per-pin type device tree based pinctrl driver");
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH V2 2/6] ARM: davinci: da850: add OF_DEV_AUXDATA entry for I2C0
  2013-01-29  7:38 [PATCH V2 0/6] davinci: DT support for i2c0 and tps6507x Vishwanathrao Badarkhe, Manish
  2013-01-29  7:38 ` [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit Vishwanathrao Badarkhe, Manish
@ 2013-01-29  7:38 ` Vishwanathrao Badarkhe, Manish
  2013-01-29  7:38 ` [PATCH V2 3/6] ARM: davinci: da850: add DT node " Vishwanathrao Badarkhe, Manish
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-01-29  7:38 UTC (permalink / raw)
  To: devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
	davinci-linux-open-source
  Cc: anilkumar, tony, hs, broonie, sameo, khilman, nsekhar,
	linus.walleij, linux, rob, rob.herring, grant.likely, manishv.b

Add OF_DEV_AUXDATA for I2C0 controller driver in da850 board
dt file to use I2C0 clock.

Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
---
Changes since V1:
 - updated name for auxdata lookup
   da850_evm_auxdata_lookup -> da850_auxdata_lookup

:100644 100644 37c27af... 95ca4e9... M	arch/arm/mach-davinci/da8xx-dt.c
 arch/arm/mach-davinci/da8xx-dt.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index 37c27af..95ca4e9 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -37,11 +37,17 @@ static void __init da8xx_init_irq(void)
 	of_irq_init(da8xx_irq_match);
 }
 
+struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL),
+	{}
+};
+
 #ifdef CONFIG_ARCH_DAVINCI_DA850
 
 static void __init da850_init_machine(void)
 {
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+	of_platform_populate(NULL, of_default_bus_match_table,
+				da850_auxdata_lookup, NULL);
 
 	da8xx_uart_clk_enable();
 }
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH V2 3/6] ARM: davinci: da850: add DT node for I2C0
  2013-01-29  7:38 [PATCH V2 0/6] davinci: DT support for i2c0 and tps6507x Vishwanathrao Badarkhe, Manish
  2013-01-29  7:38 ` [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit Vishwanathrao Badarkhe, Manish
  2013-01-29  7:38 ` [PATCH V2 2/6] ARM: davinci: da850: add OF_DEV_AUXDATA entry for I2C0 Vishwanathrao Badarkhe, Manish
@ 2013-01-29  7:38 ` Vishwanathrao Badarkhe, Manish
  2013-02-03 12:49   ` Sekhar Nori
  2013-01-29  7:38 ` [PATCH V2 4/6] mfd: tps6507x: add device-tree support Vishwanathrao Badarkhe, Manish
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-01-29  7:38 UTC (permalink / raw)
  To: devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
	davinci-linux-open-source
  Cc: anilkumar, tony, hs, broonie, sameo, khilman, nsekhar,
	linus.walleij, linux, rob, rob.herring, grant.likely, manishv.b

Add I2C0 device tree node information to da850-evm.
Also, add I2C0 pin muxing information in da850-evm.

Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
---
Changes since V1:
 - Updated i2c0 node names in dts and dtsi file.
 - Removed interrupt parent from i2c0 node.
 - Handled i2c0 pin mux inside i2c0 node.

:100644 100644 433027f... c9ed683... M	arch/arm/boot/dts/da850-evm.dts
:100644 100644 5e0eb5c... 245ab9a... M	arch/arm/boot/dts/da850.dtsi
 arch/arm/boot/dts/da850-evm.dts |    5 +++++
 arch/arm/boot/dts/da850.dtsi    |   15 +++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 433027f..c9ed683 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -27,6 +27,11 @@
 		serial2: serial@1d0d000 {
 			status = "okay";
 		};
+		i2c0: i2c0@1c22000 {
+			status = "okay";
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c0_pins>;
+		};
 	};
 	nand_cs3@62000000 {
 		status = "okay";
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index 5e0eb5c..245ab9a 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -56,6 +56,12 @@
 					0x30 0x01100000  0x0ff00000
 				>;
 			};
+			i2c0_pins: pinmux_i2c0_pins {
+				pinctrl-single,bits = <
+					/* I2C0_SDA,I2C0_SCL */
+					0x10 0x00002200 0x0000ff00
+				>;
+			};
 		};
 		serial0: serial@1c42000 {
 			compatible = "ns16550a";
@@ -81,6 +87,15 @@
 			interrupts = <61>;
 			status = "disabled";
 		};
+		i2c0: i2c0@1c22000 {
+			compatible = "ti,davinci-i2c";
+			reg = <0x22000 0x1000>;
+			clock-frequency = <100000>;
+			interrupts = <15>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
 	};
 	nand_cs3@62000000 {
 		compatible = "ti,davinci-nand";
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH V2 4/6] mfd: tps6507x: add device-tree support.
  2013-01-29  7:38 [PATCH V2 0/6] davinci: DT support for i2c0 and tps6507x Vishwanathrao Badarkhe, Manish
                   ` (2 preceding siblings ...)
  2013-01-29  7:38 ` [PATCH V2 3/6] ARM: davinci: da850: add DT node " Vishwanathrao Badarkhe, Manish
@ 2013-01-29  7:38 ` Vishwanathrao Badarkhe, Manish
  2013-02-03 22:31   ` Samuel Ortiz
  2013-01-29  7:38 ` [PATCH V2 5/6] ARM: regulator: add tps6507x device tree data Vishwanathrao Badarkhe, Manish
  2013-01-29  7:38 ` [PATCH V2 6/6] ARM: davinci: da850: add tps6507x regulator DT data Vishwanathrao Badarkhe, Manish
  5 siblings, 1 reply; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-01-29  7:38 UTC (permalink / raw)
  To: devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
	davinci-linux-open-source
  Cc: anilkumar, tony, hs, broonie, sameo, khilman, nsekhar,
	linus.walleij, linux, rob, rob.herring, grant.likely, manishv.b

Add device tree based initialization support for TI's
tps6507x mfd device.

Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
---
Changes since V1:
 - updated subject line for commit.

:100644 100644 409afa2... 5ad4b77... M	drivers/mfd/tps6507x.c
 drivers/mfd/tps6507x.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/tps6507x.c b/drivers/mfd/tps6507x.c
index 409afa2..5ad4b77 100644
--- a/drivers/mfd/tps6507x.c
+++ b/drivers/mfd/tps6507x.c
@@ -19,6 +19,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/i2c.h>
+#include <linux/of_device.h>
 #include <linux/mfd/core.h>
 #include <linux/mfd/tps6507x.h>
 
@@ -116,11 +117,19 @@ static const struct i2c_device_id tps6507x_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, tps6507x_i2c_id);
 
+#ifdef CONFIG_OF
+static struct of_device_id tps6507x_of_match[] = {
+	{.compatible = "ti,tps6507x", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, tps6507x_of_match);
+#endif
 
 static struct i2c_driver tps6507x_i2c_driver = {
 	.driver = {
 		   .name = "tps6507x",
 		   .owner = THIS_MODULE,
+		   .of_match_table = of_match_ptr(tps6507x_of_match),
 	},
 	.probe = tps6507x_i2c_probe,
 	.remove = tps6507x_i2c_remove,
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH V2 5/6] ARM: regulator: add tps6507x device tree data
  2013-01-29  7:38 [PATCH V2 0/6] davinci: DT support for i2c0 and tps6507x Vishwanathrao Badarkhe, Manish
                   ` (3 preceding siblings ...)
  2013-01-29  7:38 ` [PATCH V2 4/6] mfd: tps6507x: add device-tree support Vishwanathrao Badarkhe, Manish
@ 2013-01-29  7:38 ` Vishwanathrao Badarkhe, Manish
  2013-02-07 10:21   ` Vishwanathrao Badarkhe, Manish
  2013-01-29  7:38 ` [PATCH V2 6/6] ARM: davinci: da850: add tps6507x regulator DT data Vishwanathrao Badarkhe, Manish
  5 siblings, 1 reply; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-01-29  7:38 UTC (permalink / raw)
  To: devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
	davinci-linux-open-source
  Cc: anilkumar, tony, hs, broonie, sameo, khilman, nsekhar,
	linus.walleij, linux, rob, rob.herring, grant.likely, manishv.b

Add device tree data for tps6507x regulator by adding
all tps6507x regulator nodes. Regulators are initialized
based on compatible name provided in tps6507x DT file.

All tps6507x PMIC regulator device tree nodes are placed
in a separate device tree include file (tps6507x.dtsi).
tps6507x.dtsi file is created using datasheet
http://www.ti.com/lit/ds/symlink/tps65070.pdf

Tested on da850-evm.

Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
---
Changes since V1:
 - Updated Copyright information.

:000000 100644 0000000... 4c326e5... A	arch/arm/boot/dts/tps6507x.dtsi
 arch/arm/boot/dts/tps6507x.dtsi |   47 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/tps6507x.dtsi b/arch/arm/boot/dts/tps6507x.dtsi
new file mode 100644
index 0000000..4c326e5
--- /dev/null
+++ b/arch/arm/boot/dts/tps6507x.dtsi
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * Integrated Power Management Chip
+ * http://www.ti.com/lit/ds/symlink/tps65070.pdf
+ */
+
+&tps {
+	compatible = "ti,tps6507x";
+
+	regulators {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		vdcdc1_reg: regulator@0 {
+			reg = <0>;
+			regulator-compatible = "VDCDC1";
+		};
+
+		vdcdc2_reg: regulator@1 {
+			reg = <1>;
+			regulator-compatible = "VDCDC2";
+		};
+
+		vdcdc3_reg: regulator@2 {
+			reg = <2>;
+			regulator-compatible = "VDCDC3";
+		};
+
+		ldo1_reg: regulator@3 {
+			reg = <3>;
+			regulator-compatible = "LDO1";
+		};
+
+		ldo2_reg: regulator@4 {
+			reg = <4>;
+			regulator-compatible = "LDO2";
+		};
+
+	};
+};
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH V2 6/6] ARM: davinci: da850: add tps6507x regulator DT data
  2013-01-29  7:38 [PATCH V2 0/6] davinci: DT support for i2c0 and tps6507x Vishwanathrao Badarkhe, Manish
                   ` (4 preceding siblings ...)
  2013-01-29  7:38 ` [PATCH V2 5/6] ARM: regulator: add tps6507x device tree data Vishwanathrao Badarkhe, Manish
@ 2013-01-29  7:38 ` Vishwanathrao Badarkhe, Manish
  2013-02-07 10:22   ` Vishwanathrao Badarkhe, Manish
  5 siblings, 1 reply; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-01-29  7:38 UTC (permalink / raw)
  To: devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
	davinci-linux-open-source
  Cc: anilkumar, tony, hs, broonie, sameo, khilman, nsekhar,
	linus.walleij, linux, rob, rob.herring, grant.likely, manishv.b

Add tps6507x regulator device tree data to da850-evm by
adding regulator consumers with tightened constraints
and regulator-name.TPS6507x regulator handle can be obtained
by using this regulator name.
Regulator constraints are added as per da850 board file.

Regulator names are given as per maximum output voltage the
regulator is capable to provide.
for e.g. regulator name for dcdc1 is "VDCDC1_3.3V".
Also, add tps6507x PMIC I2C slave device under I2C0 node.

Tested on da850-evm.

Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
---
Changes since V1:
 - No change

:100644 100644 c9ed683... 58e6961... M	arch/arm/boot/dts/da850-evm.dts
 arch/arm/boot/dts/da850-evm.dts |   63 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index c9ed683..58e6961 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -31,6 +31,10 @@
 			status = "okay";
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c0_pins>;
+
+			tps: tps@48 {
+				reg = <0x48>;
+			};
 		};
 	};
 	nand_cs3@62000000 {
@@ -38,4 +42,63 @@
 		pinctrl-names = "default";
 		pinctrl-0 = <&nand_cs3_pins>;
 	};
+	vbat: fixedregulator@0 {
+		compatible = "regulator-fixed";
+		regulator-name = "vbat";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-boot-on;
+	};
+};
+
+/include/ "tps6507x.dtsi"
+
+&tps {
+        vdcdc1_2-supply = <&vbat>;
+        vdcdc3-supply = <&vbat>;
+        vldo1_2-supply = <&vbat>;
+
+        regulators {
+                vdcdc1_reg: regulator@0 {
+                        regulator-name = "VDCDC1_3.3V";
+                        regulator-min-microvolt = <3150000>;
+                        regulator-max-microvolt = <3450000>;
+                        regulator-always-on;
+                        regulator-boot-on;
+                };
+
+                vdcdc2_reg: regulator@1 {
+                        regulator-name = "VDCDC2_3.3V";
+                        regulator-min-microvolt = <1710000>;
+                        regulator-max-microvolt = <3450000>;
+                        regulator-always-on;
+                        regulator-boot-on;
+                        ti,defdcdc_default = <1>;
+                };
+
+                vdcdc3_reg: regulator@2 {
+                        regulator-name = "VDCDC3_1.2V";
+                        regulator-min-microvolt = <950000>;
+                        regulator-max-microvolt = <1350000>;
+                        regulator-always-on;
+                        regulator-boot-on;
+                        ti,defdcdc_default = <1>;
+                };
+
+                ldo1_reg: regulator@3 {
+                        regulator-name = "LDO1_1.8V";
+                        regulator-min-microvolt = <1710000>;
+                        regulator-max-microvolt = <1890000>;
+                        regulator-always-on;
+                        regulator-boot-on;
+                };
+
+                ldo2_reg: regulator@4 {
+                        regulator-name = "LDO2_1.2V";
+                        regulator-min-microvolt = <1140000>;
+                        regulator-max-microvolt = <1320000>;
+                        regulator-always-on;
+                        regulator-boot-on;
+                };
+        };
 };
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit
  2013-01-29  7:38 ` [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit Vishwanathrao Badarkhe, Manish
@ 2013-01-29 10:59   ` Linus Walleij
  2013-01-29 12:02     ` Vishwanathrao Badarkhe, Manish
                       ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Linus Walleij @ 2013-01-29 10:59 UTC (permalink / raw)
  To: Vishwanathrao Badarkhe, Manish
  Cc: devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
	davinci-linux-open-source, anilkumar, tony, hs, broonie, sameo,
	khilman, nsekhar, linux, rob, rob.herring, grant.likely

On Tue, Jan 29, 2013 at 8:38 AM, Vishwanathrao Badarkhe, Manish
<manishv.b@ti.com> wrote:

> Currently, I2C driver gets probed before pinctrl driver.
> To achieve I2C pin muxing via pinctrl driver before I2C
> probe get called, register pinctrl driver in arch_initcall.
> Also, add module_exit to unregister pinctrl driver.
>
> Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>

So your I2C driver is not returning -EPROBE_DEFER
if it cannot find its pins?

Hm, well I can live with this, if Tony ACKs it.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit
  2013-01-29 10:59   ` Linus Walleij
@ 2013-01-29 12:02     ` Vishwanathrao Badarkhe, Manish
  2013-02-01  7:05     ` Sekhar Nori
  2013-02-01 17:09     ` Tony Lindgren
  2 siblings, 0 replies; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-01-29 12:02 UTC (permalink / raw)
  To: Linus Walleij
  Cc: devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
	davinci-linux-open-source, AnilKumar, Chimata, tony, hs, broonie,
	sameo, khilman, Nori, Sekhar, linux, rob, rob.herring,
	grant.likely

Hi Linus,

On Tue, Jan 29, 2013 at 16:29:54, Linus Walleij wrote:
> On Tue, Jan 29, 2013 at 8:38 AM, Vishwanathrao Badarkhe, Manish <manishv.b@ti.com> wrote:
> 
> > Currently, I2C driver gets probed before pinctrl driver.
> > To achieve I2C pin muxing via pinctrl driver before I2C probe get 
> > called, register pinctrl driver in arch_initcall.
> > Also, add module_exit to unregister pinctrl driver.
> >
> > Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> 
> So your I2C driver is not returning -EPROBE_DEFER if it cannot find its pins?
Yes. In Davinci I2C driver, it's not implemented to return -EPROBE_DEFER if it 
can't find its pins.

Please see below discussion for more details: 
https://patchwork2.kernel.org/patch/2031321/
 
> 
> Hm, well I can live with this, if Tony ACKs it.
> 
> Yours,
> Linus Walleij
> 


Regards, 
Manish

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit
  2013-01-29 10:59   ` Linus Walleij
  2013-01-29 12:02     ` Vishwanathrao Badarkhe, Manish
@ 2013-02-01  7:05     ` Sekhar Nori
  2013-02-01 17:09     ` Tony Lindgren
  2 siblings, 0 replies; 22+ messages in thread
From: Sekhar Nori @ 2013-02-01  7:05 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Vishwanathrao Badarkhe, Manish, devicetree-discuss, linux-doc,
	linux-kernel, linux-arm-kernel, davinci-linux-open-source,
	anilkumar, tony, hs, broonie, sameo, khilman, linux, rob,
	rob.herring, grant.likely

On 1/29/2013 4:29 PM, Linus Walleij wrote:
> On Tue, Jan 29, 2013 at 8:38 AM, Vishwanathrao Badarkhe, Manish
> <manishv.b@ti.com> wrote:
> 
>> Currently, I2C driver gets probed before pinctrl driver.
>> To achieve I2C pin muxing via pinctrl driver before I2C
>> probe get called, register pinctrl driver in arch_initcall.
>> Also, add module_exit to unregister pinctrl driver.
>>
>> Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> 
> So your I2C driver is not returning -EPROBE_DEFER
> if it cannot find its pins?
> 
> Hm, well I can live with this, if Tony ACKs it.

FWIW, most of the other pinctrl drivers seem to be using arch_initcall() 
already.

$ grep -r arch_initcall drivers/pinctrl/*
drivers/pinctrl/pinctrl-at91.c:arch_initcall(at91_pinctrl_init);
drivers/pinctrl/pinctrl-coh901.c:arch_initcall(u300_gpio_init);
drivers/pinctrl/pinctrl-imx35.c:arch_initcall(imx35_pinctrl_init);
drivers/pinctrl/pinctrl-imx51.c:arch_initcall(imx51_pinctrl_init);
drivers/pinctrl/pinctrl-imx53.c:arch_initcall(imx53_pinctrl_init);
drivers/pinctrl/pinctrl-imx6q.c:arch_initcall(imx6q_pinctrl_init);
drivers/pinctrl/pinctrl-sirf.c:arch_initcall(sirfsoc_pinmux_init);
drivers/pinctrl/pinctrl-tegra20.c:arch_initcall(tegra20_pinctrl_init);
drivers/pinctrl/pinctrl-tegra30.c:arch_initcall(tegra30_pinctrl_init);
drivers/pinctrl/pinctrl-u300.c:arch_initcall(u300_pmx_init);
drivers/pinctrl/spear/pinctrl-spear300.c:arch_initcall(spear300_pinctrl_init);
drivers/pinctrl/spear/pinctrl-spear320.c:arch_initcall(spear320_pinctrl_init);
drivers/pinctrl/spear/pinctrl-spear310.c:arch_initcall(spear310_pinctrl_init);
drivers/pinctrl/spear/pinctrl-spear1340.c:arch_initcall(spear1340_pinctrl_init);
drivers/pinctrl/spear/pinctrl-spear1310.c:arch_initcall(spear1310_pinctrl_init);

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit
  2013-01-29 10:59   ` Linus Walleij
  2013-01-29 12:02     ` Vishwanathrao Badarkhe, Manish
  2013-02-01  7:05     ` Sekhar Nori
@ 2013-02-01 17:09     ` Tony Lindgren
  2013-02-01 17:11       ` Tony Lindgren
  2 siblings, 1 reply; 22+ messages in thread
From: Tony Lindgren @ 2013-02-01 17:09 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Vishwanathrao Badarkhe, Manish, devicetree-discuss, linux-doc,
	linux-kernel, linux-arm-kernel, davinci-linux-open-source,
	anilkumar, hs, broonie, sameo, khilman, nsekhar, linux, rob,
	rob.herring, grant.likely

* Linus Walleij <linus.walleij@linaro.org> [130129 03:03]:
> On Tue, Jan 29, 2013 at 8:38 AM, Vishwanathrao Badarkhe, Manish
> <manishv.b@ti.com> wrote:
> 
> > Currently, I2C driver gets probed before pinctrl driver.
> > To achieve I2C pin muxing via pinctrl driver before I2C
> > probe get called, register pinctrl driver in arch_initcall.
> > Also, add module_exit to unregister pinctrl driver.
> >
> > Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> 
> So your I2C driver is not returning -EPROBE_DEFER
> if it cannot find its pins?
> 
> Hm, well I can live with this, if Tony ACKs it.

Hmm pinctrl is before i2c in drivers/Makefile.
Making initcalls happen earlier and earlier is usually the
wrong way to go. Sounds like there's some other issue here
that needs to be fixed instead.

Regards,

Tony

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit
  2013-02-01 17:09     ` Tony Lindgren
@ 2013-02-01 17:11       ` Tony Lindgren
  2013-02-05  6:36         ` Vishwanathrao Badarkhe, Manish
  0 siblings, 1 reply; 22+ messages in thread
From: Tony Lindgren @ 2013-02-01 17:11 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Vishwanathrao Badarkhe, Manish, davinci-linux-open-source, linux,
	sameo, linux-doc, khilman, devicetree-discuss, broonie, nsekhar,
	linux-kernel, rob.herring, hs, linux-arm-kernel

* Tony Lindgren <tony@atomide.com> [130201 09:12]:
> * Linus Walleij <linus.walleij@linaro.org> [130129 03:03]:
> > On Tue, Jan 29, 2013 at 8:38 AM, Vishwanathrao Badarkhe, Manish
> > <manishv.b@ti.com> wrote:
> > 
> > > Currently, I2C driver gets probed before pinctrl driver.
> > > To achieve I2C pin muxing via pinctrl driver before I2C
> > > probe get called, register pinctrl driver in arch_initcall.
> > > Also, add module_exit to unregister pinctrl driver.
> > >
> > > Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> > 
> > So your I2C driver is not returning -EPROBE_DEFER
> > if it cannot find its pins?
> > 
> > Hm, well I can live with this, if Tony ACKs it.
> 
> Hmm pinctrl is before i2c in drivers/Makefile.
> Making initcalls happen earlier and earlier is usually the
> wrong way to go. Sounds like there's some other issue here
> that needs to be fixed instead.

Let me guess: The i2c driver is wrongly set to run with
arch_initcall?
 
> Regards,
> 
> Tony
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH V2 3/6] ARM: davinci: da850: add DT node for I2C0
  2013-01-29  7:38 ` [PATCH V2 3/6] ARM: davinci: da850: add DT node " Vishwanathrao Badarkhe, Manish
@ 2013-02-03 12:49   ` Sekhar Nori
  2013-02-04  3:07     ` Vishwanathrao Badarkhe, Manish
  0 siblings, 1 reply; 22+ messages in thread
From: Sekhar Nori @ 2013-02-03 12:49 UTC (permalink / raw)
  To: Vishwanathrao Badarkhe, Manish
  Cc: devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
	davinci-linux-open-source, anilkumar, tony, hs, broonie, sameo,
	khilman, linus.walleij, linux, rob, rob.herring, grant.likely



On 1/29/2013 1:08 PM, Vishwanathrao Badarkhe, Manish wrote:
> Add I2C0 device tree node information to da850-evm.
> Also, add I2C0 pin muxing information in da850-evm.
> 
> Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> ---
> Changes since V1:
>  - Updated i2c0 node names in dts and dtsi file.
>  - Removed interrupt parent from i2c0 node.
>  - Handled i2c0 pin mux inside i2c0 node.
> 
> :100644 100644 433027f... c9ed683... M	arch/arm/boot/dts/da850-evm.dts
> :100644 100644 5e0eb5c... 245ab9a... M	arch/arm/boot/dts/da850.dtsi
>  arch/arm/boot/dts/da850-evm.dts |    5 +++++
>  arch/arm/boot/dts/da850.dtsi    |   15 +++++++++++++++
>  2 files changed, 20 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
> index 433027f..c9ed683 100644
> --- a/arch/arm/boot/dts/da850-evm.dts
> +++ b/arch/arm/boot/dts/da850-evm.dts
> @@ -27,6 +27,11 @@
>  		serial2: serial@1d0d000 {
>  			status = "okay";
>  		};
> +		i2c0: i2c0@1c22000 {

This should be:

i2c0: i2c@1c22000

inline with what has been done in rest of this file.

> +			status = "okay";
> +			pinctrl-names = "default";
> +			pinctrl-0 = <&i2c0_pins>;
> +		};
>  	};
>  	nand_cs3@62000000 {
>  		status = "okay";
> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
> index 5e0eb5c..245ab9a 100644
> --- a/arch/arm/boot/dts/da850.dtsi
> +++ b/arch/arm/boot/dts/da850.dtsi
> @@ -56,6 +56,12 @@
>  					0x30 0x01100000  0x0ff00000
>  				>;
>  			};
> +			i2c0_pins: pinmux_i2c0_pins {
> +				pinctrl-single,bits = <
> +					/* I2C0_SDA,I2C0_SCL */
> +					0x10 0x00002200 0x0000ff00
> +				>;
> +			};
>  		};
>  		serial0: serial@1c42000 {
>  			compatible = "ns16550a";
> @@ -81,6 +87,15 @@
>  			interrupts = <61>;
>  			status = "disabled";
>  		};
> +		i2c0: i2c0@1c22000 {
> +			compatible = "ti,davinci-i2c";
> +			reg = <0x22000 0x1000>;
> +			clock-frequency = <100000>;

The clock frequency is board specific. This should come from da850-evm.dts.

Also, I think you can merge the auxdata addition with this patch. Can
you post the i2c0 support separate from this series, so it can be taken
independently? Looks like other patches have some dependencies/acks needed.

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH V2 4/6] mfd: tps6507x: add device-tree support.
  2013-01-29  7:38 ` [PATCH V2 4/6] mfd: tps6507x: add device-tree support Vishwanathrao Badarkhe, Manish
@ 2013-02-03 22:31   ` Samuel Ortiz
  0 siblings, 0 replies; 22+ messages in thread
From: Samuel Ortiz @ 2013-02-03 22:31 UTC (permalink / raw)
  To: Vishwanathrao Badarkhe, Manish
  Cc: devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
	davinci-linux-open-source, anilkumar, tony, hs, broonie, khilman,
	nsekhar, linus.walleij, linux, rob, rob.herring, grant.likely

Hi Manish,

On Tue, Jan 29, 2013 at 01:08:52PM +0530, Vishwanathrao Badarkhe, Manish wrote:
> Add device tree based initialization support for TI's
> tps6507x mfd device.
> 
> Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> ---
> Changes since V1:
>  - updated subject line for commit.
> 
> :100644 100644 409afa2... 5ad4b77... M	drivers/mfd/tps6507x.c
>  drivers/mfd/tps6507x.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
Applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [PATCH V2 3/6] ARM: davinci: da850: add DT node for I2C0
  2013-02-03 12:49   ` Sekhar Nori
@ 2013-02-04  3:07     ` Vishwanathrao Badarkhe, Manish
  0 siblings, 0 replies; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-02-04  3:07 UTC (permalink / raw)
  To: Nori, Sekhar
  Cc: devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
	davinci-linux-open-source, AnilKumar, Chimata, tony, hs, broonie,
	sameo, khilman, linus.walleij, linux, rob, rob.herring,
	grant.likely

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2858 bytes --]

On Sun, Feb 03, 2013 at 18:19:05, Nori, Sekhar wrote:
> 
> 
> On 1/29/2013 1:08 PM, Vishwanathrao Badarkhe, Manish wrote:
> > Add I2C0 device tree node information to da850-evm.
> > Also, add I2C0 pin muxing information in da850-evm.
> > 
> > Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> > ---
> > Changes since V1:
> >  - Updated i2c0 node names in dts and dtsi file.
> >  - Removed interrupt parent from i2c0 node.
> >  - Handled i2c0 pin mux inside i2c0 node.
> > 
> > :100644 100644 433027f... c9ed683... M	arch/arm/boot/dts/da850-evm.dts
> > :100644 100644 5e0eb5c... 245ab9a... M	arch/arm/boot/dts/da850.dtsi
> >  arch/arm/boot/dts/da850-evm.dts |    5 +++++
> >  arch/arm/boot/dts/da850.dtsi    |   15 +++++++++++++++
> >  2 files changed, 20 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/da850-evm.dts 
> > b/arch/arm/boot/dts/da850-evm.dts index 433027f..c9ed683 100644
> > --- a/arch/arm/boot/dts/da850-evm.dts
> > +++ b/arch/arm/boot/dts/da850-evm.dts
> > @@ -27,6 +27,11 @@
> >  		serial2: serial@1d0d000 {
> >  			status = "okay";
> >  		};
> > +		i2c0: i2c0@1c22000 {
> 
> This should be:
> 
> i2c0: i2c@1c22000
> 
> inline with what has been done in rest of this file.

Ok, I will update this name everywhere.

> 
> > +			status = "okay";
> > +			pinctrl-names = "default";
> > +			pinctrl-0 = <&i2c0_pins>;
> > +		};
> >  	};
> >  	nand_cs3@62000000 {
> >  		status = "okay";
> > diff --git a/arch/arm/boot/dts/da850.dtsi 
> > b/arch/arm/boot/dts/da850.dtsi index 5e0eb5c..245ab9a 100644
> > --- a/arch/arm/boot/dts/da850.dtsi
> > +++ b/arch/arm/boot/dts/da850.dtsi
> > @@ -56,6 +56,12 @@
> >  					0x30 0x01100000  0x0ff00000
> >  				>;
> >  			};
> > +			i2c0_pins: pinmux_i2c0_pins {
> > +				pinctrl-single,bits = <
> > +					/* I2C0_SDA,I2C0_SCL */
> > +					0x10 0x00002200 0x0000ff00
> > +				>;
> > +			};
> >  		};
> >  		serial0: serial@1c42000 {
> >  			compatible = "ns16550a";
> > @@ -81,6 +87,15 @@
> >  			interrupts = <61>;
> >  			status = "disabled";
> >  		};
> > +		i2c0: i2c0@1c22000 {
> > +			compatible = "ti,davinci-i2c";
> > +			reg = <0x22000 0x1000>;
> > +			clock-frequency = <100000>;
> 
> The clock frequency is board specific. This should come from da850-evm.dts.

Ok, I will add this board specific information in da850-evm.dts.

> 
> Also, I think you can merge the auxdata addition with this patch. Can you post the i2c0 support separate from this series, so it can be taken independently? Looks like other patches have some dependencies/acks needed.

Sure, I will merge auxdata addition with this patch and post this patch independently from this series.

> 
> Thanks,
> Sekhar
> 


Regards, 
Manish
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit
  2013-02-01 17:11       ` Tony Lindgren
@ 2013-02-05  6:36         ` Vishwanathrao Badarkhe, Manish
  2013-02-05 11:27           ` Russell King - ARM Linux
  2013-02-05 13:00           ` Linus Walleij
  0 siblings, 2 replies; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-02-05  6:36 UTC (permalink / raw)
  To: Tony Lindgren, Linus Walleij
  Cc: davinci-linux-open-source, linux, sameo, linux-doc, khilman,
	devicetree-discuss, broonie, Nori, Sekhar, linux-kernel,
	rob.herring, hs, linux-arm-kernel

On Fri, Feb 01, 2013 at 22:41:24, Tony Lindgren wrote:
> * Tony Lindgren <tony@atomide.com> [130201 09:12]:
> > * Linus Walleij <linus.walleij@linaro.org> [130129 03:03]:
> > > On Tue, Jan 29, 2013 at 8:38 AM, Vishwanathrao Badarkhe, Manish 
> > > <manishv.b@ti.com> wrote:
> > > 
> > > > Currently, I2C driver gets probed before pinctrl driver.
> > > > To achieve I2C pin muxing via pinctrl driver before I2C probe get 
> > > > called, register pinctrl driver in arch_initcall.
> > > > Also, add module_exit to unregister pinctrl driver.
> > > >
> > > > Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> > > 
> > > So your I2C driver is not returning -EPROBE_DEFER if it cannot find 
> > > its pins?
> > > 
> > > Hm, well I can live with this, if Tony ACKs it.
> > 
> > Hmm pinctrl is before i2c in drivers/Makefile.
> > Making initcalls happen earlier and earlier is usually the wrong way 
> > to go. Sounds like there's some other issue here that needs to be 
> > fixed instead.
> 
> Let me guess: The i2c driver is wrongly set to run with arch_initcall?
>  

Hi Tony

No, Currently i2c driver is set to subsys_initcall. I have seen some
problem while using pin control grab functionality. Please see detailed
explanation as below.

Hi Linus

I am using auto grab pin control facility to do pin muxing of I2C0 
pins and seen problem as below:

Currently, probe of I2C0 driver gets called before pin control driver. 
Hence, while calling I2C0 probe because of unavailability of  
pin control node information, its probe get deferred giving following 
messages:

"i2c_davinci i2c_davinci.1: could not find pctldev for node /soc/pinmux@1c14120
/pinmux_i2c0_pins, deferring probe"

As I2C0 is in deferred list (as auto grab patch handle this), its probe 
get called once again, During this second time probe of I2C0, I have 
observed following crash:

"Unable to handle kernel paging request at virtual address fffffe07"

As per code analysis of auto grab functionality, I have seen in 
"pinctrl_bind_pin" function, pin control handle (dpi->p) is returned by 
"devm_pinctrl_get" function.

Pin control handle is assigned with error pointer during 1st time probing of 
I2C0 (as pin control information is not available at this time). 
During 2nd time probing (deferred probe) of I2C0, same pin control handle 
(which was get assigned during 1st probe) is getting used instead of getting 
updated to correct pin control handle which leads to system crash.

I made following changes, in order to update "dip->p" pointer with 
correct value:

-       if (!dpi->p) {
+       if (IS_ERR_OR_NULL(dpi->p)) {
                dpi->p = devm_pinctrl_get(dev);
-               if (IS_ERR_OR_NULL(dpi->p)) {
-                       int ret = PTR_ERR(dpi->p);
-
-                       dev_dbg(dev, "no pinctrl handle\n");
-                       /* Only return deferrals */
-                       if (ret == -EPROBE_DEFER)
-                               return ret;
-                       return 0;
-               }
+               ret = PTR_ERR(dpi->p);
+               dev_dbg(dev, "no pinctrl handle\n");
+               /* Only return deferrals */
+               if (ret == -EPROBE_DEFER)
+                       return ret;
+               return 0;

Is this intended change? or am I missing something in order to use this auto grab
functionality?

With the above change, now deferred probing is working fine and there is no need
to register pin control driver in arch_initcall.


Regards, 
Manish

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit
  2013-02-05  6:36         ` Vishwanathrao Badarkhe, Manish
@ 2013-02-05 11:27           ` Russell King - ARM Linux
  2013-02-06  6:04             ` Vishwanathrao Badarkhe, Manish
  2013-02-05 13:00           ` Linus Walleij
  1 sibling, 1 reply; 22+ messages in thread
From: Russell King - ARM Linux @ 2013-02-05 11:27 UTC (permalink / raw)
  To: Vishwanathrao Badarkhe, Manish
  Cc: Tony Lindgren, Linus Walleij, davinci-linux-open-source, sameo,
	linux-doc, khilman, devicetree-discuss, broonie, Nori, Sekhar,
	linux-kernel, rob.herring, hs, linux-arm-kernel

On Tue, Feb 05, 2013 at 06:36:34AM +0000, Vishwanathrao Badarkhe, Manish wrote:
> I made following changes, in order to update "dip->p" pointer with 
> correct value:
> 
> -       if (!dpi->p) {
> +       if (IS_ERR_OR_NULL(dpi->p)) {
>                 dpi->p = devm_pinctrl_get(dev);
> -               if (IS_ERR_OR_NULL(dpi->p)) {
> -                       int ret = PTR_ERR(dpi->p);
> -
> -                       dev_dbg(dev, "no pinctrl handle\n");
> -                       /* Only return deferrals */
> -                       if (ret == -EPROBE_DEFER)
> -                               return ret;
> -                       return 0;
> -               }
> +               ret = PTR_ERR(dpi->p);
> +               dev_dbg(dev, "no pinctrl handle\n");
> +               /* Only return deferrals */
> +               if (ret == -EPROBE_DEFER)
> +                       return ret;
> +               return 0;
> 
> Is this intended change?

The above looks totally broken to me.

Oh, it's using IS_ERR_OR_NULL(), so it's bound to be broken.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit
  2013-02-05  6:36         ` Vishwanathrao Badarkhe, Manish
  2013-02-05 11:27           ` Russell King - ARM Linux
@ 2013-02-05 13:00           ` Linus Walleij
  2013-02-06  4:57             ` Vishwanathrao Badarkhe, Manish
  1 sibling, 1 reply; 22+ messages in thread
From: Linus Walleij @ 2013-02-05 13:00 UTC (permalink / raw)
  To: Vishwanathrao Badarkhe, Manish
  Cc: Tony Lindgren, davinci-linux-open-source, linux, sameo,
	linux-doc, khilman, devicetree-discuss, broonie, Nori, Sekhar,
	linux-kernel, rob.herring, hs, linux-arm-kernel

On Tue, Feb 5, 2013 at 7:36 AM, Vishwanathrao Badarkhe, Manish
<manishv.b@ti.com> wrote:

> I made following changes, in order to update "dip->p" pointer with
> correct value:
>
> -       if (!dpi->p) {
> +       if (IS_ERR_OR_NULL(dpi->p)) {
>                 dpi->p = devm_pinctrl_get(dev);
> -               if (IS_ERR_OR_NULL(dpi->p)) {
> -                       int ret = PTR_ERR(dpi->p);
> -
> -                       dev_dbg(dev, "no pinctrl handle\n");
> -                       /* Only return deferrals */
> -                       if (ret == -EPROBE_DEFER)
> -                               return ret;
> -                       return 0;
> -               }
> +               ret = PTR_ERR(dpi->p);
> +               dev_dbg(dev, "no pinctrl handle\n");
> +               /* Only return deferrals */
> +               if (ret == -EPROBE_DEFER)
> +                       return ret;
> +               return 0;

This is based on some old code that I wrote ages ago. Check the
pinctrl tree or linux-next for the latest core pin grabbing code.
Use that instead.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit
  2013-02-05 13:00           ` Linus Walleij
@ 2013-02-06  4:57             ` Vishwanathrao Badarkhe, Manish
  0 siblings, 0 replies; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-02-06  4:57 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Tony Lindgren, davinci-linux-open-source, linux, sameo,
	linux-doc, khilman, devicetree-discuss, broonie, Nori, Sekhar,
	linux-kernel, rob.herring, hs, linux-arm-kernel

Hi Linus

On Tue, Feb 05, 2013 at 18:30:48, Linus Walleij wrote:
> On Tue, Feb 5, 2013 at 7:36 AM, Vishwanathrao Badarkhe, Manish <manishv.b@ti.com> wrote:
> 
> > I made following changes, in order to update "dip->p" pointer with 
> > correct value:
> >
> > -       if (!dpi->p) {
> > +       if (IS_ERR_OR_NULL(dpi->p)) {
> >                 dpi->p = devm_pinctrl_get(dev);
> > -               if (IS_ERR_OR_NULL(dpi->p)) {
> > -                       int ret = PTR_ERR(dpi->p);
> > -
> > -                       dev_dbg(dev, "no pinctrl handle\n");
> > -                       /* Only return deferrals */
> > -                       if (ret == -EPROBE_DEFER)
> > -                               return ret;
> > -                       return 0;
> > -               }
> > +               ret = PTR_ERR(dpi->p);
> > +               dev_dbg(dev, "no pinctrl handle\n");
> > +               /* Only return deferrals */
> > +               if (ret == -EPROBE_DEFER)
> > +                       return ret;
> > +               return 0;
> 
> This is based on some old code that I wrote ages ago. Check the pinctrl tree or linux-next for the latest core pin grabbing code.
> Use that instead.

Thanks for your reply.
I have checked with your latest changes regarding pinctrl 
in linux-next tree and these changes are working fine for me.

Regards
Manish Badarkhe

^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit
  2013-02-05 11:27           ` Russell King - ARM Linux
@ 2013-02-06  6:04             ` Vishwanathrao Badarkhe, Manish
  0 siblings, 0 replies; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-02-06  6:04 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Tony Lindgren, Linus Walleij, davinci-linux-open-source, sameo,
	linux-doc, khilman, devicetree-discuss, broonie, Nori, Sekhar,
	linux-kernel, rob.herring, hs, linux-arm-kernel

Hi Russell,

On Tue, Feb 05, 2013 at 16:57:31, Russell King - ARM Linux wrote:
> On Tue, Feb 05, 2013 at 06:36:34AM +0000, Vishwanathrao Badarkhe, Manish wrote:
> > I made following changes, in order to update "dip->p" pointer with 
> > correct value:
> > 
> > -       if (!dpi->p) {
> > +       if (IS_ERR_OR_NULL(dpi->p)) {
> >                 dpi->p = devm_pinctrl_get(dev);
> > -               if (IS_ERR_OR_NULL(dpi->p)) {
> > -                       int ret = PTR_ERR(dpi->p);
> > -
> > -                       dev_dbg(dev, "no pinctrl handle\n");
> > -                       /* Only return deferrals */
> > -                       if (ret == -EPROBE_DEFER)
> > -                               return ret;
> > -                       return 0;
> > -               }
> > +               ret = PTR_ERR(dpi->p);
> > +               dev_dbg(dev, "no pinctrl handle\n");
> > +               /* Only return deferrals */
> > +               if (ret == -EPROBE_DEFER)
> > +                       return ret;
> > +               return 0;
> > 
> > Is this intended change?
> 
> The above looks totally broken to me.
> 
> Oh, it's using IS_ERR_OR_NULL(), so it's bound to be broken.
> 

I went through discussion in community on usage of "IS_ERR_OR_NULL".
https://patchwork.kernel.org/patch/1953271/
Will take care not use this in future.

Thanks,
Manish

^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [PATCH V2 5/6] ARM: regulator: add tps6507x device tree data
  2013-01-29  7:38 ` [PATCH V2 5/6] ARM: regulator: add tps6507x device tree data Vishwanathrao Badarkhe, Manish
@ 2013-02-07 10:21   ` Vishwanathrao Badarkhe, Manish
  0 siblings, 0 replies; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-02-07 10:21 UTC (permalink / raw)
  To: Vishwanathrao Badarkhe, Manish, devicetree-discuss, linux-doc,
	linux-kernel, linux-arm-kernel, davinci-linux-open-source
  Cc: AnilKumar, Chimata, tony, hs, broonie, sameo, khilman, Nori,
	Sekhar, linus.walleij, linux, rob, rob.herring, grant.likely

Hi Mark,

On Tue, Jan 29, 2013 at 13:08:53, Vishwanathrao Badarkhe, Manish wrote:
> Add device tree data for tps6507x regulator by adding all tps6507x regulator nodes. Regulators are initialized based on compatible name provided in tps6507x DT file.
> 
> All tps6507x PMIC regulator device tree nodes are placed in a separate device tree include file (tps6507x.dtsi).
> tps6507x.dtsi file is created using datasheet http://www.ti.com/lit/ds/symlink/tps65070.pdf
> 
> Tested on da850-evm.
> 
> Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> ---
> Changes since V1:
>  - Updated Copyright information.
> 
> :000000 100644 0000000... 4c326e5... A	arch/arm/boot/dts/tps6507x.dtsi
>  arch/arm/boot/dts/tps6507x.dtsi |   47 +++++++++++++++++++++++++++++++++++++++
>  1 files changed, 47 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/tps6507x.dtsi b/arch/arm/boot/dts/tps6507x.dtsi new file mode 100644 index 0000000..4c326e5
> --- /dev/null
> +++ b/arch/arm/boot/dts/tps6507x.dtsi
> @@ -0,0 +1,47 @@
> +/*
> + * Copyright (C) 2013 Texas Instruments Incorporated - 
> +http://www.ti.com/
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +/*
> + * Integrated Power Management Chip
> + * http://www.ti.com/lit/ds/symlink/tps65070.pdf
> + */
> +
> +&tps {
> +	compatible = "ti,tps6507x";
> +
> +	regulators {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		vdcdc1_reg: regulator@0 {
> +			reg = <0>;
> +			regulator-compatible = "VDCDC1";
> +		};
> +
> +		vdcdc2_reg: regulator@1 {
> +			reg = <1>;
> +			regulator-compatible = "VDCDC2";
> +		};
> +
> +		vdcdc3_reg: regulator@2 {
> +			reg = <2>;
> +			regulator-compatible = "VDCDC3";
> +		};
> +
> +		ldo1_reg: regulator@3 {
> +			reg = <3>;
> +			regulator-compatible = "LDO1";
> +		};
> +
> +		ldo2_reg: regulator@4 {
> +			reg = <4>;
> +			regulator-compatible = "LDO2";
> +		};
> +
> +	};
> +};
> --
> 1.7.4.1
> 
> 

If there are not any comments on this patch, Could you please 
accept this patch?

Regards, 
Manish

^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [PATCH V2 6/6] ARM: davinci: da850: add tps6507x regulator DT data
  2013-01-29  7:38 ` [PATCH V2 6/6] ARM: davinci: da850: add tps6507x regulator DT data Vishwanathrao Badarkhe, Manish
@ 2013-02-07 10:22   ` Vishwanathrao Badarkhe, Manish
  0 siblings, 0 replies; 22+ messages in thread
From: Vishwanathrao Badarkhe, Manish @ 2013-02-07 10:22 UTC (permalink / raw)
  To: Vishwanathrao Badarkhe, Manish, devicetree-discuss, linux-doc,
	linux-kernel, linux-arm-kernel, davinci-linux-open-source
  Cc: AnilKumar, Chimata, tony, hs, broonie, sameo, khilman, Nori,
	Sekhar, linus.walleij, linux, rob, rob.herring, grant.likely

Hi Mark,

On Tue, Jan 29, 2013 at 13:08:54, Vishwanathrao Badarkhe, Manish wrote:
> Add tps6507x regulator device tree data to da850-evm by adding regulator consumers with tightened constraints and regulator-name.TPS6507x regulator handle can be obtained by using this regulator name.
> Regulator constraints are added as per da850 board file.
> 
> Regulator names are given as per maximum output voltage the regulator is capable to provide.
> for e.g. regulator name for dcdc1 is "VDCDC1_3.3V".
> Also, add tps6507x PMIC I2C slave device under I2C0 node.
> 
> Tested on da850-evm.
> 
> Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> ---
> Changes since V1:
>  - No change
> 
> :100644 100644 c9ed683... 58e6961... M	arch/arm/boot/dts/da850-evm.dts
>  arch/arm/boot/dts/da850-evm.dts |   63 +++++++++++++++++++++++++++++++++++++++
>  1 files changed, 63 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts index c9ed683..58e6961 100644
> --- a/arch/arm/boot/dts/da850-evm.dts
> +++ b/arch/arm/boot/dts/da850-evm.dts
> @@ -31,6 +31,10 @@
>  			status = "okay";
>  			pinctrl-names = "default";
>  			pinctrl-0 = <&i2c0_pins>;
> +
> +			tps: tps@48 {
> +				reg = <0x48>;
> +			};
>  		};
>  	};
>  	nand_cs3@62000000 {
> @@ -38,4 +42,63 @@
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&nand_cs3_pins>;
>  	};
> +	vbat: fixedregulator@0 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vbat";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		regulator-boot-on;
> +	};
> +};
> +
> +/include/ "tps6507x.dtsi"
> +
> +&tps {
> +        vdcdc1_2-supply = <&vbat>;
> +        vdcdc3-supply = <&vbat>;
> +        vldo1_2-supply = <&vbat>;
> +
> +        regulators {
> +                vdcdc1_reg: regulator@0 {
> +                        regulator-name = "VDCDC1_3.3V";
> +                        regulator-min-microvolt = <3150000>;
> +                        regulator-max-microvolt = <3450000>;
> +                        regulator-always-on;
> +                        regulator-boot-on;
> +                };
> +
> +                vdcdc2_reg: regulator@1 {
> +                        regulator-name = "VDCDC2_3.3V";
> +                        regulator-min-microvolt = <1710000>;
> +                        regulator-max-microvolt = <3450000>;
> +                        regulator-always-on;
> +                        regulator-boot-on;
> +                        ti,defdcdc_default = <1>;
> +                };
> +
> +                vdcdc3_reg: regulator@2 {
> +                        regulator-name = "VDCDC3_1.2V";
> +                        regulator-min-microvolt = <950000>;
> +                        regulator-max-microvolt = <1350000>;
> +                        regulator-always-on;
> +                        regulator-boot-on;
> +                        ti,defdcdc_default = <1>;
> +                };
> +
> +                ldo1_reg: regulator@3 {
> +                        regulator-name = "LDO1_1.8V";
> +                        regulator-min-microvolt = <1710000>;
> +                        regulator-max-microvolt = <1890000>;
> +                        regulator-always-on;
> +                        regulator-boot-on;
> +                };
> +
> +                ldo2_reg: regulator@4 {
> +                        regulator-name = "LDO2_1.2V";
> +                        regulator-min-microvolt = <1140000>;
> +                        regulator-max-microvolt = <1320000>;
> +                        regulator-always-on;
> +                        regulator-boot-on;
> +                };
> +        };
>  };
> --
> 1.7.4.1
> 
> 

If there are not any comments on this patch, Could you please accept 
this patch?

Regards, 
Manish

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2013-02-07 10:22 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-29  7:38 [PATCH V2 0/6] davinci: DT support for i2c0 and tps6507x Vishwanathrao Badarkhe, Manish
2013-01-29  7:38 ` [PATCH V2 1/6] pinctrl: pinctrl-single: use arch_initcall and module_exit Vishwanathrao Badarkhe, Manish
2013-01-29 10:59   ` Linus Walleij
2013-01-29 12:02     ` Vishwanathrao Badarkhe, Manish
2013-02-01  7:05     ` Sekhar Nori
2013-02-01 17:09     ` Tony Lindgren
2013-02-01 17:11       ` Tony Lindgren
2013-02-05  6:36         ` Vishwanathrao Badarkhe, Manish
2013-02-05 11:27           ` Russell King - ARM Linux
2013-02-06  6:04             ` Vishwanathrao Badarkhe, Manish
2013-02-05 13:00           ` Linus Walleij
2013-02-06  4:57             ` Vishwanathrao Badarkhe, Manish
2013-01-29  7:38 ` [PATCH V2 2/6] ARM: davinci: da850: add OF_DEV_AUXDATA entry for I2C0 Vishwanathrao Badarkhe, Manish
2013-01-29  7:38 ` [PATCH V2 3/6] ARM: davinci: da850: add DT node " Vishwanathrao Badarkhe, Manish
2013-02-03 12:49   ` Sekhar Nori
2013-02-04  3:07     ` Vishwanathrao Badarkhe, Manish
2013-01-29  7:38 ` [PATCH V2 4/6] mfd: tps6507x: add device-tree support Vishwanathrao Badarkhe, Manish
2013-02-03 22:31   ` Samuel Ortiz
2013-01-29  7:38 ` [PATCH V2 5/6] ARM: regulator: add tps6507x device tree data Vishwanathrao Badarkhe, Manish
2013-02-07 10:21   ` Vishwanathrao Badarkhe, Manish
2013-01-29  7:38 ` [PATCH V2 6/6] ARM: davinci: da850: add tps6507x regulator DT data Vishwanathrao Badarkhe, Manish
2013-02-07 10:22   ` Vishwanathrao Badarkhe, Manish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).