Commit 63e23304 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

pinctrl: cy8c95x0: Correct comment style

In a few comments the style is not aligned with the rest.
Correct them.

While at it, drop unneeded blank lines and deduplicate 'Author'.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarPatrick Rudolph <patrick.rudolph@9elements.com>
Link: https://lore.kernel.org/r/20220902182650.83098-17-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 9540a836
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* CY8C95X0 20/40/60 pin I2C GPIO port expander with interrupt support * CY8C95X0 20/40/60 pin I2C GPIO port expander with interrupt support
* *
* Copyright (C) 2022 9elements GmbH * Copyright (C) 2022 9elements GmbH
* Author: Patrick Rudolph <patrick.rudolph@9elements.com> * Authors: Patrick Rudolph <patrick.rudolph@9elements.com>
* Author: Naresh Solanki <Naresh.Solanki@9elements.com> * Naresh Solanki <Naresh.Solanki@9elements.com>
*/ */
#include <linux/acpi.h> #include <linux/acpi.h>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
/* Port Select configures the port */ /* Port Select configures the port */
#define CY8C95X0_PORTSEL 0x18 #define CY8C95X0_PORTSEL 0x18
/* port settings, write PORTSEL first */ /* Port settings, write PORTSEL first */
#define CY8C95X0_INTMASK 0x19 #define CY8C95X0_INTMASK 0x19
#define CY8C95X0_PWMSEL 0x1A #define CY8C95X0_PWMSEL 0x1A
#define CY8C95X0_INVERT 0x1B #define CY8C95X0_INVERT 0x1B
...@@ -72,7 +72,6 @@ static const struct of_device_id cy8c95x0_dt_ids[] = { ...@@ -72,7 +72,6 @@ static const struct of_device_id cy8c95x0_dt_ids[] = {
{ .compatible = "cypress,cy8c9560", .data = OF_CY8C95X(60), }, { .compatible = "cypress,cy8c9560", .data = OF_CY8C95X(60), },
{ } { }
}; };
MODULE_DEVICE_TABLE(of, cy8c95x0_dt_ids); MODULE_DEVICE_TABLE(of, cy8c95x0_dt_ids);
static const struct acpi_gpio_params cy8c95x0_irq_gpios = { 0, 0, true }; static const struct acpi_gpio_params cy8c95x0_irq_gpios = { 0, 0, true };
...@@ -429,7 +428,7 @@ static int cy8c95x0_write_regs_mask(struct cy8c95x0_pinctrl *chip, int reg, ...@@ -429,7 +428,7 @@ static int cy8c95x0_write_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
continue; continue;
switch (reg) { switch (reg) {
/* muxed registers */ /* Muxed registers */
case CY8C95X0_INTMASK: case CY8C95X0_INTMASK:
case CY8C95X0_PWMSEL: case CY8C95X0_PWMSEL:
case CY8C95X0_INVERT: case CY8C95X0_INVERT:
...@@ -446,7 +445,7 @@ static int cy8c95x0_write_regs_mask(struct cy8c95x0_pinctrl *chip, int reg, ...@@ -446,7 +445,7 @@ static int cy8c95x0_write_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
goto out; goto out;
off = reg; off = reg;
break; break;
/* direct access registers */ /* Direct access registers */
case CY8C95X0_INPUT: case CY8C95X0_INPUT:
case CY8C95X0_OUTPUT: case CY8C95X0_OUTPUT:
case CY8C95X0_INTSTATUS: case CY8C95X0_INTSTATUS:
...@@ -500,7 +499,7 @@ static int cy8c95x0_read_regs_mask(struct cy8c95x0_pinctrl *chip, int reg, ...@@ -500,7 +499,7 @@ static int cy8c95x0_read_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
continue; continue;
switch (reg) { switch (reg) {
/* muxed registers */ /* Muxed registers */
case CY8C95X0_INTMASK: case CY8C95X0_INTMASK:
case CY8C95X0_PWMSEL: case CY8C95X0_PWMSEL:
case CY8C95X0_INVERT: case CY8C95X0_INVERT:
...@@ -517,7 +516,7 @@ static int cy8c95x0_read_regs_mask(struct cy8c95x0_pinctrl *chip, int reg, ...@@ -517,7 +516,7 @@ static int cy8c95x0_read_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
goto out; goto out;
off = reg; off = reg;
break; break;
/* direct access registers */ /* Direct access registers */
case CY8C95X0_INPUT: case CY8C95X0_INPUT:
case CY8C95X0_OUTPUT: case CY8C95X0_OUTPUT:
case CY8C95X0_INTSTATUS: case CY8C95X0_INTSTATUS:
...@@ -592,18 +591,18 @@ static int cy8c95x0_gpio_direction_output(struct gpio_chip *gc, ...@@ -592,18 +591,18 @@ static int cy8c95x0_gpio_direction_output(struct gpio_chip *gc,
u8 bit = cypress_get_pin_mask(chip, off); u8 bit = cypress_get_pin_mask(chip, off);
int ret; int ret;
/* set output level */ /* Set output level */
ret = regmap_write_bits(chip->regmap, outreg, bit, val ? bit : 0); ret = regmap_write_bits(chip->regmap, outreg, bit, val ? bit : 0);
if (ret) if (ret)
return ret; return ret;
mutex_lock(&chip->i2c_lock); mutex_lock(&chip->i2c_lock);
/* select port */ /* Select port... */
ret = regmap_write(chip->regmap, CY8C95X0_PORTSEL, port); ret = regmap_write(chip->regmap, CY8C95X0_PORTSEL, port);
if (ret) if (ret)
goto out; goto out;
/* then direction */ /* ...then direction */
ret = regmap_write_bits(chip->regmap, CY8C95X0_DIRECTION, bit, 0); ret = regmap_write_bits(chip->regmap, CY8C95X0_DIRECTION, bit, 0);
out: out:
...@@ -624,7 +623,7 @@ static int cy8c95x0_gpio_get_value(struct gpio_chip *gc, unsigned int off) ...@@ -624,7 +623,7 @@ static int cy8c95x0_gpio_get_value(struct gpio_chip *gc, unsigned int off)
if (ret < 0) { if (ret < 0) {
/* /*
* NOTE: * NOTE:
* diagnostic already emitted; that's all we should * Diagnostic already emitted; that's all we should
* do unless gpio_*_value_cansleep() calls become different * do unless gpio_*_value_cansleep() calls become different
* from their nonsleeping siblings (and report faults). * from their nonsleeping siblings (and report faults).
*/ */
...@@ -687,7 +686,7 @@ static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip, ...@@ -687,7 +686,7 @@ static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip,
mutex_lock(&chip->i2c_lock); mutex_lock(&chip->i2c_lock);
/* select port */ /* Select port */
ret = regmap_write(chip->regmap, CY8C95X0_PORTSEL, port); ret = regmap_write(chip->regmap, CY8C95X0_PORTSEL, port);
if (ret < 0) if (ret < 0)
goto out; goto out;
...@@ -742,7 +741,8 @@ static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip, ...@@ -742,7 +741,8 @@ static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip,
ret = -ENOTSUPP; ret = -ENOTSUPP;
goto out; goto out;
} }
/* Writing 1 to one of the drive mode registers will automatically /*
* Writing 1 to one of the drive mode registers will automatically
* clear conflicting set bits in the other drive mode registers. * clear conflicting set bits in the other drive mode registers.
*/ */
ret = regmap_read(chip->regmap, reg, &reg_val); ret = regmap_read(chip->regmap, reg, &reg_val);
...@@ -768,7 +768,7 @@ static int cy8c95x0_gpio_set_pincfg(struct cy8c95x0_pinctrl *chip, ...@@ -768,7 +768,7 @@ static int cy8c95x0_gpio_set_pincfg(struct cy8c95x0_pinctrl *chip,
mutex_lock(&chip->i2c_lock); mutex_lock(&chip->i2c_lock);
/* select port */ /* Select port */
ret = regmap_write(chip->regmap, CY8C95X0_PORTSEL, port); ret = regmap_write(chip->regmap, CY8C95X0_PORTSEL, port);
if (ret < 0) if (ret < 0)
goto out; goto out;
...@@ -805,7 +805,8 @@ static int cy8c95x0_gpio_set_pincfg(struct cy8c95x0_pinctrl *chip, ...@@ -805,7 +805,8 @@ static int cy8c95x0_gpio_set_pincfg(struct cy8c95x0_pinctrl *chip,
ret = -ENOTSUPP; ret = -ENOTSUPP;
goto out; goto out;
} }
/* Writing 1 to one of the drive mode registers will automatically /*
* Writing 1 to one of the drive mode registers will automatically
* clear conflicting set bits in the other drive mode registers. * clear conflicting set bits in the other drive mode registers.
*/ */
ret = regmap_write_bits(chip->regmap, reg, bit, bit); ret = regmap_write_bits(chip->regmap, reg, bit, bit);
...@@ -1130,7 +1131,7 @@ static int cy8c95x0_pinmux_cfg(struct cy8c95x0_pinctrl *chip, ...@@ -1130,7 +1131,7 @@ static int cy8c95x0_pinmux_cfg(struct cy8c95x0_pinctrl *chip,
u8 bit = cypress_get_pin_mask(chip, off); u8 bit = cypress_get_pin_mask(chip, off);
int ret; int ret;
/* select port */ /* Select port */
ret = regmap_write(chip->regmap, CY8C95X0_PORTSEL, port); ret = regmap_write(chip->regmap, CY8C95X0_PORTSEL, port);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -1247,11 +1248,12 @@ static int cy8c95x0_setup_pinctrl(struct cy8c95x0_pinctrl *chip) ...@@ -1247,11 +1248,12 @@ static int cy8c95x0_setup_pinctrl(struct cy8c95x0_pinctrl *chip)
pd->pins = cy8c9560_pins; pd->pins = cy8c9560_pins;
pd->npins = chip->tpin; pd->npins = chip->tpin;
pd->owner = THIS_MODULE; pd->owner = THIS_MODULE;
chip->pctldev = devm_pinctrl_register(chip->dev, pd, chip);
chip->pctldev = devm_pinctrl_register(chip->dev, pd, chip);
if (IS_ERR(chip->pctldev)) if (IS_ERR(chip->pctldev))
return dev_err_probe(chip->dev, PTR_ERR(chip->pctldev), return dev_err_probe(chip->dev, PTR_ERR(chip->pctldev),
"can't register controller\n"); "can't register controller\n");
return 0; return 0;
} }
...@@ -1304,7 +1306,6 @@ static int cy8c95x0_probe(struct i2c_client *client) ...@@ -1304,7 +1306,6 @@ static int cy8c95x0_probe(struct i2c_client *client)
chip->driver_data = (unsigned long)device_get_match_data(&client->dev); chip->driver_data = (unsigned long)device_get_match_data(&client->dev);
if (!chip->driver_data) if (!chip->driver_data)
chip->driver_data = i2c_match_id(cy8c95x0_id, client)->driver_data; chip->driver_data = i2c_match_id(cy8c95x0_id, client)->driver_data;
if (!chip->driver_data) if (!chip->driver_data)
return -ENODEV; return -ENODEV;
...@@ -1404,7 +1405,6 @@ static struct i2c_driver cy8c95x0_driver = { ...@@ -1404,7 +1405,6 @@ static struct i2c_driver cy8c95x0_driver = {
.id_table = cy8c95x0_id, .id_table = cy8c95x0_id,
.detect = cy8c95x0_detect, .detect = cy8c95x0_detect,
}; };
module_i2c_driver(cy8c95x0_driver); module_i2c_driver(cy8c95x0_driver);
MODULE_AUTHOR("Patrick Rudolph <patrick.rudolph@9elements.com>"); MODULE_AUTHOR("Patrick Rudolph <patrick.rudolph@9elements.com>");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment