aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-tb10x.c
AgeCommit message (Collapse)AuthorFilesLines
2019-12-12gpio: remove unneeded MODULE_VERSION() usageEnrico Weigelt, metux IT consult1-1/+0
Remove MODULE_VERSION(), as it isn't needed at all: the only version making sense is the kernel version. Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-08-05gpio: Remove dev_err() usage after platform_get_irq()Stephen Boyd1-3/+1
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: [email protected] Cc: Greg Kroah-Hartman <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333Thomas Gleixner1-13/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 59 temple place suite 330 boston ma 02111 1307 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 136 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Alexios Zavras <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-04-05drivers: gpio: tb10x: use devm_platform_ioremap_resource()Enrico Weigelt, metux IT consult1-3/+1
Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together. Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2018-08-29gpio: tb10x: Use GENERIC_GPIOLinus Walleij1-66/+30
Instead of open coding logic for reading and writing GPIO lines, use the generic GPIO library. Also switch to using the spinlock from the generic GPIO to protect the registers. Cc: [email protected] Acked-by: Christian Ruppert <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2018-08-29gpio: tb10x: Create local helper variablesLinus Walleij1-13/+14
Create a local struct device *dev helper variable to make the code easier to read. Most GPIO drivers use "np" (node pointer) rather than "dn" (device node) to point to the device tree node. Let's follow this convention. Cc: [email protected] Acked-by: Christian Ruppert <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2018-08-10gpio: tb10x: Use the right includeLinus Walleij1-2/+1
This driver includes the legacy <linux/gpio.h> and <linux/of_gpio.h> but all it needs is really <linux/gpio/driver.h>. Signed-off-by: Linus Walleij <[email protected]>
2017-09-21gpio: tb10x: Handle return value of devm_kasprintfArvind Yadav1-0/+3
devm_kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: Convert to using %pOF instead of full_nameRob Herring1-1/+2
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring <[email protected]> Cc: Tien Hock Loh <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Alexandre Courbot <[email protected]> Cc: Brian Norris <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: [email protected] Cc: Michal Simek <[email protected]> Cc: "Sören Brinkmann" <[email protected]> Cc: [email protected] Cc: [email protected] Acked-by: Gregory Fong <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2016-02-23gpio: tb10x: Use devm_gpiochip_add_data() for gpio registrationLaxman Dewangan1-16/+6
Use devm_gpiochip_add_data() for GPIO registration and clean the error path. Signed-off-by: Laxman Dewangan <[email protected]>
2016-01-05gpio: tb10x: use gpiochip data pointerLinus Walleij1-11/+6
This makes the driver use the data pointer added to the gpio_chip to store a pointer to the state container instead of relying on container_of(). Cc: Christian Ruppert <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-11-19gpio: change member .dev to .parentLinus Walleij1-1/+1
The name .dev in a struct is normally reserved for a struct device that is let us say a superclass to the thing described by the struct. struct gpio_chip stands out by confusingly using a struct device *dev to point to the parent device (such as a platform_device) that represents the hardware. As we want to give gpio_chip:s real devices, this is not working. We need to rename this member to parent. This was done by two coccinelle scripts, I guess it is possible to combine them into one, but I don't know such stuff. They look like this: @@ struct gpio_chip *var; @@ -var->dev +var->parent and: @@ struct gpio_chip var; @@ -var.dev +var.parent and: @@ struct bgpio_chip *var; @@ -var->gc.dev +var->gc.parent Plus a few instances of bgpio that I couldn't figure out how to teach Coccinelle to rewrite. This patch hits all over the place, but I *strongly* prefer this solution to any piecemal approaches that just exercise patch mechanics all over the place. It mainly hits drivers/gpio and drivers/pinctrl which is my own backyard anyway. Cc: Haavard Skinnemoen <[email protected]> Cc: Rafał Miłecki <[email protected]> Cc: Richard Purdie <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: Alek Du <[email protected]> Cc: Jaroslav Kysela <[email protected]> Cc: Takashi Iwai <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Lee Jones <[email protected]> Acked-by: Jiri Kosina <[email protected]> Acked-by: Hans-Christian Egtvedt <[email protected]> Acked-by: Jacek Anaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-10-16gpio: replace trivial implementations of request/free with generic oneJonas Gorski1-12/+2
Replace all trivial request/free callbacks that do nothing but call into pinctrl code with the generic versions. Signed-off-by: Jonas Gorski <[email protected]> Reviewed-by: Thomas Petazzoni <[email protected]> Acked-by: James Hogan <[email protected]> Acked-by: Stefan Agner <[email protected]> Acked-by: Joachim Eastwood <[email protected]> Acked-by: Gregory CLEMENT <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-06-02gpio: tb10x: Drop unneeded free_irq() callAxel Lin1-1/+0
Current code uses devm_request_irq() in .probe, so drop the unneeded free_irq() call in .remove. Signed-off-by: Axel Lin <[email protected]> Acked-by: Christian Ruppert <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-27gpio: gpio-tb10x: remove incorrect __exit markupDmitry Torokhov1-1/+1
Even if bus is not hot-pluggable, the devices can be unbound from the driver via sysfs, so we should not be using __exit annotations on remove() methods. The only exception is drivers registered with platform_driver_probe() which specifically disables sysfs bind/unbind attributes. Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2014-12-14Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds1-1/+0
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
2014-10-28gpio: gpio-tb10x: remove duplicate check on resourceVarka Bhadram1-6/+1
Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2014-10-20gpio: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <[email protected]>
2014-07-22gpio: remove all usage of gpio_remove retval in driver/gpioabdoulaye berthe1-4/+1
Signed-off-by: abdoulaye berthe <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2014-01-02gpio: tb10x: Remove redundant of_match_ptr helperSachin Kamat1-1/+1
'tb10x_gpio_dt_ids' is always compiled in. Hence the helper macro is not needed. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2013-12-09Merge tag 'v3.13-rc3' into develLinus Walleij1-0/+1
Linux 3.13-rc3
2013-12-04gpio/pinctrl: make gpio_chip members typed booleanLinus Walleij1-1/+1
This switches the two members of struct gpio_chip that were defined as unsigned foo:1 to bool, because that is indeed what they are. Switch all users in the gpio and pinctrl subsystems to assign these values with true/false instead of 0/1. The users outside these subsystems will survive since true/false is 1/0, atleast we set some kind of more strict typing example. Signed-off-by: Linus Walleij <[email protected]>
2013-11-25gpio: tb10x: Set output value before setting direction to outputAxel Lin1-0/+1
Signed-off-by: Axel Lin <[email protected]> Acked-by: Christian Ruppert <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2013-10-30gpio: tb10x: fix return value check in tb10x_gpio_probe()Wei Yongjun1-4/+2
In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Also remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2013-10-30gpio: tb10x: use module_platform_driver to simplify the codeWei Yongjun1-12/+1
module_platform_driver() makes the code simpler by eliminating boilerplate code. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2013-10-25gpio: add TB10x GPIO driverChristian Ruppert1-0/+341
The GPIO driver for the Abilis Systems TB10x series of SOCs based on ARC700 CPUs. It supports GPIO control and GPIO interrupt generation. This driver works in conjunction with the TB10x pinctrl driver. Signed-off-by: Sascha Leuenberger <[email protected]> Signed-off-by: Christian Ruppert <[email protected]> Acked-by: Kumar Gala <[email protected]> Signed-off-by: Linus Walleij <[email protected]>