26 Mar, 2018
3 commits
-
This patch fixes check warnings.
Signed-off-by: Zhiyong Tao
Signed-off-by: Linus Walleij -
For generic pins, parameter "arg" is 0 or 1.
For special pins, bias-disable is set by R0R1,
so we need transmited "00" to set bias-disable
When we set "bias-disable" as high-z property,
the parameter should be "MTK_PUPD_SET_R1R0_00".Signed-off-by: Zhiyong Tao
Reviewed-by: Sean Wang
Signed-off-by: Linus Walleij -
The commit includes mt2712 pinctrl driver.
Signed-off-by: Zhiyong Tao
Reviewed-by: Sean Wang
Signed-off-by: Linus Walleij
23 Mar, 2018
1 commit
-
Assign true or false to boolean variables instead of an integer value.
This issue was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva
Signed-off-by: Linus Walleij
11 Jan, 2018
2 commits
-
Make consistent error handling of all mtk_hw_get_value occurrences using
propagating error code from the internal instead of creating a new one.Signed-off-by: Sean Wang
Reviewed-by: Matthias Brugger
Signed-off-by: Linus Walleij -
commit d6ed93551320 ("pinctrl: mediatek: add pinctrl driver for MT7622
SoC") leads to the following static checker warning:drivers/pinctrl/mediatek/pinctrl-mt7622.c:1419 mtk_gpio_get()
error: uninitialized symbol 'value'.
1412 static int mtk_gpio_get(struct gpio_chip *chip, unsigned int gpio)
1413 {
1414 struct mtk_pinctrl *hw = dev_get_drvdata(chip->parent);
1415 int value;
1416
1417 mtk_hw_get_value(hw, gpio, PINCTRL_PIN_REG_DI, &value);
^^^^^^^^^^^^^^^^
1418
1419 return !!value;
1420 }The appropriate error handling must be added to avoid the potential error
caused by uninitialized value being returned.Reported-by: Dan Carpenter
Signed-off-by: Sean Wang
Reviewed-by: Matthias Brugger
Signed-off-by: Linus Walleij
20 Dec, 2017
2 commits
-
Add support for pinctrl on MT7622 SoC. The IO core found on the SoC has
the registers for pinctrl, pinconf and gpio mixed up in the same register
range. However, the IO core for the MT7622 SoC is completely distinct from
anyone of previous MediaTek SoCs which already had support, such as
the hardware internal, register address map and register detailed
definition for each pin.Therefore, instead, the driver is being newly implemented by reusing
generic methods provided from the core layer with GENERIC_PINCONF,
GENERIC_PINCTRL_GROUPS, and GENERIC_PINMUX_FUNCTIONS for the sake of code
simplicity and rid of superfluous code. Where the function of pins
determined by groups is utilized in this driver which can help developers
less confused with what combinations of pins effective on the SoC and even
reducing the mistakes during the integration of those relevant boards.As the gpio_chip handling is also only a few lines, the driver also
implements the gpio functionality directly through GPIOLIB.Signed-off-by: Sean Wang
Reviewed-by: Biao Huang
Signed-off-by: Linus Walleij -
Since lots of MediaTek drivers had been added, it seems slightly better
for that adding cleanup for placing MediaTek pinctrl drivers under the
independent menu as other kinds of drivers usually was done.Signed-off-by: Sean Wang
Reviewed-by: Biao Huang
Signed-off-by: Linus Walleij
02 Nov, 2017
1 commit
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
31 Aug, 2017
1 commit
-
MT2701 shares the same driver with MT7623, but there is a slight difference
between their pin functions (e.g., PCIe), so we update the different parts
in pinmux table.Doing so, SoC could choose the correct mux setting via their own pinfun.h.
Signed-off-by: Ryder Lee
Cc: Biao Huang
Signed-off-by: Linus Walleij
22 May, 2017
1 commit
-
mt7623 pinctrl hardware can be compatible with mt2701 driver,
so the patch lets the pinctrl on mt7623 SoC reuse the driver
and deletes those redundant ones.Signed-off-by: Sean Wang
Acked-by: John Crispin
Reviewed-by: Matthias Brugger
Signed-off-by: Linus Walleij
26 Jan, 2017
3 commits
-
Do not hide pinctrl drivers for Mediatek platforms using
conditionals. Doing so actually leaves the symbols present (but
always disabled) on all other platforms, which is confusing and
inefficient. Better use real dependencies so that the symbols do not
exist at all on platforms where they are not relevant.Signed-off-by: Jean Delvare
Reported-by: Andreas Färber
Reviewed-by: Matthias Brugger
Signed-off-by: Linus Walleij -
Currently we already have two pin configuration related callbacks
available for GPIO chips .set_single_ended() and .set_debounce(). In
future we expect to have even more, which does not scale well if we need
to add yet another callback to the GPIO chip structure for each possible
configuration parameter.Better solution is to reuse what we already have available in the
generic pinconf.To support this, we introduce a new .set_config() callback for GPIO
chips. The callback takes a single packed pin configuration value as
parameter. This can then be extended easily beyond what is currently
supported by just adding new types to the generic pinconf enum.If the GPIO driver is backed up by a pinctrl driver the GPIO driver can
just assign gpiochip_generic_config() (introduced in this patch) to
.set_config and that will take care configuration requests are directed
to the pinctrl driver.We then convert the existing drivers over .set_config() and finally
remove the .set_single_ended() and .set_debounce() callbacks.Suggested-by: Linus Walleij
Signed-off-by: Mika Westerberg
Reviewed-by: Andy Shevchenko
Signed-off-by: Linus Walleij
30 Dec, 2016
1 commit
-
This patch updates my email address as I no longer have access to the old
one.Signed-off-by: John Crispin
Signed-off-by: Linus Walleij
07 Dec, 2016
1 commit
-
the default mode of GPIO16 pin is gpio, when set EINT16 to
IRQ_TYPE_LEVEL_HIGH, no interrupt is triggered, it can be
fixed when set its default mode as usb iddig.Signed-off-by: Chunfeng Yun
Acked-by: Hongzhou Yang
Signed-off-by: Linus Walleij
22 Nov, 2016
1 commit
-
Use builtin_platform_driver() helper to simplify the code.
Signed-off-by: Geliang Tang
Acked-by: Hongzhou Yang
Signed-off-by: Linus Walleij
13 Sep, 2016
1 commit
-
These structures are only used to copy into other structures, so declare
them as const.The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)//
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct gpio_chip i@p = { ... };@ok@
identifier r.i;
expression e;
position p;
@@
e = i@p;@bad@
position p != {r.p,ok.p};
identifier r.i;
struct gpio_chip e;
@@
e@i@p@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct gpio_chip i = { ... };
//Signed-off-by: Julia Lawall
Signed-off-by: Linus Walleij
27 Aug, 2016
1 commit
-
The Makefile currently controlling compilation of this code is:
drivers/pinctrl/mediatek/pinctrl-mtk-common.o
---> drivers/pinctrl/mediatek/Makefile:obj-y += pinctrl-mtk-common.o...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modular infrastructure use, so that
when reading the driver there is no doubt it is builtin-only.We delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.We don't replace module.h with init.h since the file doesn't need that.
Cc: Linus Walleij
Cc: Hongzhou Yang
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Linus Walleij
29 Jul, 2016
1 commit
-
Pull pin control updates from Linus Walleij:
"This is the bulk of pin control changes for the v4.8 kernel cycle.Nothing stands out as especially exiting: new drivers, new subdrivers,
lots of cleanups and incremental features.Business as usual.
New drivers:
- New driver for Oxnas pin control and GPIO. This ARM-based chipset
is used in a few storage (NAS) type devices.- New driver for the MAX77620/MAX20024 pin controller portions.
- New driver for the Intel Merrifield pin controller.
New subdrivers:
- New subdriver for the Qualcomm MDM9615
- New subdriver for the STM32F746 MCU
- New subdriver for the Broadcom NSP SoC.
Cleanups:
- Demodularization of bool compiled-in drivers.
Apart from this there is just regular incremental improvements to a
lot of drivers, especially Uniphier and PFC"* tag 'pinctrl-v4.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (131 commits)
pinctrl: fix pincontrol definition for marvell
pinctrl: xway: fix typo
Revert "pinctrl: amd: make it explicitly non-modular"
pinctrl: iproc: Add NSP and Stingray GPIO support
pinctrl: Update iProc GPIO DT bindings
pinctrl: bcm: add OF dependencies
pinctrl: ns2: remove redundant dev_err call in ns2_pinmux_probe()
pinctrl: Add STM32F746 MCU support
pinctrl: intel: Protect set wake flow by spin lock
pinctrl: nsp: remove redundant dev_err call in nsp_pinmux_probe()
pinctrl: uniphier: add Ethernet pin-mux settings
sh-pfc: Use PTR_ERR_OR_ZERO() to simplify the code
pinctrl: ns2: fix return value check in ns2_pinmux_probe()
pinctrl: qcom: update DT bindings with ebi2 groups
pinctrl: qcom: establish proper EBI2 pin groups
pinctrl: imx21: Remove the MODULE_DEVICE_TABLE() macro
Documentation: dt: Add new compatible to STM32 pinctrl driver bindings
includes: dt-bindings: Add STM32F746 pinctrl DT bindings
pinctrl: sunxi: fix nand0 function name for sun8i
pinctrl: uniphier: remove pointless pin-mux settings for PH1-LD11
...
08 Jun, 2016
1 commit
-
An irq which is a wake up source maybe masked unexpectedly if the wake
up source irq was triggered after pinctrl irqchip suspend and before
suspend_device_irqs finished.
Use *_noirq callbacks to guarantee pinctrl irqchip suspend would be
called after suspend_devices_irqs.Signed-off-by: hongkun.cao
Signed-off-by: Linus Walleij
31 May, 2016
1 commit
-
When a dual-edge irq is triggered, an incorrect irq will be reported on
condition that the external signal is not stable and this incorrect irq
has been registered.
Correct the register offset.Cc: stable@vger.kernel.org
Signed-off-by: Hongkun Cao
Reviewed-by: Matthias Brugger
Signed-off-by: Linus Walleij
20 May, 2016
1 commit
-
Pull pin control updates from Linus Walleij:
"This kernel cycle was quite calm when it comes to pin control and
there is really just one major change, and that is the introduction of
devm_pinctrl_register() managed resources.Apart from that linear development, details below.
Core changes:
- Add the devm_pinctrl_register() API and switch all applicable
drivers to use it, saving lots of lines of code all over the place.New drivers:
- driver for the Broadcom NS2 SoC
- subdriver for the PXA25x SoCs
- subdriver for the AMLogic Meson GXBB SoC
Driver improvements:
- the Intel Baytrail driver now properly supports pin control
- Nomadik, Rockchip, Broadcom BCM2835 support the .get_direction()
callback in the GPIO portions- continued development and stabilization of several SH-PFC SoC
subdrivers: r8a7795, r8a7790, r8a7794 etc"* tag 'pinctrl-v4.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (85 commits)
Revert "pinctrl: tegra: avoid parked_reg and parked_bank"
pinctrl: meson: Fix eth_tx_en bit index
pinctrl: tegra: avoid parked_reg and parked_bank
pinctrl: tegra: Correctly check the supported configuration
pinctrl: amlogic: Add support for Amlogic Meson GXBB SoC
pinctrl: rockchip: fix pull setting error for rk3399
pinctrl: stm32: Implement .pin_config_dbg_show()
pinctrl: nomadik: hide nmk_gpio_get_mode when unused
pinctrl: ns2: rename pinctrl_utils_dt_free_map
pinctrl: at91: Merge clk_prepare and clk_enable into clk_prepare_enable
pinctrl: at91: Make at91_gpio_template const
pinctrl: baytrail: fix some error handling in debugfs
pinctrl: ns2: add pinmux driver support for Broadcom NS2 SoC
pinctrl: sirf/atlas7: trivial fix of spelling mistake on flagged
pinctrl: sh-pfc: Kill unused variable in sh_pfc_remove()
pinctrl: nomadik: implement .get_direction()
pinctrl: nomadik: use BIT() with offsets consequently
pinctrl: exynos5440: Use off-stack memory for pinctrl_gpio_range
pinctrl: zynq: Use devm_pinctrl_register() for pinctrl registration
pinctrl: u300: Use devm_pinctrl_register() for pinctrl registration
...
21 Apr, 2016
1 commit
-
Use devm_pinctrl_register() for pin control registration and clean
the error path.Signed-off-by: Laxman Dewangan
Cc: Matthias Brugger
Cc: Hongzhou Yang
Cc: Yingjoe Chen
Reviewed-by: Matthias Brugger
Acked-by: Hongzhou Yang
Signed-off-by: Linus Walleij
15 Apr, 2016
1 commit
-
The debounce time unit for gpio_chip.set_debounce is us but
mtk_gpio_set_debounce regard it as ms.
Fix this by correct debounce time array dbnc_arr so it can find correct
debounce setting. Debounce time for first debounce setting is 500us,
correct this as well.While I'm at it, also change the debounce time array name to
"debounce_time" for readability.Cc: stable@vger.kernel.org
Signed-off-by: Yingjoe Chen
Reviewed-by: Daniel Kurtz
Acked-by: Hongzhou Yang
Signed-off-by: Linus Walleij
01 Apr, 2016
1 commit
-
Rename pinctrl_utils_dt_free_map to pinctrl_utils_free_map, since
it does not depend on device tree despite the current name. This
will enforce a consistent naming in pinctr-utils.c and will make
it clear it can be called from outside device tree (e.g. from
ACPI handling code).Signed-off-by: Irina Tirdea
Signed-off-by: Linus Walleij
10 Mar, 2016
1 commit
-
Linux 4.5-rc5
09 Mar, 2016
1 commit
-
The Kconfig for this driver is currently:
config PINCTRL_MT6397
bool "Mediatek MT6397 pin control" if COMPILE_TEST && !MFD_MT6397...meaning that it is currently not being built as a module by anyone.
Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
Cc: Matthias Brugger
Cc: linux-gpio@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Signed-off-by: Paul Gortmaker
Acked-by: Hongzhou Yang
Signed-off-by: Linus Walleij
25 Feb, 2016
1 commit
-
This is set by the device core.
Cc: John Crispin
Reported-by: kbuild test robot
Signed-off-by: Linus Walleij
19 Feb, 2016
3 commits
-
Add the driver and header files required to make pinctrl work on MediaTek
MT7623.Signed-off-by: John Crispin
Signed-off-by: Linus Walleij -
To use pin as eint, user should make sure that:
1. pin is set to right mode, this is done in .irq_request_resources
implementation already.
2. direction of the pin is input, which should call GPIO API to set
pin to input gpio.
We add what step 2 do to .irq_request_resources so that user doesn't
need call GPIO API any more when pin for eint usage.Signed-off-by: Biao Huang
Signed-off-by: Linus Walleij -
Since input-disable cuts off input signal of gpio, add input-enable
setting in .gpio_request_enable implementation to ensure gpio function wellSigned-off-by: Biao Huang
Signed-off-by: Linus Walleij
18 Feb, 2016
1 commit
-
The device core will handle this and Coccinelle complains.
Signed-off-by: Linus Walleij
16 Feb, 2016
1 commit
-
The function can return negative values, so its result should
be assigned to signed variable.The problem has been detected using coccinelle semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci.Fixes: 59ee9c9 ('pinctrl: mediatek: Add gpio_request_enable support')
Signed-off-by: Andrzej Hajda
Acked-by: Hongzhou Yang
Signed-off-by: Linus Walleij
14 Feb, 2016
1 commit
-
CONFIG_PINCTRL_MTK is more suitable than CONFIG_ARCH_MEDIATEK
to guard the drivers/pinctrl/mediatek/ directory.
(I renamed CONFIG_PINCTRL_MTK_COMMON to CONFIG_PINCTRL_MTK.)This allows COMPILE_TEST to descend into drivers/pinctrl/mediatek
without CONFIG_ARCH_MEDIATEK define.Signed-off-by: Masahiro Yamada
Signed-off-by: Linus Walleij
09 Feb, 2016
1 commit
05 Feb, 2016
2 commits
-
Implement the .gpio_request_enable() callbacks in struct pinmux_ops
in mediatek pinctrl driver. Make sure that when gpio_request is called,
GPIO on the pin is enabled.Signed-off-by: Biao Huang
Signed-off-by: Linus Walleij -
Since input-enable/disable and input-schmitt-enable/disable are
workable when gpio direction is input, so add direction setting
when do input-enable/disable and input-schmitt-enable/disable
properties.Signed-off-by: Biao Huang
Signed-off-by: Linus Walleij
28 Jan, 2016
1 commit
-
Add mt2701 support using mediatek common pinctrl driver.
MT2701 have some special pins need an extra setting register
than other ICs, so adding this support to common code.Signed-off-by: Biao Huang
Acked-by: Yingjoe Chen
Signed-off-by: Linus Walleij
27 Jan, 2016
1 commit
-
The Kconfig for these drivers are currently:
config PINCTRL_MT8127
bool "Mediatek MT8127 pin control" if COMPILE_TEST && !MACH_MT8127config PINCTRL_MT8135
bool "Mediatek MT8135 pin control" if COMPILE_TEST && !MACH_MT8135config PINCTRL_MT8173
bool "Mediatek MT8173 pin control"...meaning that they are currently not being built as a module by anyone.
Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.A recent commit moved these from module_init to arch_initcall already, so
the init ordering remains untouched with this commit.We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
Cc: Daniel Kurtz
Cc: Matthias Brugger
Cc: Hongzhou Yang
Cc: Yingjoe Chen
Cc: linux-gpio@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Linus Walleij