blob: 71838cae890ca3e756142bda1d588567a7988f3a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * rsrc_mgr.c -- Resource management routines and/or wrappers
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * The initial developer of the original code is David A. Hinds
9 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 *
12 * (C) 1999 David A. Hinds
13 */
14
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090015#include <linux/slab.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#include <linux/module.h>
17#include <linux/kernel.h>
18
19#include <pcmcia/cs_types.h>
20#include <pcmcia/ss.h>
21#include <pcmcia/cs.h>
Dominik Brodowski91284222009-10-18 23:32:33 +020022#include <pcmcia/cistpl.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#include "cs_internal.h"
24
Dominik Brodowski49b11532010-03-07 16:41:57 +010025int static_init(struct pcmcia_socket *s)
Linus Torvalds1da177e2005-04-16 15:20:36 -070026{
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 /* the good thing about SS_CAP_STATIC_MAP sockets is
28 * that they don't need a resource database */
29
Linus Torvalds1da177e2005-04-16 15:20:36 -070030 s->resource_setup_done = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
32 return 0;
33}
34
Dominik Brodowski49b11532010-03-07 16:41:57 +010035struct resource *pcmcia_make_resource(unsigned long start, unsigned long end,
36 int flags, const char *name)
37{
38 struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
39
40 if (res) {
41 res->name = name;
42 res->start = start;
43 res->end = start + end - 1;
44 res->flags = flags;
45 }
46 return res;
47}
48
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
50struct pccard_resource_ops pccard_static_ops = {
51 .validate_mem = NULL,
52 .adjust_io_region = NULL,
53 .find_io = NULL,
54 .find_mem = NULL,
Dominik Brodowskic5023802008-06-19 19:02:52 +020055 .add_io = NULL,
56 .add_mem = NULL,
Linus Torvalds1da177e2005-04-16 15:20:36 -070057 .init = static_init,
58 .exit = NULL,
59};
60EXPORT_SYMBOL(pccard_static_ops);
Dominik Brodowski3b27e942005-12-07 12:32:20 +010061
62
Dominik Brodowski49b11532010-03-07 16:41:57 +010063MODULE_AUTHOR("David A. Hinds, Dominik Brodowski");
64MODULE_LICENSE("GPL");
65MODULE_ALIAS("rsrc_nonstatic");