Merge branch 'net-mscc-miim-switch-reset'

Herve Codina says:

====================
Handle switch reset in mscc-miim

These two patches were previously sent as part of a bigger series:
  https://lore.kernel.org/lkml/20240527161450.326615-1-herve.codina@bootlin.com/

v1 and v2 iterations were handled during the v1 and v2 reviews of this
bigger series. As theses two patches are now ready to be applied, they
were extracted from the bigger series and sent alone in this current
series.

This current v3 series takes into account feedback received during the
bigger series v2 review.

Changes v2 -> v3
  - patch 1
    Drop one useless sentence.
    Add 'Reviewed-by: Andrew Lunn <andrew@lunn.ch>'
    Add 'Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>'

  - patch 2
   Add 'Reviewed-by: Andrew Lunn <andrew@lunn.ch>'

Changes v1 -> v2 (as part of the bigger series iterations)
  - Patch 1
    Improve the reset property description

  - Patch 2
    Fix a wrong reverse x-mass tree declaration
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller
2024-06-21 12:12:43 +01:00
2 changed files with 18 additions and 0 deletions

View File

@@ -38,6 +38,16 @@ properties:
clock-frequency: true
resets:
items:
- description:
Reset shared with all blocks attached to the Switch Core Register
Bus (CSR) including VRAP slave.
reset-names:
items:
- const: switch
required:
- compatible
- reg

View File

@@ -19,6 +19,7 @@
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#define MSCC_MIIM_REG_STATUS 0x0
#define MSCC_MIIM_STATUS_STAT_PENDING BIT(2)
@@ -271,10 +272,17 @@ static int mscc_miim_probe(struct platform_device *pdev)
struct device_node *np = pdev->dev.of_node;
struct regmap *mii_regmap, *phy_regmap;
struct device *dev = &pdev->dev;
struct reset_control *reset;
struct mscc_miim_dev *miim;
struct mii_bus *bus;
int ret;
reset = devm_reset_control_get_optional_shared(dev, "switch");
if (IS_ERR(reset))
return dev_err_probe(dev, PTR_ERR(reset), "Failed to get reset\n");
reset_control_reset(reset);
mii_regmap = ocelot_regmap_from_resource(pdev, 0,
&mscc_miim_regmap_config);
if (IS_ERR(mii_regmap))