Main Page | Directories | File List | Globals

adi_chips.c

Go to the documentation of this file.
00001 /*
00002  * kernel_drivers/adi_core/adi_chips.c
00003  *
00004  * Copyright (c) 2003-2004 Lukasz Dembinski <dembol@nasa.com.pl>
00005  * All Rights Reserved
00006  * 
00007  * Date:        2004/01
00008  * Author:      Lukasz Dembinski
00009  * Info:        adi_chips.c core file
00010  * Contact:     mailto: <dembol@nasa.com.pl>
00011  *
00012  */
00013 
00014 #include <agnix/init.h>
00015 #include <agnix/adi/adi.h>
00016 #include <agnix/irq.h>
00017 #include <agnix/console.h>
00018 
00019 #define MOD_NAME                "CHIPS: "
00020 
00021 const char *chip_class_names[] = {
00022     "CPU", "PIC", "PIT", "RTC", "DMA"
00023 };
00024 
00025 int adi_register_chip(struct chip_s *chip)
00026 {
00027     int ret = 0;
00028 
00029     if (chip->chip_name)
00030         printk(MOD_NAME "Registering %s chip\t (class %s)\n", chip->chip_name, chip_class_names[chip->chip_class]);
00031     else
00032         printk(MOD_NAME "Registering unknown-name chip\n", chip->chip_name);
00033 
00034     spin_lock_init(&chip->chip_lock);
00035 
00036     /* + request resources */
00037 
00038     chip->chip_state = CHIP_STATE_INITIALIZING;
00039 
00040     if ((chip->chip_ops) && (chip->chip_ops->init)) {
00041         
00042         ret = chip->chip_ops->init(chip);
00043         if (ret)
00044             return -1;
00045         else
00046             chip->chip_state = CHIP_STATE_WORKING;
00047     }
00048 
00049     return 0;
00050 }
00051 
00052 void __init adi_chips_init(void)
00053 {
00054     printk(MOD_NAME "Initializing chip drivers\n");
00055 
00056     i8259a_init();
00057      i8254_init();
00058        rtc_init();
00059        dma_init();
00060      intel_init(0);
00061 }
Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix