Debian Codegraph @

src/superio/smsc/mec1308/superio.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 /* RAM driver for the SMSC MEC1308 Super I/O chip */
4
5 #include <device/device.h>
6 #include <device/pnp.h>
7 #include <superio/conf_mode.h>
8 #include <pc80/keyboard.h>
9
10 #include "mec1308.h"
11
12 static void mec1308_init(struct device *dev)
13 {
14 if (!dev->enabled)
15 return;
16
17 switch (dev->path.pnp.device) {
18 case MEC1308_KBC:
19 pc_keyboard_init(NO_AUX_DEVICE);
20 break;
21 }
22 }
23
24 static struct device_operations ops = {
25 .read_resources = pnp_read_resources,
26 .set_resources = pnp_set_resources,
27 .enable_resources = pnp_enable_resources,
28 .enable = pnp_alt_enable,
29 .init = mec1308_init,
30 .ops_pnp_mode = &pnp_conf_mode_55_aa,
31 };
32
33 static struct pnp_info pnp_dev_info[] = {
34 { NULL, MEC1308_PM1, PNP_IO0, 0x7ff },
35 { NULL, MEC1308_EC1, PNP_IO0, 0x7ff },
36 { NULL, MEC1308_EC2, PNP_IO0, 0x7ff },
37 { NULL, MEC1308_UART, PNP_IO0 | PNP_IRQ0, 0x0ff8, },
38 { NULL, MEC1308_KBC, PNP_IRQ0, 0 /* IO Fixed at 0x60/0x64 */ },
39 { NULL, MEC1308_EC0, PNP_IO0, 0x7ff },
40 { NULL, MEC1308_MBX, PNP_IO0, 0x7ff },
41 };
42
43 static void enable_dev(struct device *dev)
44 {
45 pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
46 }
47
48 struct chip_operations superio_smsc_mec1308_ops = {
49 .name = "SMSC MEC1308 EC SuperIO Interface",
50 .enable_dev = enable_dev
51 };