Lines Matching defs:ipoctal

20 #include "ipoctal.h"
45 struct ipoctal {
54 static inline struct ipoctal *chan_to_ipoctal(struct ipoctal_channel *chan,
57 return container_of(chan, struct ipoctal, channel[index]);
88 struct ipoctal *ipoctal = chan_to_ipoctal(channel, tty->index);
91 if (!ipack_get_carrier(ipoctal->dev))
103 ipack_put_carrier(ipoctal->dev);
256 struct ipoctal *ipoctal = arg;
259 readw(ipoctal->int_space + ACK_INT_REQ0);
260 readw(ipoctal->int_space + ACK_INT_REQ1);
264 ipoctal_irq_channel(&ipoctal->channel[i]);
274 static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
286 ipoctal->board_id = ipoctal->dev->id_device;
288 region = &ipoctal->dev->region[IPACK_IO_SPACE];
289 addr = devm_ioremap(&ipoctal->dev->dev,
292 dev_err(&ipoctal->dev->dev,
303 region = &ipoctal->dev->region[IPACK_INT_SPACE];
304 ipoctal->int_space =
305 devm_ioremap(&ipoctal->dev->dev,
307 if (!ipoctal->int_space) {
308 dev_err(&ipoctal->dev->dev,
314 region = &ipoctal->dev->region[IPACK_MEM8_SPACE];
315 ipoctal->mem8_space =
316 devm_ioremap(&ipoctal->dev->dev,
318 if (!ipoctal->mem8_space) {
319 dev_err(&ipoctal->dev->dev,
328 struct ipoctal_channel *channel = &ipoctal->channel[i];
331 channel->board_id = ipoctal->board_id;
357 iowrite8(1, ipoctal->mem8_space + 1);
367 /* Fill struct tty_driver with ipoctal data */
388 dev_err(&ipoctal->dev->dev, "Can't register tty driver.\n");
393 ipoctal->tty_drv = drv;
398 channel = &ipoctal->channel[i];
413 dev_err(&ipoctal->dev->dev, "Failed to register tty device.\n");
426 ipoctal->dev->bus->ops->request_irq(ipoctal->dev,
427 ipoctal_irq_handler, ipoctal);
667 struct ipoctal *ipoctal = chan_to_ipoctal(channel, tty->index);
670 ipack_put_carrier(ipoctal->dev);
691 struct ipoctal *ipoctal;
693 ipoctal = kzalloc(sizeof(struct ipoctal), GFP_KERNEL);
694 if (ipoctal == NULL)
697 ipoctal->dev = dev;
698 res = ipoctal_inst_slot(ipoctal, dev->bus->bus_nr, dev->slot);
702 dev_set_drvdata(&dev->dev, ipoctal);
706 kfree(ipoctal);
710 static void __ipoctal_remove(struct ipoctal *ipoctal)
714 ipoctal->dev->bus->ops->free_irq(ipoctal->dev);
717 struct ipoctal_channel *channel = &ipoctal->channel[i];
722 tty_unregister_device(ipoctal->tty_drv, i);
727 tty_unregister_driver(ipoctal->tty_drv);
728 kfree(ipoctal->tty_drv->name);
729 tty_driver_kref_put(ipoctal->tty_drv);
730 kfree(ipoctal);