aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-02-06gpio: mockup: implement naming the linesBartosz Golaszewski1-0/+35
In order to allow testing line lookup by name from user space, add a new boolean parameter that indicates whether we want the lines to be named. The name is created by concatenating the chip name and the line offset value. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-06gpio: mockup: code shrinkBartosz Golaszewski1-21/+8
Moving a couple of lines around allows us to shrink the code a bit while keeping the same functionality. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-06gpio: mockup: readability tweaksBartosz Golaszewski1-57/+66
The following patch tries to improve the readability of the mockup driver. The driver is called gpio-mockup, so add the same prefix to all functions and structures. Add some newlines and use a temporary pointer in gpio_mockup_add(). Drop the name of the direction enum and rename the enum values to better reflect their purpose. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-06gpio: Add GPIO support for the ACCES PCI-IDIO-16William Breathitt Gray4-0/+364
The ACCES PCI-IDIO-16 device provides 32 lines of digital I/O (16 lines of optically-isolated digital inputs for AC and DC control signals, and 16 lines of solid state switch digital outputs). An interrupt is generated when any of the inputs change state (low to high or high to low). Input filter control is not supported by this driver, and input filters are deactivated by this driver. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-05Merge branch 'ib-gpiod-flags' into develLinus Walleij7-40/+58
2017-02-04gpio: Add the devm_fwnode_get_index_gpiod_from_child() helperBoris Brezillon3-23/+37
devm_fwnode_get_gpiod_from_child() currently allows GPIO users to request a GPIO that is defined in a child fwnode instead of directly in the device fwnode. Extend this API by adding the devm_fwnode_get_index_gpiod_from_child() helper which does the same except you can also specify an index in case the 'xx-gpios' property describe several GPIOs. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-04gpio: Rename devm_get_gpiod_from_child()Boris Brezillon6-33/+37
Rename devm_get_gpiod_from_child() into devm_fwnode_get_gpiod_from_child() to reflect the fact that this function is operating on a fwnode object. Signed-off-by: Boris Brezillon <[email protected]> Acked-by: Jacek Anaszewski <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-04gpio: mcp23s08: Select REGMAP/REGMAP_I2C to fix build errorAxel Lin1-0/+2
This driver now using devm_regmap_init/devm_regmap_init_i2c, so it needs to select REGMAP/REGMAP_I2C accordingly. Fixes: ("3d84fdb3f0b5 gpio: mcp23s08: use regmap") Signed-off-by: Axel Lin <[email protected]> Acked-By: Sebastian Reichel <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-01gpio: ws16c48: Add support for GPIO namesWilliam Breathitt Gray1-1/+18
This patch sets the gpio_chip names option with an array of GPIO line names that match the manual documentation for the WinSystems WS16C48. This should make it easier for users to identify which GPIO line corresponds to a respective GPIO pin on the device. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-01gpio: gpio-mm: Add support for GPIO namesWilliam Breathitt Gray1-1/+14
This patch sets the gpio_chip names option with an array of GPIO line names that match the manual documentation for the Diamond Systems GPIO-MM. This should make it easier for users to identify which GPIO line corresponds to a respective GPIO pin on the device. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-01gpio: 104-idio-16: Add support for GPIO namesWilliam Breathitt Gray1-1/+10
This patch sets the gpio_chip names option with an array of GPIO line names that match the manual documentation for the ACCES 104-IDIO-16. This should make it easier for users to identify which GPIO line corresponds to a respective GPIO pin on the device. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-01gpio: 104-idi-48: Add support for GPIO namesWilliam Breathitt Gray1-1/+14
This patch sets the gpio_chip names option with an array of GPIO line names that match the manual documentation for the ACCES 104-IDI-48. This should make it easier for users to identify which GPIO line corresponds to a respective GPIO pin on the device. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-01gpio: 104-dio-48e: Add support for GPIO namesWilliam Breathitt Gray1-1/+22
This patch sets the gpio_chip names option with an array of GPIO line names that match the manual documentation for the ACCES 104-DIO-48E. This should make it easier for users to identify which GPIO line corresponds to a respective GPIO pin on the device. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-01gpio: ws16c48: Remove unnecessary driver_data setWilliam Breathitt Gray1-2/+0
Setting driver_data was necessary to access private data in the ws16c48_remove function. Now that the ws16c48_remove function is gone, driver_data is no longer used. This patch removes the relevant code. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-01gpio: gpio-mm: Remove unnecessary driver_data setWilliam Breathitt Gray1-2/+0
Setting driver_data was necessary to access private data in the gpiomm_remove function. Now that the gpiomm_remove function is gone, driver_data is no longer used. This patch removes the relevant code. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-01gpio: 104-idio-16: Remove unnecessary driver_data setWilliam Breathitt Gray1-2/+0
Setting driver_data was necessary to access private data in the idio_16_remove function. Now that the idio_16_remove function is gone, driver_data is no longer used. This patch removes the relevant code. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-01gpio: 104-idi-48: Remove unnecessary driver_data setWilliam Breathitt Gray1-2/+0
Setting driver_data was necessary to access private data in the idi_48_remove function. Now that the idi_48_remove function is gone, driver_data is no longer used. This patch removes the relevant code. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-02-01gpio: 104-dio-48e: Remove unnecessary driver_data setWilliam Breathitt Gray1-2/+0
Setting driver_data was necessary to access private data in the dio48e_remove function. Now that the dio48e_remove function is gone, driver_data is no longer used. This patch removes the relevant code. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-31gpiolib: Fix a WARN_ON that can never triggerChristophe JAILLET1-2/+1
"if (!x) WARN_ON(x)" can never trigger. Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-31gpio: random documentation updateLinus Walleij1-9/+46
Updated and proofread the documentation for GPIO drivers a bit when looking over the changes for generic configuration. Signed-off-by: Linus Walleij <[email protected]>
2017-01-30gpio: mcp23s08: use regmapSebastian Reichel1-190/+130
Use regmap API to save some lines of codes and have debugfs support for all of the MCP's registers. Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio-hammer: fix make consumer_label suitable to work on gpio-nailsUwe Kleine-König1-1/+1
There are no gpio-nalils, so fix label accordingly. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: ws16c48: Utilize devm_ functions in driver probe callbackWilliam Breathitt Gray1-23/+5
The devm_ resource manager functions allow memory to be automatically released when a device is unbound. This patch takes advantage of the resource manager functions and replaces the gpiochip_add_data call and request_irq call with the devm_gpiochip_add_data call and devm_request_irq call respectively. In addition, the ws16c48_remove function has been removed as no longer necessary due to the use of the relevant devm_ resource manager functions. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: gpio-mm: Utilize devm_ functions in driver probe callbackWilliam Breathitt Gray1-11/+1
The devm_ resource manager functions allow memory to be automatically released when a device is unbound. This patch takes advantage of the resource manager functions and replaces the gpiochip_add_data call with the devm_gpiochip_add_data call. In addition, the gpiomm_remove function has been removed as no longer necessary due to the use of the relevant devm_ resource manager functions. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: 104-idio-16: Utilize devm_ functions in driver probe callbackWilliam Breathitt Gray1-22/+5
The devm_ resource manager functions allow memory to be automatically released when a device is unbound. This patch takes advantage of the resource manager functions and replaces the gpiochip_add_data call and request_irq call with the devm_gpiochip_add_data call and devm_request_irq call respectively. In addition, the idio_16_remove function has been removed as no longer necessary due to the use of the relevant devm_ resource manager functions. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: 104-idi-48: Utilize devm_ functions in driver probe callbackWilliam Breathitt Gray1-23/+5
The devm_ resource manager functions allow memory to be automatically released when a device is unbound. This patch takes advantage of the resource manager functions and replaces the gpiochip_add_data call and request_irq call with the devm_gpiochip_add_data call and devm_request_irq call respectively. In addition, the idi_48_remove function has been removed as no longer necessary due to the use of the relevant devm_ resource manager functions. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: 104-dio-48e: Utilize devm_ functions in driver probe callbackWilliam Breathitt Gray1-22/+5
The devm_ resource manager functions allow memory to be automatically released when a device is unbound. This patch takes advantage of the resource manager functions and replaces the gpiochip_add_data call and request_irq call with the devm_gpiochip_add_data call and devm_request_irq call respectively. In addition, the dio48e_remove function has been removed as no longer necessary due to the use of the relevant devm_ resource manager functions. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26Merge branch 'ib-pinctrl-genprops' of /home/linus/linux-pinctrl into develLinus Walleij47-257/+392
2017-01-26pinctrl / gpio: Introduce .set_config() callback for GPIO chipsMika Westerberg26-218/+297
Currently we already have two pin configuration related callbacks available for GPIO chips .set_single_ended() and .set_debounce(). In future we expect to have even more, which does not scale well if we need to add yet another callback to the GPIO chip structure for each possible configuration parameter. Better solution is to reuse what we already have available in the generic pinconf. To support this, we introduce a new .set_config() callback for GPIO chips. The callback takes a single packed pin configuration value as parameter. This can then be extended easily beyond what is currently supported by just adding new types to the generic pinconf enum. If the GPIO driver is backed up by a pinctrl driver the GPIO driver can just assign gpiochip_generic_config() (introduced in this patch) to .set_config and that will take care configuration requests are directed to the pinctrl driver. We then convert the existing drivers over .set_config() and finally remove the .set_single_ended() and .set_debounce() callbacks. Suggested-by: Linus Walleij <[email protected]> Signed-off-by: Mika Westerberg <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26pinctrl: Allow configuration of pins from gpiolib based driversMika Westerberg4-0/+56
When a GPIO driver is backed by a pinctrl driver the GPIO driver sometimes needs to call the pinctrl driver to configure certain things, like whether the pin is used as input or output. In addition to this there are other configurations applicable to GPIOs such as setting debounce time of the GPIO. To support this we introduce a new function pinctrl_gpio_set_config() that can be used by gpiolib based driver to pass configuration requests to the backing pinctrl driver. Signed-off-by: Mika Westerberg <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26pinctrl: Widen the generic pinconf argument from 16 to 24 bitsMika Westerberg18-39/+39
The current pinconf packed format allows only 16-bit argument limiting the maximum value 65535. For most types this is enough. However, debounce time can be in range of hundreths of milliseconds in case of mechanical switches so we cannot represent the worst case using the current format. In order to support larger values change the packed format so that the lower 8 bits are used as type which leaves 24 bits for the argument. This allows representing values up to 16777215 and debounce times up to 16 seconds. We also convert the existing users to use 32-bit integer when extracting argument from the packed configuration value. Signed-off-by: Mika Westerberg <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: exar: add gpio for exar cardsSudip Mukherjee3-0/+208
Exar XR17V352/354/358 chips have 16 multi-purpose inputs/outputs which can be controlled using gpio interface. Add the gpio specific code. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: ws16c48: Add set_multiple callback function supportWilliam Breathitt Gray1-0/+41
The WinSystems WS16C48 provides registers where 8 lines of GPIO may be set at a time. This patch add support for the set_multiple callback function, thus allowing multiple GPIO output lines to be set more efficiently in groups. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: gpio-mm: Add set_multiple callback function supportWilliam Breathitt Gray1-0/+39
The Diamond Systems GPIO-MM series provides registers where 8 lines of GPIO may be set at a time. This patch add support for the set_multiple callback function, thus allowing multiple GPIO output lines to be set more efficiently in groups. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: 104-idio-16: Add set_multiple callback function supportWilliam Breathitt Gray1-0/+20
The ACCES 104-IDIO-16 series provides registers where 8 lines of GPIO may be set at a time. This patch add support for the set_multiple callback function, thus allowing multiple GPIO output lines to be set more efficiently in groups. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: 104-dio-48e: Add set_multiple callback function supportWilliam Breathitt Gray1-0/+39
The ACCES 104-DIO-48E series provides registers where 8 lines of GPIO may be set at a time. This patch add support for the set_multiple callback function, thus allowing multiple GPIO output lines to be set more efficiently in groups. Signed-off-by: William Breathitt Gray <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26Merge branch 'ib-gpiod-flags' into develLinus Walleij7-46/+64
2017-01-26gpio: Add a driver for Cortina Systems Gemini GPIOLinus Walleij3-0/+246
This is a heavy edit/rewrite of the GPIO driver for the Gemini SoC from arch/arm/mach-gemini/gpio.c. This rewrite uses all the best-in-class helper like generic GPIO and GPIOLIB_IRQCHIP and has been tested on ITian Square One Gemini-based NAS/router. Cc: Janos Laube <[email protected]> Cc: Paulius Zaleckas <[email protected]> Cc: Hans Ulli Kroll <[email protected]> Cc: Florian Fainelli <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: add DT bindings for Cortina Gemini GPIOLinus Walleij1-0/+24
This adds fairly standard DT bindings for the Cortina Systems Gemini GPIO controller. Cc: Janos Laube <[email protected]> Cc: Paulius Zaleckas <[email protected]> Cc: Hans Ulli Kroll <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: [email protected] Acked-by: Rob Herring <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: davinci: Remove custom .xlateKeerthy1-22/+0
With the current redesign of driver it's not necessary to have custom .xlate() as the gpiolib will assign default of_gpio_simple_xlate(). Suggested-by: Grygorii Strashko <[email protected]> Signed-off-by: Keerthy <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: davinci: Add support for multiple GPIO controllersKeerthy2-1/+4
Update GPIO driver to support Multiple GPIO controllers by updating the base of subsequent GPIO chips with total of previous chips gpio count so that gpio_add_chip gets unique numbers. Signed-off-by: Keerthy <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: davinci: Redesign driver to accommodate ngpios in one gpio chipKeerthy2-56/+83
The Davinci GPIO driver is implemented to work with one monolithic Davinci GPIO platform device which may have up to Y(144) gpios. The Davinci GPIO driver instantiates number of GPIO chips with max 32 gpio pins per each during initialization and one IRQ domain. So, the current GPIO's opjects structure is: <platform device> Davinci GPIO controller |- <gpio0_chip0> ------| ... |--- irq_domain (hwirq [0..143]) |- <gpio0_chipN> ------| Current driver creates one chip for every 32 GPIOs in a controller. This was a limitation earlier now there is no need for that. Hence redesigning the driver to create one gpio chip for all the ngpio in the controller. |- <gpio0_chip0> ------|--- irq_domain (hwirq [0..143]). The previous discussion on this can be found here: https://www.spinics.net/lists/linux-omap/msg132869.html Signed-off-by: Keerthy <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: davinci: Remove unwanted blank lineKeerthy1-1/+0
Remove redundant blank line. Signed-off-by: Keerthy <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: davinci: Remove gpio2regs functionKeerthy1-24/+11
gpio2regs is written making an assumption that driver supports only one instance of gpio controller. Removing this and adding a generic array so as to support multiple instances of gpio controllers. Signed-off-by: Keerthy <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: intel-mid: Fix build warning when !CONFIG_PMAugusto Mecking Caringi1-1/+1
The only usage of function intel_gpio_runtime_idle() is here (in the same file): static const struct dev_pm_ops intel_gpio_pm_ops = { SET_RUNTIME_PM_OPS(NULL, NULL, intel_gpio_runtime_idle) }; And when CONFIG_PM is not set, the macro SET_RUNTIME_PM_OPS expands to nothing, causing the following compiler warning: drivers/gpio/gpio-intel-mid.c:324:12: warning: ‘intel_gpio_runtime_idle’ defined but not used [-Wunused-function] static int intel_gpio_runtime_idle(struct device *dev) Fix it by annotating the function with __maybe_unused. Signed-off-by: Augusto Mecking Caringi <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpio: Pass GPIO label down to gpiod_requestAlexander Stein7-20/+33
Currently all users of fwnode_get_named_gpiod() have no way to specify a label for the GPIO. So GPIOs listed in debugfs are shown with label "?". With this change a proper label is used. Also adjust all users so they can pass a label, properly retrieved from device tree properties. Signed-off-by: Alexander Stein <[email protected]> Cc: Andy Shevchenko <[email protected]> Acked-by: Jacek Anaszewski <[email protected]> Acked-by: Bartlomiej Zolnierkiewicz <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-26gpiolib: Convert fwnode_get_named_gpiod() to configure GPIOAndy Shevchenko7-40/+45
Make fwnode_get_named_gpiod() consistent with the rest of gpiod_get() like API, i.e. configure GPIO pin immediately after request. Besides obvious clean up it will help to configure pins based on firmware provided resources. Reviewed-by: Mika Westerberg <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-11gpio: mvebu: fix warning when building on 64-bitRussell King1-1/+1
Casting a pointer to an int is not portable, and provokes a compiler warning. Cast to unsigned long instead to avoid the warning. drivers/gpio/gpio-mvebu.c: In function 'mvebu_gpio_probe': drivers/gpio/gpio-mvebu.c:662:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] soc_variant = (int) match->data; ^ This will be needed when building gpio-mvebu for Armada 7k/8k ARM64 SoCs. Signed-off-by: Russell King <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-11gpio: pca953x: Add optional reset gpio controlSteve Longerbeam2-0/+13
Add optional reset-gpios pin control. If present, de-assert the specified reset gpio pin to bring the chip out of reset. v2: - Specify that reset signal to PCA953x chip is active low, in binding doc. - reorder includes in gpio-pca953x.c. - remove dev_err() on devm_gpiod_get_optional() error return. Cc: Alexandre Courbot <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Steve Longerbeam <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Vladimir Zapolskiy <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-11gpio: tools: add .gitignore for generated filesShuah Khan1-0/+4
Add .gitignore for generated files. Signed-off-by: Shuah Khan <[email protected]> [Dropped include dir] Signed-off-by: Linus Walleij <[email protected]>