Skip to content

Commit 2427d69

Browse files
committed
Merge tag 'intel-pinctrl-v6.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into devel
intel-pinctrl for v6.16-1 * Use new GPIO line value setter callbacks (Bartosz Golaszewski) * Add missed export.h to the main driver The following is an automated git shortlog grouped by driver: baytrail: - use new GPIO line value setter callbacks cherryview: - use new GPIO line value setter callbacks intel: - fix build warnings about export.h - use new GPIO line value setter callbacks lynxpoint: - use new GPIO line value setter callbacks Signed-off-by: Linus Walleij <[email protected]>
2 parents ebbe8bf + 3b44080 commit 2427d69

File tree

4 files changed

+27
-13
lines changed

4 files changed

+27
-13
lines changed

drivers/pinctrl/intel/pinctrl-baytrail.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,15 +1045,15 @@ static int byt_gpio_get(struct gpio_chip *chip, unsigned int offset)
10451045
return !!(val & BYT_LEVEL);
10461046
}
10471047

1048-
static void byt_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
1048+
static int byt_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
10491049
{
10501050
struct intel_pinctrl *vg = gpiochip_get_data(chip);
10511051
void __iomem *reg;
10521052
u32 old_val;
10531053

10541054
reg = byt_gpio_reg(vg, offset, BYT_VAL_REG);
10551055
if (!reg)
1056-
return;
1056+
return -EINVAL;
10571057

10581058
guard(raw_spinlock_irqsave)(&byt_lock);
10591059

@@ -1062,6 +1062,8 @@ static void byt_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
10621062
writel(old_val | BYT_LEVEL, reg);
10631063
else
10641064
writel(old_val & ~BYT_LEVEL, reg);
1065+
1066+
return 0;
10651067
}
10661068

10671069
static int byt_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
@@ -1229,7 +1231,7 @@ static const struct gpio_chip byt_gpio_chip = {
12291231
.direction_input = byt_gpio_direction_input,
12301232
.direction_output = byt_gpio_direction_output,
12311233
.get = byt_gpio_get,
1232-
.set = byt_gpio_set,
1234+
.set_rv = byt_gpio_set,
12331235
.set_config = gpiochip_generic_config,
12341236
.dbg_show = byt_gpio_dbg_show,
12351237
};

drivers/pinctrl/intel/pinctrl-cherryview.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ static int chv_gpio_get(struct gpio_chip *chip, unsigned int offset)
11121112
return !!(ctrl0 & CHV_PADCTRL0_GPIORXSTATE);
11131113
}
11141114

1115-
static void chv_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
1115+
static int chv_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
11161116
{
11171117
struct intel_pinctrl *pctrl = gpiochip_get_data(chip);
11181118
u32 ctrl0;
@@ -1127,6 +1127,8 @@ static void chv_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
11271127
ctrl0 &= ~CHV_PADCTRL0_GPIOTXSTATE;
11281128

11291129
chv_writel(pctrl, offset, CHV_PADCTRL0, ctrl0);
1130+
1131+
return 0;
11301132
}
11311133

11321134
static int chv_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
@@ -1166,7 +1168,7 @@ static const struct gpio_chip chv_gpio_chip = {
11661168
.direction_input = chv_gpio_direction_input,
11671169
.direction_output = chv_gpio_direction_output,
11681170
.get = chv_gpio_get,
1169-
.set = chv_gpio_set,
1171+
.set_rv = chv_gpio_set,
11701172
};
11711173

11721174
static void chv_gpio_irq_ack(struct irq_data *d)

drivers/pinctrl/intel/pinctrl-intel.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <linux/acpi.h>
1111
#include <linux/cleanup.h>
12+
#include <linux/export.h>
1213
#include <linux/gpio/driver.h>
1314
#include <linux/interrupt.h>
1415
#include <linux/log2.h>
@@ -1033,8 +1034,8 @@ static int intel_gpio_get(struct gpio_chip *chip, unsigned int offset)
10331034
return !!(padcfg0 & PADCFG0_GPIORXSTATE);
10341035
}
10351036

1036-
static void intel_gpio_set(struct gpio_chip *chip, unsigned int offset,
1037-
int value)
1037+
static int intel_gpio_set(struct gpio_chip *chip, unsigned int offset,
1038+
int value)
10381039
{
10391040
struct intel_pinctrl *pctrl = gpiochip_get_data(chip);
10401041
void __iomem *reg;
@@ -1043,11 +1044,11 @@ static void intel_gpio_set(struct gpio_chip *chip, unsigned int offset,
10431044

10441045
pin = intel_gpio_to_pin(pctrl, offset, NULL, NULL);
10451046
if (pin < 0)
1046-
return;
1047+
return -EINVAL;
10471048

10481049
reg = intel_get_padcfg(pctrl, pin, PADCFG0);
10491050
if (!reg)
1050-
return;
1051+
return -EINVAL;
10511052

10521053
guard(raw_spinlock_irqsave)(&pctrl->lock);
10531054

@@ -1057,6 +1058,8 @@ static void intel_gpio_set(struct gpio_chip *chip, unsigned int offset,
10571058
else
10581059
padcfg0 &= ~PADCFG0_GPIOTXSTATE;
10591060
writel(padcfg0, reg);
1061+
1062+
return 0;
10601063
}
10611064

10621065
static int intel_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
@@ -1094,7 +1097,12 @@ static int intel_gpio_direction_input(struct gpio_chip *chip, unsigned int offse
10941097
static int intel_gpio_direction_output(struct gpio_chip *chip, unsigned int offset,
10951098
int value)
10961099
{
1097-
intel_gpio_set(chip, offset, value);
1100+
int ret;
1101+
1102+
ret = intel_gpio_set(chip, offset, value);
1103+
if (ret)
1104+
return ret;
1105+
10981106
return pinctrl_gpio_direction_output(chip, offset);
10991107
}
11001108

@@ -1106,7 +1114,7 @@ static const struct gpio_chip intel_gpio_chip = {
11061114
.direction_input = intel_gpio_direction_input,
11071115
.direction_output = intel_gpio_direction_output,
11081116
.get = intel_gpio_get,
1109-
.set = intel_gpio_set,
1117+
.set_rv = intel_gpio_set,
11101118
.set_config = gpiochip_generic_config,
11111119
};
11121120

drivers/pinctrl/intel/pinctrl-lynxpoint.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ static int lp_gpio_get(struct gpio_chip *chip, unsigned int offset)
503503
return !!(ioread32(reg) & IN_LVL_BIT);
504504
}
505505

506-
static void lp_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
506+
static int lp_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
507507
{
508508
struct intel_pinctrl *lg = gpiochip_get_data(chip);
509509
void __iomem *reg = lp_gpio_reg(chip, offset, LP_CONFIG1);
@@ -514,6 +514,8 @@ static void lp_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
514514
iowrite32(ioread32(reg) | OUT_LVL_BIT, reg);
515515
else
516516
iowrite32(ioread32(reg) & ~OUT_LVL_BIT, reg);
517+
518+
return 0;
517519
}
518520

519521
static int lp_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
@@ -775,7 +777,7 @@ static int lp_gpio_probe(struct platform_device *pdev)
775777
gc->direction_input = lp_gpio_direction_input;
776778
gc->direction_output = lp_gpio_direction_output;
777779
gc->get = lp_gpio_get;
778-
gc->set = lp_gpio_set;
780+
gc->set_rv = lp_gpio_set;
779781
gc->set_config = gpiochip_generic_config;
780782
gc->get_direction = lp_gpio_get_direction;
781783
gc->base = -1;

0 commit comments

Comments
 (0)