Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1315687

[PATCH 2/3] mfd: lpc_ich: use a correct mask for the GPIO base address

From Antoine Tenart <antoine.tenart@free-electrons.com>
Newsgroups linux.kernel
Subject [PATCH 2/3] mfd: lpc_ich: use a correct mask for the GPIO base address
Date 2016-01-23 17:40 +0100
Message-ID <qU9oe-5ok-11@gated-at.bofh.it> (permalink)
References <qU9od-5ok-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The GPIO base address is read from the GPIOBASE register. The first
bit must be cleared as it can be hardwired to 1 to represent the i/o
space. Other bits are either containing the base address of are
reserved. They should not be cleared as all the chipsets do not have
the same reserved bits.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
 drivers/mfd/lpc_ich.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c
index b514f3cf140d..f13a5ded3958 100644
--- a/drivers/mfd/lpc_ich.c
+++ b/drivers/mfd/lpc_ich.c
@@ -921,7 +921,10 @@ static int lpc_ich_init_gpio(struct pci_dev *dev)
 gpe0_done:
 	/* Setup GPIO base register */
 	pci_read_config_dword(dev, priv->gbase, &base_addr_cfg);
-	base_addr = base_addr_cfg & 0x0000ff80;
+
+	/* Clear the i/o flag */
+	base_addr = base_addr_cfg & ~BIT(0);
+
 	if (!base_addr) {
 		dev_notice(&dev->dev, "I/O space for GPIO uninitialized\n");
 		ret = -ENODEV;
-- 
2.7.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 2/3] mfd: lpc_ich: use a correct mask for the GPIO base address Antoine Tenart <antoine.tenart@free-electrons.com> - 2016-01-23 17:40 +0100
  Re: [PATCH 2/3] mfd: lpc_ich: use a correct mask for the GPIO base  address Lee Jones <lee.jones@linaro.org> - 2016-01-25 13:50 +0100
    Re: [PATCH 2/3] mfd: lpc_ich: use a correct mask for the GPIO base  address Peter Tyser <ptyser@xes-inc.com> - 2016-01-25 17:20 +0100

csiph-web