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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAmh0vkUACgkQb7wzTHR8
 rChJog//d7qFpQgZt0oDNAmiFJDThWf+Fb+AwFyDWogu1Q4k9YHpQUcUbyuvBlHk
 6U2ORV4iHBt2Elo1lcPvXwtyGzY+z3zGPR2/sFbTV1jPhxBNWtc0QF8xZZ9lrTCr
 EgRLsQrDD+JngUVtwQ8EWrLNfu+2g6MDVBTnMJ6cLWXbzIjIyCClE5tyPp2Ro9kZ
 f+XTuW1BB6qzDCNk+XURd5mflfw2YI/ZNYfWsx7+/6YT5tPqWvmAnc4xgX0samLw
 XQShZcV3a4SFiN+K5+tix1YhUcEu3hudL9RaeSw3HfXHPruCTvW+p4UFy7aO9Vf0
 CsNupQ2OV6VVPFJq1upvZKoJ1W1DKQ7faq4FuftrYaKQ2sTgRvTTWthUf1y7sCDV
 MVghTv4Qh4HKwfD2me50CgHfwx9ElgwSi+NQcccVXBBaVJDxXFibr01qElaZ54g2
 BUa80wQ70btP3IWQwsNfobxlHEljRyUjydfbxGMwOMLzOYYlU3TlTev8bhb647ne
 VQHwQtgHi6Xwqg1ZzBLWyccdJoLepJcq1z1po4hcR5tZ3aor306T+14ad8LCIvRg
 qnCazp+/+Nff/2xNg8hx+wRZmTduJsc4379qzGyfRCMWPqi2kzAENz8VxqKl7R6f
 mmUGoL8ojwJ6wvWcA87EAAyWFxoQmXv5+TQQ0hWyRkpe+dMzUUg=
 =bbK4
 -----END PGP SIGNATURE-----

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 <linus.walleij@linaro.org>
This commit is contained in:
Linus Walleij 2025-07-14 17:55:30 +02:00
commit 2427d69c3d
4 changed files with 27 additions and 13 deletions

View File

@ -1045,7 +1045,7 @@ static int byt_gpio_get(struct gpio_chip *chip, unsigned int offset)
return !!(val & BYT_LEVEL);
}
static void byt_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
static int byt_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
{
struct intel_pinctrl *vg = gpiochip_get_data(chip);
void __iomem *reg;
@ -1053,7 +1053,7 @@ static void byt_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
reg = byt_gpio_reg(vg, offset, BYT_VAL_REG);
if (!reg)
return;
return -EINVAL;
guard(raw_spinlock_irqsave)(&byt_lock);
@ -1062,6 +1062,8 @@ static void byt_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
writel(old_val | BYT_LEVEL, reg);
else
writel(old_val & ~BYT_LEVEL, reg);
return 0;
}
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 = {
.direction_input = byt_gpio_direction_input,
.direction_output = byt_gpio_direction_output,
.get = byt_gpio_get,
.set = byt_gpio_set,
.set_rv = byt_gpio_set,
.set_config = gpiochip_generic_config,
.dbg_show = byt_gpio_dbg_show,
};

View File

@ -1112,7 +1112,7 @@ static int chv_gpio_get(struct gpio_chip *chip, unsigned int offset)
return !!(ctrl0 & CHV_PADCTRL0_GPIORXSTATE);
}
static void chv_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
static int chv_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
{
struct intel_pinctrl *pctrl = gpiochip_get_data(chip);
u32 ctrl0;
@ -1127,6 +1127,8 @@ static void chv_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
ctrl0 &= ~CHV_PADCTRL0_GPIOTXSTATE;
chv_writel(pctrl, offset, CHV_PADCTRL0, ctrl0);
return 0;
}
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 = {
.direction_input = chv_gpio_direction_input,
.direction_output = chv_gpio_direction_output,
.get = chv_gpio_get,
.set = chv_gpio_set,
.set_rv = chv_gpio_set,
};
static void chv_gpio_irq_ack(struct irq_data *d)

View File

@ -9,6 +9,7 @@
#include <linux/acpi.h>
#include <linux/cleanup.h>
#include <linux/export.h>
#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/log2.h>
@ -1033,8 +1034,8 @@ static int intel_gpio_get(struct gpio_chip *chip, unsigned int offset)
return !!(padcfg0 & PADCFG0_GPIORXSTATE);
}
static void intel_gpio_set(struct gpio_chip *chip, unsigned int offset,
int value)
static int intel_gpio_set(struct gpio_chip *chip, unsigned int offset,
int value)
{
struct intel_pinctrl *pctrl = gpiochip_get_data(chip);
void __iomem *reg;
@ -1043,11 +1044,11 @@ static void intel_gpio_set(struct gpio_chip *chip, unsigned int offset,
pin = intel_gpio_to_pin(pctrl, offset, NULL, NULL);
if (pin < 0)
return;
return -EINVAL;
reg = intel_get_padcfg(pctrl, pin, PADCFG0);
if (!reg)
return;
return -EINVAL;
guard(raw_spinlock_irqsave)(&pctrl->lock);
@ -1057,6 +1058,8 @@ static void intel_gpio_set(struct gpio_chip *chip, unsigned int offset,
else
padcfg0 &= ~PADCFG0_GPIOTXSTATE;
writel(padcfg0, reg);
return 0;
}
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
static int intel_gpio_direction_output(struct gpio_chip *chip, unsigned int offset,
int value)
{
intel_gpio_set(chip, offset, value);
int ret;
ret = intel_gpio_set(chip, offset, value);
if (ret)
return ret;
return pinctrl_gpio_direction_output(chip, offset);
}
@ -1106,7 +1114,7 @@ static const struct gpio_chip intel_gpio_chip = {
.direction_input = intel_gpio_direction_input,
.direction_output = intel_gpio_direction_output,
.get = intel_gpio_get,
.set = intel_gpio_set,
.set_rv = intel_gpio_set,
.set_config = gpiochip_generic_config,
};

View File

@ -503,7 +503,7 @@ static int lp_gpio_get(struct gpio_chip *chip, unsigned int offset)
return !!(ioread32(reg) & IN_LVL_BIT);
}
static void lp_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
static int lp_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
{
struct intel_pinctrl *lg = gpiochip_get_data(chip);
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)
iowrite32(ioread32(reg) | OUT_LVL_BIT, reg);
else
iowrite32(ioread32(reg) & ~OUT_LVL_BIT, reg);
return 0;
}
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)
gc->direction_input = lp_gpio_direction_input;
gc->direction_output = lp_gpio_direction_output;
gc->get = lp_gpio_get;
gc->set = lp_gpio_set;
gc->set_rv = lp_gpio_set;
gc->set_config = gpiochip_generic_config;
gc->get_direction = lp_gpio_get_direction;
gc->base = -1;