Lines Matching +full:spi +full:- +full:compatible
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Microchip ksz series register access through SPI
15 #include <linux/spi/spi.h>
40 static int ksz_spi_probe(struct spi_device *spi) in ksz_spi_probe() argument
44 struct device *ddev = &spi->dev; in ksz_spi_probe()
49 dev = ksz_switch_alloc(&spi->dev, spi); in ksz_spi_probe()
51 return -ENOMEM; in ksz_spi_probe()
55 return -EINVAL; in ksz_spi_probe()
57 if (chip->chip_id == KSZ8830_CHIP_ID) in ksz_spi_probe()
59 else if (chip->chip_id == KSZ8795_CHIP_ID || in ksz_spi_probe()
60 chip->chip_id == KSZ8794_CHIP_ID || in ksz_spi_probe()
61 chip->chip_id == KSZ8765_CHIP_ID) in ksz_spi_probe()
68 rc.lock_arg = &dev->regmap_mutex; in ksz_spi_probe()
69 rc.wr_table = chip->wr_table; in ksz_spi_probe()
70 rc.rd_table = chip->rd_table; in ksz_spi_probe()
71 dev->regmap[i] = devm_regmap_init_spi(spi, &rc); in ksz_spi_probe()
73 if (IS_ERR(dev->regmap[i])) { in ksz_spi_probe()
74 ret = PTR_ERR(dev->regmap[i]); in ksz_spi_probe()
75 dev_err(&spi->dev, in ksz_spi_probe()
82 if (spi->dev.platform_data) in ksz_spi_probe()
83 dev->pdata = spi->dev.platform_data; in ksz_spi_probe()
85 /* setup spi */ in ksz_spi_probe()
86 spi->mode = SPI_MODE_3; in ksz_spi_probe()
87 ret = spi_setup(spi); in ksz_spi_probe()
91 dev->irq = spi->irq; in ksz_spi_probe()
99 spi_set_drvdata(spi, dev); in ksz_spi_probe()
104 static void ksz_spi_remove(struct spi_device *spi) in ksz_spi_remove() argument
106 struct ksz_device *dev = spi_get_drvdata(spi); in ksz_spi_remove()
112 static void ksz_spi_shutdown(struct spi_device *spi) in ksz_spi_shutdown() argument
114 struct ksz_device *dev = spi_get_drvdata(spi); in ksz_spi_shutdown()
119 if (dev->dev_ops->reset) in ksz_spi_shutdown()
120 dev->dev_ops->reset(dev); in ksz_spi_shutdown()
122 dsa_switch_shutdown(dev->ds); in ksz_spi_shutdown()
124 spi_set_drvdata(spi, NULL); in ksz_spi_shutdown()
129 .compatible = "microchip,ksz8765",
133 .compatible = "microchip,ksz8794",
137 .compatible = "microchip,ksz8795",
141 .compatible = "microchip,ksz8863",
145 .compatible = "microchip,ksz8873",
149 .compatible = "microchip,ksz9477",
153 .compatible = "microchip,ksz9896",
157 .compatible = "microchip,ksz9897",
161 .compatible = "microchip,ksz9893",
165 .compatible = "microchip,ksz9563",
169 .compatible = "microchip,ksz8563",
173 .compatible = "microchip,ksz9567",
177 .compatible = "microchip,lan9370",
181 .compatible = "microchip,lan9371",
185 .compatible = "microchip,lan9372",
189 .compatible = "microchip,lan9373",
193 .compatible = "microchip,lan9374",
220 MODULE_DEVICE_TABLE(spi, ksz_spi_ids);
224 .name = "ksz-switch",
236 MODULE_ALIAS("spi:ksz9477");
237 MODULE_ALIAS("spi:ksz9896");
238 MODULE_ALIAS("spi:ksz9897");
239 MODULE_ALIAS("spi:ksz9893");
240 MODULE_ALIAS("spi:ksz9563");
241 MODULE_ALIAS("spi:ksz8563");
242 MODULE_ALIAS("spi:ksz9567");
243 MODULE_ALIAS("spi:lan937x");
245 MODULE_DESCRIPTION("Microchip ksz Series Switch SPI Driver");