Lines Matching defs:ipoctal
3 * ipoctal.c
22 #include "ipoctal.h"
47 struct ipoctal {
56 static inline struct ipoctal *chan_to_ipoctal(struct ipoctal_channel *chan,
59 return container_of(chan, struct ipoctal, channel[index]);
90 struct ipoctal *ipoctal = chan_to_ipoctal(channel, tty->index);
93 if (!ipack_get_carrier(ipoctal->dev))
105 ipack_put_carrier(ipoctal->dev);
258 struct ipoctal *ipoctal = (struct ipoctal *) arg;
261 readw(ipoctal->int_space + ACK_INT_REQ0);
262 readw(ipoctal->int_space + ACK_INT_REQ1);
266 ipoctal_irq_channel(&ipoctal->channel[i]);
276 static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
288 ipoctal->board_id = ipoctal->dev->id_device;
290 region = &ipoctal->dev->region[IPACK_IO_SPACE];
291 addr = devm_ioremap(&ipoctal->dev->dev,
294 dev_err(&ipoctal->dev->dev,
305 region = &ipoctal->dev->region[IPACK_INT_SPACE];
306 ipoctal->int_space =
307 devm_ioremap(&ipoctal->dev->dev,
309 if (!ipoctal->int_space) {
310 dev_err(&ipoctal->dev->dev,
316 region = &ipoctal->dev->region[IPACK_MEM8_SPACE];
317 ipoctal->mem8_space =
318 devm_ioremap(&ipoctal->dev->dev,
320 if (!ipoctal->mem8_space) {
321 dev_err(&ipoctal->dev->dev,
330 struct ipoctal_channel *channel = &ipoctal->channel[i];
333 channel->board_id = ipoctal->board_id;
359 iowrite8(1, ipoctal->mem8_space + 1);
369 /* Fill struct tty_driver with ipoctal data */
391 dev_err(&ipoctal->dev->dev, "Can't register tty driver.\n");
396 ipoctal->tty_drv = tty;
401 channel = &ipoctal->channel[i];
416 dev_err(&ipoctal->dev->dev, "Failed to register tty device.\n");
429 ipoctal->dev->bus->ops->request_irq(ipoctal->dev,
430 ipoctal_irq_handler, ipoctal);
672 struct ipoctal *ipoctal = chan_to_ipoctal(channel, tty->index);
675 ipack_put_carrier(ipoctal->dev);
696 struct ipoctal *ipoctal;
698 ipoctal = kzalloc(sizeof(struct ipoctal), GFP_KERNEL);
699 if (ipoctal == NULL)
702 ipoctal->dev = dev;
703 res = ipoctal_inst_slot(ipoctal, dev->bus->bus_nr, dev->slot);
707 dev_set_drvdata(&dev->dev, ipoctal);
711 kfree(ipoctal);
715 static void __ipoctal_remove(struct ipoctal *ipoctal)
719 ipoctal->dev->bus->ops->free_irq(ipoctal->dev);
722 struct ipoctal_channel *channel = &ipoctal->channel[i];
727 tty_unregister_device(ipoctal->tty_drv, i);
732 tty_unregister_driver(ipoctal->tty_drv);
733 kfree(ipoctal->tty_drv->name);
734 put_tty_driver(ipoctal->tty_drv);
735 kfree(ipoctal);