-
-static __init int add_pcspkr(void)
-{
- struct device_node *np;
- struct platform_device *pd;
- int ret;
-
- np = of_find_compatible_node(NULL, NULL, "pnpPNP,100");
- of_node_put(np);
- if (!np)
- return -ENODEV;
-
- pd = platform_device_alloc("pcspkr", -1);
- if (!pd)
- return -ENOMEM;
-
- ret = platform_device_add(pd);
- if (ret)
- platform_device_put(pd);
-
- return ret;
-}
-device_initcall(add_pcspkr);
-
-void probe_machine(void)
-{
- extern struct machdep_calls __machine_desc_start;
- extern struct machdep_calls __machine_desc_end;
-
- /*
- * Iterate all ppc_md structures until we find the proper
- * one for the current machine type
- */
- DBG("Probing machine type ...\n");
-
- for (machine_id = &__machine_desc_start;
- machine_id < &__machine_desc_end;
- machine_id++) {
- DBG(" %s ...", machine_id->name);
- memcpy(&ppc_md, machine_id, sizeof(struct machdep_calls));
- if (ppc_md.probe()) {
- DBG(" match !\n");
- break;
- }
- DBG("\n");
- }
- /* What can we do if we didn't find ? */
- if (machine_id >= &__machine_desc_end) {
- DBG("No suitable machine found !\n");
- for (;;);
- }
-
- printk(KERN_INFO "Using %s machine description\n", ppc_md.name);
-}
-
-int check_legacy_ioport(unsigned long base_port)
-{
- if (ppc_md.check_legacy_ioport == NULL)
- return 0;
- return ppc_md.check_legacy_ioport(base_port);
-}
-EXPORT_SYMBOL(check_legacy_ioport);
-
-static int ppc_panic_event(struct notifier_block *this,
- unsigned long event, void *ptr)
-{
- ppc_md.panic(ptr); /* May not return */
- return NOTIFY_DONE;
-}
-
-static struct notifier_block ppc_panic_block = {
- .notifier_call = ppc_panic_event,
- .priority = INT_MIN /* may not return; must be done last */
-};
-
-void __init setup_panic(void)
-{
- atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block);
-}