summaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-07 15:40:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-07 15:40:27 -0400
commitc7d28eca1d58d335ff8de6f33559b221bdd029f9 (patch)
tree3522cae5809d6912ccc307a4b0a7dea3ffeb8225 /drivers/pnp
parentdddd564dbb5934c9a0c401491cafb98ab1c82fc6 (diff)
parent413058df4331ce29f9934a5870d582c7e71fe15f (diff)
Merge tag 'gpio-v4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO updates from Linus Walleij: "This is the bulk of GPIO changes for the v4.13 series. Some administrativa: I have a slew of 8250 serial patches and the new IOT2040 serial+GPIO driver coming in through this tree, along with a whole bunch of Exar 8250 fixes. These are ACKed by Greg and also hit drivers/platform/* where they are ACKed by Andy Shevchenko. Speaking about drivers/platform/* there is also a bunch of ACPI stuff coming through that route, again ACKed by Andy. The MCP23S08 changes are coming in here as well. You already have the commits in your tree, so this is just a result of sharing an immutable branch between pin control and GPIO. Core: - Export add/remove for lookup tables so that modules can export GPIO descriptor tables. - Handle GPIO sleep states: it is now possible to flag that a GPIO line may loose its state during suspend/resume of the system to save power. This is used in the Wolfson Micro Arizona driver. - ACPI-based GPIO was tightened up a lot around the edges. - Use bitmap_fill() to speed up a loop. New drivers: - Exar XRA1403 SPI-based GPIO. - MVEBU driver now supports Armada 7K and 8K. - LP87565 PMIC GPIO. - Renesas R-CAR R8A7743 (RZ/G1M). - The new IOT2040 8250 serial/GPIO also comes in through this changeset. Substantial driver changes: - Seriously fix the Exar 8250 GPIO portions to work. - The MCP23S08 was moved out to a pin control driver. - Convert MEVEBU to use regmap for register access. - Drop Vulcan support from the Broadcom driver. - Serious cleanup and improvement of the mockup driver, giving us a better test coverage. Misc: - Lots of janitorial clean up. - A bunch of documentation fixes" * tag 'gpio-v4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (70 commits) serial: exar: Add support for IOT2040 device gpio-exar/8250-exar: Make set of exported GPIOs configurable platform: Accept const properties serial: exar: Factor out platform hooks gpio-exar/8250-exar: Rearrange gpiochip parenthood gpio: exar: Fix iomap request gpio-exar/8250-exar: Do not even instantiate a GPIO device for Commtech cards serial: uapi: Add support for bus termination gpio: rcar: Add R8A7743 (RZ/G1M) support gpio: gpio-wcove: Fix GPIO control register offset calculation gpio: lp87565: Add support for GPIO gpio: dwapb: fix missing first irq for edgeboth irq type MAINTAINERS: Take maintainership for GPIO ACPI support gpio: exar: Fix reading of directions and values gpio: exar: Allocate resources on behalf of the platform device gpio-exar/8250-exar: Fix passing in of parent PCI device gpio: mockup: use devm_kcalloc() where applicable gpio: mockup: add myself as author gpio: mockup: improve the error message gpio: mockup: don't return magic numbers from probe() ...
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index 4b717c699313..43d8ed577e70 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -15,10 +15,6 @@
15 * WITHOUT ANY WARRANTY; without even the implied warranty of 15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details. 17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */ 18 */
23#include <linux/kernel.h> 19#include <linux/kernel.h>
24#include <linux/acpi.h> 20#include <linux/acpi.h>
@@ -149,8 +145,8 @@ static int vendor_resource_matches(struct pnp_dev *dev,
149 uuid_len == sizeof(match->data) && 145 uuid_len == sizeof(match->data) &&
150 memcmp(uuid, match->data, uuid_len) == 0) { 146 memcmp(uuid, match->data, uuid_len) == 0) {
151 if (expected_len && expected_len != actual_len) { 147 if (expected_len && expected_len != actual_len) {
152 dev_err(&dev->dev, "wrong vendor descriptor size; " 148 dev_err(&dev->dev,
153 "expected %d, found %d bytes\n", 149 "wrong vendor descriptor size; expected %d, found %d bytes\n",
154 expected_len, actual_len); 150 expected_len, actual_len);
155 return 0; 151 return 0;
156 } 152 }
@@ -180,6 +176,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
180 struct pnp_dev *dev = data; 176 struct pnp_dev *dev = data;
181 struct acpi_resource_dma *dma; 177 struct acpi_resource_dma *dma;
182 struct acpi_resource_vendor_typed *vendor_typed; 178 struct acpi_resource_vendor_typed *vendor_typed;
179 struct acpi_resource_gpio *gpio;
183 struct resource_win win = {{0}, 0}; 180 struct resource_win win = {{0}, 0};
184 struct resource *r = &win.res; 181 struct resource *r = &win.res;
185 int i, flags; 182 int i, flags;
@@ -203,13 +200,27 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
203 * one interrupt, we won't be able to re-encode it. 200 * one interrupt, we won't be able to re-encode it.
204 */ 201 */
205 if (pnp_can_write(dev)) { 202 if (pnp_can_write(dev)) {
206 dev_warn(&dev->dev, "multiple interrupts in " 203 dev_warn(&dev->dev,
207 "_CRS descriptor; configuration can't " 204 "multiple interrupts in _CRS descriptor; configuration can't be changed\n");
208 "be changed\n");
209 dev->capabilities &= ~PNP_WRITE; 205 dev->capabilities &= ~PNP_WRITE;
210 } 206 }
211 } 207 }
212 return AE_OK; 208 return AE_OK;
209 } else if (acpi_gpio_get_irq_resource(res, &gpio)) {
210 /*
211 * If the resource is GpioInt() type then extract the IRQ
212 * from GPIO resource and fill it into IRQ resource type.
213 */
214 i = acpi_dev_gpio_irq_get(dev->data, 0);
215 if (i >= 0) {
216 flags = acpi_dev_irq_flags(gpio->triggering,
217 gpio->polarity,
218 gpio->sharable);
219 } else {
220 flags = IORESOURCE_DISABLED;
221 }
222 pnp_add_irq_resource(dev, i, flags);
223 return AE_OK;
213 } else if (r->flags & IORESOURCE_DISABLED) { 224 } else if (r->flags & IORESOURCE_DISABLED) {
214 pnp_add_irq_resource(dev, 0, IORESOURCE_DISABLED); 225 pnp_add_irq_resource(dev, 0, IORESOURCE_DISABLED);
215 return AE_OK; 226 return AE_OK;
@@ -331,8 +342,8 @@ static __init void pnpacpi_parse_ext_irq_option(struct pnp_dev *dev,
331 if (p->interrupts[i] < PNP_IRQ_NR) 342 if (p->interrupts[i] < PNP_IRQ_NR)
332 __set_bit(p->interrupts[i], map.bits); 343 __set_bit(p->interrupts[i], map.bits);
333 else 344 else
334 dev_err(&dev->dev, "ignoring IRQ %d option " 345 dev_err(&dev->dev,
335 "(too large for %d entry bitmap)\n", 346 "ignoring IRQ %d option (too large for %d entry bitmap)\n",
336 p->interrupts[i], PNP_IRQ_NR); 347 p->interrupts[i], PNP_IRQ_NR);
337 } 348 }
338 } 349 }
@@ -933,8 +944,9 @@ int pnpacpi_encode_resources(struct pnp_dev *dev, struct acpi_buffer *buffer)
933 case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64: 944 case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
934 case ACPI_RESOURCE_TYPE_GENERIC_REGISTER: 945 case ACPI_RESOURCE_TYPE_GENERIC_REGISTER:
935 default: /* other type */ 946 default: /* other type */
936 dev_warn(&dev->dev, "can't encode unknown resource " 947 dev_warn(&dev->dev,
937 "type %d\n", resource->type); 948 "can't encode unknown resource type %d\n",
949 resource->type);
938 return -EINVAL; 950 return -EINVAL;
939 } 951 }
940 resource++; 952 resource++;