All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Ying <Ying.Liu@freescale.com>
To: "Lothar Waßmann" <LW@KARO-electronics.de>
Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org,
	thierry.reding@gmail.com, s.hauer@pengutronix.de,
	shawn.guo@freescale.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3] pwm: i.MX: Avoid sample FIFO overflow for i.MX PWM version2
Date: Mon, 19 May 2014 14:52:03 +0800	[thread overview]
Message-ID: <5379AA13.4000904@freescale.com> (raw)
In-Reply-To: <20140519075328.7f2ef0c5@ipc1.ka-ro>

Hi Lothar,

Thanks for your review.

On 05/19/2014 01:53 PM, Lothar Waßmann wrote:
> Hi,
> 
> Liu Ying wrote:
> [...]
>> @@ -30,6 +32,7 @@
>>  /* i.MX27, i.MX31, i.MX35 share the same PWM function block: */
>>  
>>  #define MX3_PWMCR                 0x00    /* PWM Control Register */
>> +#define MX3_PWMIR                 0x08    /* PWM Interrupt Register */
>>  #define MX3_PWMSAR                0x0C    /* PWM Sample Register */
>>  #define MX3_PWMPR                 0x10    /* PWM Period Register */
>>  #define MX3_PWMCR_PRESCALER(x)    (((x - 1) & 0xFFF) << 4)
>> @@ -38,7 +41,12 @@
>>  #define MX3_PWMCR_DBGEN			(1 << 22)
>>  #define MX3_PWMCR_CLKSRC_IPG_HIGH (2 << 16)
>>  #define MX3_PWMCR_CLKSRC_IPG      (1 << 16)
>> +#define MX3_PWMCR_SWR		  (1 << 3)
>>  #define MX3_PWMCR_EN              (1 << 0)
>> +#define MX3_PWMSR_ROV             (1 << 4)
>> +#define MX3_PWMIR_RIE             (1 << 1)
>> +
> You should decide whether to use tabs or spaces for indentation.
> And probably cleanup the indentation of the existing definitions to use
> all the same indentation style.

Ok, I will generate a separate patch to cleanup the indentation for
the existing register definitions of both i.MX PWMv1 and PWMv2.

> 
>> @@ -128,6 +160,13 @@ static int imx_pwm_config_v2(struct pwm_chip *chip,
>>  	else
>>  		period_cycles = 0;
>>  
>> +	if (!enable || duty_cycles == 0)
>> +		imx_pwm_software_reset_v2(chip);
>> +	else if (readl(imx->mmio_base + MX3_PWMSAR))
>> +		/* No rollover irq generated if duty peroid is zero. */
> typo: 'period'.

I will fix this.

> 
>> @@ -135,27 +174,55 @@ static int imx_pwm_config_v2(struct pwm_chip *chip,
>>  		MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN |
>>  		MX3_PWMCR_DBGEN | MX3_PWMCR_CLKSRC_IPG_HIGH;
>>  
>> -	if (test_bit(PWMF_ENABLED, &pwm->flags))
>> +	if (enable)
>>  		cr |= MX3_PWMCR_EN;
>>  
>>  	writel(cr, imx->mmio_base + MX3_PWMCR);
>>  
>> +	if (enable && duty_cycles)
>> +		/* No rollover irq generated if duty peroid is zero. */
> dto.

I will fix this.

> 
> 
> Lothar Waßmann
> 

-- 
Liu Ying

WARNING: multiple messages have this Message-ID (diff)
From: Ying.Liu@freescale.com (Liu Ying)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] pwm: i.MX: Avoid sample FIFO overflow for i.MX PWM version2
Date: Mon, 19 May 2014 14:52:03 +0800	[thread overview]
Message-ID: <5379AA13.4000904@freescale.com> (raw)
In-Reply-To: <20140519075328.7f2ef0c5@ipc1.ka-ro>

Hi Lothar,

Thanks for your review.

On 05/19/2014 01:53 PM, Lothar Wa?mann wrote:
> Hi,
> 
> Liu Ying wrote:
> [...]
>> @@ -30,6 +32,7 @@
>>  /* i.MX27, i.MX31, i.MX35 share the same PWM function block: */
>>  
>>  #define MX3_PWMCR                 0x00    /* PWM Control Register */
>> +#define MX3_PWMIR                 0x08    /* PWM Interrupt Register */
>>  #define MX3_PWMSAR                0x0C    /* PWM Sample Register */
>>  #define MX3_PWMPR                 0x10    /* PWM Period Register */
>>  #define MX3_PWMCR_PRESCALER(x)    (((x - 1) & 0xFFF) << 4)
>> @@ -38,7 +41,12 @@
>>  #define MX3_PWMCR_DBGEN			(1 << 22)
>>  #define MX3_PWMCR_CLKSRC_IPG_HIGH (2 << 16)
>>  #define MX3_PWMCR_CLKSRC_IPG      (1 << 16)
>> +#define MX3_PWMCR_SWR		  (1 << 3)
>>  #define MX3_PWMCR_EN              (1 << 0)
>> +#define MX3_PWMSR_ROV             (1 << 4)
>> +#define MX3_PWMIR_RIE             (1 << 1)
>> +
> You should decide whether to use tabs or spaces for indentation.
> And probably cleanup the indentation of the existing definitions to use
> all the same indentation style.

Ok, I will generate a separate patch to cleanup the indentation for
the existing register definitions of both i.MX PWMv1 and PWMv2.

> 
>> @@ -128,6 +160,13 @@ static int imx_pwm_config_v2(struct pwm_chip *chip,
>>  	else
>>  		period_cycles = 0;
>>  
>> +	if (!enable || duty_cycles == 0)
>> +		imx_pwm_software_reset_v2(chip);
>> +	else if (readl(imx->mmio_base + MX3_PWMSAR))
>> +		/* No rollover irq generated if duty peroid is zero. */
> typo: 'period'.

I will fix this.

> 
>> @@ -135,27 +174,55 @@ static int imx_pwm_config_v2(struct pwm_chip *chip,
>>  		MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN |
>>  		MX3_PWMCR_DBGEN | MX3_PWMCR_CLKSRC_IPG_HIGH;
>>  
>> -	if (test_bit(PWMF_ENABLED, &pwm->flags))
>> +	if (enable)
>>  		cr |= MX3_PWMCR_EN;
>>  
>>  	writel(cr, imx->mmio_base + MX3_PWMCR);
>>  
>> +	if (enable && duty_cycles)
>> +		/* No rollover irq generated if duty peroid is zero. */
> dto.

I will fix this.

> 
> 
> Lothar Wa?mann
> 

-- 
Liu Ying

WARNING: multiple messages have this Message-ID (diff)
From: Liu Ying <Ying.Liu@freescale.com>
To: "Lothar Waßmann" <LW@KARO-electronics.de>
Cc: <linux-pwm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<thierry.reding@gmail.com>, <s.hauer@pengutronix.de>,
	<shawn.guo@freescale.com>, <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v3] pwm: i.MX: Avoid sample FIFO overflow for i.MX PWM version2
Date: Mon, 19 May 2014 14:52:03 +0800	[thread overview]
Message-ID: <5379AA13.4000904@freescale.com> (raw)
In-Reply-To: <20140519075328.7f2ef0c5@ipc1.ka-ro>

Hi Lothar,

Thanks for your review.

On 05/19/2014 01:53 PM, Lothar Waßmann wrote:
> Hi,
> 
> Liu Ying wrote:
> [...]
>> @@ -30,6 +32,7 @@
>>  /* i.MX27, i.MX31, i.MX35 share the same PWM function block: */
>>  
>>  #define MX3_PWMCR                 0x00    /* PWM Control Register */
>> +#define MX3_PWMIR                 0x08    /* PWM Interrupt Register */
>>  #define MX3_PWMSAR                0x0C    /* PWM Sample Register */
>>  #define MX3_PWMPR                 0x10    /* PWM Period Register */
>>  #define MX3_PWMCR_PRESCALER(x)    (((x - 1) & 0xFFF) << 4)
>> @@ -38,7 +41,12 @@
>>  #define MX3_PWMCR_DBGEN			(1 << 22)
>>  #define MX3_PWMCR_CLKSRC_IPG_HIGH (2 << 16)
>>  #define MX3_PWMCR_CLKSRC_IPG      (1 << 16)
>> +#define MX3_PWMCR_SWR		  (1 << 3)
>>  #define MX3_PWMCR_EN              (1 << 0)
>> +#define MX3_PWMSR_ROV             (1 << 4)
>> +#define MX3_PWMIR_RIE             (1 << 1)
>> +
> You should decide whether to use tabs or spaces for indentation.
> And probably cleanup the indentation of the existing definitions to use
> all the same indentation style.

Ok, I will generate a separate patch to cleanup the indentation for
the existing register definitions of both i.MX PWMv1 and PWMv2.

> 
>> @@ -128,6 +160,13 @@ static int imx_pwm_config_v2(struct pwm_chip *chip,
>>  	else
>>  		period_cycles = 0;
>>  
>> +	if (!enable || duty_cycles == 0)
>> +		imx_pwm_software_reset_v2(chip);
>> +	else if (readl(imx->mmio_base + MX3_PWMSAR))
>> +		/* No rollover irq generated if duty peroid is zero. */
> typo: 'period'.

I will fix this.

> 
>> @@ -135,27 +174,55 @@ static int imx_pwm_config_v2(struct pwm_chip *chip,
>>  		MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN |
>>  		MX3_PWMCR_DBGEN | MX3_PWMCR_CLKSRC_IPG_HIGH;
>>  
>> -	if (test_bit(PWMF_ENABLED, &pwm->flags))
>> +	if (enable)
>>  		cr |= MX3_PWMCR_EN;
>>  
>>  	writel(cr, imx->mmio_base + MX3_PWMCR);
>>  
>> +	if (enable && duty_cycles)
>> +		/* No rollover irq generated if duty peroid is zero. */
> dto.

I will fix this.

> 
> 
> Lothar Waßmann
> 

-- 
Liu Ying

  reply	other threads:[~2014-05-19  6:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16  5:11 [PATCH v3] pwm: i.MX: Avoid sample FIFO overflow for i.MX PWM version2 Liu Ying
2014-05-16  5:11 ` Liu Ying
2014-05-16  5:11 ` Liu Ying
2014-05-19  5:53 ` Lothar Waßmann
2014-05-19  5:53   ` Lothar Waßmann
2014-05-19  5:53   ` Lothar Waßmann
2014-05-19  6:52   ` Liu Ying [this message]
2014-05-19  6:52     ` Liu Ying
2014-05-19  6:52     ` Liu Ying
2014-05-19  7:11 ` Sascha Hauer
2014-05-19  7:11   ` Sascha Hauer
2014-05-19  8:09   ` Liu Ying
2014-05-19  8:09     ` Liu Ying
2014-05-19  8:09     ` Liu Ying

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=5379AA13.4000904@freescale.com \
    --to=ying.liu@freescale.com \
    --cc=LW@KARO-electronics.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@freescale.com \
    --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.