Lines Matching +full:irda +full:- +full:mode +full:- +full:ports
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 1996-2001 Paul Mackerras (paulus@cs.anu.edu.au)
8 * - Replace mdelay with some schedule loop if possible
9 * - Shorten some obfuscated delays on some routines (like modem
11 * - Refcount some clocks (see darwin)
12 * - Split split split...
37 #include <asm/pci-bridge.h>
81 child = child->parent; in macio_find()
147 return -ENODEV; in simple_feature_tweak()
171 return -ENODEV; in ohare_htw_scc_enable()
172 if (of_node_name_eq(node, "ch-a")) in ohare_htw_scc_enable()
174 else if (of_node_name_eq(node, "ch-b")) in ohare_htw_scc_enable()
177 return -ENODEV; in ohare_htw_scc_enable()
179 htw = (macio->type == macio_heathrow || macio->type == macio_paddington in ohare_htw_scc_enable()
180 || macio->type == macio_gatwick); in ohare_htw_scc_enable()
197 * ports this controls the transceiver and on which in ohare_htw_scc_enable()
221 macio->flags |= chan_mask; in ohare_htw_scc_enable()
224 macio->flags |= MACIO_FLAG_SCC_LOCKED; in ohare_htw_scc_enable()
226 if (macio->flags & MACIO_FLAG_SCC_LOCKED) in ohare_htw_scc_enable()
227 return -EPERM; in ohare_htw_scc_enable()
241 macio->flags &= ~(chan_mask); in ohare_htw_scc_enable()
270 * doesn't stick. I'm still investigating... --BenH. in ohare_ide_enable()
281 return -ENODEV; in ohare_ide_enable()
295 return -ENODEV; in ohare_ide_reset()
304 return -EPERM; in ohare_sleep_state()
323 return -ENODEV; in heathrow_modem_enable()
375 return -ENODEV; in heathrow_mesh_enable()
407 return -ENODEV; in heathrow_ide_enable()
422 return -ENODEV; in heathrow_ide_reset()
434 return -ENODEV; in heathrow_bmac_enable()
470 return -ENODEV; in heathrow_sound_enable()
498 (macio->base + ((0x8000+i*0x100)>>2)); in dbdma_save()
499 save[i].cmdptr_hi = in_le32(&chan->cmdptr_hi); in dbdma_save()
500 save[i].cmdptr = in_le32(&chan->cmdptr); in dbdma_save()
501 save[i].intr_sel = in_le32(&chan->intr_sel); in dbdma_save()
502 save[i].br_sel = in_le32(&chan->br_sel); in dbdma_save()
503 save[i].wait_sel = in_le32(&chan->wait_sel); in dbdma_save()
514 (macio->base + ((0x8000+i*0x100)>>2)); in dbdma_restore()
515 out_le32(&chan->control, (ACTIVE|DEAD|WAKE|FLUSH|PAUSE|RUN)<<16); in dbdma_restore()
516 while (in_le32(&chan->status) & ACTIVE) in dbdma_restore()
518 out_le32(&chan->cmdptr_hi, save[i].cmdptr_hi); in dbdma_restore()
519 out_le32(&chan->cmdptr, save[i].cmdptr); in dbdma_restore()
520 out_le32(&chan->intr_sel, save[i].intr_sel); in dbdma_restore()
521 out_le32(&chan->br_sel, save[i].br_sel); in dbdma_restore()
522 out_le32(&chan->wait_sel, save[i].wait_sel); in dbdma_restore()
586 return -EPERM; in heathrow_sleep_state()
608 return -ENODEV; in core99_scc_enable()
609 if (of_node_name_eq(node, "ch-a")) in core99_scc_enable()
611 else if (of_node_name_eq(node, "ch-b")) in core99_scc_enable()
614 return -ENODEV; in core99_scc_enable()
637 /* Perform irda specific inits */ in core99_scc_enable()
650 macio->flags |= chan_mask; in core99_scc_enable()
669 macio->flags |= MACIO_FLAG_SCC_LOCKED; in core99_scc_enable()
671 if (macio->flags & MACIO_FLAG_SCC_LOCKED) in core99_scc_enable()
672 return -EPERM; in core99_scc_enable()
679 /* Perform irda specific clears */ in core99_scc_enable()
692 macio->flags &= ~(chan_mask); in core99_scc_enable()
709 return -ENODEV; in core99_modem_enable()
714 return -ENODEV; in core99_modem_enable()
762 return -ENODEV; in pangea_modem_enable()
767 return -ENODEV; in pangea_modem_enable()
815 return -ENODEV; in core99_ata100_enable()
845 * based ata-100 in core99_ide_enable()
860 return -ENODEV; in core99_ide_enable()
878 return -ENODEV; in core99_ide_reset()
906 if (macio->type != macio_keylargo && macio->type != macio_pangea && in core99_gmac_phy_reset()
907 macio->type != macio_intrepid) in core99_gmac_phy_reset()
908 return -ENODEV; in core99_gmac_phy_reset()
932 return -ENODEV; in core99_sound_chip_enable()
963 return -ENODEV; in core99_airport_enable()
968 if (node != macio->of_node && in core99_airport_enable()
969 (!node->parent || node->parent != macio->of_node)) in core99_airport_enable()
970 return -ENODEV; in core99_airport_enable()
971 state = (macio->flags & MACIO_FLAG_AIRPORT_ON) != 0; in core99_airport_enable()
975 /* This code is a reproduction of OF enable-cardslot in core99_airport_enable()
976 * and init-wireless methods, slightly hacked until in core99_airport_enable()
1022 macio->flags |= MACIO_FLAG_AIRPORT_ON; in core99_airport_enable()
1035 macio->flags &= ~MACIO_FLAG_AIRPORT_ON; in core99_airport_enable()
1054 if (macio->type != macio_keylargo) in core99_reset_cpu()
1055 return -ENODEV; in core99_reset_cpu()
1058 const u32 *rst = of_get_property(np, "soft-reset", NULL); in core99_reset_cpu()
1092 if (macio->type != macio_keylargo && macio->type != macio_pangea && in core99_usb_enable()
1093 macio->type != macio_intrepid) in core99_usb_enable()
1094 return -ENODEV; in core99_usb_enable()
1096 prop = of_get_property(node, "AAPL,clock-id", NULL); in core99_usb_enable()
1098 return -ENODEV; in core99_usb_enable()
1106 return -ENODEV; in core99_usb_enable()
1108 /* Sorry for the brute-force locking, but this is only used during in core99_usb_enable()
1155 if (macio->type == macio_intrepid) { in core99_usb_enable()
1177 if (--timeout <= 0) { in core99_usb_enable()
1210 if (macio->type != macio_intrepid) in core99_usb_enable()
1217 if (macio->type != macio_intrepid) in core99_usb_enable()
1242 if (macio->type != macio_keylargo && macio->type != macio_pangea && in core99_firewire_enable()
1243 macio->type != macio_intrepid) in core99_firewire_enable()
1244 return -ENODEV; in core99_firewire_enable()
1245 if (!(macio->flags & MACIO_FLAG_FW_SUPPORTED)) in core99_firewire_enable()
1246 return -ENODEV; in core99_firewire_enable()
1270 return -ENODEV; in core99_firewire_cable_power()
1272 if (macio->type != macio_keylargo && macio->type != macio_pangea && in core99_firewire_cable_power()
1273 macio->type != macio_intrepid) in core99_firewire_cable_power()
1274 return -ENODEV; in core99_firewire_cable_power()
1275 if (!(macio->flags & MACIO_FLAG_FW_SUPPORTED)) in core99_firewire_cable_power()
1276 return -ENODEV; in core99_firewire_cable_power()
1299 return -ENODEV; in intrepid_aack_delay_enable()
1339 return -ENODEV; in g5_gmac_enable()
1364 return -ENODEV; in g5_fw_enable()
1415 return -ENODEV; in g5_eth_phy_reset()
1421 /* PHY reset is GPIO 29, not in device-tree unfortunately */ in g5_eth_phy_reset()
1457 if (macio->type != macio_keylargo2 && macio->type != macio_shasta) in g5_i2s_enable()
1458 return -ENODEV; in g5_i2s_enable()
1459 if (strncmp(node->name, "i2s-", 4)) in g5_i2s_enable()
1460 return -ENODEV; in g5_i2s_enable()
1461 cell = node->name[4] - 'a'; in g5_i2s_enable()
1467 if (macio->type == macio_shasta) in g5_i2s_enable()
1471 return -ENODEV; in g5_i2s_enable()
1500 if (macio->type != macio_keylargo2 && macio->type != macio_shasta) in g5_reset_cpu()
1501 return -ENODEV; in g5_reset_cpu()
1504 const u32 *rst = of_get_property(np, "soft-reset", NULL); in g5_reset_cpu()
1514 return -ENODEV; in g5_reset_cpu()
1583 if (macio->rev >= 2) { in keylargo_shutdown()
1671 if (macio->type != macio_keylargo && macio->type != macio_pangea && in core99_sleep()
1672 macio->type != macio_intrepid) in core99_sleep()
1673 return -ENODEV; in core99_sleep()
1678 if (macio->flags & MACIO_FLAG_AIRPORT_ON) in core99_sleep()
1679 core99_airport_enable(macio->of_node, 0, 0); in core99_sleep()
1682 if (macio->flags & MACIO_FLAG_FW_SUPPORTED) { in core99_sleep()
1688 if (macio->type == macio_keylargo) in core99_sleep()
1689 core99_modem_enable(macio->of_node, 0, 0); in core99_sleep()
1691 pangea_modem_enable(macio->of_node, 0, 0); in core99_sleep()
1694 core99_sound_chip_enable(macio->of_node, 0, 0); in core99_sleep()
1709 if (macio->type == macio_keylargo) in core99_sleep()
1716 if (macio->type == macio_pangea || macio->type == macio_intrepid) in core99_sleep()
1725 if (macio->type == macio_pangea) in core99_sleep()
1727 else if (macio->type == macio_intrepid) in core99_sleep()
1729 else if (macio->type == macio_keylargo) in core99_sleep()
1764 if (macio->type != macio_keylargo && macio->type != macio_pangea && in core99_wake_up()
1765 macio->type != macio_intrepid) in core99_wake_up()
1766 return -ENODEV; in core99_wake_up()
1780 if (macio->type == macio_keylargo) { in core99_wake_up()
1794 if (macio->type == macio_pangea || macio->type == macio_intrepid) { in core99_wake_up()
1825 /* Param == 1 means to enter the "fake sleep" mode that is in core99_sleep_state()
1841 return -EPERM; in core99_sleep_state()
1858 /* Todo: eventually check we are really dealing with on-board in generic_dev_can_wake()
1879 return -EINVAL; in generic_get_mb_info()
2387 return -ENODEV; in pmac_do_feature_call()
2406 /* Lookup known motherboard type in device-tree. First try an in probe_motherboard()
2410 dt = of_find_node_by_name(NULL, "device-tree"); in probe_motherboard()
2426 /* Fallback to selection depending on mac-io chip type */ in probe_motherboard()
2427 switch(macio->type) { in probe_motherboard()
2435 pmac_mb.model_name = "Unknown OHare-based"; in probe_motherboard()
2439 pmac_mb.model_name = "Unknown Heathrow-based"; in probe_motherboard()
2444 pmac_mb.model_name = "Unknown Paddington-based"; in probe_motherboard()
2449 pmac_mb.model_name = "Unknown Keylargo-based"; in probe_motherboard()
2454 pmac_mb.model_name = "Unknown Pangea-based"; in probe_motherboard()
2459 pmac_mb.model_name = "Unknown Intrepid-based"; in probe_motherboard()
2465 pmac_mb.model_name = "Unknown K2-based"; in probe_motherboard()
2470 pmac_mb.model_name = "Unknown Shasta-based"; in probe_motherboard()
2475 ret = -ENODEV; in probe_motherboard()
2484 ret = -ENODEV; in probe_motherboard()
2487 /* Here, I used to disable the media-bay on comet. It in probe_motherboard()
2489 * a kind of media-bay and works with the current driver. in probe_motherboard()
2498 * enable it on those. In theory, the flush-on-lock property is in probe_motherboard()
2508 /* Nap mode not supported on SMP */ in probe_motherboard()
2509 if (of_property_read_bool(np, "flush-on-lock") || in probe_motherboard()
2521 printk(KERN_DEBUG "Processor NAP mode on idle enabled.\n"); in probe_motherboard()
2524 * NAP mode in probe_motherboard()
2551 /* Locate core99 Uni-N */ in probe_uninorth()
2552 uninorth_node = of_find_node_by_name(NULL, "uni-n"); in probe_uninorth()
2654 printk(KERN_ERR "pmac_feature: %pOF, can't map mac-io chip !\n", in probe_one_macio()
2659 const u32 *did = of_get_property(node, "device-id", NULL); in probe_one_macio()
2672 revp = of_get_property(node, "revision-id", NULL); in probe_one_macio()
2675 printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n", in probe_one_macio()
2691 probe_one_macio("mac-io", "keylargo", macio_keylargo); in probe_macios()
2692 probe_one_macio("mac-io", "paddington", macio_paddington); in probe_macios()
2693 probe_one_macio("mac-io", "gatwick", macio_gatwick); in probe_macios()
2694 probe_one_macio("mac-io", "heathrow", macio_heathrow); in probe_macios()
2695 probe_one_macio("mac-io", "K2-Keylargo", macio_keylargo2); in probe_macios()
2713 return (macio_chips[0].of_node == NULL) ? -ENODEV : 0; in probe_macios()
2728 slots = of_get_property(np, "slot-names", &len); in initial_serial_shutdown()
2734 else if (slots && slots->count > 0) { in initial_serial_shutdown()
2735 if (strcmp(slots->name, "IrDA") == 0) in initial_serial_shutdown()
2737 else if (strcmp(slots->name, "Modem") == 0) in initial_serial_shutdown()
2751 * but I'm not too sure it was audited for side-effects on other in set_initial_features()
2759 np = of_find_node_by_name(NULL, "via-pmu"); in set_initial_features()
2790 if (of_device_is_compatible(np, "K2-GMAC")) in set_initial_features()
2814 if (np->parent in set_initial_features()
2815 && of_device_is_compatible(np->parent, "uni-north") in set_initial_features()
2826 if (np->parent in set_initial_features()
2827 && of_device_is_compatible(np->parent, "uni-north") in set_initial_features()
2836 /* Enable ATA-100 before PCI probe. */ in set_initial_features()
2837 for_each_node_by_name(np, "ata-6") { in set_initial_features()
2838 if (np->parent in set_initial_features()
2839 && of_device_is_compatible(np->parent, "uni-north") in set_initial_features()
2840 && of_device_is_compatible(np, "kauai-ata")) { in set_initial_features()
2847 if (np->parent == macio_chips[0].of_node) { in set_initial_features()
2870 /* On all machines, switch modem & serial ports off */ in set_initial_features()
2871 for_each_node_by_name(np, "ch-a") in set_initial_features()
2873 for_each_node_by_name(np, "ch-b") in set_initial_features()
2883 /* Probe mac-io controllers */ in pmac_feature_init()
2885 printk(KERN_WARNING "No mac-io chip found\n"); in pmac_feature_init()
2926 pcix_node = of_find_compatible_node(NULL, "pci", "pci-x");
2928 printk("No PCI-X bridge found\n");
2932 printk("PCI-X bridge found but not matched to pci\n");
2937 printk("PCI-X bridge found but not matched to host\n");
2942 dump_HT_speeds("PCI-X HT Uplink", cfg, freq);
2945 dump_HT_speeds("PCI-X HT Downlink", cfg, freq);
3002 if (pmac_agp_bridge->bus != dev->bus) in pmac_suspend_agp_for_card()
3012 if (pmac_agp_bridge->bus != dev->bus) in pmac_resume_agp_for_card()