blob: 1f4424954f71560bce95f81f14aadba4a39d8caa [file] [log] [blame]
Felix Held3f3eca92020-01-23 17:12:32 +01001/* SPDX-License-Identifier: GPL-2.0-or-later */
Marc Jones43882f12010-09-10 22:13:34 +00002
Marc Jones43882f12010-09-10 22:13:34 +00003#include <device/device.h>
4#include <device/pnp.h>
Nico Huber1c811282013-06-15 20:33:44 +02005#include <superio/conf_mode.h>
Marc Jones43882f12010-09-10 22:13:34 +00006#include "f71859.h"
7
Edward O'Callaghanf21bdc32014-10-21 07:43:41 +11008static void f71859_init(struct device *dev)
Marc Jones43882f12010-09-10 22:13:34 +00009{
Marc Jones43882f12010-09-10 22:13:34 +000010 if (!dev->enabled)
11 return;
12
Marc Jones43882f12010-09-10 22:13:34 +000013 /* TODO: Might potentially need code for HWM or FDC etc. */
Marc Jones43882f12010-09-10 22:13:34 +000014}
15
Marc Jones43882f12010-09-10 22:13:34 +000016static struct device_operations ops = {
17 .read_resources = pnp_read_resources,
Nico Huber0b2ee932013-06-15 19:58:35 +020018 .set_resources = pnp_set_resources,
19 .enable_resources = pnp_enable_resources,
20 .enable = pnp_alt_enable,
Marc Jones43882f12010-09-10 22:13:34 +000021 .init = f71859_init,
Nico Huber1c811282013-06-15 20:33:44 +020022 .ops_pnp_mode = &pnp_conf_mode_8787_aa,
Marc Jones43882f12010-09-10 22:13:34 +000023};
24
25static struct pnp_info pnp_dev_info[] = {
Uwe Hermanna69d9782010-11-15 19:35:14 +000026 /* TODO: Some of the 0x07f8 etc. values may not be correct. */
Felix Held8ac8ac62018-07-06 21:43:34 +020027 { NULL, F71859_SP1, PNP_IO0 | PNP_IRQ0, 0x07f8, },
Marc Jones43882f12010-09-10 22:13:34 +000028};
29
Edward O'Callaghanf21bdc32014-10-21 07:43:41 +110030static void enable_dev(struct device *dev)
Marc Jones43882f12010-09-10 22:13:34 +000031{
32 pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
33}
34
35struct chip_operations superio_fintek_f71859_ops = {
36 CHIP_NAME("Fintek F71859 Super I/O")
37 .enable_dev = enable_dev
38};