mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-20 16:22:07 +07:00
832f5dacfa
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 <albeu@free.fr> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Cc: linux-mips@linux-mips.org Cc: Hauke Mehrtens <hauke@hauke-m.de> Cc: Rafał Miłecki <zajec5@gmail.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Tejun Heo <tj@kernel.org> Cc: Alexandre Courbot <gnurou@gmail.com> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Florian Fainelli <florian@openwrt.org> Cc: Manuel Lauss <manuel.lauss@gmail.com> Cc: Joe Perches <joe@perches.com> Cc: Daniel Walter <dwalter@google.com> Cc: Sergey Ryazanov <ryazanov.s.a@gmail.com> Cc: Huacai Chen <chenhc@lemote.com> Cc: James Hartley <james.hartley@imgtec.com> Cc: Andrew Bresticker <abrestic@chromium.org> Cc: Paul Burton <paul.burton@imgtec.com> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Wolfram Sang <wsa@the-dreams.de> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Varka Bhadram <varkabhadram@gmail.com> Cc: Masanari Iida <standby24x7@gmail.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Michael Buesch <m@bues.ch> Cc: abdoulaye berthe <berthe.ab@gmail.com> Cc: linux-kernel@vger.kernel.org Cc: linux-ide@vger.kernel.org Cc: linux-gpio@vger.kernel.org Cc: linux-input@vger.kernel.org Cc: netdev@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/10828/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
79 lines
2.0 KiB
C
79 lines
2.0 KiB
C
/*
|
|
* Copyright 2002 Integrated Device Technology, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* GPIO register definition.
|
|
*
|
|
* Author : ryan.holmQVist@idt.com
|
|
* Date : 20011005
|
|
* Copyright (C) 2001, 2002 Ryan Holm <ryan.holmQVist@idt.com>
|
|
* Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
|
|
*/
|
|
|
|
#ifndef _RC32434_GPIO_H_
|
|
#define _RC32434_GPIO_H_
|
|
|
|
struct rb532_gpio_reg {
|
|
u32 gpiofunc; /* GPIO Function Register
|
|
* gpiofunc[x]==0 bit = gpio
|
|
* func[x]==1 bit = altfunc
|
|
*/
|
|
u32 gpiocfg; /* GPIO Configuration Register
|
|
* gpiocfg[x]==0 bit = input
|
|
* gpiocfg[x]==1 bit = output
|
|
*/
|
|
u32 gpiod; /* GPIO Data Register
|
|
* gpiod[x] read/write gpio pinX status
|
|
*/
|
|
u32 gpioilevel; /* GPIO Interrupt Status Register
|
|
* interrupt level (see gpioistat)
|
|
*/
|
|
u32 gpioistat; /* Gpio Interrupt Status Register
|
|
* istat[x] = (gpiod[x] == level[x])
|
|
* cleared in ISR (STICKY bits)
|
|
*/
|
|
u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
|
|
};
|
|
|
|
/* UART GPIO signals */
|
|
#define RC32434_UART0_SOUT (1 << 0)
|
|
#define RC32434_UART0_SIN (1 << 1)
|
|
#define RC32434_UART0_RTS (1 << 2)
|
|
#define RC32434_UART0_CTS (1 << 3)
|
|
|
|
/* M & P bus GPIO signals */
|
|
#define RC32434_MP_BIT_22 (1 << 4)
|
|
#define RC32434_MP_BIT_23 (1 << 5)
|
|
#define RC32434_MP_BIT_24 (1 << 6)
|
|
#define RC32434_MP_BIT_25 (1 << 7)
|
|
|
|
/* CPU GPIO signals */
|
|
#define RC32434_CPU_GPIO (1 << 8)
|
|
|
|
/* Reserved GPIO signals */
|
|
#define RC32434_AF_SPARE_6 (1 << 9)
|
|
#define RC32434_AF_SPARE_4 (1 << 10)
|
|
#define RC32434_AF_SPARE_3 (1 << 11)
|
|
#define RC32434_AF_SPARE_2 (1 << 12)
|
|
|
|
/* PCI messaging unit */
|
|
#define RC32434_PCI_MSU_GPIO (1 << 13)
|
|
|
|
/* NAND GPIO signals */
|
|
#define GPIO_RDY 8
|
|
#define GPIO_WPX 9
|
|
#define GPIO_ALE 10
|
|
#define GPIO_CLE 11
|
|
|
|
/* Compact Flash GPIO pin */
|
|
#define CF_GPIO_NUM 13
|
|
|
|
/* S1 button GPIO (shared with UART0_SIN) */
|
|
#define GPIO_BTN_S1 1
|
|
|
|
extern void rb532_gpio_set_ilevel(int bit, unsigned gpio);
|
|
extern void rb532_gpio_set_istat(int bit, unsigned gpio);
|
|
extern void rb532_gpio_set_func(unsigned gpio);
|
|
|
|
#endif /* _RC32434_GPIO_H_ */
|