2013-03-12 23:14:38

by Doug Anderson

[permalink] [raw]
Subject: [PATCH 0/4] Get exynos adc driver running on on exynos5250-snow

This set of patches is based on Naveen Krishna Chatradhi's recent work
(some of which is still in-flight) and does the final touches to get
things working on exynos5250-snow (the ARM Chromebook).

These patches were tested on next-20130312 (which includes support for
the common clock framework on exynos) plus the current linux-iio/togreg:
95783f2 iio: adc: add exynos adc driver under iio framwork
298489f iio:common: Use spi_sync_transfer() in STMicroelectronics ...
1d9a4cb IIO ADC support for AD7923
9a282b0 iio: Add OF support
3d277fc3 staging:iio: Remove adt7410 driver

...plus Naveen's recent ADC cleanup and NTC thermistor patch.

Doug Anderson (4):
iio: adc: Document the regulator/clocks for exynos-adc
iio: adc: Add dt support for turning on the phy in exynos-adc
ARM: dts: Add adc to exynos5250 device tree file
ARM: dts: Add adc and thermistors for exynos5250-snow

.../devicetree/bindings/arm/samsung/exynos-adc.txt | 12 +++++++--
arch/arm/boot/dts/cros5250-common.dtsi | 4 +++
arch/arm/boot/dts/exynos5250-snow.dts | 31 ++++++++++++++++++++++
arch/arm/boot/dts/exynos5250.dtsi | 11 ++++++++
drivers/iio/adc/exynos_adc.c | 14 +++++++++-
5 files changed, 69 insertions(+), 3 deletions(-)

--
1.8.1.3


2013-03-12 23:13:46

by Doug Anderson

[permalink] [raw]
Subject: [PATCH 4/4] ARM: dts: Add adc and thermistors for exynos5250-snow

Hook up the exynos5250-snow thermistors via the device tree now that
there's a driver available to use them.

Signed-off-by: Doug Anderson <[email protected]>
---
arch/arm/boot/dts/cros5250-common.dtsi | 4 ++++
arch/arm/boot/dts/exynos5250-snow.dts | 31 +++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+)

diff --git a/arch/arm/boot/dts/cros5250-common.dtsi b/arch/arm/boot/dts/cros5250-common.dtsi
index 62eceb4..cb48981 100644
--- a/arch/arm/boot/dts/cros5250-common.dtsi
+++ b/arch/arm/boot/dts/cros5250-common.dtsi
@@ -305,6 +305,10 @@
status = "disabled";
};

+ adc@12D10000 {
+ vdd-supply = <&buck5_reg>;
+ };
+
hdmi {
hpd-gpio = <&gpx3 7 0xf 1 3>;
};
diff --git a/arch/arm/boot/dts/exynos5250-snow.dts b/arch/arm/boot/dts/exynos5250-snow.dts
index babd9f9..1cab5fd 100644
--- a/arch/arm/boot/dts/exynos5250-snow.dts
+++ b/arch/arm/boot/dts/exynos5250-snow.dts
@@ -51,4 +51,35 @@
clock-frequency = <24000000>;
};
};
+
+ adc@12D10000 {
+ ncp15wb473@3 {
+ compatible = "ntc,ncp15wb473";
+ pullup-uV = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 3>;
+ };
+ ncp15wb473@4 {
+ compatible = "ntc,ncp15wb473";
+ pullup-uV = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 4>;
+ };
+ ncp15wb473@5 {
+ compatible = "ntc,ncp15wb473";
+ pullup-uV = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 5>;
+ };
+ ncp15wb473@6 {
+ compatible = "ntc,ncp15wb473";
+ pullup-uV = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 6>;
+ };
+ };
};
--
1.8.1.3

2013-03-12 23:14:05

by Doug Anderson

[permalink] [raw]
Subject: [PATCH 3/4] ARM: dts: Add adc to exynos5250 device tree file

Add the device tree entry for the device-tree enabled ADC driver that
recently landed in the iio tree.

Signed-off-by: Doug Anderson <[email protected]>
---
arch/arm/boot/dts/exynos5250.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 24c52e6..3773feb 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -115,6 +115,17 @@
interrupts = <1 2>, <22 4>;
};

+ adc: adc@12D10000 {
+ compatible = "samsung,exynos-adc-v1";
+ reg = <0x12D10000 0x100>, <0x10040718 0x4>;
+ interrupts = <0 106 0>;
+ #io-channel-cells = <1>;
+ io-channel-ranges;
+
+ clocks = <&clock 303>;
+ clock-names = "adc";
+ };
+
watchdog {
compatible = "samsung,s3c2410-wdt";
reg = <0x101D0000 0x100>;
--
1.8.1.3

2013-03-12 23:14:03

by Doug Anderson

[permalink] [raw]
Subject: [PATCH 2/4] iio: adc: Add dt support for turning on the phy in exynos-adc

Without this change the exynos adc controller needed to have its phy
enabled in some out-of-driver C code. Add support for specifying the
phy enable register by listing it in the reg list.

Signed-off-by: Doug Anderson <[email protected]>
---
.../devicetree/bindings/arm/samsung/exynos-adc.txt | 4 ++--
drivers/iio/adc/exynos_adc.c | 14 +++++++++++++-
2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
index 96db940..05be151 100644
--- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
+++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
@@ -15,7 +15,7 @@ Required properties:
Must be "samsung,exynos-adc-v2" for
future controllers.
- reg: Contains ADC register address range (base address and
- length).
+ length) and the address of the phy enable register.
- interrupts: Contains the interrupt information for the timer. The
format is being dependent on which interrupt controller
the Samsung device uses.
@@ -30,7 +30,7 @@ Example: adding device info in dtsi file

adc: adc@12D10000 {
compatible = "samsung,exynos-adc-v1";
- reg = <0x12D10000 0x100>;
+ reg = <0x12D10000 0x100>, <0x10040718 0x4>;
interrupts = <0 106 0>;
#io-channel-cells = <1>;
io-channel-ranges;
diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index ed6fdd7..5ab0dfd 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -85,6 +85,7 @@ enum adc_version {

struct exynos_adc {
void __iomem *regs;
+ void __iomem *enable_reg;
struct clk *clk;
unsigned int irq;
struct regulator *vdd;
@@ -269,13 +270,19 @@ static int exynos_adc_probe(struct platform_device *pdev)
info = iio_priv(indio_dev);

mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
info->regs = devm_request_and_ioremap(&pdev->dev, mem);
if (!info->regs) {
ret = -ENOMEM;
goto err_iio;
}

+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+ info->enable_reg = devm_request_and_ioremap(&pdev->dev, mem);
+ if (!info->enable_reg) {
+ ret = -ENOMEM;
+ goto err_iio;
+ }
+
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "no irq resource?\n");
@@ -295,6 +302,8 @@ static int exynos_adc_probe(struct platform_device *pdev)
goto err_iio;
}

+ writel(1, info->enable_reg);
+
info->clk = devm_clk_get(&pdev->dev, "adc");
if (IS_ERR(info->clk)) {
dev_err(&pdev->dev, "failed getting clock, err = %ld\n",
@@ -370,6 +379,7 @@ static int exynos_adc_remove(struct platform_device *pdev)
exynos_adc_remove_devices);
regulator_disable(info->vdd);
clk_disable_unprepare(info->clk);
+ writel(0, info->enable_reg);
iio_device_unregister(indio_dev);
free_irq(info->irq, info);
iio_device_free(indio_dev);
@@ -395,6 +405,7 @@ static int exynos_adc_suspend(struct device *dev)
}

clk_disable_unprepare(info->clk);
+ writel(0, info->enable_reg);
regulator_disable(info->vdd);

return 0;
@@ -410,6 +421,7 @@ static int exynos_adc_resume(struct device *dev)
if (ret)
return ret;

+ writel(1, info->enable_reg);
clk_prepare_enable(info->clk);

exynos_adc_hw_init(info);
--
1.8.1.3

2013-03-12 23:14:37

by Doug Anderson

[permalink] [raw]
Subject: [PATCH 1/4] iio: adc: Document the regulator/clocks for exynos-adc

The exynos ADC won't work without a regulator called "vdd" and a clock
called "adc". Document this fact in the device tree bindings.

Signed-off-by: Doug Anderson <[email protected]>
---
Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
index f686378..96db940 100644
--- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
+++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
@@ -20,6 +20,9 @@ Required properties:
format is being dependent on which interrupt controller
the Samsung device uses.
- #io-channel-cells = <1>; As ADC has multiple outputs
+- clocks From common clock binding: handle to adc clock.
+- clock-names From common clock binding: Shall be "adc".
+- vdd-supply VDD input supply.

Note: child nodes can be added for auto probing from device tree.

@@ -31,6 +34,11 @@ adc: adc@12D10000 {
interrupts = <0 106 0>;
#io-channel-cells = <1>;
io-channel-ranges;
+
+ clocks = <&clock 303>;
+ clock-names = "adc";
+
+ vdd-supply = <&buck5_reg>;
};


--
1.8.1.3

2013-03-13 20:40:21

by Doug Anderson

[permalink] [raw]
Subject: [PATCH v2 2/4] iio: adc: Add dt support for turning on the phy in exynos-adc

Without this change the exynos adc controller needed to have its phy
enabled in some out-of-driver C code. Add support for specifying the
phy enable register by listing it in the reg list.

Signed-off-by: Doug Anderson <[email protected]>
---
Changes in v2: None

.../devicetree/bindings/arm/samsung/exynos-adc.txt | 4 ++--
drivers/iio/adc/exynos_adc.c | 14 +++++++++++++-
2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
index 96db940..05be151 100644
--- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
+++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
@@ -15,7 +15,7 @@ Required properties:
Must be "samsung,exynos-adc-v2" for
future controllers.
- reg: Contains ADC register address range (base address and
- length).
+ length) and the address of the phy enable register.
- interrupts: Contains the interrupt information for the timer. The
format is being dependent on which interrupt controller
the Samsung device uses.
@@ -30,7 +30,7 @@ Example: adding device info in dtsi file

adc: adc@12D10000 {
compatible = "samsung,exynos-adc-v1";
- reg = <0x12D10000 0x100>;
+ reg = <0x12D10000 0x100>, <0x10040718 0x4>;
interrupts = <0 106 0>;
#io-channel-cells = <1>;
io-channel-ranges;
diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index ed6fdd7..5ab0dfd 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -85,6 +85,7 @@ enum adc_version {

struct exynos_adc {
void __iomem *regs;
+ void __iomem *enable_reg;
struct clk *clk;
unsigned int irq;
struct regulator *vdd;
@@ -269,13 +270,19 @@ static int exynos_adc_probe(struct platform_device *pdev)
info = iio_priv(indio_dev);

mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
info->regs = devm_request_and_ioremap(&pdev->dev, mem);
if (!info->regs) {
ret = -ENOMEM;
goto err_iio;
}

+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+ info->enable_reg = devm_request_and_ioremap(&pdev->dev, mem);
+ if (!info->enable_reg) {
+ ret = -ENOMEM;
+ goto err_iio;
+ }
+
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "no irq resource?\n");
@@ -295,6 +302,8 @@ static int exynos_adc_probe(struct platform_device *pdev)
goto err_iio;
}

+ writel(1, info->enable_reg);
+
info->clk = devm_clk_get(&pdev->dev, "adc");
if (IS_ERR(info->clk)) {
dev_err(&pdev->dev, "failed getting clock, err = %ld\n",
@@ -370,6 +379,7 @@ static int exynos_adc_remove(struct platform_device *pdev)
exynos_adc_remove_devices);
regulator_disable(info->vdd);
clk_disable_unprepare(info->clk);
+ writel(0, info->enable_reg);
iio_device_unregister(indio_dev);
free_irq(info->irq, info);
iio_device_free(indio_dev);
@@ -395,6 +405,7 @@ static int exynos_adc_suspend(struct device *dev)
}

clk_disable_unprepare(info->clk);
+ writel(0, info->enable_reg);
regulator_disable(info->vdd);

return 0;
@@ -410,6 +421,7 @@ static int exynos_adc_resume(struct device *dev)
if (ret)
return ret;

+ writel(1, info->enable_reg);
clk_prepare_enable(info->clk);

exynos_adc_hw_init(info);
--
1.8.1.3

2013-03-13 20:40:19

by Doug Anderson

[permalink] [raw]
Subject: [PATCH v2 3/4] ARM: dts: Add adc to exynos5250 device tree file

Add the device tree entry for the device-tree enabled ADC driver that
recently landed in the iio tree.

Signed-off-by: Doug Anderson <[email protected]>
---
Changes in v2: None

arch/arm/boot/dts/exynos5250.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 3acf594..1642062 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -69,6 +69,17 @@
<0 28 0>, <0 29 0>, <0 30 0>, <0 31 0>;
};

+ adc: adc@12D10000 {
+ compatible = "samsung,exynos-adc-v1";
+ reg = <0x12D10000 0x100>, <0x10040718 0x4>;
+ interrupts = <0 106 0>;
+ #io-channel-cells = <1>;
+ io-channel-ranges;
+
+ clocks = <&clock 303>;
+ clock-names = "adc";
+ };
+
watchdog {
compatible = "samsung,s3c2410-wdt";
reg = <0x101D0000 0x100>;
--
1.8.1.3

2013-03-13 20:40:17

by Doug Anderson

[permalink] [raw]
Subject: [PATCH v2 1/4] iio: adc: Document the regulator/clocks for exynos-adc

The exynos ADC won't work without a regulator called "vdd" and a clock
called "adc". Document this fact in the device tree bindings.

Signed-off-by: Doug Anderson <[email protected]>
---
Changes in v2: None

Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
index f686378..96db940 100644
--- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
+++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
@@ -20,6 +20,9 @@ Required properties:
format is being dependent on which interrupt controller
the Samsung device uses.
- #io-channel-cells = <1>; As ADC has multiple outputs
+- clocks From common clock binding: handle to adc clock.
+- clock-names From common clock binding: Shall be "adc".
+- vdd-supply VDD input supply.

Note: child nodes can be added for auto probing from device tree.

@@ -31,6 +34,11 @@ adc: adc@12D10000 {
interrupts = <0 106 0>;
#io-channel-cells = <1>;
io-channel-ranges;
+
+ clocks = <&clock 303>;
+ clock-names = "adc";
+
+ vdd-supply = <&buck5_reg>;
};


--
1.8.1.3

2013-03-13 20:40:59

by Doug Anderson

[permalink] [raw]
Subject: [PATCH v2 4/4] ARM: dts: Add adc and thermistors for exynos5250-snow

Hook up the exynos5250-snow thermistors via the device tree now that
there's a driver available to use them.

Signed-off-by: Doug Anderson <[email protected]>
---
Changes in v2:
- Match 'uV' -> 'uv' change in Naveen's bindings.

arch/arm/boot/dts/cros5250-common.dtsi | 4 ++++
arch/arm/boot/dts/exynos5250-snow.dts | 31 +++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+)

diff --git a/arch/arm/boot/dts/cros5250-common.dtsi b/arch/arm/boot/dts/cros5250-common.dtsi
index 46c0980..f7cc835 100644
--- a/arch/arm/boot/dts/cros5250-common.dtsi
+++ b/arch/arm/boot/dts/cros5250-common.dtsi
@@ -167,6 +167,10 @@
status = "disabled";
};

+ adc@12D10000 {
+ vdd-supply = <&buck5_reg>;
+ };
+
hdmi {
hpd-gpio = <&gpx3 7 0xf 1 3>;
};
diff --git a/arch/arm/boot/dts/exynos5250-snow.dts b/arch/arm/boot/dts/exynos5250-snow.dts
index 17dd951..b78da7c 100644
--- a/arch/arm/boot/dts/exynos5250-snow.dts
+++ b/arch/arm/boot/dts/exynos5250-snow.dts
@@ -40,4 +40,35 @@
<&gpc4 5 2 3 0>, <&gpc4 6 2 3 0>;
};
};
+
+ adc@12D10000 {
+ ncp15wb473@3 {
+ compatible = "ntc,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 3>;
+ };
+ ncp15wb473@4 {
+ compatible = "ntc,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 4>;
+ };
+ ncp15wb473@5 {
+ compatible = "ntc,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 5>;
+ };
+ ncp15wb473@6 {
+ compatible = "ntc,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 6>;
+ };
+ };
};
--
1.8.1.3

2013-03-13 20:48:06

by Doug Anderson

[permalink] [raw]
Subject: [PATCH v2 0/4] This set of patches is based on Naveen Krishna Chatradhi's recent work

(some of which is still in-flight) and does the final touches to get
things working on exynos5250-snow (the ARM Chromebook).

These patches were tested on next-20130312 (which includes support for
the common clock framework on exynos) plus the current linux-iio/togreg:
95783f2 iio: adc: add exynos adc driver under iio framwork
298489f iio:common: Use spi_sync_transfer() in STMicroelectronics ...
1d9a4cb IIO ADC support for AD7923
9a282b0 iio: Add OF support
3d277fc3 staging:iio: Remove adt7410 driver

Changes in v2:
- Match 'uV' -> 'uv' change in Naveen's bindings.

Doug Anderson (4):
iio: adc: Document the regulator/clocks for exynos-adc
iio: adc: Add dt support for turning on the phy in exynos-adc
ARM: dts: Add adc to exynos5250 device tree file
ARM: dts: Add adc and thermistors for exynos5250-snow

.../devicetree/bindings/arm/samsung/exynos-adc.txt | 12 +++++++--
arch/arm/boot/dts/cros5250-common.dtsi | 4 +++
arch/arm/boot/dts/exynos5250-snow.dts | 31 ++++++++++++++++++++++
arch/arm/boot/dts/exynos5250.dtsi | 11 ++++++++
drivers/iio/adc/exynos_adc.c | 14 +++++++++-
5 files changed, 69 insertions(+), 3 deletions(-)

--
1.8.1.3

2013-03-15 08:06:18

by Naveen Krishna Ch

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] iio: adc: Document the regulator/clocks for exynos-adc

Doug,

On 14 March 2013 02:09, Doug Anderson <[email protected]> wrote:
> The exynos ADC won't work without a regulator called "vdd" and a clock
> called "adc". Document this fact in the device tree bindings.
>
> Signed-off-by: Doug Anderson <[email protected]>
Thanks for the correction. Clocks and regulator is needed.
I missed it out, as i did not submit the arch side changes
> ---
> Changes in v2: None
>
> Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> index f686378..96db940 100644
> --- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> +++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> @@ -20,6 +20,9 @@ Required properties:
> format is being dependent on which interrupt controller
> the Samsung device uses.
> - #io-channel-cells = <1>; As ADC has multiple outputs
> +- clocks From common clock binding: handle to adc clock.
> +- clock-names From common clock binding: Shall be "adc".
> +- vdd-supply VDD input supply.
>
> Note: child nodes can be added for auto probing from device tree.
>
> @@ -31,6 +34,11 @@ adc: adc@12D10000 {
> interrupts = <0 106 0>;
> #io-channel-cells = <1>;
> io-channel-ranges;
> +
> + clocks = <&clock 303>;
> + clock-names = "adc";
> +
> + vdd-supply = <&buck5_reg>;
> };
>
>
> --
> 1.8.1.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/



--
Shine bright,
(: Nav :)

2013-03-15 10:24:47

by Naveen Krishna Ch

[permalink] [raw]
Subject: Re: [PATCH v2 4/4] ARM: dts: Add adc and thermistors for exynos5250-snow

Doug,

On 14 March 2013 02:10, Doug Anderson <[email protected]> wrote:
> Hook up the exynos5250-snow thermistors via the device tree now that
> there's a driver available to use them.
>
> Signed-off-by: Doug Anderson <[email protected]>
> ---
> Changes in v2:
> - Match 'uV' -> 'uv' change in Naveen's bindings.
>
> arch/arm/boot/dts/cros5250-common.dtsi | 4 ++++
> arch/arm/boot/dts/exynos5250-snow.dts | 31 +++++++++++++++++++++++++++++++
> 2 files changed, 35 insertions(+)
>
> diff --git a/arch/arm/boot/dts/cros5250-common.dtsi b/arch/arm/boot/dts/cros5250-common.dtsi
> index 46c0980..f7cc835 100644
> --- a/arch/arm/boot/dts/cros5250-common.dtsi
> +++ b/arch/arm/boot/dts/cros5250-common.dtsi
> @@ -167,6 +167,10 @@
> status = "disabled";
> };
>
> + adc@12D10000 {
> + vdd-supply = <&buck5_reg>;
> + };
> +
> hdmi {
> hpd-gpio = <&gpx3 7 0xf 1 3>;
> };
> diff --git a/arch/arm/boot/dts/exynos5250-snow.dts b/arch/arm/boot/dts/exynos5250-snow.dts
> index 17dd951..b78da7c 100644
> --- a/arch/arm/boot/dts/exynos5250-snow.dts
> +++ b/arch/arm/boot/dts/exynos5250-snow.dts
> @@ -40,4 +40,35 @@
> <&gpc4 5 2 3 0>, <&gpc4 6 2 3 0>;
> };
> };
> +
> + adc@12D10000 {
> + ncp15wb473@3 {
> + compatible = "ntc,ncp15wb473";
> + pullup-uv = <1800000>;
> + pullup-ohm = <47000>;
> + pulldown-ohm = <0>;
> + io-channels = <&adc 3>;
> + };
> + ncp15wb473@4 {
> + compatible = "ntc,ncp15wb473";
> + pullup-uv = <1800000>;
> + pullup-ohm = <47000>;
> + pulldown-ohm = <0>;
> + io-channels = <&adc 4>;
> + };
> + ncp15wb473@5 {
> + compatible = "ntc,ncp15wb473";
> + pullup-uv = <1800000>;
> + pullup-ohm = <47000>;
> + pulldown-ohm = <0>;
> + io-channels = <&adc 5>;
> + };
> + ncp15wb473@6 {
> + compatible = "ntc,ncp15wb473";
> + pullup-uv = <1800000>;
> + pullup-ohm = <47000>;
> + pulldown-ohm = <0>;
> + io-channels = <&adc 6>;
> + };
> + };
> };
Thanks for the upload, i've tested with a similar changes.
> --
> 1.8.1.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/



--
Shine bright,
(: Nav :)

2013-03-15 11:46:23

by Naveen Krishna Ch

[permalink] [raw]
Subject: Re: [PATCH v2 2/4] iio: adc: Add dt support for turning on the phy in exynos-adc

On 14 March 2013 02:10, Doug Anderson <[email protected]> wrote:
> Without this change the exynos adc controller needed to have its phy
> enabled in some out-of-driver C code. Add support for specifying the
> phy enable register by listing it in the reg list.
>
> Signed-off-by: Doug Anderson <[email protected]>

Worked for me, Its needed for Exynos5250 and future versions too.
Tested on SMDK5250.
> ---
> Changes in v2: None
>
> .../devicetree/bindings/arm/samsung/exynos-adc.txt | 4 ++--
> drivers/iio/adc/exynos_adc.c | 14 +++++++++++++-
> 2 files changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> index 96db940..05be151 100644
> --- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> +++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> @@ -15,7 +15,7 @@ Required properties:
> Must be "samsung,exynos-adc-v2" for
> future controllers.
> - reg: Contains ADC register address range (base address and
> - length).
> + length) and the address of the phy enable register.
> - interrupts: Contains the interrupt information for the timer. The
> format is being dependent on which interrupt controller
> the Samsung device uses.
> @@ -30,7 +30,7 @@ Example: adding device info in dtsi file
>
> adc: adc@12D10000 {
> compatible = "samsung,exynos-adc-v1";
> - reg = <0x12D10000 0x100>;
> + reg = <0x12D10000 0x100>, <0x10040718 0x4>;
> interrupts = <0 106 0>;
> #io-channel-cells = <1>;
> io-channel-ranges;
> diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
> index ed6fdd7..5ab0dfd 100644
> --- a/drivers/iio/adc/exynos_adc.c
> +++ b/drivers/iio/adc/exynos_adc.c
> @@ -85,6 +85,7 @@ enum adc_version {
>
> struct exynos_adc {
> void __iomem *regs;
> + void __iomem *enable_reg;
> struct clk *clk;
> unsigned int irq;
> struct regulator *vdd;
> @@ -269,13 +270,19 @@ static int exynos_adc_probe(struct platform_device *pdev)
> info = iio_priv(indio_dev);
>
> mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -
> info->regs = devm_request_and_ioremap(&pdev->dev, mem);
> if (!info->regs) {
> ret = -ENOMEM;
> goto err_iio;
> }
>
> + mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> + info->enable_reg = devm_request_and_ioremap(&pdev->dev, mem);
> + if (!info->enable_reg) {
> + ret = -ENOMEM;
> + goto err_iio;
> + }
> +
> irq = platform_get_irq(pdev, 0);
> if (irq < 0) {
> dev_err(&pdev->dev, "no irq resource?\n");
> @@ -295,6 +302,8 @@ static int exynos_adc_probe(struct platform_device *pdev)
> goto err_iio;
> }
>
> + writel(1, info->enable_reg);
> +
> info->clk = devm_clk_get(&pdev->dev, "adc");
> if (IS_ERR(info->clk)) {
> dev_err(&pdev->dev, "failed getting clock, err = %ld\n",
> @@ -370,6 +379,7 @@ static int exynos_adc_remove(struct platform_device *pdev)
> exynos_adc_remove_devices);
> regulator_disable(info->vdd);
> clk_disable_unprepare(info->clk);
> + writel(0, info->enable_reg);
> iio_device_unregister(indio_dev);
> free_irq(info->irq, info);
> iio_device_free(indio_dev);
> @@ -395,6 +405,7 @@ static int exynos_adc_suspend(struct device *dev)
> }
>
> clk_disable_unprepare(info->clk);
> + writel(0, info->enable_reg);
> regulator_disable(info->vdd);
>
> return 0;
> @@ -410,6 +421,7 @@ static int exynos_adc_resume(struct device *dev)
> if (ret)
> return ret;
>
> + writel(1, info->enable_reg);
> clk_prepare_enable(info->clk);
>
> exynos_adc_hw_init(info);
> --
> 1.8.1.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/



--
Shine bright,
(: Nav :)

2013-03-15 15:42:44

by Naveen Krishna Ch

[permalink] [raw]
Subject: Re: [PATCH v2 4/4] ARM: dts: Add adc and thermistors for exynos5250-snow

On 15 March 2013 15:54, Naveen Krishna Ch <[email protected]> wrote:
> Doug,
>
> On 14 March 2013 02:10, Doug Anderson <[email protected]> wrote:
>> Hook up the exynos5250-snow thermistors via the device tree now that
>> there's a driver available to use them.
>>
>> Signed-off-by: Doug Anderson <[email protected]>
Tested-by: Naveen Krishna Chatradhi <[email protected]>
used these changes to test on snow before submitting the ADC and NTC
driver changes.
>> ---
>> Changes in v2:
>> - Match 'uV' -> 'uv' change in Naveen's bindings.
>>
>> arch/arm/boot/dts/cros5250-common.dtsi | 4 ++++
>> arch/arm/boot/dts/exynos5250-snow.dts | 31 +++++++++++++++++++++++++++++++
>> 2 files changed, 35 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/cros5250-common.dtsi b/arch/arm/boot/dts/cros5250-common.dtsi
>> index 46c0980..f7cc835 100644
>> --- a/arch/arm/boot/dts/cros5250-common.dtsi
>> +++ b/arch/arm/boot/dts/cros5250-common.dtsi
>> @@ -167,6 +167,10 @@
>> status = "disabled";
>> };
>>
>> + adc@12D10000 {
>> + vdd-supply = <&buck5_reg>;
>> + };
>> +
>> hdmi {
>> hpd-gpio = <&gpx3 7 0xf 1 3>;
>> };
>> diff --git a/arch/arm/boot/dts/exynos5250-snow.dts b/arch/arm/boot/dts/exynos5250-snow.dts
>> index 17dd951..b78da7c 100644
>> --- a/arch/arm/boot/dts/exynos5250-snow.dts
>> +++ b/arch/arm/boot/dts/exynos5250-snow.dts
>> @@ -40,4 +40,35 @@
>> <&gpc4 5 2 3 0>, <&gpc4 6 2 3 0>;
>> };
>> };
>> +
>> + adc@12D10000 {
>> + ncp15wb473@3 {
>> + compatible = "ntc,ncp15wb473";
>> + pullup-uv = <1800000>;
>> + pullup-ohm = <47000>;
>> + pulldown-ohm = <0>;
>> + io-channels = <&adc 3>;
>> + };
>> + ncp15wb473@4 {
>> + compatible = "ntc,ncp15wb473";
>> + pullup-uv = <1800000>;
>> + pullup-ohm = <47000>;
>> + pulldown-ohm = <0>;
>> + io-channels = <&adc 4>;
>> + };
>> + ncp15wb473@5 {
>> + compatible = "ntc,ncp15wb473";
>> + pullup-uv = <1800000>;
>> + pullup-ohm = <47000>;
>> + pulldown-ohm = <0>;
>> + io-channels = <&adc 5>;
>> + };
>> + ncp15wb473@6 {
>> + compatible = "ntc,ncp15wb473";
>> + pullup-uv = <1800000>;
>> + pullup-ohm = <47000>;
>> + pulldown-ohm = <0>;
>> + io-channels = <&adc 6>;
>> + };
>> + };
>> };
> Thanks for the upload, i've tested with a similar changes.
>> --
>> 1.8.1.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>
>
>
> --
> Shine bright,
> (: Nav :)



--
Shine bright,
(: Nav :)

2013-03-15 15:43:32

by Naveen Krishna Ch

[permalink] [raw]
Subject: Re: [PATCH v2 2/4] iio: adc: Add dt support for turning on the phy in exynos-adc

On 15 March 2013 17:15, Naveen Krishna Ch <[email protected]> wrote:
> On 14 March 2013 02:10, Doug Anderson <[email protected]> wrote:
>> Without this change the exynos adc controller needed to have its phy
>> enabled in some out-of-driver C code. Add support for specifying the
>> phy enable register by listing it in the reg list.
>>
>> Signed-off-by: Doug Anderson <[email protected]>
Tested-by: Naveen Krishna Chatradhi <[email protected]>
I used this in mach file for testing. But this one worked aswell.

>
> Worked for me, Its needed for Exynos5250 and future versions too.
> Tested on SMDK5250.
>> ---
>> Changes in v2: None
>>
>> .../devicetree/bindings/arm/samsung/exynos-adc.txt | 4 ++--
>> drivers/iio/adc/exynos_adc.c | 14 +++++++++++++-
>> 2 files changed, 15 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
>> index 96db940..05be151 100644
>> --- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
>> +++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
>> @@ -15,7 +15,7 @@ Required properties:
>> Must be "samsung,exynos-adc-v2" for
>> future controllers.
>> - reg: Contains ADC register address range (base address and
>> - length).
>> + length) and the address of the phy enable register.
>> - interrupts: Contains the interrupt information for the timer. The
>> format is being dependent on which interrupt controller
>> the Samsung device uses.
>> @@ -30,7 +30,7 @@ Example: adding device info in dtsi file
>>
>> adc: adc@12D10000 {
>> compatible = "samsung,exynos-adc-v1";
>> - reg = <0x12D10000 0x100>;
>> + reg = <0x12D10000 0x100>, <0x10040718 0x4>;
>> interrupts = <0 106 0>;
>> #io-channel-cells = <1>;
>> io-channel-ranges;
>> diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
>> index ed6fdd7..5ab0dfd 100644
>> --- a/drivers/iio/adc/exynos_adc.c
>> +++ b/drivers/iio/adc/exynos_adc.c
>> @@ -85,6 +85,7 @@ enum adc_version {
>>
>> struct exynos_adc {
>> void __iomem *regs;
>> + void __iomem *enable_reg;
>> struct clk *clk;
>> unsigned int irq;
>> struct regulator *vdd;
>> @@ -269,13 +270,19 @@ static int exynos_adc_probe(struct platform_device *pdev)
>> info = iio_priv(indio_dev);
>>
>> mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> -
>> info->regs = devm_request_and_ioremap(&pdev->dev, mem);
>> if (!info->regs) {
>> ret = -ENOMEM;
>> goto err_iio;
>> }
>>
>> + mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
>> + info->enable_reg = devm_request_and_ioremap(&pdev->dev, mem);
>> + if (!info->enable_reg) {
>> + ret = -ENOMEM;
>> + goto err_iio;
>> + }
>> +
>> irq = platform_get_irq(pdev, 0);
>> if (irq < 0) {
>> dev_err(&pdev->dev, "no irq resource?\n");
>> @@ -295,6 +302,8 @@ static int exynos_adc_probe(struct platform_device *pdev)
>> goto err_iio;
>> }
>>
>> + writel(1, info->enable_reg);
>> +
>> info->clk = devm_clk_get(&pdev->dev, "adc");
>> if (IS_ERR(info->clk)) {
>> dev_err(&pdev->dev, "failed getting clock, err = %ld\n",
>> @@ -370,6 +379,7 @@ static int exynos_adc_remove(struct platform_device *pdev)
>> exynos_adc_remove_devices);
>> regulator_disable(info->vdd);
>> clk_disable_unprepare(info->clk);
>> + writel(0, info->enable_reg);
>> iio_device_unregister(indio_dev);
>> free_irq(info->irq, info);
>> iio_device_free(indio_dev);
>> @@ -395,6 +405,7 @@ static int exynos_adc_suspend(struct device *dev)
>> }
>>
>> clk_disable_unprepare(info->clk);
>> + writel(0, info->enable_reg);
>> regulator_disable(info->vdd);
>>
>> return 0;
>> @@ -410,6 +421,7 @@ static int exynos_adc_resume(struct device *dev)
>> if (ret)
>> return ret;
>>
>> + writel(1, info->enable_reg);
>> clk_prepare_enable(info->clk);
>>
>> exynos_adc_hw_init(info);
>> --
>> 1.8.1.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>
>
>
> --
> Shine bright,
> (: Nav :)



--
Shine bright,
(: Nav :)

2013-03-15 15:45:55

by Naveen Krishna Ch

[permalink] [raw]
Subject: Re: [PATCH v2 3/4] ARM: dts: Add adc to exynos5250 device tree file

On 14 March 2013 02:10, Doug Anderson <[email protected]> wrote:
> Add the device tree entry for the device-tree enabled ADC driver that
> recently landed in the iio tree.
>
> Signed-off-by: Doug Anderson <[email protected]>

I've not used the "clock" binding yet, Will test with that and give a tag.
> ---
> Changes in v2: None
>
> arch/arm/boot/dts/exynos5250.dtsi | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
> index 3acf594..1642062 100644
> --- a/arch/arm/boot/dts/exynos5250.dtsi
> +++ b/arch/arm/boot/dts/exynos5250.dtsi
> @@ -69,6 +69,17 @@
> <0 28 0>, <0 29 0>, <0 30 0>, <0 31 0>;
> };
>
> + adc: adc@12D10000 {
> + compatible = "samsung,exynos-adc-v1";
> + reg = <0x12D10000 0x100>, <0x10040718 0x4>;
> + interrupts = <0 106 0>;
> + #io-channel-cells = <1>;
> + io-channel-ranges;
> +
> + clocks = <&clock 303>;
> + clock-names = "adc";
> + };
> +
> watchdog {
> compatible = "samsung,s3c2410-wdt";
> reg = <0x101D0000 0x100>;
> --
> 1.8.1.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/



--
Shine bright,
(: Nav :)

2013-03-27 18:35:54

by Naveen Krishna Ch

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] iio: adc: Document the regulator/clocks for exynos-adc

On 13 March 2013 13:39, Doug Anderson <[email protected]> wrote:
> The exynos ADC won't work without a regulator called "vdd" and a clock
> called "adc". Document this fact in the device tree bindings.
>
> Signed-off-by: Doug Anderson <[email protected]>
Reviewed-by: Naveen Krishna Chatradhi <[email protected]>

Lars, any update on this patch set. This change is required.
> ---
> Changes in v2: None
>
> Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> index f686378..96db940 100644
> --- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> +++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> @@ -20,6 +20,9 @@ Required properties:
> format is being dependent on which interrupt controller
> the Samsung device uses.
> - #io-channel-cells = <1>; As ADC has multiple outputs
> +- clocks From common clock binding: handle to adc clock.
> +- clock-names From common clock binding: Shall be "adc".
> +- vdd-supply VDD input supply.
>
> Note: child nodes can be added for auto probing from device tree.
>
> @@ -31,6 +34,11 @@ adc: adc@12D10000 {
> interrupts = <0 106 0>;
> #io-channel-cells = <1>;
> io-channel-ranges;
> +
> + clocks = <&clock 303>;
> + clock-names = "adc";
> +
> + vdd-supply = <&buck5_reg>;
> };
>
>
> --
> 1.8.1.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/



--
Shine bright,
(: Nav :)

2013-03-27 18:37:09

by Naveen Krishna Ch

[permalink] [raw]
Subject: Re: [PATCH v2 4/4] ARM: dts: Add adc and thermistors for exynos5250-snow

On 15 March 2013 08:42, Naveen Krishna Ch <[email protected]> wrote:
> On 15 March 2013 15:54, Naveen Krishna Ch <[email protected]> wrote:
>> Doug,
>>
>> On 14 March 2013 02:10, Doug Anderson <[email protected]> wrote:
>>> Hook up the exynos5250-snow thermistors via the device tree now that
>>> there's a driver available to use them.
>>>
>>> Signed-off-by: Doug Anderson <[email protected]>
> Tested-by: Naveen Krishna Chatradhi <[email protected]>
> used these changes to test on snow before submitting the ADC and NTC
> driver changes.
Kukjin, Any update on this patch. you want us to rebase it ?

>>> ---
>>> Changes in v2:
>>> - Match 'uV' -> 'uv' change in Naveen's bindings.
>>>
>>> arch/arm/boot/dts/cros5250-common.dtsi | 4 ++++
>>> arch/arm/boot/dts/exynos5250-snow.dts | 31 +++++++++++++++++++++++++++++++
>>> 2 files changed, 35 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/cros5250-common.dtsi b/arch/arm/boot/dts/cros5250-common.dtsi
>>> index 46c0980..f7cc835 100644
>>> --- a/arch/arm/boot/dts/cros5250-common.dtsi
>>> +++ b/arch/arm/boot/dts/cros5250-common.dtsi
>>> @@ -167,6 +167,10 @@
>>> status = "disabled";
>>> };
>>>
>>> + adc@12D10000 {
>>> + vdd-supply = <&buck5_reg>;
>>> + };
>>> +
>>> hdmi {
>>> hpd-gpio = <&gpx3 7 0xf 1 3>;
>>> };
>>> diff --git a/arch/arm/boot/dts/exynos5250-snow.dts b/arch/arm/boot/dts/exynos5250-snow.dts
>>> index 17dd951..b78da7c 100644
>>> --- a/arch/arm/boot/dts/exynos5250-snow.dts
>>> +++ b/arch/arm/boot/dts/exynos5250-snow.dts
>>> @@ -40,4 +40,35 @@
>>> <&gpc4 5 2 3 0>, <&gpc4 6 2 3 0>;
>>> };
>>> };
>>> +
>>> + adc@12D10000 {
>>> + ncp15wb473@3 {
>>> + compatible = "ntc,ncp15wb473";
>>> + pullup-uv = <1800000>;
>>> + pullup-ohm = <47000>;
>>> + pulldown-ohm = <0>;
>>> + io-channels = <&adc 3>;
>>> + };
>>> + ncp15wb473@4 {
>>> + compatible = "ntc,ncp15wb473";
>>> + pullup-uv = <1800000>;
>>> + pullup-ohm = <47000>;
>>> + pulldown-ohm = <0>;
>>> + io-channels = <&adc 4>;
>>> + };
>>> + ncp15wb473@5 {
>>> + compatible = "ntc,ncp15wb473";
>>> + pullup-uv = <1800000>;
>>> + pullup-ohm = <47000>;
>>> + pulldown-ohm = <0>;
>>> + io-channels = <&adc 5>;
>>> + };
>>> + ncp15wb473@6 {
>>> + compatible = "ntc,ncp15wb473";
>>> + pullup-uv = <1800000>;
>>> + pullup-ohm = <47000>;
>>> + pulldown-ohm = <0>;
>>> + io-channels = <&adc 6>;
>>> + };
>>> + };
>>> };
>> Thanks for the upload, i've tested with a similar changes.
>>> --
>>> 1.8.1.3
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>>> the body of a message to [email protected]
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>> Please read the FAQ at http://www.tux.org/lkml/
>>
>>
>>
>> --
>> Shine bright,
>> (: Nav :)
>
>
>
> --
> Shine bright,
> (: Nav :)



--
Shine bright,
(: Nav :)

2013-03-27 18:38:05

by Naveen Krishna Ch

[permalink] [raw]
Subject: Re: [PATCH v2 2/4] iio: adc: Add dt support for turning on the phy in exynos-adc

On 13 March 2013 13:40, Doug Anderson <[email protected]> wrote:
> Without this change the exynos adc controller needed to have its phy
> enabled in some out-of-driver C code. Add support for specifying the
> phy enable register by listing it in the reg list.
>
> Signed-off-by: Doug Anderson <[email protected]>
> ---
> Changes in v2: None
Reviewed-by: Naveen Krishna Chatradhi <[email protected]>

Lars, any update on this patch set. This change is required.
>
> .../devicetree/bindings/arm/samsung/exynos-adc.txt | 4 ++--
> drivers/iio/adc/exynos_adc.c | 14 +++++++++++++-
> 2 files changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> index 96db940..05be151 100644
> --- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> +++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> @@ -15,7 +15,7 @@ Required properties:
> Must be "samsung,exynos-adc-v2" for
> future controllers.
> - reg: Contains ADC register address range (base address and
> - length).
> + length) and the address of the phy enable register.
> - interrupts: Contains the interrupt information for the timer. The
> format is being dependent on which interrupt controller
> the Samsung device uses.
> @@ -30,7 +30,7 @@ Example: adding device info in dtsi file
>
> adc: adc@12D10000 {
> compatible = "samsung,exynos-adc-v1";
> - reg = <0x12D10000 0x100>;
> + reg = <0x12D10000 0x100>, <0x10040718 0x4>;
> interrupts = <0 106 0>;
> #io-channel-cells = <1>;
> io-channel-ranges;
> diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
> index ed6fdd7..5ab0dfd 100644
> --- a/drivers/iio/adc/exynos_adc.c
> +++ b/drivers/iio/adc/exynos_adc.c
> @@ -85,6 +85,7 @@ enum adc_version {
>
> struct exynos_adc {
> void __iomem *regs;
> + void __iomem *enable_reg;
> struct clk *clk;
> unsigned int irq;
> struct regulator *vdd;
> @@ -269,13 +270,19 @@ static int exynos_adc_probe(struct platform_device *pdev)
> info = iio_priv(indio_dev);
>
> mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -
> info->regs = devm_request_and_ioremap(&pdev->dev, mem);
> if (!info->regs) {
> ret = -ENOMEM;
> goto err_iio;
> }
>
> + mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> + info->enable_reg = devm_request_and_ioremap(&pdev->dev, mem);
> + if (!info->enable_reg) {
> + ret = -ENOMEM;
> + goto err_iio;
> + }
> +
> irq = platform_get_irq(pdev, 0);
> if (irq < 0) {
> dev_err(&pdev->dev, "no irq resource?\n");
> @@ -295,6 +302,8 @@ static int exynos_adc_probe(struct platform_device *pdev)
> goto err_iio;
> }
>
> + writel(1, info->enable_reg);
> +
> info->clk = devm_clk_get(&pdev->dev, "adc");
> if (IS_ERR(info->clk)) {
> dev_err(&pdev->dev, "failed getting clock, err = %ld\n",
> @@ -370,6 +379,7 @@ static int exynos_adc_remove(struct platform_device *pdev)
> exynos_adc_remove_devices);
> regulator_disable(info->vdd);
> clk_disable_unprepare(info->clk);
> + writel(0, info->enable_reg);
> iio_device_unregister(indio_dev);
> free_irq(info->irq, info);
> iio_device_free(indio_dev);
> @@ -395,6 +405,7 @@ static int exynos_adc_suspend(struct device *dev)
> }
>
> clk_disable_unprepare(info->clk);
> + writel(0, info->enable_reg);
> regulator_disable(info->vdd);
>
> return 0;
> @@ -410,6 +421,7 @@ static int exynos_adc_resume(struct device *dev)
> if (ret)
> return ret;
>
> + writel(1, info->enable_reg);
> clk_prepare_enable(info->clk);
>
> exynos_adc_hw_init(info);
> --
> 1.8.1.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/



--
Shine bright,
(: Nav :)

2013-03-27 18:38:51

by Lars-Peter Clausen

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] iio: adc: Document the regulator/clocks for exynos-adc

On 03/27/2013 07:35 PM, Naveen Krishna Ch wrote:
> On 13 March 2013 13:39, Doug Anderson <[email protected]> wrote:
>> The exynos ADC won't work without a regulator called "vdd" and a clock
>> called "adc". Document this fact in the device tree bindings.
>>
>> Signed-off-by: Doug Anderson <[email protected]>
> Reviewed-by: Naveen Krishna Chatradhi <[email protected]>
>
> Lars, any update on this patch set. This change is required.

Uhm, looks fine to me. I'm sure Jonathan will pick it up :)

>> ---
>> Changes in v2: None
>>
>> Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
>> index f686378..96db940 100644
>> --- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
>> +++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
>> @@ -20,6 +20,9 @@ Required properties:
>> format is being dependent on which interrupt controller
>> the Samsung device uses.
>> - #io-channel-cells = <1>; As ADC has multiple outputs
>> +- clocks From common clock binding: handle to adc clock.
>> +- clock-names From common clock binding: Shall be "adc".
>> +- vdd-supply VDD input supply.
>>
>> Note: child nodes can be added for auto probing from device tree.
>>
>> @@ -31,6 +34,11 @@ adc: adc@12D10000 {
>> interrupts = <0 106 0>;
>> #io-channel-cells = <1>;
>> io-channel-ranges;
>> +
>> + clocks = <&clock 303>;
>> + clock-names = "adc";
>> +
>> + vdd-supply = <&buck5_reg>;
>> };
>>
>>
>> --
>> 1.8.1.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>
>
>
> --
> Shine bright,
> (: Nav :)

2013-03-27 18:44:09

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH v2 2/4] iio: adc: Add dt support for turning on the phy in exynos-adc

Naveen,

On Wed, Mar 27, 2013 at 11:37 AM, Naveen Krishna Ch
<[email protected]> wrote:
> On 13 March 2013 13:40, Doug Anderson <[email protected]> wrote:
>> Without this change the exynos adc controller needed to have its phy
>> enabled in some out-of-driver C code. Add support for specifying the
>> phy enable register by listing it in the reg list.
>>
>> Signed-off-by: Doug Anderson <[email protected]>
>> ---
>> Changes in v2: None
> Reviewed-by: Naveen Krishna Chatradhi <[email protected]>
>
> Lars, any update on this patch set. This change is required.

This particular CL is already in linux-next.
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next-history.git/commit/?id=bb916ebbeabd18f7dc3c661275d2c9d343f4fa85

2013-03-27 18:46:51

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] iio: adc: Document the regulator/clocks for exynos-adc

Hi,

On Wed, Mar 27, 2013 at 11:40 AM, Lars-Peter Clausen <[email protected]> wrote:
> On 03/27/2013 07:35 PM, Naveen Krishna Ch wrote:
>> On 13 March 2013 13:39, Doug Anderson <[email protected]> wrote:
>>> The exynos ADC won't work without a regulator called "vdd" and a clock
>>> called "adc". Document this fact in the device tree bindings.
>>>
>>> Signed-off-by: Doug Anderson <[email protected]>
>> Reviewed-by: Naveen Krishna Chatradhi <[email protected]>
>>
>> Lars, any update on this patch set. This change is required.
>
> Uhm, looks fine to me. I'm sure Jonathan will pick it up :)

Part 2 made it in, but not the documentation patch. Now that it has a
Reviewed-by it can probably go in... :)

-Doug

2013-03-28 06:36:25

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] iio: adc: Document the regulator/clocks for exynos-adc



Doug Anderson <[email protected]> wrote:

>Hi,
>
>On Wed, Mar 27, 2013 at 11:40 AM, Lars-Peter Clausen <[email protected]>
>wrote:
>> On 03/27/2013 07:35 PM, Naveen Krishna Ch wrote:
>>> On 13 March 2013 13:39, Doug Anderson <[email protected]> wrote:
>>>> The exynos ADC won't work without a regulator called "vdd" and a
>clock
>>>> called "adc". Document this fact in the device tree bindings.
>>>>
>>>> Signed-off-by: Doug Anderson <[email protected]>
>>> Reviewed-by: Naveen Krishna Chatradhi <[email protected]>
>>>
>>> Lars, any update on this patch set. This change is required.
>>
>> Uhm, looks fine to me. I'm sure Jonathan will pick it up :)
>
>Part 2 made it in, but not the documentation patch. Now that it has a
>Reviewed-by it can probably go in... :)
>
>-Doug
I'll take it sometime over the weekend.

Thanks.
Jonathan

--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

2013-03-29 09:36:09

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] iio: adc: Document the regulator/clocks for exynos-adc

On 03/27/2013 06:46 PM, Doug Anderson wrote:
> Hi,
>
> On Wed, Mar 27, 2013 at 11:40 AM, Lars-Peter Clausen <[email protected]> wrote:
>> On 03/27/2013 07:35 PM, Naveen Krishna Ch wrote:
>>> On 13 March 2013 13:39, Doug Anderson <[email protected]> wrote:
>>>> The exynos ADC won't work without a regulator called "vdd" and a clock
>>>> called "adc". Document this fact in the device tree bindings.
>>>>
>>>> Signed-off-by: Doug Anderson <[email protected]>
>>> Reviewed-by: Naveen Krishna Chatradhi <[email protected]>
>>>
>>> Lars, any update on this patch set. This change is required.
>>
>> Uhm, looks fine to me. I'm sure Jonathan will pick it up :)
>
> Part 2 made it in, but not the documentation patch. Now that it has a
> Reviewed-by it can probably go in... :)
>
And indeed it has now done so. Well into the togreg branch of iio.git

Jonathan
> -Doug
>