From: Lee Jones <lee.jones@linaro.org>
To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: kernel@stlinux.com, patrice.chotard@st.com,
thierry.reding@gmail.com, linux-pwm@vger.kernel.org,
devicetree@vger.kernel.org, Lee Jones <lee.jones@linaro.org>
Subject: [PATCH v4 07/17] pwm: sti: Rename channel => device
Date: Tue, 16 Aug 2016 10:34:58 +0100 [thread overview]
Message-ID: <20160816093508.28307-8-lee.jones@linaro.org> (raw)
In-Reply-To: <20160816093508.28307-1-lee.jones@linaro.org>
This is to bring the terminology used in the STi PWM driver more
into line with the PWM subsystem.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/pwm/pwm-sti.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/pwm/pwm-sti.c b/drivers/pwm/pwm-sti.c
index 92abbd5..5c7fdd1 100644
--- a/drivers/pwm/pwm-sti.c
+++ b/drivers/pwm/pwm-sti.c
@@ -21,7 +21,7 @@
#include <linux/slab.h>
#include <linux/time.h>
-#define STI_DS_REG(ch) (4 * (ch)) /* Channel's Duty Cycle register */
+#define STI_DS_REG(ch) (4 * (ch)) /* Device's Duty Cycle register */
#define STI_PWMCR 0x50 /* Control/Config register */
#define STI_INTEN 0x54 /* Interrupt Enable/Disable register */
#define PWM_PRESCALE_LOW_MASK 0x0f
@@ -40,7 +40,7 @@ enum {
struct sti_pwm_compat_data {
const struct reg_field *reg_fields;
- unsigned int num_chan;
+ unsigned int num_devs;
unsigned int max_pwm_cnt;
unsigned int max_prescale;
};
@@ -130,13 +130,13 @@ static int sti_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
/* Allow configuration changes if one of the
* following conditions satisfy.
- * 1. No channels have been configured.
- * 2. Only one channel has been configured and the new request
- * is for the same channel.
- * 3. Only one channel has been configured and the new request is
- * for a new channel and period of the new channel is same as
+ * 1. No devices have been configured.
+ * 2. Only one device has been configured and the new request
+ * is for the same device.
+ * 3. Only one device has been configured and the new request is
+ * for a new device and period of the new device is same as
* the current configured period.
- * 4. More than one channels are configured and period of the new
+ * 4. More than one devices are configured and period of the new
* requestis the same as the current period.
*/
if (!ncfg ||
@@ -201,7 +201,7 @@ static int sti_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
int ret = 0;
/*
- * Since we have a common enable for all PWM channels,
+ * Since we have a common enable for all PWM devices,
* do not enable if already enabled.
*/
mutex_lock(&pc->sti_pwm_lock);
@@ -259,11 +259,11 @@ static int sti_pwm_probe_dt(struct sti_pwm_chip *pc)
const struct reg_field *reg_fields;
struct device_node *np = dev->of_node;
struct sti_pwm_compat_data *cdata = pc->cdata;
- u32 num_chan;
+ u32 num_devs;
- of_property_read_u32(np, "st,pwm-num-chan", &num_chan);
- if (num_chan)
- cdata->num_chan = num_chan;
+ of_property_read_u32(np, "st,pwm-num-chans", &num_devs);
+ if (num_devs)
+ cdata->num_devs = num_devs;
reg_fields = cdata->reg_fields;
@@ -330,7 +330,7 @@ static int sti_pwm_probe(struct platform_device *pdev)
cdata->reg_fields = &sti_pwm_regfields[0];
cdata->max_prescale = 0xff;
cdata->max_pwm_cnt = 255;
- cdata->num_chan = 1;
+ cdata->num_devs = 1;
pc->cdata = cdata;
pc->dev = dev;
@@ -362,7 +362,7 @@ static int sti_pwm_probe(struct platform_device *pdev)
pc->chip.dev = dev;
pc->chip.ops = &sti_pwm_ops;
pc->chip.base = -1;
- pc->chip.npwm = pc->cdata->num_chan;
+ pc->chip.npwm = pc->cdata->num_devs;
pc->chip.can_sleep = true;
ret = pwmchip_add(&pc->chip);
@@ -381,7 +381,7 @@ static int sti_pwm_remove(struct platform_device *pdev)
struct sti_pwm_chip *pc = platform_get_drvdata(pdev);
unsigned int i;
- for (i = 0; i < pc->cdata->num_chan; i++)
+ for (i = 0; i < pc->cdata->num_devs; i++)
pwm_disable(&pc->chip.pwms[i]);
clk_unprepare(pc->clk);
--
2.9.0
next prev parent reply other threads:[~2016-08-16 9:34 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-16 9:34 [PATCH v4 00/17] pwm: Add support for PWM Capture Lee Jones
2016-08-16 9:34 ` [PATCH v4 01/17] ARM: dts: STiH407: Supply PWM Capture IRQ Lee Jones
2016-08-16 9:34 ` [PATCH v4 02/17] ARM: dts: STiH407: Declare PWM Capture data lines via Pinctrl Lee Jones
2016-08-16 9:34 ` [PATCH v4 03/17] ARM: dts: STiH416: Supply PWM Capture IRQs Lee Jones
2016-08-16 9:34 ` [PATCH v4 05/17] ARM: dts: STiH416: Define PWM Capture clock Lee Jones
2016-08-16 9:34 ` [PATCH v4 06/17] ARM: dts: STiH416: Define the number of PWM Capture channels Lee Jones
2016-08-16 9:34 ` Lee Jones [this message]
2016-09-05 10:33 ` [PATCH v4 07/17] pwm: sti: Rename channel => device Thierry Reding
2016-08-16 9:34 ` [PATCH v4 08/17] pwm: sti: Reorganise register names in preparation for new functionality Lee Jones
[not found] ` <20160816093508.28307-9-lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-09-05 10:35 ` Thierry Reding
2016-08-16 9:35 ` [PATCH v4 10/17] pwm: sti: Supply PWM Capture register addresses and bit locations Lee Jones
2016-09-05 10:41 ` Thierry Reding
2016-08-16 9:35 ` [PATCH v4 11/17] pwm: sti: Supply PWM Capture clock handling Lee Jones
[not found] ` <20160816093508.28307-12-lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-09-05 10:42 ` Thierry Reding
2016-08-16 9:35 ` [PATCH v4 13/17] pwm: sti: Add support for PWM Capture IRQs Lee Jones
[not found] ` <20160816093508.28307-14-lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-09-05 10:53 ` Thierry Reding
2016-08-16 9:35 ` [PATCH v4 15/17] pwm: sti: It's now valid for number of PWM channels to be zero Lee Jones
[not found] ` <20160816093508.28307-16-lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-09-05 11:20 ` Thierry Reding
2016-08-16 9:35 ` [PATCH v4 16/17] pwm: sti: Take the opportunity to conduct a little house keeping Lee Jones
2016-09-05 11:37 ` Thierry Reding
[not found] ` <20160816093508.28307-1-lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-08-16 9:34 ` [PATCH v4 04/17] ARM: dts: STiH416: Declare PWM Capture data lines via Pinctrl Lee Jones
2016-08-16 9:35 ` [PATCH v4 09/17] pwm: sti: Only request clock rate when you need to Lee Jones
2016-09-05 10:36 ` Thierry Reding
2016-08-16 9:35 ` [PATCH v4 12/17] pwm: sti: Initialise PWM Capture device data Lee Jones
2016-09-05 10:50 ` Thierry Reding
2016-08-16 9:35 ` [PATCH v4 14/17] pwm: sti: Add PWM Capture call-back Lee Jones
2016-09-05 11:10 ` Thierry Reding
2016-08-16 9:35 ` [PATCH v4 17/17] dt-bindings: pwm: sti: Update DT bindings with recent changes Lee Jones
2016-08-18 19:20 ` Rob Herring
2016-08-19 8:35 ` Lee Jones
2016-08-19 12:45 ` Rob Herring
2016-09-05 10:29 ` Thierry Reding
2016-08-25 11:51 ` [STLinux Kernel] [PATCH v4 00/17] pwm: Add support for PWM Capture Peter Griffin
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=20160816093508.28307-8-lee.jones@linaro.org \
--to=lee.jones@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel@stlinux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=patrice.chotard@st.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 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).