// SPDX-License-Identifier: GPL-2.0-only /* Low-level parallel port routines for the Amiga built-in port * * Author: Joerg Dorchain <joerg@dorchain.net> * * This is a complete rewrite of the code, but based heaviy upon the old * lp_intern. code. * * The built-in Amiga parallel port provides one port at a fixed address * with 8 bidirectional data lines (D0 - D7) and 3 bidirectional status * lines (BUSY, POUT, SEL), 1 output control line /STROBE (raised automatically * in hardware when the data register is accessed), and 1 input control line * /ACK, able to cause an interrupt, but both not directly settable by * software.
*/
staticvoid amiga_write_data(struct parport *p, unsignedchar data)
{
pr_debug("write_data %c\n", data); /* Triggers also /STROBE. This behavior cannot be changed */
ciaa.prb = data;
mb();
}
staticunsignedchar amiga_read_data(struct parport *p)
{ /* Triggers also /STROBE. This behavior cannot be changed */ return ciaa.prb;
}
staticunsignedchar control_amiga_to_pc(unsignedchar control)
{ return PARPORT_CONTROL_SELECT |
PARPORT_CONTROL_AUTOFD | PARPORT_CONTROL_STROBE; /* fake value: interrupt enable, select in, no reset,
no autolf, no strobe - seems to be closest the wiring diagram */
}
staticvoid amiga_write_control(struct parport *p, unsignedchar control)
{
pr_debug("write_control %02x\n", control); /* No implementation possible */
}
if (status & 1) /* Busy */
ret &= ~PARPORT_STATUS_BUSY; if (status & 2) /* PaperOut */
ret |= PARPORT_STATUS_PAPEROUT; if (status & 4) /* Selected */
ret |= PARPORT_STATUS_SELECT; /* the rest is not connected or handled autonomously in hardware */
parport_remove_port(port); if (port->irq != PARPORT_IRQ_NONE)
free_irq(IRQ_AMIGA_CIAA_FLG, port);
parport_put_port(port);
}
/* * amiga_parallel_remove() lives in .exit.text. For drivers registered via * module_platform_driver_probe() this is ok because they cannot get unbound at * runtime. So mark the driver struct with __refdata to prevent modpost * triggering a section mismatch warning.
*/ staticstruct platform_driver amiga_parallel_driver __refdata = {
.remove = __exit_p(amiga_parallel_remove),
.driver = {
.name = "amiga-parallel",
},
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.