Lines Matching +full:irq +full:- +full:device

60  *	er	28-Jan-1997	Initial Entry
67 ** Macros for handling device IRQs
69 ** The mask acts as a flag used in mapping actual ISA IRQs (0 - 15)
70 ** to device IRQs (A - H).
81 ** Macros for handling device DRQs
84 ** channels to device DMA channels (A - C).
97 ** SMC37c669 Device Function Definitions
107 ** Default Device Function Mappings
127 ** SMC 37c669 Device IRQs
139 ** SMC 37c669 Device DMA Channel Definitions
218 ** CR00 - default value 0x28
221 ** 0x - 30ua pull-ups on nIDEEN, nHDCS0, NHDCS1
222 ** 11 - IRQ_H available as IRQ output,
224 ** 10 - nIDEEN, nHDCS0, nHDCS1 used to control IDE
247 ** CR01 - default value 0x9C
257 unsigned lock_crx: 1; /* Lock CR00 - CR18 */
262 ** CR02 - default value 0x88
275 ** CR03 - default value 0x78
278 ** ------- ------- ------
284 ** ------- ------- -------
297 unsigned drvden : 1; /* 1 = high, 0 - output */
304 ** CR04 - default value 0x00
308 ** 00 - Standard and Bidirectional
309 ** 01 - EPP mode and SPP
310 ** 10 - ECP mode
315 ** 11 - ECP mode and EPP mode
324 ** 00 - Normal
325 ** 01 - PPFD1
326 ** 10 - PPFD2
327 ** 11 - Reserved
339 ** 0 - Use pins IRRX, IRTX
340 ** 1 - Use pins IRRX2, IRTX2
359 ** CR05 - default value 0x00
362 ** 00 - Densel output normal
363 ** 01 - Reserved
364 ** 10 - Densel output 1
365 ** 11 - Densel output 0
372 unsigned fdc_dma_mode : 1; /* 0 = burst, 1 = non-burst */
381 ** CR06 - default value 0xFF
394 ** CR07 - default value 0x00
397 ** 0 - Auto Powerdown disabled (default)
398 ** 1 - Auto Powerdown enabled
417 ** CR08 - default value 0x00
428 ** CR09 - default value 0x00
431 ** 00 - ADRx disabled
432 ** 01 - 1 byte decode A<3:0> = 0000b
433 ** 10 - 8 byte block decode A<3:0> = 0XXXb
434 ** 11 - 16 byte block decode A<3:0> = XXXXb
447 ** CR0A - default value 0x00
458 ** CR0B - default value 0x00
471 ** CR0C - default value 0x00
474 ** 000 - Standard (default)
475 ** 001 - IrDA (HPSIR)
476 ** 010 - Amplitude Shift Keyed IR @500 KHz
477 ** 011 - Reserved
478 ** 1xx - Reserved
494 ** CR0D - default value 0x03
496 ** Device ID Register - read only
506 ** CR0E - default value 0x02
508 ** Device Revision Register - read only
518 ** CR0F - default value 0x00
523 unsigned test0 : 1; /* Reserved - set to 0 */
524 unsigned test1 : 1; /* Reserved - set to 0 */
525 unsigned test2 : 1; /* Reserved - set to 0 */
526 unsigned test3 : 1; /* Reserved - set t0 0 */
527 unsigned test4 : 1; /* Reserved - set to 0 */
528 unsigned test5 : 1; /* Reserved - set t0 0 */
529 unsigned test6 : 1; /* Reserved - set t0 0 */
530 unsigned test7 : 1; /* Reserved - set to 0 */
535 ** CR10 - default value 0x00
550 ** CR11 - default value 0x00
562 ** CR12 - CR1D are reserved registers
566 ** CR1E - default value 0x80
569 ** 00 - GAMECS disabled
570 ** 01 - 1 byte decode ADR<3:0> = 0001b
571 ** 10 - 8 byte block decode ADR<3:0> = 0XXXb
572 ** 11 - 16 byte block decode ADR<3:0> = XXXXb
584 ** CR1F - default value 0x00
587 ** --- --- ------- ------- ----------
590 ** 2/1.6/1 MB 3.5" (3-mode)
596 ** pins - DRVDEN0 and DRVDEN1.
610 ** CR20 - default value 0x3C
613 ** - To disable this decode set Addr<9:8> = 0
614 ** - A<10> = 0, A<3:0> = 0XXXb to access.
626 ** CR21 - default value 0x3C
629 ** - To disable this decode set Addr<9:8> = 0
630 ** - A<10> = 0, A<3:0> = 0XXXb to access.
642 ** CR22 - default value 0x3D
645 ** - To disable this decode set Addr<9:8> = 0
646 ** - A<10> = 0, A<3:0> = 0110b to access.
658 ** CR23 - default value 0x00
661 ** - To disable this decode set Addr<9:8> = 0
662 ** - A<10> = 0 to access.
663 ** - If EPP is enabled, A<2:0> = XXXb to access.
675 ** CR24 - default value 0x00
678 ** - To disable this decode set Addr<9:8> = 0
679 ** - A<10> = 0, A<2:0> = XXXb to access.
691 ** CR25 - default value 0x00
694 ** - To disable this decode set Addr<9:8> = 0
695 ** - A<10> = 0, A<2:0> = XXXb to access.
707 ** CR26 - default value 0x00
711 ** D3 - D0 DMA
712 ** D7 - D4 Selected
713 ** ------- --------
729 ** CR27 - default value 0x00
731 ** Parallel Port / FDC IRQ Select Register
733 ** D3 - D0 IRQ
734 ** D7 - D4 Selected
735 ** ------- --------
746 ** Any unselected IRQ REQ is in tristate
758 ** CR28 - default value 0x00
760 ** UART IRQ Select Register
762 ** D3 - D0 IRQ
763 ** D7 - D4 Selected
764 ** ------- --------
776 ** Any unselected IRQ REQ is in tristate
778 ** To share an IRQ between UART1 and UART2, set
779 ** UART1 to use the desired IRQ and set UART2 to
792 ** CR29 - default value 0x00
794 ** IRQIN IRQ Select Register
796 ** D3 - D0 IRQ
797 ** D7 - D4 Selected
798 ** ------- --------
809 ** Any unselected IRQ REQ is in tristate
826 ** this we only define 1 alias here - for CR24 - as the serial
832 ** here - for CR21 - as the IDE address register.
846 ** ISA/Device IRQ Translation Table Entry Definition
854 ** ISA/Device DMA Translation Table Entry Definition
880 int irq,
927 * 28-Jan-1997
931 * er 01-May-1997 Fixed pointer conversion errors in
933 * er 28-Jan-1997 Initial version.
935 *--
949 ** Local storage for device configuration information.
952 ** mechanism for enabling/disabling individual device
953 ** functions, other than unmapping the device, local
954 ** storage for device configuration information is
961 int irq; member
976 ** Global Pointer to the Super I/O device
981 ** IRQ Translation Table
983 ** The IRQ translation table is a list of SMC37c669 device
990 ** The following definition is for the default IRQ
996 { SMC37c669_DEVICE_IRQ_A, -1 },
997 { SMC37c669_DEVICE_IRQ_B, -1 },
1002 { SMC37c669_DEVICE_IRQ_H, -1 },
1003 { -1, -1 } /* End of table */
1007 ** The following definition is for the MONET (XP1000) IRQ
1013 { SMC37c669_DEVICE_IRQ_A, -1 },
1014 { SMC37c669_DEVICE_IRQ_B, -1 },
1019 { SMC37c669_DEVICE_IRQ_H, -1 },
1020 { -1, -1 } /* End of table */
1032 ** The DRQ translation table is a list of SMC37c669 device and
1047 { SMC37c669_DEVICE_DRQ_C, -1 },
1048 { -1, -1 } /* End of table */
1063 int *irq,
1088 int irq
1110 ** Returns a pointer to the device if found, otherwise,
1117 **--
1126 ** Initialize the device pointer even though we don't yet know if in SMC37c669_detect()
1128 ** the controller through this device pointer so we need to set it in SMC37c669_detect()
1137 ** Read the device id in SMC37c669_detect()
1145 ** Does the device id match? If so, assume we have found an in SMC37c669_detect()
1150 ** Initialize the IRQ and DRQ translation tables. in SMC37c669_detect()
1157 ** If the platform can't use the IRQ and DRQ defaults set up in this in SMC37c669_detect()
1158 ** file, it should call a platform-specific external routine at this in SMC37c669_detect()
1159 ** point to reset the IRQ and DRQ translation table pointers to point in SMC37c669_detect()
1184 ** address so set the device pointer to NULL. in SMC37c669_detect()
1197 ** This function enables an SMC37c669 device function.
1202 ** Which device function to enable
1206 ** Returns TRUE is the device function was enabled, otherwise, FALSE
1214 ** Enabling a device function in the SMC37c669 controller involves
1215 ** setting all of its mappings (port, irq, drq ...). A local
1216 ** "shadow" copy of the device configuration is kept so we can
1220 ** the device function being enabled, even if the device is always
1223 ** function to the update the real device.
1225 **--
1231 ** Put the device into configuration mode in SMC37c669_enable_device()
1238 SMC37c669_SERIAL_IRQ_REGISTER irq; in SMC37c669_enable_device() local
1240 ** Enable the serial 1 IRQ mapping in SMC37c669_enable_device()
1242 irq.as_uchar = in SMC37c669_enable_device()
1245 irq.by_field.uart1_irq = in SMC37c669_enable_device()
1247 SMC37c669_xlate_irq( local_config[ func ].irq ) in SMC37c669_enable_device()
1250 SMC37c669_write_config( SMC37c669_SERIAL_IRQ_INDEX, irq.as_uchar ); in SMC37c669_enable_device()
1267 SMC37c669_SERIAL_IRQ_REGISTER irq; in SMC37c669_enable_device() local
1269 ** Enable the serial 2 IRQ mapping in SMC37c669_enable_device()
1271 irq.as_uchar = in SMC37c669_enable_device()
1274 irq.by_field.uart2_irq = in SMC37c669_enable_device()
1276 SMC37c669_xlate_irq( local_config[ func ].irq ) in SMC37c669_enable_device()
1279 SMC37c669_write_config( SMC37c669_SERIAL_IRQ_INDEX, irq.as_uchar ); in SMC37c669_enable_device()
1296 SMC37c669_PARALLEL_FDC_IRQ_REGISTER irq; in SMC37c669_enable_device() local
1314 ** Enable the parallel port IRQ mapping in SMC37c669_enable_device()
1316 irq.as_uchar = in SMC37c669_enable_device()
1319 irq.by_field.ppt_irq = in SMC37c669_enable_device()
1321 SMC37c669_xlate_irq( local_config[ func ].irq ) in SMC37c669_enable_device()
1326 irq.as_uchar in SMC37c669_enable_device()
1344 SMC37c669_PARALLEL_FDC_IRQ_REGISTER irq; in SMC37c669_enable_device() local
1362 ** Enable the floppy controller IRQ mapping in SMC37c669_enable_device()
1364 irq.as_uchar = in SMC37c669_enable_device()
1367 irq.by_field.fdc_irq = in SMC37c669_enable_device()
1369 SMC37c669_xlate_irq( local_config[ func ].irq ) in SMC37c669_enable_device()
1374 irq.as_uchar in SMC37c669_enable_device()
1429 ** This function disables a device function within the
1439 ** Return TRUE if the device function was disabled, otherwise, FALSE
1447 ** Disabling a function in the SMC37c669 device involves
1448 ** disabling all the function's mappings (port, irq, drq ...).
1449 ** A shadow copy of the device configuration is maintained
1453 **--
1460 ** Put the device into configuration mode in SMC37c669_disable_device()
1467 SMC37c669_SERIAL_IRQ_REGISTER irq; in SMC37c669_disable_device() local
1469 ** Disable the serial 1 IRQ mapping in SMC37c669_disable_device()
1471 irq.as_uchar = in SMC37c669_disable_device()
1474 irq.by_field.uart1_irq = 0; in SMC37c669_disable_device()
1476 SMC37c669_write_config( SMC37c669_SERIAL_IRQ_INDEX, irq.as_uchar ); in SMC37c669_disable_device()
1491 SMC37c669_SERIAL_IRQ_REGISTER irq; in SMC37c669_disable_device() local
1493 ** Disable the serial 2 IRQ mapping in SMC37c669_disable_device()
1495 irq.as_uchar = in SMC37c669_disable_device()
1498 irq.by_field.uart2_irq = 0; in SMC37c669_disable_device()
1500 SMC37c669_write_config( SMC37c669_SERIAL_IRQ_INDEX, irq.as_uchar ); in SMC37c669_disable_device()
1516 SMC37c669_PARALLEL_FDC_IRQ_REGISTER irq; in SMC37c669_disable_device() local
1531 ** Disable the parallel port IRQ mapping in SMC37c669_disable_device()
1533 irq.as_uchar = in SMC37c669_disable_device()
1536 irq.by_field.ppt_irq = 0; in SMC37c669_disable_device()
1540 irq.as_uchar in SMC37c669_disable_device()
1557 SMC37c669_PARALLEL_FDC_IRQ_REGISTER irq; in SMC37c669_disable_device() local
1572 ** Disable the floppy controller IRQ mapping in SMC37c669_disable_device()
1574 irq.as_uchar = in SMC37c669_disable_device()
1577 irq.by_field.fdc_irq = 0; in SMC37c669_disable_device()
1581 irq.as_uchar in SMC37c669_disable_device()
1633 ** This function configures a device function within the
1639 ** Which device function
1644 ** irq:
1645 ** IRQ for the device function to use
1648 ** DMA channel for the device function to use
1652 ** Returns TRUE if the device function was configured,
1662 ** the configuration is also updated. If the device function
1664 ** updated and the actual device function will be updated
1667 **--
1672 int irq, in SMC37c669_configure_device() argument
1685 cp->drq = drq; in SMC37c669_configure_device()
1687 if ( ( irq & ~0xFF ) == 0 ) { in SMC37c669_configure_device()
1688 cp->irq = irq; in SMC37c669_configure_device()
1691 cp->port1 = port; in SMC37c669_configure_device()
1694 ** If the device function is enabled, update the actual in SMC37c669_configure_device()
1695 ** device configuration. in SMC37c669_configure_device()
1710 ** This function determines whether a device function
1716 ** Which device function
1720 ** Returns TRUE if the device function is enabled, otherwise, FALSE
1728 ** To check whether a device is enabled we will only look at
1734 **--
1774 ** If we have a valid device, check base_addr<7:6> to see if the in SMC37c669_is_device_enabled()
1775 ** device is enabled (mapped). in SMC37c669_is_device_enabled()
1799 ** device function within the SMC37c699 Super I/O controller.
1804 ** Which device function
1809 ** irq:
1810 ** IRQ returned
1817 ** Returns TRUE if the device configuration was successfully
1822 ** The data pointed to by the port, irq, and drq parameters
1828 ** The device configuration is fetched from the local shadow
1829 ** copy. Any unused parameters will be set to -1. Any
1833 **--
1838 int *irq,
1844 ** Check for a valid device configuration
1848 *drq = cp->drq;
1851 if ( irq != NULL ) {
1852 *irq = cp->irq;
1856 *port = cp->port1;
1870 ** Super I/O controller's device functions.
1884 **--
1889 printk( " Serial 0: Enabled [ Port 0x%x, IRQ %d ]\n", in SMC37c669_display_device_info()
1891 local_config[ SERIAL_0 ].irq in SMC37c669_display_device_info()
1899 printk( " Serial 1: Enabled [ Port 0x%x, IRQ %d ]\n", in SMC37c669_display_device_info()
1901 local_config[ SERIAL_1 ].irq in SMC37c669_display_device_info()
1909 printk( " Parallel: Enabled [ Port 0x%x, IRQ %d/%d ]\n", in SMC37c669_display_device_info()
1911 local_config[ PARALLEL_0 ].irq, in SMC37c669_display_device_info()
1920 printk( " Floppy Ctrl: Enabled [ Port 0x%x, IRQ %d/%d ]\n", in SMC37c669_display_device_info()
1922 local_config[ FLOPPY_0 ].irq, in SMC37c669_display_device_info()
1931 printk( " IDE 0: Enabled [ Port 0x%x, IRQ %d ]\n", in SMC37c669_display_device_info()
1933 local_config[ IDE_0 ].irq in SMC37c669_display_device_info()
1962 **--
1976 wb( &SMC37c669->index_port, SMC37c669_CONFIG_ON_KEY ); in SMC37c669_config_mode()
1977 wb( &SMC37c669->index_port, SMC37c669_CONFIG_ON_KEY ); in SMC37c669_config_mode()
1981 wb( &SMC37c669->index_port, SMC37c669_CONFIG_OFF_KEY ); in SMC37c669_config_mode()
1991 ** device is already in configuration mode.
2006 **--
2011 wb(&SMC37c669->index_port, index); in SMC37c669_read_config()
2012 return rb(&SMC37c669->data_port); in SMC37c669_read_config()
2021 ** device is already in configuration mode.
2039 **--
2045 wb( &SMC37c669->index_port, index ); in SMC37c669_write_config()
2046 wb( &SMC37c669->data_port, data ); in SMC37c669_write_config()
2054 ** This function initializes the local device
2056 ** that the device is already in configuration
2069 ** Local storage for device configuration information
2072 **--
2099 local_config[SERIAL_0].irq = in SMC37c669_init_local_config()
2112 local_config[SERIAL_1].irq = in SMC37c669_init_local_config()
2135 local_config[PARALLEL_0].irq = in SMC37c669_init_local_config()
2152 local_config[FLOPPY_0].irq = in SMC37c669_init_local_config()
2175 local_config[IDE_0].irq = 14; in SMC37c669_init_local_config()
2184 ** configuration of the requested device function.
2189 ** Which device function
2200 **--
2231 ** IRQs and SMC37c669 device IRQs.
2235 ** irq:
2236 ** The IRQ to translate
2240 ** Returns the translated IRQ, otherwise, returns -1.
2246 **--
2248 static int __init SMC37c669_xlate_irq ( int irq ) in SMC37c669_xlate_irq() argument
2250 int i, translated_irq = -1; in SMC37c669_xlate_irq()
2252 if ( SMC37c669_IS_DEVICE_IRQ( irq ) ) { in SMC37c669_xlate_irq()
2254 ** We are translating a device IRQ to an ISA IRQ in SMC37c669_xlate_irq()
2256 …for ( i = 0; ( SMC37c669_irq_table[i].device_irq != -1 ) || ( SMC37c669_irq_table[i].isa_irq != -1… in SMC37c669_xlate_irq()
2257 if ( irq == SMC37c669_irq_table[i].device_irq ) { in SMC37c669_xlate_irq()
2265 ** We are translating an ISA IRQ to a device IRQ in SMC37c669_xlate_irq()
2267 …for ( i = 0; ( SMC37c669_irq_table[i].isa_irq != -1 ) || ( SMC37c669_irq_table[i].device_irq != -1… in SMC37c669_xlate_irq()
2268 if ( irq == SMC37c669_irq_table[i].isa_irq ) { in SMC37c669_xlate_irq()
2283 ** ISA DMA channels and SMC37c669 device DMA channels.
2292 ** Returns the translated DMA channel, otherwise, returns -1
2298 **--
2302 int i, translated_drq = -1; in SMC37c669_xlate_drq()
2306 ** We are translating a device DMA channel to an ISA DMA channel in SMC37c669_xlate_drq()
2308 …for ( i = 0; ( SMC37c669_drq_table[i].device_drq != -1 ) || ( SMC37c669_drq_table[i].isa_drq != -1… in SMC37c669_xlate_drq()
2317 ** We are translating an ISA DMA channel to a device DMA channel in SMC37c669_xlate_drq()
2319 …for ( i = 0; ( SMC37c669_drq_table[i].isa_drq != -1 ) || ( SMC37c669_drq_table[i].device_drq != -1… in SMC37c669_xlate_drq()
2335 ip->dva = &smc_ddb;
2336 ip->attr = ATTR$M_WRITE | ATTR$M_READ;
2337 ip->len[0] = 0x30;
2338 ip->misc = 0;
2348 ** Allow multiple readers but only one writer. ip->misc keeps track
2351 ip = fp->ip;
2353 if ( fp->mode & ATTR$M_WRITE ) {
2354 if ( ip->misc ) {
2358 ip->misc++;
2363 *fp->offset = xtoi( info );
2373 ip = fp->ip;
2374 if ( fp->mode & ATTR$M_WRITE ) {
2376 ip->misc--;
2392 ip = fp->ip;
2398 if ( !inrange( *fp->offset, 0, ip->len[0] ) )
2400 *buf++ = SMC37c669_read_config( *fp->offset );
2401 *fp->offset += 1;
2417 ip = fp->ip;
2423 if ( !inrange( *fp->offset, 0, ip->len[0] ) )
2425 SMC37c669_write_config( *fp->offset, *buf );
2426 *fp->offset += 1;
2441 printk("-- CR%02x : %02x\n", i, SMC37c669_read_config(i)); in SMC37c669_dump_registers()
2446 * = SMC_init - SMC37c669 Super I/O controller initialization =
2451 * This routine configures and enables device functions on the
2489 -1 in SMC669_Init()
2498 -1 in SMC669_Init()