1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <device/device.h>
4 #include <device/pnp.h>
5 #include <pc80/keyboard.h>
6 #include <superio/conf_mode.h>
10 static void nct6779d_init(struct device
*dev
)
15 switch (dev
->path
.pnp
.device
) {
16 /* TODO: Might potentially need code for HWM or FDC etc. */
18 pc_keyboard_init(NO_AUX_DEVICE
);
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_alt_enable
,
28 .init
= nct6779d_init
,
29 .ops_pnp_mode
= &pnp_conf_mode_8787_aa
,
32 static struct pnp_info pnp_dev_info
[] = {
33 { NULL
, NCT6779D_PP
, PNP_IO0
| PNP_IRQ0
| PNP_DRQ0
, 0x0ff8, },
34 { NULL
, NCT6779D_SP1
, PNP_IO0
| PNP_IRQ0
, 0x0ff8, },
35 { NULL
, NCT6779D_SP2
, PNP_IO0
| PNP_IRQ0
, 0x0ff8, },
36 { NULL
, NCT6779D_KBC
, PNP_IO0
| PNP_IO1
| PNP_IRQ0
| PNP_IRQ1
,
38 { NULL
, NCT6779D_CIR
, PNP_IO0
| PNP_IRQ0
, 0x0ff8, },
39 { NULL
, NCT6779D_ACPI
, PNP_MSC2
,},
40 { NULL
, NCT6779D_HWM_FPLED
, PNP_IO0
| PNP_IO1
| PNP_IRQ0
| PNP_MSC0
,
42 { NULL
, NCT6779D_WDT1
},
43 { NULL
, NCT6779D_CIRWKUP
, PNP_IO0
| PNP_IRQ0
, 0x0ff8, },
44 { NULL
, NCT6779D_GPIO_PP_OD
},
45 { NULL
, NCT6779D_PRT80
},
46 { NULL
, NCT6779D_DSLP
},
47 { NULL
, NCT6779D_GPIOBASE
, PNP_IO0
, 0x0ff8, },
48 { NULL
, NCT6779D_GPIO0
},
49 { NULL
, NCT6779D_GPIO1
},
50 { NULL
, NCT6779D_GPIO2
},
51 { NULL
, NCT6779D_GPIO3
},
52 { NULL
, NCT6779D_GPIO4
},
53 { NULL
, NCT6779D_GPIO5
, PNP_MSC4
| PNP_MSC5
},
54 { NULL
, NCT6779D_GPIO6
, PNP_MSC4
| PNP_MSC5
},
55 { NULL
, NCT6779D_GPIO7
},
56 { NULL
, NCT6779D_GPIO8
},
59 static void enable_dev(struct device
*dev
)
61 pnp_enable_devices(dev
, &ops
, ARRAY_SIZE(pnp_dev_info
), pnp_dev_info
);
64 struct chip_operations superio_nuvoton_nct6779d_ops
= {
65 .name
= "NUVOTON NCT6779D Super I/O",
66 .enable_dev
= enable_dev
,