Skip to content

Commit

Permalink
Add PCI attachment for dwiic(4) needed by Intel 100 Series machines
Browse files Browse the repository at this point in the history
ok kettenis
  • Loading branch information
jcs committed Nov 16, 2017
1 parent fd40c22 commit c6df0db
Show file tree
Hide file tree
Showing 13 changed files with 1,454 additions and 1,108 deletions.
6 changes: 4 additions & 2 deletions share/man/man4/dwiic.4
@@ -1,4 +1,4 @@
.\" $OpenBSD: dwiic.4,v 1.2 2016/07/30 15:44:45 jcs Exp $ .\" $OpenBSD: dwiic.4,v 1.3 2017/11/16 18:12:27 jcs Exp $
.\" .\"
.\" Copyright (c) 2016 Jonathan Gray <jsg@openbsd.org> .\" Copyright (c) 2016 Jonathan Gray <jsg@openbsd.org>
.\" .\"
Expand All @@ -14,14 +14,15 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" .\"
.Dd $Mdocdate: July 30 2016 $ .Dd $Mdocdate: November 16 2017 $
.Dt DWIIC 4 .Dt DWIIC 4
.Os .Os
.Sh NAME .Sh NAME
.Nm dwiic .Nm dwiic
.Nd Synopsys DesignWare I2C controller .Nd Synopsys DesignWare I2C controller
.Sh SYNOPSIS .Sh SYNOPSIS
.Cd "dwiic* at acpi?" .Cd "dwiic* at acpi?"
.Cd "dwiic* at pci?"
.Cd "iic* at dwiic?" .Cd "iic* at dwiic?"
.Sh DESCRIPTION .Sh DESCRIPTION
The The
Expand All @@ -33,6 +34,7 @@ framework.
.Sh SEE ALSO .Sh SEE ALSO
.Xr acpi 4 , .Xr acpi 4 ,
.Xr iic 4 .Xr iic 4
.Xr pci 4
.Sh HISTORY .Sh HISTORY
The The
.Nm .Nm
Expand Down
3 changes: 2 additions & 1 deletion sys/arch/amd64/conf/GENERIC
@@ -1,4 +1,4 @@
# $OpenBSD: GENERIC,v 1.447 2017/10/28 01:37:52 yasuoka Exp $ # $OpenBSD: GENERIC,v 1.448 2017/11/16 18:12:27 jcs Exp $
# #
# For further information on compiling OpenBSD kernels, see the config(8) # For further information on compiling OpenBSD kernels, see the config(8)
# man page. # man page.
Expand Down Expand Up @@ -135,6 +135,7 @@ iic* at nviic?
amdpm* at pci? # AMD-7xx/8111 and NForce SMBus controller amdpm* at pci? # AMD-7xx/8111 and NForce SMBus controller
iic* at amdpm? iic* at amdpm?
dwiic* at acpi? # DesignWare Synopsys i2c controller dwiic* at acpi? # DesignWare Synopsys i2c controller
dwiic* at pci?
iic* at dwiic? iic* at dwiic?


itherm* at pci? # Intel 3400 Thermal Sensor itherm* at pci? # Intel 3400 Thermal Sensor
Expand Down
3 changes: 2 additions & 1 deletion sys/arch/amd64/conf/RAMDISK_CD
@@ -1,4 +1,4 @@
# $OpenBSD: RAMDISK_CD,v 1.168 2017/06/14 22:35:43 mikeb Exp $ # $OpenBSD: RAMDISK_CD,v 1.169 2017/11/16 18:12:27 jcs Exp $


machine amd64 machine amd64
maxusers 4 maxusers 4
Expand Down Expand Up @@ -72,6 +72,7 @@ pci* at pchb?
#pcib* at pci? # PCI-ISA bridge #pcib* at pci? # PCI-ISA bridge


dwiic* at acpi? dwiic* at acpi?
dwiic* at pci?
iic* at dwiic? iic* at dwiic?


ihidev* at iic? ihidev* at iic?
Expand Down
6 changes: 5 additions & 1 deletion sys/conf/files
@@ -1,4 +1,4 @@
# $OpenBSD: files,v 1.655 2017/11/14 06:46:43 dlg Exp $ # $OpenBSD: files,v 1.656 2017/11/16 18:12:27 jcs Exp $
# $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $ # $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $


# @(#)files.newconf 7.5 (Berkeley) 5/10/93 # @(#)files.newconf 7.5 (Berkeley) 5/10/93
Expand Down Expand Up @@ -524,6 +524,10 @@ file dev/spdmem.c spdmem
device oaic: scsi device oaic: scsi
file dev/ic/aic6250.c oaic file dev/ic/aic6250.c oaic


# Synopsys DesignWare I2C controller
device dwiic: i2cbus
file dev/ic/dwiic.c dwiic

# legitimate pseudo-devices # legitimate pseudo-devices
pseudo-device vnd: disk pseudo-device vnd: disk
pseudo-device rd: disk pseudo-device rd: disk
Expand Down
10 changes: 7 additions & 3 deletions sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
/* $OpenBSD: acpi.c,v 1.333 2017/11/14 10:17:13 kettenis Exp $ */ /* $OpenBSD: acpi.c,v 1.334 2017/11/16 18:12:27 jcs Exp $ */
/* /*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
Expand Down Expand Up @@ -71,7 +71,7 @@ int acpi_hasprocfvs;


#define ACPIEN_RETRIES 15 #define ACPIEN_RETRIES 15


void acpi_pci_match(struct device *, struct pci_attach_args *); struct aml_node *acpi_pci_match(struct device *, struct pci_attach_args *);
pcireg_t acpi_pci_min_powerstate(pci_chipset_tag_t, pcitag_t); pcireg_t acpi_pci_min_powerstate(pci_chipset_tag_t, pcitag_t);
void acpi_pci_set_powerstate(pci_chipset_tag_t, pcitag_t, int, int); void acpi_pci_set_powerstate(pci_chipset_tag_t, pcitag_t, int, int);
int acpi_pci_notify(struct aml_node *, int, void *); int acpi_pci_notify(struct aml_node *, int, void *);
Expand Down Expand Up @@ -669,7 +669,7 @@ acpi_getpci(struct aml_node *node, void *arg)
return (1); return (1);
} }


void struct aml_node *
acpi_pci_match(struct device *dev, struct pci_attach_args *pa) acpi_pci_match(struct device *dev, struct pci_attach_args *pa)
{ {
struct acpi_pci *pdev; struct acpi_pci *pdev;
Expand All @@ -695,7 +695,11 @@ acpi_pci_match(struct device *dev, struct pci_attach_args *pa)
acpi_pci_set_powerstate(pa->pa_pc, pa->pa_tag, state, 0); acpi_pci_set_powerstate(pa->pa_pc, pa->pa_tag, state, 0);


aml_register_notify(pdev->node, NULL, acpi_pci_notify, pdev, 0); aml_register_notify(pdev->node, NULL, acpi_pci_notify, pdev, 0);

return pdev->node;
} }

return NULL;
} }


pcireg_t pcireg_t
Expand Down

0 comments on commit c6df0db

Please sign in to comment.