blob: 100257bd7ad645df5397769baeece7232096afc8 [file] [log] [blame]
Lee Leahyac690b12016-05-15 15:12:56 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2016 Intel Corporation.
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.
14 */
15
Aaron Durbin64031672018-04-21 14:45:32 -060016#include <compiler.h>
Lee Leahyac690b12016-05-15 15:12:56 -070017#include <console/console.h>
18#include <delay.h>
19#include <device/device.h>
Nico Huber0f2dd1e2017-08-01 14:02:40 +020020#include <device/i2c_simple.h>
Lee Leahyac690b12016-05-15 15:12:56 -070021#include <device/pci.h>
22#include <device/pci_ids.h>
23#include <soc/i2c.h>
24#include <soc/ramstage.h>
25#include <soc/reg_access.h>
26
Elyes HAOUAS696545d2018-05-25 13:11:37 +020027__weak void mainboard_gpio_i2c_init(struct device *dev)
Lee Leahyac690b12016-05-15 15:12:56 -070028{
29 /* Initialize any of the GPIOs or I2C devices */
30 printk(BIOS_SPEW, "WEAK; mainboard_gpio_i2c_init\n");
31}
32
33static struct device_operations device_ops = {
34 .read_resources = pci_dev_read_resources,
35 .set_resources = pci_dev_set_resources,
36 .enable_resources = pci_dev_enable_resources,
37 .init = mainboard_gpio_i2c_init,
38};
39
40static const struct pci_driver gfx_driver __pci_driver = {
41 .ops = &device_ops,
42 .vendor = PCI_VENDOR_ID_INTEL,
43 .device = I2CGPIO_DEVID,
44};