26 Mar, 2018

3 commits


23 Mar, 2018

1 commit


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

    Sean Wang
     
  • 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

    Sean Wang
     

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

    Sean Wang
     
  • 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

    Sean Wang
     

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

    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

    Ryder Lee
     

22 May, 2017

1 commit


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

    Jean Delvare
     
  • 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

    Mika Westerberg
     

30 Dec, 2016

1 commit


07 Dec, 2016

1 commit


22 Nov, 2016

1 commit


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

    Julia Lawall
     

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

    Paul Gortmaker
     

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
    ...

    Linus Torvalds
     

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

    hongkun.cao
     

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

    hongkun.cao
     

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
    ...

    Linus Torvalds
     

21 Apr, 2016

1 commit


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

    Yingjoe Chen
     

01 Apr, 2016

1 commit


10 Mar, 2016

1 commit


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

    Paul Gortmaker
     

25 Feb, 2016

1 commit


19 Feb, 2016

3 commits


18 Feb, 2016

1 commit


16 Feb, 2016

1 commit


14 Feb, 2016

1 commit


09 Feb, 2016

1 commit


05 Feb, 2016

2 commits


28 Jan, 2016

1 commit


27 Jan, 2016

1 commit

  • The Kconfig for these drivers are currently:

    config PINCTRL_MT8127
    bool "Mediatek MT8127 pin control" if COMPILE_TEST && !MACH_MT8127

    config PINCTRL_MT8135
    bool "Mediatek MT8135 pin control" if COMPILE_TEST && !MACH_MT8135

    config 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

    Paul Gortmaker