All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] pwm: clps711x: Fix period calculation
@ 2018-12-19 10:39 Alexander Shiyan
  2018-12-19 10:39 ` [PATCH 2/2] pwm: clps711x: Switch to SPDX identifier Alexander Shiyan
  2018-12-20 17:25 ` [PATCH 1/2] pwm: clps711x: Fix period calculation Thierry Reding
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Shiyan @ 2018-12-19 10:39 UTC (permalink / raw)
  To: linux-pwm; +Cc: Thierry Reding, Alexander Shiyan

Commit e39c0df1be5a ("pwm: Introduce the pwm_args concept") has
changed the variable for the period for clps711x-pwm driver, so now
pwm_get/set_period() works with pwm->state.period variable instead
of pwm->args.period.
This patch changes the period variable in other places where it is used.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/pwm/pwm-clps711x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pwm/pwm-clps711x.c b/drivers/pwm/pwm-clps711x.c
index 26ec24e457b1..7e16b7def0dc 100644
--- a/drivers/pwm/pwm-clps711x.c
+++ b/drivers/pwm/pwm-clps711x.c
@@ -48,7 +48,7 @@ static void clps711x_pwm_update_val(struct clps711x_chip *priv, u32 n, u32 v)
 static unsigned int clps711x_get_duty(struct pwm_device *pwm, unsigned int v)
 {
 	/* Duty cycle 0..15 max */
-	return DIV_ROUND_CLOSEST(v * 0xf, pwm_get_period(pwm));
+	return DIV_ROUND_CLOSEST(v * 0xf, pwm->args.period);
 }
 
 static int clps711x_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
@@ -71,7 +71,7 @@ static int clps711x_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
 	struct clps711x_chip *priv = to_clps711x_chip(chip);
 	unsigned int duty;
 
-	if (period_ns != pwm_get_period(pwm))
+	if (period_ns != pwm->args.period)
 		return -EINVAL;
 
 	duty = clps711x_get_duty(pwm, duty_ns);
-- 
2.13.0

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

* [PATCH 2/2] pwm: clps711x: Switch to SPDX identifier
  2018-12-19 10:39 [PATCH 1/2] pwm: clps711x: Fix period calculation Alexander Shiyan
@ 2018-12-19 10:39 ` Alexander Shiyan
  2018-12-20 17:23   ` Thierry Reding
  2018-12-20 17:25 ` [PATCH 1/2] pwm: clps711x: Fix period calculation Thierry Reding
  1 sibling, 1 reply; 4+ messages in thread
From: Alexander Shiyan @ 2018-12-19 10:39 UTC (permalink / raw)
  To: linux-pwm; +Cc: Thierry Reding, Alexander Shiyan

Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/pwm/pwm-clps711x.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/pwm/pwm-clps711x.c b/drivers/pwm/pwm-clps711x.c
index 7e16b7def0dc..924d39a797cf 100644
--- a/drivers/pwm/pwm-clps711x.c
+++ b/drivers/pwm/pwm-clps711x.c
@@ -1,12 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Cirrus Logic CLPS711X PWM driver
- *
- * Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Author: Alexander Shiyan <shc_work@mail.ru>
  */
 
 #include <linux/clk.h>
-- 
2.13.0

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

* Re: [PATCH 2/2] pwm: clps711x: Switch to SPDX identifier
  2018-12-19 10:39 ` [PATCH 2/2] pwm: clps711x: Switch to SPDX identifier Alexander Shiyan
@ 2018-12-20 17:23   ` Thierry Reding
  0 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2018-12-20 17:23 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: linux-pwm

[-- Attachment #1: Type: text/plain, Size: 1098 bytes --]

On Wed, Dec 19, 2018 at 01:39:25PM +0300, Alexander Shiyan wrote:
> Adopt the SPDX license identifier headers to ease license compliance
> management.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  drivers/pwm/pwm-clps711x.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-clps711x.c b/drivers/pwm/pwm-clps711x.c
> index 7e16b7def0dc..924d39a797cf 100644
> --- a/drivers/pwm/pwm-clps711x.c
> +++ b/drivers/pwm/pwm-clps711x.c
> @@ -1,12 +1,7 @@
> +// SPDX-License-Identifier: GPL-2.0+
>  /*
>   * Cirrus Logic CLPS711X PWM driver
> - *
> - * Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru>
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> + * Author: Alexander Shiyan <shc_work@mail.ru>
>   */
>  
>  #include <linux/clk.h>
> -- 
> 2.13.0

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 1/2] pwm: clps711x: Fix period calculation
  2018-12-19 10:39 [PATCH 1/2] pwm: clps711x: Fix period calculation Alexander Shiyan
  2018-12-19 10:39 ` [PATCH 2/2] pwm: clps711x: Switch to SPDX identifier Alexander Shiyan
@ 2018-12-20 17:25 ` Thierry Reding
  1 sibling, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2018-12-20 17:25 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: linux-pwm

[-- Attachment #1: Type: text/plain, Size: 1527 bytes --]

On Wed, Dec 19, 2018 at 01:39:24PM +0300, Alexander Shiyan wrote:
> Commit e39c0df1be5a ("pwm: Introduce the pwm_args concept") has
> changed the variable for the period for clps711x-pwm driver, so now
> pwm_get/set_period() works with pwm->state.period variable instead
> of pwm->args.period.
> This patch changes the period variable in other places where it is used.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  drivers/pwm/pwm-clps711x.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-clps711x.c b/drivers/pwm/pwm-clps711x.c
> index 26ec24e457b1..7e16b7def0dc 100644
> --- a/drivers/pwm/pwm-clps711x.c
> +++ b/drivers/pwm/pwm-clps711x.c
> @@ -48,7 +48,7 @@ static void clps711x_pwm_update_val(struct clps711x_chip *priv, u32 n, u32 v)
>  static unsigned int clps711x_get_duty(struct pwm_device *pwm, unsigned int v)
>  {
>  	/* Duty cycle 0..15 max */
> -	return DIV_ROUND_CLOSEST(v * 0xf, pwm_get_period(pwm));
> +	return DIV_ROUND_CLOSEST(v * 0xf, pwm->args.period);
>  }
>  
>  static int clps711x_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
> @@ -71,7 +71,7 @@ static int clps711x_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
>  	struct clps711x_chip *priv = to_clps711x_chip(chip);
>  	unsigned int duty;
>  
> -	if (period_ns != pwm_get_period(pwm))
> +	if (period_ns != pwm->args.period)
>  		return -EINVAL;
>  
>  	duty = clps711x_get_duty(pwm, duty_ns);

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2018-12-20 17:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-19 10:39 [PATCH 1/2] pwm: clps711x: Fix period calculation Alexander Shiyan
2018-12-19 10:39 ` [PATCH 2/2] pwm: clps711x: Switch to SPDX identifier Alexander Shiyan
2018-12-20 17:23   ` Thierry Reding
2018-12-20 17:25 ` [PATCH 1/2] pwm: clps711x: Fix period calculation Thierry Reding

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.