* [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID.
@ 2011-03-13 15:26 Denis Turischev
2011-03-13 15:28 ` [PATCH 2/3] lpc_sch: expand for Tunnel Creek Denis Turischev
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Denis Turischev @ 2011-03-13 15:26 UTC (permalink / raw)
To: Samuel Ortiz; +Cc: LKML, Grant Likely, David Brownell, Jesse Barnes
Signed-off-by: Denis Turischev <denis@compulab.co.il>
---
include/linux/pci_ids.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 3adb06e..43779f9 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2731,6 +2731,7 @@
#define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601
#define PCI_DEVICE_ID_INTEL_SCH_LPC 0x8119
#define PCI_DEVICE_ID_INTEL_SCH_IDE 0x811a
+#define PCI_DEVICE_ID_INTEL_ITC_LPC 0x8186
#define PCI_DEVICE_ID_INTEL_82454GX 0x84c4
#define PCI_DEVICE_ID_INTEL_82450GX 0x84c5
#define PCI_DEVICE_ID_INTEL_82451NX 0x84ca
--
1.7.0.4
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 2/3] lpc_sch: expand for Tunnel Creek 2011-03-13 15:26 [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID Denis Turischev @ 2011-03-13 15:28 ` Denis Turischev 2011-03-13 15:30 ` [PATCH 3/3] sch_gpio: expand for Tunnel Creak Denis Turischev 2011-03-17 23:12 ` [PATCH 2/3] lpc_sch: expand for Tunnel Creek Samuel Ortiz 2011-03-14 11:43 ` [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID Samuel Ortiz 2011-03-17 23:11 ` Samuel Ortiz 2 siblings, 2 replies; 11+ messages in thread From: Denis Turischev @ 2011-03-13 15:28 UTC (permalink / raw) To: Samuel Ortiz; +Cc: LKML, Grant Likely, David Brownell Intel Poulsbo SCH and Tunnel Creek provide almost the same LPC interface. Use the same driver for both devices while storing PCI ID to distinguish between platforms to apply plarform related quirks. Signed-off-by: Denis Turischev <denis@compulab.co.il> --- drivers/mfd/lpc_sch.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/mfd/lpc_sch.c b/drivers/mfd/lpc_sch.c index 51b2f60..ea3f52c 100644 --- a/drivers/mfd/lpc_sch.c +++ b/drivers/mfd/lpc_sch.c @@ -61,6 +61,7 @@ static struct mfd_cell lpc_sch_cells[] = { static struct pci_device_id lpc_sch_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_LPC) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ITC_LPC) }, { 0, } }; MODULE_DEVICE_TABLE(pci, lpc_sch_ids); @@ -70,6 +71,7 @@ static int __devinit lpc_sch_probe(struct pci_dev *dev, { unsigned int base_addr_cfg; unsigned short base_addr; + int i; pci_read_config_dword(dev, SMBASE, &base_addr_cfg); if (!(base_addr_cfg & (1 << 31))) { @@ -99,7 +101,10 @@ static int __devinit lpc_sch_probe(struct pci_dev *dev, gpio_sch_resource.start = base_addr; gpio_sch_resource.end = base_addr + GPIO_IO_SIZE - 1; - return mfd_add_devices(&dev->dev, -1, + for (i=0; i < ARRAY_SIZE(lpc_sch_cells); i++) + lpc_sch_cells[i].id = id->device; + + return mfd_add_devices(&dev->dev, 0, lpc_sch_cells, ARRAY_SIZE(lpc_sch_cells), NULL, 0); } -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/3] sch_gpio: expand for Tunnel Creak 2011-03-13 15:28 ` [PATCH 2/3] lpc_sch: expand for Tunnel Creek Denis Turischev @ 2011-03-13 15:30 ` Denis Turischev 2011-03-14 10:53 ` [PATCH 3/3 v2] sch_gpio: expand for Tunnel Creek Denis Turischev 2011-03-17 23:13 ` [PATCH 3/3] sch_gpio: expand for Tunnel Creak Samuel Ortiz 2011-03-17 23:12 ` [PATCH 2/3] lpc_sch: expand for Tunnel Creek Samuel Ortiz 1 sibling, 2 replies; 11+ messages in thread From: Denis Turischev @ 2011-03-13 15:30 UTC (permalink / raw) To: Samuel Ortiz; +Cc: LKML, Grant Likely, David Brownell Almost the same driver for both Poulsbo and Tunnel Creek. The difference is in quantity of GPIOs powered by the core power rail and by suspend power supply, default values for some GPIOs, etc. Detect actual hardware by platform device ID assigned in lpc_sch and set configuration accordingly. Signed-off-by: Denis Turischev <denis@compulab.co.il> --- drivers/gpio/Kconfig | 7 +++++-- drivers/gpio/sch_gpio.c | 46 +++++++++++++++++++++++++++++++++++++++------- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 664660e..7ef9108 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -100,18 +100,21 @@ config GPIO_VR41XX Say yes here to support the NEC VR4100 series General-purpose I/O Uint config GPIO_SCH - tristate "Intel SCH GPIO" + tristate "Intel SCH/TunnelCreek GPIO" depends on GPIOLIB && PCI select MFD_CORE select LPC_SCH help - Say yes here to support GPIO interface on Intel Poulsbo SCH. + Say yes here to support GPIO interface on Intel Poulsbo SCH + or Intel Tunnel Creek processor. The Intel SCH contains a total of 14 GPIO pins. Ten GPIOs are powered by the core power rail and are turned off during sleep modes (S3 and higher). The remaining four GPIOs are powered by the Intel SCH suspend power supply. These GPIOs remain active during S3. The suspend powered GPIOs can be used to wake the system from the Suspend-to-RAM state. + The Intel Tunnel Creek processor has 5 GPIOs powered by the + core power rail and 9 from suspend power supply. This driver can also be built as a module. If so, the module will be called sch-gpio. diff --git a/drivers/gpio/sch_gpio.c b/drivers/gpio/sch_gpio.c index 5835213..065ae21 100644 --- a/drivers/gpio/sch_gpio.c +++ b/drivers/gpio/sch_gpio.c @@ -187,7 +187,11 @@ static struct gpio_chip sch_gpio_resume = { static int __devinit sch_gpio_probe(struct platform_device *pdev) { struct resource *res; - int err; + int err, id; + + id = pdev->id; + if (!id) + return -ENODEV; res = platform_get_resource(pdev, IORESOURCE_IO, 0); if (!res) @@ -198,12 +202,40 @@ static int __devinit sch_gpio_probe(struct platform_device *pdev) gpio_ba = res->start; - sch_gpio_core.base = 0; - sch_gpio_core.ngpio = 10; - sch_gpio_core.dev = &pdev->dev; + switch (id) { + case PCI_DEVICE_ID_INTEL_SCH_LPC: + sch_gpio_core.base = 0; + sch_gpio_core.ngpio = 10; + + sch_gpio_resume.base = 10; + sch_gpio_resume.ngpio = 4; + + /* + * GPIO[6:0] enabled by default + * GPIO7 is configured by the CMC as SLPIOVR + * Enable GPIO[9:8] core powered gpios explicitly + */ + outb(0x3, gpio_ba + CGEN + 1); + /* + * SUS_GPIO[2:0] enabled by default + * Enable SUS_GPIO3 resume powered gpio explicitly + */ + outb(0x8, gpio_ba + RGEN); + break; + + case PCI_DEVICE_ID_INTEL_ITC_LPC: + sch_gpio_core.base = 0; + sch_gpio_core.ngpio = 5; + + sch_gpio_resume.base = 5; + sch_gpio_resume.ngpio = 9; + break; + + default: + return -ENODEV; + } - sch_gpio_resume.base = 10; - sch_gpio_resume.ngpio = 4; + sch_gpio_core.dev = &pdev->dev; sch_gpio_resume.dev = &pdev->dev; err = gpiochip_add(&sch_gpio_core); -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/3 v2] sch_gpio: expand for Tunnel Creek 2011-03-13 15:30 ` [PATCH 3/3] sch_gpio: expand for Tunnel Creak Denis Turischev @ 2011-03-14 10:53 ` Denis Turischev 2011-03-14 11:45 ` Samuel Ortiz 2011-03-17 23:13 ` [PATCH 3/3] sch_gpio: expand for Tunnel Creak Samuel Ortiz 1 sibling, 1 reply; 11+ messages in thread From: Denis Turischev @ 2011-03-14 10:53 UTC (permalink / raw) To: Samuel Ortiz; +Cc: LKML, Grant Likely, David Brownell Almost the same driver for both Poulsbo and Tunnel Creek. The difference is in quantity of GPIOs powered by the core power rail and by suspend power supply, default values for some GPIOs, etc. Detect actual hardware by platform device ID assigned in lpc_sch and set configuration accordingly. v2: added include <linux/pci_ids.h> line Signed-off-by: Denis Turischev <denis@compulab.co.il> --- drivers/gpio/Kconfig | 7 ++++- drivers/gpio/sch_gpio.c | 59 +++++++++++++++++++++++++++++++--------------- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 664660e..7ef9108 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -100,18 +100,21 @@ config GPIO_VR41XX Say yes here to support the NEC VR4100 series General-purpose I/O Uint config GPIO_SCH - tristate "Intel SCH GPIO" + tristate "Intel SCH/TunnelCreek GPIO" depends on GPIOLIB && PCI select MFD_CORE select LPC_SCH help - Say yes here to support GPIO interface on Intel Poulsbo SCH. + Say yes here to support GPIO interface on Intel Poulsbo SCH + or Intel Tunnel Creek processor. The Intel SCH contains a total of 14 GPIO pins. Ten GPIOs are powered by the core power rail and are turned off during sleep modes (S3 and higher). The remaining four GPIOs are powered by the Intel SCH suspend power supply. These GPIOs remain active during S3. The suspend powered GPIOs can be used to wake the system from the Suspend-to-RAM state. + The Intel Tunnel Creek processor has 5 GPIOs powered by the + core power rail and 9 from suspend power supply. This driver can also be built as a module. If so, the module will be called sch-gpio. diff --git a/drivers/gpio/sch_gpio.c b/drivers/gpio/sch_gpio.c index 5835213..58e4510 100644 --- a/drivers/gpio/sch_gpio.c +++ b/drivers/gpio/sch_gpio.c @@ -25,6 +25,7 @@ #include <linux/errno.h> #include <linux/acpi.h> #include <linux/platform_device.h> +#include <linux/pci_ids.h> #include <linux/gpio.h> @@ -187,7 +188,11 @@ static struct gpio_chip sch_gpio_resume = { static int __devinit sch_gpio_probe(struct platform_device *pdev) { struct resource *res; - int err; + int err, id; + + id = pdev->id; + if (!id) + return -ENODEV; res = platform_get_resource(pdev, IORESOURCE_IO, 0); if (!res) @@ -198,12 +203,40 @@ static int __devinit sch_gpio_probe(struct platform_device *pdev) gpio_ba = res->start; - sch_gpio_core.base = 0; - sch_gpio_core.ngpio = 10; - sch_gpio_core.dev = &pdev->dev; + switch (id) { + case PCI_DEVICE_ID_INTEL_SCH_LPC: + sch_gpio_core.base = 0; + sch_gpio_core.ngpio = 10; + + sch_gpio_resume.base = 10; + sch_gpio_resume.ngpio = 4; + + /* + * GPIO[6:0] enabled by default + * GPIO7 is configured by the CMC as SLPIOVR + * Enable GPIO[9:8] core powered gpios explicitly + */ + outb(0x3, gpio_ba + CGEN + 1); + /* + * SUS_GPIO[2:0] enabled by default + * Enable SUS_GPIO3 resume powered gpio explicitly + */ + outb(0x8, gpio_ba + RGEN); + break; + + case PCI_DEVICE_ID_INTEL_ITC_LPC: + sch_gpio_core.base = 0; + sch_gpio_core.ngpio = 5; + + sch_gpio_resume.base = 5; + sch_gpio_resume.ngpio = 9; + break; + + default: + return -ENODEV; + } - sch_gpio_resume.base = 10; - sch_gpio_resume.ngpio = 4; + sch_gpio_core.dev = &pdev->dev; sch_gpio_resume.dev = &pdev->dev; err = gpiochip_add(&sch_gpio_core); @@ -214,18 +247,6 @@ static int __devinit sch_gpio_probe(struct platform_device *pdev) if (err < 0) goto err_sch_gpio_resume; - /* - * GPIO[6:0] enabled by default - * GPIO7 is configured by the CMC as SLPIOVR - * Enable GPIO[9:8] core powered gpios explicitly - */ - outb(0x3, gpio_ba + CGEN + 1); - /* - * SUS_GPIO[2:0] enabled by default - * Enable SUS_GPIO3 resume powered gpio explicitly - */ - outb(0x8, gpio_ba + RGEN); - return 0; err_sch_gpio_resume: -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3 v2] sch_gpio: expand for Tunnel Creek 2011-03-14 10:53 ` [PATCH 3/3 v2] sch_gpio: expand for Tunnel Creek Denis Turischev @ 2011-03-14 11:45 ` Samuel Ortiz 2011-03-14 19:20 ` Grant Likely 0 siblings, 1 reply; 11+ messages in thread From: Samuel Ortiz @ 2011-03-14 11:45 UTC (permalink / raw) To: Denis Turischev; +Cc: LKML, Grant Likely, David Brownell Hi Denis, On Mon, Mar 14, 2011 at 12:53:05PM +0200, Denis Turischev wrote: > Almost the same driver for both Poulsbo and Tunnel Creek. > The difference is in quantity of GPIOs powered by the core power > rail and by suspend power supply, default values for some GPIOs, etc. > Detect actual hardware by platform device ID assigned in lpc_sch > and set configuration accordingly. Grant, are you ok with me taking this patch ? Cheers, Samuel. -- Intel Open Source Technology Centre http://oss.intel.com/ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3 v2] sch_gpio: expand for Tunnel Creek 2011-03-14 11:45 ` Samuel Ortiz @ 2011-03-14 19:20 ` Grant Likely 0 siblings, 0 replies; 11+ messages in thread From: Grant Likely @ 2011-03-14 19:20 UTC (permalink / raw) To: Samuel Ortiz; +Cc: Denis Turischev, LKML, David Brownell On Mon, Mar 14, 2011 at 12:45:40PM +0100, Samuel Ortiz wrote: > Hi Denis, > > On Mon, Mar 14, 2011 at 12:53:05PM +0200, Denis Turischev wrote: > > Almost the same driver for both Poulsbo and Tunnel Creek. > > The difference is in quantity of GPIOs powered by the core power > > rail and by suspend power supply, default values for some GPIOs, etc. > > Detect actual hardware by platform device ID assigned in lpc_sch > > and set configuration accordingly. > Grant, are you ok with me taking this patch ? Acked-by: Grant Likely <grant.likely@secretlab.ca> > > Cheers, > Samuel. > > -- > Intel Open Source Technology Centre > http://oss.intel.com/ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] sch_gpio: expand for Tunnel Creak 2011-03-13 15:30 ` [PATCH 3/3] sch_gpio: expand for Tunnel Creak Denis Turischev 2011-03-14 10:53 ` [PATCH 3/3 v2] sch_gpio: expand for Tunnel Creek Denis Turischev @ 2011-03-17 23:13 ` Samuel Ortiz 1 sibling, 0 replies; 11+ messages in thread From: Samuel Ortiz @ 2011-03-17 23:13 UTC (permalink / raw) To: Denis Turischev; +Cc: LKML, Grant Likely, David Brownell Hi Denis, On Sun, Mar 13, 2011 at 05:30:38PM +0200, Denis Turischev wrote: > Almost the same driver for both Poulsbo and Tunnel Creek. > The difference is in quantity of GPIOs powered by the core power > rail and by suspend power supply, default values for some GPIOs, etc. > Detect actual hardware by platform device ID assigned in lpc_sch > and set configuration accordingly. Thanks, patch applied with Grant's ACK. Cheers, Samuel. -- Intel Open Source Technology Centre http://oss.intel.com/ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/3] lpc_sch: expand for Tunnel Creek 2011-03-13 15:28 ` [PATCH 2/3] lpc_sch: expand for Tunnel Creek Denis Turischev 2011-03-13 15:30 ` [PATCH 3/3] sch_gpio: expand for Tunnel Creak Denis Turischev @ 2011-03-17 23:12 ` Samuel Ortiz 1 sibling, 0 replies; 11+ messages in thread From: Samuel Ortiz @ 2011-03-17 23:12 UTC (permalink / raw) To: Denis Turischev; +Cc: LKML, Grant Likely, David Brownell Hi Denis, On Sun, Mar 13, 2011 at 05:28:59PM +0200, Denis Turischev wrote: > Intel Poulsbo SCH and Tunnel Creek provide almost the > same LPC interface. Use the same driver for both devices while > storing PCI ID to distinguish between platforms to apply plarform > related quirks. Thanks, patch applied. Cheers, Samuel. -- Intel Open Source Technology Centre http://oss.intel.com/ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID. 2011-03-13 15:26 [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID Denis Turischev 2011-03-13 15:28 ` [PATCH 2/3] lpc_sch: expand for Tunnel Creek Denis Turischev @ 2011-03-14 11:43 ` Samuel Ortiz 2011-03-14 15:50 ` Jesse Barnes 2011-03-17 23:11 ` Samuel Ortiz 2 siblings, 1 reply; 11+ messages in thread From: Samuel Ortiz @ 2011-03-14 11:43 UTC (permalink / raw) To: Denis Turischev; +Cc: LKML, Grant Likely, David Brownell, Jesse Barnes Hi Denis, On Sun, Mar 13, 2011 at 05:26:40PM +0200, Denis Turischev wrote: > Signed-off-by: Denis Turischev <denis@compulab.co.il> Jesse, are you ok with me carrying this patch ? The 2 following patches from this patchset depend on it, obviously. Cheers, Samuel. -- Intel Open Source Technology Centre http://oss.intel.com/ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID. 2011-03-14 11:43 ` [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID Samuel Ortiz @ 2011-03-14 15:50 ` Jesse Barnes 0 siblings, 0 replies; 11+ messages in thread From: Jesse Barnes @ 2011-03-14 15:50 UTC (permalink / raw) To: Samuel Ortiz; +Cc: Denis Turischev, LKML, Grant Likely, David Brownell On Mon, 14 Mar 2011 12:43:36 +0100 Samuel Ortiz <sameo@linux.intel.com> wrote: > Hi Denis, > > On Sun, Mar 13, 2011 at 05:26:40PM +0200, Denis Turischev wrote: > > Signed-off-by: Denis Turischev <denis@compulab.co.il> > Jesse, are you ok with me carrying this patch ? The 2 following patches from > this patchset depend on it, obviously. Yeah, np, assuming the PCI IDs are used in several places. Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> -- Jesse Barnes, Intel Open Source Technology Center ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID. 2011-03-13 15:26 [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID Denis Turischev 2011-03-13 15:28 ` [PATCH 2/3] lpc_sch: expand for Tunnel Creek Denis Turischev 2011-03-14 11:43 ` [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID Samuel Ortiz @ 2011-03-17 23:11 ` Samuel Ortiz 2 siblings, 0 replies; 11+ messages in thread From: Samuel Ortiz @ 2011-03-17 23:11 UTC (permalink / raw) To: Denis Turischev; +Cc: LKML, Grant Likely, David Brownell, Jesse Barnes Hi Denis, On Sun, Mar 13, 2011 at 05:26:40PM +0200, Denis Turischev wrote: > Signed-off-by: Denis Turischev <denis@compulab.co.il> Patch applied, with Jesse's ACK. Cheers, Samuel. -- Intel Open Source Technology Centre http://oss.intel.com/ ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-03-17 23:13 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-03-13 15:26 [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID Denis Turischev 2011-03-13 15:28 ` [PATCH 2/3] lpc_sch: expand for Tunnel Creek Denis Turischev 2011-03-13 15:30 ` [PATCH 3/3] sch_gpio: expand for Tunnel Creak Denis Turischev 2011-03-14 10:53 ` [PATCH 3/3 v2] sch_gpio: expand for Tunnel Creek Denis Turischev 2011-03-14 11:45 ` Samuel Ortiz 2011-03-14 19:20 ` Grant Likely 2011-03-17 23:13 ` [PATCH 3/3] sch_gpio: expand for Tunnel Creak Samuel Ortiz 2011-03-17 23:12 ` [PATCH 2/3] lpc_sch: expand for Tunnel Creek Samuel Ortiz 2011-03-14 11:43 ` [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID Samuel Ortiz 2011-03-14 15:50 ` Jesse Barnes 2011-03-17 23:11 ` Samuel Ortiz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox