linux/drivers/parisc/hppb.c
<<
>>
Prefs
   1/*
   2** hppb.c:
   3**      HP-PB bus driver for the NOVA and K-Class systems.
   4**
   5**      (c) Copyright 2002 Ryan Bradetich
   6**      (c) Copyright 2002 Hewlett-Packard Company
   7**
   8** This program is free software; you can redistribute it and/or modify
   9** it under the terms of the GNU General Public License as published by
  10** the Free Software Foundation; either version 2 of the License, or
  11** (at your option) any later version.
  12**
  13*/
  14
  15#include <linux/types.h>
  16#include <linux/init.h>
  17#include <linux/mm.h>
  18#include <linux/slab.h>
  19#include <linux/dma-mapping.h>
  20#include <linux/ioport.h>
  21
  22#include <asm/io.h>
  23#include <asm/hardware.h>
  24#include <asm/parisc-device.h>
  25
  26struct hppb_card {
  27        unsigned long hpa;
  28        struct resource mmio_region;
  29        struct hppb_card *next;
  30};
  31
  32static struct hppb_card hppb_card_head = {
  33        .hpa = 0,
  34        .next = NULL,
  35};
  36
  37#define IO_IO_LOW  offsetof(struct bc_module, io_io_low)
  38#define IO_IO_HIGH offsetof(struct bc_module, io_io_high)
  39
  40/**
  41 * hppb_probe - Determine if the hppb driver should claim this device.
  42 * @dev: The device which has been found
  43 *
  44 * Determine if hppb driver should claim this chip (return 0) or not 
  45 * (return 1). If so, initialize the chip and tell other partners in crime 
  46 * they have work to do.
  47 */
  48static int hppb_probe(struct parisc_device *dev)
  49{
  50        int status;
  51        struct hppb_card *card = &hppb_card_head;
  52
  53        while(card->next) {
  54                card = card->next;
  55        }
  56
  57        if(card->hpa) {
  58                card->next = kzalloc(shre2