diff options
author | Gary King <gking@nvidia.com> | 2010-05-27 22:21:41 -0700 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2010-05-27 22:23:39 -0700 |
commit | fa86a654a16978c33454410a0fd5624930503121 (patch) | |
tree | db511fcf9bf864261ffccee175a2874eb785038b | |
parent | 3f6dfe9482e8db753934927d69f647c2032c7fc6 (diff) |
[ARM/tegra] board-nvodm: add a config option for USB charging
USB charging requires a vbus_draw regulator registered for the tegra-udc.0
device driver; since not all platform support USB charging, this is
enabled via a Kconfig
Change-Id: Iec441d7d3d854400762ca2667a514b6660b053c4
-rw-r--r-- | arch/arm/mach-tegra/Kconfig | 6 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-nvodm.c | 19 |
2 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index b624af0ff1d7..2dfbc0a280c5 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -112,6 +112,12 @@ config TEGRA_FUSE Adds support for reading and writing (blowing) internal fuses through sysfs +config TEGRA_USB_CHARGE + boolean "Enable USB charging support" + depends on REGULATOR_TEGRA + help + Enables charging over USB + if TEGRA_NVRM source "arch/arm/mach-tegra/odm_kit/Kconfig" diff --git a/arch/arm/mach-tegra/board-nvodm.c b/arch/arm/mach-tegra/board-nvodm.c index d4a5174efa95..0034e0ed2000 100644 --- a/arch/arm/mach-tegra/board-nvodm.c +++ b/arch/arm/mach-tegra/board-nvodm.c @@ -58,6 +58,7 @@ #include "gpio-names.h" #include "power.h" #include "board.h" +#include "nvrm_pmu.h" NvRmGpioHandle s_hGpioGlobal; @@ -780,6 +781,14 @@ static struct regulator_consumer_supply tegra_soc_consumers[] = { .supply = "soc_main", }, }; +#ifdef CONFIG_TEGRA_USB_CHARGE +static struct regulator_consumer_supply tegra_vbus_consumers[] = { + [0] = { + .supply = "vbus_draw", + .dev_name = "tegra-udc.0", + }, +}; +#endif static struct tegra_regulator_entry tegra_regulators[] = { [0] = { .guid = NV_VDD_PEX_CLK_ODM_ID, @@ -802,6 +811,16 @@ static struct tegra_regulator_entry tegra_regulators[] = { .consumers = tegra_soc_consumers, .nr_consumers = ARRAY_SIZE(tegra_soc_consumers), }, +#ifdef CONFIG_TEGRA_USB_CHARGE + [3] = { + .charging_path = NvRmPmuChargingPath_UsbBus, + .name = "vbus_draw", + .id = 3, + .consumers = tegra_vbus_consumers, + .nr_consumers = ARRAY_SIZE(tegra_vbus_consumers), + .is_charger = true, + }, +#endif }; static struct tegra_regulator_platform_data tegra_regulator_platform = { .regs = tegra_regulators, |