From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=66.163.184.43 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796069328; b=DHseW/fnx+n6cfNcLbrVzjuP1ODA+7NeNRZrbDu3DsB39MAAGc9nt3TdhDYOLSIAt53W f+M+Q61ecIObP73gpsRt2LRqpuYDL7euLErA+lBQ7DGFm5ZjXeEGwEqe+dfNbrcfNn/2R W5ovzRiO9rVSmyUmMlUPetBCQuePrG0McJuuDeIjYaFu0YAHiB7+L9tS6fQJwnyWfBloR 4bMW+F6Wo8H5oLs1OeZSHqJ/Kjis1C0K4SotAqTerRFEdIF9jFLPU67Uze0w47OQEvrJC OrqimZ/4QV3UbkLOBIxO/fNf9UNP2qh1LxFbnBXmpTnccDqialDkcCjZ9A3ISU5wHig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796069328; h=DMARC-Filter:DKIM-Signature:X-SONIC-DKIM-SIGN:X-YMail-OSG:X-Sonic-MF: X-Sonic-ID:Received:Received:Message-ID:Date:MIME-Version:User-Agent: Subject:To:References:Content-Language:In-Reply-To:From:Content-Type: Content-Transfer-Encoding:X-Mailer; bh=83+Dd6AfDWYcA1B5SXvXpNoLGGpVkCT0tcTywCutllw=; b=RFO+wzNbF6QSgljYX7JzOB/2QQ9gE3TYpdbJSPPcPS1AMBXGoYAJhqAvloJhqZPoywpd VE0lX+RnLq5ZdLCx0kVGHtl0ga7OQ9vKTPRhFtT7VXGTKEwHQ8pVoYL554bjJV5xz1oBC I9B9jls+dytCDRc3kM951mktvZF+OTMhylus7w5CdkHCTjQMQD6uQ9PBra7sinzKR6aar hklekC51wRV7r/AUiYqSBV8YAKm0ga8IHp6ACNvkVbNtlYEn1Z8AOvv5Bh+9ehMmlouWQ lUN3OAcC9qLUWvtKeTj1A+r6ff77WGQtlfQttgVS/YaJmglCycQxH7pwv2cfGkN2hWA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=yahoo.com; spf=pass smtp.mailfrom=yahoo.com; dkim=pass header.d=yahoo.com header.i=@yahoo.com header.a=rsa-sha256 header.s=s2048 header.b=jvTm3eGw; arc=none smtp.remote-ip=66.163.184.43 Received: from sonic317-32.consmr.mail.ne1.yahoo.com (sonic317-32.consmr.mail.ne1.yahoo.com [66.163.184.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48E18606A320 for ; Mon, 30 Nov 2026 20:08:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 48E18606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=yahoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yahoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.a=rsa-sha256 header.s=s2048 header.b=jvTm3eGw DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1796069326; bh=83+Dd6AfDWYcA1B5SXvXpNoLGGpVkCT0tcTywCutllw=; h=Date:Subject:To:References:In-Reply-To:From:Content-Type:From:Subject:Reply-To:Content-Type; b=jvTm3eGwunhsysUlpeV94dq6YCx30wcFk33/e9AN7aBQAPDiZ1SmwA9NdarYZNcIoEn68U5/nEbfOdOlWNDHJmU2oAQur3l8BsTjjTPpr+udiIRtfs12ciB/O7VbwS8ng2+CP1tZUYDgy46cF4KYMVSJhQyLUWAMgNncrF6i2fM1rLs/33w773/9EdZ+o9S4HK+M0EUlisbvA7elEt+tDl/8jYva+zRRu23n7MXAFgPcbY+EzV+8BGu4P7cHvbbJ5AS4Gd1hVOBH3xwVKTe4Wrm6i9VU+E/T3PXQ7elO1w3a4Ilh/uX42E/2YTJPOmKWNrwlEN92QhQSYhBNMGLMsg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1796069326; bh=26O1pR8M+1HmmNOlx7Z5gH29jXIVAn7EF7gkY3FQJoa=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=tn8bb4pWgHIv3AROLnmG5i9PLO0BZL6sGNQR/qIvnEbH7qG4wTddTdF+krwKIONXV7irK0UJdz8cowmy+IK1L0i/rSYcSpyQiIMW9V7l/sCLYeSCnIrYi49ezvwQUOXwRDLsxBjoi86Cq+fj0RJVNvi2wSXC4aUIUpmyjzbQ6iZL3Ggtu4RiklHslCsBEspjp++oK6b99RQRilyAcLjVx4tJ/BIevSxi6mteZ6A/+hUh4DwZICvi/d52sLYZOm23PnC3QTR3Z4A2ASOIvtbvXR3hRM50PkKXd3+l2DUfwVEcYflupo+X4z0sn8WE1vJXWHlN/X17SerBFRp8NeHruw== X-YMail-OSG: mrDYPfkVM1kILgl27cBoNY.wmftS0lg5UFTr4tUu7PoptH6p9sHrqKADizDy.A5 K6uJZRyQdvWzk81I3CUCGVpXmNgPtvSRJ83UAMYlL11gYxPBLHyO1Vne.ge1tiQMH5cSbmCwxCUd 8aHcvzqY_ldkuYhaGVq64M8RS4aEHOaC1ypQecNqad3no1zzoz4eVkXi1_5riNYRsgBx7HTCGOGd eZ_zT9mW9wx6_GSSKl0vDJamk40RnuBS5mSfh8lcVdV.b10CnibZ9ob5.VOe2SWjaWcUwQEs8de0 86eBfUBg3BCG6R10Cy9.FxdxorAiagHM9dWrh5bJGY8KJQTsL1Bay0qJk0ZUmckMWDBn2up57JUC uPic3ip.z7xbG2vn6IMNE9tjYPIBqcKyRRurGPJoKKleRTq0vF.L3VXeN7f.afyS9j14CZWDxZrJ skuhfxPT2ANXVoBziAvbNcbBhHwlJquleqRkDPEYbIrRhIJCvmQbKBI.MLgsgqw1s0MnUPIAF58S JD_nSbXI7qjWKHoVLJwd_aRFX8gBrdGgZtrQy8CrTjCMUiWWdKZEsfFQdb_FYdr_g08qM.DD_KwL VQeL9.JB9dRh_XJXl_IFBgHHSKAe0rDL8NM326UuZvvqXb.UeCu0J_Uuh_td.nJWH5zyKL8s8xC2 paRStKIj1qU3TN_rRztndFsx4vu_XMWFBzYeYEOWbiopL0uF5SBxs75Nvce20r.IQqXXxGy14Nl8 kJ3TgMfhYaNrKAehvcTRsrWYzo9_bWxuDtYE4AN8n5FJ1IFP4bEqjbNQB9MUElidMIisp8fuNjff EolZybOxVk5ue_DDNlN1dKoNnxl2SmFaMvtZMcxPc1.pZLOCbvO58kCBEo4YYUaT8fh58YrLfSbg CXJuaqsQRJbl0cKZPf2ufpwj_IuHsZORtk_THwaMFkQnHm.zbVyQKwMaoefjT6ddZTW.A309BKwO lBdg0MBE3.IqiwF.leLkzA8D8OBRwf7dkbg6jnvM97N.oAwOTh5V5kSK6CJsiXjCKoQxLxncNTyG Byijxon97bjoJnCPwupoB1CpJJdG6A3Jj3IYshaixA8uC0YwlEMSFXVGN3K8luma3DHTMeegRvot TTNm1ST_sYTF6kwMcZiVJMSQr_8Vlez1JgxsB2Ahig0NKg9sNyahxkkXY31zAPjsSuEecS_uEmwV 4mKQCyHsw.9_P.IK9QUuGFQq.MDod1L0H1z0qJYTGzWAp03gkeLGpAH1u0fKVwGdf6RvjkZWwHOO 9Z1NSC1.dbfPwT5mVVyvN5qDAlBKymxnXD7gzqMhIFy4ugojjoU_qtMLGenSecJjqE6BZC666USP Ieff3NWMRThbl_LmrByDFVOniOE8f63ZaW7x.reKAMNd5QZuOwzNeR7YC6QrvI6U489Z4pgwl.Uz Dm98oQGzpTjL8Ct5Vaj4SVOzXYqLDZKZJW6tbjwxmmqz.onnMwfVWJR5kJrhrB8NUp2ZkcZ9l6GK oQL6Pi5122ZzFTaDSXONOjOZTI0XJm24BBi47b57WY6cYqgib3kVY6koyCJNbpHr3v6n7Bvg1nDi KLoJ7DqXZNZfAdBaj9bkPvsGf8IFT_XlX42lgx5FaVRV.YScICBPceQPH2OF_jWeKNeWeqbc0536 WU3Vm_9XJtmrGhS01.z6NlVR5Dw9I4xQJFCPuR0ukB2L6R5AYqyXdct93TPmn7yS.KffoOzfkYIK _J3Hb3tNrcKfsGBQ5vK5jsv7IoG42BNM1.KdjeoHnVT3CIKDgZewp0OCele439oaHMEokDCuestR Q2GDgKb8robO0JW3TJveH8zGNPJhHRs.556uUpMXnRJMXWVVMGh6d2n4JGtHgSnXP0IyAX27k1YU LvpvLJd3iXEffKYiUJ47niSU5CNt8XRxKekMWpIOSvomwMIrLTdz220.buWt860SUL8gGK1dIh.g sTPYJmQxdm6f3KL_uiYhHDJCP5tM4zUtwff1sEf3YwvuotrVKgTBcDeP1gDfBWAE81xWjvmHhV4. 1OjKzXErlBoQ6vSMg0fM0aLz_XXZMc1mFUtzQe_XGgvuQ8GTyM58e0jHvGuqFhGh1WNDxcAd10Gn unju2QAHKf031sFv69lD4B.sbAxGAMcmQ72a7T_oMFD.kFbRP0GZ925decOCQbTyIyzLk4P9vAoW RTL89qWE2TcFOTIEk_0if8oe8RJpnpb9C3xgOZoyPXiUkPVOB15oAL6s5fQ3IaK3gljaq0fbqGR2 Pg10yWsLiwQfzBqz8IZPduxT8wdUNeSytye1Z1IW0KF1wlgKsYdJYv1qLODlDYHoIxIBNNIPRkyg VDEJ5FWM5MTA2LnfrsxeqqmwjcT6lYRUGLvJUWB_rzg-- X-Sonic-MF: X-Sonic-ID: c229c406-8e1c-4a2e-8a19-ad301e6d84b5 Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Mon, 30 Nov 2026 20:08:46 +0000 Received: by hermes--production-ir2-7c4859dc89-jpc6b (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 77022f6e623096712887ac17862ab9cf; Mon, 30 Nov 2026 20:08:40 +0000 (UTC) Message-ID: <14a77dd4-466d-497c-93e4-383a776c5e2c@yahoo.com> Date: Mon, 30 Nov 2026 21:08:36 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH net-next v17 02/15] net: dsa: realtek: rtl8365mb: add chip family infrastructure To: linusw@kernel.org, andrew@lunn.ch, olteanv@gmail.com, kuba@kernel.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, linux@armlinux.org.uk, luizluca@gmail.com, maxime.chevallier@bootlin.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, alvin.sipraga@analog.com, gusfmora@gmail.com, kuncy7@gmail.com, fabianotassotti@gmail.com, gabonpivovich@gmail.com, contact@c127.dev, o.rempel@pengutronix.de References: <236d002f-5ca5-4f12-bf5b-0ed6442e5c9a@yahoo.com> Content-Language: pl In-Reply-To: <236d002f-5ca5-4f12-bf5b-0ed6442e5c9a@yahoo.com> From: Mieczyslaw Nalewaj Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.27100 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Add enum rtl8365mb_family and struct rtl8365mb_family_info, which holds the data shared by all chips of one family: the family id and the init jam table. Fold rtl8365mb_init_jam_common into the family C init jam table (renamed to rtl8365mb_c_init_jam) and drop the separate common jam loop from rtl8365mb_switch_init(), as family D does not use these writes. struct rtl8365mb_chip_info now points to the family info through a family_info member, and all existing chips use the RTL8365MB_FAMILY_C instance. rtl8365mb_get_family_info() and rtl8365mb_is_d() are declared in a new rtl8365mb.h so that the VLAN code can use them too. The available ports of a chip are already described by port_mask in struct rtl8365mb_chip_info, so the family info does not carry a port count. RTL8365MB_FAMILY_D is defined here but no chip uses it yet; it is needed by the following patches, which add family D handling for chips whose register layout differs from the existing ones. No functional change. Tested-by: Gustavo Foletto Mora Tested-by: Stanislaw Pal Tested-by: Oleg Gavrilov Signed-off-by: Mieczyslaw Nalewaj Reviewed-by: Linus Walleij --- drivers/net/dsa/realtek/rtl8365mb.h | 28 ++++++++++ drivers/net/dsa/realtek/rtl8365mb_main.c | 71 ++++++++++++------------ 2 files changed, 62 insertions(+), 37 deletions(-) create mode 100644 drivers/net/dsa/realtek/rtl8365mb.h diff --git a/drivers/net/dsa/realtek/rtl8365mb.h b/drivers/net/dsa/realtek/rtl8365mb.h new file mode 100644 index 0000000..7b0c710 --- /dev/null +++ b/drivers/net/dsa/realtek/rtl8365mb.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _RTL8365MB_H +#define _RTL8365MB_H + +#include "realtek.h" + +enum rtl8365mb_family { + RTL8365MB_FAMILY_C, + RTL8365MB_FAMILY_D, +}; + +struct rtl8365mb_jam_tbl_entry; + +struct rtl8365mb_family_info { + enum rtl8365mb_family family; + const struct rtl8365mb_jam_tbl_entry *jam_table; + size_t jam_size; +}; + +const struct rtl8365mb_family_info * +rtl8365mb_get_family_info(struct realtek_priv *priv); + +static inline bool rtl8365mb_is_d(struct realtek_priv *priv) +{ + return rtl8365mb_get_family_info(priv)->family == RTL8365MB_FAMILY_D; +} + +#endif /* _RTL8365MB_H */ diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c index 6c11c36..8c59b1e 100644 --- a/drivers/net/dsa/realtek/rtl8365mb_main.c +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c @@ -112,6 +112,7 @@ #include "rtl8365mb_qos.h" #include "rtl8365mb_l2.h" #include "rtl8365mb_vlan.h" +#include "rtl8365mb.h" /* Family-specific data and limits */ #define RTL8365MB_PHYADDRMAX 7 @@ -638,20 +639,16 @@ struct rtl8365mb_jam_tbl_entry { }; /* Lifted from the vendor driver sources */ -static const struct rtl8365mb_jam_tbl_entry rtl8365mb_init_jam_8365mb_vc[] = { +static const struct rtl8365mb_jam_tbl_entry rtl8365mb_c_init_jam[] = { { 0x13EB, 0x15BB }, { 0x1303, 0x06D6 }, { 0x1304, 0x0700 }, { 0x13E2, 0x003F }, { 0x13F9, 0x0090 }, { 0x121E, 0x03CA }, { 0x1233, 0x0352 }, { 0x1237, 0x00A0 }, { 0x123A, 0x0030 }, { 0x1239, 0x0084 }, { 0x0301, 0x1000 }, { 0x1349, 0x001F }, { 0x18E0, 0x4004 }, { 0x122B, 0x241C }, { 0x1305, 0xC000 }, - { 0x13F0, 0x0000 }, -}; - -static const struct rtl8365mb_jam_tbl_entry rtl8365mb_init_jam_common[] = { - { 0x1200, 0x7FCB }, { 0x0884, 0x0003 }, { 0x06EB, 0x0001 }, - { 0x03Fa, 0x0007 }, { 0x08C8, 0x00C0 }, { 0x0A30, 0x020E }, - { 0x0800, 0x0000 }, { 0x0802, 0x0000 }, { 0x09DA, 0x0013 }, - { 0x1D32, 0x0002 }, + { 0x13F0, 0x0000 }, { 0x1200, 0x7FCB }, { 0x0884, 0x0003 }, + { 0x06EB, 0x0001 }, { 0x03Fa, 0x0007 }, { 0x08C8, 0x00C0 }, + { 0x0A30, 0x020E }, { 0x0800, 0x0000 }, { 0x0802, 0x0000 }, + { 0x09DA, 0x0013 }, { 0x1D32, 0x0002 }, }; /* SGMII SerDes tuning parameters, lifted from the vendor driver sources. The @@ -704,15 +701,20 @@ struct rtl8365mb_extint { unsigned int supported_interfaces; }; +static const struct rtl8365mb_family_info rtl8365mb_family_c = { + .family = RTL8365MB_FAMILY_C, + .jam_table = rtl8365mb_c_init_jam, + .jam_size = ARRAY_SIZE(rtl8365mb_c_init_jam), +}; + /** * struct rtl8365mb_chip_info - static chip-specific info * @name: human-readable chip name * @chip_id: chip identifier * @chip_ver: chip silicon revision * @port_mask: ports the chip has + * @family_info: data shared by all chips of the same family * @extints: available external interfaces - * @jam_table: chip-specific initialization jam table - * @jam_size: size of the chip's jam table * @num_tx_queues: number of egress queues exposed by the chip * * These data are specific to a given chip in the family of switches supported @@ -724,9 +726,8 @@ struct rtl8365mb_chip_info { u32 chip_id; u32 chip_ver; u32 port_mask; + const struct rtl8365mb_family_info *family_info; const struct rtl8365mb_extint extints[RTL8365MB_MAX_NUM_EXTINTS]; - const struct rtl8365mb_jam_tbl_entry *jam_table; - size_t jam_size; unsigned int num_tx_queues; }; @@ -746,33 +747,32 @@ static const struct rtl8365mb_chip_info rtl8365mb_chip_infos[] = { .name = "RTL8365MB-VC", .chip_id = 0x6367, .chip_ver = 0x0040, + .family_info = &rtl8365mb_family_c, .port_mask = PORT_MASK(GENMASK(3, 0) | BIT(6)), .extints = { { 6, 1, PHY_INTF(MII) | PHY_INTF(TMII) | PHY_INTF(RMII) | PHY_INTF(RGMII) }, }, - .jam_table = rtl8365mb_init_jam_8365mb_vc, - .jam_size = ARRAY_SIZE(rtl8365mb_init_jam_8365mb_vc), .num_tx_queues = 8, }, { .name = "RTL8367S", .chip_id = 0x6367, .chip_ver = 0x00A0, + .family_info = &rtl8365mb_family_c, .port_mask = PORT_MASK(GENMASK(4, 0) | BIT(6) | BIT(7)), .extints = { { 6, 1, PHY_INTF(SGMII) | PHY_INTF(HSGMII) }, { 7, 2, PHY_INTF(MII) | PHY_INTF(TMII) | PHY_INTF(RMII) | PHY_INTF(RGMII) }, }, - .jam_table = rtl8365mb_init_jam_8365mb_vc, - .jam_size = ARRAY_SIZE(rtl8365mb_init_jam_8365mb_vc), .num_tx_queues = 8, }, { .name = "RTL8367SB", .chip_id = 0x6367, .chip_ver = 0x0010, + .family_info = &rtl8365mb_family_c, .port_mask = PORT_MASK(GENMASK(4, 0) | BIT(6) | BIT(7)), .extints = { { 6, 1, PHY_INTF(MII) | PHY_INTF(TMII) | @@ -781,14 +781,13 @@ static const struct rtl8365mb_chip_info rtl8365mb_chip_infos[] = { { 7, 2, PHY_INTF(MII) | PHY_INTF(TMII) | PHY_INTF(RMII) | PHY_INTF(RGMII) }, }, - .jam_table = rtl8365mb_init_jam_8365mb_vc, - .jam_size = ARRAY_SIZE(rtl8365mb_init_jam_8365mb_vc), .num_tx_queues = 8, }, { .name = "RTL8367RB-VB", .chip_id = 0x6367, .chip_ver = 0x0020, + .family_info = &rtl8365mb_family_c, .port_mask = PORT_MASK(GENMASK(4, 0) | BIT(6) | BIT(7)), .extints = { { 6, 1, PHY_INTF(MII) | PHY_INTF(TMII) | @@ -796,8 +795,6 @@ static const struct rtl8365mb_chip_info rtl8365mb_chip_infos[] = { { 7, 2, PHY_INTF(MII) | PHY_INTF(TMII) | PHY_INTF(RMII) | PHY_INTF(RGMII) }, }, - .jam_table = rtl8365mb_init_jam_8365mb_vc, - .jam_size = ARRAY_SIZE(rtl8365mb_init_jam_8365mb_vc), .num_tx_queues = 8, }, }; @@ -897,6 +894,14 @@ struct rtl8365mb { #define pcs_to_rtl8365mb(_pcs) container_of((_pcs), struct rtl8365mb, pcs) +const struct rtl8365mb_family_info * +rtl8365mb_get_family_info(struct realtek_priv *priv) +{ + struct rtl8365mb *mb = priv->chip_data; + + return mb->chip_info->family_info; +} + static int rtl8365mb_phy_poll_busy(struct realtek_priv *priv) { u32 val; @@ -1375,7 +1380,7 @@ static int rtl8365mb_sds_probe_option(struct realtek_priv *priv) * the cap has been observed on hardware. Raise them likewise, to 0x7FFFF * (~4.19 Gbps, above the HSGMII line rate). The related HSGMII scheduler * line rate register (LINE_RATE_HSG_H, 0x03FA) is already set to its - * maximum by the common init jam table. + * maximum by the family C init jam table. */ static int rtl8365mb_sds_raise_rate_limits(struct realtek_priv *priv) { @@ -3059,30 +3064,22 @@ static int rtl8365mb_change_tag_protocol(struct dsa_switch *ds, static int rtl8365mb_switch_init(struct realtek_priv *priv) { struct rtl8365mb *mb = priv->chip_data; - const struct rtl8365mb_chip_info *ci; + const struct rtl8365mb_family_info *fi; int ret; int i; - ci = mb->chip_info; + fi = mb->chip_info->family_info; - /* Do any chip-specific init jam before getting to the common stuff */ - if (ci->jam_table) { - for (i = 0; i < ci->jam_size; i++) { - ret = regmap_write(priv->map, ci->jam_table[i].reg, - ci->jam_table[i].val); + /* Do any family-specific init jam */ + if (fi->jam_table) { + for (i = 0; i < fi->jam_size; i++) { + ret = regmap_write(priv->map, fi->jam_table[i].reg, + fi->jam_table[i].val); if (ret) return ret; } } - /* Common init jam */ - for (i = 0; i < ARRAY_SIZE(rtl8365mb_init_jam_common); i++) { - ret = regmap_write(priv->map, rtl8365mb_init_jam_common[i].reg, - rtl8365mb_init_jam_common[i].val); - if (ret) - return ret; - } - return 0; } -- 2.53.0