summaryrefslogtreecommitdiff
path: root/drivers/staging/mt7621-pci-phy
AgeCommit message (Collapse)Author
2020-11-30staging: mt7621-pci-phy: remove driver from stagingSergio Paracuellos
Remove this driver from staging because it has been moved into its properly place in the kernel. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20201121155037.21354-5-sergio.paracuellos@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-04-13staging: mt7621-pci-phy: dt: bindings: remove bindings txt fileSergio Paracuellos
Yaml file for bindings has been properly added. Hence, remove the old txt file. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Link: https://lore.kernel.org/r/20200410091836.13068-3-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: mt7621-pci-phy: dt: bindings: add mediatek, mt7621-pci-phy.yamlSergio Paracuellos
Add bindings to describe Mediatek MT7621 PCIe PHY. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Link: https://lore.kernel.org/r/20200410091836.13068-2-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-23staging: mt7621-pci-phy: re-do 'xtal_mode' detectionSergio Paracuellos
Detection of the Xtal mode is using magic numbers that can be avoided using properly some definitions and a more accurate variable name from 'reg' into 'xtal_mode'. This increase readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Link: https://lore.kernel.org/r/20200321133624.31388-4-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-23staging: mt7621-pci-phy: use builtin_platform_driver()Sergio Paracuellos
Macro builtin_platform_driver can be used for builtin drivers that don't do anything in driver init. So, use the macro builtin_platform_driver and remove some boilerplate code. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Link: https://lore.kernel.org/r/20200321133624.31388-3-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-20staging: mt7621-pci-phy: avoid to create to different phys for a dual port oneSergio Paracuellos
This soc has two phy's for the pcie one of them using just a different register for settig it up but sharing all the rest of the config. Until now we was presenting this schema as three different phy's in the device tree using the 'phy-cells' node property to discriminate an index and setting up a complete phy for the dual port index. This sometimes worked properly but reconfiguring the same registers twice presents sometimes some unstable pcie links and the ports was not properly being detected. The problems only appears on hard resets and soft resets was properly working. Instead of having this schema just set two phy's in the device ree and use the 'phy-cells' property to say if the port has or not a dual port. Doing this configuration and set up becomes easier, LOC is decreased and the behaviour also gets deterministic with properly and stable pcie links in both hard and soft resets. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Link: https://lore.kernel.org/r/20200320110123.9907-2-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-17staging: mt7621-pci-phy: add 'mt7621_phy_rmw' to simplify codeSergio Paracuellos
In order to simplify driver code and decrease a bit LOC add new function 'mt7621_phy_rmw' where clear and set bits are passed as arguments. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Link: https://lore.kernel.org/r/20200315160154.10292-1-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-21staging: mt7621-pci-phy: remove disable clock from the phy exit functionSergio Paracuellos
The clock which has been used here is not about the phy but the pcie port. It has been properly handled into host pcie driver code. Hence, remove it from here which is the correct thing to do. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-19staging: mt7621-pci-phy: convert driver to use kernel regmap API'sSergio Paracuellos
Instead of using writel and readl use regmap API which makes the driver maintainability easier. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-19staging: mt7621-pci-phy: add quirks for 'E2' revision using ↵Sergio Paracuellos
'soc_device_attribute' Depending on revision of the chip, 'mt7621_bypass_pipe_rst' function must be executed. Add better support for this using 'soc_device_match' in driver probe function. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-19staging: mt7621-pci-phy: remove some unnecessary local variablesSergio Paracuellos
Device tree is not using child nodes anymore so the 'child_np' variable can safely removed. This also simplifies the error path to be able to directly return errors removing also the 'ret' variable. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-19staging: mt7621-pci-phy: use 'platform_get_resource'Sergio Paracuellos
Driver is using 'of_address_to_resource' to get memory resources. Make use of 'platform_get_resource' instead which is more accurate for a platform driver. This also makes possible to delete a local variable which is not needed anymore. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: mt7621-pci-phy: prevent use of uninitialized variableAntti Keränen
Do not use uninitialized variable 'port' when printing an error message Signed-off-by: Antti Keränen <detegr@gmail.com> Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Makefile filesGreg Kroah-Hartman
There are a few remaining drivers/staging/*/Makefile files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Kconfig filesGreg Kroah-Hartman
There are a few remaining drivers/staging/*/Kconfig files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-29staging: mt7621-pci-phy: change driver to don't use child nodesSergio Paracuellos
Device tree has been simplified to don't use child nodes and use the #phy-cells property instead. Change the driver accordly implementing custom 'xlate' function to return the correct phy for each port. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-29staging: mt7621-pci-phy: update bindings documentationSergio Paracuellos
Device tree has been simplified to use phy-cells instead of using child nodes. Update documentation accordly. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-19staging: mt7621-pci-phy: Add Spaces to Macro DefinitionEmanuel Bennici
Improve Code readability by adding Tabs and Spaces after #define Signed-off-by: Emanuel Bennici <benniciemanuel78@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-19staging: mt7621-pci-phy: use 'module_init' instead of 'arch_initcall'Sergio Paracuellos
Init driver as 'arch_initcall()' does not work. It causes phy_create() to be called before the phy module is initialized, so 'phy_class' is NULL, the new phy isn't placed in the right class, and it cannot be found. Change to 'module_init()' which works properly in this case. Fixes: 00981d31d6df: staging: mt7621-pci-phy: add new driver for phy part of mt7621-pci Reported-by: NeilBrown <neil@brown.name> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18staging: Mediatek: Use individual config flags in MakefileGeorge Hilliard
These drivers can be useful on other MT76xx SoCs, which have compatible peripherals. The drivers were selectable in Kconfig, but they were quietly excluded from the build because the SOC_MT7621 chip was not selected. So, make the Makefiles use the same flags as Kconfig for these drivers. mt7621-dma and mt7621-dts are left alone because they truly do require that SoC. I have personally confirmed that the mt7621-spi driver works on the MT7688, which was what prompted this change. Cc: linux-kernel@vger.kernel.org Cc: devel@driverdev.osuosl.org Cc: NeilBrown <neil@brown.name> Cc: sergio.paracuellos@gmail.com Signed-off-by: George Hilliard <thirtythreeforty@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-07staging: mt7621-pci-phy: dt-bindings: add bindings for Mediatek MT7621 Pcie PHYSergio Paracuellos
Add bindings documentation for PCie PHY of Mediatek MT7621. This file will be moved into its appropiate documentation bindings'place when this driver is mainlined. CC: Device Tree mailing list <devicetree@vger.kernel.org> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-07staging: mt7621-pci-phy: add new driver for phy part of mt7621-pciSergio Paracuellos
Phy part of the pci for this SoC can be handled using a generic phy driver. This commit extracts phy part of the mt7621-pci into a new 'mt7621-pci-phy' driver. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>