Stefan Reinauer | 9e7a5d4 | 2010-05-16 14:08:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2008 coresystems GmbH |
| 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; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Stefan Reinauer | 9e7a5d4 | 2010-05-16 14:08:32 +0000 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <stdlib.h> |
| 17 | #include <device/device.h> |
| 18 | #include <device/pnp.h> |
Stefan Reinauer | 9e7a5d4 | 2010-05-16 14:08:32 +0000 | [diff] [blame] | 19 | #include <pc80/keyboard.h> |
Stefan Reinauer | 9e7a5d4 | 2010-05-16 14:08:32 +0000 | [diff] [blame] | 20 | #include "sio10n268.h" |
| 21 | |
Edward O'Callaghan | 2c9d2cf | 2014-10-27 23:29:29 +1100 | [diff] [blame] | 22 | static void init(struct device *dev) |
Stefan Reinauer | 9e7a5d4 | 2010-05-16 14:08:32 +0000 | [diff] [blame] | 23 | { |
Uwe Hermann | a69d978 | 2010-11-15 19:35:14 +0000 | [diff] [blame] | 24 | if (!dev->enabled) |
Stefan Reinauer | 9e7a5d4 | 2010-05-16 14:08:32 +0000 | [diff] [blame] | 25 | return; |
Stefan Reinauer | 9e7a5d4 | 2010-05-16 14:08:32 +0000 | [diff] [blame] | 26 | |
| 27 | switch (dev->path.pnp.device) { |
| 28 | case SIO10N268_FDC: /* TODO. */ |
| 29 | break; |
| 30 | case SIO10N268_PP: /* TODO. */ |
| 31 | break; |
| 32 | case SIO10N268_KBDC: |
| 33 | /* TODO: This is still hardcoded. */ |
Timothy Pearson | 448e386 | 2015-11-24 14:12:01 -0600 | [diff] [blame] | 34 | pc_keyboard_init(NO_AUX_DEVICE); |
Stefan Reinauer | 9e7a5d4 | 2010-05-16 14:08:32 +0000 | [diff] [blame] | 35 | break; |
| 36 | // [..] The rest: TODO |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | static struct device_operations ops = { |
| 41 | .read_resources = pnp_read_resources, |
| 42 | .set_resources = pnp_set_resources, |
| 43 | .enable_resources = pnp_enable_resources, |
| 44 | .enable = pnp_enable, |
| 45 | .init = init, |
| 46 | }; |
| 47 | |
| 48 | /* TODO: FDC, PP, AUX. */ |
| 49 | static struct pnp_info pnp_dev_info[] = { |
Felix Held | b0d868e | 2018-07-06 23:39:00 +0200 | [diff] [blame] | 50 | { NULL, SIO10N268_KBDC, PNP_IO0 | PNP_IO1, 0x07f8, 0x07f8, }, |
Stefan Reinauer | 9e7a5d4 | 2010-05-16 14:08:32 +0000 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | static void enable_dev(struct device *dev) |
| 54 | { |
Felix Held | b0d868e | 2018-07-06 23:39:00 +0200 | [diff] [blame] | 55 | pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); |
Stefan Reinauer | 9e7a5d4 | 2010-05-16 14:08:32 +0000 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | struct chip_operations superio_smsc_sio10n268_ops = { |
| 59 | CHIP_NAME("SMSC SIO10N268 Super I/O") |
| 60 | .enable_dev = enable_dev, |
| 61 | }; |