Lines Matching +full:connected +full:- +full:ground

1 // SPDX-License-Identifier: GPL-2.0-only
7 * - Kvaser linux driver, version 4.72 BETA
8 * Copyright (C) 2002-2007 KVASER AB
10 * - Lincan driver, version 0.3.3, OCERA project
14 * - Socketcan SJA1000 drivers
16 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
35 MODULE_DESCRIPTION("Socket-CAN driver for KVASER PCAN PCI cards");
43 struct net_device *slave_dev[MAX_NO_OF_CHANNELS-1];
54 * RX1 is connected to ground.
55 * TX1 is not connected.
56 * CLKO is not connected.
58 * This means normal output mode , push-pull and the correct polarity.
65 * (meaning divide-by-2), the Pelican bit, and the clock-off bit
88 #define PCI_CONFIG_PORT_SIZE 0x80 /* size of the config io-memory */
89 #define PCI_PORT_SIZE 0x80 /* size of a channel io-memory */
90 #define PCI_PORT_XILINX_SIZE 0x08 /* size of a xilinx io-memory */
108 return ioread8(priv->reg_base + port); in kvaser_pci_read_reg()
114 iowrite8(val, priv->reg_base + port); in kvaser_pci_write_reg()
120 struct kvaser_pci *board = priv->priv; in kvaser_pci_disable_irq()
124 intcsr = ioread32(board->conf_addr + S5920_INTCSR); in kvaser_pci_disable_irq()
126 iowrite32(intcsr, board->conf_addr + S5920_INTCSR); in kvaser_pci_disable_irq()
132 struct kvaser_pci *board = priv->priv; in kvaser_pci_enable_irq()
136 tmp_en_io = ioread32(board->conf_addr + S5920_INTCSR); in kvaser_pci_enable_irq()
138 iowrite32(tmp_en_io, board->conf_addr + S5920_INTCSR); in kvaser_pci_enable_irq()
169 board = priv->priv; in kvaser_pci_del_chan()
173 dev_info(&board->pci_dev->dev, "Removing device %s\n", in kvaser_pci_del_chan()
174 dev->name); in kvaser_pci_del_chan()
179 for (i = 0; i < board->no_channels - 1; i++) { in kvaser_pci_del_chan()
180 if (board->slave_dev[i]) { in kvaser_pci_del_chan()
181 dev_info(&board->pci_dev->dev, "Removing device %s\n", in kvaser_pci_del_chan()
182 board->slave_dev[i]->name); in kvaser_pci_del_chan()
183 unregister_sja1000dev(board->slave_dev[i]); in kvaser_pci_del_chan()
184 free_sja1000dev(board->slave_dev[i]); in kvaser_pci_del_chan()
189 pci_iounmap(board->pci_dev, priv->reg_base); in kvaser_pci_del_chan()
190 pci_iounmap(board->pci_dev, board->conf_addr); in kvaser_pci_del_chan()
191 pci_iounmap(board->pci_dev, board->res_addr); in kvaser_pci_del_chan()
209 return -ENOMEM; in kvaser_pci_add_chan()
212 board = priv->priv; in kvaser_pci_add_chan()
214 board->pci_dev = pdev; in kvaser_pci_add_chan()
215 board->channel = channel; in kvaser_pci_add_chan()
218 board->conf_addr = conf_addr; in kvaser_pci_add_chan()
221 board->res_addr = res_addr; in kvaser_pci_add_chan()
224 board->xilinx_ver = in kvaser_pci_add_chan()
225 ioread8(board->res_addr + XILINX_VERINT) >> 4; in kvaser_pci_add_chan()
227 /* Assert PTADR# - we're in passive mode so the other bits are in kvaser_pci_add_chan()
229 iowrite32(0x80808080UL, board->conf_addr + S5920_PTCR); in kvaser_pci_add_chan()
235 struct kvaser_pci *master_board = master_priv->priv; in kvaser_pci_add_chan()
236 master_board->slave_dev[channel - 1] = dev; in kvaser_pci_add_chan()
237 master_board->no_channels = channel + 1; in kvaser_pci_add_chan()
238 board->xilinx_ver = master_board->xilinx_ver; in kvaser_pci_add_chan()
241 priv->reg_base = base_addr + channel * KVASER_PCI_PORT_BYTES; in kvaser_pci_add_chan()
243 priv->read_reg = kvaser_pci_read_reg; in kvaser_pci_add_chan()
244 priv->write_reg = kvaser_pci_write_reg; in kvaser_pci_add_chan()
246 priv->can.clock.freq = KVASER_PCI_CAN_CLOCK; in kvaser_pci_add_chan()
248 priv->ocr = KVASER_PCI_OCR; in kvaser_pci_add_chan()
249 priv->cdr = KVASER_PCI_CDR; in kvaser_pci_add_chan()
251 priv->irq_flags = IRQF_SHARED; in kvaser_pci_add_chan()
252 dev->irq = pdev->irq; in kvaser_pci_add_chan()
254 dev_info(&pdev->dev, "reg_base=%p conf_addr=%p irq=%d\n", in kvaser_pci_add_chan()
255 priv->reg_base, board->conf_addr, dev->irq); in kvaser_pci_add_chan()
257 SET_NETDEV_DEV(dev, &pdev->dev); in kvaser_pci_add_chan()
258 dev->dev_id = channel; in kvaser_pci_add_chan()
263 dev_err(&pdev->dev, "Registering device failed (err=%d)\n", in kvaser_pci_add_chan()
291 dev_info(&pdev->dev, "initializing device %04x:%04x\n", in kvaser_pci_init_one()
292 pdev->vendor, pdev->device); in kvaser_pci_init_one()
305 err = -ENODEV; in kvaser_pci_init_one()
312 err = -ENOMEM; in kvaser_pci_init_one()
318 err = -ENOMEM; in kvaser_pci_init_one()
324 err = -ENOMEM; in kvaser_pci_init_one()
337 board = priv->priv; in kvaser_pci_init_one()
339 dev_info(&pdev->dev, "xilinx version=%d number of channels=%d\n", in kvaser_pci_init_one()
340 board->xilinx_ver, board->no_channels); in kvaser_pci_init_one()