aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-loongson.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-05-16gpio: loongson: Use BIT() macrosLinus Walleij1-14/+11
This switches the Loongson driver over to using the bitops BIT() macros and drops some local variables and make the code easier to read (in my opinion). Cc: Keguang Zhang <keguang.zhang@gmail.com> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> Cc: Huacai Chen <chenhc@lemote.com> Cc: linux-mips@linux-mips.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2018-05-16gpio: loongson: Create a dynamic platform deviceLinus Walleij1-10/+37
It is pretty helpful to create some kind of device for backing the GPIO chips, especially when preparing the driver for using GENERIC_GPIO, so let's create a simple platform device and a simple platform device driver and create the gpiochip in the .probe() routine for the device driver. Keep all at the core initcall so the behaviour is the same as before. Cc: Keguang Zhang <keguang.zhang@gmail.com> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> Cc: Huacai Chen <chenhc@lemote.com> Cc: linux-mips@linux-mips.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2018-05-16gpio: loongson: Use right includeLinus Walleij1-33/+33
The driver includes <linux/gpio.h> which is wrong, rely on <linux/gpio/driver.h> and remove to call to gpio_set_value() in favor of calling the internal function. Move functions around to avoid forward declarations. Cc: Keguang Zhang <keguang.zhang@gmail.com> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> Cc: Huacai Chen <chenhc@lemote.com> Cc: linux-mips@linux-mips.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-01-05gpio: convert remaining users to gpiochip_add_data()Linus Walleij1-1/+1
For completion, sweep the floor from all gpiochip_add() usage so we can remove that function and get rid of the function wrapper gpiochip_add(). Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-04-08gpio: loongson: Add Loongson-3A/3B GPIO driver supportHuacai Chen1-17/+27
Improve Loongson-2's GPIO driver to support Loongson-3A/3B, and update Loongson-3's default config file. Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Huacai Chen <chenhc@lemote.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-04-07MIPS: Move Loongson GPIO driver to drivers/gpioHuacai Chen1-0/+105
Move Loongson-2's GPIO driver to drivers/gpio and add Kconfig options. Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Huacai Chen <chenhc@lemote.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>