08 Oct, 2020

1 commit

  • * tag 'v5.4.70': (3051 commits)
    Linux 5.4.70
    netfilter: ctnetlink: add a range check for l3/l4 protonum
    ep_create_wakeup_source(): dentry name can change under you...
    ...

    Conflicts:
    arch/arm/mach-imx/pm-imx6.c
    arch/arm64/boot/dts/freescale/imx8mm-evk.dts
    arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts
    drivers/crypto/caam/caamalg.c
    drivers/gpu/drm/imx/dw_hdmi-imx.c
    drivers/gpu/drm/imx/imx-ldb.c
    drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c
    drivers/mmc/host/sdhci-esdhc-imx.c
    drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
    drivers/net/ethernet/freescale/enetc/enetc.c
    drivers/net/ethernet/freescale/enetc/enetc_pf.c
    drivers/thermal/imx_thermal.c
    drivers/usb/cdns3/ep0.c
    drivers/xen/swiotlb-xen.c
    sound/soc/fsl/fsl_esai.c
    sound/soc/fsl/fsl_sai.c

    Signed-off-by: Jason Liu

    Jason Liu
     

07 Oct, 2020

1 commit

  • [ Upstream commit 63c3212e7a37d68c89a13bdaebce869f4e064e67 ]

    Per the datasheet the i2c functions use MPP_Sel=0x1. They are documented
    as using MPP_Sel=0x4 as well but mixing 0x1 and 0x4 is clearly wrong. On
    the board tested 0x4 resulted in a non-functioning i2c bus so stick with
    0x1 which works.

    Fixes: d7ae8f8dee7f ("pinctrl: mvebu: pinctrl driver for 98DX3236 SoC")
    Signed-off-by: Chris Packham
    Reviewed-by: Andrew Lunn
    Link: https://lore.kernel.org/r/20200907211712.9697-2-chris.packham@alliedtelesis.co.nz
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin

    Chris Packham
     

21 Aug, 2020

2 commits

  • commit 84e7a946da71f678affacea301f6d5cb4d9784e8 upstream.

    The PAT1 register contains information about the IRQ type (edge/level)
    for input GPIOs with IRQ enabled, and the direction for non-IRQ GPIOs.
    So it makes sense to read it only if the GPIO has no interrupt
    configured, otherwise input GPIOs configured for level IRQs are
    misdetected as output GPIOs.

    Fixes: ebd6651418b6 ("pinctrl: ingenic: Implement .get_direction for GPIO chips")
    Reported-by: João Henrique
    Signed-off-by: Paul Cercueil
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200622214548.265417-2-paul@crapouillou.net
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Paul Cercueil
     
  • commit 1c95348ba327fe8621d3680890c2341523d3524a upstream.

    Ingenic SoCs don't natively support registering an interrupt for both
    rising and falling edges. This has to be emulated in software.

    Until now, this was emulated by switching back and forth between
    IRQ_TYPE_EDGE_RISING and IRQ_TYPE_EDGE_FALLING according to the level of
    the GPIO. While this worked most of the time, when used with GPIOs that
    need debouncing, some events would be lost. For instance, between the
    time a falling-edge interrupt happens and the interrupt handler
    configures the hardware for rising-edge, the level of the pin may have
    already risen, and the rising-edge event is lost.

    To address that issue, instead of switching back and forth between
    IRQ_TYPE_EDGE_RISING and IRQ_TYPE_EDGE_FALLING, we now switch back and
    forth between IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_LEVEL_HIGH. Since we
    always switch in the interrupt handler, they actually permit to detect
    level changes. In the example above, if the pin level rises before
    switching the IRQ type from IRQ_TYPE_LEVEL_LOW to IRQ_TYPE_LEVEL_HIGH,
    a new interrupt will raise as soon as the handler exits, and the
    rising-edge event will be properly detected.

    Fixes: e72394e2ea19 ("pinctrl: ingenic: Merge GPIO functionality")
    Reported-by: João Henrique
    Signed-off-by: Paul Cercueil
    Tested-by: João Henrique
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200622214548.265417-1-paul@crapouillou.net
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Paul Cercueil
     

19 Aug, 2020

1 commit

  • [ Upstream commit f46fe79ff1b65692a65266a5bec6dbe2bf7fc70f ]

    This patch causes pcs_parse_pinconf() to return -ENOTSUPP when no
    pinctrl_map is added. The current behavior is to return 0 when
    !PCS_HAS_PINCONF or !nconfs. Thus pcs_parse_one_pinctrl_entry()
    incorrectly assumes that a map was added and sets num_maps = 2.

    Analysis:
    =========
    The function pcs_parse_one_pinctrl_entry() calls pcs_parse_pinconf()
    if PCS_HAS_PINCONF is enabled. The function pcs_parse_pinconf()
    returns 0 to indicate there was no error and num_maps is then set to 2:

    980 static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
    981 struct device_node *np,
    982 struct pinctrl_map **map,
    983 unsigned *num_maps,
    984 const char **pgnames)
    985 {

    1053 (*map)->type = PIN_MAP_TYPE_MUX_GROUP;
    1054 (*map)->data.mux.group = np->name;
    1055 (*map)->data.mux.function = np->name;
    1056
    1057 if (PCS_HAS_PINCONF && function) {
    1058 res = pcs_parse_pinconf(pcs, np, function, map);
    1059 if (res)
    1060 goto free_pingroups;
    1061 *num_maps = 2;
    1062 } else {
    1063 *num_maps = 1;
    1064 }

    However, pcs_parse_pinconf() will also return 0 if !PCS_HAS_PINCONF or
    !nconfs. I believe these conditions should indicate that no map was
    added by returning -ENOTSUPP. Otherwise pcs_parse_one_pinctrl_entry()
    will set num_maps = 2 even though no maps were successfully added, as
    it does not reach "m++" on line 940:

    895 static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
    896 struct pcs_function *func,
    897 struct pinctrl_map **map)
    898
    899 {
    900 struct pinctrl_map *m = *map;

    917 /* If pinconf isn't supported, don't parse properties in below. */
    918 if (!PCS_HAS_PINCONF)
    919 return 0;
    920
    921 /* cacluate how much properties are supported in current node */
    922 for (i = 0; i < ARRAY_SIZE(prop2); i++) {
    923 if (of_find_property(np, prop2[i].name, NULL))
    924 nconfs++;
    925 }
    926 for (i = 0; i < ARRAY_SIZE(prop4); i++) {
    927 if (of_find_property(np, prop4[i].name, NULL))
    928 nconfs++;
    929 }
    930 if (!nconfs)
    919 return 0;
    932
    933 func->conf = devm_kcalloc(pcs->dev,
    934 nconfs, sizeof(struct pcs_conf_vals),
    935 GFP_KERNEL);
    936 if (!func->conf)
    937 return -ENOMEM;
    938 func->nconfs = nconfs;
    939 conf = &(func->conf[0]);
    940 m++;

    This situtation will cause a boot failure [0] on the BeagleBone Black
    (AM3358) when am33xx_pinmux node in arch/arm/boot/dts/am33xx-l4.dtsi
    has compatible = "pinconf-single" instead of "pinctrl-single".

    The patch fixes this issue by returning -ENOSUPP when !PCS_HAS_PINCONF
    or !nconfs, so that pcs_parse_one_pinctrl_entry() will know that no
    map was added.

    Logic is also added to pcs_parse_one_pinctrl_entry() to distinguish
    between -ENOSUPP and other errors. In the case of -ENOSUPP, num_maps
    is set to 1 as it is valid for pinconf to be enabled and a given pin
    group to not any pinconf properties.

    [0] https://lore.kernel.org/linux-omap/20200529175544.GA3766151@x1/

    Fixes: 9dddb4df90d1 ("pinctrl: single: support generic pinconf")
    Signed-off-by: Drew Fustini
    Acked-by: Tony Lindgren
    Link: https://lore.kernel.org/r/20200608125143.GA2789203@x1
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin

    Drew Fustini
     

29 Jul, 2020

1 commit

  • [ Upstream commit 69339d083dfb7786b0e0b3fc19eaddcf11fabdfb ]

    uart0_pins is defined as:
    static const unsigned uart0_pins[] = {135, 136, 137, 138, 139};

    which npins is wronly specified as 9 later
    {
    .name = "uart0",
    .pins = uart0_pins,
    .npins = 9,
    },

    npins should be 5 instead of 9 according to the definition.

    Signed-off-by: Jacky Hu
    Link: https://lore.kernel.org/r/20200616015024.287683-1-hengqing.hu@gmail.com
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin

    Jacky Hu
     

01 Jul, 2020

2 commits

  • [ Upstream commit 782b6b69847f34dda330530493ea62b7de3fd06a ]

    Use noirq suspend/resume callbacks as other drivers which implement
    noirq suspend/resume callbacks (Ex:- PCIe) depend on pinctrl driver to
    configure the signals used by their respective devices in the noirq phase.

    Signed-off-by: Vidya Sagar
    Reviewed-by: Dmitry Osipenko
    Link: https://lore.kernel.org/r/20200604174935.26560-1-vidyas@nvidia.com
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin

    Vidya Sagar
     
  • [ Upstream commit 5e50311556c9f409a85740e3cb4c4511e7e27da0 ]

    Fix the following warnings caused by reusage of the same irq_chip
    instance for all spmi-gpio gpio_irq_chip instances. Instead embed
    irq_chip into pmic_gpio_state struct.

    gpio gpiochip2: (c440000.qcom,spmi:pmic@2:gpio@c000): detected irqchip that is shared with multiple gpiochips: please fix the driver.
    gpio gpiochip3: (c440000.qcom,spmi:pmic@4:gpio@c000): detected irqchip that is shared with multiple gpiochips: please fix the driver.
    gpio gpiochip4: (c440000.qcom,spmi:pmic@a:gpio@c000): detected irqchip that is shared with multiple gpiochips: please fix the driver.

    Signed-off-by: Dmitry Baryshkov
    Acked-by: Manivannan Sadhasivam
    Link: https://lore.kernel.org/r/20200604002817.667160-1-dmitry.baryshkov@linaro.org
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin

    Dmitry Baryshkov
     

24 Jun, 2020

5 commits

  • [ Upstream commit 11d8da5cabf7c6c3263ba2cd9c00260395867048 ]

    'pinctrl_unregister()' should not be called to undo
    'devm_pinctrl_register_and_init()', it is already handled by the framework.

    This simplifies the error handling paths of the probe function.
    The 'imx_free_resources()' can be removed as well.

    Fixes: a51c158bf0f7 ("pinctrl: imx: use radix trees for groups and functions")
    Signed-off-by: Christophe JAILLET
    Reviewed-by: Dong Aisheng
    Link: https://lore.kernel.org/r/20200530204955.588962-1-christophe.jaillet@wanadoo.fr
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin

    Christophe JAILLET
     
  • [ Upstream commit 9eb728321286c4b31e964d2377fca2368526d408 ]

    When 'pinctrl_register()' has been turned into 'devm_pinctrl_register()',
    an error handling path has not been updated.

    Axe a now unneeded 'pinctrl_unregister()'.

    Fixes: e55e025d1687 ("pinctrl: imxl: Use devm_pinctrl_register() for pinctrl registration")
    Signed-off-by: Christophe JAILLET
    Link: https://lore.kernel.org/r/20200530201952.585798-1-christophe.jaillet@wanadoo.fr
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin

    Christophe JAILLET
     
  • [ Upstream commit d7faa8ffb6be57bf8233a4b5a636d76b83c51ce7 ]

    In function rockchip_dt_node_to_map, a new_map variable is
    allocated by:

    new_map = devm_kcalloc(pctldev->dev, map_num, sizeof(*new_map),
    GFP_KERNEL);

    This uses devres and attaches new_map to the pinctrl driver.
    This cause a leak since new_map is not released when the probed
    driver is removed. Fix it by using kcalloc to allocate new_map
    and free it in `rockchip_dt_free_map`

    Signed-off-by: Dafna Hirschfeld
    Reviewed-by: Heiko Stuebner
    Link: https://lore.kernel.org/r/20200506100903.15420-1-dafna.hirschfeld@collabora.com
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin

    Dafna Hirschfeld
     
  • [ Upstream commit 4b4e8e93eccc2abc4209fe226ec89e7fbe9f3c61 ]

    The rza1l_swio_entries referred to the wrong array rza1h_swio_pins,
    which was intended to be rza1l_swio_pins. So let's fix it.

    This is detected by the following gcc warning:

    drivers/pinctrl/pinctrl-rza1.c:401:35: warning: ‘rza1l_swio_pins’
    defined but not used [-Wunused-const-variable=]
    static const struct rza1_swio_pin rza1l_swio_pins[] = {
    ^~~~~~~~~~~~~~~

    Fixes: 039bc58e73b77723 ("pinctrl: rza1: Add support for RZ/A1L")
    Reported-by: Hulk Robot
    Signed-off-by: Jason Yan
    Link: https://lore.kernel.org/r/20200417111604.19143-1-yanaijie@huawei.com
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Sasha Levin

    Jason Yan
     
  • [ Upstream commit 0b47afc65453a70bc521e251138418056f65793f ]

    This fixes a problem with using the GPIO as an interrupt on Jaguar2
    (and similar), as the register layout of the platforms with 64 GPIO's
    are pairwise, such that the original offset must be multiplied with
    the platform stride.

    Fixes: da801ab56ad8 pinctrl: ocelot: add MSCC Jaguar2 support.
    Reviewed-by: Alexandre Belloni
    Signed-off-by: Lars Povlsen
    Link: https://lore.kernel.org/r/20200513125532.24585-4-lars.povlsen@microchip.com
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin

    Lars Povlsen
     

22 Jun, 2020

10 commits


19 Jun, 2020

1 commit

  • * tag 'v5.4.47': (2193 commits)
    Linux 5.4.47
    KVM: arm64: Save the host's PtrAuth keys in non-preemptible context
    KVM: arm64: Synchronize sysreg state on injecting an AArch32 exception
    ...

    Conflicts:
    arch/arm/boot/dts/imx6qdl.dtsi
    arch/arm/mach-imx/Kconfig
    arch/arm/mach-imx/common.h
    arch/arm/mach-imx/suspend-imx6.S
    arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
    arch/powerpc/include/asm/cacheflush.h
    drivers/cpufreq/imx6q-cpufreq.c
    drivers/dma/imx-sdma.c
    drivers/edac/synopsys_edac.c
    drivers/firmware/imx/imx-scu.c
    drivers/net/ethernet/freescale/fec.h
    drivers/net/ethernet/freescale/fec_main.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    drivers/net/phy/phy_device.c
    drivers/perf/fsl_imx8_ddr_perf.c
    drivers/usb/cdns3/gadget.c
    drivers/usb/dwc3/gadget.c
    include/uapi/linux/dma-buf.h

    Signed-off-by: Jason Liu

    Jason Liu
     

20 May, 2020

4 commits

  • [ Upstream commit 69388e15f5078c961b9e5319e22baea4c57deff1 ]

    According to Braswell NDA Specification Update (#557593),
    concurrent read accesses may result in returning 0xffffffff and write
    instructions may be dropped. We have an established format for the
    commit references, i.e.
    cdca06e4e859 ("pinctrl: baytrail: Add missing spinlock usage in
    byt_gpio_irq_handler")

    Fixes: 0bd50d719b00 ("pinctrl: cherryview: prevent concurrent access to GPIO controllers")
    Signed-off-by: Grace Kao
    Reported-by: Brian Norris
    Reviewed-by: Brian Norris
    Acked-by: Mika Westerberg
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Sasha Levin

    Grace Kao
     
  • [ Upstream commit 90bcb0c3ca0809d1ed358bfbf838df4b3d4e58e0 ]

    Fix a typo in the readl/writel accessor conversion where val is used
    instead of pol changing the behavior of the original code.

    Cc: stable@vger.kernel.org
    Fixes: 6c73698904aa pinctrl: qcom: Introduce readl/writel accessors
    Signed-off-by: Ansuel Smith
    Reviewed-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/20200414003726.25347-1-ansuelsmth@gmail.com
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin

    Ansuel Smith
     
  • [ Upstream commit ccd025eaddaeb99e982029446197c544252108e2 ]

    It appears that pin configuration for GPIO chip hasn't been enabled yet
    due to absence of ->set_config() callback.

    Enable it here for Intel Baytrail.

    Fixes: c501d0b149de ("pinctrl: baytrail: Add pin control operations")
    Depends-on: 2956b5d94a76 ("pinctrl / gpio: Introduce .set_config() callback for GPIO chips")
    Signed-off-by: Andy Shevchenko
    Acked-by: Mika Westerberg
    Signed-off-by: Sasha Levin

    Andy Shevchenko
     
  • [ Upstream commit 6b7275c87717652daace4c0b8131eb184c7d7516 ]

    It appears that SPT-H variant has different offset for PAD locking registers.
    Fix it here.

    Fixes: 551fa5801ef1 ("pinctrl: intel: sunrisepoint: Add Intel Sunrisepoint-H support")
    Signed-off-by: Andy Shevchenko
    Acked-by: Mika Westerberg
    Signed-off-by: Sasha Levin

    Andy Shevchenko
     

18 Mar, 2020

4 commits

  • commit aafd56fc79041bf36f97712d4b35208cbe07db90 upstream.

    kref_init starts with the reference count at 1, which will be balanced
    by the pinctrl_put in pinctrl_unregister. The additional kref_get in
    pinctrl_claim_hogs will increase this count to 2 and cause the hogs to
    not get freed when pinctrl_unregister is called.

    Fixes: 6118714275f0 ("pinctrl: core: Fix pinctrl_register_and_init() with pinctrl_enable()")
    Signed-off-by: Charles Keepax
    Link: https://lore.kernel.org/r/20200228154142.13860-1-ckeepax@opensource.cirrus.com
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Charles Keepax
     
  • commit 4c48e549f39f8ed10cf8a0b6cb96f5eddf0391ce upstream.

    The imx SC api strongly assumes that messages are composed out of
    4-bytes words but some of our message structs have odd sizeofs.

    This produces many oopses with CONFIG_KASAN=y.

    Fix by marking with __aligned(4).

    Fixes: b96eea718bf6 ("pinctrl: fsl: add scu based pinctrl support")
    Signed-off-by: Leonard Crestez
    Link: https://lore.kernel.org/r/bd7ad5fd755739a6d8d5f4f65e03b3ca4f457bd2.1582216144.git.leonard.crestez@nxp.com
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Leonard Crestez
     
  • commit dc7a06b0dbbafac8623c2b7657e61362f2f479a7 upstream.

    In the gxl driver, the sdio cmd and clk pins are inverted. It has not caused
    any issue so far because devices using these pins always take both pins
    so the resulting configuration is OK.

    Fixes: 0f15f500ff2c ("pinctrl: meson: Add GXL pinctrl definitions")
    Reviewed-by: Jerome Brunet
    Signed-off-by: Nicolas Belin
    Link: https://lore.kernel.org/r/1582204512-7582-1-git-send-email-nbelin@baylibre.com
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Nicolas Belin
     
  • commit d62e7fbea4951c124a24176da0c7bf3003ec53d4 upstream.

    Add the missing semicolon after of_node_put to get the file compiled.

    Fixes: f17d2f54d36d ("pinctrl: falcon: Add of_node_put() before return")
    Cc: stable@vger.kernel.org # v5.4+
    Signed-off-by: Mathias Kresin
    Link: https://lore.kernel.org/r/20200305182245.9636-1-dev@kresin.me
    Acked-by: Thomas Langer
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Mathias Kresin
     

08 Mar, 2020

1 commit

  • Merge Linux stable release v5.4.24 into imx_5.4.y

    * tag 'v5.4.24': (3306 commits)
    Linux 5.4.24
    blktrace: Protect q->blk_trace with RCU
    kvm: nVMX: VMWRITE checks unsupported field before read-only field
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm/boot/dts/imx6sll-evk.dts
    arch/arm/boot/dts/imx7ulp.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
    drivers/clk/imx/clk-composite-8m.c
    drivers/gpio/gpio-mxc.c
    drivers/irqchip/Kconfig
    drivers/mmc/host/sdhci-of-esdhc.c
    drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
    drivers/net/can/flexcan.c
    drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
    drivers/net/ethernet/mscc/ocelot.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    drivers/net/phy/realtek.c
    drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
    drivers/perf/fsl_imx8_ddr_perf.c
    drivers/tee/optee/shm_pool.c
    drivers/usb/cdns3/gadget.c
    kernel/sched/cpufreq.c
    net/core/xdp.c
    sound/soc/fsl/fsl_esai.c
    sound/soc/fsl/fsl_sai.c
    sound/soc/sof/core.c
    sound/soc/sof/imx/Kconfig
    sound/soc/sof/loader.c

    Jason Liu
     

26 Feb, 2020

1 commit

  • The imx SC api strongly assumes that messages are composed out of
    4-bytes words but some of our message structs have sizeof "6" and "7".

    This produces many oopses with CONFIG_KASAN=y:

    BUG: KASAN: stack-out-of-bounds in imx_mu_send_data+0x108/0x1f0

    It shouldn't cause an issues in normal use because these structs are
    always allocated on the stack.

    Also upstream: https://patchwork.kernel.org/patch/11376909/

    Reported-by: Iuliana Prodan
    Signed-off-by: Leonard Crestez
    Reviewed-by: Jason Liu
    Reviewed-by: Aisheng Dong
    Signed-off-by: Dong Aisheng
    (cherry picked from commit 8ca6d9eb2725152404a5764fc8916f77ee82aa29)

    Leonard Crestez
     

24 Feb, 2020

3 commits

  • [ Upstream commit 02aeb2f21530c98fc3ca51028eda742a3fafbd9f ]

    pinmux_func_gpios[] contains a hole due to the missing function GPIO
    definition for the "CTX0&CTX1" signal, which is the logical "AND" of the
    first two CAN outputs.

    A closer look reveals other issues:
    - Some functionality is available on alternative pins, but the
    PINMUX_DATA() entries is using the wrong marks,
    - Several configurations are missing.

    Fix this by:
    - Renaming CTX0CTX1CTX2_MARK, CRX0CRX1_PJ22_MARK, and
    CRX0CRX1CRX2_PJ20_MARK to CTX0_CTX1_CTX2_MARK, CRX0_CRX1_PJ22_MARK,
    resp. CRX0_CRX1_CRX2_PJ20_MARK for consistency with the
    corresponding enum IDs,
    - Adding all missing enum IDs and marks,
    - Use the right (*_PJ2x) variants for alternative pins,
    - Adding all missing configurations to pinmux_data[],
    - Adding all missing function GPIO definitions to pinmux_func_gpios[].

    See SH7268 Group, SH7269 Group User’s Manual: Hardware, Rev. 2.00:
    [1] Table 1.4 List of Pins
    [2] Figure 23.29 Connection Example when Using Channels 0 and 1 as One
    Channel (64 Mailboxes × 1 Channel) and Channel 2 as One Channel
    (32 Mailboxes × 1 Channel),
    [3] Figure 23.30 Connection Example when Using Channels 0, 1, and 2 as
    One Channel (96 Mailboxes × 1 Channel),
    [4] Table 48.3 Multiplexed Pins (Port B),
    [5] Table 48.4 Multiplexed Pins (Port C),
    [6] Table 48.10 Multiplexed Pins (Port J),
    [7] Section 48.2.4 Port B Control Registers 0 to 5 (PBCR0 to PBCR5).

    Signed-off-by: Geert Uytterhoeven
    Link: https://lore.kernel.org/r/20191218194812.12741-5-geert+renesas@glider.be
    Signed-off-by: Sasha Levin

    Geert Uytterhoeven
     
  • [ Upstream commit a23680594da7a9e2696dbcf4f023e9273e2fa40b ]

    Suspending Goodix touchscreens requires changing the interrupt pin to
    output before sending them a power-down command. Followed by wiggling
    the interrupt pin to wake the device up, after which it is put back
    in input mode.

    On Bay Trail devices with a Goodix touchscreen direct-irq mode is used
    in combination with listing the pin as a normal GpioIo resource.

    This works fine, until the goodix driver gets rmmod-ed and then insmod-ed
    again. In this case byt_gpio_disable_free() calls
    byt_gpio_clear_triggering() which clears the IRQ flags and after that the
    (direct) IRQ no longer triggers.

    This commit fixes this by adding a check for the BYT_DIRECT_IRQ_EN flag
    to byt_gpio_clear_triggering().

    Note that byt_gpio_clear_triggering() only gets called from
    byt_gpio_disable_free() for direct-irq enabled pins, as these are excluded
    from the irq_valid mask by byt_init_irq_valid_mask().

    Signed-off-by: Hans de Goede
    Acked-by: Mika Westerberg
    Reviewed-by: Linus Walleij
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Sasha Levin

    Hans de Goede
     
  • [ Upstream commit 55b1cb1f03ad5eea39897d0c74035e02deddcff2 ]

    pinmux_func_gpios[] contains a hole due to the missing function GPIO
    definition for the "CTX0&CTX1" signal, which is the logical "AND" of the
    two CAN outputs.

    Fix this by:
    - Renaming CRX0_CRX1_MARK to CTX0_CTX1_MARK, as PJ2MD[2:0]=010
    configures the combined "CTX0&CTX1" output signal,
    - Renaming CRX0X1_MARK to CRX0_CRX1_MARK, as PJ3MD[1:0]=10 configures
    the shared "CRX0/CRX1" input signal, which is fed to both CAN
    inputs,
    - Adding the missing function GPIO definition for "CTX0&CTX1" to
    pinmux_func_gpios[],
    - Moving all CAN enums next to each other.

    See SH7262 Group, SH7264 Group User's Manual: Hardware, Rev. 4.00:
    [1] Figure 1.2 (3) (Pin Assignment for the SH7264 Group (1-Mbyte
    Version),
    [2] Figure 1.2 (4) Pin Assignment for the SH7264 Group (640-Kbyte
    Version,
    [3] Table 1.4 List of Pins,
    [4] Figure 20.29 Connection Example when Using This Module as 1-Channel
    Module (64 Mailboxes x 1 Channel),
    [5] Table 32.10 Multiplexed Pins (Port J),
    [6] Section 32.2.30 (3) Port J Control Register 0 (PJCR0).

    Note that the last 2 disagree about PJ2MD[2:0], which is probably the
    root cause of this bug. But considering [4], "CTx0&CTx1" in [5] must
    be correct, and "CRx0&CRx1" in [6] must be wrong.

    Signed-off-by: Geert Uytterhoeven
    Link: https://lore.kernel.org/r/20191218194812.12741-4-geert+renesas@glider.be
    Signed-off-by: Sasha Levin

    Geert Uytterhoeven
     

15 Feb, 2020

2 commits

  • commit 805f635703b2562b5ddd822c62fc9124087e5dd5 upstream.

    The FN_SDSELF_B and FN_SD1_CLK_B enum IDs are used twice, which means
    one set of users must be wrong. Replace them by the correct enum IDs.

    Fixes: 87f8c988636db0d4 ("sh-pfc: Add r8a7778 pinmux support")
    Signed-off-by: Geert Uytterhoeven
    Link: https://lore.kernel.org/r/20191218194812.12741-2-geert+renesas@glider.be
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     
  • commit a34cd9dfd03fa9ec380405969f1d638bc63b8d63 upstream.

    R-Car Gen3 Hardware Manual Errata for Rev. 2.00 of October 24, 2019
    changed the configuration bits for drive and bias control for the
    DU_DOTCLKIN3 pin on R-Car M3-N, to match the same pin on R-Car H3.
    Update the driver to reflect this.

    After this, the handling of drive and bias control for the various
    DU_DOTCLKINx pins is consistent across all of the R-Car H3, M3-W,
    M3-W+, and M3-N SoCs.

    Fixes: 86c045c2e4201e94 ("pinctrl: sh-pfc: r8a77965: Replace DU_DOTCLKIN2 by DU_DOTCLKIN3")
    Signed-off-by: Geert Uytterhoeven
    Link: https://lore.kernel.org/r/20191113101653.28428-1-geert+renesas@glider.be
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     

13 Feb, 2020

1 commit