diff options
| author | Tristram Ha <[email protected]> | 2024-11-09 01:57:05 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-11-14 03:54:58 +0000 |
| commit | 16220cb315a0a10d2a003d9af534988686e675ea (patch) | |
| tree | 1eee16301266317ab6015e9860d2fa19f544d965 /drivers/net/dsa/microchip/ksz_spi.c | |
| parent | dt-bindings: net: dsa: microchip: Add LAN9646 switch support (diff) | |
| download | kernel-16220cb315a0a10d2a003d9af534988686e675ea.tar.gz kernel-16220cb315a0a10d2a003d9af534988686e675ea.zip | |
net: dsa: microchip: Add LAN9646 switch support to KSZ DSA driver
LAN9646 switch is a 6-port switch with functions like KSZ9897. It has
4 internal PHYs and 1 SGMII port. The chip id read from hardware is
same as KSZ9477, so software driver needs to create a new chip id and
group allowable functions under its chip data structure to
differentiate the product.
Signed-off-by: Tristram Ha <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/dsa/microchip/ksz_spi.c')
| -rw-r--r-- | drivers/net/dsa/microchip/ksz_spi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/dsa/microchip/ksz_spi.c b/drivers/net/dsa/microchip/ksz_spi.c index 1c6652f2b9fe..108a958dc356 100644 --- a/drivers/net/dsa/microchip/ksz_spi.c +++ b/drivers/net/dsa/microchip/ksz_spi.c @@ -54,6 +54,8 @@ static int ksz_spi_probe(struct spi_device *spi) if (!chip) return -EINVAL; + /* Save chip id to do special initialization when probing. */ + dev->chip_id = chip->chip_id; if (chip->chip_id == KSZ88X3_CHIP_ID) regmap_config = ksz8863_regmap_config; else if (chip->chip_id == KSZ8795_CHIP_ID || @@ -203,6 +205,10 @@ static const struct of_device_id ksz_dt_ids[] = { .compatible = "microchip,lan9374", .data = &ksz_switch_chips[LAN9374] }, + { + .compatible = "microchip,lan9646", + .data = &ksz_switch_chips[LAN9646] + }, {}, }; MODULE_DEVICE_TABLE(of, ksz_dt_ids); @@ -228,6 +234,7 @@ static const struct spi_device_id ksz_spi_ids[] = { { "lan9372" }, { "lan9373" }, { "lan9374" }, + { "lan9646" }, { }, }; MODULE_DEVICE_TABLE(spi, ksz_spi_ids); |
