Debian Codegraph @

src/superio/smsc/fdc37n972/superio.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <device/device.h>
4 #include <device/pnp.h>
5 #include <superio/conf_mode.h>
6 #include <pc80/keyboard.h>
7
8 #include "fdc37n972.h"
9
10 static void init(struct device *dev)
11 {
12 if (!dev->enabled)
13 return;
14
15 switch (dev->path.pnp.device) {
16 case FDC37N972_FDC: /* TODO. */
17 break;
18 case FDC37N972_PP: /* TODO. */
19 break;
20 case FDC37N972_KBDC:
21 pc_keyboard_init(NO_AUX_DEVICE);
22 break;
23 // [..] The rest: TODO
24 }
25 }
26
27 static struct device_operations ops = {
28 .read_resources = pnp_read_resources,
29 .set_resources = pnp_set_resources,
30 .enable_resources = pnp_enable_resources,
31 .enable = pnp_enable,
32 .init = init,
33 .ops_pnp_mode = &pnp_conf_mode_55_aa,
34 };
35
36 static struct pnp_info pnp_dev_info[] = {
37 { NULL, FDC37N972_SP1, PNP_IO0 | PNP_IRQ0, 0x07f8, },
38 { NULL, FDC37N972_SP2,
39 PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, 0x07f8, },
40 { NULL, FDC37N972_KBDC, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07f8, 0x07f8, },
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_fdc37n972_ops = {
49 .name = "SMSC FDC37N972 Super I/O",
50 .enable_dev = enable_dev,
51 };