blob: da998d0197691a0c17432076fdde01309a6eb9bf [file] [log] [blame]
Marc Jones43882f12010-09-10 22:13:34 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2010 Marc Jones <marcj303@gmail.com>
5 * Copyright (C) 2008 Corey Osgood <corey.osgood@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
Marc Jones43882f12010-09-10 22:13:34 +000016 */
17
Marc Jones43882f12010-09-10 22:13:34 +000018#include <device/device.h>
19#include <device/pnp.h>
Nico Huber1c811282013-06-15 20:33:44 +020020#include <superio/conf_mode.h>
Marc Jones43882f12010-09-10 22:13:34 +000021#include <stdlib.h>
Marc Jones43882f12010-09-10 22:13:34 +000022#include "f71859.h"
23
Edward O'Callaghanf21bdc32014-10-21 07:43:41 +110024static void f71859_init(struct device *dev)
Marc Jones43882f12010-09-10 22:13:34 +000025{
Marc Jones43882f12010-09-10 22:13:34 +000026 if (!dev->enabled)
27 return;
28
Marc Jones43882f12010-09-10 22:13:34 +000029 /* TODO: Might potentially need code for HWM or FDC etc. */
Marc Jones43882f12010-09-10 22:13:34 +000030}
31
Marc Jones43882f12010-09-10 22:13:34 +000032static struct device_operations ops = {
33 .read_resources = pnp_read_resources,
Nico Huber0b2ee932013-06-15 19:58:35 +020034 .set_resources = pnp_set_resources,
35 .enable_resources = pnp_enable_resources,
36 .enable = pnp_alt_enable,
Marc Jones43882f12010-09-10 22:13:34 +000037 .init = f71859_init,
Nico Huber1c811282013-06-15 20:33:44 +020038 .ops_pnp_mode = &pnp_conf_mode_8787_aa,
Marc Jones43882f12010-09-10 22:13:34 +000039};
40
41static struct pnp_info pnp_dev_info[] = {
Uwe Hermanna69d9782010-11-15 19:35:14 +000042 /* TODO: Some of the 0x07f8 etc. values may not be correct. */
Felix Held8ac8ac62018-07-06 21:43:34 +020043 { NULL, F71859_SP1, PNP_IO0 | PNP_IRQ0, 0x07f8, },
Marc Jones43882f12010-09-10 22:13:34 +000044};
45
Edward O'Callaghanf21bdc32014-10-21 07:43:41 +110046static void enable_dev(struct device *dev)
Marc Jones43882f12010-09-10 22:13:34 +000047{
48 pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
49}
50
51struct chip_operations superio_fintek_f71859_ops = {
52 CHIP_NAME("Fintek F71859 Super I/O")
53 .enable_dev = enable_dev
54};