From patchwork Fri Apr 22 10:18:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 66428 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp632172qge; Fri, 22 Apr 2016 03:19:54 -0700 (PDT) X-Received: by 10.66.231.98 with SMTP id tf2mr27517022pac.56.1461320394277; Fri, 22 Apr 2016 03:19:54 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sn5si6970032pac.181.2016.04.22.03.19.54; Fri, 22 Apr 2016 03:19:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752246AbcDVKTw (ORCPT + 29 others); Fri, 22 Apr 2016 06:19:52 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35695 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752400AbcDVKS2 (ORCPT ); Fri, 22 Apr 2016 06:18:28 -0400 Received: by mail-wm0-f51.google.com with SMTP id e201so13251219wme.0 for ; Fri, 22 Apr 2016 03:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LOTuFBMRCyP51zJ0GFs8fZCIF6e0rLwxQcgpebi45NY=; b=kDykPH2N5t3Ye21mYfsk/Iq+OAvkR7F4wwXohS0gC4cGh2xv9Lpphe9bzaYrDhEY6l AEDT0HXHefpE7U7uKQPe093TnNuIHxvstOuRzxYD+APPIDmbfcUbUfIyMxOoL1D4NzKA zeI8hj1lLbs36qWxTmWX02kSFVIHk4LGuP5wk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LOTuFBMRCyP51zJ0GFs8fZCIF6e0rLwxQcgpebi45NY=; b=WNIyEVH9NV4pJSuitxlOcaubIb9XuGUbmsCm1KrWtK/GUZLQBI61hyaGouebciVaIP KtclXYTTzCndRWgxtdGngu5URxHo7Smuy9vebiJTXw4BzXYaars1RrIlbAiW1Og0Y8zM bC6KcxCrL8Z7fqG1C/7+gckDljSSCktKPVgAIOnRZ5Tj6AW/+Okz1u55Ycp1YYo10zDw qhhA46aP92D+ES4yKCjeK2PPPMy7uIu6yO0LTGM5xIXkM9aBl0J1fVaP+uuRpWxcvt/n hj7fLEDL9heylWW+xf0P8+BYt6ORqJpOcwxtB4syQ7iOWDzzS0Qi4UwtuGgvXzwL8DDQ Eg+w== X-Gm-Message-State: AOPr4FU5DoUzj61xEtuCL4VC9L8+heS970LdDu1kBXJs4LejM7+Zw/4VLTQmAD+tXt+EfYc3 X-Received: by 10.28.30.148 with SMTP id e142mr2803680wme.69.1461320302201; Fri, 22 Apr 2016 03:18:22 -0700 (PDT) Received: from dell.localdomain (host81-129-172-5.range81-129.btcentralplus.com. [81.129.172.5]) by smtp.gmail.com with ESMTPSA id a1sm7316345wje.43.2016.04.22.03.18.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Apr 2016 03:18:21 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@stlinux.com, maxime.coquelin@st.com, linux-pwm@vger.kernel.org, thierry.reding@gmail.com, ajitpal.singh@st.com, Lee Jones Subject: [[PATCH v2] 02/11] pwm: sti: Rename channel => device Date: Fri, 22 Apr 2016 11:18:06 +0100 Message-Id: <1461320295-20414-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1461320295-20414-1-git-send-email-lee.jones@linaro.org> References: <1461320295-20414-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- drivers/pwm/pwm-sti.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) -- 2.8.0 diff --git a/drivers/pwm/pwm-sti.c b/drivers/pwm/pwm-sti.c index 92abbd5..3dae127 100644 --- a/drivers/pwm/pwm-sti.c +++ b/drivers/pwm/pwm-sti.c @@ -21,7 +21,7 @@ #include #include -#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-devs", &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);