mt7530.c (f8b8b1cd5aadd221742b45eb0ee3c8a80abf036a) mt7530.c (c8652c83bc84ac8db44060ced0036de7628aa5e5)
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 *

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

777 mutex_lock(&priv->reg_mutex);
778
779 for (i = 0; i < MT7530_NUM_PORTS; i++) {
780 /* Add this port to the port matrix of the other ports in the
781 * same bridge. If the port is disabled, port matrix is kept
782 * and not being setup until the port becomes enabled.
783 */
784 if (ds->enabled_port_mask & BIT(i) && i != port) {
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 *

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

777 mutex_lock(&priv->reg_mutex);
778
779 for (i = 0; i < MT7530_NUM_PORTS; i++) {
780 /* Add this port to the port matrix of the other ports in the
781 * same bridge. If the port is disabled, port matrix is kept
782 * and not being setup until the port becomes enabled.
783 */
784 if (ds->enabled_port_mask & BIT(i) && i != port) {
785 if (ds->ports[i].bridge_dev != bridge)
785 if (dsa_to_port(ds, i)->bridge_dev != bridge)
786 continue;
787 if (priv->ports[i].enable)
788 mt7530_set(priv, MT7530_PCR_P(i),
789 PCR_MATRIX(BIT(port)));
790 priv->ports[i].pm |= PCR_MATRIX(BIT(port));
791
792 port_bitmap |= BIT(i);
793 }

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

814 mutex_lock(&priv->reg_mutex);
815
816 for (i = 0; i < MT7530_NUM_PORTS; i++) {
817 /* Remove this port from the port matrix of the other ports
818 * in the same bridge. If the port is disabled, port matrix
819 * is kept and not being setup until the port becomes enabled.
820 */
821 if (ds->enabled_port_mask & BIT(i) && i != port) {
786 continue;
787 if (priv->ports[i].enable)
788 mt7530_set(priv, MT7530_PCR_P(i),
789 PCR_MATRIX(BIT(port)));
790 priv->ports[i].pm |= PCR_MATRIX(BIT(port));
791
792 port_bitmap |= BIT(i);
793 }

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

814 mutex_lock(&priv->reg_mutex);
815
816 for (i = 0; i < MT7530_NUM_PORTS; i++) {
817 /* Remove this port from the port matrix of the other ports
818 * in the same bridge. If the port is disabled, port matrix
819 * is kept and not being setup until the port becomes enabled.
820 */
821 if (ds->enabled_port_mask & BIT(i) && i != port) {
822 if (ds->ports[i].bridge_dev != bridge)
822 if (dsa_to_port(ds, i)->bridge_dev != bridge)
823 continue;
824 if (priv->ports[i].enable)
825 mt7530_clear(priv, MT7530_PCR_P(i),
826 PCR_MATRIX(BIT(port)));
827 priv->ports[i].pm &= ~PCR_MATRIX(BIT(port));
828 }
829 }
830

--- 311 unchanged lines hidden ---
823 continue;
824 if (priv->ports[i].enable)
825 mt7530_clear(priv, MT7530_PCR_P(i),
826 PCR_MATRIX(BIT(port)));
827 priv->ports[i].pm &= ~PCR_MATRIX(BIT(port));
828 }
829 }
830

--- 311 unchanged lines hidden ---