payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / superio / winbond / w83977tf / superio.c
blob4187b52a4293b7b44f3fdbbd657f45de104a47da
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <device/device.h>
4 #include <device/pnp.h>
5 #include <superio/conf_mode.h>
6 #include <pc80/keyboard.h>
8 #include "w83977tf.h"
10 static void w83977tf_init(struct device *dev)
13 if (!dev->enabled)
14 return;
16 switch (dev->path.pnp.device) {
17 case W83977TF_KBC:
18 pc_keyboard_init(NO_AUX_DEVICE);
19 break;
23 static struct device_operations ops = {
24 .read_resources = pnp_read_resources,
25 .set_resources = pnp_set_resources,
26 .enable_resources = pnp_enable_resources,
27 .enable = pnp_enable,
28 .init = w83977tf_init,
29 .ops_pnp_mode = &pnp_conf_mode_8787_aa,
32 static struct pnp_info pnp_dev_info[] = {
33 { NULL, W83977TF_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, 0x07f8, },
34 { NULL, W83977TF_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, 0x07f8, },
35 { NULL, W83977TF_SP1, PNP_IO0 | PNP_IRQ0, 0x07f8, },
36 { NULL, W83977TF_SP2, PNP_IO0 | PNP_IRQ0, 0x07f8, },
37 { NULL, W83977TF_KBC, PNP_IO0 | PNP_IO1 | PNP_IRQ0 | PNP_IRQ1,
38 0x07ff, 0x07ff, },
39 #if CONFIG(W83977TF_HAVE_SEPARATE_IR_DEVICE)
40 { NULL, W83977TF_CIR, PNP_IO0 | PNP_IRQ0, 0x07f8, },
41 #endif
42 { NULL, W83977TF_GAME_MIDI_GPIO1, PNP_IO0 | PNP_IO1 | PNP_IRQ0,
43 0x07ff, 0x07fe, },
44 { NULL, W83977TF_ACPI, PNP_IRQ0, },
47 static void enable_dev(struct device *dev)
49 pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
52 struct chip_operations superio_winbond_w83977tf_ops = {
53 CHIP_NAME("Winbond W83977TF Super I/O")
54 .enable_dev = enable_dev,