Commit 2427d69c authored by Linus Walleij's avatar Linus Walleij
Browse files

Merge tag 'intel-pinctrl-v6.16-1' of...

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: default avatarLinus Walleij <linus.walleij@linaro.org>
parents ebbe8bfe 3b440803
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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,
};
+4 −2
Original line number Diff line number Diff line
@@ -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)
+14 −6
Original line number Diff line number Diff line
@@ -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,7 +1034,7 @@ 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,
static int intel_gpio_set(struct gpio_chip *chip, unsigned int offset,
			  int value)
{
	struct intel_pinctrl *pctrl = gpiochip_get_data(chip);
@@ -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,
};

+4 −2
Original line number Diff line number Diff line
@@ -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;