mediatek: update v4.19 switch support to latest vendor version
[openwrt/staging/rmilecki.git] / target / linux / mediatek / files-4.19 / drivers / net / phy / mtk / mt753x / mt753x_swconfig.h
index 971a2cc90a862b11d15572ad9670135fb6828f73..b877d8957e9b2d36e5ddf630b6d837792db2e12d 100644 (file)
@@ -1,19 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
- * OpenWrt swconfig support for MediaTek MT753x Gigabit switch
- *
- * Copyright (C) 2018 MediaTek Inc. All Rights Reserved.
- *
+ * Copyright (c) 2018 MediaTek Inc.
  * Author: Weijie Gao <weijie.gao@mediatek.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef _MT753X_SWCONFIG_H_
 #define _MT753X_SWCONFIG_H_
 
+#ifdef CONFIG_SWCONFIG
 #include <linux/switch.h>
+#include "mt753x.h"
 
 int mt753x_swconfig_init(struct gsw_mt753x *gsw);
 void mt753x_swconfig_destroy(struct gsw_mt753x *gsw);
+#else
+static inline int mt753x_swconfig_init(struct gsw_mt753x *gsw)
+{
+       mt753x_apply_vlan_config(gsw);
+
+       return 0;
+}
+
+static inline void mt753x_swconfig_destroy(struct gsw_mt753x *gsw)
+{
+}
+#endif
 
 #endif /* _MT753X_SWCONFIG_H_ */