OSDN Git Service

uclinux-h8/linux.git
8 years agogpio: mpc8xxx: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 09:34:28 +0000 (10:34 +0100)]
gpio: mpc8xxx: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: mpc5200: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 09:25:36 +0000 (10:25 +0100)]
gpio: mpc5200: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: mm-lantiq: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 09:19:29 +0000 (10:19 +0100)]
gpio: mm-lantiq: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: John Crispin <blogic@openwrt.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: ml-ioh: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 09:12:05 +0000 (10:12 +0100)]
gpio: ml-ioh: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Feng Tang <feng.tang@intel.com>
Cc: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: mcp: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 09:09:36 +0000 (10:09 +0100)]
gpio: mcp: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: mc9s08dz60: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 09:07:07 +0000 (10:07 +0100)]
gpio: mc9s08dz60: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: wu guoxing <b39297@freescale.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: mc33880: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 09:04:32 +0000 (10:04 +0100)]
gpio: mc33880: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: mb86s7x: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 09:01:36 +0000 (10:01 +0100)]
gpio: mb86s7x: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Acked-By: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: max732x: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 08:58:28 +0000 (09:58 +0100)]
gpio: max732x: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Nicholas Krause <xerofoify@gmail.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Semen Protsenko <semen.protsenko@globallogic.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: max730x: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 08:27:05 +0000 (09:27 +0100)]
gpio: max730x: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Roland Stigge <stigge@antcom.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: lynxpoint: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 08:21:55 +0000 (09:21 +0100)]
gpio: lynxpoint: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: lpc32xx: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 08:18:23 +0000 (09:18 +0100)]
gpio: lpc32xx: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Roland Stigge <stigge@antcom.de>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: lpc18xx: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 08:13:57 +0000 (09:13 +0100)]
gpio: lpc18xx: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Acked-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: lp3943: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 08:10:13 +0000 (09:10 +0100)]
gpio: lp3943: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Milo Kim <milo.kim@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: kempld: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 08:06:22 +0000 (09:06 +0100)]
gpio: kempld: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Brunner Michael <Michael.Brunner@kontron.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: it87: use gpiochip data pointer
Linus Walleij [Mon, 7 Dec 2015 08:03:09 +0000 (09:03 +0100)]
gpio: it87: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Diego Elio Pettenò <flameeyes@flameeyes.eu>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: intel-mid: use gpiochip data pointer
Linus Walleij [Sun, 6 Dec 2015 09:55:28 +0000 (10:55 +0100)]
gpio: intel-mid: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: David Cohen <david.a.cohen@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: f7188: use gpiochip data pointer
Linus Walleij [Sun, 6 Dec 2015 09:51:13 +0000 (10:51 +0100)]
gpio: f7188: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Andreas Bofjall <andreas@gazonk.org>
Cc: Simon Guinot <simon.guinot@sequanux.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: em: use gpiochip data pointer
Linus Walleij [Sat, 5 Dec 2015 23:36:39 +0000 (00:36 +0100)]
gpio: em: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Magnus Damm <damm@opensource.se>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: dln2: use gpiochip data pointer
Linus Walleij [Sat, 5 Dec 2015 23:32:16 +0000 (00:32 +0100)]
gpio: dln2: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Octavian Purdila <octavian.purdila@intel.com>
Cc: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: davinci: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 15:25:04 +0000 (16:25 +0100)]
gpio: davinci: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: da9055: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 15:21:53 +0000 (16:21 +0100)]
gpio: da9055: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Ashish Jangam <ashish.jangam@kpitcummins.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: da9052: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 15:19:52 +0000 (16:19 +0100)]
gpio: da9052: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Ashish Jangam <ashish.jangam@kpitcummins.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: cs5535: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 14:53:04 +0000 (15:53 +0100)]
gpio: cs5535: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: crystalcove: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 14:47:54 +0000 (15:47 +0100)]
gpio: crystalcove: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Shobhit Kumar <shobhit.kumar@intel.com>
Cc: Zhu, Lejun <lejun.zhu@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: bt8xx: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 14:44:16 +0000 (15:44 +0100)]
gpio: bt8xx: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Michael Buesch <m@bues.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: bcm-kona: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 14:39:50 +0000 (15:39 +0100)]
gpio: bcm-kona: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Markus Mayer <markus.mayer@linaro.org>
Cc: Tim Kryger <tim.kryger@linaro.org>
Cc: Matt Porter <matt.porter@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: ath79: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 14:36:14 +0000 (15:36 +0100)]
gpio: ath79: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Acked-by: Alban Bedel <albeu@free.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: arizona: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 14:31:31 +0000 (15:31 +0100)]
gpio: arizona: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Cc: Mark Brown <broonie@kernel.org>
Reviewed-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: amdpt: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 14:29:41 +0000 (15:29 +0100)]
gpio: amdpt: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: YD Tseng <ltyu101@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: amd8111: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 14:26:35 +0000 (15:26 +0100)]
gpio: amd8111: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: altera: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 14:16:43 +0000 (15:16 +0100)]
gpio: altera: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Tien Hock Loh <thloh@altera.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: adp5588: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 14:05:34 +0000 (15:05 +0100)]
gpio: adp5588: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Jean-Francois Dagenais <jeff.dagenais@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: adp5520: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 14:01:50 +0000 (15:01 +0100)]
gpio: adp5520: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: adnp: use gpiochip data pointer
Linus Walleij [Fri, 4 Dec 2015 13:56:15 +0000 (14:56 +0100)]
gpio: adnp: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: 74x164: use gpiochip data pointer
Linus Walleij [Thu, 3 Dec 2015 17:20:29 +0000 (18:20 +0100)]
gpio: 74x164: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: 104-idio-16: use gpiochip data pointer
Linus Walleij [Thu, 3 Dec 2015 17:18:06 +0000 (18:18 +0100)]
gpio: 104-idio-16: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: 104-idi-48: use gpiochip data pointer
Linus Walleij [Thu, 3 Dec 2015 14:31:48 +0000 (15:31 +0100)]
gpio: 104-idi-48: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: generic: factor into gpio_chip struct
Linus Walleij [Fri, 4 Dec 2015 13:02:58 +0000 (14:02 +0100)]
gpio: generic: factor into gpio_chip struct

The separate struct bgpio_chip has been a pain to handle, both
by being confusingly similar in name to struct gpio_chip and
for being contained inside a struct so that struct gpio_chip
is contained in a struct contained in a struct, making several
steps of dereferencing necessary.

Make things simpler: include the fields directly into
<linux/gpio/driver.h>, #ifdef:ed for CONFIG_GENERIC_GPIO, and
get rid of the <linux/basic_mmio_gpio.h> altogether. Prefix
some of the member variables with bgpio_* and add proper
kerneldoc while we're at it.

Modify all users to handle the change and use a struct
gpio_chip directly. And while we're at it: replace all
container_of() dereferencing by gpiochip_get_data() and
registering the gpio_chip with gpiochip_add_data().

Cc: arm@kernel.org
Cc: Alexander Shiyan <shc_work@mail.ru>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Olof Johansson <olof@lixom.net>
Cc: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: Rabin Vincent <rabin@rab.in>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com
Acked-by: Gregory Fong <gregory.0xf0@gmail.com>
Acked-by: Liviu Dudau <Liviu.Dudau@arm.com>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: of: provide optional of_mm_gpiochip_add_data() function
Linus Walleij [Fri, 4 Dec 2015 14:13:53 +0000 (15:13 +0100)]
gpio: of: provide optional of_mm_gpiochip_add_data() function

In the same spirit as we add an optional void *data argument
to the gpiochip_add_data() call, we need this also for
of_mm_gpiochip_add().

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: add a data pointer to gpio_chip
Linus Walleij [Thu, 3 Dec 2015 14:14:13 +0000 (15:14 +0100)]
gpio: add a data pointer to gpio_chip

This adds a void * pointer to gpio_chip so that driver can
assign and retrieve some states. This is done to get rid of
container_of() calls for gpio_chips embedded inside state
containers, so we can remove the need to have the gpio_chip
or later (planned) struct gpio_device be dynamically allocated
at registration time, so that its struct device can be properly
reference counted and not bound to its parent device (e.g.
a platform_device) but instead live on after unregistration
if it is opened by e.g. a char device or sysfs.

The data is added with the new function gpiochip_add_data()
and for compatibility we add static inline wrapper function
gpiochip_add() that will call gpiochip_add_data() with
NULL as argument. The latter will be removed once we have
exorcised gpiochip_add() from the kernel.

gpiochip_get_data() is added as a static inline accessor
for drivers to quickly get their data out.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: pxa: checking IS_ERR() instead of NULL
Dan Carpenter [Tue, 5 Jan 2016 09:56:37 +0000 (12:56 +0300)]
gpio: pxa: checking IS_ERR() instead of NULL

irq_domain_add_legacy() returns NULL on error, it doesn't return error
pointers.

Fixes: 384ca3c6a28d ('gpio: pxa: change the interrupt management')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: generic: fix signedness bug found by cppcheck
Linus Walleij [Tue, 5 Jan 2016 10:13:28 +0000 (11:13 +0100)]
gpio: generic: fix signedness bug found by cppcheck

cppcheck reports this:

(style) int result is returned as long value. If the return
value is long to avoid loss of information, then you have
loss of information.

This can be fixed with (1UL << pin) but that is the same
as using <linux/bitops.h> that already use 1UL so take
this approach.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agofbdev: via-gpio: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 22:03:02 +0000 (23:03 +0100)]
fbdev: via-gpio: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agopinctrl: qcom: fix up errorpath
Linus Walleij [Tue, 5 Jan 2016 09:23:28 +0000 (10:23 +0100)]
pinctrl: qcom: fix up errorpath

This fixes up:
commit 464231fb1fb1360399a2eb11479c47e39facb030
"pinctrl: ssbi-gpio: Be sure to clamp return value"
commit b9164f049339006fafe8a52396e0f1997552214a
"gpio: ssbi-mpp: Be sure to clamp return value"
as I managed to screw up some of the logic when clamping
the return values.

Cc: Björn Andersson <bjorn@kryo.se>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpiolib: always initialize *flags from of_get_named_gpio_flags
Arnd Bergmann [Fri, 1 Jan 2016 22:40:46 +0000 (23:40 +0100)]
gpiolib: always initialize *flags from of_get_named_gpio_flags

The of_get_named_gpio_flags() function does nothing other than returning
an error when CONFIG_OF_GPIO is disabled, but that causes spurious
warnings about possible use of uninitialized variables in any code that
does not check the of_get_named_gpio_flags() return value before trying
to use the flags:

drivers/input/misc/rotary_encoder.c: In function 'rotary_encoder_probe':
drivers/input/misc/rotary_encoder.c:223:28: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/power/bq24735-charger.c: In function 'bq24735_charger_probe':
drivers/power/bq24735-charger.c:227:12: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/power/sbs-battery.c: In function 'sbs_probe':
drivers/power/sbs-battery.c:782:17: warning: 'gpio_flags' may be used uninitialized in this function [-Wmaybe-uninitialized]

This changes the behavior of the inline helper to set the flags to zero
when OF_GPIO is disabled, to avoid the warnings. In all cases I've
encountered, we don't actually get to the place that uses the flags
if CONFIG_OF is disabled because we won't enter the DT parser code.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: fix warning about iterator
Sudip Mukherjee [Sun, 27 Dec 2015 13:36:50 +0000 (19:06 +0530)]
gpio: fix warning about iterator

We were getting build warning about "iterator" being used uninitialized.
Use iterator properly to fix the build warning and in the process remove
the variable "pos" which is not required now.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: update gpiochip .get() callback description
Vladimir Zapolskiy [Tue, 22 Dec 2015 14:37:28 +0000 (16:37 +0200)]
gpio: update gpiochip .get() callback description

Since gpiochip .get() callback may return a negative error value, it
strictly limits the range of possible non-error returned values to
a subset of [30:0] bitmask, however on practice on success all
gpiochip drivers return either 0 for low signal or 1 for high signal,
this is assured by "gpio: *: Be sure to clamp return value" series of
changes. To avoid any confusion, misinterpretation and potential
errors while developing gpiochip drivers in future convert this
implicit assumption to a mandatory rule.

For output signals with unknown output signal state gpiochip drivers
should return a negative error instead of 0.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agoRevert "gpio: revert get() to non-errorprogating behaviour"
Linus Walleij [Mon, 21 Dec 2015 22:10:12 +0000 (23:10 +0100)]
Revert "gpio: revert get() to non-errorprogating behaviour"

This reverts commit 45ad7db90b42555c8107f18ec6d6a1e9bce34860.

We have fixed all the drivers that were returning ambious values
not clamped to [0,1] or an error code, so return the error
propagating behaviour of the API.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agopinctrl: sunxi: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 15:40:27 +0000 (16:40 +0100)]
pinctrl: sunxi: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: ssbi-mpp: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 15:36:17 +0000 (16:36 +0100)]
gpio: ssbi-mpp: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

This code was also double-inverting a bool which makes no sense
so I removed that code and moved clamping toward the end.

Cc: Björn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agopinctrl: ssbi-gpio: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 15:33:41 +0000 (16:33 +0100)]
pinctrl: ssbi-gpio: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Also, this code was double-inverting a bool. That makes no
sense whatsoever, so I removed the double-invert.

Cc: Björn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agopinctrl: spmi-mpp: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 15:31:06 +0000 (16:31 +0100)]
pinctrl: spmi-mpp: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Björn Andersson <bjorn.andersson@sonymobile.com>
Cc: Ivan T. Ivanov <ivan.ivanov@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agopinctrl: spmi-gpio: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 15:29:50 +0000 (16:29 +0100)]
pinctrl: spmi-gpio: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Ivan T. Ivanov <ivan.ivanov@linaro.org>
Cc: Björn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agopinctrl: xway: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 15:28:11 +0000 (16:28 +0100)]
pinctrl: xway: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Pramod Gurav <pramod.gurav@smartplayin.com>
Cc: John Crispin <blogic@openwrt.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agopinctrl: coh901: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 15:25:11 +0000 (16:25 +0100)]
pinctrl: coh901: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agopinctrl: baytrail: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 15:17:20 +0000 (16:17 +0100)]
pinctrl: baytrail: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: viperboard: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 13:58:52 +0000 (14:58 +0100)]
gpio: viperboard: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Lars Poeschel <poeschel@lemonage.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: ucb1400: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 13:56:04 +0000 (14:56 +0100)]
gpio: ucb1400: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: tz1090-pdc: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 13:54:59 +0000 (14:54 +0100)]
gpio: tz1090-pdc: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: tz1090: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:48:48 +0000 (11:48 +0100)]
gpio: tz1090: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: twl4030: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:47:16 +0000 (11:47 +0100)]
gpio: twl4030: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

This also makes the driver start to return the error code, as the
end of the series make this work.

Cc: Roger Quadros <rogerq@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: tc3589x: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:42:30 +0000 (11:42 +0100)]
gpio: tc3589x: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: sx150x: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:41:06 +0000 (11:41 +0100)]
gpio: sx150x: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

This also starts to propagate the error code from the I2C
transaction as the end of the series adds support for that.

Cc: Wei Chen <Wei.Chen@csr.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: sta2x11: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:38:50 +0000 (11:38 +0100)]
gpio: sta2x11: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: sa1100: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:36:28 +0000 (11:36 +0100)]
gpio: sa1100: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: pch: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:34:11 +0000 (11:34 +0100)]
gpio: pch: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Thierry Reding <treding@nvidia.com>
Cc: Daniel Krueger <daniel.krueger@systec-electronic.com>
Cc: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: pcf857x: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:32:53 +0000 (11:32 +0100)]
gpio: pcf857x: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Also start returning the error code if something fails, as the
end of the series augment the core to support this.

Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: George Cherian <george.cherian@ti.com>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: msic: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:21:47 +0000 (11:21 +0100)]
gpio: msic: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: mpc8xxx: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:20:56 +0000 (11:20 +0100)]
gpio: mpc8xxx: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: ml-ioh: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:18:44 +0000 (11:18 +0100)]
gpio: ml-ioh: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Feng Tang <feng.tang@intel.com>
Cc: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: max732x: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:12:55 +0000 (11:12 +0100)]
gpio: max732x: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Also start to propagate the error code here as the end of the
series fixes this to work for all drivers.

Cc: Semen Protsenko <semen.protsenko@globallogic.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by:Nicholas Krause <xerofoify@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: lpc32xx: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:10:06 +0000 (11:10 +0100)]
gpio: lpc32xx: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Roland Stigge <stigge@antcom.de>
Cc: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: kempld: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:04:26 +0000 (11:04 +0100)]
gpio: kempld: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Brunner Michael <Michael.Brunner@kontron.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: janz-ttl: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:03:33 +0000 (11:03 +0100)]
gpio: janz-ttl: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: intel-mid: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 10:00:56 +0000 (11:00 +0100)]
gpio: intel-mid: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Acked-by: David Cohen <david.a.cohen@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: em: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 09:46:18 +0000 (10:46 +0100)]
gpio: em: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Magnus Damm <damm@opensource.se>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: davinci: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 09:33:27 +0000 (10:33 +0100)]
gpio: davinci: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: da9052: Be sure to clamp return value
Linus Walleij [Mon, 21 Dec 2015 09:30:02 +0000 (10:30 +0100)]
gpio: da9052: Be sure to clamp return value

As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Ashish Jangam <ashish.jangam@kpitcummins.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: sx150x: Add support for sx1502
Peter Rosin [Tue, 15 Dec 2015 22:01:34 +0000 (23:01 +0100)]
gpio: sx150x: Add support for sx1502

Signed-off-by: Peter Rosin <peda@axentia.se>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: 104-idi-48: Clear pending interrupt once in IRQ handler
William Breathitt Gray [Tue, 15 Dec 2015 23:52:44 +0000 (18:52 -0500)]
gpio: 104-idi-48: Clear pending interrupt once in IRQ handler

Performing a read operation on the IRQ Status register will clear the
IRQ latch. Since a read operation on the IRQ Status register must be
performed in the IRQ handler in order to determine if the IRQ was in
fact generated by the device, the IRQ latch is consequently cleared by
the IRQ handler. A spinlock is used to guarantee that each IRQ is
serviced in the order it was received.

Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
8 years agoMAINTAINERS: add my-self as maintainer of gpio pxa driver
Robert Jarzmik [Fri, 18 Dec 2015 21:41:34 +0000 (22:41 +0100)]
MAINTAINERS: add my-self as maintainer of gpio pxa driver

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agogpio: pxa: fixes non devicetree builds
Robert Jarzmik [Fri, 18 Dec 2015 20:40:40 +0000 (21:40 +0100)]
gpio: pxa: fixes non devicetree builds

The commit "gpio: pxa: change the interrupt management" should have
taken care of moving an ifdef to not englobe irqdomain related
structures anymore, as they are used now for all builds.

This repairs the broken builds where CONFIG_OF=n.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agopinctrl: fixup problematic flag
Linus Walleij [Thu, 17 Dec 2015 13:50:45 +0000 (14:50 +0100)]
pinctrl: fixup problematic flag

This removes the set_irq_flags() call that unfortunately slipped
into the BCM NSP driver.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Yendapally Reddy Dhananjaya Reddy <yrdreddy@broadcom.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
8 years agoMerge tag 'v4.4-rc6' into devel
Linus Walleij [Mon, 21 Dec 2015 08:36:21 +0000 (09:36 +0100)]
Merge tag 'v4.4-rc6' into devel

Linux 4.4-rc6

8 years agoLinux 4.4-rc6 v4.4-rc6
Linus Torvalds [Mon, 21 Dec 2015 00:06:09 +0000 (16:06 -0800)]
Linux 4.4-rc6

8 years agoMerge tag 'rtc-4.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Linus Torvalds [Sun, 20 Dec 2015 18:01:11 +0000 (10:01 -0800)]
Merge tag 'rtc-4.4-3' of git://git./linux/kernel/git/abelloni/linux

Pull RTC fixes from Alexandre Belloni:
 "Late fixes for the RTC subsystem for 4.4:

  A fix for a nasty hardware bug in rk808 and an initialization
  reordering in da9063 to fix a possible crash"

* tag 'rtc-4.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux:
  rtc: da9063: fix access ordering error during RTC interrupt at system power on
  rtc: rk808: Compensate for Rockchip calendar deviation on November 31st

8 years agortc: da9063: fix access ordering error during RTC interrupt at system power on
Steve Twiss [Tue, 8 Dec 2015 16:28:39 +0000 (16:28 +0000)]
rtc: da9063: fix access ordering error during RTC interrupt at system power on

This fix alters the ordering of the IRQ and device registrations in the RTC
driver probe function. This change will apply to the RTC driver that supports
both DA9063 and DA9062 PMICs.

A problem could occur with the existing RTC driver if:

A system is started from a cold boot using the PMIC RTC IRQ to initiate a
power on operation. For instance, if an RTC alarm is used to start a
platform from power off.
The existing driver IRQ is requested before the device has been properly
registered.
i.e.
    ret = devm_request_threaded_irq()
comes before
    rtc->rtc_dev = devm_rtc_device_register();

In this case, the interrupt can be called before the device has been
registered and the handler can be called immediately. The IRQ handler
da9063_alarm_event() contains the function call

    rtc_update_irq(rtc->rtc_dev, 1, RTC_IRQF | RTC_AF);

which in turn tries to access the unavailable rtc->rtc_dev.

The fix is to reorder the functions inside the RTC probe. The IRQ is
requested after the RTC device resource has been registered so that
get_irq_byname is the last thing to happen.

Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
8 years agortc: rk808: Compensate for Rockchip calendar deviation on November 31st
Julius Werner [Tue, 15 Dec 2015 23:02:49 +0000 (15:02 -0800)]
rtc: rk808: Compensate for Rockchip calendar deviation on November 31st

In A.D. 1582 Pope Gregory XIII found that the existing Julian calendar
insufficiently represented reality, and changed the rules about
calculating leap years to account for this. Similarly, in A.D. 2013
Rockchip hardware engineers found that the new Gregorian calendar still
contained flaws, and that the month of November should be counted up to
31 days instead. Unfortunately it takes a long time for calendar changes
to gain widespread adoption, and just like more than 300 years went by
before the last Protestant nation implemented Greg's proposal, we will
have to wait a while until all religions and operating system kernels
acknowledge the inherent advantages of the Rockchip system. Until then
we need to translate dates read from (and written to) Rockchip hardware
back to the Gregorian format.

This patch works by defining Jan 1st, 2016 as the arbitrary anchor date
on which Rockchip and Gregorian calendars are in sync. From that we can
translate arbitrary later dates back and forth by counting the number
of November/December transitons since the anchor date to determine the
offset between the calendars. We choose this method (rather than trying
to regularly "correct" the date stored in hardware) since it's the only
way to ensure perfect time-keeping even if the system may be shut down
for an unknown number of years. The drawback is that other software
reading the same hardware (e.g. mainboard firmware) must use the same
translation convention (including the same anchor date) to be able to
read and write correct timestamps from/to the RTC.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
8 years agoMerge tag 'tty-4.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Linus Torvalds [Sun, 20 Dec 2015 01:44:19 +0000 (17:44 -0800)]
Merge tag 'tty-4.4-rc6' of git://git./linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg KH:
 "Here are some tty/serial driver fixes for 4.4-rc6 that resolve some
  reported problems.  All of these have been in linux-next.  The details
  are in the shortlog"

* tag 'tty-4.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  tty: Fix GPF in flush_to_ldisc()
  serial: earlycon: Add missing spinlock initialization
  serial: sh-sci: Fix length of scatterlist
  n_tty: Fix poll() after buffer-limited eof push read
  serial: 8250_uniphier: fix dl_read and dl_write functions

8 years agoMerge tag 'usb-4.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sun, 20 Dec 2015 01:33:58 +0000 (17:33 -0800)]
Merge tag 'usb-4.4-rc6' of git://git./linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here are some USB and PHY fixes for 4.4-rc6.  All of them resolve some
  reported problems.  Full details in the shortlog"

* tag 'usb-4.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  USB: fix invalid memory access in hub_activate()
  USB: ipaq.c: fix a timeout loop
  phy: core: Get a refcount to phy in devm_of_phy_get_by_index()
  phy: cygnus: pcie: add missing of_node_put
  phy: miphy365x: add missing of_node_put
  phy: miphy28lp: add missing of_node_put
  phy: rockchip-usb: add missing of_node_put
  phy: berlin-sata: add missing of_node_put
  phy: mt65xx-usb3: add missing of_node_put
  phy: brcmstb-sata: add missing of_node_put
  phy: sun9i-usb: add USB dependency

8 years agoMerge tag 'md/4.4-rc5-fixes' of git://neil.brown.name/md
Linus Torvalds [Sun, 20 Dec 2015 00:46:46 +0000 (16:46 -0800)]
Merge tag 'md/4.4-rc5-fixes' of git://neil.brown.name/md

Pull md fixes from Neil Brown:
 "Four fixes for md:

   - two recently introduced regressions fixed.
   - one older bug in RAID10 - tagged for -stable since 4.2
   - one minor sysfs api improvement"

* tag 'md/4.4-rc5-fixes' of git://neil.brown.name/md:
  Fix remove_and_add_spares removes drive added as spare in slot_store
  md: fix bug due to nested suspend
  MD: change journal disk role to disk 0
  md/raid10: fix data corruption and crash during resync

8 years agoMerge tag 'powerpc-4.4-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
Linus Torvalds [Sun, 20 Dec 2015 00:40:48 +0000 (16:40 -0800)]
Merge tag 'powerpc-4.4-5' of git://git./linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
 - Partial revert of "powerpc: Individual System V IPC system calls"
 - pr_warn_once on unsupported OPAL_MSG type from Stewart
 - Fix deadlock in opal-irqchip introduced by "Fix double endian
   conversion" from Alistair

* tag 'powerpc-4.4-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/opal-irqchip: Fix deadlock introduced by "Fix double endian conversion"
  powerpc/powernv: pr_warn_once on unsupported OPAL_MSG type
  Partial revert of "powerpc: Individual System V IPC system calls"

8 years agoMerge tag 'spi-fix-v4.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Linus Torvalds [Sat, 19 Dec 2015 18:10:43 +0000 (10:10 -0800)]
Merge tag 'spi-fix-v4.4-rc5' of git://git./linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A couple of reference counting bugs here, one in spidev and one with
  holding an extra reference in the core that we never freed if we
  removed a device, plus a driver specific fix.  Both of the refcounting
  bugs are very old but they've only been found by observation so
  hopefully their impact has been low"

* tag 'spi-fix-v4.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: fix parent-device reference leak
  spi: spidev: Hold spi_lock over all defererences of spi in release()
  spi-fsl-dspi: Fix CTAR Register access

8 years agoMerge tag 'gpio-v4.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux...
Linus Torvalds [Sat, 19 Dec 2015 18:05:00 +0000 (10:05 -0800)]
Merge tag 'gpio-v4.4-3' of git://git./linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
 "Some GPIO fixes for the v4.4 series.  Most prominent: I revert the
  error propagation from the .get() function until we can fix up all the
  drivers properly for v4.5.

   - Revert the error number propagation from the .get() vtable entry
     temporarily, until we make the proper fixes to all drivers.
   - Fix the clamping behaviour in the generic GPIO driver.
   - Driver fix for the ath79 driver"

* tag 'gpio-v4.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: revert get() to non-errorprogating behaviour
  gpio: generic: clamp values from bgpio_get_set()
  gpio: ath79: Fix the logic to clear offset bit of AR71XX_GPIO_REG_OE register

8 years agoMerge tag 'pinctrl-v4.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
Linus Torvalds [Sat, 19 Dec 2015 18:01:03 +0000 (10:01 -0800)]
Merge tag 'pinctrl-v4.4-3' of git://git./linux/kernel/git/linusw/linux-pinctrl

Pull pin control fixes from Linus Walleij:
 - Driver fixes for Freescale i.MX7D, Intel, Broadcom 2835
 - One MAINTAINERS entry

* tag 'pinctrl-v4.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  MAINTAINERS: pinctrl: Add maintainers for pinctrl-single
  pinctrl: bcm2835: Fix initial value for direction_output
  pinctrl: intel: fix offset calculation issue of register PAD_OWN
  pinctrl: intel: fix bug of register offset calculation
  pinctrl: freescale: add ZERO_OFFSET_VALID flag for vf610 pinctrl

8 years agoMerge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Sat, 19 Dec 2015 17:52:44 +0000 (09:52 -0800)]
Merge branch 'i2c/for-current' of git://git./linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
 "A set of 'usual' driver bugfixes for the I2C subsystem"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: rcar: disable runtime PM correctly in slave mode
  i2c: designware: Keep pm_runtime_enable/_disable calls in sync
  i2c: designware: fix IO timeout issue for AMD controller
  i2c: imx: init bus recovery info before adding i2c adapter
  i2c: do not use 0x in front of %pa
  i2c: davinci: Increase module clock frequency
  i2c: mv64xxx: The n clockdiv factor is 0 based on sunxi SoCs
  i2c: rk3x: populate correct variable for sda_falling_time

8 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Sat, 19 Dec 2015 17:51:11 +0000 (09:51 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/dtor/input

Pull input fixes from Dmitry Torokhov:
 "Just a few assorted driver fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: elants_i2c - fix wake-on-touch
  Input: elan_i2c - set input device's vendor and product IDs
  Input: sun4i-lradc-keys - fix typo in binding documentation
  Input: atmel_mxt_ts - add maxtouch to I2C table for module autoload
  Input: arizona-haptic - fix disabling of haptics device
  Input: aiptek - fix crash on detecting device without endpoints
  Input: atmel_mxt_ts - add generic platform data for Chromebooks
  Input: parkbd - clear unused function pointers
  Input: walkera0701 - clear unused function pointers
  Input: turbografx - clear unused function pointers
  Input: gamecon - clear unused function pointers
  Input: db9 - clear unused function pointers

8 years agoi2c: rcar: disable runtime PM correctly in slave mode
Wolfram Sang [Wed, 16 Dec 2015 19:05:18 +0000 (20:05 +0100)]
i2c: rcar: disable runtime PM correctly in slave mode

When we also are I2C slave, we need to disable runtime PM because the
address detection mechanism needs to be active all the time. However, we
can reenable runtime PM once the slave instance was unregistered. So,
use pm_runtime_get_sync/put to achieve this, since it has proper
refcounting. pm_runtime_allow/forbid is like a global knob controllable
from userspace which is unsuitable here.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
8 years agoMerge tag 'pm+acpi-4.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Sat, 19 Dec 2015 05:01:35 +0000 (21:01 -0800)]
Merge tag 'pm+acpi-4.4-rc6' of git://git./linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "These fix a potential regression introduced during the 4.3 cycle
  (generic power domains framework), a nasty bug that has been present
  forever (power capping RAPL driver), a build issue (Tegra cpufreq
  driver) and a minor ugliness introduced recently (intel_pstate).

  Specifics:

   - Fix a potential regression in the generic power domains framework
     introduced during the 4.3 development cycle that may lead to
     spurious failures of system suspend in certain situations (Ulf
     Hansson).

   - Fix a problem in the power capping RAPL (Running Average Power
     Limits) driver that causes it to initialize successfully on some
     systems where it is not supposed to do that which is due to an
     incorrect check in an initialization routine (Prarit Bhargava).

   - Fix a build problem in the cpufreq Tegra driver that depends on the
     regulator framework, but that dependency is not reflected in
     Kconfig (Arnd Bergmann).

   - Fix a recent mistake in the intel_pstate driver where a numeric
     constant is used directly instead of a symbol defined specifically
     for the case in question (Prarit Bhargava)"

* tag 'pm+acpi-4.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  powercap / RAPL: fix BIOS lock check
  cpufreq: intel_pstate: Minor cleanup for FRAC_BITS
  cpufreq: tegra: add regulator dependency for T124
  PM / Domains: Allow runtime PM callbacks to be re-used during system PM