Sven Schnelle | 071d835 | 2011-03-03 08:29:03 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2011 Sven Schnelle <svens@stackframe.org> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
Sven Schnelle | 071d835 | 2011-03-03 08:29:03 +0000 | [diff] [blame] | 15 | */ |
| 16 | |
Sven Schnelle | 071d835 | 2011-03-03 08:29:03 +0000 | [diff] [blame] | 17 | #include <device/device.h> |
| 18 | #include <device/pnp.h> |
Elyes HAOUAS | 2329a25 | 2019-05-15 22:11:18 +0200 | [diff] [blame] | 19 | |
Sven Schnelle | 071d835 | 2011-03-03 08:29:03 +0000 | [diff] [blame] | 20 | #include "pc87384.h" |
| 21 | |
Sven Schnelle | 071d835 | 2011-03-03 08:29:03 +0000 | [diff] [blame] | 22 | static struct device_operations ops = { |
| 23 | .read_resources = pnp_read_resources, |
| 24 | .set_resources = pnp_set_resources, |
| 25 | .enable_resources = pnp_enable_resources, |
| 26 | .enable = pnp_enable, |
Sven Schnelle | 071d835 | 2011-03-03 08:29:03 +0000 | [diff] [blame] | 27 | }; |
| 28 | |
| 29 | static struct pnp_info pnp_dev_info[] = { |
Felix Held | d5292bf | 2019-01-16 13:23:35 +0100 | [diff] [blame] | 30 | { NULL, PC87384_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, 0x07f8 }, |
Felix Held | faca0bc | 2017-12-27 22:51:29 +0100 | [diff] [blame] | 31 | { NULL, PC87384_SP1, PNP_IO0 | PNP_IRQ0, 0x07f8 }, |
| 32 | { NULL, PC87384_SP2, PNP_IO0 | PNP_IRQ0, 0x07f8 }, |
| 33 | { NULL, PC87384_GPIO, PNP_IO0 | PNP_IRQ0, 0xfff0 }, |
Sven Schnelle | 071d835 | 2011-03-03 08:29:03 +0000 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | static void enable_dev(struct device *dev) |
| 37 | { |
Felix Held | faca0bc | 2017-12-27 22:51:29 +0100 | [diff] [blame] | 38 | pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); |
Sven Schnelle | 071d835 | 2011-03-03 08:29:03 +0000 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | struct chip_operations superio_nsc_pc87384_ops = { |
| 42 | CHIP_NAME("NSC PC87384 Super I/O") |
| 43 | .enable_dev = enable_dev, |
| 44 | }; |