History

Merge tag 'gpio-v4.6-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 kernel v4.6. There is quite a lot of interesting stuff going on. The patches to other subsystems and arch-wide are ACKed as far as possible, though I consider things like per-arch <asm/gpio.h> as essentially a part of the GPIO subsystem so it should not be needed. Core changes: - The gpio_chip is now a *real device*. Until now the gpio chips were just piggybacking the parent device or (gasp) floating in space outside of the device model. We now finally make GPIO chips devices. The gpio_chip will create a gpio_device which contains a struct device, and this gpio_device struct is kept private. Anything that needs to be kept private from the rest of the kernel will gradually be moved over to the gpio_device. - As a result of making the gpio_device a real device, we have added resource management, so devm_gpiochip_add_data() will cut down on overhead and reduce code lines. A huge slew of patches convert almost all drivers in the subsystem to use this. - Building on making the GPIO a real device, we add the first step of a new userspace ABI: the GPIO character device. We take small steps here, so we first add a pure *information* ABI and the tool "lsgpio" that will list all GPIO devices on the system and all lines on these devices. We can now discover GPIOs properly from userspace. We still have not come up with a way to actually *use* GPIOs from userspace. - To encourage people to use the character device for the future, we have it always-enabled when using GPIO. The old sysfs ABI is still opt-in (and can be used in parallel), but is marked as deprecated. We will keep it around for the foreseeable future, but it will not be extended to cover ever more use cases. Cleanup: - Bjorn Helgaas removed a whole slew of per-architecture <asm/gpio.h> includes. This dates back to when GPIO was an opt-in feature and no shared library even existed: just a header file with proper prototypes was provided and all semantics were up to the arch to implement. These patches make the GPIO chip even more a proper device and cleans out leftovers of the old in-kernel API here and there. Still some cruft is left but it's very little now. - There is still some clamping of return values for .get() going on, but we now return sane values in the vast majority of drivers and the errorpath is sanitized. Some patches for powerpc, blackfin and unicore still drop in. - We continue to switch the ARM, MIPS, blackfin, m68k local GPIO implementations to use gpiochip_add_data() and cut down on code lines. - MPC8xxx is converted to use the generic GPIO helpers. - ATH79 is converted to use the generic GPIO helpers. New drivers: - WinSystems WS16C48 - Acces 104-DIO-48E - F81866 (a F7188x variant) - Qoric (a MPC8xxx variant) - TS-4800 - SPI serializers (pisosr): simple 74xx shift registers connected to SPI to obtain a dirt-cheap output-only GPIO expander. - Texas Instruments TPIC2810 - Texas Instruments TPS65218 - Texas Instruments TPS65912 - X-Gene (ARM64) standby GPIO controller" * tag 'gpio-v4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (194 commits) Revert "Share upstreaming patches" gpio: mcp23s08: Fix clearing of interrupt. gpiolib: Fix comment referring to gpio_*() in gpiod_*() gpio: pca953x: Fix pca953x_gpio_set_multiple() on 64-bit gpio: xgene: Fix kconfig for standby GIPO contoller gpio: Add generic serializer DT binding gpio: uapi: use 0xB4 as ioctl() major gpio: tps65912: fix bad merge Revert "gpio: lp3943: Drop pin_used and lp3943_gpio_request/lp3943_gpio_free" gpio: omap: drop dev field from gpio_bank structure gpio: mpc8xxx: Slightly update the code for better readability gpio: mpc8xxx: Remove *read_reg and *write_reg from struct mpc8xxx_gpio_chip gpio: mpc8xxx: Fixup setting gpio direction output gpio: mcp23s08: Add support for mcp23s18 dt-bindings: gpio: altera: Fix altr,interrupt-type property gpio: add driver for MEN 16Z127 GPIO controller gpio: lp3943: Drop pin_used and lp3943_gpio_request/lp3943_gpio_free gpio: timberdale: Switch to devm_ioremap_resource() gpio: ts4800: Add IMX51 dependency gpiolib: rewrite gpiodev_add_to_list ...

Linus Torvalds committed 10 years ago

Commit 1a467122 parents 82b666e ccbd805169 files · +4405 −2663Browse files

Showing the changes to include/uapi (2 of 169 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/Kbuild +1 −0
  2. include/uapi/linux/gpio.h +58 −0
include/uapi/linux/Kbuild+1−0
@@ -138,6 +138,7 @@ header-y += genetlink.h · 137 unmodified lines
138138 header-y += gen_stats.h
139139 header-y += gfs2_ondisk.h
140140 header-y += gigaset_dev.h
141+header-y += gpio.h
141142 header-y += gsmmux.h
142143 header-y += hdlcdrv.h
143144 header-y += hdlc.h
include/uapi/linux/gpio.h+58−0
@@ -0,0 +1,58 @@
1+/*
2+ * <linux/gpio.h> - userspace ABI for the GPIO character devices
3+ *
4+ * Copyright (C) 2015 Linus Walleij
5+ *
6+ * This program is free software; you can redistribute it and/or modify it
7+ * under the terms of the GNU General Public License version 2 as published by
8+ * the Free Software Foundation.
9+ */
10+#ifndef _UAPI_GPIO_H_
11+#define _UAPI_GPIO_H_
12+
13+#include <linux/ioctl.h>
14+#include <linux/types.h>
15+
16+/**
17+ * struct gpiochip_info - Information about a certain GPIO chip
18+ * @name: the Linux kernel name of this GPIO chip
19+ * @label: a functional name for this GPIO chip, such as a product
20+ * number, may be NULL
21+ * @lines: number of GPIO lines on this chip
22+ */
23+struct gpiochip_info {
24+ char name[32];
25+ char label[32];
26+ __u32 lines;
27+};
28+
29+/* Line is in use by the kernel */
30+#define GPIOLINE_FLAG_KERNEL (1UL << 0)
31+#define GPIOLINE_FLAG_IS_OUT (1UL << 1)
32+#define GPIOLINE_FLAG_ACTIVE_LOW (1UL << 2)
33+#define GPIOLINE_FLAG_OPEN_DRAIN (1UL << 3)
34+#define GPIOLINE_FLAG_OPEN_SOURCE (1UL << 4)
35+
36+/**
37+ * struct gpioline_info - Information about a certain GPIO line
38+ * @line_offset: the local offset on this GPIO device, fill this in when
39+ * requesting the line information from the kernel
40+ * @flags: various flags for this line
41+ * @name: the name of this GPIO line, such as the output pin of the line on the
42+ * chip, a rail or a pin header name on a board, as specified by the gpio
43+ * chip, may be NULL
44+ * @consumer: a functional name for the consumer of this GPIO line as set by
45+ * whatever is using it, will be NULL if there is no current user but may
46+ * also be NULL if the consumer doesn't set this up
47+ */
48+struct gpioline_info {
49+ __u32 line_offset;
50+ __u32 flags;
51+ char name[32];
52+ char consumer[32];
53+};
54+
55+#define GPIO_GET_CHIPINFO_IOCTL _IOR(0xB4, 0x01, struct gpiochip_info)
56+#define GPIO_GET_LINEINFO_IOCTL _IOWR(0xB4, 0x02, struct gpioline_info)
57+
58+#endif /* _UAPI_GPIO_H_ */