Skip to content

Commit 0a7404f

Browse files
andy-shevlinusw
authored andcommitted
pinctrl: cy8c95x0: Rename PWMSEL to SELPWM
There are two registers in the hardware, one, "Select PWM", is per-port configuration enabling PWM function instead of GPIO. The other one is "PWM Select" is per-PWM selector to configure PWM itself. Original code uses abbreviation of the latter to describe the former. Rename it to follow the datasheet. Fixes: e6cbbe4 ("pinctrl: Add Cypress cy8c95x0 support") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/20250203131506.3318201-5-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent aac4470 commit 0a7404f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/pinctrl/pinctrl-cy8c95x0.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#define CY8C95X0_PORTSEL 0x18
4343
/* Port settings, write PORTSEL first */
4444
#define CY8C95X0_INTMASK 0x19
45-
#define CY8C95X0_PWMSEL 0x1A
45+
#define CY8C95X0_SELPWM 0x1A
4646
#define CY8C95X0_INVERT 0x1B
4747
#define CY8C95X0_DIRECTION 0x1C
4848
/* Drive mode register change state on writing '1' */
@@ -369,8 +369,8 @@ static bool cy8c95x0_volatile_register(struct device *dev, unsigned int reg)
369369
case CY8C95X0_INPUT_(0) ... CY8C95X0_INPUT_(7):
370370
case CY8C95X0_INTSTATUS_(0) ... CY8C95X0_INTSTATUS_(7):
371371
case CY8C95X0_INTMASK:
372+
case CY8C95X0_SELPWM:
372373
case CY8C95X0_INVERT:
373-
case CY8C95X0_PWMSEL:
374374
case CY8C95X0_DIRECTION:
375375
case CY8C95X0_DRV_PU:
376376
case CY8C95X0_DRV_PD:
@@ -399,7 +399,7 @@ static bool cy8c95x0_muxed_register(unsigned int reg)
399399
{
400400
switch (reg) {
401401
case CY8C95X0_INTMASK:
402-
case CY8C95X0_PWMSEL:
402+
case CY8C95X0_SELPWM:
403403
case CY8C95X0_INVERT:
404404
case CY8C95X0_DIRECTION:
405405
case CY8C95X0_DRV_PU:
@@ -797,7 +797,7 @@ static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip,
797797
reg = CY8C95X0_DIRECTION;
798798
break;
799799
case PIN_CONFIG_MODE_PWM:
800-
reg = CY8C95X0_PWMSEL;
800+
reg = CY8C95X0_SELPWM;
801801
break;
802802
case PIN_CONFIG_OUTPUT:
803803
reg = CY8C95X0_OUTPUT;
@@ -876,7 +876,7 @@ static int cy8c95x0_gpio_set_pincfg(struct cy8c95x0_pinctrl *chip,
876876
reg = CY8C95X0_DRV_PP_FAST;
877877
break;
878878
case PIN_CONFIG_MODE_PWM:
879-
reg = CY8C95X0_PWMSEL;
879+
reg = CY8C95X0_SELPWM;
880880
break;
881881
case PIN_CONFIG_OUTPUT_ENABLE:
882882
return cy8c95x0_pinmux_direction(chip, off, !arg);
@@ -1161,7 +1161,7 @@ static void cy8c95x0_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *
11611161
bitmap_zero(mask, MAX_LINE);
11621162
__set_bit(pin, mask);
11631163

1164-
if (cy8c95x0_read_regs_mask(chip, CY8C95X0_PWMSEL, pwm, mask)) {
1164+
if (cy8c95x0_read_regs_mask(chip, CY8C95X0_SELPWM, pwm, mask)) {
11651165
seq_puts(s, "not available");
11661166
return;
11671167
}
@@ -1206,7 +1206,7 @@ static int cy8c95x0_set_mode(struct cy8c95x0_pinctrl *chip, unsigned int off, bo
12061206
u8 port = cypress_get_port(chip, off);
12071207
u8 bit = cypress_get_pin_mask(chip, off);
12081208

1209-
return cy8c95x0_regmap_write_bits(chip, CY8C95X0_PWMSEL, port, bit, mode ? bit : 0);
1209+
return cy8c95x0_regmap_write_bits(chip, CY8C95X0_SELPWM, port, bit, mode ? bit : 0);
12101210
}
12111211

12121212
static int cy8c95x0_pinmux_mode(struct cy8c95x0_pinctrl *chip,

0 commit comments

Comments
 (0)