drivers/gpib/tms9914/tms9914.c
Source file repositories/reference/linux-study-clean/drivers/gpib/tms9914/tms9914.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpib/tms9914/tms9914.c- Extension
.c- Size
- 24576 bytes
- Lines
- 902
- Domain
- Driver Families
- Bucket
- drivers/gpib
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ioport.hlinux/sched.hlinux/module.hlinux/slab.hasm/dma.hlinux/io.hlinux/bitops.hlinux/pci.hlinux/pci_ids.hlinux/string.hlinux/init.hlinux/spinlock.hlinux/delay.hgpibP.htms9914.h
Detected Declarations
function tms9914_take_controlfunction directlyfunction tms9914_go_to_standbyfunction tms9914_interface_clearfunction tms9914_remote_enablefunction tms9914_request_system_controlfunction tms9914_t1_delayfunction tms9914_return_to_localfunction tms9914_set_holdoff_modefunction tms9914_release_holdofffunction tms9914_enable_eosfunction tms9914_disable_eosfunction tms9914_parallel_pollfunction set_ppoll_regfunction tms9914_parallel_poll_configurefunction tms9914_parallel_poll_responsefunction tms9914_serial_poll_responsefunction tms9914_serial_poll_statusfunction tms9914_primary_addressfunction tms9914_secondary_addressfunction tms9914_update_statusfunction update_talker_statefunction update_listener_statefunction update_status_nolockfunction tms9914_line_statusfunction check_for_eosfunction wait_for_read_bytefunction tms9914_read_data_infunction pio_readfunction tms9914_readfunction pio_write_waitfunction pio_writefunction tms9914_writefunction check_my_address_statefunction tms9914_commandfunction tms9914_interruptfunction tms9914_interrupt_have_statusfunction tms9914_board_resetfunction tms9914_onlinefunction tms9914_ioport_read_bytefunction tms9914_ioport_write_bytefunction tms9914_iomem_read_bytefunction tms9914_iomem_write_byteexport tms9914_take_controlexport tms9914_take_control_workaroundexport tms9914_go_to_standbyexport tms9914_interface_clearexport tms9914_remote_enable
Annotated Snippet
switch (command_byte) {
case PP_CONFIG:
priv->ppoll_configure_state = 1;
/*
* AUX_PTS generates another UNC interrupt on the next command byte
* if it is in the secondary address group (such as PPE and PPD).
*/
write_byte(priv, AUX_PTS, AUXCR);
write_byte(priv, AUX_VAL, AUXCR);
break;
case PPU:
tms9914_parallel_poll_configure(board, priv, command_byte);
write_byte(priv, AUX_VAL, AUXCR);
break;
default:
if (is_PPE(command_byte) || is_PPD(command_byte)) {
if (priv->ppoll_configure_state) {
tms9914_parallel_poll_configure(board, priv, command_byte);
write_byte(priv, AUX_VAL, AUXCR);
} else {// bad parallel poll configure byte
// clear dac holdoff
write_byte(priv, AUX_INVAL, AUXCR);
}
} else {
// clear dac holdoff
write_byte(priv, AUX_INVAL, AUXCR);
}
break;
}
if (in_primary_command_group(command_byte) && command_byte != PP_CONFIG)
priv->ppoll_configure_state = 0;
}
if (status1 & HR_ERR) {
dev_dbg(board->gpib_dev, "gpib bus error\n");
set_bit(BUS_ERROR_BN, &priv->state);
}
if (status1 & HR_IFC) {
push_gpib_event(board, EVENT_IFC);
clear_bit(CIC_NUM, &board->status);
}
if (status1 & HR_GET) {
push_gpib_event(board, EVENT_DEV_TRG);
// clear dac holdoff
write_byte(priv, AUX_VAL, AUXCR);
}
if (status1 & HR_DCAS) {
push_gpib_event(board, EVENT_DEV_CLR);
// clear dac holdoff
write_byte(priv, AUX_VAL, AUXCR);
set_bit(DEV_CLEAR_BN, &priv->state);
}
// check for being addressed with secondary addressing
if (status1 & HR_APT) {
if (board->sad < 0)
dev_err(board->gpib_dev, "bug, APT interrupt without secondary addressing?\n");
if ((read_byte(priv, CPTR) & gpib_command_mask) == MSA(board->sad))
write_byte(priv, AUX_VAL, AUXCR);
else
write_byte(priv, AUX_INVAL, AUXCR);
}
if ((status0 & priv->imr0_bits) || (status1 & priv->imr1_bits)) {
dev_dbg(board->gpib_dev, "isr0 0x%x, imr0 0x%x, isr1 0x%x, imr1 0x%x\n",
status0, priv->imr0_bits, status1, priv->imr1_bits);
update_status_nolock(board, priv);
wake_up_interruptible(&board->wait);
}
return IRQ_HANDLED;
}
EXPORT_SYMBOL(tms9914_interrupt_have_status);
void tms9914_board_reset(struct tms9914_priv *priv)
{
/* chip reset */
write_byte(priv, AUX_CHIP_RESET | AUX_CS, AUXCR);
/* disable all interrupts */
priv->imr0_bits = 0;
write_byte(priv, priv->imr0_bits, IMR0);
priv->imr1_bits = 0;
write_byte(priv, priv->imr1_bits, IMR1);
write_byte(priv, AUX_DAI | AUX_CS, AUXCR);
/* clear registers by reading */
Annotation
- Immediate include surface: `linux/ioport.h`, `linux/sched.h`, `linux/module.h`, `linux/slab.h`, `asm/dma.h`, `linux/io.h`, `linux/bitops.h`, `linux/pci.h`.
- Detected declarations: `function tms9914_take_control`, `function directly`, `function tms9914_go_to_standby`, `function tms9914_interface_clear`, `function tms9914_remote_enable`, `function tms9914_request_system_control`, `function tms9914_t1_delay`, `function tms9914_return_to_local`, `function tms9914_set_holdoff_mode`, `function tms9914_release_holdoff`.
- Atlas domain: Driver Families / drivers/gpib.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.