mt7530.c (36452b8ba02a62445847a29779dc581eb4cfeddd) mt7530.c (f8b8b1cd5aadd221742b45eb0ee3c8a80abf036a)
1/*
2 * Mediatek MT7530 DSA Switch driver
3 * Copyright (C) 2017 Sean Wang <sean.wang@mediatek.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *

--- 550 unchanged lines hidden (view full) ---

559
560static int mt7530_phy_read(struct dsa_switch *ds, int port, int regnum)
561{
562 struct mt7530_priv *priv = ds->priv;
563
564 return mdiobus_read_nested(priv->bus, port, regnum);
565}
566
1/*
2 * Mediatek MT7530 DSA Switch driver
3 * Copyright (C) 2017 Sean Wang <sean.wang@mediatek.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *

--- 550 unchanged lines hidden (view full) ---

559
560static int mt7530_phy_read(struct dsa_switch *ds, int port, int regnum)
561{
562 struct mt7530_priv *priv = ds->priv;
563
564 return mdiobus_read_nested(priv->bus, port, regnum);
565}
566
567int mt7530_phy_write(struct dsa_switch *ds, int port, int regnum, u16 val)
567static int mt7530_phy_write(struct dsa_switch *ds, int port, int regnum,
568 u16 val)
568{
569 struct mt7530_priv *priv = ds->priv;
570
571 return mdiobus_write_nested(priv->bus, port, regnum, val);
572}
573
574static void
575mt7530_get_strings(struct dsa_switch *ds, int port, uint8_t *data)

--- 347 unchanged lines hidden (view full) ---

923mt7530_setup(struct dsa_switch *ds)
924{
925 struct mt7530_priv *priv = ds->priv;
926 int ret, i;
927 u32 id, val;
928 struct device_node *dn;
929 struct mt7530_dummy_poll p;
930
569{
570 struct mt7530_priv *priv = ds->priv;
571
572 return mdiobus_write_nested(priv->bus, port, regnum, val);
573}
574
575static void
576mt7530_get_strings(struct dsa_switch *ds, int port, uint8_t *data)

--- 347 unchanged lines hidden (view full) ---

924mt7530_setup(struct dsa_switch *ds)
925{
926 struct mt7530_priv *priv = ds->priv;
927 int ret, i;
928 u32 id, val;
929 struct device_node *dn;
930 struct mt7530_dummy_poll p;
931
931 /* The parent node of cpu_dp->netdev which holds the common system
932 /* The parent node of master netdev which holds the common system
932 * controller also is the container for two GMACs nodes representing
933 * as two netdev instances.
934 */
933 * controller also is the container for two GMACs nodes representing
934 * as two netdev instances.
935 */
935 dn = ds->dst->cpu_dp->netdev->dev.of_node->parent;
936 dn = ds->ports[MT7530_CPU_PORT].master->dev.of_node->parent;
936 priv->ethernet = syscon_node_to_regmap(dn);
937 if (IS_ERR(priv->ethernet))
938 return PTR_ERR(priv->ethernet);
939
940 regulator_set_voltage(priv->core_pwr, 1000000, 1000000);
941 ret = regulator_enable(priv->core_pwr);
942 if (ret < 0) {
943 dev_err(priv->dev,

--- 197 unchanged lines hidden ---
937 priv->ethernet = syscon_node_to_regmap(dn);
938 if (IS_ERR(priv->ethernet))
939 return PTR_ERR(priv->ethernet);
940
941 regulator_set_voltage(priv->core_pwr, 1000000, 1000000);
942 ret = regulator_enable(priv->core_pwr);
943 if (ret < 0) {
944 dev_err(priv->dev,

--- 197 unchanged lines hidden ---