blob: a4759fb7211e5c9642ad54eb5e63858ef6fa09cc [file] [log] [blame]
Felix Held3f3eca92020-01-23 17:12:32 +01001/* SPDX-License-Identifier: GPL-2.0-or-later */
Patrick Rudolph45766002018-03-27 15:58:38 +02002
3#include <arch/io.h>
Patrick Rudolph9bd60152018-05-04 09:01:38 +02004#include <console/console.h>
Patrick Rudolph45766002018-03-27 15:58:38 +02005#include <device/device.h>
6#include <device/pnp.h>
Patrick Rudolph9bd60152018-05-04 09:01:38 +02007#include <option.h>
Patrick Rudolph45766002018-03-27 15:58:38 +02008#include <pc80/keyboard.h>
Patrick Rudolph45766002018-03-27 15:58:38 +02009#include <superio/conf_mode.h>
Furquan Shaikh76cedd22020-05-02 10:24:23 -070010#include <acpi/acpi.h>
11#include <acpi/acpigen.h>
Patrick Rudolphe1498ce2020-02-12 15:23:05 +010012#include <superio/common/ssdt.h>
13#include <stdlib.h>
Patrick Rudolph45766002018-03-27 15:58:38 +020014
15#include "npcd378.h"
16
Patrick Rudolph9bd60152018-05-04 09:01:38 +020017uint8_t npcd378_hwm_read(const uint16_t iobase, const uint16_t reg)
18{
19 outb((reg >> 8) & 0xf, iobase + 0xff);
20 uint8_t reg8 = inb(iobase + (reg & 0xff));
21 if (reg8 == 0xff)
22 reg8 = inb(iobase + (reg & 0xff));
23
24 outb(0, iobase + 0xff);
25 return reg8;
26}
27
Elyes HAOUAS7774de52020-03-30 16:46:18 +020028void npcd378_hwm_write(const uint16_t iobase, const uint16_t reg, const uint8_t val)
Patrick Rudolph9bd60152018-05-04 09:01:38 +020029{
30 outb((reg >> 8) & 0xf, iobase + 0xff);
31 outb(val, iobase + (reg & 0xff));
32
33 outb(0, iobase + 0xff);
34}
35
36void npcd378_hwm_write_start(const uint16_t iobase)
37{
38 u8 reg8 = npcd378_hwm_read(iobase, NPCD837_HWM_WRITE_LOCK_CTRL);
39 reg8 &= ~NPCD837_HWM_WRITE_LOCK_BIT;
40 npcd378_hwm_write(iobase, NPCD837_HWM_WRITE_LOCK_CTRL, reg8);
41}
42
43void npcd378_hwm_write_finished(const uint16_t iobase)
44{
45 u8 reg8 = npcd378_hwm_read(iobase, NPCD837_HWM_WRITE_LOCK_CTRL);
46 reg8 |= NPCD837_HWM_WRITE_LOCK_BIT;
47 npcd378_hwm_write(iobase, NPCD837_HWM_WRITE_LOCK_CTRL, reg8);
48}
49
Patrick Rudolph45766002018-03-27 15:58:38 +020050static void npcd378_init(struct device *dev)
51{
Patrick Rudolph9bd60152018-05-04 09:01:38 +020052 struct resource *res;
Patrick Rudolph9bd60152018-05-04 09:01:38 +020053
Patrick Rudolph45766002018-03-27 15:58:38 +020054 if (!dev->enabled)
55 return;
56
57 switch (dev->path.pnp.device) {
Patrick Rudolph9bd60152018-05-04 09:01:38 +020058 /* TODO: Might potentially need code for FDC etc. */
Patrick Rudolph45766002018-03-27 15:58:38 +020059 case NPCD378_KBC:
60 pc_keyboard_init(PROBE_AUX_DEVICE);
61 break;
Patrick Rudolph9bd60152018-05-04 09:01:38 +020062 case NPCD378_HWM:
Angel Ponsc167b742021-11-03 13:25:02 +010063 res = probe_resource(dev, PNP_IDX_IO0);
Patrick Rudolph9bd60152018-05-04 09:01:38 +020064 if (!res || !res->base) {
Elyes HAOUAS7774de52020-03-30 16:46:18 +020065 printk(BIOS_ERR, "NPCD378: LDN%u IOBASE not set.\n", NPCD378_HWM);
Patrick Rudolph9bd60152018-05-04 09:01:38 +020066 break;
67 }
68
69 npcd378_hwm_write_start(res->base);
70
Angel Pons88dcb312021-04-26 17:10:28 +020071 unsigned int fan_lvl = get_uint_option("psu_fan_lvl", 3);
Angel Ponsa35f1812021-04-26 16:49:40 +020072 if (fan_lvl > 7)
Patrick Rudolph9bd60152018-05-04 09:01:38 +020073 fan_lvl = 3;
74
Angel Pons5a19f7e2021-04-19 15:04:22 +020075 uint8_t pwm = NPCD378_HWM_PSU_FAN_MIN +
Patrick Rudolph9bd60152018-05-04 09:01:38 +020076 (NPCD378_HWM_PSU_FAN_MAX - NPCD378_HWM_PSU_FAN_MIN) *
77 fan_lvl / 7;
78
79 /* Set PSU fan PWM lvl */
80 npcd378_hwm_write(res->base, NPCD378_HWM_PSU_FAN_PWM_CTRL, pwm);
81 printk(BIOS_INFO, "NPCD378: PSU fan PWM 0x%02x\n", pwm);
82
83 npcd378_hwm_write_finished(res->base);
84 break;
Patrick Rudolph45766002018-03-27 15:58:38 +020085 }
86}
87
Julius Wernercd49cce2019-03-05 16:53:33 -080088#if CONFIG(HAVE_ACPI_TABLES)
Patrick Rudolphe1498ce2020-02-12 15:23:05 +010089/* Provide ACPI HIDs for generic Super I/O SSDT */
90static const char *npcd378_acpi_hid(const struct device *dev)
Patrick Rudolph9ae150a2018-07-17 11:41:10 +020091{
Patrick Rudolphe1498ce2020-02-12 15:23:05 +010092 /* Sanity checks */
93 if (dev->path.type != DEVICE_PATH_PNP)
94 return NULL;
95 if (dev->path.pnp.port == 0)
96 return NULL;
97 if ((dev->path.pnp.device & 0xff) > NPCD378_GPIOA)
98 return NULL;
Patrick Rudolph9ae150a2018-07-17 11:41:10 +020099
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100100 switch (dev->path.pnp.device & 0xff) {
101 case NPCD378_FDC:
102 return ACPI_HID_FDC;
103 case NPCD378_PP:
104 return ACPI_HID_LPT;
105 case NPCD378_SP1: /* fallthrough */
106 case NPCD378_SP2:
107 return ACPI_HID_COM;
108 case NPCD378_AUX:
109 return ACPI_HID_MOUSE;
110 case NPCD378_KBC:
111 return ACPI_HID_KEYBOARD;
112 default:
113 return ACPI_HID_PNP;
Patrick Rudolph9ae150a2018-07-17 11:41:10 +0200114 }
115}
116
Furquan Shaikh7536a392020-04-24 21:59:21 -0700117static void npcd378_ssdt_aux(const struct device *dev)
Patrick Rudolph9ae150a2018-07-17 11:41:10 +0200118{
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100119 /* Scope */
120 acpigen_write_scope(acpi_device_path(dev));
121
122 acpigen_write_method("_PSW", 1);
123 acpigen_write_store();
124 acpigen_emit_byte(ARG0_OP);
125 acpigen_emit_namestring("^^MSFG");
126 acpigen_pop_len(); /* Pop Method */
127
128 acpigen_write_PRW(8, 3);
129
130 acpigen_pop_len(); /* Pop Scope */
131}
132
Furquan Shaikh7536a392020-04-24 21:59:21 -0700133static void npcd378_ssdt_kbc(const struct device *dev)
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100134{
135 /* Scope */
136 acpigen_write_scope(acpi_device_path(dev));
137
138 acpigen_write_method("_PSW", 1);
139 acpigen_write_store();
140 acpigen_emit_byte(ARG0_OP);
141 acpigen_emit_namestring("^^KBFG");
142 acpigen_pop_len(); /* Pop Method */
143
144 acpigen_write_PRW(8, 3);
145
146 acpigen_pop_len(); /* Pop Scope */
147}
148
Furquan Shaikh7536a392020-04-24 21:59:21 -0700149static void npcd378_ssdt_pwr(const struct device *dev)
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100150{
151 const char *name = acpi_device_path(dev);
152 const char *scope = acpi_device_scope(dev);
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100153
154 /* Scope */
155 acpigen_write_scope(name);
156
157 acpigen_emit_ext_op(OPREGION_OP);
158 acpigen_emit_namestring("SWCR");
159 acpigen_emit_byte(SYSTEMIO);
160 acpigen_emit_namestring("IO0B");
161 acpigen_emit_namestring("IO0S");
162
163 struct fieldlist l1[] = {
164 FIELDLIST_OFFSET(0),
165 FIELDLIST_NAMESTR("LEDC", 8),
166 FIELDLIST_NAMESTR("SWCC", 8),
167 };
168
169 acpigen_write_field("SWCR", l1, ARRAY_SIZE(l1), FIELD_BYTEACC |
170 FIELD_NOLOCK | FIELD_PRESERVE);
171
172 acpigen_emit_ext_op(OPREGION_OP);
173 acpigen_emit_namestring("RNTR");
174 acpigen_emit_byte(SYSTEMIO);
175 acpigen_emit_namestring("IO1B");
176 acpigen_emit_namestring("IO1S");
177
178 struct fieldlist l2[] = {
179 FIELDLIST_OFFSET(0),
180 FIELDLIST_NAMESTR("GPES", 8),
181 FIELDLIST_NAMESTR("GPEE", 8),
182 FIELDLIST_OFFSET(8),
183 FIELDLIST_NAMESTR("GPS0", 8),
184 FIELDLIST_NAMESTR("GPS1", 8),
185 FIELDLIST_NAMESTR("GPS2", 8),
186 FIELDLIST_NAMESTR("GPS3", 8),
187 FIELDLIST_NAMESTR("GPE0", 8),
188 FIELDLIST_NAMESTR("GPE1", 8),
189 FIELDLIST_NAMESTR("GPE2", 8),
190 FIELDLIST_NAMESTR("GPE3", 8),
191 };
192
193 acpigen_write_field("RNTR", l2, ARRAY_SIZE(l2), FIELD_BYTEACC |
194 FIELD_NOLOCK | FIELD_PRESERVE);
195
196 /* Method (SIOW, 1, NotSerialized) */
197 acpigen_write_method("SIOW", 1);
198 acpigen_write_store();
199 acpigen_emit_namestring("^GPS2");
200 acpigen_emit_namestring("^^PMFG");
201
202 acpigen_write_store();
203 acpigen_emit_byte(ZERO_OP);
204 acpigen_emit_namestring("^GPEE");
205
206 acpigen_write_store();
207 acpigen_emit_byte(ZERO_OP);
208 acpigen_emit_namestring("^GPE0");
209
210 acpigen_write_store();
211 acpigen_emit_byte(ZERO_OP);
212 acpigen_emit_namestring("^GPE1");
213
214 acpigen_emit_byte(AND_OP);
215 acpigen_emit_namestring("^LEDC");
216 acpigen_write_integer(0xE0);
217 acpigen_emit_byte(LOCAL0_OP);
218
219 acpigen_emit_byte(OR_OP);
220 acpigen_emit_byte(LOCAL0_OP);
221 acpigen_write_integer(0x1E);
222 acpigen_emit_namestring("^LEDC");
223
224 acpigen_emit_byte(AND_OP);
225 acpigen_emit_namestring("^SWCC");
226 acpigen_write_integer(0xBF);
227 acpigen_emit_namestring("^SWCC");
228
229 acpigen_pop_len(); /* SIOW method */
230
231 /* Method (SIOS, 1, NotSerialized) */
232 acpigen_write_method("SIOS", 1);
233
234 acpigen_write_if();
235 acpigen_emit_byte(LNOT_OP);
236 acpigen_emit_byte(LEQUAL_OP);
237 acpigen_emit_byte(ARG0_OP);
238 acpigen_write_integer(5);
239
240 acpigen_write_if();
241 acpigen_emit_byte(LEQUAL_OP);
242 acpigen_emit_namestring("^^KBFG");
243 acpigen_emit_byte(ONE_OP);
244
245 acpigen_emit_byte(OR_OP);
246 acpigen_emit_namestring("^GPE2");
247 acpigen_write_integer(0xE8);
248 acpigen_emit_namestring("^GPE2");
249
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100250 acpigen_write_else();
251
252 acpigen_emit_byte(AND_OP);
253 acpigen_emit_namestring("^GPE2");
254 acpigen_write_integer(0x17);
255 acpigen_emit_namestring("^GPE2");
256
257 acpigen_pop_len(); /* Pop Else */
258
259 acpigen_write_if();
260 acpigen_emit_byte(LEQUAL_OP);
261 acpigen_emit_namestring("^^MSFG");
262 acpigen_emit_byte(ONE_OP);
263
264 acpigen_emit_byte(OR_OP);
265 acpigen_emit_namestring("^GPE2");
266 acpigen_write_integer(0x10);
267 acpigen_emit_namestring("^GPE2");
268
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100269 acpigen_write_else();
270
271 acpigen_emit_byte(AND_OP);
272 acpigen_emit_namestring("^GPE2");
273 acpigen_write_integer(0xEF);
274 acpigen_emit_namestring("^GPE2");
275
276 acpigen_pop_len(); /* Pop Else */
277
278 /* Enable wake on GPE */
279 acpigen_write_store();
280 acpigen_emit_byte(ONE_OP);
281 acpigen_emit_namestring("^GPEE");
282
283 acpigen_write_if();
284 acpigen_emit_byte(LEQUAL_OP);
285 acpigen_emit_byte(ARG0_OP);
286 acpigen_write_integer(3);
287
288 acpigen_emit_byte(AND_OP);
289 acpigen_emit_namestring("^LEDC");
290 acpigen_write_integer(0xE0);
291 acpigen_emit_byte(LOCAL0_OP);
292
293 acpigen_emit_byte(OR_OP);
294 acpigen_emit_byte(LOCAL0_OP);
295 acpigen_write_integer(0x1C);
296 acpigen_emit_namestring("^LEDC");
297
298 acpigen_emit_byte(AND_OP);
299 acpigen_emit_namestring("^SWCC");
300 acpigen_write_integer(0xBF);
301 acpigen_emit_byte(LOCAL0_OP);
302
303 acpigen_emit_byte(OR_OP);
304 acpigen_emit_byte(LOCAL0_OP);
305 acpigen_write_integer(0x40);
306 acpigen_emit_namestring("^SWCC");
307
308 acpigen_pop_len(); /* Pop If */
309
310 acpigen_pop_len(); /* Pop If */
311
312 acpigen_write_store();
313 acpigen_write_integer(0x10);
314 acpigen_emit_namestring("^GPE0");
315
316 acpigen_write_store();
317 acpigen_write_integer(0x20);
318 acpigen_emit_namestring("^GPE1");
319
320 acpigen_pop_len(); /* Pop SIOS method */
321
322 acpigen_pop_len(); /* Pop Scope */
323
324 /* Inject into parent: */
John Zhao8f5fbb02020-06-26 10:38:42 -0700325 if (!scope) {
326 printk(BIOS_ERR, "%s: Missing ACPI path/scope\n", dev_path(dev));
327 return;
328 }
329 acpigen_write_scope(scope);
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100330
331 acpigen_write_name_integer("MSFG", 1);
332 acpigen_write_name_integer("KBFG", 1);
333 acpigen_write_name_integer("PMFG", 0);
334
335 /* DSDT must call SIOW on _WAK */
336 /* Method (SIOW, 1, NotSerialized) */
337 acpigen_write_method("SIOW", 1);
338 acpigen_emit_byte(RETURN_OP);
Arthur Heymans0a0945c2023-11-07 11:01:34 +0100339 acpigen_emit_namestring(acpi_device_path_join(dev, "SIOW"));
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100340
341 acpigen_emit_byte(ARG0_OP);
342 acpigen_pop_len();
343
344 /* DSDT must call SIOS on _PTS */
345 /* Method (SIOS, 1, NotSerialized) */
346 acpigen_write_method("SIOS", 1);
347 acpigen_emit_byte(RETURN_OP);
Arthur Heymans0a0945c2023-11-07 11:01:34 +0100348 acpigen_emit_namestring(acpi_device_path_join(dev, "SIOS"));
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100349 acpigen_emit_byte(ARG0_OP);
350 acpigen_pop_len(); /* Pop Method */
351
352 acpigen_pop_len(); /* Scope */
353
354 acpigen_write_scope("\\_GPE");
355
356 /* Method (SIOH, 0, NotSerialized) */
357 acpigen_write_method("_L08", 0);
358 acpigen_emit_byte(AND_OP);
Riku Viitanen5eb95ee32023-12-15 22:46:20 +0200359 acpigen_emit_namestring(acpi_device_path_join(dev->bus->dev, "PMFG"));
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100360 acpigen_write_integer(0xE8);
361 acpigen_emit_byte(LOCAL0_OP);
362
363 acpigen_write_if();
364 acpigen_emit_byte(LGREATER_OP);
365 acpigen_emit_byte(LOCAL0_OP);
366 acpigen_emit_byte(ZERO_OP);
367
368 acpigen_emit_byte(NOTIFY_OP);
Riku Viitanen5eb95ee32023-12-15 22:46:20 +0200369 acpigen_emit_namestring(acpi_device_path_join(dev->bus->dev, "L060"));
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100370 acpigen_write_integer(2);
371
372 acpigen_pop_len(); /* Pop If */
373
374 acpigen_emit_byte(AND_OP);
Riku Viitanen5eb95ee32023-12-15 22:46:20 +0200375 acpigen_emit_namestring(acpi_device_path_join(dev->bus->dev, "PMFG"));
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100376 acpigen_write_integer(0x10);
377 acpigen_emit_byte(LOCAL0_OP);
378
379 acpigen_write_if();
380 acpigen_emit_byte(LGREATER_OP);
381 acpigen_emit_byte(LOCAL0_OP);
382 acpigen_emit_byte(ZERO_OP);
383
384 acpigen_emit_byte(NOTIFY_OP);
Riku Viitanen5eb95ee32023-12-15 22:46:20 +0200385 acpigen_emit_namestring(acpi_device_path_join(dev->bus->dev, "L050"));
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100386 acpigen_write_integer(2);
387 acpigen_pop_len(); /* Pop If */
388
389 acpigen_pop_len(); /* Pop Method */
390
391 acpigen_pop_len(); /* Scope */
392}
393
Furquan Shaikh7536a392020-04-24 21:59:21 -0700394static void npcd378_fill_ssdt_generator(const struct device *dev)
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100395{
John Zhao8f5fbb02020-06-26 10:38:42 -0700396 if (!dev)
397 return;
398
Patrick Rudolphe1498ce2020-02-12 15:23:05 +0100399 superio_common_fill_ssdt_generator(dev);
400
401 switch (dev->path.pnp.device) {
402 case NPCD378_PWR:
403 npcd378_ssdt_pwr(dev);
404 break;
405 case NPCD378_AUX:
406 npcd378_ssdt_aux(dev);
407 break;
408 case NPCD378_KBC:
409 npcd378_ssdt_kbc(dev);
410 break;
411 }
Patrick Rudolph9ae150a2018-07-17 11:41:10 +0200412}
413#endif
414
Patrick Rudolph45766002018-03-27 15:58:38 +0200415static struct device_operations ops = {
Nico Huber68680dd2020-03-31 17:34:52 +0200416 .read_resources = pnp_read_resources,
417 .set_resources = pnp_set_resources,
418 .enable_resources = pnp_enable_resources,
419 .enable = pnp_alt_enable,
420 .init = npcd378_init,
421 .ops_pnp_mode = &pnp_conf_mode_8787_aa,
Julius Wernercd49cce2019-03-05 16:53:33 -0800422#if CONFIG(HAVE_ACPI_TABLES)
Nico Huber68680dd2020-03-31 17:34:52 +0200423 .acpi_fill_ssdt = npcd378_fill_ssdt_generator,
424 .acpi_name = superio_common_ldn_acpi_name,
425 .acpi_hid = npcd378_acpi_hid,
Patrick Rudolph9ae150a2018-07-17 11:41:10 +0200426#endif
Patrick Rudolph45766002018-03-27 15:58:38 +0200427};
428
429static struct pnp_info pnp_dev_info[] = {
Felix Held9911d642018-07-06 20:55:53 +0200430 { NULL, NPCD378_FDC, PNP_IO0|PNP_IRQ0|PNP_DRQ0, 0x0ff8, },
431 { NULL, NPCD378_PP, PNP_IO0|PNP_IRQ0|PNP_DRQ0, 0x0ff8, },
432 { NULL, NPCD378_SP1, PNP_IO0|PNP_IRQ0, 0x0ff8, },
433 { NULL, NPCD378_SP2, PNP_IO0|PNP_IRQ0, 0x0ff8, },
434 { NULL, NPCD378_PWR, PNP_IO0|PNP_IO1|PNP_IRQ0|PNP_MSC0|
Patrick Rudolph45766002018-03-27 15:58:38 +0200435 PNP_MSC1|PNP_MSC2|PNP_MSC3|PNP_MSC4|PNP_MSC5|PNP_MSC6|PNP_MSC7|
436 PNP_MSC8|PNP_MSC9|PNP_MSCA|PNP_MSCB|PNP_MSCC|PNP_MSCD|PNP_MSCE,
Patrick Rudolph61c3b592018-07-17 11:36:15 +0200437 0x0ff8, 0x0ff0},
Felix Held9911d642018-07-06 20:55:53 +0200438 { NULL, NPCD378_AUX, PNP_IRQ0, 0x0fff, 0x0fff, },
439 { NULL, NPCD378_KBC, PNP_IO0|PNP_IO1|PNP_IRQ0,
Patrick Rudolph45766002018-03-27 15:58:38 +0200440 0x0fff, 0x0fff, },
Felix Held9911d642018-07-06 20:55:53 +0200441 { NULL, NPCD378_WDT1, PNP_IO0|PNP_MSC8|PNP_MSC9|
Patrick Rudolph61c3b592018-07-17 11:36:15 +0200442 PNP_MSCA|PNP_MSCB|PNP_MSCC|PNP_MSCD|PNP_MSCE, 0x0fe0},
Felix Held9911d642018-07-06 20:55:53 +0200443 { NULL, NPCD378_HWM, PNP_IO0|PNP_MSC0|PNP_MSC1|PNP_MSC2|PNP_MSC3|
Patrick Rudolph61c3b592018-07-17 11:36:15 +0200444 PNP_MSC4|PNP_MSC5|PNP_MSC6|PNP_MSC7|PNP_IRQ0, 0x0f00},
Felix Held9911d642018-07-06 20:55:53 +0200445 { NULL, NPCD378_GPIO_PP_OD, PNP_MSC0|PNP_MSC1|PNP_MSC2|PNP_MSC3|
Patrick Rudolph45766002018-03-27 15:58:38 +0200446 PNP_MSC4|PNP_MSC5|PNP_MSC6|PNP_MSC7|PNP_MSC8|PNP_MSC9|PNP_MSCA|
447 PNP_MSCB|PNP_MSCC|PNP_MSCD|PNP_MSCE},
Felix Held9911d642018-07-06 20:55:53 +0200448 { NULL, NPCD378_I2C, PNP_IO0|PNP_IO1|PNP_IRQ0|PNP_MSC0|
Patrick Rudolph45766002018-03-27 15:58:38 +0200449 PNP_MSC1|PNP_MSC2|PNP_MSC3|PNP_MSC4|PNP_MSC5|PNP_MSC6|PNP_MSC7|
450 PNP_MSC8|PNP_MSC9|PNP_MSCA|PNP_MSCB|PNP_MSCC|PNP_MSCD|PNP_MSCE,
Patrick Rudolph61c3b592018-07-17 11:36:15 +0200451 0x0ff0, 0x0ff0},
452 { NULL, NPCD378_SUSPEND, PNP_IO0, 0x0fe0 },
Felix Held9911d642018-07-06 20:55:53 +0200453 { NULL, NPCD378_GPIOA, PNP_IO0|PNP_MSC0|PNP_MSC1|PNP_MSC2|PNP_MSC3|
Patrick Rudolph61c3b592018-07-17 11:36:15 +0200454 PNP_MSC4, 0x0fe0},
Patrick Rudolph45766002018-03-27 15:58:38 +0200455};
456
457static void enable_dev(struct device *dev)
458{
459 pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
460}
461
462struct chip_operations superio_nuvoton_npcd378_ops = {
Nicholas Sudsgaardbfb11be2024-01-30 09:53:46 +0900463 .name = "NUVOTON NPCD378 Super I/O",
Patrick Rudolph45766002018-03-27 15:58:38 +0200464 .enable_dev = enable_dev,
465};