linux: add 'GPIOI' for linux process (#5926)

Signed-off-by: Alan.Ma from BigTreeTech tech@biqu3d.com
This commit is contained in:
BIGTREETECH 2022-12-12 09:07:58 +08:00 committed by GitHub
parent 03006f5ca3
commit 516fdae2b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -27,6 +27,7 @@ DECL_ENUMERATION_RANGE("pin", "gpiochip4/gpio0", GPIO(4, 0), MAX_GPIO_LINES);
DECL_ENUMERATION_RANGE("pin", "gpiochip5/gpio0", GPIO(5, 0), MAX_GPIO_LINES); DECL_ENUMERATION_RANGE("pin", "gpiochip5/gpio0", GPIO(5, 0), MAX_GPIO_LINES);
DECL_ENUMERATION_RANGE("pin", "gpiochip6/gpio0", GPIO(6, 0), MAX_GPIO_LINES); DECL_ENUMERATION_RANGE("pin", "gpiochip6/gpio0", GPIO(6, 0), MAX_GPIO_LINES);
DECL_ENUMERATION_RANGE("pin", "gpiochip7/gpio0", GPIO(7, 0), MAX_GPIO_LINES); DECL_ENUMERATION_RANGE("pin", "gpiochip7/gpio0", GPIO(7, 0), MAX_GPIO_LINES);
DECL_ENUMERATION_RANGE("pin", "gpiochip8/gpio0", GPIO(8, 0), MAX_GPIO_LINES);
struct gpio_line { struct gpio_line {
int chipid; int chipid;
@ -34,8 +35,8 @@ struct gpio_line {
int fd; int fd;
int state; int state;
}; };
static struct gpio_line gpio_lines[8 * MAX_GPIO_LINES]; static struct gpio_line gpio_lines[9 * MAX_GPIO_LINES];
static int gpio_chip_fd[8] = { -1, -1, -1, -1, -1, -1, -1, -1 }; static int gpio_chip_fd[9] = { -1, -1, -1, -1, -1, -1, -1, -1, -1 };
static int static int
get_chip_fd(uint8_t chipId) get_chip_fd(uint8_t chipId)

View File

@ -6,7 +6,7 @@
#include <stdint.h> // uint32_t #include <stdint.h> // uint32_t
#include "autoconf.h" // CONFIG_CLOCK_FREQ #include "autoconf.h" // CONFIG_CLOCK_FREQ
#define MAX_GPIO_LINES 256 #define MAX_GPIO_LINES 288
#define GPIO(PORT, NUM) ((PORT) * MAX_GPIO_LINES + (NUM)) #define GPIO(PORT, NUM) ((PORT) * MAX_GPIO_LINES + (NUM))
#define GPIO2PORT(PIN) ((PIN) / MAX_GPIO_LINES) #define GPIO2PORT(PIN) ((PIN) / MAX_GPIO_LINES)
#define GPIO2PIN(PIN) ((PIN) % MAX_GPIO_LINES) #define GPIO2PIN(PIN) ((PIN) % MAX_GPIO_LINES)