[PATCH 1/2] memory: omap-gpmc: Add support for AAD timings

2015-12-28 Thread Neil Armstrong
In order to support extended timings parameters on hardware supporting the
"AAD" mode like the AM335x or DM816x, add these entries into the GPMC driver
if the hardware is capable.

Tested on DM816x and AM335x.

Signed-off-by: Neil Armstrong 
---
 drivers/memory/omap-gpmc.c | 30 ++
 include/linux/omap-gpmc.h  |  5 +
 2 files changed, 35 insertions(+)

diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index 6515dfc..21825dd 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -541,9 +541,20 @@ static void gpmc_cs_show_timings(int cs, const char *desc)
GPMC_GET_TICKS(GPMC_CS_CONFIG3,  0,  3, "adv-on-ns");
GPMC_GET_TICKS(GPMC_CS_CONFIG3,  8, 12, "adv-rd-off-ns");
GPMC_GET_TICKS(GPMC_CS_CONFIG3, 16, 20, "adv-wr-off-ns");
+   if (gpmc_capability & GPMC_HAS_MUX_AAD) {
+   GPMC_GET_TICKS(GPMC_CS_CONFIG3, 4, 6, "adv-aad-mux-on-ns");
+   GPMC_GET_TICKS(GPMC_CS_CONFIG3, 24, 26,
+   "adv-aad-mux-rd-off-ns");
+   GPMC_GET_TICKS(GPMC_CS_CONFIG3, 28, 30,
+   "adv-aad-mux-wr-off-ns");
+   }
 
GPMC_GET_TICKS(GPMC_CS_CONFIG4,  0,  3, "oe-on-ns");
GPMC_GET_TICKS(GPMC_CS_CONFIG4,  8, 12, "oe-off-ns");
+   if (gpmc_capability & GPMC_HAS_MUX_AAD) {
+   GPMC_GET_TICKS(GPMC_CS_CONFIG4,  4,  6, "oe-aad-mux-on-ns");
+   GPMC_GET_TICKS(GPMC_CS_CONFIG4, 13, 15, "oe-aad-mux-off-ns");
+   }
GPMC_GET_TICKS(GPMC_CS_CONFIG4, 16, 19, "we-on-ns");
GPMC_GET_TICKS(GPMC_CS_CONFIG4, 24, 28, "we-off-ns");
 
@@ -734,9 +745,18 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings 
*t,
GPMC_SET_ONE(GPMC_CS_CONFIG3,  0,  3, adv_on);
GPMC_SET_ONE(GPMC_CS_CONFIG3,  8, 12, adv_rd_off);
GPMC_SET_ONE(GPMC_CS_CONFIG3, 16, 20, adv_wr_off);
+   if (gpmc_capability & GPMC_HAS_MUX_AAD) {
+   GPMC_SET_ONE(GPMC_CS_CONFIG3,  4,  6, adv_aad_mux_on);
+   GPMC_SET_ONE(GPMC_CS_CONFIG3, 24, 26, adv_aad_mux_rd_off);
+   GPMC_SET_ONE(GPMC_CS_CONFIG3, 28, 30, adv_aad_mux_wr_off);
+   }
 
GPMC_SET_ONE(GPMC_CS_CONFIG4,  0,  3, oe_on);
GPMC_SET_ONE(GPMC_CS_CONFIG4,  8, 12, oe_off);
+   if (gpmc_capability & GPMC_HAS_MUX_AAD) {
+   GPMC_SET_ONE(GPMC_CS_CONFIG4,  4,  6, oe_aad_mux_on);
+   GPMC_SET_ONE(GPMC_CS_CONFIG4, 13, 15, oe_aad_mux_off);
+   }
GPMC_SET_ONE(GPMC_CS_CONFIG4, 16, 19, we_on);
GPMC_SET_ONE(GPMC_CS_CONFIG4, 24, 28, we_off);
 
@@ -1722,6 +1742,12 @@ static void __maybe_unused gpmc_read_timings_dt(struct 
device_node *np,
of_property_read_u32(np, "gpmc,adv-on-ns", &gpmc_t->adv_on);
of_property_read_u32(np, "gpmc,adv-rd-off-ns", &gpmc_t->adv_rd_off);
of_property_read_u32(np, "gpmc,adv-wr-off-ns", &gpmc_t->adv_wr_off);
+   of_property_read_u32(np, "gpmc,adv-aad-mux-on-ns",
+&gpmc_t->adv_aad_mux_on);
+   of_property_read_u32(np, "gpmc,adv-aad-mux-rd-off-ns",
+&gpmc_t->adv_aad_mux_rd_off);
+   of_property_read_u32(np, "gpmc,adv-aad-mux-wr-off-ns",
+&gpmc_t->adv_aad_mux_wr_off);
 
/* WE signal timings */
of_property_read_u32(np, "gpmc,we-on-ns", &gpmc_t->we_on);
@@ -1730,6 +1756,10 @@ static void __maybe_unused gpmc_read_timings_dt(struct 
device_node *np,
/* OE signal timings */
of_property_read_u32(np, "gpmc,oe-on-ns", &gpmc_t->oe_on);
of_property_read_u32(np, "gpmc,oe-off-ns", &gpmc_t->oe_off);
+   of_property_read_u32(np, "gpmc,oe-aad-mux-on-ns",
+&gpmc_t->oe_aad_mux_on);
+   of_property_read_u32(np, "gpmc,oe-aad-mux-off-ns",
+&gpmc_t->oe_aad_mux_off);
 
/* access and cycle timings */
of_property_read_u32(np, "gpmc,page-burst-access-ns",
diff --git a/include/linux/omap-gpmc.h b/include/linux/omap-gpmc.h
index 7dee0014..d833eb4 100644
--- a/include/linux/omap-gpmc.h
+++ b/include/linux/omap-gpmc.h
@@ -51,6 +51,9 @@ struct gpmc_timings {
u32 adv_on; /* Assertion time */
u32 adv_rd_off; /* Read deassertion time */
u32 adv_wr_off; /* Write deassertion time */
+   u32 adv_aad_mux_on; /* ADV assertion time for AAD */
+   u32 adv_aad_mux_rd_off; /* ADV read deassertion time for AAD */
+   u32 adv_aad_mux_wr_off; /* ADV write deassertion time for AAD */
 
/* WE signals timings corresponding to GPMC_CONFIG4 */
 

[PATCH 2/2] dt-bindings: bus: ti-gpmc: Add AAD timings properties

2015-12-28 Thread Neil Armstrong
In order to support advanced AAD timings, add these properties to the DT
GPMC bindings.

Signed-off-by: Neil Armstrong 
---
 Documentation/devicetree/bindings/bus/ti-gpmc.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/bus/ti-gpmc.txt 
b/Documentation/devicetree/bindings/bus/ti-gpmc.txt
index 704be93..0168370 100644
--- a/Documentation/devicetree/bindings/bus/ti-gpmc.txt
+++ b/Documentation/devicetree/bindings/bus/ti-gpmc.txt
@@ -46,6 +46,9 @@ Timing properties for child nodes. All are optional and 
default to 0.
  - gpmc,adv-on-ns: Assertion time
  - gpmc,adv-rd-off-ns: Read deassertion time
  - gpmc,adv-wr-off-ns: Write deassertion time
+ - gpmc,adv-aad-mux-on-ns: Assertion time for AAD
+ - gpmc,adv-aad-mux-rd-off-ns: Read deassertion time for AAD
+ - gpmc,adv-aad-mux-wr-off-ns: Write deassertion time for AAD
 
  WE signals timings (in nanoseconds) corresponding to GPMC_CONFIG4:
  - gpmc,we-on-ns   Assertion time
@@ -54,6 +57,8 @@ Timing properties for child nodes. All are optional and 
default to 0.
  OE signals timings (in nanoseconds) corresponding to GPMC_CONFIG4:
  - gpmc,oe-on-ns:  Assertion time
  - gpmc,oe-off-ns: Deassertion time
+ - gpmc,oe-aad-mux-on-ns:  Assertion time for AAD
+ - gpmc,oe-aad-mux-off-ns: Deassertion time for AAD
 
  Access time and cycle time timings (in nanoseconds) corresponding to
  GPMC_CONFIG5:
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] ti-gpmc: Add support for AAD timings

2015-12-28 Thread Neil Armstrong
This serie add support for the GPMC Advanced AAD timings on hardware supporting
the feature like the AM335x and DM816X.

Neil Armstrong (2):
  memory: omap-gpmc: Add support for AAD timings
  dt-bindings: bus: ti-gpmc: Add AAD timings properties

 Documentation/devicetree/bindings/bus/ti-gpmc.txt |  5 
 drivers/memory/omap-gpmc.c| 30 +++
 include/linux/omap-gpmc.h |  5 
 3 files changed, 40 insertions(+)

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] pwm: Add PWM driver for OMAP using dual-mode timers

2015-12-17 Thread Neil Armstrong
Hi Thierry,
On 12/16/2015 05:27 PM, Thierry Reding wrote:
> I've applied this with some coding style bikeshedding applied. Also I
> think there's a timer leak in the probe function:
Indeed, the coding style had some root for ameliorations ! Thanks !
I also missed this timer leak, thanks for the fix.
>
>> diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c
> [...]
>> +static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
>> +{
> [...]
>> +dm_timer = pdata->request_by_node(timer);
>> +if (!dm_timer)
>> +return -EPROBE_DEFER;
>
> dm_timer holds the requested timer now.
>
>> +
>> +omap = devm_kzalloc(&pdev->dev, sizeof(*omap), GFP_KERNEL);
>> +if (!omap)
>> +return -ENOMEM;
>
> But it's not released when this allocation fails...
>
>> +
>> +omap->pdata = pdata;
>> +omap->dm_timer = dm_timer;
>> +omap->dm_timer_pdev = of_find_device_by_node(timer);
>> +if (!omap->dm_timer_pdev) {
>> +dev_err(&pdev->dev, "Unable to find timer pdev\n");
>> +return -EINVAL;
>> +}
>
> ... nor when this lookup fails. I've taken the liberty of adding two
> calls to omap->pdata->free(dm_timer) to these error paths.
Perfect !

> Please take a look at what's in the pwm/for-next branch to see if it
> still works correctly.
I had a look against my original patch and it should be ok, I will still hook 
it up back
on the real HW in case we forgot something.

> Thanks,
> Thierry
>

Thanks !
Neil




signature.asc
Description: OpenPGP digital signature


[PATCH v2 1/4] arm: omap2+: add missing HWMOD_NO_IDLEST in 81xx hwmod data

2015-11-13 Thread Neil Armstrong
Add missing HWMOD_NO_IDLEST hwmod flag for entries not
having omap4 clkctrl values.
The emac0 hwmod flag fixes the davinci_emac driver probe
since the return of pm_resume() call is now checked.

This solves the following boot errors :
[0.121429] omap_hwmod: l4_ls: _wait_target_ready failed: -16
[0.121441] omap_hwmod: l4_ls: cannot be enabled for reset (3)
[0.124342] omap_hwmod: l4_hs: _wait_target_ready failed: -16
[0.124352] omap_hwmod: l4_hs: cannot be enabled for reset (3)
[1.967228] omap_hwmod: emac0: _wait_target_ready failed: -16

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
index b1288f5..6256052 100644
--- a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
@@ -144,6 +144,7 @@ static struct omap_hwmod dm81xx_l4_ls_hwmod = {
.name   = "l4_ls",
.clkdm_name = "alwon_l3s_clkdm",
.class  = &l4_hwmod_class,
+   .flags  = HWMOD_NO_IDLEST,
 };

 /*
@@ -155,6 +156,7 @@ static struct omap_hwmod dm81xx_l4_hs_hwmod = {
.name   = "l4_hs",
.clkdm_name = "alwon_l3_med_clkdm",
.class  = &l4_hwmod_class,
+   .flags  = HWMOD_NO_IDLEST,
 };

 /* L3 slow -> L4 ls peripheral interface running at 125MHz */
@@ -850,6 +852,7 @@ static struct omap_hwmod dm816x_emac0_hwmod = {
.name   = "emac0",
.clkdm_name = "alwon_ethernet_clkdm",
.class  = &dm816x_emac_hwmod_class,
+   .flags  = HWMOD_NO_IDLEST,
 };

 static struct omap_hwmod_ocp_if dm81xx_l4_hs__emac0 = {
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/4] clk: ti816x: Add missing dmtimer clkdev entries

2015-11-13 Thread Neil Armstrong
Add missing clkdev dmtimer related entries for dm816x.
32Khz and ext sources were missing.

Cc: Brian Hutchinson 
Acked-by: Tony Lindgren 
Signed-off-by: Neil Armstrong 
---
 drivers/clk/ti/clk-816x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/ti/clk-816x.c b/drivers/clk/ti/clk-816x.c
index 1dfad0c..2a5d84f 100644
--- a/drivers/clk/ti/clk-816x.c
+++ b/drivers/clk/ti/clk-816x.c
@@ -20,6 +20,8 @@ static struct ti_dt_clk dm816x_clks[] = {
DT_CLK(NULL, "sys_clkin", "sys_clkin_ck"),
DT_CLK(NULL, "timer_sys_ck", "sys_clkin_ck"),
DT_CLK(NULL, "sys_32k_ck", "sys_32k_ck"),
+   DT_CLK(NULL, "timer_32k_ck", "sysclk18_ck"),
+   DT_CLK(NULL, "timer_ext_ck", "tclkin_ck"),
DT_CLK(NULL, "mpu_ck", "mpu_ck"),
DT_CLK(NULL, "timer1_fck", "timer1_fck"),
DT_CLK(NULL, "timer2_fck", "timer2_fck"),
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 3/4] arm: plat-omap: add DT support for ti,dm816-timer

2015-11-13 Thread Neil Armstrong
Adds ti,dm816-timer to the dmtimer OF match table.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/plat-omap/dmtimer.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 8ca94d3..28a6550 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -943,6 +943,10 @@ static const struct of_device_id omap_timer_match[] = {
.compatible = "ti,am335x-timer-1ms",
.data = &omap3plus_pdata,
},
+   {
+   .compatible = "ti,dm816-timer",
+   .data = &omap3plus_pdata,
+   },
{},
 };
 MODULE_DEVICE_TABLE(of, omap_timer_match);
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 4/4] arm: omap2+: Add hwmod spinbox support for dm816x

2015-11-13 Thread Neil Armstrong
Add dm81xx hwmod data entries for dm816x spinbox support.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 35 ++
 1 file changed, 35 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
index 6256052..275b16c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
@@ -1036,6 +1036,40 @@ static struct omap_hwmod_ocp_if dm81xx_l4_ls__mailbox = {
.user   = OCP_USER_MPU,
 };

+static struct omap_hwmod_class_sysconfig dm81xx_spinbox_sysc = {
+   .rev_offs   = 0x000,
+   .sysc_offs  = 0x010,
+   .syss_offs  = 0x014,
+   .sysc_flags = SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
+   SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE,
+   .idlemodes  = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class dm81xx_spinbox_hwmod_class = {
+   .name = "spinbox",
+   .sysc = &dm81xx_spinbox_sysc,
+};
+
+static struct omap_hwmod dm81xx_spinbox_hwmod = {
+   .name   = "spinbox",
+   .clkdm_name = "alwon_l3s_clkdm",
+   .class  = &dm81xx_spinbox_hwmod_class,
+   .main_clk   = "sysclk6_ck",
+   .prcm   = {
+   .omap4 = {
+   .clkctrl_offs = DM81XX_CM_ALWON_SPINBOX_CLKCTRL,
+   .modulemode = MODULEMODE_SWCTRL,
+   },
+   },
+};
+
+static struct omap_hwmod_ocp_if dm81xx_l4_ls__spinbox = {
+   .master = &dm81xx_l4_ls_hwmod,
+   .slave  = &dm81xx_spinbox_hwmod,
+   .user   = OCP_USER_MPU,
+};
+
 static struct omap_hwmod_class dm81xx_tpcc_hwmod_class = {
.name   = "tpcc",
 };
@@ -1298,6 +1332,7 @@ static struct omap_hwmod_ocp_if *dm816x_hwmod_ocp_ifs[] 
__initdata = {
&dm816x_l4_ls__timer7,
&dm81xx_l4_ls__mcspi1,
&dm81xx_l4_ls__mailbox,
+   &dm81xx_l4_ls__spinbox,
&dm81xx_l4_hs__emac0,
&dm81xx_emac0__mdio,
&dm816x_l4_hs__emac1,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/4] arm: omap2+: complete dm816x hwmod and clkdev

2015-11-13 Thread Neil Armstrong
In order to fix support for the dm816x platform, add missing bits in
the 81xx hwmod data.

The clk related patch adds the missing clkdev entries to fix all source
selection in the dmtimer driver.

The last patch adds hwmod support of the spinbox module.

v2: add error logs for first patch

Neil Armstrong (4):
  arm: omap2+: add missing HWMOD_NO_IDLEST in 81xx hwmod data
  clk: ti816x: Add missing dmtimer clkdev entries
  arm: plat-omap: add DT support for ti,dm816-timer
  arm: omap2+: Add hwmod spinbox support for dm816x

 arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 38 ++
 arch/arm/plat-omap/dmtimer.c   |  4 
 drivers/clk/ti/clk-816x.c  |  2 ++
 3 files changed, 44 insertions(+)

-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4] arm: omap2+: add missing HWMOD_NO_IDLEST in 81xx hwmod data

2015-11-13 Thread Neil Armstrong
On 11/13/2015 03:41 PM, Tony Lindgren wrote:
> * Neil Armstrong  [151112 06:16]:
>> On 10/24/2015 12:09 PM, Neil Armstrong wrote:
>>> Hi,
>>>
>>> 2015-10-24 3:21 GMT+02:00 Tony Lindgren :
>>>>
>>>> Hi,
>>>>
>>>> * Neil Armstrong  [151022 02:19]:
>>>>> Add missing HWMOD_NO_IDLEST hwmod flag for entries no
>>>>> having omap4 clkctrl values.
>>>>
>>>> Have you checked this is the case both in dm814x and dm816x TRM?
>>>> Also the documentation may not be complete FYI, might be also
>>>> worth checking the legacy TI kernel tree to be sure.
>>>>
>>>> Regards,
>>>>
>>>> Tony
>>>>
>>>>> Cc: Brian Hutchinson 
>>>>> Signed-off-by: Neil Armstrong 
>>>>> ---
>>>>>  arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 3 +++
>>>>>  1 file changed, 3 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c 
>>>>> b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
>>>>> index b1288f5..6256052 100644
>>>>> --- a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
>>>>> +++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
>>>>> @@ -144,6 +144,7 @@ static struct omap_hwmod dm81xx_l4_ls_hwmod = {
>>>>>   .name   = "l4_ls",
>>>>>   .clkdm_name = "alwon_l3s_clkdm",
>>>>>   .class  = &l4_hwmod_class,
>>>>> + .flags  = HWMOD_NO_IDLEST,
>>>>>  };
>>> In DM814x TRM, the CM_ALWON_L3_SLOW_CLKSTCTRL does not have IDLEST field.
>>> Same in DM816x TRM.
>>>
>>>>>
>>>>>  /*
>>>>> @@ -155,6 +156,7 @@ static struct omap_hwmod dm81xx_l4_hs_hwmod = {
>>>>>   .name   = "l4_hs",
>>>>>   .clkdm_name = "alwon_l3_med_clkdm",
>>>>>   .class  = &l4_hwmod_class,
>>>>> + .flags  = HWMOD_NO_IDLEST,
>>>>>  };
>>> In DM814x TRM, the CM_ALWON_L3_MED_CLKSTCTRL does not have IDLEST field.
>>> Same in DM816x TRM.
>>>
>>>>>
>>>>>  /* L3 slow -> L4 ls peripheral interface running at 125MHz */
>>>>> @@ -850,6 +852,7 @@ static struct omap_hwmod dm816x_emac0_hwmod = {
>>>>>   .name   = "emac0",
>>>>>   .clkdm_name = "alwon_ethernet_clkdm",
>>>>>   .class  = &dm816x_emac_hwmod_class,
>>>>> + .flags  = HWMOD_NO_IDLEST,
>>>>>  };
>>> In this particular case, the IDLEST is handled in the MDIO hwmod.
>>>
>>>>>
>>>>>  static struct omap_hwmod_ocp_if dm81xx_l4_hs__emac0 = {
>>>>> --
>>>>> 1.9.1
>>>
>>> I'll check the TI tree to be sure...
>>>
>>> Regards,
>>> Neil
>>>
>> Tony,
>>
>> In TI's tree, there is no L3_MED hwmod but the L3_SLOW hwmod has NO_IDLEST 
>> flag.
>>
>> Is there any other issue about this patchset ?
> 
> Thanks for checking. Well one thing, if this is needed as fix, then a
> description of what happens without it would be good to have.
> 
> Regards,
> 
> Tony
> 
Tony,

I'll send a patchset with the error lines in a few minutes.

Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/5] arm: dts: complete dm816x device tree

2015-11-13 Thread Neil Armstrong
On 11/12/2015 06:47 PM, Tony Lindgren wrote:
> * Neil Armstrong  [151112 06:08]:
>> In order to fix support for the dm816x platform, add missing bits in
>> the dm816x dtsi and cleanup OCP.
> 
> Which ones are needed as fixes for the v4.4-rc kernel?
> 
> Regards,
> 
> Tony
> 
>> The last patch adds support for the omap4-hwspinlock.
>>
>> v2: add ocp hwmod cleanup
>>
>> Neil Armstrong (5):
>>   arm: dts: add dm816x missing #mbox-cells
>>   arm: dts: add dm816x missing spi DT dma handles
Tony,

The two first are fixes for v4.4-rc.

>>   arm: dts: add dm816x pwm property to timers
>>   arm: dts: remove dm816x invalid DT l3_main hwmod
>>   arm: dts: Add omap4-hwspinlock support in dm816x

the 3 following can wait.

>>
>>  arch/arm/boot/dts/dm816x.dtsi | 20 +---
>>  1 file changed, 17 insertions(+), 3 deletions(-)
>>
>> -- 
>> 1.9.1

Thanks,
Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4] arm: omap2+: add missing HWMOD_NO_IDLEST in 81xx hwmod data

2015-11-12 Thread Neil Armstrong
On 10/24/2015 12:09 PM, Neil Armstrong wrote:
> Hi,
> 
> 2015-10-24 3:21 GMT+02:00 Tony Lindgren :
>>
>> Hi,
>>
>> * Neil Armstrong  [151022 02:19]:
>>> Add missing HWMOD_NO_IDLEST hwmod flag for entries no
>>> having omap4 clkctrl values.
>>
>> Have you checked this is the case both in dm814x and dm816x TRM?
>> Also the documentation may not be complete FYI, might be also
>> worth checking the legacy TI kernel tree to be sure.
>>
>> Regards,
>>
>> Tony
>>
>>> Cc: Brian Hutchinson 
>>> Signed-off-by: Neil Armstrong 
>>> ---
>>>  arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c 
>>> b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
>>> index b1288f5..6256052 100644
>>> --- a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
>>> +++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
>>> @@ -144,6 +144,7 @@ static struct omap_hwmod dm81xx_l4_ls_hwmod = {
>>>   .name   = "l4_ls",
>>>   .clkdm_name = "alwon_l3s_clkdm",
>>>   .class  = &l4_hwmod_class,
>>> + .flags  = HWMOD_NO_IDLEST,
>>>  };
> In DM814x TRM, the CM_ALWON_L3_SLOW_CLKSTCTRL does not have IDLEST field.
> Same in DM816x TRM.
> 
>>>
>>>  /*
>>> @@ -155,6 +156,7 @@ static struct omap_hwmod dm81xx_l4_hs_hwmod = {
>>>   .name   = "l4_hs",
>>>   .clkdm_name = "alwon_l3_med_clkdm",
>>>   .class  = &l4_hwmod_class,
>>> + .flags  = HWMOD_NO_IDLEST,
>>>  };
> In DM814x TRM, the CM_ALWON_L3_MED_CLKSTCTRL does not have IDLEST field.
> Same in DM816x TRM.
> 
>>>
>>>  /* L3 slow -> L4 ls peripheral interface running at 125MHz */
>>> @@ -850,6 +852,7 @@ static struct omap_hwmod dm816x_emac0_hwmod = {
>>>   .name   = "emac0",
>>>   .clkdm_name = "alwon_ethernet_clkdm",
>>>   .class  = &dm816x_emac_hwmod_class,
>>> + .flags  = HWMOD_NO_IDLEST,
>>>  };
> In this particular case, the IDLEST is handled in the MDIO hwmod.
> 
>>>
>>>  static struct omap_hwmod_ocp_if dm81xx_l4_hs__emac0 = {
>>> --
>>> 1.9.1
> 
> I'll check the TI tree to be sure...
> 
> Regards,
> Neil
> 
Tony,

In TI's tree, there is no L3_MED hwmod but the L3_SLOW hwmod has NO_IDLEST flag.

Is there any other issue about this patchset ?

Neil

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/5] arm: dts: add dm816x missing spi DT dma handles

2015-11-12 Thread Neil Armstrong
Add the missing SPI controller DMA handler in the dm816x DT
node, only properties for the two channels on four were present.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/boot/dts/dm816x.dtsi | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index a7a34e4..eee636d 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -280,8 +280,11 @@
ti,spi-num-cs = <4>;
ti,hwmods = "mcspi1";
dmas = <&edma 16 &edma 17
-   &edma 18 &edma 19>;
-   dma-names = "tx0", "rx0", "tx1", "rx1";
+   &edma 18 &edma 19
+   &edma 20 &edma 21
+   &edma 22 &edma 23>;
+   dma-names = "tx0", "rx0", "tx1", "rx1",
+   "tx2", "rx2", "tx3", "rx3";
};

mmc1: mmc@4806 {
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/5] arm: dts: add dm816x missing #mbox-cells

2015-11-12 Thread Neil Armstrong
Add missing #mbox-cells for dm816x mbox DT node.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/boot/dts/dm816x.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index 3c99cfa..a7a34e4 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -218,6 +218,7 @@
reg = <0x480c8000 0x2000>;
interrupts = <77>;
ti,hwmods = "mailbox";
+   #mbox-cells = <1>;
ti,mbox-num-users = <4>;
ti,mbox-num-fifos = <12>;
mbox_dsp: mbox_dsp {
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 5/5] arm: dts: Add omap4-hwspinlock support in dm816x

2015-11-12 Thread Neil Armstrong
Add dm816x DT entries for omap4-hwspinlock support as hwmod spinbox.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/boot/dts/dm816x.dtsi | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index b9feeea..eb9bea1 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -226,6 +226,13 @@
};
};

+   spinbox: spinbox@480ca000 {
+   compatible = "ti,omap4-hwspinlock";
+   reg = <0x480ca000 0x2000>;
+   ti,hwmods = "spinbox";
+   #hwlock-cells = <1>;
+   };
+
mdio: mdio@4a100800 {
compatible = "ti,davinci_mdio";
#address-cells = <1>;
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 3/5] arm: dts: add dm816x pwm property to timers

2015-11-12 Thread Neil Armstrong
Adds ti,timer-pwm property to timers 4 to 7 to permit usage of their
PWM output fonctionnality via the dmtimer driver.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/boot/dts/dm816x.dtsi | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index eee636d..51ad4a9 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -323,6 +323,7 @@
reg = <0x48044000 0x2000>;
interrupts = <92>;
ti,hwmods = "timer4";
+   ti,timer-pwm;
};

timer5: timer@48046000 {
@@ -330,6 +331,7 @@
reg = <0x48046000 0x2000>;
interrupts = <93>;
ti,hwmods = "timer5";
+   ti,timer-pwm;
};

timer6: timer@48048000 {
@@ -337,6 +339,7 @@
reg = <0x48048000 0x2000>;
interrupts = <94>;
ti,hwmods = "timer6";
+   ti,timer-pwm;
};

timer7: timer@4804a000 {
@@ -344,6 +347,7 @@
reg = <0x4804a000 0x2000>;
interrupts = <95>;
ti,hwmods = "timer7";
+   ti,timer-pwm;
};

uart1: uart@4802 {
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 4/5] arm: dts: remove dm816x invalid DT l3_main hwmod

2015-11-12 Thread Neil Armstrong
Remove invalid l3_main hwmod entry from dm816x DT ocp node.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/boot/dts/dm816x.dtsi | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index 51ad4a9..b9feeea 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -64,7 +64,6 @@
#address-cells = <1>;
#size-cells = <1>;
ranges;
-   ti,hwmods = "l3_main";

prcm: prcm@4818 {
compatible = "ti,dm816-prcm";
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/5] arm: dts: complete dm816x device tree

2015-11-12 Thread Neil Armstrong
In order to fix support for the dm816x platform, add missing bits in
the dm816x dtsi and cleanup OCP.

The last patch adds support for the omap4-hwspinlock.

v2: add ocp hwmod cleanup

Neil Armstrong (5):
  arm: dts: add dm816x missing #mbox-cells
  arm: dts: add dm816x missing spi DT dma handles
  arm: dts: add dm816x pwm property to timers
  arm: dts: remove dm816x invalid DT l3_main hwmod
  arm: dts: Add omap4-hwspinlock support in dm816x

 arch/arm/boot/dts/dm816x.dtsi | 20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)

-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] arm: plat-omap: dmtimer: Add clock source from DT

2015-11-02 Thread Neil Armstrong
Add a function which sets the timer source from the clocks
binding on dm_timer_prepare call.

In case the clocks property is not valid, it falls back to
the set_source() with 32_KHZ clock as default.

Suggested-by: Tony Lindgren 
Signed-off-by: Neil Armstrong 
---
 arch/arm/plat-omap/dmtimer.c | 31 ++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 8ca94d3..7c7f260 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -137,6 +137,31 @@ static int omap_dm_timer_reset(struct omap_dm_timer *timer)
return 0;
 }

+static int omap_dm_timer_of_set_source(struct omap_dm_timer *timer)
+{
+   int ret;
+   struct clk *parent;
+
+   /*
+* FIXME: OMAP1 devices do not use the clock framework for dmtimers so
+* do not call clk_get() for these devices.
+*/
+   if (!timer->fclk)
+   return -ENODEV;
+
+   parent = clk_get(&timer->pdev->dev, NULL);
+   if (IS_ERR(parent))
+   return -ENODEV;
+
+   ret = clk_set_parent(timer->fclk, parent);
+   if (ret < 0)
+   pr_err("%s: failed to set parent\n", __func__);
+
+   clk_put(parent);
+
+   return ret;
+}
+
 static int omap_dm_timer_prepare(struct omap_dm_timer *timer)
 {
int rc;
@@ -166,7 +191,11 @@ static int omap_dm_timer_prepare(struct omap_dm_timer 
*timer)
__omap_dm_timer_enable_posted(timer);
omap_dm_timer_disable(timer);

-   return omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
+   rc = omap_dm_timer_of_set_source(timer);
+   if (rc == -ENODEV)
+   return omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
+
+   return rc;
 }

 static inline u32 omap_dm_timer_reserved_systimer(int id)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] pwm: omap: Add PWM support using dual-mode timers

2015-11-02 Thread Neil Armstrong
This patch is based on an earlier patch by NeilBrown which is based on
a older patch from Grant Erickson which provided PWM devices using
the 'legacy' interface.

The pwm driver was renamed to not be confused with the OMAP4 PWM dedicated
hardware and was cleaned with the review from Thierry Reding.

The first patch introduces a way to select to dmtimer clock source via a
clocks binding and a dedicated function wit the legacy fallback.

In order to prepare for the future form of the dmtimer (clksource or whatever),
and less rely on specific bindings the first patch introduces the PWM driver
with all the dmtimer calls into a platform data structure.

The structure is then filled in plat-omap and added as auxdata for the
ti,pwm-dmtimer-omap compatible nodes.

Suggested-by: Tony Lindgren 

RFC Thread : http://lkml.kernel.org/r/562505db.3010...@baylibre.com

Neil Armstrong (3):
  arm: plat-omap: dmtimer: Add clock source from DT
  pwm: Add PWM driver for OMAP using dual-mode timers
  arm: plat-omap: Add PWM dmtimer platform data quirks

 .../devicetree/bindings/pwm/pwm-omap-dmtimer.txt   |  18 ++
 arch/arm/mach-omap2/pdata-quirks.c |  23 ++
 arch/arm/plat-omap/dmtimer.c   |  31 +-
 drivers/pwm/Kconfig|   9 +
 drivers/pwm/Makefile   |   1 +
 drivers/pwm/pwm-omap-dmtimer.c | 322 +
 include/linux/platform_data/pwm_omap_dmtimer.h |  69 +
 7 files changed, 472 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
 create mode 100644 drivers/pwm/pwm-omap-dmtimer.c
 create mode 100644 include/linux/platform_data/pwm_omap_dmtimer.h

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] arm: plat-omap: Add PWM dmtimer platform data quirks

2015-11-02 Thread Neil Armstrong
In order to set the currently platform dependent dmtimer
functions pointers as platform data for the pwm-omap-dmtimer
platform driver, add it to plat-omap auxdata_lookup table.

Suggested-by: Tony Lindgren 
Signed-off-by: Neil Armstrong 
---
 arch/arm/mach-omap2/pdata-quirks.c | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/mach-omap2/pdata-quirks.c 
b/arch/arm/mach-omap2/pdata-quirks.c
index ea56397..647dec5 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -23,6 +23,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 

 #include 
 #include 
@@ -453,6 +455,24 @@ void omap_auxdata_legacy_init(struct device *dev)
dev->platform_data = &twl_gpio_auxdata;
 }

+/* Dual mode timer PWM callbacks platdata */
+#if IS_ENABLED(CONFIG_OMAP_DM_TIMER)
+struct pwm_omap_dmtimer_pdata pwm_dmtimer_pdata = {
+   .request_by_node = omap_dm_timer_request_by_node,
+   .free = omap_dm_timer_free,
+   .enable = omap_dm_timer_enable,
+   .disable = omap_dm_timer_disable,
+   .get_fclk = omap_dm_timer_get_fclk,
+   .start = omap_dm_timer_start,
+   .stop = omap_dm_timer_stop,
+   .set_load = omap_dm_timer_set_load,
+   .set_match = omap_dm_timer_set_match,
+   .set_pwm = omap_dm_timer_set_pwm,
+   .set_prescaler = omap_dm_timer_set_prescaler,
+   .write_counter = omap_dm_timer_write_counter,
+};
+#endif
+
 /*
  * Few boards still need auxdata populated before we populate
  * the dev entries in of_platform_populate().
@@ -506,6 +526,9 @@ static struct of_dev_auxdata omap_auxdata_lookup[] 
__initdata = {
OF_DEV_AUXDATA("ti,am4372-wkup-m3", 0x44d0, "44d0.wkup_m3",
   &wkup_m3_data),
 #endif
+#if IS_ENABLED(CONFIG_OMAP_DM_TIMER)
+   OF_DEV_AUXDATA("ti,omap-dmtimer-pwm", 0, NULL, &pwm_dmtimer_pdata),
+#endif
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
   &omap4_iommu_pdata),
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] pwm: Add PWM driver for OMAP using dual-mode timers

2015-11-02 Thread Neil Armstrong
Adds support for using a OMAP dual-mode timer with PWM capability
as a Linux PWM device. The driver controls the timer by using the
dmtimer API.

Add a platform_data structure for each pwm-omap-dmtimer nodes containing
the dmtimers functions in order to get driver not rely on platform
specific functions.

Cc: Grant Erickson 
Cc: NeilBrown 
Cc: Joachim Eastwood 
Suggested-by: Tony Lindgren 
Signed-off-by: Neil Armstrong 
---
 .../devicetree/bindings/pwm/pwm-omap-dmtimer.txt   |  18 ++
 drivers/pwm/Kconfig|   9 +
 drivers/pwm/Makefile   |   1 +
 drivers/pwm/pwm-omap-dmtimer.c | 322 +
 include/linux/platform_data/pwm_omap_dmtimer.h |  69 +
 5 files changed, 419 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
 create mode 100644 drivers/pwm/pwm-omap-dmtimer.c
 create mode 100644 include/linux/platform_data/pwm_omap_dmtimer.h

diff --git a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt 
b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
new file mode 100644
index 000..5befb53
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
@@ -0,0 +1,18 @@
+* OMAP PWM for dual-mode timers
+
+Required properties:
+- compatible: Shall contain "ti,omap-dmtimer-pwm".
+- ti,timers: phandle to PWM capable OMAP timer. See arm/omap/timer.txt for info
+  about these timers.
+- #pwm-cells: Should be 3. See pwm.txt in this directory for a description of
+  the cells format.
+
+Optional properties:
+- ti,prescaler: Should be a value between 0 and 7, see the timers datasheet
+
+Example:
+   pwm9: dmtimer-pwm@9 {
+   compatible = "ti,omap-dmtimer-pwm";
+   ti,timers = <&timer9>;
+   #pwm-cells = <3>;
+   };
diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index 062630a..2da60f8 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -240,6 +240,15 @@ config PWM_MXS
  To compile this driver as a module, choose M here: the module
  will be called pwm-mxs.

+config PWM_OMAP_DMTIMER
+   tristate "OMAP Dual-Mode Timer PWM support"
+   depends on OF && ARCH_OMAP && OMAP_DM_TIMER
+   help
+ Generic PWM framework driver for OMAP Dual-Mode Timer PWM output
+
+ To compile this driver as a module, choose M here: the module
+ will be called pwm-omap-dmtimer
+
 config PWM_PCA9685
tristate "NXP PCA9685 PWM driver"
depends on OF && I2C
diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile
index a0e00c0..af14774 100644
--- a/drivers/pwm/Makefile
+++ b/drivers/pwm/Makefile
@@ -21,6 +21,7 @@ obj-$(CONFIG_PWM_LPSS)+= pwm-lpss.o
 obj-$(CONFIG_PWM_LPSS_PCI) += pwm-lpss-pci.o
 obj-$(CONFIG_PWM_LPSS_PLATFORM)+= pwm-lpss-platform.o
 obj-$(CONFIG_PWM_MXS)  += pwm-mxs.o
+obj-$(CONFIG_PWM_OMAP_DMTIMER) += pwm-omap-dmtimer.o
 obj-$(CONFIG_PWM_PCA9685)  += pwm-pca9685.o
 obj-$(CONFIG_PWM_PUV3) += pwm-puv3.o
 obj-$(CONFIG_PWM_PXA)  += pwm-pxa.o
diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c
new file mode 100644
index 000..c1a4967
--- /dev/null
+++ b/drivers/pwm/pwm-omap-dmtimer.c
@@ -0,0 +1,322 @@
+/*
+ *Copyright (c) 2015 Neil Armstrong 
+ *Copyright (c) 2014 Joachim Eastwood 
+ *Copyright (c) 2012 NeilBrown 
+ *Heavily based on earlier code which is:
+ *Copyright (c) 2010 Grant Erickson 
+ *
+ *Also based on pwm-samsung.c
+ *
+ *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.
+ *
+ *Description:
+ *  This file is the core OMAP support for the generic, Linux
+ *  PWM driver / controller, using the OMAP's dual-mode timers.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define DM_TIMER_LOAD_MIN  0xFFFE
+
+struct pwm_omap_dmtimer_chip {
+   struct pwm_chip chip;
+   struct mutexmutex;
+   pwm_omap_dmtimer*dm_timer;
+   struct pwm_omap_dmtimer_pdata   *pdata;
+   struct platform_device  *dm_timer_pdev;
+};
+
+#define to_pwm_omap_dmtimer_chip(chip) container_of(chip,\
+   struct pwm_omap_dmtimer_chip, chip)
+
+static int pwm_omap_dmtimer_calc_value(unsigned long clk_rate, int ns)
+{
+   u64 c;
+
+   c = (u64)clk_rate * ns;
+   do_div(c, NSEC_PER_SEC);
+
+   return DM_TIMER_LOAD_MIN - c;
+}
+
+static void pwm_omap_dmtimer_start(struct pwm_omap_dmtimer_chip *omap)
+{
+   /*
+* According to OMAP 4 TRM section 22.2.4.10 the counter

Re: [PATCH 1/4] arm: omap2+: add missing HWMOD_NO_IDLEST in 81xx hwmod data

2015-10-24 Thread Neil Armstrong
Hi,

2015-10-24 3:21 GMT+02:00 Tony Lindgren :
>
> Hi,
>
> * Neil Armstrong  [151022 02:19]:
> > Add missing HWMOD_NO_IDLEST hwmod flag for entries no
> > having omap4 clkctrl values.
>
> Have you checked this is the case both in dm814x and dm816x TRM?
> Also the documentation may not be complete FYI, might be also
> worth checking the legacy TI kernel tree to be sure.
>
> Regards,
>
> Tony
>
> > Cc: Brian Hutchinson 
> > Signed-off-by: Neil Armstrong 
> > ---
> >  arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c 
> > b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
> > index b1288f5..6256052 100644
> > --- a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
> > +++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
> > @@ -144,6 +144,7 @@ static struct omap_hwmod dm81xx_l4_ls_hwmod = {
> >   .name   = "l4_ls",
> >   .clkdm_name = "alwon_l3s_clkdm",
> >   .class  = &l4_hwmod_class,
> > + .flags  = HWMOD_NO_IDLEST,
> >  };
In DM814x TRM, the CM_ALWON_L3_SLOW_CLKSTCTRL does not have IDLEST field.
Same in DM816x TRM.

> >
> >  /*
> > @@ -155,6 +156,7 @@ static struct omap_hwmod dm81xx_l4_hs_hwmod = {
> >   .name   = "l4_hs",
> >   .clkdm_name = "alwon_l3_med_clkdm",
> >   .class  = &l4_hwmod_class,
> > + .flags  = HWMOD_NO_IDLEST,
> >  };
In DM814x TRM, the CM_ALWON_L3_MED_CLKSTCTRL does not have IDLEST field.
Same in DM816x TRM.

> >
> >  /* L3 slow -> L4 ls peripheral interface running at 125MHz */
> > @@ -850,6 +852,7 @@ static struct omap_hwmod dm816x_emac0_hwmod = {
> >   .name   = "emac0",
> >   .clkdm_name = "alwon_ethernet_clkdm",
> >   .class  = &dm816x_emac_hwmod_class,
> > + .flags  = HWMOD_NO_IDLEST,
> >  };
In this particular case, the IDLEST is handled in the MDIO hwmod.

> >
> >  static struct omap_hwmod_ocp_if dm81xx_l4_hs__emac0 = {
> > --
> > 1.9.1

I'll check the TI tree to be sure...

Regards,
Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/4] arm: omap2+: complete dm816x hwmod and clkdev

2015-10-22 Thread Neil Armstrong
In order to fix support for the dm816x platform, add missing bits in
the 81xx hwmod data.

The clk related patch adds the missing clkdev entries to fix all source
selection in the dmtimer driver.

The last patch adds hwmod support of the spinbox module.

Neil Armstrong (4):
  arm: omap2+: add missing HWMOD_NO_IDLEST in 81xx hwmod data
  clk: ti816x: Add missing dmtimer clkdev entries
  arm: plat-omap: add DT support for ti,dm816-timer
  arm: omap2+: Add hwmod spinbox support for dm816x

 arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 38 ++
 arch/arm/plat-omap/dmtimer.c   |  4 
 drivers/clk/ti/clk-816x.c  |  2 ++
 3 files changed, 44 insertions(+)

-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] arm: omap2+: add missing HWMOD_NO_IDLEST in 81xx hwmod data

2015-10-22 Thread Neil Armstrong
Add missing HWMOD_NO_IDLEST hwmod flag for entries no
having omap4 clkctrl values.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
index b1288f5..6256052 100644
--- a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
@@ -144,6 +144,7 @@ static struct omap_hwmod dm81xx_l4_ls_hwmod = {
.name   = "l4_ls",
.clkdm_name = "alwon_l3s_clkdm",
.class  = &l4_hwmod_class,
+   .flags  = HWMOD_NO_IDLEST,
 };

 /*
@@ -155,6 +156,7 @@ static struct omap_hwmod dm81xx_l4_hs_hwmod = {
.name   = "l4_hs",
.clkdm_name = "alwon_l3_med_clkdm",
.class  = &l4_hwmod_class,
+   .flags  = HWMOD_NO_IDLEST,
 };

 /* L3 slow -> L4 ls peripheral interface running at 125MHz */
@@ -850,6 +852,7 @@ static struct omap_hwmod dm816x_emac0_hwmod = {
.name   = "emac0",
.clkdm_name = "alwon_ethernet_clkdm",
.class  = &dm816x_emac_hwmod_class,
+   .flags  = HWMOD_NO_IDLEST,
 };

 static struct omap_hwmod_ocp_if dm81xx_l4_hs__emac0 = {
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] arm: plat-omap: add DT support for ti,dm816-timer

2015-10-22 Thread Neil Armstrong
Adds ti,dm816-timer to the dmtimer OF match table.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/plat-omap/dmtimer.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 8ca94d3..28a6550 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -943,6 +943,10 @@ static const struct of_device_id omap_timer_match[] = {
.compatible = "ti,am335x-timer-1ms",
.data = &omap3plus_pdata,
},
+   {
+   .compatible = "ti,dm816-timer",
+   .data = &omap3plus_pdata,
+   },
{},
 };
 MODULE_DEVICE_TABLE(of, omap_timer_match);
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] clk: ti816x: Add missing dmtimer clkdev entries

2015-10-22 Thread Neil Armstrong
Add missing clkdev dmtimer related entries for dm816x.
32Khz and ext sources were missing.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 drivers/clk/ti/clk-816x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/ti/clk-816x.c b/drivers/clk/ti/clk-816x.c
index 1dfad0c..2a5d84f 100644
--- a/drivers/clk/ti/clk-816x.c
+++ b/drivers/clk/ti/clk-816x.c
@@ -20,6 +20,8 @@ static struct ti_dt_clk dm816x_clks[] = {
DT_CLK(NULL, "sys_clkin", "sys_clkin_ck"),
DT_CLK(NULL, "timer_sys_ck", "sys_clkin_ck"),
DT_CLK(NULL, "sys_32k_ck", "sys_32k_ck"),
+   DT_CLK(NULL, "timer_32k_ck", "sysclk18_ck"),
+   DT_CLK(NULL, "timer_ext_ck", "tclkin_ck"),
DT_CLK(NULL, "mpu_ck", "mpu_ck"),
DT_CLK(NULL, "timer1_fck", "timer1_fck"),
DT_CLK(NULL, "timer2_fck", "timer2_fck"),
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] arm: omap2+: Add hwmod spinbox support for dm816x

2015-10-22 Thread Neil Armstrong
Add dm81xx hwmod data entries for dm816x spinbox support.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 35 ++
 1 file changed, 35 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
index 6256052..275b16c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
@@ -1036,6 +1036,40 @@ static struct omap_hwmod_ocp_if dm81xx_l4_ls__mailbox = {
.user   = OCP_USER_MPU,
 };

+static struct omap_hwmod_class_sysconfig dm81xx_spinbox_sysc = {
+   .rev_offs   = 0x000,
+   .sysc_offs  = 0x010,
+   .syss_offs  = 0x014,
+   .sysc_flags = SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
+   SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE,
+   .idlemodes  = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class dm81xx_spinbox_hwmod_class = {
+   .name = "spinbox",
+   .sysc = &dm81xx_spinbox_sysc,
+};
+
+static struct omap_hwmod dm81xx_spinbox_hwmod = {
+   .name   = "spinbox",
+   .clkdm_name = "alwon_l3s_clkdm",
+   .class  = &dm81xx_spinbox_hwmod_class,
+   .main_clk   = "sysclk6_ck",
+   .prcm   = {
+   .omap4 = {
+   .clkctrl_offs = DM81XX_CM_ALWON_SPINBOX_CLKCTRL,
+   .modulemode = MODULEMODE_SWCTRL,
+   },
+   },
+};
+
+static struct omap_hwmod_ocp_if dm81xx_l4_ls__spinbox = {
+   .master = &dm81xx_l4_ls_hwmod,
+   .slave  = &dm81xx_spinbox_hwmod,
+   .user   = OCP_USER_MPU,
+};
+
 static struct omap_hwmod_class dm81xx_tpcc_hwmod_class = {
.name   = "tpcc",
 };
@@ -1298,6 +1332,7 @@ static struct omap_hwmod_ocp_if *dm816x_hwmod_ocp_ifs[] 
__initdata = {
&dm816x_l4_ls__timer7,
&dm81xx_l4_ls__mcspi1,
&dm81xx_l4_ls__mailbox,
+   &dm81xx_l4_ls__spinbox,
&dm81xx_l4_hs__emac0,
&dm81xx_emac0__mdio,
&dm816x_l4_hs__emac1,
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/4] arm: dts: complete dm816x device tree

2015-10-22 Thread Neil Armstrong
In order to fix support for the dm816x platform, add missing bits in
the dm816x dtsi.

The last patch adds support for the omap4-hwspinlock.

Neil Armstrong (4):
  arm: dts: add dm816x missing #mbox-cells
  arm: dts: add dm816x missing spi DT dma handles
  arm: dts: add dm816x pwm property to timers
  arm: dts: Add omap4-hwspinlock support in dm816x

 arch/arm/boot/dts/dm816x.dtsi | 19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] arm: dts: add dm816x missing #mbox-cells

2015-10-22 Thread Neil Armstrong
Add missing #mbox-cells for dm816x mbox DT node.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/boot/dts/dm816x.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index 3c99cfa..a7a34e4 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -218,6 +218,7 @@
reg = <0x480c8000 0x2000>;
interrupts = <77>;
ti,hwmods = "mailbox";
+   #mbox-cells = <1>;
ti,mbox-num-users = <4>;
ti,mbox-num-fifos = <12>;
mbox_dsp: mbox_dsp {
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] arm: dts: Add omap4-hwspinlock support in dm816x

2015-10-22 Thread Neil Armstrong
Add dm816x DT entries for omap4-hwspinlock support as hwmod spinbox.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/boot/dts/dm816x.dtsi | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index 51ad4a9..f655ce1 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -227,6 +227,13 @@
};
};

+   spinbox: spinbox@480ca000 {
+   compatible = "ti,omap4-hwspinlock";
+   reg = <0x480ca000 0x2000>;
+   ti,hwmods = "spinbox";
+   #hwlock-cells = <1>;
+   };
+
mdio: mdio@4a100800 {
compatible = "ti,davinci_mdio";
#address-cells = <1>;
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] arm: dts: add dm816x missing spi DT dma handles

2015-10-22 Thread Neil Armstrong
Add the missing SPI controller DMA handler in the dm816x DT
node, only properties for the two channels on four were present.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/boot/dts/dm816x.dtsi | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index a7a34e4..eee636d 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -280,8 +280,11 @@
ti,spi-num-cs = <4>;
ti,hwmods = "mcspi1";
dmas = <&edma 16 &edma 17
-   &edma 18 &edma 19>;
-   dma-names = "tx0", "rx0", "tx1", "rx1";
+   &edma 18 &edma 19
+   &edma 20 &edma 21
+   &edma 22 &edma 23>;
+   dma-names = "tx0", "rx0", "tx1", "rx1",
+   "tx2", "rx2", "tx3", "rx3";
};

mmc1: mmc@4806 {
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] arm: dts: add dm816x pwm property to timers

2015-10-22 Thread Neil Armstrong
Adds ti,timer-pwm property to timers 4 to 7 to permit usage of their
PWM output fonctionnality via the dmtimer driver.

Cc: Brian Hutchinson 
Signed-off-by: Neil Armstrong 
---
 arch/arm/boot/dts/dm816x.dtsi | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index eee636d..51ad4a9 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -323,6 +323,7 @@
reg = <0x48044000 0x2000>;
interrupts = <92>;
ti,hwmods = "timer4";
+   ti,timer-pwm;
};

timer5: timer@48046000 {
@@ -330,6 +331,7 @@
reg = <0x48046000 0x2000>;
interrupts = <93>;
ti,hwmods = "timer5";
+   ti,timer-pwm;
};

timer6: timer@48048000 {
@@ -337,6 +339,7 @@
reg = <0x48048000 0x2000>;
interrupts = <94>;
ti,hwmods = "timer6";
+   ti,timer-pwm;
};

timer7: timer@4804a000 {
@@ -344,6 +347,7 @@
reg = <0x4804a000 0x2000>;
interrupts = <95>;
ti,hwmods = "timer7";
+   ti,timer-pwm;
};

uart1: uart@4802 {
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH v2 3/3] arm: plat-omap: Add PWM dmtimer platform data quirks

2015-10-19 Thread Neil Armstrong
In order to set the currently platform dependent dmtimer
functions pointers as platform data for the pwm-omap-dmtimer
platform driver, add it to plat-omap auxdata_lookup table.

Suggested-by: Tony Lindgren 
Signed-off-by: Neil Armstrong 
---
 arch/arm/mach-omap2/pdata-quirks.c | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/mach-omap2/pdata-quirks.c 
b/arch/arm/mach-omap2/pdata-quirks.c
index ea56397..647dec5 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -23,6 +23,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 

 #include 
 #include 
@@ -453,6 +455,24 @@ void omap_auxdata_legacy_init(struct device *dev)
dev->platform_data = &twl_gpio_auxdata;
 }

+/* Dual mode timer PWM callbacks platdata */
+#if IS_ENABLED(CONFIG_OMAP_DM_TIMER)
+struct pwm_omap_dmtimer_pdata pwm_dmtimer_pdata = {
+   .request_by_node = omap_dm_timer_request_by_node,
+   .free = omap_dm_timer_free,
+   .enable = omap_dm_timer_enable,
+   .disable = omap_dm_timer_disable,
+   .get_fclk = omap_dm_timer_get_fclk,
+   .start = omap_dm_timer_start,
+   .stop = omap_dm_timer_stop,
+   .set_load = omap_dm_timer_set_load,
+   .set_match = omap_dm_timer_set_match,
+   .set_pwm = omap_dm_timer_set_pwm,
+   .set_prescaler = omap_dm_timer_set_prescaler,
+   .write_counter = omap_dm_timer_write_counter,
+};
+#endif
+
 /*
  * Few boards still need auxdata populated before we populate
  * the dev entries in of_platform_populate().
@@ -506,6 +526,9 @@ static struct of_dev_auxdata omap_auxdata_lookup[] 
__initdata = {
OF_DEV_AUXDATA("ti,am4372-wkup-m3", 0x44d0, "44d0.wkup_m3",
   &wkup_m3_data),
 #endif
+#if IS_ENABLED(CONFIG_OMAP_DM_TIMER)
+   OF_DEV_AUXDATA("ti,omap-dmtimer-pwm", 0, NULL, &pwm_dmtimer_pdata),
+#endif
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
   &omap4_iommu_pdata),
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH v2 0/3] pwm: omap: Add PWM support using dual-mode timers

2015-10-19 Thread Neil Armstrong
This patch is based on an earlier patch by NeilBrown which is based on
a older patch from Grant Erickson which provided PWM devices using
the 'legacy' interface.

The pwm driver was renamed to not be confused with the OMAP4 PWM dedicated
hardware and was cleaned with the review from Thierry Reding.

The first patch introduces a way to select to dmtimer clock source via a
clocks binding and a dedicated function wit the legacy fallback.

In order to prepare for the future form of the dmtimer (clksource or whatever),
and less rely on specific bindings the first patch introduces the PWM driver
with all the dmtimer calls into a platform data structure.

The structure is then filled in plat-omap and added as auxdata for the
ti,pwm-dmtimer-omap compatible nodes.

Suggested-by: Tony Lindgren 

v2: fix dmtimer of clock handling, fix binding doc example

Neil Armstrong (3):
  arm: plat-omap: dmtimer: Add clock source from DT
  pwm: Add PWM driver for OMAP using dual-mode timers
  arm: plat-omap: Add PWM dmtimer platform data quirks

 .../devicetree/bindings/pwm/pwm-omap-dmtimer.txt   |  18 ++
 arch/arm/mach-omap2/pdata-quirks.c |  23 ++
 arch/arm/plat-omap/dmtimer.c   |  31 +-
 drivers/pwm/Kconfig|   9 +
 drivers/pwm/Makefile   |   1 +
 drivers/pwm/pwm-omap-dmtimer.c | 322 +
 include/linux/platform_data/pwm_omap_dmtimer.h |  69 +
 7 files changed, 472 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
 create mode 100644 drivers/pwm/pwm-omap-dmtimer.c
 create mode 100644 include/linux/platform_data/pwm_omap_dmtimer.h

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH v2 2/3] pwm: Add PWM driver for OMAP using dual-mode timers

2015-10-19 Thread Neil Armstrong
Adds support for using a OMAP dual-mode timer with PWM capability
as a Linux PWM device. The driver controls the timer by using the
dmtimer API.

Add a platform_data structure for each pwm-omap-dmtimer nodes containing
the dmtimers functions in order to get driver not rely on platform
specific functions.

Cc: Grant Erickson 
Cc: NeilBrown 
Cc: Joachim Eastwood 
Suggested-by: Tony Lindgren 
Signed-off-by: Neil Armstrong 
---
 .../devicetree/bindings/pwm/pwm-omap-dmtimer.txt   |  18 ++
 drivers/pwm/Kconfig|   9 +
 drivers/pwm/Makefile   |   1 +
 drivers/pwm/pwm-omap-dmtimer.c | 322 +
 include/linux/platform_data/pwm_omap_dmtimer.h |  69 +
 5 files changed, 419 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
 create mode 100644 drivers/pwm/pwm-omap-dmtimer.c
 create mode 100644 include/linux/platform_data/pwm_omap_dmtimer.h

diff --git a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt 
b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
new file mode 100644
index 000..5befb53
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
@@ -0,0 +1,18 @@
+* OMAP PWM for dual-mode timers
+
+Required properties:
+- compatible: Shall contain "ti,omap-dmtimer-pwm".
+- ti,timers: phandle to PWM capable OMAP timer. See arm/omap/timer.txt for info
+  about these timers.
+- #pwm-cells: Should be 3. See pwm.txt in this directory for a description of
+  the cells format.
+
+Optional properties:
+- ti,prescaler: Should be a value between 0 and 7, see the timers datasheet
+
+Example:
+   pwm9: dmtimer-pwm@9 {
+   compatible = "ti,omap-dmtimer-pwm";
+   ti,timers = <&timer9>;
+   #pwm-cells = <3>;
+   };
diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index 062630a..2da60f8 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -240,6 +240,15 @@ config PWM_MXS
  To compile this driver as a module, choose M here: the module
  will be called pwm-mxs.

+config PWM_OMAP_DMTIMER
+   tristate "OMAP Dual-Mode Timer PWM support"
+   depends on OF && ARCH_OMAP && OMAP_DM_TIMER
+   help
+ Generic PWM framework driver for OMAP Dual-Mode Timer PWM output
+
+ To compile this driver as a module, choose M here: the module
+ will be called pwm-omap-dmtimer
+
 config PWM_PCA9685
tristate "NXP PCA9685 PWM driver"
depends on OF && I2C
diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile
index a0e00c0..af14774 100644
--- a/drivers/pwm/Makefile
+++ b/drivers/pwm/Makefile
@@ -21,6 +21,7 @@ obj-$(CONFIG_PWM_LPSS)+= pwm-lpss.o
 obj-$(CONFIG_PWM_LPSS_PCI) += pwm-lpss-pci.o
 obj-$(CONFIG_PWM_LPSS_PLATFORM)+= pwm-lpss-platform.o
 obj-$(CONFIG_PWM_MXS)  += pwm-mxs.o
+obj-$(CONFIG_PWM_OMAP_DMTIMER) += pwm-omap-dmtimer.o
 obj-$(CONFIG_PWM_PCA9685)  += pwm-pca9685.o
 obj-$(CONFIG_PWM_PUV3) += pwm-puv3.o
 obj-$(CONFIG_PWM_PXA)  += pwm-pxa.o
diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c
new file mode 100644
index 000..c1a4967
--- /dev/null
+++ b/drivers/pwm/pwm-omap-dmtimer.c
@@ -0,0 +1,322 @@
+/*
+ *Copyright (c) 2015 Neil Armstrong 
+ *Copyright (c) 2014 Joachim Eastwood 
+ *Copyright (c) 2012 NeilBrown 
+ *Heavily based on earlier code which is:
+ *Copyright (c) 2010 Grant Erickson 
+ *
+ *Also based on pwm-samsung.c
+ *
+ *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.
+ *
+ *Description:
+ *  This file is the core OMAP support for the generic, Linux
+ *  PWM driver / controller, using the OMAP's dual-mode timers.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define DM_TIMER_LOAD_MIN  0xFFFE
+
+struct pwm_omap_dmtimer_chip {
+   struct pwm_chip chip;
+   struct mutexmutex;
+   pwm_omap_dmtimer*dm_timer;
+   struct pwm_omap_dmtimer_pdata   *pdata;
+   struct platform_device  *dm_timer_pdev;
+};
+
+#define to_pwm_omap_dmtimer_chip(chip) container_of(chip,\
+   struct pwm_omap_dmtimer_chip, chip)
+
+static int pwm_omap_dmtimer_calc_value(unsigned long clk_rate, int ns)
+{
+   u64 c;
+
+   c = (u64)clk_rate * ns;
+   do_div(c, NSEC_PER_SEC);
+
+   return DM_TIMER_LOAD_MIN - c;
+}
+
+static void pwm_omap_dmtimer_start(struct pwm_omap_dmtimer_chip *omap)
+{
+   /*
+* According to OMAP 4 TRM section 22.2.4.10 the counter

[RFC PATCH v2 1/3] arm: plat-omap: dmtimer: Add clock source from DT

2015-10-19 Thread Neil Armstrong
Add a function which sets the timer source from the clocks
binding on dm_timer_prepare call.

In case the clocks property is not valid, it falls back to
the set_source() with 32_KHZ clock as default.

Suggested-by: Tony Lindgren 
Signed-off-by: Neil Armstrong 
---
 arch/arm/plat-omap/dmtimer.c | 31 ++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 8ca94d3..7c7f260 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -137,6 +137,31 @@ static int omap_dm_timer_reset(struct omap_dm_timer *timer)
return 0;
 }

+static int omap_dm_timer_of_set_source(struct omap_dm_timer *timer)
+{
+   int ret;
+   struct clk *parent;
+
+   /*
+* FIXME: OMAP1 devices do not use the clock framework for dmtimers so
+* do not call clk_get() for these devices.
+*/
+   if (!timer->fclk)
+   return -ENODEV;
+
+   parent = clk_get(&timer->pdev->dev, NULL);
+   if (IS_ERR(parent))
+   return -ENODEV;
+
+   ret = clk_set_parent(timer->fclk, parent);
+   if (ret < 0)
+   pr_err("%s: failed to set parent\n", __func__);
+
+   clk_put(parent);
+
+   return ret;
+}
+
 static int omap_dm_timer_prepare(struct omap_dm_timer *timer)
 {
int rc;
@@ -166,7 +191,11 @@ static int omap_dm_timer_prepare(struct omap_dm_timer 
*timer)
__omap_dm_timer_enable_posted(timer);
omap_dm_timer_disable(timer);

-   return omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
+   rc = omap_dm_timer_of_set_source(timer);
+   if (rc == -ENODEV)
+   return omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
+
+   return rc;
 }

 static inline u32 omap_dm_timer_reserved_systimer(int id)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH 1/3] arm: plat-omap: dmtimer: Add clock source from DT

2015-10-19 Thread Neil Armstrong
Hi,

On 10/16/2015 05:40 PM, Felipe Balbi wrote:
>> +static int omap_dm_timer_of_set_source(struct omap_dm_timer *timer)
>> +{
>> +int ret;
>> +struct clk *parent;
>> +
>> +if (unlikely(!timer))
>> +return -EINVAL;
> 
> IMO, let this crash. If this happens we have bigger problems.
> 
>> +if (IS_ERR(timer->fclk))
>> +return -EINVAL;
> 
> We bail out if we can't get fclk, this check is unnecessary.

Sure, I will remove the checks.
This was also breaking OMAP1, fclk must be checked against NULL here to detect 
OMAP1 and return -ENODEV;

> 
>> +parent = clk_get(&timer->pdev->dev, NULL);
> 
> why NULL ? You could use something more descriptive, but no strong
> feelings.


Actually, I just wanted the "default" clock for this device, NULL will select 
the first OF clock found.
If we specify a name, we should also specify it in the DT as clock-names, is it 
desired ?
If you feel I should name it somehow... I don't want it to conflict all the 
HWMOD clk namings actually.

> 
>> +if (IS_ERR(parent))
>> +return -ENODEV;
>> +
>> +ret = clk_set_parent(timer->fclk, parent);
>> +if (ret < 0)
>> +pr_err("%s: failed to set parent\n", __func__);
>> +
>> +clk_put(parent);
>> +
>> +return ret;
>> +}
>> +
>>  static int omap_dm_timer_prepare(struct omap_dm_timer *timer)
>>  {
>> -int rc;
>> +int rc, ret;
> 
> doesn't seem like you need this extra 'ret' variable. Just use 'rc'.
> 
>> @@ -166,7 +190,11 @@ static int omap_dm_timer_prepare(struct omap_dm_timer 
>> *timer)
>>  __omap_dm_timer_enable_posted(timer);
>>  omap_dm_timer_disable(timer);
>>
>> -return omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
>> +ret = omap_dm_timer_of_set_source(timer);
>> +if (ret < 0 && ret == -ENODEV)
> 
> this < 0 check is pointless if you're going to check for equality to -ENODEV

Sure, I was certainly tired, this was a so stupid mistake...

Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH 3/3] arm: plat-omap: Add PWM dmtimer platforma data quirks

2015-10-16 Thread Neil Armstrong
In order to set the currently platform dependent dmtimer
functions pointers as platform data for the pwm-omap-dmtimer
platform driver, add it to plat-omap auxdata_lookup table.

Suggested-by: Tony Lindgren 
Signed-off-by: Neil Armstrong 
---
 arch/arm/mach-omap2/pdata-quirks.c | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/mach-omap2/pdata-quirks.c 
b/arch/arm/mach-omap2/pdata-quirks.c
index ea56397..647dec5 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -23,6 +23,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 

 #include 
 #include 
@@ -453,6 +455,24 @@ void omap_auxdata_legacy_init(struct device *dev)
dev->platform_data = &twl_gpio_auxdata;
 }

+/* Dual mode timer PWM callbacks platdata */
+#if IS_ENABLED(CONFIG_OMAP_DM_TIMER)
+struct pwm_omap_dmtimer_pdata pwm_dmtimer_pdata = {
+   .request_by_node = omap_dm_timer_request_by_node,
+   .free = omap_dm_timer_free,
+   .enable = omap_dm_timer_enable,
+   .disable = omap_dm_timer_disable,
+   .get_fclk = omap_dm_timer_get_fclk,
+   .start = omap_dm_timer_start,
+   .stop = omap_dm_timer_stop,
+   .set_load = omap_dm_timer_set_load,
+   .set_match = omap_dm_timer_set_match,
+   .set_pwm = omap_dm_timer_set_pwm,
+   .set_prescaler = omap_dm_timer_set_prescaler,
+   .write_counter = omap_dm_timer_write_counter,
+};
+#endif
+
 /*
  * Few boards still need auxdata populated before we populate
  * the dev entries in of_platform_populate().
@@ -506,6 +526,9 @@ static struct of_dev_auxdata omap_auxdata_lookup[] 
__initdata = {
OF_DEV_AUXDATA("ti,am4372-wkup-m3", 0x44d0, "44d0.wkup_m3",
   &wkup_m3_data),
 #endif
+#if IS_ENABLED(CONFIG_OMAP_DM_TIMER)
+   OF_DEV_AUXDATA("ti,omap-dmtimer-pwm", 0, NULL, &pwm_dmtimer_pdata),
+#endif
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
   &omap4_iommu_pdata),
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH 2/3] pwm: Add PWM driver for OMAP using dual-mode timers

2015-10-16 Thread Neil Armstrong
Adds support for using a OMAP dual-mode timer with PWM capability
as a Linux PWM device. The driver controls the timer by using the
dmtimer API.

Add a platform_data structure for each pwm-omap-dmtimer nodes containing
the dmtimers functions in order to get driver not rely on platform
specific functions.

Cc: Grant Erickson 
Cc: NeilBrown 
Cc: Joachim Eastwood 
Suggested-by: Tony Lindgren 
Signed-off-by: Neil Armstrong 
---
 .../devicetree/bindings/pwm/pwm-omap-dmtimer.txt   |  18 ++
 drivers/pwm/Kconfig|   9 +
 drivers/pwm/Makefile   |   1 +
 drivers/pwm/pwm-omap-dmtimer.c | 322 +
 include/linux/platform_data/pwm_omap_dmtimer.h |  69 +
 5 files changed, 419 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
 create mode 100644 drivers/pwm/pwm-omap-dmtimer.c
 create mode 100644 include/linux/platform_data/pwm_omap_dmtimer.h

diff --git a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt 
b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
new file mode 100644
index 000..7f27606
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
@@ -0,0 +1,18 @@
+* OMAP PWM for dual-mode timers
+
+Required properties:
+- compatible: Shall contain "ti,omap-dmtimer-pwm".
+- ti,timers: phandle to PWM capable OMAP timer. See arm/omap/timer.txt for info
+  about these timers.
+- #pwm-cells: Should be 3. See pwm.txt in this directory for a description of
+  the cells format.
+
+Optiomal properties:
+- ti,prescaler: Should be a value between 0 and 7, see the timers datasheet
+
+Example:
+   pwm: omap-pwm {
+   compatible = "ti,omap-pwm";
+   ti,timers = <&timer9>;
+   #pwm-cells = <3>;
+   };
diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index 062630a..2da60f8 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -240,6 +240,15 @@ config PWM_MXS
  To compile this driver as a module, choose M here: the module
  will be called pwm-mxs.

+config PWM_OMAP_DMTIMER
+   tristate "OMAP Dual-Mode Timer PWM support"
+   depends on OF && ARCH_OMAP && OMAP_DM_TIMER
+   help
+ Generic PWM framework driver for OMAP Dual-Mode Timer PWM output
+
+ To compile this driver as a module, choose M here: the module
+ will be called pwm-omap-dmtimer
+
 config PWM_PCA9685
tristate "NXP PCA9685 PWM driver"
depends on OF && I2C
diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile
index a0e00c0..af14774 100644
--- a/drivers/pwm/Makefile
+++ b/drivers/pwm/Makefile
@@ -21,6 +21,7 @@ obj-$(CONFIG_PWM_LPSS)+= pwm-lpss.o
 obj-$(CONFIG_PWM_LPSS_PCI) += pwm-lpss-pci.o
 obj-$(CONFIG_PWM_LPSS_PLATFORM)+= pwm-lpss-platform.o
 obj-$(CONFIG_PWM_MXS)  += pwm-mxs.o
+obj-$(CONFIG_PWM_OMAP_DMTIMER) += pwm-omap-dmtimer.o
 obj-$(CONFIG_PWM_PCA9685)  += pwm-pca9685.o
 obj-$(CONFIG_PWM_PUV3) += pwm-puv3.o
 obj-$(CONFIG_PWM_PXA)  += pwm-pxa.o
diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c
new file mode 100644
index 000..c1a4967
--- /dev/null
+++ b/drivers/pwm/pwm-omap-dmtimer.c
@@ -0,0 +1,322 @@
+/*
+ *Copyright (c) 2015 Neil Armstrong 
+ *Copyright (c) 2014 Joachim Eastwood 
+ *Copyright (c) 2012 NeilBrown 
+ *Heavily based on earlier code which is:
+ *Copyright (c) 2010 Grant Erickson 
+ *
+ *Also based on pwm-samsung.c
+ *
+ *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.
+ *
+ *Description:
+ *  This file is the core OMAP support for the generic, Linux
+ *  PWM driver / controller, using the OMAP's dual-mode timers.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define DM_TIMER_LOAD_MIN  0xFFFE
+
+struct pwm_omap_dmtimer_chip {
+   struct pwm_chip chip;
+   struct mutexmutex;
+   pwm_omap_dmtimer*dm_timer;
+   struct pwm_omap_dmtimer_pdata   *pdata;
+   struct platform_device  *dm_timer_pdev;
+};
+
+#define to_pwm_omap_dmtimer_chip(chip) container_of(chip,\
+   struct pwm_omap_dmtimer_chip, chip)
+
+static int pwm_omap_dmtimer_calc_value(unsigned long clk_rate, int ns)
+{
+   u64 c;
+
+   c = (u64)clk_rate * ns;
+   do_div(c, NSEC_PER_SEC);
+
+   return DM_TIMER_LOAD_MIN - c;
+}
+
+static void pwm_omap_dmtimer_start(struct pwm_omap_dmtimer_chip *omap)
+{
+   /*
+* According to OMAP 4 TRM section 22.2.4.10 the counter should be
+* st

[RFC PATCH 1/3] arm: plat-omap: dmtimer: Add clock source from DT

2015-10-16 Thread Neil Armstrong
Add a function which sets the timer source from the clocks
binding on dm_timer_prepare call.

In case the clocks property is not valid, it falls back to
the set_source() with 32_KHZ clock as default.

Suggested-by: Tony Lindgren 
Signed-off-by: Neil Armstrong 
---
 arch/arm/plat-omap/dmtimer.c | 32 ++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 8ca94d3..5e8aece 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -137,9 +137,33 @@ static int omap_dm_timer_reset(struct omap_dm_timer *timer)
return 0;
 }

+static int omap_dm_timer_of_set_source(struct omap_dm_timer *timer)
+{
+   int ret;
+   struct clk *parent;
+
+   if (unlikely(!timer))
+   return -EINVAL;
+
+   if (IS_ERR(timer->fclk))
+   return -EINVAL;
+
+   parent = clk_get(&timer->pdev->dev, NULL);
+   if (IS_ERR(parent))
+   return -ENODEV;
+
+   ret = clk_set_parent(timer->fclk, parent);
+   if (ret < 0)
+   pr_err("%s: failed to set parent\n", __func__);
+
+   clk_put(parent);
+
+   return ret;
+}
+
 static int omap_dm_timer_prepare(struct omap_dm_timer *timer)
 {
-   int rc;
+   int rc, ret;

/*
 * FIXME: OMAP1 devices do not use the clock framework for dmtimers so
@@ -166,7 +190,11 @@ static int omap_dm_timer_prepare(struct omap_dm_timer 
*timer)
__omap_dm_timer_enable_posted(timer);
omap_dm_timer_disable(timer);

-   return omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
+   ret = omap_dm_timer_of_set_source(timer);
+   if (ret < 0 && ret == -ENODEV)
+   return omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
+
+   return ret;
 }

 static inline u32 omap_dm_timer_reserved_systimer(int id)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH 0/3] pwm: omap: Add PWM support using dual-mode timers

2015-10-16 Thread Neil Armstrong
This patch is based on an earlier patch by NeilBrown which is based on
a older patch from Grant Erickson which provided PWM devices using
the 'legacy' interface.

The pwm driver was renamed to not be confused with the OMAP4 PWM dedicated
hardware and was cleaned with the review from Thierry Reding.

The first patch introduces a way to select to dmtimer clock source via a
clocks binding and a dedicated function wit the legacy fallback.

In order to prepare for the future form of the dmtimer (clksource or whatever)
the first patch introduces the PWM driver with all the dmtimer calls into a
platform data structure.

The structure is then filled in plat-omap and added as auxdata for the
ti,pwm-dmtimer-omap compatible nodes.

Cc: Grant Erickson 
Cc: NeilBrown 
Cc: Joachim Eastwood 
Suggested-by: Tony Lindgren 

Neil Armstrong (3):
  arm: plat-omap: dmtimer: Add clock source from DT
  pwm: Add PWM driver for OMAP using dual-mode timers
  arm: plat-omap: Add PWM dmtimer platforma data quirks

 .../devicetree/bindings/pwm/pwm-omap-dmtimer.txt   |  18 ++
 arch/arm/mach-omap2/pdata-quirks.c |  23 ++
 arch/arm/plat-omap/dmtimer.c   |  32 +-
 drivers/pwm/Kconfig|   9 +
 drivers/pwm/Makefile   |   1 +
 drivers/pwm/pwm-omap-dmtimer.c | 322 +
 include/linux/platform_data/pwm_omap_dmtimer.h |  69 +
 7 files changed, 472 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
 create mode 100644 drivers/pwm/pwm-omap-dmtimer.c
 create mode 100644 include/linux/platform_data/pwm_omap_dmtimer.h

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html