Skip to content

Commit 23de126

Browse files
pvantrapdavem330
authored andcommitted
net: dsa: microchip: replace unclear KSZ8830 strings
Replace ksz8830 with ksz88x3 for CHIP_ID definition and other strings. This due to KSZ8830 not being an actual switch but the Chip ID shared among KSZ8863/8873 switches, impossible to differentiate from their Chip ID or Revision ID registers. Now all KSZ*_CHIP_ID macros refer to actual, existing switches which removes confusion. Signed-off-by: Pieter Van Trappen <[email protected]> Acked-by: Arun Ramadoss <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent dcff1c0 commit 23de126

File tree

6 files changed

+33
-33
lines changed

6 files changed

+33
-33
lines changed

drivers/net/dsa/microchip/ksz8.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ int ksz8_change_mtu(struct ksz_device *dev, int port, int mtu)
194194
case KSZ8794_CHIP_ID:
195195
case KSZ8765_CHIP_ID:
196196
return ksz8795_change_mtu(dev, frame_size);
197-
case KSZ8830_CHIP_ID:
197+
case KSZ88X3_CHIP_ID:
198198
case KSZ8864_CHIP_ID:
199199
case KSZ8895_CHIP_ID:
200200
return ksz8863_change_mtu(dev, frame_size);

drivers/net/dsa/microchip/ksz8863_smi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ static void ksz8863_smi_shutdown(struct mdio_device *mdiodev)
199199
static const struct of_device_id ksz8863_dt_ids[] = {
200200
{
201201
.compatible = "microchip,ksz8863",
202-
.data = &ksz_switch_chips[KSZ8830]
202+
.data = &ksz_switch_chips[KSZ88X3]
203203
},
204204
{
205205
.compatible = "microchip,ksz8873",
206-
.data = &ksz_switch_chips[KSZ8830]
206+
.data = &ksz_switch_chips[KSZ88X3]
207207
},
208208
{ },
209209
};

drivers/net/dsa/microchip/ksz_common.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,16 @@ static const struct ksz_drive_strength ksz9477_drive_strengths[] = {
246246
{ SW_DRIVE_STRENGTH_28MA, 28000 },
247247
};
248248

249-
/* ksz8830_drive_strengths - Drive strength mapping for KSZ8830, KSZ8873, ..
249+
/* ksz88x3_drive_strengths - Drive strength mapping for KSZ8863, KSZ8873, ..
250250
* variants.
251251
* This values are documented in KSZ8873 and KSZ8863 datasheets.
252252
*/
253-
static const struct ksz_drive_strength ksz8830_drive_strengths[] = {
253+
static const struct ksz_drive_strength ksz88x3_drive_strengths[] = {
254254
{ 0, 8000 },
255255
{ KSZ8873_DRIVE_STRENGTH_16MA, 16000 },
256256
};
257257

258-
static void ksz8830_phylink_mac_config(struct phylink_config *config,
258+
static void ksz88x3_phylink_mac_config(struct phylink_config *config,
259259
unsigned int mode,
260260
const struct phylink_link_state *state);
261261
static void ksz_phylink_mac_config(struct phylink_config *config,
@@ -265,8 +265,8 @@ static void ksz_phylink_mac_link_down(struct phylink_config *config,
265265
unsigned int mode,
266266
phy_interface_t interface);
267267

268-
static const struct phylink_mac_ops ksz8830_phylink_mac_ops = {
269-
.mac_config = ksz8830_phylink_mac_config,
268+
static const struct phylink_mac_ops ksz88x3_phylink_mac_ops = {
269+
.mac_config = ksz88x3_phylink_mac_config,
270270
.mac_link_down = ksz_phylink_mac_link_down,
271271
.mac_link_up = ksz8_phylink_mac_link_up,
272272
};
@@ -1442,8 +1442,8 @@ const struct ksz_chip_data ksz_switch_chips[] = {
14421442
.internal_phy = {true, true, true, true, false},
14431443
},
14441444

1445-
[KSZ8830] = {
1446-
.chip_id = KSZ8830_CHIP_ID,
1445+
[KSZ88X3] = {
1446+
.chip_id = KSZ88X3_CHIP_ID,
14471447
.dev_name = "KSZ8863/KSZ8873",
14481448
.num_vlans = 16,
14491449
.num_alus = 0,
@@ -1453,7 +1453,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
14531453
.num_tx_queues = 4,
14541454
.num_ipms = 4,
14551455
.ops = &ksz88xx_dev_ops,
1456-
.phylink_mac_ops = &ksz8830_phylink_mac_ops,
1456+
.phylink_mac_ops = &ksz88x3_phylink_mac_ops,
14571457
.mib_names = ksz88xx_mib_names,
14581458
.mib_cnt = ARRAY_SIZE(ksz88xx_mib_names),
14591459
.reg_mib_cnt = MIB_COUNTER_NUM,
@@ -1487,7 +1487,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
14871487
.num_tx_queues = 4,
14881488
.num_ipms = 4,
14891489
.ops = &ksz88xx_dev_ops,
1490-
.phylink_mac_ops = &ksz8830_phylink_mac_ops,
1490+
.phylink_mac_ops = &ksz88x3_phylink_mac_ops,
14911491
.mib_names = ksz88xx_mib_names,
14921492
.mib_cnt = ARRAY_SIZE(ksz88xx_mib_names),
14931493
.reg_mib_cnt = MIB_COUNTER_NUM,
@@ -1510,7 +1510,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
15101510
.num_tx_queues = 4,
15111511
.num_ipms = 4,
15121512
.ops = &ksz88xx_dev_ops,
1513-
.phylink_mac_ops = &ksz8830_phylink_mac_ops,
1513+
.phylink_mac_ops = &ksz88x3_phylink_mac_ops,
15141514
.mib_names = ksz88xx_mib_names,
15151515
.mib_cnt = ARRAY_SIZE(ksz88xx_mib_names),
15161516
.reg_mib_cnt = MIB_COUNTER_NUM,
@@ -2724,7 +2724,7 @@ static u32 ksz_get_phy_flags(struct dsa_switch *ds, int port)
27242724
struct ksz_device *dev = ds->priv;
27252725

27262726
switch (dev->chip_id) {
2727-
case KSZ8830_CHIP_ID:
2727+
case KSZ88X3_CHIP_ID:
27282728
/* Silicon Errata Sheet (DS80000830A):
27292729
* Port 1 does not work with LinkMD Cable-Testing.
27302730
* Port 1 does not respond to received PAUSE control frames.
@@ -3050,7 +3050,7 @@ static enum dsa_tag_protocol ksz_get_tag_protocol(struct dsa_switch *ds,
30503050
if (ksz_is_ksz87xx(dev) || ksz_is_8895_family(dev))
30513051
proto = DSA_TAG_PROTO_KSZ8795;
30523052

3053-
if (dev->chip_id == KSZ8830_CHIP_ID ||
3053+
if (dev->chip_id == KSZ88X3_CHIP_ID ||
30543054
dev->chip_id == KSZ8563_CHIP_ID ||
30553055
dev->chip_id == KSZ9893_CHIP_ID ||
30563056
dev->chip_id == KSZ9563_CHIP_ID)
@@ -3162,7 +3162,7 @@ static int ksz_max_mtu(struct dsa_switch *ds, int port)
31623162
case KSZ8794_CHIP_ID:
31633163
case KSZ8765_CHIP_ID:
31643164
return KSZ8795_HUGE_PACKET_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN;
3165-
case KSZ8830_CHIP_ID:
3165+
case KSZ88X3_CHIP_ID:
31663166
case KSZ8864_CHIP_ID:
31673167
case KSZ8895_CHIP_ID:
31683168
return KSZ8863_HUGE_PACKET_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN;
@@ -3334,7 +3334,7 @@ phy_interface_t ksz_get_xmii(struct ksz_device *dev, int port, bool gbit)
33343334
return interface;
33353335
}
33363336

3337-
static void ksz8830_phylink_mac_config(struct phylink_config *config,
3337+
static void ksz88x3_phylink_mac_config(struct phylink_config *config,
33383338
unsigned int mode,
33393339
const struct phylink_link_state *state)
33403340
{
@@ -3518,7 +3518,7 @@ static int ksz_switch_detect(struct ksz_device *dev)
35183518
break;
35193519
case KSZ88_FAMILY_ID:
35203520
if (id2 == KSZ88_CHIP_ID_63)
3521-
dev->chip_id = KSZ8830_CHIP_ID;
3521+
dev->chip_id = KSZ88X3_CHIP_ID;
35223522
else
35233523
return -ENODEV;
35243524
break;
@@ -4592,24 +4592,24 @@ static int ksz9477_drive_strength_write(struct ksz_device *dev,
45924592
}
45934593

45944594
/**
4595-
* ksz8830_drive_strength_write() - Set the drive strength configuration for
4596-
* KSZ8830 compatible chip variants.
4595+
* ksz88x3_drive_strength_write() - Set the drive strength configuration for
4596+
* KSZ8863 compatible chip variants.
45974597
* @dev: ksz device
45984598
* @props: Array of drive strength properties to be set
45994599
* @num_props: Number of properties in the array
46004600
*
4601-
* This function applies the specified drive strength settings to KSZ8830 chip
4601+
* This function applies the specified drive strength settings to KSZ88X3 chip
46024602
* variants (KSZ8873, KSZ8863).
46034603
* It ensures the configurations align with what the chip variant supports and
46044604
* warns or errors out on unsupported settings.
46054605
*
46064606
* Return: 0 on success, error code otherwise
46074607
*/
4608-
static int ksz8830_drive_strength_write(struct ksz_device *dev,
4608+
static int ksz88x3_drive_strength_write(struct ksz_device *dev,
46094609
struct ksz_driver_strength_prop *props,
46104610
int num_props)
46114611
{
4612-
size_t array_size = ARRAY_SIZE(ksz8830_drive_strengths);
4612+
size_t array_size = ARRAY_SIZE(ksz88x3_drive_strengths);
46134613
int microamp;
46144614
int i, ret;
46154615

@@ -4622,10 +4622,10 @@ static int ksz8830_drive_strength_write(struct ksz_device *dev,
46224622
}
46234623

46244624
microamp = props[KSZ_DRIVER_STRENGTH_IO].value;
4625-
ret = ksz_drive_strength_to_reg(ksz8830_drive_strengths, array_size,
4625+
ret = ksz_drive_strength_to_reg(ksz88x3_drive_strengths, array_size,
46264626
microamp);
46274627
if (ret < 0) {
4628-
ksz_drive_strength_error(dev, ksz8830_drive_strengths,
4628+
ksz_drive_strength_error(dev, ksz88x3_drive_strengths,
46294629
array_size, microamp);
46304630
return ret;
46314631
}
@@ -4685,8 +4685,8 @@ static int ksz_parse_drive_strength(struct ksz_device *dev)
46854685
return 0;
46864686

46874687
switch (dev->chip_id) {
4688-
case KSZ8830_CHIP_ID:
4689-
return ksz8830_drive_strength_write(dev, of_props,
4688+
case KSZ88X3_CHIP_ID:
4689+
return ksz88x3_drive_strength_write(dev, of_props,
46904690
ARRAY_SIZE(of_props));
46914691
case KSZ8795_CHIP_ID:
46924692
case KSZ8794_CHIP_ID:

drivers/net/dsa/microchip/ksz_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ enum ksz_model {
200200
KSZ8795,
201201
KSZ8794,
202202
KSZ8765,
203-
KSZ8830,
203+
KSZ88X3,
204204
KSZ8864,
205205
KSZ8895,
206206
KSZ9477,
@@ -628,7 +628,7 @@ static inline bool ksz_is_ksz87xx(struct ksz_device *dev)
628628

629629
static inline bool ksz_is_ksz88x3(struct ksz_device *dev)
630630
{
631-
return dev->chip_id == KSZ8830_CHIP_ID;
631+
return dev->chip_id == KSZ88X3_CHIP_ID;
632632
}
633633

634634
static inline bool ksz_is_8895_family(struct ksz_device *dev)

drivers/net/dsa/microchip/ksz_spi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static int ksz_spi_probe(struct spi_device *spi)
5454
if (!chip)
5555
return -EINVAL;
5656

57-
if (chip->chip_id == KSZ8830_CHIP_ID)
57+
if (chip->chip_id == KSZ88X3_CHIP_ID)
5858
regmap_config = ksz8863_regmap_config;
5959
else if (chip->chip_id == KSZ8795_CHIP_ID ||
6060
chip->chip_id == KSZ8794_CHIP_ID ||
@@ -137,15 +137,15 @@ static const struct of_device_id ksz_dt_ids[] = {
137137
},
138138
{
139139
.compatible = "microchip,ksz8863",
140-
.data = &ksz_switch_chips[KSZ8830]
140+
.data = &ksz_switch_chips[KSZ88X3]
141141
},
142142
{
143143
.compatible = "microchip,ksz8864",
144144
.data = &ksz_switch_chips[KSZ8864]
145145
},
146146
{
147147
.compatible = "microchip,ksz8873",
148-
.data = &ksz_switch_chips[KSZ8830]
148+
.data = &ksz_switch_chips[KSZ88X3]
149149
},
150150
{
151151
.compatible = "microchip,ksz8895",

include/linux/platform_data/microchip-ksz.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ enum ksz_chip_id {
2727
KSZ8795_CHIP_ID = 0x8795,
2828
KSZ8794_CHIP_ID = 0x8794,
2929
KSZ8765_CHIP_ID = 0x8765,
30-
KSZ8830_CHIP_ID = 0x8830,
30+
KSZ88X3_CHIP_ID = 0x8830,
3131
KSZ8864_CHIP_ID = 0x8864,
3232
KSZ8895_CHIP_ID = 0x8895,
3333
KSZ9477_CHIP_ID = 0x00947700,

0 commit comments

Comments
 (0)