linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/1] mx51: add support for pwm
@ 2011-01-07  9:06 Arnaud Patard (Rtp)
  2011-01-07  9:30 ` Jason Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaud Patard (Rtp) @ 2011-01-07  9:06 UTC (permalink / raw)
  To: linux-arm-kernel

An embedded and charset-unspecified text was scrubbed...
Name: mx51_pwm.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110107/2599c43b/attachment.ksh>

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

* [patch 1/1] mx51: add support for pwm
  2011-01-07  9:06 [patch 1/1] mx51: add support for pwm Arnaud Patard (Rtp)
@ 2011-01-07  9:30 ` Jason Liu
  2011-01-07  9:58   ` Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Liu @ 2011-01-07  9:30 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, Arnaud,

2011/1/7 Arnaud Patard <arnaud.patard@rtp-net.org>:
> This patch is adding support for pwm1 and pwm2 devices found
> on mx51.
> [ this patch has been tested with pwm-backlight driver ]
>
> Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
> Index: linux-2.6-submit/arch/arm/mach-mx5/clock-mx51-mx53.c
> ===================================================================
> --- linux-2.6-submit.orig/arch/arm/mach-mx5/clock-mx51-mx53.c ? 2011-01-04 11:36:15.000000000 +0100
> +++ linux-2.6-submit/arch/arm/mach-mx5/clock-mx51-mx53.c ? ? ? ?2011-01-04 11:39:55.000000000 +0100
> @@ -1206,6 +1206,11 @@
> ?DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG9_OFFSET,
> ? ? ? ?NULL, ?NULL, &ipg_clk, &gpt_ipg_clk);
>
> +DEFINE_CLOCK(pwm1_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG6_OFFSET,
> + ? ? ? NULL, NULL, &ipg_clk, NULL);
> +DEFINE_CLOCK(pwm2_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG8_OFFSET,
> + ? ? ? NULL, NULL, &ipg_clk, NULL);
> +
> ?/* I2C */
> ?DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET,
> ? ? ? ?NULL, NULL, &ipg_clk, NULL);
> @@ -1298,6 +1303,8 @@
> ? ? ? ?_REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
> ? ? ? ?_REGISTER_CLOCK(NULL, "gpt", gpt_clk)
> ? ? ? ?_REGISTER_CLOCK("fec.0", NULL, fec_clk)
> + ? ? ? _REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk)
> + ? ? ? _REGISTER_CLOCK("mxc_pwm.1", "pwm", pwm2_clk)
> ? ? ? ?_REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
> ? ? ? ?_REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
> ? ? ? ?_REGISTER_CLOCK("imx-i2c.2", NULL, hsi2c_clk)
> Index: linux-2.6-submit/arch/arm/mach-mx5/devices.c
> ===================================================================
> --- linux-2.6-submit.orig/arch/arm/mach-mx5/devices.c ? 2011-01-04 11:11:43.000000000 +0100
> +++ linux-2.6-submit/arch/arm/mach-mx5/devices.c ? ? ? ?2011-01-04 11:39:55.000000000 +0100
> @@ -120,6 +120,44 @@
> ? ? ? ?},
> ?};
[...]
> +struct platform_device mxc_pwm2_device = {
> + ? ? ? .name = "mxc_pwm",
> + ? ? ? .id = 1,
> + ? ? ? .num_resources = ARRAY_SIZE(pwm2_resources),
> + ? ? ? .resource = pwm2_resources,
> +};
> +

Why not follow the arch/arm/plat-mxc/devices/platform-imx-xxx to add
devices support?
I saw that some devices was added in arch/arm/mach-mx5/devices.c, but
most are in
 arch/arm/plat-mxc/devices/xx, what's the rule for it when we add
device support?

[...]
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

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

* [patch 1/1] mx51: add support for pwm
  2011-01-07  9:30 ` Jason Liu
@ 2011-01-07  9:58   ` Uwe Kleine-König
  2011-01-07 16:55     ` Fabio Estevam
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2011-01-07  9:58 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Jason,

On Fri, Jan 07, 2011 at 05:30:28PM +0800, Jason Liu wrote:
> 2011/1/7 Arnaud Patard <arnaud.patard@rtp-net.org>:
> > This patch is adding support for pwm1 and pwm2 devices found
> > on mx51.
> > [ this patch has been tested with pwm-backlight driver ]
> >
> > Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
> > Index: linux-2.6-submit/arch/arm/mach-mx5/clock-mx51-mx53.c
> > ===================================================================
> > --- linux-2.6-submit.orig/arch/arm/mach-mx5/clock-mx51-mx53.c ? 2011-01-04 11:36:15.000000000 +0100
> > +++ linux-2.6-submit/arch/arm/mach-mx5/clock-mx51-mx53.c ? ? ? ?2011-01-04 11:39:55.000000000 +0100
> > @@ -1206,6 +1206,11 @@
> > ?DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG9_OFFSET,
> > ? ? ? ?NULL, ?NULL, &ipg_clk, &gpt_ipg_clk);
> >
> > +DEFINE_CLOCK(pwm1_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG6_OFFSET,
> > + ? ? ? NULL, NULL, &ipg_clk, NULL);
> > +DEFINE_CLOCK(pwm2_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG8_OFFSET,
> > + ? ? ? NULL, NULL, &ipg_clk, NULL);
> > +
> > ?/* I2C */
> > ?DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET,
> > ? ? ? ?NULL, NULL, &ipg_clk, NULL);
> > @@ -1298,6 +1303,8 @@
> > ? ? ? ?_REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
> > ? ? ? ?_REGISTER_CLOCK(NULL, "gpt", gpt_clk)
> > ? ? ? ?_REGISTER_CLOCK("fec.0", NULL, fec_clk)
> > + ? ? ? _REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk)
> > + ? ? ? _REGISTER_CLOCK("mxc_pwm.1", "pwm", pwm2_clk)
> > ? ? ? ?_REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
> > ? ? ? ?_REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
> > ? ? ? ?_REGISTER_CLOCK("imx-i2c.2", NULL, hsi2c_clk)
> > Index: linux-2.6-submit/arch/arm/mach-mx5/devices.c
> > ===================================================================
> > --- linux-2.6-submit.orig/arch/arm/mach-mx5/devices.c ? 2011-01-04 11:11:43.000000000 +0100
> > +++ linux-2.6-submit/arch/arm/mach-mx5/devices.c ? ? ? ?2011-01-04 11:39:55.000000000 +0100
> > @@ -120,6 +120,44 @@
> > ? ? ? ?},
> > ?};
> [...]
> > +struct platform_device mxc_pwm2_device = {
> > + ? ? ? .name = "mxc_pwm",
> > + ? ? ? .id = 1,
> > + ? ? ? .num_resources = ARRAY_SIZE(pwm2_resources),
> > + ? ? ? .resource = pwm2_resources,
> > +};
> > +
> 
> Why not follow the arch/arm/plat-mxc/devices/platform-imx-xxx to add
> devices support?
good question.  Note that arch/arm/plat-mxc/devices/platform-mxc_pwm.c
already exists in Sascha's tree.  (Maybe now even Linus'.)

> I saw that some devices was added in arch/arm/mach-mx5/devices.c, but
> most are in
>  arch/arm/plat-mxc/devices/xx, what's the rule for it when we add
> device support?
devices.c was used traditionally and isn't yet completely converted.
Mostly due to lack of time for such things.
So I'd say: for new things use the dynamic stuff in
arch/arm/plat-mxc/devices and if you're motivated help converting the
existing devices to it, too.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [patch 1/1] mx51: add support for pwm
  2011-01-07  9:58   ` Uwe Kleine-König
@ 2011-01-07 16:55     ` Fabio Estevam
  0 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2011-01-07 16:55 UTC (permalink / raw)
  To: linux-arm-kernel

Arnaud,

2011/1/7 Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>:
...
>> Why not follow the arch/arm/plat-mxc/devices/platform-imx-xxx to add
>> devices support?
> good question. ?Note that arch/arm/plat-mxc/devices/platform-mxc_pwm.c
> already exists in Sascha's tree. ?(Maybe now even Linus'.)

I have submitted the following patch for dynamically registering the
PWM on MX51:
http://www.spinics.net/lists/arm-kernel/msg105828.html

I got an ack from Uwe, so it should hit Sascha?s tree soon.

Regards,

Fabio Estevam

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

end of thread, other threads:[~2011-01-07 16:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-07  9:06 [patch 1/1] mx51: add support for pwm Arnaud Patard (Rtp)
2011-01-07  9:30 ` Jason Liu
2011-01-07  9:58   ` Uwe Kleine-König
2011-01-07 16:55     ` Fabio Estevam

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