Commit 8e48230d authored by Théo Lebrun's avatar Théo Lebrun Committed by Linus Walleij

pinctrl: nomadik: follow whitespace kernel coding conventions

Fix strict checkpatch warnings relative to whitespace. Message types
addressed:

   ERROR: space required before the open parenthesis '('
   WARNING: quoted string split across lines
   CHECK: Alignment should match open parenthesis
   CHECK: Please don't use multiple blank lines
   CHECK: line length of 103 exceeds 100 columns
   CHECK: spaces preferred around that '+' (ctx:VxV)

Before: 1 errors, 2 warnings, 38 checks.
After:  0 errors, 1 warnings, 16 checks.
Signed-off-by: default avatarThéo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-12-3ba757474006@bootlin.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 1a656a80
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
* Rewritten based on work by Prafulla WADASKAR <prafulla.wadaskar@st.com> * Rewritten based on work by Prafulla WADASKAR <prafulla.wadaskar@st.com>
* Copyright (C) 2011-2013 Linus Walleij <linus.walleij@linaro.org> * Copyright (C) 2011-2013 Linus Walleij <linus.walleij@linaro.org>
*/ */
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/cleanup.h> #include <linux/cleanup.h>
#include <linux/clk.h> #include <linux/clk.h>
...@@ -165,7 +166,6 @@ ...@@ -165,7 +166,6 @@
#define PIN_SLEEPMODE_DISABLED (0 << PIN_SLEEPMODE_SHIFT) #define PIN_SLEEPMODE_DISABLED (0 << PIN_SLEEPMODE_SHIFT)
#define PIN_SLEEPMODE_ENABLED (1 << PIN_SLEEPMODE_SHIFT) #define PIN_SLEEPMODE_ENABLED (1 << PIN_SLEEPMODE_SHIFT)
/* Shortcuts. Use these instead of separate DIR, PULL, and VAL. */ /* Shortcuts. Use these instead of separate DIR, PULL, and VAL. */
#define PIN_INPUT_PULLDOWN (PIN_DIR_INPUT | PIN_PULL_DOWN) #define PIN_INPUT_PULLDOWN (PIN_DIR_INPUT | PIN_PULL_DOWN)
#define PIN_INPUT_PULLUP (PIN_DIR_INPUT | PIN_PULL_UP) #define PIN_INPUT_PULLUP (PIN_DIR_INPUT | PIN_PULL_UP)
...@@ -341,7 +341,7 @@ static void nmk_write_masked(void __iomem *reg, u32 mask, u32 value) ...@@ -341,7 +341,7 @@ static void nmk_write_masked(void __iomem *reg, u32 mask, u32 value)
} }
static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct, static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct,
unsigned int offset, unsigned int alt_num) unsigned int offset, unsigned int alt_num)
{ {
int i; int i;
u16 reg; u16 reg;
...@@ -385,7 +385,7 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct, ...@@ -385,7 +385,7 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct,
nmk_write_masked(npct->prcm_base + reg, BIT(bit), 0); nmk_write_masked(npct->prcm_base + reg, BIT(bit), 0);
dev_dbg(npct->dev, dev_dbg(npct->dev,
"PRCM GPIOCR: pin %i: alternate-C%i has been disabled\n", "PRCM GPIOCR: pin %i: alternate-C%i has been disabled\n",
offset, i+1); offset, i + 1);
} }
} }
} }
...@@ -395,8 +395,8 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct, ...@@ -395,8 +395,8 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct,
alt_index = alt_num - 1; alt_index = alt_num - 1;
if (pin_desc->altcx[alt_index].used == false) { if (pin_desc->altcx[alt_index].used == false) {
dev_warn(npct->dev, dev_warn(npct->dev,
"PRCM GPIOCR: pin %i: alternate-C%i does not exist\n", "PRCM GPIOCR: pin %i: alternate-C%i does not exist\n",
offset, alt_num); offset, alt_num);
return; return;
} }
...@@ -414,7 +414,7 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct, ...@@ -414,7 +414,7 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct,
nmk_write_masked(npct->prcm_base + reg, BIT(bit), 0); nmk_write_masked(npct->prcm_base + reg, BIT(bit), 0);
dev_dbg(npct->dev, dev_dbg(npct->dev,
"PRCM GPIOCR: pin %i: alternate-C%i has been disabled\n", "PRCM GPIOCR: pin %i: alternate-C%i has been disabled\n",
offset, i+1); offset, i + 1);
} }
} }
} }
...@@ -422,7 +422,7 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct, ...@@ -422,7 +422,7 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct,
reg = gpiocr_regs[pin_desc->altcx[alt_index].reg_index]; reg = gpiocr_regs[pin_desc->altcx[alt_index].reg_index];
bit = pin_desc->altcx[alt_index].control_bit; bit = pin_desc->altcx[alt_index].control_bit;
dev_dbg(npct->dev, "PRCM GPIOCR: pin %i: alternate-C%i has been selected\n", dev_dbg(npct->dev, "PRCM GPIOCR: pin %i: alternate-C%i has been selected\n",
offset, alt_index+1); offset, alt_index + 1);
nmk_write_masked(npct->prcm_base + reg, BIT(bit), BIT(bit)); nmk_write_masked(npct->prcm_base + reg, BIT(bit), BIT(bit));
} }
...@@ -499,7 +499,7 @@ int __maybe_unused nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpi ...@@ -499,7 +499,7 @@ int __maybe_unused nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpi
reg = gpiocr_regs[pin_desc->altcx[i].reg_index]; reg = gpiocr_regs[pin_desc->altcx[i].reg_index];
bit = pin_desc->altcx[i].control_bit; bit = pin_desc->altcx[i].control_bit;
if (readl(npct->prcm_base + reg) & BIT(bit)) if (readl(npct->prcm_base + reg) & BIT(bit))
return NMK_GPIO_ALT_C+i+1; return NMK_GPIO_ALT_C + i + 1;
} }
} }
return NMK_GPIO_ALT_C; return NMK_GPIO_ALT_C;
...@@ -513,7 +513,7 @@ static int nmk_get_groups_cnt(struct pinctrl_dev *pctldev) ...@@ -513,7 +513,7 @@ static int nmk_get_groups_cnt(struct pinctrl_dev *pctldev)
} }
static const char *nmk_get_group_name(struct pinctrl_dev *pctldev, static const char *nmk_get_group_name(struct pinctrl_dev *pctldev,
unsigned int selector) unsigned int selector)
{ {
struct nmk_pinctrl *npct = pinctrl_dev_get_drvdata(pctldev); struct nmk_pinctrl *npct = pinctrl_dev_get_drvdata(pctldev);
...@@ -536,12 +536,12 @@ static struct nmk_gpio_chip *find_nmk_gpio_from_pin(unsigned int pin) ...@@ -536,12 +536,12 @@ static struct nmk_gpio_chip *find_nmk_gpio_from_pin(unsigned int pin)
int i; int i;
struct nmk_gpio_chip *nmk_gpio; struct nmk_gpio_chip *nmk_gpio;
for(i = 0; i < NMK_MAX_BANKS; i++) { for (i = 0; i < NMK_MAX_BANKS; i++) {
nmk_gpio = nmk_gpio_chips[i]; nmk_gpio = nmk_gpio_chips[i];
if (!nmk_gpio) if (!nmk_gpio)
continue; continue;
if (pin >= nmk_gpio->chip.base && if (pin >= nmk_gpio->chip.base &&
pin < nmk_gpio->chip.base + nmk_gpio->chip.ngpio) pin < nmk_gpio->chip.base + nmk_gpio->chip.ngpio)
return nmk_gpio; return nmk_gpio;
} }
return NULL; return NULL;
...@@ -557,7 +557,7 @@ static struct gpio_chip *find_gc_from_pin(unsigned int pin) ...@@ -557,7 +557,7 @@ static struct gpio_chip *find_gc_from_pin(unsigned int pin)
} }
static void nmk_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, static void nmk_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,
unsigned int offset) unsigned int offset)
{ {
struct gpio_chip *chip = find_gc_from_pin(offset); struct gpio_chip *chip = find_gc_from_pin(offset);
...@@ -569,8 +569,8 @@ static void nmk_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, ...@@ -569,8 +569,8 @@ static void nmk_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,
} }
static int nmk_dt_add_map_mux(struct pinctrl_map **map, unsigned int *reserved_maps, static int nmk_dt_add_map_mux(struct pinctrl_map **map, unsigned int *reserved_maps,
unsigned int *num_maps, const char *group, unsigned int *num_maps, const char *group,
const char *function) const char *function)
{ {
if (*num_maps == *reserved_maps) if (*num_maps == *reserved_maps)
return -ENOSPC; return -ENOSPC;
...@@ -584,9 +584,9 @@ static int nmk_dt_add_map_mux(struct pinctrl_map **map, unsigned int *reserved_m ...@@ -584,9 +584,9 @@ static int nmk_dt_add_map_mux(struct pinctrl_map **map, unsigned int *reserved_m
} }
static int nmk_dt_add_map_configs(struct pinctrl_map **map, static int nmk_dt_add_map_configs(struct pinctrl_map **map,
unsigned int *reserved_maps, unsigned int *reserved_maps,
unsigned int *num_maps, const char *group, unsigned int *num_maps, const char *group,
unsigned long *configs, unsigned int num_configs) unsigned long *configs, unsigned int num_configs)
{ {
unsigned long *dup_configs; unsigned long *dup_configs;
...@@ -702,15 +702,14 @@ static const char *nmk_find_pin_name(struct pinctrl_dev *pctldev, const char *pi ...@@ -702,15 +702,14 @@ static const char *nmk_find_pin_name(struct pinctrl_dev *pctldev, const char *pi
} }
static bool nmk_pinctrl_dt_get_config(struct device_node *np, static bool nmk_pinctrl_dt_get_config(struct device_node *np,
unsigned long *configs) unsigned long *configs)
{ {
bool has_config = 0; bool has_config = 0;
unsigned long cfg = 0; unsigned long cfg = 0;
int i, val, ret; int i, val, ret;
for (i = 0; i < ARRAY_SIZE(nmk_cfg_params); i++) { for (i = 0; i < ARRAY_SIZE(nmk_cfg_params); i++) {
ret = of_property_read_u32(np, ret = of_property_read_u32(np, nmk_cfg_params[i].property, &val);
nmk_cfg_params[i].property, &val);
if (ret != -EINVAL) { if (ret != -EINVAL) {
if (nmk_dt_pin_config(i, val, &cfg) == 0) { if (nmk_dt_pin_config(i, val, &cfg) == 0) {
*configs |= cfg; *configs |= cfg;
...@@ -723,10 +722,10 @@ static bool nmk_pinctrl_dt_get_config(struct device_node *np, ...@@ -723,10 +722,10 @@ static bool nmk_pinctrl_dt_get_config(struct device_node *np,
} }
static int nmk_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev, static int nmk_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
struct device_node *np, struct device_node *np,
struct pinctrl_map **map, struct pinctrl_map **map,
unsigned int *reserved_maps, unsigned int *reserved_maps,
unsigned int *num_maps) unsigned int *num_maps)
{ {
int ret; int ret;
const char *function = NULL; const char *function = NULL;
...@@ -751,7 +750,7 @@ static int nmk_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev, ...@@ -751,7 +750,7 @@ static int nmk_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
of_property_for_each_string(np, "groups", prop, group) { of_property_for_each_string(np, "groups", prop, group) {
ret = nmk_dt_add_map_mux(map, reserved_maps, num_maps, ret = nmk_dt_add_map_mux(map, reserved_maps, num_maps,
group, function); group, function);
if (ret < 0) if (ret < 0)
goto exit; goto exit;
} }
...@@ -792,8 +791,9 @@ static int nmk_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev, ...@@ -792,8 +791,9 @@ static int nmk_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
} }
static int nmk_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, static int nmk_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
struct device_node *np_config, struct device_node *np_config,
struct pinctrl_map **map, unsigned int *num_maps) struct pinctrl_map **map,
unsigned int *num_maps)
{ {
unsigned int reserved_maps; unsigned int reserved_maps;
struct device_node *np; struct device_node *np;
...@@ -805,7 +805,7 @@ static int nmk_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, ...@@ -805,7 +805,7 @@ static int nmk_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
for_each_child_of_node(np_config, np) { for_each_child_of_node(np_config, np) {
ret = nmk_pinctrl_dt_subnode_to_map(pctldev, np, map, ret = nmk_pinctrl_dt_subnode_to_map(pctldev, np, map,
&reserved_maps, num_maps); &reserved_maps, num_maps);
if (ret < 0) { if (ret < 0) {
pinctrl_utils_free_map(pctldev, *map, *num_maps); pinctrl_utils_free_map(pctldev, *map, *num_maps);
of_node_put(np); of_node_put(np);
...@@ -922,7 +922,8 @@ static int nmk_pmx_set(struct pinctrl_dev *pctldev, unsigned int function, ...@@ -922,7 +922,8 @@ static int nmk_pmx_set(struct pinctrl_dev *pctldev, unsigned int function,
g->grp.pins[i], g->grp.name, i); g->grp.pins[i], g->grp.name, i);
goto out_glitch; goto out_glitch;
} }
dev_dbg(npct->dev, "setting pin %d to altsetting %d\n", g->grp.pins[i], g->altsetting); dev_dbg(npct->dev, "setting pin %d to altsetting %d\n",
g->grp.pins[i], g->altsetting);
clk_enable(nmk_chip->clk); clk_enable(nmk_chip->clk);
bit = g->grp.pins[i] % NMK_GPIO_PER_CHIP; bit = g->grp.pins[i] % NMK_GPIO_PER_CHIP;
...@@ -936,7 +937,7 @@ static int nmk_pmx_set(struct pinctrl_dev *pctldev, unsigned int function, ...@@ -936,7 +937,7 @@ static int nmk_pmx_set(struct pinctrl_dev *pctldev, unsigned int function,
nmk_gpio_disable_lazy_irq(nmk_chip, bit); nmk_gpio_disable_lazy_irq(nmk_chip, bit);
__nmk_gpio_set_mode_safe(nmk_chip, bit, __nmk_gpio_set_mode_safe(nmk_chip, bit,
(g->altsetting & NMK_GPIO_ALT_C), glitch); (g->altsetting & NMK_GPIO_ALT_C), glitch);
clk_disable(nmk_chip->clk); clk_disable(nmk_chip->clk);
/* /*
...@@ -949,7 +950,7 @@ static int nmk_pmx_set(struct pinctrl_dev *pctldev, unsigned int function, ...@@ -949,7 +950,7 @@ static int nmk_pmx_set(struct pinctrl_dev *pctldev, unsigned int function,
*/ */
if ((g->altsetting & NMK_GPIO_ALT_C) == NMK_GPIO_ALT_C) if ((g->altsetting & NMK_GPIO_ALT_C) == NMK_GPIO_ALT_C)
nmk_prcm_altcx_set_mode(npct, g->grp.pins[i], nmk_prcm_altcx_set_mode(npct, g->grp.pins[i],
g->altsetting >> NMK_GPIO_ALT_CX_SHIFT); g->altsetting >> NMK_GPIO_ALT_CX_SHIFT);
} }
/* When all pins are successfully reconfigured we get here */ /* When all pins are successfully reconfigured we get here */
...@@ -1221,8 +1222,7 @@ static int nmk_pinctrl_probe(struct platform_device *pdev) ...@@ -1221,8 +1222,7 @@ static int nmk_pinctrl_probe(struct platform_device *pdev)
if (!npct->prcm_base) { if (!npct->prcm_base) {
if (version == PINCTRL_NMK_STN8815) { if (version == PINCTRL_NMK_STN8815) {
dev_info(&pdev->dev, dev_info(&pdev->dev,
"No PRCM base, " "No PRCM base, assuming no ALT-Cx control is available\n");
"assuming no ALT-Cx control is available\n");
} else { } else {
dev_err(&pdev->dev, "missing PRCM base address\n"); dev_err(&pdev->dev, "missing PRCM base address\n");
return -EINVAL; return -EINVAL;
......
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