mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
c7d28eca1d
Core: - Export add/remove for lookup tables so that modules can export GPIO descriptor tables. - Handle GPIO sleep states: it is now possible to flag that a GPIO line may loose its state during suspend/resume of the system to save power. This is used in the Wolfson Micro Arizona driver. - ACPI-based GPIO was tightened up a lot around the edges. - Use bitmap_fill() to speed up a loop. New drivers: - Exar XRA1403 SPI-based GPIO. - MVEBU driver now supports Armada 7K and 8K. - LP87565 PMIC GPIO. - Renesas R-CAR R8A7743 (RZ/G1M). - The new IOT2040 8250 serial/GPIO also comes in through this changeset. Substantial driver changes: - Seriously fix the Exar 8250 GPIO portions to work. - The MCP23S08 was moved out to a pin control driver. - Convert MEVEBU to use regmap for register access. - Drop Vulcan support from the Broadcom driver. - Serious cleanup and improvement of the mockup driver, giving us a better test coverage. Misc: - Lots of janitorial clean up. - A bunch of documentation fixes. -----BEGIN PGP SIGNATURE----- iQIcBAABAgAGBQJZX1MjAAoJEEEQszewGV1zEYUQALFsjJH7D2mRN4TSSEeVAcYr Uz52uupsou8tgW0IupRb/khO+V6zgd7j+kHDJLMxX+rCTw3pTq5+XGyi5+iNpxof TIIT1XBx4eq7Q/n4nWdGodHbHN9BXw7cGsNmTb1TS/G/6h1wOKxfzjvUNhDAC+2v idPy6B5G+WrDsYpBtTWlKHKQKVqbUlhLFyJYoglzqIeM5L9Ry/UoZ6sGleho3hKn Vlg/hMtkCexnVO9zopBe5CuEfseLrkcCgCvtQ713egzVXApryp4hqm3Xti20Ntgy OxnKhmVyloqd0kU0qLSpvDAf7B1invbHHbeZsag6wluTMrxgUYJONuonrqGeGiwB FBDtw9SGn2GlEXcs7sg8ANmAyr2XxxezKXD9XLBL5jadNB2KCY5yKMv1IK3VnYdq gEpFAiZ5cmlpZxIXqlyeZP6LKHNTci4amb33x1I/ghH2BTkGQ/3E3anXEbPNWF8G DDE6nrSgU0oQcNqRHyZaWNZpUIz4aFUgJtOEO4lYYP4+VzYSKTdrHseTiiJ91J7E WBz9p5JvSnB22+60RhyTAPjVjXgWa30nidf7WGCK0UHiIYffihCxGZRTlrhoEEUB fXgveJpqxLopYvxpUxi1OqlPYYo7zKRF5BzHsjKMpdVYXfdMdvs7eq2g/X889i1D WpbE9LyAH9FY5BM8YjFX =TpW1 -----END PGP SIGNATURE----- Merge tag 'gpio-v4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull GPIO updates from Linus Walleij: "This is the bulk of GPIO changes for the v4.13 series. Some administrativa: I have a slew of 8250 serial patches and the new IOT2040 serial+GPIO driver coming in through this tree, along with a whole bunch of Exar 8250 fixes. These are ACKed by Greg and also hit drivers/platform/* where they are ACKed by Andy Shevchenko. Speaking about drivers/platform/* there is also a bunch of ACPI stuff coming through that route, again ACKed by Andy. The MCP23S08 changes are coming in here as well. You already have the commits in your tree, so this is just a result of sharing an immutable branch between pin control and GPIO. Core: - Export add/remove for lookup tables so that modules can export GPIO descriptor tables. - Handle GPIO sleep states: it is now possible to flag that a GPIO line may loose its state during suspend/resume of the system to save power. This is used in the Wolfson Micro Arizona driver. - ACPI-based GPIO was tightened up a lot around the edges. - Use bitmap_fill() to speed up a loop. New drivers: - Exar XRA1403 SPI-based GPIO. - MVEBU driver now supports Armada 7K and 8K. - LP87565 PMIC GPIO. - Renesas R-CAR R8A7743 (RZ/G1M). - The new IOT2040 8250 serial/GPIO also comes in through this changeset. Substantial driver changes: - Seriously fix the Exar 8250 GPIO portions to work. - The MCP23S08 was moved out to a pin control driver. - Convert MEVEBU to use regmap for register access. - Drop Vulcan support from the Broadcom driver. - Serious cleanup and improvement of the mockup driver, giving us a better test coverage. Misc: - Lots of janitorial clean up. - A bunch of documentation fixes" * tag 'gpio-v4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (70 commits) serial: exar: Add support for IOT2040 device gpio-exar/8250-exar: Make set of exported GPIOs configurable platform: Accept const properties serial: exar: Factor out platform hooks gpio-exar/8250-exar: Rearrange gpiochip parenthood gpio: exar: Fix iomap request gpio-exar/8250-exar: Do not even instantiate a GPIO device for Commtech cards serial: uapi: Add support for bus termination gpio: rcar: Add R8A7743 (RZ/G1M) support gpio: gpio-wcove: Fix GPIO control register offset calculation gpio: lp87565: Add support for GPIO gpio: dwapb: fix missing first irq for edgeboth irq type MAINTAINERS: Take maintainership for GPIO ACPI support gpio: exar: Fix reading of directions and values gpio: exar: Allocate resources on behalf of the platform device gpio-exar/8250-exar: Fix passing in of parent PCI device gpio: mockup: use devm_kcalloc() where applicable gpio: mockup: add myself as author gpio: mockup: improve the error message gpio: mockup: don't return magic numbers from probe() ...
72 lines
2.2 KiB
C
72 lines
2.2 KiB
C
#ifndef __LINUX_GPIO_MACHINE_H
|
|
#define __LINUX_GPIO_MACHINE_H
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/list.h>
|
|
|
|
enum gpio_lookup_flags {
|
|
GPIO_ACTIVE_HIGH = (0 << 0),
|
|
GPIO_ACTIVE_LOW = (1 << 0),
|
|
GPIO_OPEN_DRAIN = (1 << 1),
|
|
GPIO_OPEN_SOURCE = (1 << 2),
|
|
GPIO_SLEEP_MAINTAIN_VALUE = (0 << 3),
|
|
GPIO_SLEEP_MAY_LOOSE_VALUE = (1 << 3),
|
|
};
|
|
|
|
/**
|
|
* struct gpiod_lookup - lookup table
|
|
* @chip_label: name of the chip the GPIO belongs to
|
|
* @chip_hwnum: hardware number (i.e. relative to the chip) of the GPIO
|
|
* @con_id: name of the GPIO from the device's point of view
|
|
* @idx: index of the GPIO in case several GPIOs share the same name
|
|
* @flags: mask of GPIO_* values
|
|
*
|
|
* gpiod_lookup is a lookup table for associating GPIOs to specific devices and
|
|
* functions using platform data.
|
|
*/
|
|
struct gpiod_lookup {
|
|
const char *chip_label;
|
|
u16 chip_hwnum;
|
|
const char *con_id;
|
|
unsigned int idx;
|
|
enum gpio_lookup_flags flags;
|
|
};
|
|
|
|
struct gpiod_lookup_table {
|
|
struct list_head list;
|
|
const char *dev_id;
|
|
struct gpiod_lookup table[];
|
|
};
|
|
|
|
/*
|
|
* Simple definition of a single GPIO under a con_id
|
|
*/
|
|
#define GPIO_LOOKUP(_chip_label, _chip_hwnum, _con_id, _flags) \
|
|
GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _con_id, 0, _flags)
|
|
|
|
/*
|
|
* Use this macro if you need to have several GPIOs under the same con_id.
|
|
* Each GPIO needs to use a different index and can be accessed using
|
|
* gpiod_get_index()
|
|
*/
|
|
#define GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _con_id, _idx, _flags) \
|
|
{ \
|
|
.chip_label = _chip_label, \
|
|
.chip_hwnum = _chip_hwnum, \
|
|
.con_id = _con_id, \
|
|
.idx = _idx, \
|
|
.flags = _flags, \
|
|
}
|
|
|
|
#ifdef CONFIG_GPIOLIB
|
|
void gpiod_add_lookup_table(struct gpiod_lookup_table *table);
|
|
void gpiod_remove_lookup_table(struct gpiod_lookup_table *table);
|
|
#else
|
|
static inline
|
|
void gpiod_add_lookup_table(struct gpiod_lookup_table *table) {}
|
|
static inline
|
|
void gpiod_remove_lookup_table(struct gpiod_lookup_table *table) {}
|
|
#endif
|
|
|
|
#endif /* __LINUX_GPIO_MACHINE_H */
|