From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756746Ab3AYP2i (ORCPT ); Fri, 25 Jan 2013 10:28:38 -0500 Received: from mailout39.mail01.mtsvc.net ([216.70.64.83]:59851 "EHLO n12.mail01.mtsvc.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754451Ab3AYP2f convert rfc822-to-8bit (ORCPT ); Fri, 25 Jan 2013 10:28:35 -0500 Message-ID: <1359127704.3287.12.camel@thor.lan> Subject: Re: [PATCH v3] lpc_ich: fix gpio base and control offsets From: Peter Hurley To: Linus Walleij Cc: Aaron Sierra , Paul Bolle , Samuel Ortiz , =?ISO-8859-1?Q?Ag=F3cs_P=E1l?= , LKML Date: Fri, 25 Jan 2013 10:28:24 -0500 In-Reply-To: <1359121486.3287.11.camel@thor.lan> References: <3ffa5032-0565-48f0-a4ae-473452f4c902@zimbra> <1359121486.3287.11.camel@thor.lan> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.3-0pjh1 Mime-Version: 1.0 Content-Transfer-Encoding: 8BIT X-Authenticated-User: 125194 peter@hurleysoftware.com X-MT-ID: 8fa290c2a27252aacf65dbc4a42f3ce3735fb2a4 X-MT-INTERNAL-ID: 8fa290c2a27252aacf65dbc4a42f3ce3735fb2a4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2013-01-25 at 08:44 -0500, Peter Hurley wrote: > On Fri, 2013-01-25 at 10:47 +0100, Linus Walleij wrote: > > On Thu, Jan 24, 2013 at 9:52 PM, Aaron Sierra wrote: > > > > > In ICH5 and earlier the GPIOBASE and GPIOCTRL registers are found at > > > offsets 0x58 and 0x5C, respectively. This patch allows GPIO access to > > > properly be enabled (and disabled) for these chipsets. > > > > > > Signed-off-by: Agócs Pál > > > Signed-off-by: Aaron Sierra > > > > OK... Paul, can you test this on your setup? > > > > > @@ -858,14 +874,35 @@ wdt_done: > > > static int lpc_ich_probe(struct pci_dev *dev, > > > const struct pci_device_id *id) > > > { > > > + struct lpc_ich_priv *priv; > > > int ret; > > > bool cell_added = false; > > > > > > - ret = lpc_ich_init_wdt(dev, id); > > > + priv = kmalloc(GFP_KERNEL, sizeof(struct lpc_ich_priv)); > > > + if (!priv) > > > + return -ENOMEM; > > > + > > > + priv->chipset = id->driver_data; > > > > So where is this id->driver_data which is just assigned to > > priv->chipset coming from again? ACPI something? > > That's how pci device probing works. > > The driver defines a struct pci_device_id[] table with > DEFINE_PCI_DEVICE_TABLE(), initializing the .driver_data fields with an > index into a static array of device types (in this case, struct > lpc_ich_info lpc_chipset_info[]), and the pci subsystem passes the > actual matching pci_device_id* to the driver's probe() function. > > There's more information in Documentation/pci.txt Correction. Documentation/PCI/pci.txt