linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch 2/2] mx51: add support for pwm
Date: Thu, 13 Jan 2011 14:26:23 +0100	[thread overview]
Message-ID: <20110113132623.GQ24920@pengutronix.de> (raw)
In-Reply-To: <20110113113007.690473432@rtp-net.org>

On Thu, Jan 13, 2011 at 12:26:40PM +0100, Arnaud Patard wrote:
> 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-12 16:51:29.000000000 +0100
> +++ linux-2.6-submit/arch/arm/mach-mx5/clock-mx51-mx53.c	2011-01-12 16:54:40.000000000 +0100
> @@ -1228,6 +1228,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);
> @@ -1320,6 +1325,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)
You really need "pwm"? I'd prefer NULL if that works, too.  (And if not,
please fix the driver :-)

Uwe
>  	_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/plat-mxc/pwm.c
> ===================================================================
> --- linux-2.6-submit.orig/arch/arm/plat-mxc/pwm.c	2011-01-12 16:48:33.000000000 +0100
> +++ linux-2.6-submit/arch/arm/plat-mxc/pwm.c	2011-01-12 16:54:40.000000000 +0100
> @@ -57,7 +57,7 @@
>  	if (pwm == NULL || period_ns == 0 || duty_ns > period_ns)
>  		return -EINVAL;
>  
> -	if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) {
> +	if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51()) {
>  		unsigned long long c;
>  		unsigned long period_cycles, duty_cycles, prescale;
>  		u32 cr;
Hmm, time to convert to platform-id?

Uwe

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

      reply	other threads:[~2011-01-13 13:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13 11:26 [patch 0/2] imx51 pwm support fixes Arnaud Patard (Rtp)
2011-01-13 11:26 ` [patch 1/2] Fix pwm-related build failure Arnaud Patard (Rtp)
2011-01-15 16:39   ` Sergei Shtylyov
2011-01-13 11:26 ` [patch 2/2] mx51: add support for pwm Arnaud Patard (Rtp)
2011-01-13 13:26   ` Uwe Kleine-König [this message]

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=20110113132623.GQ24920@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 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).