Lines Matching +full:isa +full:- +full:base

1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* ------------------------------------------------------------------------- */
3 /* i2c-elektor.c i2c-hw access for PCF8584 style isa bus adaptes */
4 /* ------------------------------------------------------------------------- */
5 /* Copyright (C) 1995-97 Simon G. Vogl
6 1998-99 Hans Berglund
9 /* ------------------------------------------------------------------------- */
15 for Alpha Processor Inc. UP-2000(+) boards */
26 #include <linux/isa.h>
28 #include <linux/i2c-algo-pcf.h>
33 #include "../algos/i2c-algo-pcf.h"
37 static int base; variable
45 /* vdovikin: removed static struct i2c_pcf_isa gpi; code -
47 in some functions, called from the algo-pcf module. Sometimes it's
48 need to be rewriten - but for now just remove this for simpler reading */
56 /* ----- local functions ---------------------------------------------- */
136 if (!request_region(base, 2, pcf_isa_ops.name)) { in pcf_isa_init()
138 "in use\n", pcf_isa_ops.name, base); in pcf_isa_init()
139 return -ENODEV; in pcf_isa_init()
141 base_iomem = ioport_map(base, 2); in pcf_isa_init()
144 pcf_isa_ops.name, base); in pcf_isa_init()
145 release_region(base, 2); in pcf_isa_init()
146 return -ENODEV; in pcf_isa_init()
149 if (!request_mem_region(base, 2, pcf_isa_ops.name)) { in pcf_isa_init()
151 "is in use\n", pcf_isa_ops.name, base); in pcf_isa_init()
152 return -ENODEV; in pcf_isa_init()
154 base_iomem = ioremap(base, 2); in pcf_isa_init()
157 "failed\n", pcf_isa_ops.name, base); in pcf_isa_init()
158 release_mem_region(base, 2); in pcf_isa_init()
159 return -ENODEV; in pcf_isa_init()
162 pr_debug("%s: registers %#x remapped to %p\n", pcf_isa_ops.name, base, in pcf_isa_init()
177 /* ------------------------------------------------------------------------
193 .name = "i2c-elektor",
200 Cypress cy82c693 PCI-ISA bridge as on UP2000 board */ in elektor_match()
201 if (base == 0) { in elektor_match()
226 base = 0xe0000; in elektor_match()
228 /* UP2000 drives ISA with in elektor_match()
243 if (mmapped && base < 0xc8000) { in elektor_match()
244 dev_err(dev, "incorrect base address (%#x) specified " in elektor_match()
245 "for mmapped I/O\n", base); in elektor_match()
249 if (base == 0) { in elektor_match()
250 base = DEFAULT_BASE; in elektor_match()
259 return -ENODEV; in elektor_probe()
264 dev_info(dev, "found device at %#x\n", base); in elektor_probe()
276 release_region(base, 2); in elektor_probe()
279 release_mem_region(base, 2); in elektor_probe()
281 return -ENODEV; in elektor_probe()
295 release_region(base, 2); in elektor_remove()
298 release_mem_region(base, 2); in elektor_remove()
308 .name = "i2c-elektor",
313 MODULE_DESCRIPTION("I2C-Bus adapter routines for PCF8584 ISA bus adapter");
316 module_param_hw(base, int, ioport_or_iomem, 0);