aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-17 15:32:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-17 15:32:01 -0500
commit58cf279acac3080ce03eeea5ca268210b3165fe1 (patch)
tree54997706fbfea2cd9fd4c4044edbd8ecdc154dfb /sound
parent6606b342febfd470b4a33acb73e360eeaca1d9bb (diff)
parentc474e348778bdf5b453a2cdff4b2b1f9e000f343 (diff)
Merge tag 'gpio-v4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO updates from Linus Walleij: "Here is the bulk of GPIO changes for v4.5. Notably there are big refactorings mostly by myself, aimed at getting the gpio_chip into a shape that makes me believe I can proceed to preserve state for a proper userspace ABI (character device) that has already been proposed once, but resulted in the feedback that I need to go back and restructure stuff. So I've been restructuring stuff. On the way I ran into brokenness (return code from the get_value() callback) and had to fix it. Also, refactored generic GPIO to be simpler. Some of that is still waiting to trickle down from the subsystems all over the kernel that provide random gpio_chips, I've touched every single GPIO driver in the kernel now, oh man I didn't know I was responsible for so much... Apart from that we're churning along as usual. I took some effort to test and retest so it should merge nicely and we shook out a couple of bugs in -next. Infrastructural changes: - In struct gpio_chip, rename the .dev node to .parent to better reflect the fact that this is not the GPIO struct device abstraction. We will add that soon so this would be totallt confusing. - It was noted that the driver .get_value() callbacks was sometimes reporting negative -ERR values to the gpiolib core, expecting them to be propagated to consumer gpiod_get_value() and gpio_get_value() calls. This was not happening, so as there was a mess of drivers returning negative errors and some returning "anything else than zero" to indicate that a line was active. As some would have bit 31 set to indicate "line active" it clashed with negative error codes. This is fixed by the largeish series clamping values in all drivers with !!value to [0,1] and then augmenting the code to propagate error codes to consumers. (Includes some ACKed patches in other subsystems.) - Add a void *data pointer to struct gpio_chip. The container_of() design pattern is indeed very nice, but we want to reform the struct gpio_chip to be a non-volative, stateless business, and keep states internal to the gpiolib to be able to hold on to the state when adding a proper userspace ABI (character device) further down the road. To achieve this, drivers need a handle at the internal state that is not dependent on their struct gpio_chip() so we add gpiochip_add_data() and gpiochip_get_data() following the pattern of many other subsystems. All the "use gpiochip data pointer" patches transforms drivers to this scheme. - The Generic GPIO chip header has been merged into the general <linux/gpio/driver.h> header, and the custom header for that removed. Instead of having a separate mm_gpio_chip struct for these generic drivers, merge that into struct gpio_chip, simplifying the code and removing the need for separate and confusing includes. Misc improvements: - Stabilize the way GPIOs are looked up from the ACPI legacy specification. - Incremental driver features for PXA, PCA953X, Lantiq (patches from the OpenWRT community), RCAR, Zynq, PL061, 104-idi-48 New drivers: - Add a GPIO chip to the ALSA SoC AC97 driver. - Add a new Broadcom NSP SoC driver (this lands in the pinctrl dir, but the branch is merged here too to account for infrastructural changes). - The sx150x driver now supports the sx1502" * tag 'gpio-v4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (220 commits) gpio: generic: make bgpio_pdata always visible gpiolib: fix chip order in gpio list gpio: mpc8xxx: Do not use gpiochip_get_data() in mpc8xxx_gpio_save_regs() gpio: mm-lantiq: Do not use gpiochip_get_data() in ltq_mm_save_regs() gpio: brcmstb: Allow building driver for BMIPS_GENERIC gpio: brcmstb: Set endian flags for big-endian MIPS gpio: moxart: fix build regression gpio: xilinx: Do not use gpiochip_get_data() in xgpio_save_regs() leds: pca9532: use gpiochip data pointer leds: tca6507: use gpiochip data pointer hid: cp2112: use gpiochip data pointer bcma: gpio: use gpiochip data pointer avr32: gpio: use gpiochip data pointer video: fbdev: via: use gpiochip data pointer gpio: pch: Optimize pch_gpio_get() Revert "pinctrl: lantiq: Implement gpio_chip.to_irq" pinctrl: nsp-gpio: use gpiochip data pointer pinctrl: vt8500-wmt: use gpiochip data pointer pinctrl: exynos5440: use gpiochip data pointer pinctrl: at91-pio4: use gpiochip data pointer ...
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/rt5677.c2
-rw-r--r--sound/soc/codecs/wm5100.c2
-rw-r--r--sound/soc/codecs/wm8903.c2
-rw-r--r--sound/soc/codecs/wm8962.c2
-rw-r--r--sound/soc/codecs/wm8996.c2
-rw-r--r--sound/soc/soc-ac97.c2
6 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 967678e7f48e..33e290b703df 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -4694,7 +4694,7 @@ static void rt5677_init_gpio(struct i2c_client *i2c)
4694 4694
4695 rt5677->gpio_chip = rt5677_template_chip; 4695 rt5677->gpio_chip = rt5677_template_chip;
4696 rt5677->gpio_chip.ngpio = RT5677_GPIO_NUM; 4696 rt5677->gpio_chip.ngpio = RT5677_GPIO_NUM;
4697 rt5677->gpio_chip.dev = &i2c->dev; 4697 rt5677->gpio_chip.parent = &i2c->dev;
4698 rt5677->gpio_chip.base = -1; 4698 rt5677->gpio_chip.base = -1;
4699 4699
4700 ret = gpiochip_add(&rt5677->gpio_chip); 4700 ret = gpiochip_add(&rt5677->gpio_chip);
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c
index c2cdcae18ff6..171a23ddd15d 100644
--- a/sound/soc/codecs/wm5100.c
+++ b/sound/soc/codecs/wm5100.c
@@ -2306,7 +2306,7 @@ static void wm5100_init_gpio(struct i2c_client *i2c)
2306 2306
2307 wm5100->gpio_chip = wm5100_template_chip; 2307 wm5100->gpio_chip = wm5100_template_chip;
2308 wm5100->gpio_chip.ngpio = 6; 2308 wm5100->gpio_chip.ngpio = 6;
2309 wm5100->gpio_chip.dev = &i2c->dev; 2309 wm5100->gpio_chip.parent = &i2c->dev;
2310 2310
2311 if (wm5100->pdata.gpio_base) 2311 if (wm5100->pdata.gpio_base)
2312 wm5100->gpio_chip.base = wm5100->pdata.gpio_base; 2312 wm5100->gpio_chip.base = wm5100->pdata.gpio_base;
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index 2ed6419c181e..a82b8bc2cfc0 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -1853,7 +1853,7 @@ static void wm8903_init_gpio(struct wm8903_priv *wm8903)
1853 1853
1854 wm8903->gpio_chip = wm8903_template_chip; 1854 wm8903->gpio_chip = wm8903_template_chip;
1855 wm8903->gpio_chip.ngpio = WM8903_NUM_GPIO; 1855 wm8903->gpio_chip.ngpio = WM8903_NUM_GPIO;
1856 wm8903->gpio_chip.dev = wm8903->dev; 1856 wm8903->gpio_chip.parent = wm8903->dev;
1857 1857
1858 if (pdata->gpio_base) 1858 if (pdata->gpio_base)
1859 wm8903->gpio_chip.base = pdata->gpio_base; 1859 wm8903->gpio_chip.base = pdata->gpio_base;
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 949f632fc3f8..88223608a33f 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3379,7 +3379,7 @@ static void wm8962_init_gpio(struct snd_soc_codec *codec)
3379 3379
3380 wm8962->gpio_chip = wm8962_template_chip; 3380 wm8962->gpio_chip = wm8962_template_chip;
3381 wm8962->gpio_chip.ngpio = WM8962_MAX_GPIO; 3381 wm8962->gpio_chip.ngpio = WM8962_MAX_GPIO;
3382 wm8962->gpio_chip.dev = codec->dev; 3382 wm8962->gpio_chip.parent = codec->dev;
3383 3383
3384 if (pdata->gpio_base) 3384 if (pdata->gpio_base)
3385 wm8962->gpio_chip.base = pdata->gpio_base; 3385 wm8962->gpio_chip.base = pdata->gpio_base;
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index f7ccd9fc5808..8d7d6c01a2f7 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -2204,7 +2204,7 @@ static void wm8996_init_gpio(struct wm8996_priv *wm8996)
2204 2204
2205 wm8996->gpio_chip = wm8996_template_chip; 2205 wm8996->gpio_chip = wm8996_template_chip;
2206 wm8996->gpio_chip.ngpio = 5; 2206 wm8996->gpio_chip.ngpio = 5;
2207 wm8996->gpio_chip.dev = wm8996->dev; 2207 wm8996->gpio_chip.parent = wm8996->dev;
2208 2208
2209 if (wm8996->pdata.gpio_base) 2209 if (wm8996->pdata.gpio_base)
2210 wm8996->gpio_chip.base = wm8996->pdata.gpio_base; 2210 wm8996->gpio_chip.base = wm8996->pdata.gpio_base;
diff --git a/sound/soc/soc-ac97.c b/sound/soc/soc-ac97.c
index 733f5128eeff..7e0acd83b0e6 100644
--- a/sound/soc/soc-ac97.c
+++ b/sound/soc/soc-ac97.c
@@ -142,7 +142,7 @@ static int snd_soc_ac97_init_gpio(struct snd_ac97 *ac97,
142 gpio_priv->codec = codec; 142 gpio_priv->codec = codec;
143 gpio_priv->gpio_chip = snd_soc_ac97_gpio_chip; 143 gpio_priv->gpio_chip = snd_soc_ac97_gpio_chip;
144 gpio_priv->gpio_chip.ngpio = AC97_NUM_GPIOS; 144 gpio_priv->gpio_chip.ngpio = AC97_NUM_GPIOS;
145 gpio_priv->gpio_chip.dev = codec->dev; 145 gpio_priv->gpio_chip.parent = codec->dev;
146 gpio_priv->gpio_chip.base = -1; 146 gpio_priv->gpio_chip.base = -1;
147 147
148 ret = gpiochip_add(&gpio_priv->gpio_chip); 148 ret = gpiochip_add(&gpio_priv->gpio_chip);