linux-2.6-block.git
4 years agodt-bindings: pinctrl: aspeed: Convert AST2400 bindings to json-schema
Andrew Jeffery [Fri, 28 Jun 2019 02:38:32 +0000 (12:08 +0930)]
dt-bindings: pinctrl: aspeed: Convert AST2400 bindings to json-schema

Convert ASPEED pinctrl bindings to DT schema format using json-schema

Cc: Johnny Huang <johnny_huang@aspeedtech.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Link: https://lore.kernel.org/r/20190628023838.15426-3-andrew@aj.id.au
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agodt-bindings: pinctrl: aspeed: Split bindings document in two
Andrew Jeffery [Fri, 28 Jun 2019 02:38:31 +0000 (12:08 +0930)]
dt-bindings: pinctrl: aspeed: Split bindings document in two

Have one for each of the AST2400 and AST2500. The only thing that was
common was the fact that both support ASPEED BMC SoCs.

Cc: Johnny Huang <johnny_huang@aspeedtech.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Acked-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20190628023838.15426-2-andrew@aj.id.au
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agopinctrl: qcom: Add irq_enable callback for msm gpio
Srinivas Ramana [Tue, 25 Jun 2019 14:14:46 +0000 (19:44 +0530)]
pinctrl: qcom: Add irq_enable callback for msm gpio

Introduce the irq_enable callback which will be same as irq_unmask
except that it will also clear the status bit before unmask.

This will help in clearing any erroneous interrupts that would
have got latched when the interrupt is not in use.

There may be devices like UART which can use the same gpio line
for data rx as well as a wakeup gpio when in suspend. The data that
was flowing on the line may latch the interrupt and when we enable
the interrupt before going to suspend, this would trigger the
unexpected interrupt. This change helps clearing the interrupt
so that these unexpected interrupts gets cleared.

Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
Link: https://lore.kernel.org/r/1561472086-23360-1-git-send-email-neeraju@codeaurora.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agopinctrl: madera: Fixup SPDX headers
Charles Keepax [Tue, 25 Jun 2019 15:39:14 +0000 (16:39 +0100)]
pinctrl: madera: Fixup SPDX headers

GPL-2.0-only is the preferred way of expressing v2 of the GPL, so switch
to that. Remove some redundant copyright notices and correct some
instances where the wrong comment type has been used in header files.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agopinctrl: qcom: sdm845: Fix CONFIG preprocessor guard
Nathan Chancellor [Fri, 21 Jun 2019 20:20:43 +0000 (13:20 -0700)]
pinctrl: qcom: sdm845: Fix CONFIG preprocessor guard

Clang warns when CONFIG_ACPI is unset:

 drivers/pinctrl/qcom/pinctrl-sdm845.c:1320:5: warning: 'CONFIG_ACPI' is
 not defined, evaluates to 0 [-Wundef]
 #if CONFIG_ACPI
     ^
 1 warning generated.

Use ifdef instead of if to resolve this.

Fixes: a229105d7a1e ("pinctrl: qcom: sdm845: Provide ACPI support")
Link: https://github.com/ClangBuiltLinux/linux/issues/569
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agopinctrl: tegra: Add bitmask support for parked bits
Thierry Reding [Fri, 21 Jun 2019 15:19:32 +0000 (17:19 +0200)]
pinctrl: tegra: Add bitmask support for parked bits

Some pin groups have park bits for multiple pins in one register.
Support this by turning the parked bit field into a parked bitmask
field. If no parked bits are supported, the bitmask can be 0.

Update the pingroup table on Tegra210, which is the only generation
where this is supported, with the parked bitmask.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agopinctrl: tegra: Set specific GPIO compatible string
Thierry Reding [Fri, 21 Jun 2019 15:19:31 +0000 (17:19 +0200)]
pinctrl: tegra: Set specific GPIO compatible string

Rather than reuse the nvidia,tegra30-gpio compatible string
to find the GPIO controller on Tegra30, Tegra114, Tegra124 and
Tegra210, use the most specific compatible string for each
SoC generation for consistency.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agopinctrl: mvebu: Add support for MV98DX1135
Chris Packham [Mon, 17 Jun 2019 21:54:57 +0000 (09:54 +1200)]
pinctrl: mvebu: Add support for MV98DX1135

The 98DX1135 is a switch chip with an integrated CPU. This is similar to
the 98DX4122 except the MPP assignments differ.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agodt-bindings: pinctrl: mvebu: Document bindings for 98DX1135
Chris Packham [Mon, 17 Jun 2019 21:54:55 +0000 (09:54 +1200)]
dt-bindings: pinctrl: mvebu: Document bindings for 98DX1135

The 98DX1135 is similar to the 98DX4122 except the MPP options differ.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agopinctrl: remove unneeded #ifdef around declarations
Masahiro Yamada [Thu, 13 Jun 2019 01:55:31 +0000 (10:55 +0900)]
pinctrl: remove unneeded #ifdef around declarations

What is the point in surrounding the whole of declarations with
ifdef like this?

  #ifdef CONFIG_FOO
  int foo(void);
  #endif

If CONFIG_FOO is not defined, all callers of foo() will fail
with implicit declaration errors since the top Makefile adds
-Werror-implicit-function-declaration to KBUILD_CFLAGS.

This breaks the build earlier when you are doing something wrong.
That's it.

Anyway, it will fail to link since the definition of foo() is not
compiled.

In summary, these ifdef are unneeded.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agopinctrl: freescale: Add i.MX8MN pinctrl driver support
Anson Huang [Tue, 11 Jun 2019 12:25:34 +0000 (20:25 +0800)]
pinctrl: freescale: Add i.MX8MN pinctrl driver support

Add the pinctrl driver support for i.MX8MN.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agodt-bindings: imx: Add pinctrl binding doc for i.MX8MN
Anson Huang [Tue, 11 Jun 2019 12:25:33 +0000 (20:25 +0800)]
dt-bindings: imx: Add pinctrl binding doc for i.MX8MN

Add binding doc for i.MX8MN pinctrl driver.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agopinctrl: Minimize SPDX hamming distance
Linus Walleij [Thu, 20 Jun 2019 08:54:55 +0000 (10:54 +0200)]
pinctrl: Minimize SPDX hamming distance

OK so some automatic scripts were fixing the SPDX tags in
the mainline branch while we were patching other stuff,
and yeah it is more correct to have "GPL-2.0-only" rather
than "GPL-2.0" so let's conform to what is already upstream
so we don't end up getting the wrong license on the merged
result later.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agopinctrl: make pinconf.h self-contained
Masahiro Yamada [Thu, 13 Jun 2019 01:55:32 +0000 (10:55 +0900)]
pinctrl: make pinconf.h self-contained

This header uses 'bool', but it does not include any header by itself.

So, it could cause unknown type name error, depending on the header
include order, although probably <linux/types.h> has been included by
someone else.

Include <linux/types.h> to make it self-contained.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agogpio: Fix build warnings on undefined struct pinctrl_dev
Enrico Weigelt [Wed, 12 Jun 2019 21:59:36 +0000 (23:59 +0200)]
gpio: Fix build warnings on undefined struct pinctrl_dev

This fixes the warnings:

* include/linux/gpio.h:254:11: warning: 'struct pinctrl_dev' declared
  inside parameter list will not be visible outside of this definition
  or declaration
* include/linux/gpio/driver.h:602:11: warning: 'struct pinctrl_dev'
  declared inside parameter list will not be visible outside of this
  definition or declaration

Fixes: 78b99577b393 ("pinctrl: remove unused pin_is_valid()")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Enrico Weigelt <info@metux.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agodt-bindings: pinctrl: add compatible string for Allwinner V3 pinctrl
Icenowy Zheng [Tue, 11 Jun 2019 14:09:31 +0000 (22:09 +0800)]
dt-bindings: pinctrl: add compatible string for Allwinner V3 pinctrl

The Allwinner V3 SoC, despite come with the same die with V3s, has more
GPIO pins than V3s, and a different compatible string for pinctrl is
needed.

Add the compatible string for V3 pinctrl.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agodt-bindings: pinctrl: add missing compatible string for V3s
Icenowy Zheng [Tue, 11 Jun 2019 14:09:30 +0000 (22:09 +0800)]
dt-bindings: pinctrl: add missing compatible string for V3s

The pinctrl driver of V3s is already available and used in the kernel,
but the compatible string of it is forgotten to be added.

Add the missing compatible string.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agoMerge branch 'ib-qcom-acpi' into devel
Linus Walleij [Wed, 12 Jun 2019 07:19:31 +0000 (09:19 +0200)]
Merge branch 'ib-qcom-acpi' into devel

4 years agopinctrl: qcom: sdm845: Provide ACPI support
Lee Jones [Mon, 10 Jun 2019 08:42:09 +0000 (09:42 +0100)]
pinctrl: qcom: sdm845: Provide ACPI support

This patch provides basic support for booting with ACPI instead
of the currently supported Device Tree.  When doing so there are a
couple of differences which we need to taken into consideration.

Firstly, the SDM850 ACPI tables omit information pertaining to the
4 reserved GPIOs on the platform.  If Linux attempts to touch/
initialise any of these lines, the firmware will restart the
platform.

Secondly, when booting with ACPI, it is expected that the firmware
will set-up things like; Regulators, Clocks, Pin Functions, etc in
their ideal configuration.  Thus, the possible Pin Functions
available to this platform are not advertised when providing the
higher GPIOD/Pinctrl APIs with pin information.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agopinctrl: msm: Add ability for drivers to supply a reserved GPIO list
Lee Jones [Mon, 10 Jun 2019 08:42:08 +0000 (09:42 +0100)]
pinctrl: msm: Add ability for drivers to supply a reserved GPIO list

When booting MSM based platforms with Device Tree or some ACPI
implementations, it is possible to provide a list of reserved pins
via the 'gpio-reserved-ranges' and 'gpios' properties respectively.
However some ACPI tables are not populated with this information,
thus it has to come from a knowledgable device driver instead.

Here we provide the MSM common driver with additional support to
parse this informtion and correctly populate the widely used
'valid_mask'.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agopinctrl: remove unused pin_is_valid()
Masahiro Yamada [Sun, 9 Jun 2019 15:09:53 +0000 (00:09 +0900)]
pinctrl: remove unused pin_is_valid()

This function was used by pin_request() to pointlessly double-check
the pin validity, and it was the only user ever.

Since commit d2f6a1c6fb0e ("pinctrl: remove double pin validity
check."), no one has ever used it.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agopinctrl: remove unneeded initializer for list_for_each_entry() iterator
Masahiro Yamada [Sun, 9 Jun 2019 14:55:37 +0000 (23:55 +0900)]
pinctrl: remove unneeded initializer for list_for_each_entry() iterator

The iterator is initialized in list_for_each_entry().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: add include guard to pinctrl-state.h
Masahiro Yamada [Sun, 9 Jun 2019 14:43:13 +0000 (23:43 +0900)]
pinctrl: add include guard to pinctrl-state.h

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: pinctrl: pic32: Spelling s/configuraion/configuration/
Geert Uytterhoeven [Fri, 7 Jun 2019 11:06:12 +0000 (13:06 +0200)]
dt-bindings: pinctrl: pic32: Spelling s/configuraion/configuration/

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agoMerge tag 'sh-pfc-for-v5.3-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Walleij [Fri, 7 Jun 2019 23:32:19 +0000 (01:32 +0200)]
Merge tag 'sh-pfc-for-v5.3-tag1' of git://git./linux/kernel/git/geert/renesas-drivers into devel

pinctrl: sh-pfc: Updates for v5.3

  - Add more checks for pinctrl table validation,
  - Add TPU (Timer Pulse Unit / PWM) pin groups on R-Car H3, M3-W, and
    M3-N,
  - Rework description of pins without GPIO functionality,
  - Small fixes and cleanups.

5 years agopinctrl: nomadik: Fix SPDX tags
Linus Walleij [Sun, 2 Jun 2019 21:08:28 +0000 (23:08 +0200)]
pinctrl: nomadik: Fix SPDX tags

Some files were missing the appropriate SPDX tags so
fixed it up.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: tb10x: Use flexible-array member and struct_size() helper
Gustavo A. R. Silva [Thu, 6 Jun 2019 23:11:44 +0000 (18:11 -0500)]
pinctrl: tb10x: Use flexible-array member and struct_size() helper

Update the code to use a flexible array member instead of a pointer in
structure tb10x_pinctrl and use the struct_size() helper:

struct tb10x_pinctrl {
        ...
struct tb10x_of_pinfunc pinfuncs[];
};

Also, make use of the struct_size() helper instead of an open-coded
version in order to avoid any potential type mistakes.

So, replace the following form:

sizeof(struct tb10x_pinctrl) + of_get_child_count(of_node) * sizeof(struct tb10x_of_pinfunc)

with:

struct_size(state, pinfuncs, of_get_child_count(of_node))

This code was detected with the help of Coccinelle.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: aspeed: Add SGPM pinmux
Hongwei Zhang [Tue, 4 Jun 2019 21:53:32 +0000 (17:53 -0400)]
pinctrl: aspeed: Add SGPM pinmux

Add SGPM pinmux to ast2500-pinctrl function and group, to prepare for
supporting SGPIO in AST2500 SoC.

Signed-off-by: Hongwei Zhang <hongweiz@ami.com>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: qcom: sdm845: Expose ufs_reset as gpio
Bjorn Andersson [Tue, 4 Jun 2019 07:19:59 +0000 (00:19 -0700)]
pinctrl: qcom: sdm845: Expose ufs_reset as gpio

The ufs_reset pin is expected to be wired to the reset pin of the
primary UFS memory but is pretty much just a general purpose output pinr

Reorder the pins and expose it as gpio 150, so that the UFS driver can
toggle it.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: Add drive strength support for BM1880 SoC
Manivannan Sadhasivam [Mon, 3 Jun 2019 07:34:21 +0000 (13:04 +0530)]
pinctrl: Add drive strength support for BM1880 SoC

Add drive strength support for Bitmain BM1880 SoC.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: pinctrl: Document drive strength settings for BM1880 SoC
Manivannan Sadhasivam [Mon, 3 Jun 2019 07:34:20 +0000 (13:04 +0530)]
dt-bindings: pinctrl: Document drive strength settings for BM1880 SoC

Document drive strength settings for Bitmain BM1880 SoC.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: ns2: Fix potential NULL dereference
Young Xiao [Wed, 29 May 2019 02:43:58 +0000 (10:43 +0800)]
pinctrl: ns2: Fix potential NULL dereference

platform_get_resource() may fail and return NULL, so we should
better check it's return value to avoid a NULL pointer dereference
a bit later in the code.

Signed-off-by: Young Xiao <92siuyang@gmail.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: imx: Correct pinfunc head file path for i.MX8MM
Anson Huang [Thu, 30 May 2019 03:13:57 +0000 (11:13 +0800)]
dt-bindings: imx: Correct pinfunc head file path for i.MX8MM

The i.MX8MM pinfunc head file is located in DT folder, correct it.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: u300: Fix SPDX tags
Linus Walleij [Sun, 2 Jun 2019 21:11:19 +0000 (23:11 +0200)]
pinctrl: u300: Fix SPDX tags

Some files were missing the appropriate SPDX tags so
fixed it up.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: sh-pfc: Remove obsolete SH_PFC_PIN_NAMED*() macros
Geert Uytterhoeven [Mon, 25 Mar 2019 12:53:35 +0000 (13:53 +0100)]
pinctrl: sh-pfc: Remove obsolete SH_PFC_PIN_NAMED*() macros

Now all Renesas pin control drivers have been converted to use the new
non-GPIO helper macros, SH_PFC_PIN_NAMED() and SH_PFC_PIN_NAMED_CFG()
are no longer used.  Remove them.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
5 years agopinctrl: sh-pfc: sh73a0: Use new macros for non-GPIO pins
Geert Uytterhoeven [Wed, 16 Jan 2019 11:19:59 +0000 (12:19 +0100)]
pinctrl: sh-pfc: sh73a0: Use new macros for non-GPIO pins

Update the SH-Mobile AG5 pin control driver to use the new macros for
describing pins without GPIO functionality.  This replaces the use of
physical pin numbers on the SH-Mobile AG5 SoC (in 34x34 BGA package) by
symbolic enum values, referring to signal names.

Note that the user-visible names of these pins are still based on pin
numbers instead of signal names, to preserve DT backwards compatibility.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
5 years agopinctrl: sh-pfc: r8a77990: Use new macros for non-GPIO pins
Geert Uytterhoeven [Tue, 15 Jan 2019 18:59:59 +0000 (19:59 +0100)]
pinctrl: sh-pfc: r8a77990: Use new macros for non-GPIO pins

Update the R-Car E3 pin control driver to use the new macros for
describing pins without GPIO functionality.  This replaces the use of
physical pin numbers on the R-Car E3 SoC (in 25x25 FCBGA package) by
symbolic enum values, referring to signal names.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
5 years agopinctrl: sh-pfc: r8a77965: Use new macros for non-GPIO pins
Geert Uytterhoeven [Tue, 15 Jan 2019 13:01:27 +0000 (14:01 +0100)]
pinctrl: sh-pfc: r8a77965: Use new macros for non-GPIO pins

Update the R-Car M3-N pin control driver to use the new macros for
describing pins without GPIO functionality.  This replaces the use of
physical pin numbers on the R-Car M3-N SiP (in 39x39 BGA package) by
symbolic enum values, referring to signal names.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
5 years agopinctrl: sh-pfc: r8a7796: Use new macros for non-GPIO pins
Geert Uytterhoeven [Tue, 15 Jan 2019 13:00:52 +0000 (14:00 +0100)]
pinctrl: sh-pfc: r8a7796: Use new macros for non-GPIO pins

Update the R-Car M3-W pin control driver to use the new macros for
describing pins without GPIO functionality.  This replaces the use of
physical pin numbers on the R-Car M3-W SiP (in 39x39 BGA package) by
symbolic enum values, referring to signal names.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
5 years agopinctrl: sh-pfc: r8a7795: Use new macros for non-GPIO pins
Geert Uytterhoeven [Tue, 15 Jan 2019 13:00:12 +0000 (14:00 +0100)]
pinctrl: sh-pfc: r8a7795: Use new macros for non-GPIO pins

Update the R-Car H3 ES2.0 and later pin control driver to use the new
macros for describing pins without GPIO functionality.  This replaces
the use of physical pin numbers on the R-Car H3 ES2.0 SiP (in 39x39
BGA package) by symbolic enum values, referring to signal names.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
5 years agopinctrl: sh-pfc: r8a7795-es1: Use new macros for non-GPIO pins
Geert Uytterhoeven [Tue, 15 Jan 2019 12:43:13 +0000 (13:43 +0100)]
pinctrl: sh-pfc: r8a7795-es1: Use new macros for non-GPIO pins

Update the R-Car H3 ES1.x pin control driver to use the new macros for
describing pins without GPIO functionality.  This replaces the use of
physical pin numbers on the R-Car H3 ES1.x SiP (in 39x39 BGA package) by
symbolic enum values, referring to signal names.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
5 years agopinctrl: sh-pfc: r8a7790: Use new macros for non-GPIO pins
Geert Uytterhoeven [Wed, 16 Jan 2019 10:03:00 +0000 (11:03 +0100)]
pinctrl: sh-pfc: r8a7790: Use new macros for non-GPIO pins

Update the R-Car H2 pin control driver to use the new macros for
describing pins without GPIO functionality.  This replaces the use of
physical pin numbers on the R-Car H2 SoC (in 31x31 FCBGA package) by
symbolic enum values, referring to signal names.

Note that the user-visible names of these pins are still based on pin
numbers instead of signal names, to preserve DT backwards compatibility.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
5 years agopinctrl: sh-pfc: r8a7778: Use new macros for non-GPIO pins
Geert Uytterhoeven [Wed, 16 Jan 2019 11:01:14 +0000 (12:01 +0100)]
pinctrl: sh-pfc: r8a7778: Use new macros for non-GPIO pins

Update the R-Car M1A pin control driver to use the new macros for
describing pins without GPIO functionality.  This replaces the use of
physical pin numbers on the R-Car M1A SoC (in 25x25 FCBGA package) by
symbolic enum values, referring to signal names.

Note that the user-visible names of these pins are still based on pin
numbers instead of signal names, to preserve DT backwards compatibility.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
5 years agopinctrl: sh-pfc: emev2: Use new macros for non-GPIO pins
Geert Uytterhoeven [Wed, 16 Jan 2019 11:37:22 +0000 (12:37 +0100)]
pinctrl: sh-pfc: emev2: Use new macros for non-GPIO pins

Update the EMMA Mobile EV2 pin control driver to use the new macros for
describing pins without GPIO functionality.  This replaces the use of
physical pin numbers on the EMMA Mobile EV2 SoC (in 23x23 BGA package)
by symbolic enum values, referring to signal names.

Note that the user-visible names of these pins are still based on pin
numbers instead of signal names, to preserve DT backwards compatibility.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
5 years agopinctrl: sh-pfc: Add new non-GPIO helper macros
Geert Uytterhoeven [Thu, 21 Mar 2019 17:58:51 +0000 (18:58 +0100)]
pinctrl: sh-pfc: Add new non-GPIO helper macros

Add new macros for describing pins without GPIO functionality:
  - NOGP_ALL() expands to a list of PIN_id values, to be used for
    generating symbolic enum values,
  - PINMUX_NOGP_ALL() expands to a list of sh_pfc_pin entries, to
    list all pins and their capabilities.
Both macros depend on an SoC-specific CPU_ALL_NOGP() macro, to be
provided by each individual SoC pin control driver.

The new macros offer two advantages over the existing SH_PFC_PIN_NAMED()
and SH_PFC_PIN_NAMED_CFG() macros:
  1. They do not rely on PIN_NUMBER() macros and physical pin numbering,
     hence do not suffer from pin numbering confusion among different
     SoC/SiP packages.
  2. They are similar in spirit to the existing scheme for handling pins
     with GPIO functionality.

Note that internal to the driver, non-GPIO pins use a sequential
numbering scheme which starts after the highest GPIO pin number in use.
This value is calculated automatically, using two new helper macros, for
systems with either 32-port bank (GP port style) or linear (PORT style)
pin space.  Sample expansion:

    GP_LAST = sizeof(union {
char dummy[0] __attribute__((deprecated, deprecated));
char GP_0_0[(0 * 32) + 0] __attribute__((deprecated, deprecated));
char GP_0_1[(0 * 32) + 1] __attribute__((deprecated, deprecated));
...
char GP_7_3[(7 * 32) + 3] __attribute__((deprecated, deprecated));
    })

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
5 years agopinctrl: bcm2835: Fix build error without CONFIG_OF
YueHaibing [Tue, 28 May 2019 09:13:04 +0000 (17:13 +0800)]
pinctrl: bcm2835: Fix build error without CONFIG_OF

drivers/pinctrl/bcm/pinctrl-bcm2835.c: In function bcm2835_pctl_dt_node_to_map:
drivers/pinctrl/bcm/pinctrl-bcm2835.c:720:8: error: implicit declaration of function pinconf_generic_dt_node_to_map_all;
drivers/pinctrl/bcm/pinctrl-bcm2835.c: In function bcm2835_pinctrl_probe:
drivers/pinctrl/bcm/pinctrl-bcm2835.c:1022:15: error: struct gpio_chip has no member named of_node
  pc->gpio_chip.of_node = np;

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 0de704955ee4 ("pinctrl: bcm2835: Add support for generic pinctrl binding")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: stm32: Add links to consumers
Linus Walleij [Sat, 1 Jun 2019 17:53:31 +0000 (19:53 +0200)]
pinctrl: stm32: Add links to consumers

Using STM32 as guinea pig after Alex's initial positive
test to see if this is something we should encourage
in general and make default behaviour.

Cc: Benjamin Gaignard <benjamin.gaignard@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: mediatek: mt8183: Add pm_ops
Nicolas Boichat [Wed, 8 May 2019 07:33:31 +0000 (15:33 +0800)]
pinctrl: mediatek: mt8183: Add pm_ops

Setting this up will configure wake from suspend properly,
and wake only for the interrupts that are setup in wake_mask,
not all interrupts.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Acked-by: Sean Wang <sean.wang@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: mediatek: Add pm_ops to pinctrl-paris
Nicolas Boichat [Wed, 8 May 2019 07:33:30 +0000 (15:33 +0800)]
pinctrl: mediatek: Add pm_ops to pinctrl-paris

pinctrl variants that include pinctrl-paris.h (and not
pinctrl-mtk-common.h) also need to use pm_ops to setup
wake mask properly, so copy over the pm_ops from common
to paris variant.

It is not easy to merge the 2 copies (or move
mtk_eint_suspend/resume to mtk-eint.c), as we need to
dereference pctrl->eint, and struct mtk_pinctrl *pctl has a
different structure definition for v1 and v2 (which is
what paris variant uses).

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Acked-by: Sean Wang <sean.wang@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: gpio: meson8b-gpio: update with SPDX Licence identifier
Neil Armstrong [Mon, 20 May 2019 14:41:08 +0000 (16:41 +0200)]
dt-bindings: gpio: meson8b-gpio: update with SPDX Licence identifier

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: gpio: meson8-gpio: update with SPDX Licence identifier
Neil Armstrong [Mon, 20 May 2019 14:41:07 +0000 (16:41 +0200)]
dt-bindings: gpio: meson8-gpio: update with SPDX Licence identifier

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: gpio: meson-gxl-gpio: update with SPDX Licence identifier
Neil Armstrong [Mon, 20 May 2019 14:41:06 +0000 (16:41 +0200)]
dt-bindings: gpio: meson-gxl-gpio: update with SPDX Licence identifier

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: gpio: meson-gxbb-gpio: update with SPDX Licence identifier
Neil Armstrong [Mon, 20 May 2019 14:41:05 +0000 (16:41 +0200)]
dt-bindings: gpio: meson-gxbb-gpio: update with SPDX Licence identifier

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: meson: update with SPDX Licence identifier
Neil Armstrong [Mon, 20 May 2019 14:41:04 +0000 (16:41 +0200)]
pinctrl: meson: update with SPDX Licence identifier

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: tegra: Add Tegra194 pinmux driver
Krishna Yarlagadda [Thu, 16 May 2019 11:53:13 +0000 (17:23 +0530)]
pinctrl: tegra: Add Tegra194 pinmux driver

Tegra194 has PCIE L5 rst and clkreq pins which need to be controlled
dynamically at runtime. This driver supports change pinmux for these
pins. Pinmux for rest of the pins is set statically by bootloader and
will not be changed by this driver

Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Signed-off-by: Suresh Mangipudi <smangipudi@nvidia.com>
Tested-by: Vidya Sagar <vidyas@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: tegra: Support 32 bit register access
Krishna Yarlagadda [Thu, 16 May 2019 11:53:12 +0000 (17:23 +0530)]
pinctrl: tegra: Support 32 bit register access

Tegra194 chip has 32 bit pinctrl registers. Existing register defines in
header are only 16 bit.
Modified common pinctrl-tegra driver to support 32 bit registers of
Tegra 194 and later chips.

Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: Add Tegra194 pinctrl DT bindings
Krishna Yarlagadda [Thu, 16 May 2019 11:53:11 +0000 (17:23 +0530)]
pinctrl: Add Tegra194 pinctrl DT bindings

Add binding doc for Tegra 194 pinctrl driver.

Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Tested-by: Vidya Sagar <vidyas@nvidia.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: pinctrl: fix spelling mistakes in pinctl documentation
Colin Ian King [Sat, 25 May 2019 20:42:28 +0000 (21:42 +0100)]
dt-bindings: pinctrl: fix spelling mistakes in pinctl documentation

The spelling of configured is incorrect in the documentation. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: Add pinconf support for BM1880 SoC
Manivannan Sadhasivam [Mon, 20 May 2019 08:31:01 +0000 (14:01 +0530)]
pinctrl: Add pinconf support for BM1880 SoC

Add pinconf support for Bitmain BM1880 SoC. Pinconf support includes
pin bias, slew rate and schmitt trigger. Drive strength support will
be added later.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: pinctrl: Document pinconf bindings for BM1880 SoC
Manivannan Sadhasivam [Mon, 20 May 2019 08:31:00 +0000 (14:01 +0530)]
dt-bindings: pinctrl: Document pinconf bindings for BM1880 SoC

Document pinconf bindings for Bitmain BM1880 SoC.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: Rework the pinmux handling for BM1880 SoC
Manivannan Sadhasivam [Mon, 20 May 2019 08:30:59 +0000 (14:00 +0530)]
pinctrl: Rework the pinmux handling for BM1880 SoC

Rework the BM1880 SoC pinmux handling by removing the
BM1880_PINMUX_FUNCTION_MUX define and merging it with the
BM1880_PINMUX_FUNCTION definition. Since the PWM muxing is handled by
generic pin controller in the SoC itself, there is no need to have a
dedicated code to do the muxing in PWM registers. So, lets club all
pinmux handling in the same per pin mux handling code.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: pinctrl: Modify pinctrl memory map
Manivannan Sadhasivam [Mon, 20 May 2019 08:30:57 +0000 (14:00 +0530)]
dt-bindings: pinctrl: Modify pinctrl memory map

Earlier, the PWM registers were included as part of the pinctrl memory
map, but this turned to be useless as the muxing is being handled by the
SoC pin controller itself. So, lets modify the pinctrl memory map to
reflect the same.

Fixes: 07b734fbdea2 ("dt-bindings: pinctrl: Add BM1880 pinctrl binding")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: meson: add output support in pinconf
Jerome Brunet [Thu, 16 May 2019 15:13:39 +0000 (17:13 +0200)]
pinctrl: meson: add output support in pinconf

Add pinconf support for PIN_CONFIG_OUTPUT_ENABLE and PIN_CONFIG_OUTPUT
in the meson pinctrl driver.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: pinctrl: meson: add output support in pinconf
Jerome Brunet [Thu, 16 May 2019 15:13:38 +0000 (17:13 +0200)]
dt-bindings: pinctrl: meson: add output support in pinconf

add support for the pinconf DT property output-enable, output-disable,
output-low and output-high in the meson pinctrl driver.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: pinctrl: Convert stm32 pinctrl bindings to json-schema
Alexandre Torgue [Fri, 10 May 2019 15:45:26 +0000 (17:45 +0200)]
dt-bindings: pinctrl: Convert stm32 pinctrl bindings to json-schema

Convert the STM32 pinctrl binding to DT schema format using json-schema.

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: stm32: add lock mechanism for irqmux selection
Alexandre Torgue [Fri, 10 May 2019 07:43:03 +0000 (09:43 +0200)]
pinctrl: stm32: add lock mechanism for irqmux selection

GPIOs are split between several banks (A, B, ...) and each bank can have
up to 16 lines. Those GPIOs could be used as interrupt lines thanks to
exti lines. As there are only 16 exti lines, a mux is used to select which
gpio line is connected to which exti line. Mapping is done as follow:

-A0, B0, C0.. -->exti_line_0 (X0 selected by mux_0)
-A1, B1, C1.. -->exti_line_1 (X1 selected by mux_1)
...

This patch adds a protection to avoid overriding on mux_n for exti_line_n.

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: stm32: Enable suspend/resume for stm32mp157c SoC
Alexandre Torgue [Fri, 10 May 2019 07:42:30 +0000 (09:42 +0200)]
pinctrl: stm32: Enable suspend/resume for stm32mp157c SoC

Apply suspend/resume management for stm32mp157c MPU.

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: stm32: add suspend/resume management
Alexandre Torgue [Fri, 10 May 2019 07:42:29 +0000 (09:42 +0200)]
pinctrl: stm32: add suspend/resume management

During power sequence, GPIO hardware registers could be lost if the power
supply is switched off. Each device using pinctrl API is in charge of
managing pins during suspend/resume sequences. But for pins used as gpio or
irq stm32 pinctrl driver has to save the hardware configuration.

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: core: Do not add device links for hogs
Linus Walleij [Thu, 23 May 2019 22:11:43 +0000 (00:11 +0200)]
pinctrl: core: Do not add device links for hogs

Hogs would create circular device links, so do not link
the device to itself.

Cc: Benjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: stmfx: enable links creations
Benjamin Gaignard [Wed, 22 May 2019 15:29:25 +0000 (17:29 +0200)]
pinctrl: stmfx: enable links creations

Set create_link to inform pinctrl core that stmfx wants to create
link with its consumers.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: Enable device link creation for pin control
Benjamin Gaignard [Wed, 22 May 2019 15:29:24 +0000 (17:29 +0200)]
pinctrl: Enable device link creation for pin control

A pin controller may want to create a link between itself
and its clients to be sure of suspend/resume call ordering.

Introduce link_consumers field in pinctrl_desc structure to let
pinctrl core knows that controller expect to create a link.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
[Renamed create_link to link_consumers]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB
Doug Berger [Thu, 9 May 2019 20:59:54 +0000 (13:59 -0700)]
pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB

ARCH_BRCMSTB needs to use the BCM2835 pin controller for chips
like BCM7211 which adopted that pin controller for GPIO. This
commit makes the option menu configurable with default enabled
for ARCH_BRCMSTB and ARCH_BCM2835.

Signed-off-by: Doug Berger <opendmb@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: pinctrl: bcm2835-gpio: Document BCM7211 compatible
Florian Fainelli [Thu, 9 May 2019 20:59:53 +0000 (13:59 -0700)]
dt-bindings: pinctrl: bcm2835-gpio: Document BCM7211 compatible

BCM7211 has a slightly different block layout and some additional GPIO
registers that were added, document the compatible string.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: meson: g12a: add DS bank value
Guillaume La Roque [Tue, 14 May 2019 08:26:52 +0000 (10:26 +0200)]
pinctrl: meson: g12a: add DS bank value

add drive-strength bank regiter and bit value for G12A SoC

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: meson: add support of drive-strength-microamp
Guillaume La Roque [Tue, 14 May 2019 08:26:51 +0000 (10:26 +0200)]
pinctrl: meson: add support of drive-strength-microamp

drive-strength-microamp is a new feature needed for G12A SoC.
the default DS setting after boot is usually 500uA and it is not enough for
many functions. We need to be able to set the drive strength to reliably
enable things like MMC, I2C, etc ...

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: meson: Rework enable/disable bias part
Guillaume La Roque [Tue, 14 May 2019 08:26:50 +0000 (10:26 +0200)]
pinctrl: meson: Rework enable/disable bias part

rework bias enable/disable part to prepare drive-strength integration
no functional changes

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: pinctrl: meson: Add drive-strength-microamp property
Guillaume La Roque [Tue, 14 May 2019 08:26:49 +0000 (10:26 +0200)]
dt-bindings: pinctrl: meson: Add drive-strength-microamp property

Add optional drive-strength-microamp property

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: generic: add new 'drive-strength-microamp' property support
Guillaume La Roque [Tue, 14 May 2019 08:26:48 +0000 (10:26 +0200)]
pinctrl: generic: add new 'drive-strength-microamp' property support

Add drive-strength-microamp property support to allow drive strength in uA

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agodt-bindings: pinctrl: add a 'drive-strength-microamp' property
Guillaume La Roque [Tue, 14 May 2019 08:26:47 +0000 (10:26 +0200)]
dt-bindings: pinctrl: add a 'drive-strength-microamp' property

This property allow drive-strength parameter in uA instead of mA.

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: rockchip: fix leaked of_node references
Wen Yang [Mon, 15 Apr 2019 06:24:02 +0000 (14:24 +0800)]
pinctrl: rockchip: fix leaked of_node references

The call to of_parse_phandle returns a node pointer with refcount
incremented thus it must be explicitly decremented after the last
usage.

Detected by coccinelle with the following warnings:
./drivers/pinctrl/pinctrl-rockchip.c:3221:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 3196, but without a corresponding object release within this function.
./drivers/pinctrl/pinctrl-rockchip.c:3223:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 3196, but without a corresponding object release within this function.

Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-gpio@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years agopinctrl: sh-pfc: r8a7778: Use common PORT_GP_CFG_27() macro
Geert Uytterhoeven [Fri, 10 May 2019 10:46:35 +0000 (12:46 +0200)]
pinctrl: sh-pfc: r8a7778: Use common PORT_GP_CFG_27() macro

Get rid of the custom PORT_GP_PUP_27() macro by using the common
PORT_GP_CFG_27() macro instead.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
5 years agopinctrl: sh-pfc: Add PORT_GP_27 helper macro
Geert Uytterhoeven [Fri, 10 May 2019 10:44:21 +0000 (12:44 +0200)]
pinctrl: sh-pfc: Add PORT_GP_27 helper macro

This follows the style of the existing PORT_GP_X macros, and will be
used by a follow-up patch for the r8a7778 SoC.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
5 years agopinctrl: sh-pfc: r8a77965: Add TPU pins, groups and functions
Geert Uytterhoeven [Fri, 3 May 2019 09:02:29 +0000 (11:02 +0200)]
pinctrl: sh-pfc: r8a77965: Add TPU pins, groups and functions

Add pins, groups and functions for the 16-Bit Timer Pulse Unit outputs
on the R-Car M3-N SoC.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
5 years agopinctrl: sh-pfc: r8a7796: Add TPU pins, groups and functions
Geert Uytterhoeven [Fri, 3 May 2019 09:01:41 +0000 (11:01 +0200)]
pinctrl: sh-pfc: r8a7796: Add TPU pins, groups and functions

Add pins, groups and functions for the 16-Bit Timer Pulse Unit outputs
on the R-Car M3-W and RZ/G2M SoCs.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
5 years agopinctrl: sh-pfc: r8a7795: Add TPU pins, groups and functions
Geert Uytterhoeven [Fri, 3 May 2019 09:01:18 +0000 (11:01 +0200)]
pinctrl: sh-pfc: r8a7795: Add TPU pins, groups and functions

Add pins, groups and functions for the 16-Bit Timer Pulse Unit outputs
on revisions ES2.x and later of the R-Car H3 SoC.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
5 years agopinctrl: sh-pfc: r8a7795-es1: Add TPU pins, groups and functions
Geert Uytterhoeven [Fri, 3 May 2019 09:00:02 +0000 (11:00 +0200)]
pinctrl: sh-pfc: r8a7795-es1: Add TPU pins, groups and functions

Add pins, groups and functions for the 16-Bit Timer Pulse Unit outputs
on revision ES1.x of the R-Car H3 SoC.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
5 years agopinctrl: sh-pfc: r8a77970: Remove MMC_{CD,WP}
Geert Uytterhoeven [Mon, 1 Apr 2019 13:46:26 +0000 (15:46 +0200)]
pinctrl: sh-pfc: r8a77970: Remove MMC_{CD,WP}

Hardware Manual Errata for rev. 1.50 of March 26, 2019 removed the bit
definitions for MMC_CD and MMC_WP in the documentation for the IPSR6 and
IPSR7 registers, as these pin functionalities do not exist on R-Car
V3M.

Remove the definitions, and the corrresponding pins and groups.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
5 years agopinctrl: sh-pfc: Move PIN_NONE to shared header file
Geert Uytterhoeven [Thu, 21 Mar 2019 12:18:01 +0000 (13:18 +0100)]
pinctrl: sh-pfc: Move PIN_NONE to shared header file

Several drivers have identical definitions for PIN_NONE.
Provide a definition with a SH_PFC_ prefix for general use in sh_pfc.h,
and convert all drivers over to use it.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
5 years agopinctrl: sh-pfc: Add SH_PFC_PIN_CFG_PULL_UP_DOWN shorthand
Geert Uytterhoeven [Thu, 21 Mar 2019 15:17:47 +0000 (16:17 +0100)]
pinctrl: sh-pfc: Add SH_PFC_PIN_CFG_PULL_UP_DOWN shorthand

It is very common for a pin to support both pull-up and pull-down
functionality.  Hence add a shorthand SH_PFC_PIN_CFG_PULL_UP_DOWN.
This not only reduces typing, but also avoids the need for several line
breaks, and makes many overly long lines shorter, improving
readability.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
5 years agopinctrl: sh-pfc: Rename 2-parameter CPU_ALL_PORT() variant
Geert Uytterhoeven [Thu, 21 Mar 2019 15:17:47 +0000 (16:17 +0100)]
pinctrl: sh-pfc: Rename 2-parameter CPU_ALL_PORT() variant

There are two variants of the CPU_ALL_PORT() macro in use:
  1. A three-parameter variant, to be provided for SoCs with a linear
     GPIO pin space ("PORT style"),
  2. A two-parameter variant, to be provided for SoCs with 32-port GPIO
     banks ("GP port style").

Rename the 2-parameter variant to CPU_ALL_GP(), to avoid confusion, and
to increase naming consistency.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
5 years agopinctrl: sh-pfc: Validate pin tables at runtime
Geert Uytterhoeven [Wed, 27 Mar 2019 10:41:36 +0000 (11:41 +0100)]
pinctrl: sh-pfc: Validate pin tables at runtime

Extend the run-time debug code with checks to ensure there are no
conflicting pin names, numbers, or enumeration values.

This helps catching bugs early.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
5 years agopinctrl: sh-pfc: Add check for empty pinmux groups/functions
Geert Uytterhoeven [Thu, 25 Apr 2019 08:33:55 +0000 (10:33 +0200)]
pinctrl: sh-pfc: Add check for empty pinmux groups/functions

The pinmux groups and functions arrays may contain two parts, to ease
supporting SoCs that expose pin subsets of other related SoCs.  Both
parts need to be declared with explicit sizes, which thus need to be
updated when adding support for more groups and functions.

If a size is too small, the compiler will detect this at build time
("excess elements in array initializer").
If a size is too large, this may go undetected (for pin groups), lead to
pin controller registration failures (for pin functions: "pinmux ops has
no name for functionN"), or crash the optional run-time debug code (for
pin groups).

Extend the run-time debug code with checks to detect this, to help
catching bugs early.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
5 years agopinctrl: sh-pfc: Mark run-time debug code __init
Geert Uytterhoeven [Thu, 25 Apr 2019 08:54:11 +0000 (10:54 +0200)]
pinctrl: sh-pfc: Mark run-time debug code __init

All run-time debug code is called from sh_pfc_init(), which is __init.

Fixes: 6161b39a14380815 ("pinctrl: sh-pfc: Validate pinmux tables at runtime when debugging")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
5 years agopinctrl: sh-pfc: Correct printk level of group reference warning
Geert Uytterhoeven [Thu, 25 Apr 2019 08:51:46 +0000 (10:51 +0200)]
pinctrl: sh-pfc: Correct printk level of group reference warning

Improve wording while at it.

Fixes: 6161b39a14380815 ("pinctrl: sh-pfc: Validate pinmux tables at runtime when debugging")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
5 years agoLinux 5.2-rc1 v5.2-rc1
Linus Torvalds [Sun, 19 May 2019 22:47:09 +0000 (15:47 -0700)]
Linux 5.2-rc1

5 years agoMerge tag 'upstream-5.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw...
Linus Torvalds [Sun, 19 May 2019 22:22:03 +0000 (15:22 -0700)]
Merge tag 'upstream-5.2-rc2' of git://git./linux/kernel/git/rw/ubifs

Pull UBIFS fixes from Richard Weinberger:

 - build errors wrt xattrs

 - mismerge which lead to a wrong Kconfig ifdef

 - missing endianness conversion

* tag 'upstream-5.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
  ubifs: Convert xattr inum to host order
  ubifs: Use correct config name for encryption
  ubifs: Fix build error without CONFIG_UBIFS_FS_XATTR

5 years agoMerge branch 'akpm' (patches from Andrew)
Linus Torvalds [Sun, 19 May 2019 19:15:32 +0000 (12:15 -0700)]
Merge branch 'akpm' (patches from Andrew)

Merge yet more updates from Andrew Morton:
 "A few final bits:

   - large changes to vmalloc, yielding large performance benefits

   - tweak the console-flush-on-panic code

   - a few fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  panic: add an option to replay all the printk message in buffer
  initramfs: don't free a non-existent initrd
  fs/writeback.c: use rcu_barrier() to wait for inflight wb switches going into workqueue when umount
  mm/compaction.c: correct zone boundary handling when isolating pages from a pageblock
  mm/vmap: add DEBUG_AUGMENT_LOWEST_MATCH_CHECK macro
  mm/vmap: add DEBUG_AUGMENT_PROPAGATE_CHECK macro
  mm/vmalloc.c: keep track of free blocks for vmap allocation

5 years agoMerge tag 'kbuild-v5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
Linus Torvalds [Sun, 19 May 2019 18:53:58 +0000 (11:53 -0700)]
Merge tag 'kbuild-v5.2-2' of git://git./linux/kernel/git/masahiroy/linux-kbuild

Pull more Kbuild updates from Masahiro Yamada:

 - remove unneeded use of cc-option, cc-disable-warning, cc-ldoption

 - exclude tracked files from .gitignore

 - re-enable -Wint-in-bool-context warning

 - refactor samples/Makefile

 - stop building immediately if syncconfig fails

 - do not sprinkle error messages when $(CC) does not exist

 - move arch/alpha/defconfig to the configs subdirectory

 - remove crappy header search path manipulation

 - add comment lines to .config to clarify the end of menu blocks

 - check uniqueness of module names (adding new warnings intentionally)

* tag 'kbuild-v5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (24 commits)
  kconfig: use 'else ifneq' for Makefile to improve readability
  kbuild: check uniqueness of module names
  kconfig: Terminate menu blocks with a comment in the generated config
  kbuild: add LICENSES to KBUILD_ALLDIRS
  kbuild: remove 'addtree' and 'flags' magic for header search paths
  treewide: prefix header search paths with $(srctree)/
  media: prefix header search paths with $(srctree)/
  media: remove unneeded header search paths
  alpha: move arch/alpha/defconfig to arch/alpha/configs/defconfig
  kbuild: terminate Kconfig when $(CC) or $(LD) is missing
  kbuild: turn auto.conf.cmd into a mandatory include file
  .gitignore: exclude .get_maintainer.ignore and .gitattributes
  kbuild: add all Clang-specific flags unconditionally
  kbuild: Don't try to add '-fcatch-undefined-behavior' flag
  kbuild: add some extra warning flags unconditionally
  kbuild: add -Wvla flag unconditionally
  arch: remove dangling asm-generic wrappers
  samples: guard sub-directories with CONFIG options
  kbuild: re-enable int-in-bool-context warning
  MAINTAINERS: kbuild: Add pattern for scripts/*vmlinux*
  ...

5 years agoMerge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Sun, 19 May 2019 18:47:03 +0000 (11:47 -0700)]
Merge branch 'i2c/for-next' of git://git./linux/kernel/git/wsa/linux

Pull i2c updates from Wolfram Sang:
 "Some I2C core API additions which are kind of simple but enhance error
  checking for users a lot, especially by returning errno now.

  There are wrappers to still support the old API but it will be removed
  once all users are converted"

* 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: core: add device-managed version of i2c_new_dummy
  i2c: core: improve return value handling of i2c_new_device and i2c_new_dummy

5 years agoMerge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 19 May 2019 18:43:16 +0000 (11:43 -0700)]
Merge tag 'ext4_for_linus_stable' of git://git./linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
 "Some bug fixes, and an update to the URL's for the final version of
  Unicode 12.1.0"

* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: avoid panic during forced reboot due to aborted journal
  ext4: fix block validity checks for journal inodes using indirect blocks
  unicode: update to Unicode 12.1.0 final
  unicode: add missing check for an error return from utf8lookup()
  ext4: fix miscellaneous sparse warnings
  ext4: unsigned int compared against zero
  ext4: fix use-after-free in dx_release()
  ext4: fix data corruption caused by overlapping unaligned and aligned IO
  jbd2: fix potential double free
  ext4: zero out the unused memory region in the extent tree block