mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
This is the bulk of pin control changes for the v4.16 kernel cycle:
Core changes:
- After lengthy discussions and partly due to my ignorance, we have
merged a patch making pinctrl_force_default() and pinctrl_force_sleep()
reprogram the states into the hardware of any hogged pins, even
if they are already in the desired state. This only apply to hogged
pins since groups of pins owned by drivers need to be managed by
each driver, lest they could not do things like runtime PM and
put pins to sleeping state even if the system as a whole is not
in sleep.
New drivers:
- New driver for the Microsemi Ocelot SoC. This is used in ethernet
switches.
- The X-Powers AXP209 GPIO driver was extended to also deal with pin
control and moved over from the GPIO subsystem. This circuit is
a mixed-mode integrated circuit which is part of AllWinner designs.
- New subdriver for the Qualcomm MSM8998 SoC, core of a high end
mobile devices (phones) chipset.
- New subdriver for the ST Microelectronics STM32MP157 MPU and
STM32F769 MCU from the STM32 family.
- New subdriver for the MediaTek MT7622 SoC. This is used for routers,
repeater, gateways and such network infrastructure.
- New subdriver for the NXP (former Freescale) i.MX 6ULL. This SoC has
multimedia features and target "smart devices", I guess in-car
entertainment, in-flight entertainment, industrial control panels etc.
General improvements:
- Incremental improvements on the SH-PFC subdrivers for things like
the CAN bus.
- Enable the glitch filter on Baytrail GPIOs used for interrupts.
- Proper handling of pins to GPIO ranges on the Semtec SX150X
- An IRQ setup ordering fix on MCP23S08.
- A good set of janitorial coding style fixes.
-----BEGIN PGP SIGNATURE-----
iQIcBAABAgAGBQJadGEKAAoJEEEQszewGV1zA4QQALs8edxhv4qV5vm50mTdrO3n
QtRhJNb53j6MIKtjFnazMvh6MXRIP+08SyX9sDLi5AxINIVuyQh3mrcB6Zc9zN58
+6jFFOIbfm5E8by4n3wnKm3F/WAbNBZph9eT2Rn3cDv9o9hQbyNJ50sQkQMCjd9X
WGR353c3OL4zb3vU8t72G/RPYUY1w1SkG9bGzRuSif8LawDcN6v6MMo2XhZA6RqM
3qYIG29vJ1n0weggUIBeSAJIzk4eMwcoWCbVWxhns5JGxw5VPES1zbSp1D+mbzRC
01i5Pt/gD+cWN/Kk/zKIMo1OqLAl+uLr6hzepj6W+5wu9CcQz/BgvRx7HUqnqgyh
S8cN4AOgWmW+T75pHypd1WVic3q0RCXkFY8jjHpCATDY+Z+js0lZRs3y4DBiJ2ys
DMVBeumDINKqaZ6aLH6lVkm+SxXOUy143arQQIzi0/F7fAp68i+9ofIO8B5smEmd
0S+3sT0sO5QXVgZJ0t0iGUUG5irXi8XtF5qvRmuFZUe0OLGgKX20oCdC0pH0WU4M
OZO1Bvb8vmn1tddogO2WlHeg6amWdwxtDuBsLRO3YILLu3jwPjhNqNmErXzXEmWt
TY9l2M1uQmoJibNpmTjOzSfj4OtUHMwkDrFRJHAcUPcKwdEy4MyzFL16ATnIwgY9
AmyMLNWJd8Wazgc6BK6w
=gLY/
-----END PGP SIGNATURE-----
Merge tag 'pinctrl-v4.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control updates from Linus Walleij:
"This is the bulk of pin control changes for the v4.16 kernel cycle.
Like with GPIO it is actually a bit calm this time.
Core changes:
- After lengthy discussions and partly due to my ignorance, we have
merged a patch making pinctrl_force_default() and
pinctrl_force_sleep() reprogram the states into the hardware of any
hogged pins, even if they are already in the desired state.
This only apply to hogged pins since groups of pins owned by
drivers need to be managed by each driver, lest they could not do
things like runtime PM and put pins to sleeping state even if the
system as a whole is not in sleep.
New drivers:
- New driver for the Microsemi Ocelot SoC. This is used in ethernet
switches.
- The X-Powers AXP209 GPIO driver was extended to also deal with pin
control and moved over from the GPIO subsystem. This circuit is a
mixed-mode integrated circuit which is part of AllWinner designs.
- New subdriver for the Qualcomm MSM8998 SoC, core of a high end
mobile devices (phones) chipset.
- New subdriver for the ST Microelectronics STM32MP157 MPU and
STM32F769 MCU from the STM32 family.
- New subdriver for the MediaTek MT7622 SoC. This is used for
routers, repeater, gateways and such network infrastructure.
- New subdriver for the NXP (former Freescale) i.MX 6ULL. This SoC
has multimedia features and target "smart devices", I guess in-car
entertainment, in-flight entertainment, industrial control panels
etc.
General improvements:
- Incremental improvements on the SH-PFC subdrivers for things like
the CAN bus.
- Enable the glitch filter on Baytrail GPIOs used for interrupts.
- Proper handling of pins to GPIO ranges on the Semtec SX150X
- An IRQ setup ordering fix on MCP23S08.
- A good set of janitorial coding style fixes"
* tag 'pinctrl-v4.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (102 commits)
pinctrl: mcp23s08: fix irq setup order
pinctrl: Forward declare struct device
pinctrl: sunxi: Use of_clk_get_parent_count() instead of open coding
pinctrl: stm32: add STM32F769 MCU support
pinctrl: sx150x: Add a static gpio/pinctrl pin range mapping
pinctrl: sx150x: Register pinctrl before adding the gpiochip
pinctrl: sx150x: Unregister the pinctrl on release
pinctrl: ingenic: Remove redundant dev_err call in ingenic_pinctrl_probe()
pinctrl: sprd: Use seq_putc() in sprd_pinconf_group_dbg_show()
pinctrl: pinmux: Use seq_putc() in pinmux_pins_show()
pinctrl: abx500: Use seq_putc() in abx500_gpio_dbg_show()
pinctrl: mediatek: mt7622: align error handling of mtk_hw_get_value call
pinctrl: mediatek: mt7622: fix potential uninitialized value being returned
pinctrl: uniphier: refactor drive strength get/set functions
pinctrl: imx7ulp: constify struct imx_cfg_params_decode
pinctrl: imx: constify struct imx_pinctrl_soc_info
pinctrl: imx7d: simplify imx7d_pinctrl_probe
pinctrl: imx: use struct imx_pinctrl_soc_info as a const
pinctrl: sunxi-pinctrl: fix pin funtion can not be match correctly.
pinctrl: qcom: Add msm8998 pinctrl driver
...
This commit is contained in:
commit
ef991796be
115 changed files with 13578 additions and 751 deletions
|
|
@ -505,4 +505,4 @@ module_platform_driver(uniphier_gpio_driver);
|
|||
|
||||
MODULE_AUTHOR("Masahiro Yamada <[email protected]>");
|
||||
MODULE_DESCRIPTION("UniPhier GPIO driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
|
|
|||
|
|
@ -58,58 +58,6 @@ static int acpi_gpiochip_find(struct gpio_chip *gc, void *data)
|
|||
return ACPI_HANDLE(gc->parent) == data;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PINCTRL
|
||||
/**
|
||||
* acpi_gpiochip_pin_to_gpio_offset() - translates ACPI GPIO to Linux GPIO
|
||||
* @gdev: GPIO device
|
||||
* @pin: ACPI GPIO pin number from GpioIo/GpioInt resource
|
||||
*
|
||||
* Function takes ACPI GpioIo/GpioInt pin number as a parameter and
|
||||
* translates it to a corresponding offset suitable to be passed to a
|
||||
* GPIO controller driver.
|
||||
*
|
||||
* Typically the returned offset is same as @pin, but if the GPIO
|
||||
* controller uses pin controller and the mapping is not contiguous the
|
||||
* offset might be different.
|
||||
*/
|
||||
static int acpi_gpiochip_pin_to_gpio_offset(struct gpio_device *gdev, int pin)
|
||||
{
|
||||
struct gpio_pin_range *pin_range;
|
||||
|
||||
/* If there are no ranges in this chip, use 1:1 mapping */
|
||||
if (list_empty(&gdev->pin_ranges))
|
||||
return pin;
|
||||
|
||||
list_for_each_entry(pin_range, &gdev->pin_ranges, node) {
|
||||
const struct pinctrl_gpio_range *range = &pin_range->range;
|
||||
int i;
|
||||
|
||||
if (range->pins) {
|
||||
for (i = 0; i < range->npins; i++) {
|
||||
if (range->pins[i] == pin)
|
||||
return range->base + i - gdev->base;
|
||||
}
|
||||
} else {
|
||||
if (pin >= range->pin_base &&
|
||||
pin < range->pin_base + range->npins) {
|
||||
unsigned gpio_base;
|
||||
|
||||
gpio_base = range->base - gdev->base;
|
||||
return gpio_base + pin - range->pin_base;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
#else
|
||||
static inline int acpi_gpiochip_pin_to_gpio_offset(struct gpio_device *gdev,
|
||||
int pin)
|
||||
{
|
||||
return pin;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* acpi_get_gpiod() - Translate ACPI GPIO pin to GPIO descriptor usable with GPIO API
|
||||
* @path: ACPI GPIO controller full path name, (e.g. "\\_SB.GPO1")
|
||||
|
|
@ -125,7 +73,6 @@ static struct gpio_desc *acpi_get_gpiod(char *path, int pin)
|
|||
struct gpio_chip *chip;
|
||||
acpi_handle handle;
|
||||
acpi_status status;
|
||||
int offset;
|
||||
|
||||
status = acpi_get_handle(NULL, path, &handle);
|
||||
if (ACPI_FAILURE(status))
|
||||
|
|
@ -135,11 +82,7 @@ static struct gpio_desc *acpi_get_gpiod(char *path, int pin)
|
|||
if (!chip)
|
||||
return ERR_PTR(-EPROBE_DEFER);
|
||||
|
||||
offset = acpi_gpiochip_pin_to_gpio_offset(chip->gpiodev, pin);
|
||||
if (offset < 0)
|
||||
return ERR_PTR(offset);
|
||||
|
||||
return gpiochip_get_desc(chip, offset);
|
||||
return gpiochip_get_desc(chip, pin);
|
||||
}
|
||||
|
||||
static irqreturn_t acpi_gpio_irq_handler(int irq, void *data)
|
||||
|
|
@ -216,10 +159,6 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
|
|||
if (!handler)
|
||||
return AE_OK;
|
||||
|
||||
pin = acpi_gpiochip_pin_to_gpio_offset(chip->gpiodev, pin);
|
||||
if (pin < 0)
|
||||
return AE_BAD_PARAMETER;
|
||||
|
||||
desc = gpiochip_request_own_desc(chip, pin, "ACPI:Event");
|
||||
if (IS_ERR(desc)) {
|
||||
dev_err(chip->parent, "Failed to request GPIO\n");
|
||||
|
|
@ -871,12 +810,6 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,
|
|||
struct gpio_desc *desc;
|
||||
bool found;
|
||||
|
||||
pin = acpi_gpiochip_pin_to_gpio_offset(chip->gpiodev, pin);
|
||||
if (pin < 0) {
|
||||
status = AE_BAD_PARAMETER;
|
||||
goto out;
|
||||
}
|
||||
|
||||
mutex_lock(&achip->conn_lock);
|
||||
|
||||
found = false;
|
||||
|
|
@ -1009,11 +942,7 @@ static struct gpio_desc *acpi_gpiochip_parse_own_gpio(
|
|||
if (ret < 0)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
ret = acpi_gpiochip_pin_to_gpio_offset(chip->gpiodev, gpios[0]);
|
||||
if (ret < 0)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
desc = gpiochip_get_desc(chip, ret);
|
||||
desc = gpiochip_get_desc(chip, gpios[0]);
|
||||
if (IS_ERR(desc))
|
||||
return desc;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue