2013-03-25 07:49:26

by Philip, Avinash

[permalink] [raw]
Subject: [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.

Add platform support for EHRPWM and ECAP by providing clock nodes and
device tree nodes.
This series depends on [1] and [2] and is available for testing at [3].
Tested for back light support in da850 EVM with EHRPWM PWM device.

[1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
[2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
[3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm

Note:
DT support for EHRPWM backlight has not been added in da850-evm.dts as there is
conflicting pin-mux requirement with SPI flash.

Philip Avinash (3):
ARM: davinci: clk framework support for enable/disable functionality
arm: davinci: clock node support for ECAP & EHRPWM
ARM: davinci: da850: add EHRPWM & ECAP DT node

arch/arm/boot/dts/da850.dtsi | 30 ++++++++++++++++++
arch/arm/mach-davinci/clock.c | 21 ++++++++-----
arch/arm/mach-davinci/clock.h | 2 ++
arch/arm/mach-davinci/da850.c | 46 ++++++++++++++++++++++++++++
arch/arm/mach-davinci/da8xx-dt.c | 5 +++
arch/arm/mach-davinci/include/mach/da8xx.h | 1 +
6 files changed, 98 insertions(+), 7 deletions(-)

--
1.7.9.5


2013-03-25 07:49:42

by Philip, Avinash

[permalink] [raw]
Subject: [PATCH v3 2/3] arm: davinci: clock node support for ECAP & EHRPWM

Add clock node support for ECAP and EHRPWM modules.
Also adds TBCLK for EHRWPM TBCLK to comply with pwm-tiehrpwm
driver.

Signed-off-by: Philip Avinash <[email protected]>
---
Changes Since v2:
- Add prefix of ehrpwm to tblck_enable and tblck_disable functions
- Make functions as static.

Changes Since v1:
- TBCLK make it as actual clock with enable/disable feature.

arch/arm/mach-davinci/da850.c | 46 ++++++++++++++++++++++++++++
arch/arm/mach-davinci/include/mach/da8xx.h | 1 +
2 files changed, 47 insertions(+)

diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 0c4a26d..2a2f60c 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -383,6 +383,49 @@ static struct clk dsp_clk = {
.flags = PSC_LRST | PSC_FORCE,
};

+static struct clk ehrpwm_clk = {
+ .name = "ehrpwm",
+ .parent = &pll0_sysclk2,
+ .lpsc = DA8XX_LPSC1_PWM,
+ .gpsc = 1,
+ .flags = DA850_CLK_ASYNC3,
+};
+
+#define DA8XX_EHRPWM_TBCLKSYNC BIT(12)
+
+static void ehrpwm_tblck_enable(struct clk *clk)
+{
+ u32 val;
+
+ val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
+ val |= DA8XX_EHRPWM_TBCLKSYNC;
+ writel(val, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
+}
+
+static void ehrpwm_tblck_disable(struct clk *clk)
+{
+ u32 val;
+
+ val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
+ val &= ~DA8XX_EHRPWM_TBCLKSYNC;
+ writel(val, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
+}
+
+static struct clk ehrpwm_tbclk = {
+ .name = "ehrpwm_tbclk",
+ .parent = &ehrpwm_clk,
+ .clk_enable = ehrpwm_tblck_enable,
+ .clk_disable = ehrpwm_tblck_disable,
+};
+
+static struct clk ecap_clk = {
+ .name = "ecap",
+ .parent = &pll0_sysclk2,
+ .lpsc = DA8XX_LPSC1_ECAP,
+ .gpsc = 1,
+ .flags = DA850_CLK_ASYNC3,
+};
+
static struct clk_lookup da850_clks[] = {
CLK(NULL, "ref", &ref_clk),
CLK(NULL, "pll0", &pll0_clk),
@@ -430,6 +473,9 @@ static struct clk_lookup da850_clks[] = {
CLK("vpif", NULL, &vpif_clk),
CLK("ahci", NULL, &sata_clk),
CLK("davinci-rproc.0", NULL, &dsp_clk),
+ CLK("ehrpwm", "fck", &ehrpwm_clk),
+ CLK("ehrpwm", "tbclk", &ehrpwm_tbclk),
+ CLK("ecap", "fck", &ecap_clk),
CLK(NULL, NULL, NULL),
};

diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index de439b7..be77ce2 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -55,6 +55,7 @@ extern unsigned int da850_max_speed;
#define DA8XX_SYSCFG0_VIRT(x) (da8xx_syscfg0_base + (x))
#define DA8XX_JTAG_ID_REG 0x18
#define DA8XX_CFGCHIP0_REG 0x17c
+#define DA8XX_CFGCHIP1_REG 0x180
#define DA8XX_CFGCHIP2_REG 0x184
#define DA8XX_CFGCHIP3_REG 0x188

--
1.7.9.5

2013-03-25 07:51:22

by Philip, Avinash

[permalink] [raw]
Subject: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

Add da850 EHRPWM & ECAP DT node.
Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP
clock.

Signed-off-by: Philip Avinash <[email protected]>
---
Changes since v1:
- Reusing ti,am33xx<ecap/ehrpwm> as compatible field as both IP's are
similar with am33xx platform and da850 has no platform specific
dependency.

arch/arm/boot/dts/da850.dtsi | 30 ++++++++++++++++++++++++++++++
arch/arm/mach-davinci/da8xx-dt.c | 5 +++++
2 files changed, 35 insertions(+)

diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index 3ec1bda..62fd2d4 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -107,6 +107,36 @@
reg = <0x21000 0x1000>;
status = "disabled";
};
+ ehrpwm0: ehrpwm@01f00000 {
+ compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
+ #pwm-cells = <3>;
+ reg = <0x300000 0x2000>;
+ status = "disabled";
+ };
+ ehrpwm1: ehrpwm@01f02000 {
+ compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
+ #pwm-cells = <3>;
+ reg = <0x302000 0x2000>;
+ status = "disabled";
+ };
+ ecap0: ecap@01f06000 {
+ compatible = "ti,da850-ecap", "ti,am33xx-ecap";
+ #pwm-cells = <3>;
+ reg = <0x306000 0x80>;
+ status = "disabled";
+ };
+ ecap1: ecap@01f07000 {
+ compatible = "ti,da850-ecap", "ti,am33xx-ecap";
+ #pwm-cells = <3>;
+ reg = <0x307000 0x80>;
+ status = "disabled";
+ };
+ ecap2: ecap@01f08000 {
+ compatible = "ti,da850-ecap", "ti,am33xx-ecap";
+ #pwm-cells = <3>;
+ reg = <0x308000 0x80>;
+ status = "disabled";
+ };
};
nand_cs3@62000000 {
compatible = "ti,davinci-nand";
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index 6b7a0a2..89ee974 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -40,6 +40,11 @@ static void __init da8xx_init_irq(void)
struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL),
OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL),
+ OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f00000, "ehrpwm", NULL),
+ OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f02000, "ehrpwm", NULL),
+ OF_DEV_AUXDATA("ti,da850-ecap", 0x01f06000, "ecap", NULL),
+ OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL),
+ OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL),
{}
};

--
1.7.9.5

2013-03-25 08:15:05

by Sekhar Nori

[permalink] [raw]
Subject: Re: [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.

On 3/25/2013 1:19 PM, Philip Avinash wrote:
> Add platform support for EHRPWM and ECAP by providing clock nodes and
> device tree nodes.
> This series depends on [1] and [2] and is available for testing at [3].
> Tested for back light support in da850 EVM with EHRPWM PWM device.
>
> [1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
> [2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
> [3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm
>
> Note:
> DT support for EHRPWM backlight has not been added in da850-evm.dts as there is
> conflicting pin-mux requirement with SPI flash.
>
> Philip Avinash (3):
> ARM: davinci: clk framework support for enable/disable functionality

Patch 1/3 did not reach me. I cant find it in archives either so most
likely no one received it. Can you please send that one patch again?

> arm: davinci: clock node support for ECAP & EHRPWM

For future, please be consistent and capitalize 'ARM' in subject line.

> ARM: davinci: da850: add EHRPWM & ECAP DT node
>
> arch/arm/boot/dts/da850.dtsi | 30 ++++++++++++++++++
> arch/arm/mach-davinci/clock.c | 21 ++++++++-----
> arch/arm/mach-davinci/clock.h | 2 ++
> arch/arm/mach-davinci/da850.c | 46 ++++++++++++++++++++++++++++
> arch/arm/mach-davinci/da8xx-dt.c | 5 +++
> arch/arm/mach-davinci/include/mach/da8xx.h | 1 +
> 6 files changed, 98 insertions(+), 7 deletions(-)
>

Thanks,
Sekhar

2013-03-25 08:32:15

by Philip, Avinash

[permalink] [raw]
Subject: RE: [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.

On Mon, Mar 25, 2013 at 13:44:37, Nori, Sekhar wrote:
> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> > Add platform support for EHRPWM and ECAP by providing clock nodes and
> > device tree nodes.
> > This series depends on [1] and [2] and is available for testing at [3].
> > Tested for back light support in da850 EVM with EHRPWM PWM device.
> >
> > [1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
> > [2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
> > [3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm
> >
> > Note:
> > DT support for EHRPWM backlight has not been added in da850-evm.dts as there is
> > conflicting pin-mux requirement with SPI flash.
> >
> > Philip Avinash (3):
> > ARM: davinci: clk framework support for enable/disable functionality
>
> Patch 1/3 did not reach me. I cant find it in archives either so most
> likely no one received it. Can you please send that one patch again?

Done.

>
> > arm: davinci: clock node support for ECAP & EHRPWM
>
> For future, please be consistent and capitalize 'ARM' in subject line.

Ok I will take care.

Thanks
Avinash
>
> > ARM: davinci: da850: add EHRPWM & ECAP DT node
> >
> > arch/arm/boot/dts/da850.dtsi | 30 ++++++++++++++++++
> > arch/arm/mach-davinci/clock.c | 21 ++++++++-----
> > arch/arm/mach-davinci/clock.h | 2 ++
> > arch/arm/mach-davinci/da850.c | 46 ++++++++++++++++++++++++++++
> > arch/arm/mach-davinci/da8xx-dt.c | 5 +++
> > arch/arm/mach-davinci/include/mach/da8xx.h | 1 +
> > 6 files changed, 98 insertions(+), 7 deletions(-)
> >
>
> Thanks,
> Sekhar
>

????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2013-04-02 08:16:34

by Sekhar Nori

[permalink] [raw]
Subject: Re: [PATCH v3 2/3] arm: davinci: clock node support for ECAP & EHRPWM

On 3/25/2013 1:19 PM, Philip Avinash wrote:
> Add clock node support for ECAP and EHRPWM modules.
> Also adds TBCLK for EHRWPM TBCLK to comply with pwm-tiehrpwm
> driver.
>
> Signed-off-by: Philip Avinash <[email protected]>

Queuing this for v3.10

Thanks,
Sekhar

2013-04-02 08:34:05

by Sekhar Nori

[permalink] [raw]
Subject: Re: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

On 3/25/2013 1:19 PM, Philip Avinash wrote:
> Add da850 EHRPWM & ECAP DT node.
> Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP
> clock.

This looks fine to me but I will wait for the bindings to get accepted
before taking this one.

Thanks,
Sekhar

2013-04-02 08:35:26

by Sekhar Nori

[permalink] [raw]
Subject: Re: [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.

On 3/25/2013 1:19 PM, Philip Avinash wrote:
> Add platform support for EHRPWM and ECAP by providing clock nodes and
> device tree nodes.
> This series depends on [1] and [2] and is available for testing at [3].
> Tested for back light support in da850 EVM with EHRPWM PWM device.
>
> [1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
> [2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
> [3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm
>
> Note:
> DT support for EHRPWM backlight has not been added in da850-evm.dts as there is
> conflicting pin-mux requirement with SPI flash.

Can you check if this is really true even in newer boards (have a look
at the latest schematics)? I remember this used to be a problem in very
early versions but was fixed later.

Thanks,
Sekhar

2013-04-04 04:40:38

by Philip, Avinash

[permalink] [raw]
Subject: RE: [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.

On Tue, Apr 02, 2013 at 14:05:09, Nori, Sekhar wrote:
> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> > Add platform support for EHRPWM and ECAP by providing clock nodes and
> > device tree nodes.
> > This series depends on [1] and [2] and is available for testing at [3].
> > Tested for back light support in da850 EVM with EHRPWM PWM device.
> >
> > [1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
> > [2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
> > [3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm
> >
> > Note:
> > DT support for EHRPWM backlight has not been added in da850-evm.dts as there is
> > conflicting pin-mux requirement with SPI flash.
>
> Can you check if this is really true even in newer boards (have a look
> at the latest schematics)? I remember this used to be a problem in very
> early versions but was fixed later.

On looking schematics, panel has three power controls LCD_BACKLIGHT_PWR, LCD_PANEL_PWR,
LCD_PWM0. On latest schematic, LCD_PWM0 is connected to ECAP instance 2. So backlight
can control through ECAP2 (not conflicting with SPI1 cs0). Still for controlling
backlight, require support for LCD_BACKLIGHT_PWR & LCD_PANEL_PWR. These signals
to be controlled by GPIO 2[8] & GPIO 2[15]. In release platform callbacks used
to control GPIO functionality. But with DT support, I have to check how platform
callbacks can be used.

Thanks
Avinash

>
> Thanks,
> Sekhar
>

????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2013-04-04 05:50:18

by Sekhar Nori

[permalink] [raw]
Subject: Re: [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.

On 4/4/2013 10:09 AM, Philip, Avinash wrote:
> On Tue, Apr 02, 2013 at 14:05:09, Nori, Sekhar wrote:
>> On 3/25/2013 1:19 PM, Philip Avinash wrote:
>>> Add platform support for EHRPWM and ECAP by providing clock nodes and
>>> device tree nodes.
>>> This series depends on [1] and [2] and is available for testing at [3].
>>> Tested for back light support in da850 EVM with EHRPWM PWM device.
>>>
>>> [1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
>>> [2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
>>> [3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm
>>>
>>> Note:
>>> DT support for EHRPWM backlight has not been added in da850-evm.dts as there is
>>> conflicting pin-mux requirement with SPI flash.
>>
>> Can you check if this is really true even in newer boards (have a look
>> at the latest schematics)? I remember this used to be a problem in very
>> early versions but was fixed later.
>
> On looking schematics, panel has three power controls LCD_BACKLIGHT_PWR, LCD_PANEL_PWR,
> LCD_PWM0. On latest schematic, LCD_PWM0 is connected to ECAP instance 2. So backlight
> can control through ECAP2 (not conflicting with SPI1 cs0). Still for controlling
> backlight, require support for LCD_BACKLIGHT_PWR & LCD_PANEL_PWR. These signals

By controlling above you mean "switching on/off"? Otherwise this seems
to be contradicting the statement just before.

> to be controlled by GPIO 2[8] & GPIO 2[15]. In release platform callbacks used
> to control GPIO functionality. But with DT support, I have to check how platform
> callbacks can be used.

Platform callbacks are not possible with DT. You can look at what
freescale mxsfb.c does. Look for panel-enable-gpios DT binding.

Thanks,
Sekhar

2013-04-04 06:39:51

by Philip, Avinash

[permalink] [raw]
Subject: RE: [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.

On Thu, Apr 04, 2013 at 11:19:44, Nori, Sekhar wrote:
> On 4/4/2013 10:09 AM, Philip, Avinash wrote:
> > On Tue, Apr 02, 2013 at 14:05:09, Nori, Sekhar wrote:
> >> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> >>> Add platform support for EHRPWM and ECAP by providing clock nodes and
> >>> device tree nodes.
> >>> This series depends on [1] and [2] and is available for testing at [3].
> >>> Tested for back light support in da850 EVM with EHRPWM PWM device.
> >>>
> >>> [1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
> >>> [2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
> >>> [3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm
> >>>
> >>> Note:
> >>> DT support for EHRPWM backlight has not been added in da850-evm.dts as there is
> >>> conflicting pin-mux requirement with SPI flash.
> >>
> >> Can you check if this is really true even in newer boards (have a look
> >> at the latest schematics)? I remember this used to be a problem in very
> >> early versions but was fixed later.
> >
> > On looking schematics, panel has three power controls LCD_BACKLIGHT_PWR, LCD_PANEL_PWR,
> > LCD_PWM0. On latest schematic, LCD_PWM0 is connected to ECAP instance 2. So backlight
> > can control through ECAP2 (not conflicting with SPI1 cs0). Still for controlling
> > backlight, require support for LCD_BACKLIGHT_PWR & LCD_PANEL_PWR. These signals
>
> By controlling above you mean "switching on/off"? Otherwise this seems
> to be contradicting the statement just before.

Yes these lines should be switching on/off.

>
> > to be controlled by GPIO 2[8] & GPIO 2[15]. In release platform callbacks used
> > to control GPIO functionality. But with DT support, I have to check how platform
> > callbacks can be used.
>
> Platform callbacks are not possible with DT.

Ok.

> You can look at what freescale mxsfb.c does. Look for panel-enable-gpios DT binding.

I will use GPIO pin configuration info from DT nodes. From probe GPIO pin make active and
in remove disable GPIO pin.

Thanks
Avinash

>
> Thanks,
> Sekhar
>

????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2013-04-04 10:11:42

by Philip, Avinash

[permalink] [raw]
Subject: RE: [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.

On Thu, Apr 04, 2013 at 12:07:44, Philip, Avinash wrote:
> On Thu, Apr 04, 2013 at 11:19:44, Nori, Sekhar wrote:
> > On 4/4/2013 10:09 AM, Philip, Avinash wrote:
> > > On Tue, Apr 02, 2013 at 14:05:09, Nori, Sekhar wrote:
> > >> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> > >>> Add platform support for EHRPWM and ECAP by providing clock nodes and
> > >>> device tree nodes.
> > >>> This series depends on [1] and [2] and is available for testing at [3].
> > >>> Tested for back light support in da850 EVM with EHRPWM PWM device.
> > >>>
> > >>> [1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
> > >>> [2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
> > >>> [3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm
> > >>>
> > >>> Note:
> > >>> DT support for EHRPWM backlight has not been added in da850-evm.dts as there is
> > >>> conflicting pin-mux requirement with SPI flash.
> > >>
> > >> Can you check if this is really true even in newer boards (have a look
> > >> at the latest schematics)? I remember this used to be a problem in very
> > >> early versions but was fixed later.
> > >
> > > On looking schematics, panel has three power controls LCD_BACKLIGHT_PWR, LCD_PANEL_PWR,
> > > LCD_PWM0. On latest schematic, LCD_PWM0 is connected to ECAP instance 2. So backlight
> > > can control through ECAP2 (not conflicting with SPI1 cs0). Still for controlling
> > > backlight, require support for LCD_BACKLIGHT_PWR & LCD_PANEL_PWR. These signals
> >
> > By controlling above you mean "switching on/off"? Otherwise this seems
> > to be contradicting the statement just before.
>
> Yes these lines should be switching on/off.
>
> >
> > > to be controlled by GPIO 2[8] & GPIO 2[15]. In release platform callbacks used
> > > to control GPIO functionality. But with DT support, I have to check how platform
> > > callbacks can be used.
> >
> > Platform callbacks are not possible with DT.
>
> Ok.
>
> > You can look at what freescale mxsfb.c does. Look for panel-enable-gpios DT binding.
>
> I will use GPIO pin configuration info from DT nodes. From probe GPIO pin make active and
> in remove disable GPIO pin.

For passing from GPIO pins from DT, GPIO DT node has to be populated. So this has dependency
on GPIO driver conversion for davinci platforms.

Thanks
Avinash

>
> Thanks
> Avinash
>
> >
> > Thanks,
> > Sekhar
> >
>
>

????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2013-04-08 09:11:52

by Philip, Avinash

[permalink] [raw]
Subject: RE: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> > Add da850 EHRPWM & ECAP DT node.
> > Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP
> > clock.
>
> This looks fine to me but I will wait for the bindings to get accepted
> before taking this one.

Sekhar,

Binding document got accepted in PWM tree [1].
Can you accept this patch?

1. https://gitorious.org/linux-pwm

Thanks
Avinash

>
> Thanks,
> Sekhar
>

????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2013-04-08 13:10:31

by Sekhar Nori

[permalink] [raw]
Subject: Re: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node


On 4/8/2013 2:39 PM, Philip, Avinash wrote:
> On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
>> On 3/25/2013 1:19 PM, Philip Avinash wrote:
>>> Add da850 EHRPWM & ECAP DT node.
>>> Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP
>>> clock.
>>
>> This looks fine to me but I will wait for the bindings to get accepted
>> before taking this one.
>
> Sekhar,
>
> Binding document got accepted in PWM tree [1].
> Can you accept this patch?

Can you also add the pinmux definitions and resend just this patch?
Sorry I did not notice those were missing earlier.

Thanks,
Sekhar

2013-04-09 08:43:51

by Philip, Avinash

[permalink] [raw]
Subject: RE: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

On Mon, Apr 08, 2013 at 18:39:57, Nori, Sekhar wrote:
>
> On 4/8/2013 2:39 PM, Philip, Avinash wrote:
> > On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
> >> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> >>> Add da850 EHRPWM & ECAP DT node.
> >>> Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP
> >>> clock.
> >>
> >> This looks fine to me but I will wait for the bindings to get accepted
> >> before taking this one.
> >
> > Sekhar,
> >
> > Binding document got accepted in PWM tree [1].
> > Can you accept this patch?
>
> Can you also add the pinmux definitions and resend just this patch?
> Sorry I did not notice those were missing earlier.

According to latest schematics, ECAP instance 2 being used for PWM backlight
control. Should I add pin-mux only for ECAP2 or for all PWM instances?

Thanks
Avinash

>
> Thanks,
> Sekhar
>

????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2013-04-09 11:36:04

by Sekhar Nori

[permalink] [raw]
Subject: Re: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

On 4/9/2013 2:12 PM, Philip, Avinash wrote:
> On Mon, Apr 08, 2013 at 18:39:57, Nori, Sekhar wrote:
>>
>> On 4/8/2013 2:39 PM, Philip, Avinash wrote:
>>> On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
>>>> On 3/25/2013 1:19 PM, Philip Avinash wrote:
>>>>> Add da850 EHRPWM & ECAP DT node.
>>>>> Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP
>>>>> clock.
>>>>
>>>> This looks fine to me but I will wait for the bindings to get accepted
>>>> before taking this one.
>>>
>>> Sekhar,
>>>
>>> Binding document got accepted in PWM tree [1].
>>> Can you accept this patch?
>>
>> Can you also add the pinmux definitions and resend just this patch?
>> Sorry I did not notice those were missing earlier.
>
> According to latest schematics, ECAP instance 2 being used for PWM backlight
> control. Should I add pin-mux only for ECAP2 or for all PWM instances?

I meant add definitions in .dtsi. Since there is only one pin a given
functionality can be present on in DaVinci, it can be done in a board
independent manner. See examples for other peripherals in existing
da850.dtsi file.

Thanks,
Sekhar

2013-04-10 05:31:50

by Philip, Avinash

[permalink] [raw]
Subject: RE: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

On Tue, Apr 09, 2013 at 17:05:25, Nori, Sekhar wrote:
> On 4/9/2013 2:12 PM, Philip, Avinash wrote:
> > On Mon, Apr 08, 2013 at 18:39:57, Nori, Sekhar wrote:
> >>
> >> On 4/8/2013 2:39 PM, Philip, Avinash wrote:
> >>> On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
> >>>> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> >>>>> Add da850 EHRPWM & ECAP DT node.
> >>>>> Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP
> >>>>> clock.
> >>>>
> >>>> This looks fine to me but I will wait for the bindings to get accepted
> >>>> before taking this one.
> >>>
> >>> Sekhar,
> >>>
> >>> Binding document got accepted in PWM tree [1].
> >>> Can you accept this patch?
> >>
> >> Can you also add the pinmux definitions and resend just this patch?
> >> Sorry I did not notice those were missing earlier.
> >
> > According to latest schematics, ECAP instance 2 being used for PWM backlight
> > control. Should I add pin-mux only for ECAP2 or for all PWM instances?
>
> I meant add definitions in .dtsi. Since there is only one pin a given
> functionality can be present on in DaVinci, it can be done in a board
> independent manner.

I think here the expectation would be that .dtsi should populate the complete
pin-mux for SOC and board files should just be able to re-use it (add it as a phandler).
Also as per the above description .dtsi file will end up contain majorly pin-mux info
rather than the hardware data. Is it a good idea?

On looking da850.dtsi file NAND pins were defined for 8-bit part.
In case of NAND flash, the device might be sitting under different chip-select or may
have 16 bit part on different boards. So pin-mux defined in soc.dtsi has to be split
separately for CS, DATA, Address.

So it is always challenging to create pin-mux info in .dtsi file. So more useful/meaningful
way is to actually create pin-mux in board file rather in .dtsi file.

> See examples for other peripherals in existing
> da850.dtsi file.

I have gone through .dtsi. But it didn't describe the complete pin-mux like I2C1, MMC1, etc.
So the expectation here is only to add ECAP2 pin-mux. Is it correct?

Thanks
Avinash

>
> Thanks,
> Sekhar
>

????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2013-04-10 05:55:46

by Sekhar Nori

[permalink] [raw]
Subject: Re: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

On 4/10/2013 11:00 AM, Philip, Avinash wrote:
> On Tue, Apr 09, 2013 at 17:05:25, Nori, Sekhar wrote:
>> On 4/9/2013 2:12 PM, Philip, Avinash wrote:
>>> On Mon, Apr 08, 2013 at 18:39:57, Nori, Sekhar wrote:
>>>>
>>>> On 4/8/2013 2:39 PM, Philip, Avinash wrote:
>>>>> On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
>>>>>> On 3/25/2013 1:19 PM, Philip Avinash wrote:
>>>>>>> Add da850 EHRPWM & ECAP DT node.
>>>>>>> Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP
>>>>>>> clock.
>>>>>>
>>>>>> This looks fine to me but I will wait for the bindings to get accepted
>>>>>> before taking this one.
>>>>>
>>>>> Sekhar,
>>>>>
>>>>> Binding document got accepted in PWM tree [1].
>>>>> Can you accept this patch?
>>>>
>>>> Can you also add the pinmux definitions and resend just this patch?
>>>> Sorry I did not notice those were missing earlier.
>>>
>>> According to latest schematics, ECAP instance 2 being used for PWM backlight
>>> control. Should I add pin-mux only for ECAP2 or for all PWM instances?
>>
>> I meant add definitions in .dtsi. Since there is only one pin a given
>> functionality can be present on in DaVinci, it can be done in a board
>> independent manner.
>
> I think here the expectation would be that .dtsi should populate the complete
> pin-mux for SOC and board files should just be able to re-use it (add it as a phandler).

Yes, that's the idea.

> Also as per the above description .dtsi file will end up contain majorly pin-mux info
> rather than the hardware data. Is it a good idea?

Pinmux is also hardware data, no? Thats why its present in DT.

> On looking da850.dtsi file NAND pins were defined for 8-bit part.
> In case of NAND flash, the device might be sitting under different chip-select or may
> have 16 bit part on different boards. So pin-mux defined in soc.dtsi has to be split
> separately for CS, DATA, Address.

The idea is to define pin groups that most of the time can be reused by
.dts file as-is and if there are any board specific extra pins needed
then they can be handled directly in .dts files. But the common cases
don't have to be repeated in all boards. In case of NAND, CS and the top
8-pins when using a 16-bit bus can be moved to a different group. So, I
agree instead of nand_cs3_pins, we could have had nand_pins and moved cs
definitions to another re-usable group.

> So it is always challenging to create pin-mux info in .dtsi file. So more useful/meaningful
> way is to actually create pin-mux in board file rather in .dtsi file.

I don't see why it is so challenging. Repeating the same pinmux
information over multiple .dts file (while making errors copying) will
be challenging. And its not as if this is my original idea. imx (and I
think some others) are doing it as well. See how pinmux is defined in
imx53.dtsi and reused in a number of boards like evk, qsb, smd and so on.

>> See examples for other peripherals in existing
>> da850.dtsi file.
>
> I have gone through .dtsi. But it didn't describe the complete pin-mux like I2C1, MMC1, etc.

pinmux should be added for whatever nodes are added since pimux is part
of node.

> So the expectation here is only to add ECAP2 pin-mux. Is it correct?

No, please add pinmux information for all the IP nodes you are adding. I
am not insisting that you add all IP nodes at the same time. You can add
whatever you have tested.

Thanks,
Sekhar

2013-04-10 06:09:01

by Philip, Avinash

[permalink] [raw]
Subject: RE: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

On Wed, Apr 10, 2013 at 11:25:19, Nori, Sekhar wrote:
> On 4/10/2013 11:00 AM, Philip, Avinash wrote:
> > On Tue, Apr 09, 2013 at 17:05:25, Nori, Sekhar wrote:
> >> On 4/9/2013 2:12 PM, Philip, Avinash wrote:
> >>> On Mon, Apr 08, 2013 at 18:39:57, Nori, Sekhar wrote:
> >>>>
> >>>> On 4/8/2013 2:39 PM, Philip, Avinash wrote:
> >>>>> On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
> >>>>>> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> >>>>>>> Add da850 EHRPWM & ECAP DT node.
> >>>>>>> Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP
> >>>>>>> clock.
> >>>>>>
> >>>>>> This looks fine to me but I will wait for the bindings to get accepted
> >>>>>> before taking this one.
> >>>>>
> >>>>> Sekhar,
> >>>>>
> >>>>> Binding document got accepted in PWM tree [1].
> >>>>> Can you accept this patch?
> >>>>
> >>>> Can you also add the pinmux definitions and resend just this patch?
> >>>> Sorry I did not notice those were missing earlier.
> >>>
> >>> According to latest schematics, ECAP instance 2 being used for PWM backlight
> >>> control. Should I add pin-mux only for ECAP2 or for all PWM instances?
> >>
> >> I meant add definitions in .dtsi. Since there is only one pin a given
> >> functionality can be present on in DaVinci, it can be done in a board
> >> independent manner.
> >
> > I think here the expectation would be that .dtsi should populate the complete
> > pin-mux for SOC and board files should just be able to re-use it (add it as a phandler).
>
> Yes, that's the idea.

Ok

>
> > Also as per the above description .dtsi file will end up contain majorly pin-mux info
> > rather than the hardware data. Is it a good idea?
>
> Pinmux is also hardware data, no? Thats why its present in DT.

I understood.

>
> > On looking da850.dtsi file NAND pins were defined for 8-bit part.
> > In case of NAND flash, the device might be sitting under different chip-select or may
> > have 16 bit part on different boards. So pin-mux defined in soc.dtsi has to be split
> > separately for CS, DATA, Address.
>
> The idea is to define pin groups that most of the time can be reused by
> .dts file as-is and if there are any board specific extra pins needed
> then they can be handled directly in .dts files. But the common cases
> don't have to be repeated in all boards. In case of NAND, CS and the top
> 8-pins when using a 16-bit bus can be moved to a different group. So, I
> agree instead of nand_cs3_pins, we could have had nand_pins and moved cs
> definitions to another re-usable group.

Ok, thanks for the detailed explanation.

>
> > So it is always challenging to create pin-mux info in .dtsi file. So more useful/meaningful
> > way is to actually create pin-mux in board file rather in .dtsi file.
>
> I don't see why it is so challenging. Repeating the same pinmux
> information over multiple .dts file (while making errors copying) will
> be challenging. And its not as if this is my original idea. imx (and I
> think some others) are doing it as well. See how pinmux is defined in
> imx53.dtsi and reused in a number of boards like evk, qsb, smd and so on.
>
> >> See examples for other peripherals in existing
> >> da850.dtsi file.
> >
> > I have gone through .dtsi. But it didn't describe the complete pin-mux like I2C1, MMC1, etc.
>
> pinmux should be added for whatever nodes are added since pimux is part
> of node.
>
> > So the expectation here is only to add ECAP2 pin-mux. Is it correct?
>
> No, please add pinmux information for all the IP nodes you are adding. I
> am not insisting that you add all IP nodes at the same time. You can add
> whatever you have tested.

I actually tested EHRPWM1A and EHRPWM1B in older boards for back light support.
But in latest schematics shows ECAP2 being used for backlight control and can't
be tested as boards with this change is not accessible to me.
So I will add tested pin-mux details.

Thanks
Avinash

>
> Thanks,
> Sekhar
>

????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?