mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
ARM: arm-soc: device tree conversions and enablement
Continued device tree conversion and enablement across a number of platforms; Kirkwood, tegra, i.MX, Exynos, zynq and a couple of other smaller series as well. ux500 has seen continued conversion for platforms. Several platforms have seen pinctrl-via-devicetree conversions for simpler multiplatform. Tegra is adding data for new devices/drivers, and Exynos has a bunch of new bindings and devices added as well. So, pretty much the same progression in the right direction as the last few releases. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJQySW7AAoJEIwa5zzehBx39xcP/jzEQOTOJdK4zJd1OjgrQoX/ WnhbGJT941RNjRjvDG6HmZzhpsRoE4q/zkjFEKoKELdikRW0hYoR+zPCGuB7XtN5 aF1ZQrTx4gHf4KE7doIB8slaWeOq8aG2TLFhylyy+cuaIpRK0NG0pAR0ZqWaoga9 tZFciqzplLeo50vZ+y+lVVsR40j/w29EjwPXhCV30//gGOYLyp/VDu5PRtrBdgh8 EgpcT2EWJwMCN/Upcao/q2JbQktPHPpSwnpaUAALYB20uD7k5jo7wtYE/+L9nn6B bxcCDTMVmqzNTF+y0P16hDcs5jMLVjpI0xBiyZ1G6gShpggsSZCHY5ynjAtQ19se r+2WrNfOR23k6arJuOUAQSEnLdx0T5SlW6CJeFEofKv4uoebxAbKUiNO4ShWskhd nNptX1+L3hj3zpjGcEHmL6bd+nGtyMeoG9Yekcv1oZxdVcpKhFxh0s5PEJBEeXcN M7aAWlWJkplV22Olqhpc/3INCweq6E+zBrBxZaUBW/JCzGrqBUGC0BULDPAkmC4J CKL6IqIB73jGQ4OY14IaMU20GJrIGxZ7wzXOp4aw3OUpRlxsgurfyFQeIjUvVoZL PJ8DRoAVwreVHvKfgZZVKpSAY7dwcWbxpWsYlrH3zWIC5vRJ0UFwsD0TpLJWd6Vi XA8gQcJRWKGS8E5mRY39 =Rk9v -----END PGP SIGNATURE----- Merge tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC device tree conversions and enablement from Olof Johansson: "Continued device tree conversion and enablement across a number of platforms; Kirkwood, tegra, i.MX, Exynos, zynq and a couple of other smaller series as well. ux500 has seen continued conversion for platforms. Several platforms have seen pinctrl-via-devicetree conversions for simpler multiplatform. Tegra is adding data for new devices/drivers, and Exynos has a bunch of new bindings and devices added as well. So, pretty much the same progression in the right direction as the last few releases." Fix up conflicts as per Olof. * tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (185 commits) ARM: ux500: Rename dbx500 cpufreq code to be more generic ARM: dts: add missing ux500 device trees ARM: ux500: Stop registering the PCM driver from platform code ARM: ux500: Move board specific GPIO info out to subordinate DTS files ARM: ux500: Disable the MMCI gpio-regulator by default ARM: Kirkwood: remove kirkwood_ehci_init() from new boards ARM: Kirkwood: Add support LED of OpenBlocks A6 ARM: Kirkwood: Convert to EHCI via DT for OpenBlocks A6 ARM: kirkwood: Add NAND partiton map for OpenBlocks A6 ARM: kirkwood: Add support second I2C bus and RTC on OpenBlocks A6 ARM: kirkwood: Add support DT of second I2C bus ARM: kirkwood: Convert mplcec4 board to pinctrl ARM: Kirkwood: Convert km_kirkwood to pinctrl ARM: Kirkwood: support 98DX412x kirkwoods with pinctrl ARM: Kirkwood: Convert IX2-200 to pinctrl. ARM: Kirkwood: Convert lsxl boards to pinctrl. ARM: Kirkwood: Convert ib62x0 to pinctrl. ARM: Kirkwood: Convert GoFlex Net to pinctrl. ARM: Kirkwood: Convert dreamplug to pinctrl. ARM: Kirkwood: Convert dockstar to pinctrl. ...
This commit is contained in:
commit
db5b0ae007
178 changed files with 8121 additions and 1444 deletions
|
|
@ -335,6 +335,9 @@ config AB8500_BATTERY_THERM_ON_BATCTRL
|
|||
help
|
||||
Say Y to enable battery temperature measurements using
|
||||
thermistor connected on BATCTRL ADC.
|
||||
|
||||
source "drivers/power/reset/Kconfig"
|
||||
|
||||
endif # POWER_SUPPLY
|
||||
|
||||
source "drivers/power/avs/Kconfig"
|
||||
|
|
|
|||
|
|
@ -49,3 +49,4 @@ obj-$(CONFIG_CHARGER_MAX8997) += max8997_charger.o
|
|||
obj-$(CONFIG_CHARGER_MAX8998) += max8998_charger.o
|
||||
obj-$(CONFIG_POWER_AVS) += avs/
|
||||
obj-$(CONFIG_CHARGER_SMB347) += smb347-charger.o
|
||||
obj-$(CONFIG_POWER_RESET) += reset/
|
||||
|
|
|
|||
15
drivers/power/reset/Kconfig
Normal file
15
drivers/power/reset/Kconfig
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
menuconfig POWER_RESET
|
||||
bool "Board level reset or power off"
|
||||
help
|
||||
Provides a number of drivers which either reset a complete board
|
||||
or shut it down, by manipulating the main power supply on the board.
|
||||
|
||||
Say Y here to enable board reset and power off
|
||||
|
||||
config POWER_RESET_GPIO
|
||||
bool "GPIO power-off driver"
|
||||
depends on OF_GPIO && POWER_RESET
|
||||
help
|
||||
This driver supports turning off your board via a GPIO line.
|
||||
If your board needs a GPIO high/low to power down, say Y and
|
||||
create a binding in your devicetree.
|
||||
1
drivers/power/reset/Makefile
Normal file
1
drivers/power/reset/Makefile
Normal file
|
|
@ -0,0 +1 @@
|
|||
obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o
|
||||
129
drivers/power/reset/gpio-poweroff.c
Normal file
129
drivers/power/reset/gpio-poweroff.c
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
/*
|
||||
* Toggles a GPIO pin to power down a device
|
||||
*
|
||||
* Jamie Lentin <jm@lentin.co.uk>
|
||||
* Andrew Lunn <andrew@lunn.ch>
|
||||
*
|
||||
* Copyright (C) 2012 Jamie Lentin
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/of_gpio.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
/*
|
||||
* Hold configuration here, cannot be more than one instance of the driver
|
||||
* since pm_power_off itself is global.
|
||||
*/
|
||||
static int gpio_num = -1;
|
||||
static int gpio_active_low;
|
||||
|
||||
static void gpio_poweroff_do_poweroff(void)
|
||||
{
|
||||
BUG_ON(gpio_num == -1);
|
||||
|
||||
/* drive it active */
|
||||
gpio_direction_output(gpio_num, !gpio_active_low);
|
||||
mdelay(100);
|
||||
/* rising edge or drive inactive */
|
||||
gpio_set_value(gpio_num, gpio_active_low);
|
||||
mdelay(100);
|
||||
/* falling edge */
|
||||
gpio_set_value(gpio_num, !gpio_active_low);
|
||||
|
||||
/* give it some time */
|
||||
mdelay(3000);
|
||||
|
||||
WARN_ON(1);
|
||||
}
|
||||
|
||||
static int __devinit gpio_poweroff_probe(struct platform_device *pdev)
|
||||
{
|
||||
enum of_gpio_flags flags;
|
||||
bool input = false;
|
||||
int ret;
|
||||
|
||||
/* If a pm_power_off function has already been added, leave it alone */
|
||||
if (pm_power_off != NULL) {
|
||||
pr_err("%s: pm_power_off function already registered",
|
||||
__func__);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
gpio_num = of_get_gpio_flags(pdev->dev.of_node, 0, &flags);
|
||||
if (gpio_num < 0) {
|
||||
pr_err("%s: Could not get GPIO configuration: %d",
|
||||
__func__, gpio_num);
|
||||
return -ENODEV;
|
||||
}
|
||||
gpio_active_low = flags & OF_GPIO_ACTIVE_LOW;
|
||||
|
||||
if (of_get_property(pdev->dev.of_node, "input", NULL))
|
||||
input = true;
|
||||
|
||||
ret = gpio_request(gpio_num, "poweroff-gpio");
|
||||
if (ret) {
|
||||
pr_err("%s: Could not get GPIO %d", __func__, gpio_num);
|
||||
return ret;
|
||||
}
|
||||
if (input) {
|
||||
if (gpio_direction_input(gpio_num)) {
|
||||
pr_err("Could not set direction of GPIO %d to input",
|
||||
gpio_num);
|
||||
goto err;
|
||||
}
|
||||
} else {
|
||||
if (gpio_direction_output(gpio_num, gpio_active_low)) {
|
||||
pr_err("Could not set direction of GPIO %d", gpio_num);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
pm_power_off = &gpio_poweroff_do_poweroff;
|
||||
return 0;
|
||||
|
||||
err:
|
||||
gpio_free(gpio_num);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int __devexit gpio_poweroff_remove(struct platform_device *pdev)
|
||||
{
|
||||
if (gpio_num != -1)
|
||||
gpio_free(gpio_num);
|
||||
if (pm_power_off == &gpio_poweroff_do_poweroff)
|
||||
pm_power_off = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id of_gpio_poweroff_match[] = {
|
||||
{ .compatible = "gpio-poweroff", },
|
||||
{},
|
||||
};
|
||||
|
||||
static struct platform_driver gpio_poweroff_driver = {
|
||||
.probe = gpio_poweroff_probe,
|
||||
.remove = __devexit_p(gpio_poweroff_remove),
|
||||
.driver = {
|
||||
.name = "poweroff-gpio",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = of_gpio_poweroff_match,
|
||||
},
|
||||
};
|
||||
|
||||
module_platform_driver(gpio_poweroff_driver);
|
||||
|
||||
MODULE_AUTHOR("Jamie Lentin <[email protected]>");
|
||||
MODULE_DESCRIPTION("GPIO poweroff driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("platform:poweroff-gpio");
|
||||
Loading…
Reference in a new issue