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 /* Both NCT6776D and NCT6776F package variants are supported. */
12 static void nct6776_init(struct device
*dev
)
17 switch (dev
->path
.pnp
.device
) {
18 /* TODO: Might potentially need code for HWM or FDC etc. */
20 pc_keyboard_init(NO_AUX_DEVICE
);
25 static struct device_operations ops
= {
26 .read_resources
= pnp_read_resources
,
27 .set_resources
= pnp_set_resources
,
28 .enable_resources
= pnp_enable_resources
,
29 .enable
= pnp_alt_enable
,
31 .ops_pnp_mode
= &pnp_conf_mode_8787_aa
,
34 static struct pnp_info pnp_dev_info
[] = {
35 { NULL
, NCT6776_FDC
, PNP_IO0
| PNP_IRQ0
| PNP_DRQ0
, 0x0ff8 },
36 { NULL
, NCT6776_PP
, PNP_IO0
| PNP_IRQ0
| PNP_DRQ0
, 0x0ff8 },
37 { NULL
, NCT6776_SP1
, PNP_IO0
| PNP_IRQ0
, 0x0ff8 },
38 { NULL
, NCT6776_SP2
, PNP_IO0
| PNP_IRQ0
, 0x0ff8 },
39 { NULL
, NCT6776_KBC
, PNP_IO0
| PNP_IO1
| PNP_IRQ0
| PNP_IRQ1
, 0x0fff, 0x0fff },
40 { NULL
, NCT6776_CIR
, PNP_IO0
| PNP_IRQ0
, 0x0ff8 },
41 { NULL
, NCT6776_ACPI
},
42 { NULL
, NCT6776_HWM_FPLED
, PNP_IO0
| PNP_IO1
| PNP_IRQ0
, 0x0ffe, 0x0ffe },
43 { NULL
, NCT6776_VID
},
44 { NULL
, NCT6776_CIRWKUP
, PNP_IO0
| PNP_IRQ0
, 0x0ff8 },
45 { NULL
, NCT6776_GPIO_PP_OD
},
46 { NULL
, NCT6776_SVID
},
47 { NULL
, NCT6776_DSLP
},
48 { NULL
, NCT6776_GPIOA_LDN
},
49 { NULL
, NCT6776_WDT1
},
50 { NULL
, NCT6776_GPIOBASE
, PNP_IO0
, 0x0ff8 },
51 { NULL
, NCT6776_GPIO0
},
52 { NULL
, NCT6776_GPIO1
},
53 { NULL
, NCT6776_GPIO2
},
54 { NULL
, NCT6776_GPIO3
},
55 { NULL
, NCT6776_GPIO4
},
56 { NULL
, NCT6776_GPIO5
},
57 { NULL
, NCT6776_GPIO6
},
58 { NULL
, NCT6776_GPIO7
},
59 { NULL
, NCT6776_GPIO8
},
60 { NULL
, NCT6776_GPIO9
},
61 { NULL
, NCT6776_GPIOA
},
64 static void enable_dev(struct device
*dev
)
66 pnp_enable_devices(dev
, &ops
, ARRAY_SIZE(pnp_dev_info
), pnp_dev_info
);
69 struct chip_operations superio_nuvoton_nct6776_ops
= {
70 .name
= "NUVOTON NCT6776 Super I/O",
71 .enable_dev
= enable_dev
,