aboutsummaryrefslogtreecommitdiff
path: root/arch/mips/alchemy/board-gpr.c
AgeCommit message (Collapse)AuthorFilesLines
2020-10-06MIPS: alchemy: Share prom_init implementationThomas Bogendoerfer1-17/+0
All boards have the same prom_init() function. Move it to common code and delete the duplicates. Signed-off-by: Thomas Bogendoerfer <[email protected]>
2019-05-24treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 102Thomas Gleixner1-14/+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 as published by the free software foundation either version 2 of the license or at your option any later version 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 51 franklin st fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 50 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Richard Fontana <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-07-17mips: unify prom_putchar() declarationsAlexander Sverdlin1-1/+2
prom_putchar() is used centrally in early printk infrastructure therefore at least MIPS should agree on the function return type. [[email protected]: - Include linux/types.h in asm/setup.h to gain the bool typedef before we start include asm/setup.h elsewhere. - Include asm/setup.h in all files that use or define prom_putchar(). - Also standardise on signed rather than unsigned char argument.] Signed-off-by: Alexander Sverdlin <[email protected]> Signed-off-by: Paul Burton <[email protected]> Patchwork: https://patchwork.linux-mips.org/patch/19842/ Cc: [email protected] Cc: Ralf Baechle <[email protected]> Cc: James Hogan <[email protected]> Cc: Jonas Gorski <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Kate Stewart <[email protected]> Cc: Philippe Ombredanne <[email protected]>
2018-05-17i2c: gpio: move header to platform_dataWolfram Sang1-1/+1
This header only contains platform_data. Move it to the proper directory. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Tony Lindgren <[email protected]> Acked-by: Lee Jones <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Acked-by: James Hogan <[email protected]> Acked-by: Greg Ungerer <[email protected]>
2018-02-19MIPS: Alchemy: Constify gpio_ledArvind Yadav1-1/+1
gpio_leds are not supposed to change at runtime. struct gpio_led_platform_data contains a const struct gpio_led pointer since v2.6.39, so mark the gpio_led structures const too. Signed-off-by: Arvind Yadav <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/18006/ [[email protected]: improve commit message] Signed-off-by: James Hogan <[email protected]>
2017-10-30i2c: gpio: Augment all boardfiles to use open drainLinus Walleij1-0/+4
We now handle the open drain mode internally in the I2C GPIO driver, but we will get warnings from the gpiolib that we override the default mode of the line so it becomes open drain. We can fix all in-kernel users by simply passing the right flag along in the descriptor table, and we already touched all of these files in the series so let's just tidy it up. Cc: Steven Miao <[email protected]> Cc: Ralf Baechle <[email protected]> Acked-by: Olof Johansson <[email protected]> Acked-by: Lee Jones <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Acked-by: Ralf Baechle <[email protected]> Acked-by: Wu, Aaron <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-10-30i2c: gpio: Convert to use descriptorsLinus Walleij1-2/+17
This converts the GPIO-based I2C-driver to using GPIO descriptors instead of the old global numberspace-based GPIO interface. We: - Convert the driver to unconditionally grab two GPIOs from the device by index 0 (SDA) and 1 (SCL) which will work fine with device tree and descriptor tables. The existing device trees will continue to work just like before, but without any roundtrip through the global numberspace. - Brutally convert all boardfiles still passing global GPIOs by registering descriptor tables associated with the devices instead so this driver does not need to keep supporting passing any GPIO numbers as platform data. There is no stepwise approach as elegant as this, I strongly prefer this big hammer over any antsteps for this conversion. This way the old GPIO numbers go away and NEVER COME BACK. Special conversion for the different boards utilizing I2C-GPIO: - EP93xx (arch/arm/mach-ep93xx): pretty straight forward as all boards were using the same two GPIO lines, just define these two in a lookup table for "i2c-gpio" and register these along with the device. None of them define any other platform data so just pass NULL as platform data. This platform selects GPIOLIB so all should be smooth. The pins appear on a gpiochip for bank "G" as pins 1 (SDA) and 0 (SCL). - IXP4 (arch/arm/mach-ixp4): descriptor tables have to be registered for each board separately. They all use "IXP4XX_GPIO_CHIP" so it is pretty straight forward. Most board define no other platform data than SCL/SDA so they can drop the #include of <linux/i2c-gpio.h> and assign NULL to platform data. The "goramo_mlr" (Goramo Multilink Router) board is a bit worrisome: it implements its own I2C bit-banging in the board file, and optionally registers an I2C serial port, but claims the same GPIO lines for itself in the board file. This is not going to work: there will be competition for the GPIO lines, so delete the optional extra I2C bus instead, no I2C devices are registered on it anyway, there are just hints that it may contain an EEPROM that may be accessed from userspace. This needs to be fixed up properly by the serial clock using I2C emulation so drop a note in the code. - KS8695 board acs5k (arch/arm/mach-ks8695/board-acs5.c) has some platform data in addition to the pins so it needs to be kept around sans GPIO lines. Its GPIO chip is named "KS8695" and the arch selects GPIOLIB. - PXA boards (arch/arm/mach-pxa/*) use some of the platform data so it needs to be preserved here. The viper board even registers two GPIO I2Cs. The gpiochip is named "gpio-pxa" and the arch selects GPIOLIB. - SA1100 Simpad (arch/arm/mach-sa1100/simpad.c) defines a GPIO I2C bus, and the arch selects GPIOLIB. - Blackfin boards (arch/blackfin/bf533 etc) for these I assume their I2C GPIOs refer to the local gpiochip defined in arch/blackfin/kernel/bfin_gpio.c names "BFIN-GPIO". The arch selects GPIOLIB. The boards get spiked with IF_ENABLED(I2C_GPIO) but that is a side effect of it being like that already (I would just have Kconfig select I2C_GPIO and get rid of them all.) I also delete any platform data set to 0 as it will get that value anyway from static declartions of platform data. - The MIPS selects GPIOLIB and the Alchemy machine is using two local GPIO chips, one of them has a GPIO I2C. We need to adjust the local offset from the global number space here. The ATH79 has a proper GPIO driver in drivers/gpio/gpio-ath79.c and AFAICT the chip is named "ath79-gpio" and the PB44 PCF857x expander spawns from this on GPIO 1 and 0. The latter board only use the platform data to specify pins so it can be cut altogether after this. - The MFD Silicon Motion SM501 is a special case. It dynamically spawns an I2C bus off the MFD using sm501_create_subdev(). We use an approach to dynamically create a machine descriptor table and attach this to the "SM501-LOW" or "SM501-HIGH" gpiochip. We use chip-local offsets to grab the right lines. We can get rid of two local static inline helpers as part of this refactoring. Cc: Steven Miao <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Magnus Damm <[email protected]> Cc: Ben Dooks <[email protected]> Cc: Heiko Schocher <[email protected]> Acked-by: Wu, Aaron <[email protected]> Acked-by: Olof Johansson <[email protected]> Acked-by: Lee Jones <[email protected]> Acked-by: Ralf Baechle <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-25MIPS: Alchemy: Remove duplicate initializerArnd Bergmann1-1/+0
We get a harmless warning about a duplicate initalizer for the i2c board info structure: arch/mips/alchemy/board-gpr.c:239:11: error: initialized field overwritten [-Werror=override-init] As both initializers have the identical value, we can simply drop the second one. Signed-off-by: Arnd Bergmann <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/15046/ Signed-off-by: Ralf Baechle <[email protected]>
2015-09-03MIPS: Remove all the uses of custom gpio.hAlban Bedel1-0/+1
Currently CONFIG_ARCH_HAVE_CUSTOM_GPIO_H is defined for all MIPS machines, and each machine type provides its own gpio.h. However only a handful really implement the GPIO API, most just forward everythings to gpiolib. The Alchemy machine is notable as it provides a system to allow implementing the GPIO API at the board level. But it is not used by any board currently supported, so it can also be removed. For most machine types we can just remove the custom gpio.h, as well as the custom wrappers if some exists. Some of the code found in the wrappers must be moved to the respective GPIO driver. A few more fixes are need in some drivers as they rely on linux/gpio.h to provides some machine specific definitions, or used asm/gpio.h instead of linux/gpio.h for the gpio API. Signed-off-by: Alban Bedel <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Cc: [email protected] Cc: Hauke Mehrtens <[email protected]> Cc: Rafał Miłecki <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Alexandre Courbot <[email protected]> Cc: Dmitry Torokhov <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Manuel Lauss <[email protected]> Cc: Joe Perches <[email protected]> Cc: Daniel Walter <[email protected]> Cc: Sergey Ryazanov <[email protected]> Cc: Huacai Chen <[email protected]> Cc: James Hartley <[email protected]> Cc: Andrew Bresticker <[email protected]> Cc: Paul Burton <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Wolfram Sang <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Varka Bhadram <[email protected]> Cc: Masanari Iida <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: Michael Buesch <[email protected]> Cc: abdoulaye berthe <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/10828/ Signed-off-by: Ralf Baechle <[email protected]>
2014-03-06MIPS: Alchemy: Fix unchecked kstrtoul return valueManuel Lauss1-3/+1
enabled __must_check logic triggers a build error for mtx1 and gpr in the prom init code. Fix by checking the kstrtoul() return value. Signed-off-by: Manuel Lauss <[email protected]> Cc: Linux-MIPS <[email protected]> Patchwork: https://patchwork.linux-mips.org/patch/6574/ Signed-off-by: Ralf Baechle <[email protected]>
2013-05-22MIPS: Idle: Consolidate all declarations in <asm/idle.h>.Ralf Baechle1-0/+1
Signed-off-by: Ralf Baechle <[email protected]>
2013-02-01MIPS: Whitespace cleanup.Ralf Baechle1-6/+6
Having received another series of whitespace patches I decided to do this once and for all rather than dealing with this kind of patches trickling in forever. Signed-off-by: Ralf Baechle <[email protected]>
2011-12-07MIPS: Alchemy: merge GPR/MTX-1/XXS1500 board code into single filesManuel Lauss1-0/+303
Most of these files are have more comments than real code; merge them all into single board-<name>.c files. Signed-off-by: Manuel Lauss <[email protected]> To: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/2869/ Signed-off-by: Ralf Baechle <[email protected]>