Commit 28ba5c11 authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarAndrew Lunn <andrew@lunn.ch&gt;'>
    Add 'Acked-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org&gt;'>

  - patch 2
   Add 'Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch&gt;'>

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 4fce809e 9e6d3393
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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
+8 −0
Original line number Diff line number Diff line
@@ -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))