All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Mike Dunn <mikedunn@newsguy.com>,
	linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
	Rob Herring <rob.herring@calxeda.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Haojian Zhuang <haojian.zhuang@linaro.org>,
	Grant Likely <grant.likely@linaro.org>,
	Robert Jarzmik <robert.jarzmik@free.fr>
Subject: Re: [PATCH] pwm: pxa: add device tree support to pwm driver
Date: Wed, 4 Sep 2013 00:20:54 +0200	[thread overview]
Message-ID: <201309040020.55029.marex@denx.de> (raw)
In-Reply-To: <1378236233-15637-1-git-send-email-mikedunn@newsguy.com>

Dear Mike Dunn,

> This patch adds device tree support to the pxa's pwm driver.  Only an OF
> match table is added; nothing needs to be extracted from the device tree
> node.  The existing platform_device id table is reused for the match table
> data.
> 
> Tested on a Palm Treo 680 (both platform data and DT cases).
> 
> Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
> ---
> 
> I don't have data sheets handy for the newer Marvell pxa's (and I'm
> confused about the presence of a pwm unit on pxa25x), so only pxa27x.dtsi
> was updated. Thanks for looking!
> 
>  arch/arm/boot/dts/pxa27x.dtsi | 12 ++++++++++++
>  drivers/pwm/pwm-pxa.c         | 31 +++++++++++++++++++++++++++++++
>  2 files changed, 43 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi
> index d7c5d72..4031dce 100644
> --- a/arch/arm/boot/dts/pxa27x.dtsi
> +++ b/arch/arm/boot/dts/pxa27x.dtsi
> @@ -10,5 +10,17 @@
>  			marvell,intc-priority;
>  			marvell,intc-nr-irqs = <34>;
>  		};
> +
> +		pwm0: pwm@40b00000 {
> +			compatible = "marvell,pxa27x-pwm";
> +			reg = <0x40b00000 0x100000>;
> +			#pwm-cells = <2>;
> +		};
> +
> +		pwm1: pwm@40c00000 {
> +			compatible = "marvell,pxa27x-pwm";
> +			reg = <0x40c00000 0x100000>;
> +			#pwm-cells = <2>;
> +		};
>  	};
>  };
> diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
> index a4d2164..be5f914 100644
> --- a/drivers/pwm/pwm-pxa.c
> +++ b/drivers/pwm/pwm-pxa.c
> @@ -19,6 +19,7 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/pwm.h>
> +#include <linux/of_device.h>
> 
>  #include <asm/div64.h>
> 
> @@ -124,6 +125,30 @@ static struct pwm_ops pxa_pwm_ops = {
>  	.owner = THIS_MODULE,
>  };
> 
> +#ifdef CONFIG_OF
> +/* use the platform_device id table for OF match table data */
> +static struct of_device_id pwm_of_match[] = {
> +	{ .compatible = "marvell,pxa25x-pwm", .data = &pwm_id_table[0] },
> +	{ .compatible = "marvell,pxa27x-pwm", .data = &pwm_id_table[1] },
> +	{ .compatible = "marvell,pxa168-pwm", .data = &pwm_id_table[2] },
> +	{ .compatible = "marvell,pxa910-pwm", .data = &pwm_id_table[3] },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, pwm_of_match);

Are PXA2xx and PXA3xx PWM impleemntations not all the same ? If so, why not just 
stick with pxa25x-pwm only for all of the CPUs (aka. the lowest CPU model). Then 
the table would have but a single entry.

[...]

Best regards,
Marek Vasut

WARNING: multiple messages have this Message-ID (diff)
From: marex@denx.de (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pwm: pxa: add device tree support to pwm driver
Date: Wed, 4 Sep 2013 00:20:54 +0200	[thread overview]
Message-ID: <201309040020.55029.marex@denx.de> (raw)
In-Reply-To: <1378236233-15637-1-git-send-email-mikedunn@newsguy.com>

Dear Mike Dunn,

> This patch adds device tree support to the pxa's pwm driver.  Only an OF
> match table is added; nothing needs to be extracted from the device tree
> node.  The existing platform_device id table is reused for the match table
> data.
> 
> Tested on a Palm Treo 680 (both platform data and DT cases).
> 
> Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
> ---
> 
> I don't have data sheets handy for the newer Marvell pxa's (and I'm
> confused about the presence of a pwm unit on pxa25x), so only pxa27x.dtsi
> was updated. Thanks for looking!
> 
>  arch/arm/boot/dts/pxa27x.dtsi | 12 ++++++++++++
>  drivers/pwm/pwm-pxa.c         | 31 +++++++++++++++++++++++++++++++
>  2 files changed, 43 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi
> index d7c5d72..4031dce 100644
> --- a/arch/arm/boot/dts/pxa27x.dtsi
> +++ b/arch/arm/boot/dts/pxa27x.dtsi
> @@ -10,5 +10,17 @@
>  			marvell,intc-priority;
>  			marvell,intc-nr-irqs = <34>;
>  		};
> +
> +		pwm0: pwm at 40b00000 {
> +			compatible = "marvell,pxa27x-pwm";
> +			reg = <0x40b00000 0x100000>;
> +			#pwm-cells = <2>;
> +		};
> +
> +		pwm1: pwm at 40c00000 {
> +			compatible = "marvell,pxa27x-pwm";
> +			reg = <0x40c00000 0x100000>;
> +			#pwm-cells = <2>;
> +		};
>  	};
>  };
> diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
> index a4d2164..be5f914 100644
> --- a/drivers/pwm/pwm-pxa.c
> +++ b/drivers/pwm/pwm-pxa.c
> @@ -19,6 +19,7 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/pwm.h>
> +#include <linux/of_device.h>
> 
>  #include <asm/div64.h>
> 
> @@ -124,6 +125,30 @@ static struct pwm_ops pxa_pwm_ops = {
>  	.owner = THIS_MODULE,
>  };
> 
> +#ifdef CONFIG_OF
> +/* use the platform_device id table for OF match table data */
> +static struct of_device_id pwm_of_match[] = {
> +	{ .compatible = "marvell,pxa25x-pwm", .data = &pwm_id_table[0] },
> +	{ .compatible = "marvell,pxa27x-pwm", .data = &pwm_id_table[1] },
> +	{ .compatible = "marvell,pxa168-pwm", .data = &pwm_id_table[2] },
> +	{ .compatible = "marvell,pxa910-pwm", .data = &pwm_id_table[3] },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, pwm_of_match);

Are PXA2xx and PXA3xx PWM impleemntations not all the same ? If so, why not just 
stick with pxa25x-pwm only for all of the CPUs (aka. the lowest CPU model). Then 
the table would have but a single entry.

[...]

Best regards,
Marek Vasut

WARNING: multiple messages have this Message-ID (diff)
From: Marek Vasut <marex@denx.de>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-pwm@vger.kernel.org, Mike Dunn <mikedunn@newsguy.com>,
	devicetree@vger.kernel.org, Rob Herring <rob.herring@calxeda.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Haojian Zhuang <haojian.zhuang@linaro.org>,
	Grant Likely <grant.likely@linaro.org>,
	Robert Jarzmik <robert.jarzmik@free.fr>
Subject: Re: [PATCH] pwm: pxa: add device tree support to pwm driver
Date: Wed, 4 Sep 2013 00:20:54 +0200	[thread overview]
Message-ID: <201309040020.55029.marex@denx.de> (raw)
In-Reply-To: <1378236233-15637-1-git-send-email-mikedunn@newsguy.com>

Dear Mike Dunn,

> This patch adds device tree support to the pxa's pwm driver.  Only an OF
> match table is added; nothing needs to be extracted from the device tree
> node.  The existing platform_device id table is reused for the match table
> data.
> 
> Tested on a Palm Treo 680 (both platform data and DT cases).
> 
> Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
> ---
> 
> I don't have data sheets handy for the newer Marvell pxa's (and I'm
> confused about the presence of a pwm unit on pxa25x), so only pxa27x.dtsi
> was updated. Thanks for looking!
> 
>  arch/arm/boot/dts/pxa27x.dtsi | 12 ++++++++++++
>  drivers/pwm/pwm-pxa.c         | 31 +++++++++++++++++++++++++++++++
>  2 files changed, 43 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi
> index d7c5d72..4031dce 100644
> --- a/arch/arm/boot/dts/pxa27x.dtsi
> +++ b/arch/arm/boot/dts/pxa27x.dtsi
> @@ -10,5 +10,17 @@
>  			marvell,intc-priority;
>  			marvell,intc-nr-irqs = <34>;
>  		};
> +
> +		pwm0: pwm@40b00000 {
> +			compatible = "marvell,pxa27x-pwm";
> +			reg = <0x40b00000 0x100000>;
> +			#pwm-cells = <2>;
> +		};
> +
> +		pwm1: pwm@40c00000 {
> +			compatible = "marvell,pxa27x-pwm";
> +			reg = <0x40c00000 0x100000>;
> +			#pwm-cells = <2>;
> +		};
>  	};
>  };
> diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
> index a4d2164..be5f914 100644
> --- a/drivers/pwm/pwm-pxa.c
> +++ b/drivers/pwm/pwm-pxa.c
> @@ -19,6 +19,7 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/pwm.h>
> +#include <linux/of_device.h>
> 
>  #include <asm/div64.h>
> 
> @@ -124,6 +125,30 @@ static struct pwm_ops pxa_pwm_ops = {
>  	.owner = THIS_MODULE,
>  };
> 
> +#ifdef CONFIG_OF
> +/* use the platform_device id table for OF match table data */
> +static struct of_device_id pwm_of_match[] = {
> +	{ .compatible = "marvell,pxa25x-pwm", .data = &pwm_id_table[0] },
> +	{ .compatible = "marvell,pxa27x-pwm", .data = &pwm_id_table[1] },
> +	{ .compatible = "marvell,pxa168-pwm", .data = &pwm_id_table[2] },
> +	{ .compatible = "marvell,pxa910-pwm", .data = &pwm_id_table[3] },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, pwm_of_match);

Are PXA2xx and PXA3xx PWM impleemntations not all the same ? If so, why not just 
stick with pxa25x-pwm only for all of the CPUs (aka. the lowest CPU model). Then 
the table would have but a single entry.

[...]

Best regards,
Marek Vasut

  reply	other threads:[~2013-09-03 22:20 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 19:23 [PATCH] pwm: pxa: add device tree support to pwm driver Mike Dunn
2013-09-03 19:23 ` Mike Dunn
2013-09-03 19:23 ` Mike Dunn
2013-09-03 22:20 ` Marek Vasut [this message]
2013-09-03 22:20   ` Marek Vasut
2013-09-03 22:20   ` Marek Vasut
2013-09-04 14:23   ` Mike Dunn
2013-09-04 14:23     ` Mike Dunn
2013-09-04 14:23     ` Mike Dunn
2013-09-04 14:35     ` Marek Vasut
2013-09-04 14:35       ` Marek Vasut
2013-09-04 14:35       ` Marek Vasut
2013-09-04 15:41       ` Mike Dunn
2013-09-04 15:41         ` Mike Dunn
2013-09-04 15:41         ` Mike Dunn
2013-09-04 22:11         ` Marek Vasut
2013-09-04 22:11           ` Marek Vasut
2013-09-04 22:11           ` Marek Vasut
2013-09-05 15:24           ` Mike Dunn
2013-09-05 15:24             ` Mike Dunn
2013-09-05 15:24             ` Mike Dunn
2013-09-05 15:34             ` Marek Vasut
2013-09-05 15:34               ` Marek Vasut
2013-09-05 15:34               ` Marek Vasut
2013-09-05 16:07               ` Mike Dunn
2013-09-05 16:07                 ` Mike Dunn
2013-09-05 16:07                 ` Mike Dunn
2013-09-04 14:38     ` Sergei Shtylyov
2013-09-04 14:38       ` Sergei Shtylyov
2013-09-04 15:44       ` Mike Dunn
2013-09-04 15:44         ` Mike Dunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201309040020.55029.marex@denx.de \
    --to=marex@denx.de \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=haojian.zhuang@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=mikedunn@newsguy.com \
    --cc=rob.herring@calxeda.com \
    --cc=robert.jarzmik@free.fr \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.