diff mbox

[v4,6/9] pwm: sunxi: Increase max number of pwm channels.

Message ID 1487914876-8594-7-git-send-email-lis8215@gmail.com
State Deferred
Headers show

Commit Message

Siarhei Volkau Feb. 24, 2017, 5:41 a.m. UTC
From: Siarhei Volkau <lis8215@gmail.com>

sun6i have 4 pwm channels onboard. This patch increase
maximal possible count of channels.

Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
---
 drivers/pwm/pwm-sun4i.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.c
index 9463148..a179a53 100644
--- a/drivers/pwm/pwm-sun4i.c
+++ b/drivers/pwm/pwm-sun4i.c
@@ -46,7 +46,7 @@ 
 
 #define BIT_CH(bit, chan)	((bit) << ((chan) * PWMCH_OFFSET))
 
-#define SUN4I_MAX_PWM_CHANNELS	2
+#define SUNXI_MAX_PWM_CHANNELS	4
 
 /* regmap fields */
 enum {
@@ -91,14 +91,14 @@  struct sun4i_pwm_data {
 	bool has_rdy;
 	unsigned int npwm;
 	const u32 *prescaler_table;
-	const struct sunxi_pwmch_data *chan_data[SUN4I_MAX_PWM_CHANNELS];
+	const struct sunxi_pwmch_data *chan_data[SUNXI_MAX_PWM_CHANNELS];
 };
 
 struct sun4i_pwm_chip {
 	struct pwm_chip chip;
 	struct clk *clk;
 	struct regmap *regmap;
-	struct regmap_field *fields[SUN4I_MAX_PWM_CHANNELS][NUM_FIELDS];
+	struct regmap_field *fields[SUNXI_MAX_PWM_CHANNELS][NUM_FIELDS];
 	spinlock_t ctrl_lock;
 	const struct sun4i_pwm_data *data;
 };
@@ -426,7 +426,7 @@  static int sunxi_alloc_reg_fields(struct device *dev,
 	int i, err;
 	const struct sunxi_pwmch_data *data = pwm->data->chan_data[chan];
 
-	if (!data || chan >= SUN4I_MAX_PWM_CHANNELS)
+	if (!data || chan >= SUNXI_MAX_PWM_CHANNELS)
 		return -EINVAL;
 	for (i = 0; i < NUM_FIELDS; i++) {
 		pwm->fields[chan][i] =