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. */ |
Edward O'Callaghan | def00be | 2014-04-30 05:01:52 +1000 | [diff] [blame] | 34 | pc_keyboard_init(); |
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[] = { |
Uwe Hermann | a69d978 | 2010-11-15 19:35:14 +0000 | [diff] [blame] | 50 | { &ops, SIO10N268_KBDC, PNP_IO0 | PNP_IO1, {0x07f8, 0}, {0x07f8, 4}, }, |
Stefan Reinauer | 9e7a5d4 | 2010-05-16 14:08:32 +0000 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | static void enable_dev(struct device *dev) |
| 54 | { |
| 55 | pnp_enable_devices(dev, &pnp_ops, |
| 56 | ARRAY_SIZE(pnp_dev_info), pnp_dev_info); |
| 57 | } |
| 58 | |
| 59 | struct chip_operations superio_smsc_sio10n268_ops = { |
| 60 | CHIP_NAME("SMSC SIO10N268 Super I/O") |
| 61 | .enable_dev = enable_dev, |
| 62 | }; |