coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
superio.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <device/device.h>
4 #include <device/pnp.h>
5 
6 #include "pc87382.h"
7 
8 static void init(struct device *dev)
9 {
10  if (!dev->enabled)
11  return;
12 
13  switch (dev->path.pnp.device) {
14  case PC87382_DOCK:
15  break;
16 
17  case PC87382_GPIO:
18  break;
19  }
20 }
21 
22 static struct device_operations ops = {
24  .set_resources = pnp_set_resources,
25  .enable_resources = pnp_enable_resources,
26  .enable = pnp_enable,
27  .init = init,
28 };
29 
30 static struct pnp_info pnp_dev_info[] = {
32  0x07f8 },
33  { NULL, PC87382_SP1, PNP_IO0 | PNP_IRQ0, 0x07f8 },
34  { NULL, PC87382_GPIO, PNP_IO0 | PNP_IRQ0, 0xfff0 },
35  { NULL, PC87382_DOCK, PNP_IO0 | PNP_IRQ0, 0xfffe },
36 };
37 
38 static void enable_dev(struct device *dev)
39 {
41 }
42 
44  CHIP_NAME("NSC PC87382 Docking LPC Switch")
45  .enable_dev = enable_dev,
46 };
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define CHIP_NAME(X)
Definition: device.h:32
static void enable_dev(struct device *dev)
Definition: superio.c:38
static struct device_operations ops
Definition: superio.c:22
static struct pnp_info pnp_dev_info[]
Definition: superio.c:30
struct chip_operations superio_nsc_pc87382_ops
Definition: superio.c:43
static void init(struct device *dev)
Definition: superio.c:8
#define PC87382_GPIO
Definition: pc87382.h:8
#define PC87382_IR
Definition: pc87382.h:6
#define PC87382_DOCK
Definition: pc87382.h:9
#define PC87382_SP1
Definition: pc87382.h:7
#define PNP_DRQ0
Definition: pnp.h:49
#define PNP_IO0
Definition: pnp.h:42
#define PNP_IRQ0
Definition: pnp.h:47
#define PNP_DRQ1
Definition: pnp.h:50
void pnp_enable(struct device *dev)
Definition: pnp_device.c:181
void pnp_read_resources(struct device *dev)
Definition: pnp_device.c:114
void pnp_enable_devices(struct device *base_dev, struct device_operations *ops, unsigned int functions, struct pnp_info *info)
Definition: pnp_device.c:371
void pnp_set_resources(struct device *dev)
Definition: pnp_device.c:157
void pnp_enable_resources(struct device *dev)
Definition: pnp_device.c:173
#define NULL
Definition: stddef.h:19
void(* read_resources)(struct device *dev)
Definition: device.h:39
struct pnp_path pnp
Definition: path.h:117
Definition: device.h:107
struct device_path path
Definition: device.h:115
unsigned int enabled
Definition: device.h:122
Definition: pnp.h:37
unsigned int device
Definition: path.h:59