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

1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (C) 2010 Markus Plessing <plessing@ems-wuensche.com>
22 MODULE_AUTHOR("Markus Plessing <plessing@ems-wuensche.com>");
23 MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-CARD cards");
39 * RX1 is connected to ground.
40 * TX1 is not connected.
41 * CLKO is not connected.
43 * This means normal output mode , push-pull and the correct polarity.
54 #define EMS_PCMCIA_MEM_SIZE 4096 /* Size of the remapped io-memory */
63 PCMCIA_DEVICE_PROD_ID123("EMS_T_W", "CPC-Card", "V2.0", 0xeab1ea23,
72 return readb(priv->reg_base + port); in ems_pcmcia_read_reg()
78 writeb(val, priv->reg_base + port); in ems_pcmcia_write_reg()
89 if (readw(card->base_addr) != 0xAA55) in ems_pcmcia_interrupt()
96 for (i = 0; i < card->channels; i++) { in ems_pcmcia_interrupt()
97 dev = card->net_dev[i]; in ems_pcmcia_interrupt()
123 /* read reset-values */ in ems_pcmcia_check_chan()
132 struct ems_pcmcia_card *card = pdev->priv; in ems_pcmcia_del_card()
136 free_irq(pdev->irq, card); in ems_pcmcia_del_card()
138 for (i = 0; i < card->channels; i++) { in ems_pcmcia_del_card()
139 dev = card->net_dev[i]; in ems_pcmcia_del_card()
144 DRV_NAME, dev->name, i); in ems_pcmcia_del_card()
149 writeb(EMS_CMD_UMAP, card->base_addr); in ems_pcmcia_del_card()
150 iounmap(card->base_addr); in ems_pcmcia_del_card()
153 pdev->priv = NULL; in ems_pcmcia_del_card()
158 * CAN channel to SJA1000 Socket-CAN subsystem.
170 return -ENOMEM; in ems_pcmcia_add_card()
172 pdev->priv = card; in ems_pcmcia_add_card()
173 card->channels = 0; in ems_pcmcia_add_card()
175 card->base_addr = ioremap(base, EMS_PCMCIA_MEM_SIZE); in ems_pcmcia_add_card()
176 if (!card->base_addr) { in ems_pcmcia_add_card()
177 err = -ENOMEM; in ems_pcmcia_add_card()
182 if (readw(card->base_addr) != 0xAA55) { in ems_pcmcia_add_card()
183 err = -ENODEV; in ems_pcmcia_add_card()
188 writeb(EMS_CMD_RESET, card->base_addr); in ems_pcmcia_add_card()
191 writeb(EMS_CMD_MAP, card->base_addr); in ems_pcmcia_add_card()
197 err = -ENOMEM; in ems_pcmcia_add_card()
201 card->net_dev[i] = dev; in ems_pcmcia_add_card()
203 priv->priv = card; in ems_pcmcia_add_card()
204 SET_NETDEV_DEV(dev, &pdev->dev); in ems_pcmcia_add_card()
205 dev->dev_id = i; in ems_pcmcia_add_card()
207 priv->irq_flags = IRQF_SHARED; in ems_pcmcia_add_card()
208 dev->irq = pdev->irq; in ems_pcmcia_add_card()
209 priv->reg_base = card->base_addr + EMS_PCMCIA_CAN_BASE_OFFSET + in ems_pcmcia_add_card()
214 priv->read_reg = ems_pcmcia_read_reg; in ems_pcmcia_add_card()
215 priv->write_reg = ems_pcmcia_write_reg; in ems_pcmcia_add_card()
216 priv->can.clock.freq = EMS_PCMCIA_CAN_CLOCK; in ems_pcmcia_add_card()
217 priv->ocr = EMS_PCMCIA_OCR; in ems_pcmcia_add_card()
218 priv->cdr = EMS_PCMCIA_CDR; in ems_pcmcia_add_card()
219 priv->flags |= SJA1000_CUSTOM_IRQ_HANDLER; in ems_pcmcia_add_card()
228 card->channels++; in ems_pcmcia_add_card()
231 "#%d at 0x%p, irq %d\n", DRV_NAME, dev->name, in ems_pcmcia_add_card()
232 i, priv->reg_base, dev->irq); in ems_pcmcia_add_card()
237 if (!card->channels) { in ems_pcmcia_add_card()
238 err = -ENODEV; in ems_pcmcia_add_card()
242 err = request_irq(pdev->irq, &ems_pcmcia_interrupt, IRQF_SHARED, in ems_pcmcia_add_card()
253 * Setup PCMCIA socket and probe for EMS CPC-CARD
260 dev->config_flags |= CONF_ENABLE_IRQ; in ems_pcmcia_probe()
261 dev->config_index = 1; in ems_pcmcia_probe()
262 dev->config_regs = PRESENT_OPTION; in ems_pcmcia_probe()
265 dev->resource[0]->end = 16; in ems_pcmcia_probe()
266 dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; in ems_pcmcia_probe()
267 dev->resource[1]->end = 16; in ems_pcmcia_probe()
268 dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_16; in ems_pcmcia_probe()
269 dev->io_lines = 5; in ems_pcmcia_probe()
272 dev->resource[2]->flags = in ems_pcmcia_probe()
274 dev->resource[2]->start = dev->resource[2]->end = 0; in ems_pcmcia_probe()
276 csval = pcmcia_request_window(dev, dev->resource[2], 0); in ems_pcmcia_probe()
278 dev_err(&dev->dev, "pcmcia_request_window failed (err=%d)\n", in ems_pcmcia_probe()
283 csval = pcmcia_map_mem_page(dev, dev->resource[2], dev->config_base); in ems_pcmcia_probe()
285 dev_err(&dev->dev, "pcmcia_map_mem_page failed (err=%d)\n", in ems_pcmcia_probe()
292 dev_err(&dev->dev, "pcmcia_enable_device failed (err=%d)\n", in ems_pcmcia_probe()
297 ems_pcmcia_add_card(dev, dev->resource[2]->start); in ems_pcmcia_probe()