From 4794e0b1842c52dc872e471a33222e829ecfee57 Mon Sep 17 00:00:00 2001 From: Kiran Gunda Date: Wed, 17 Jan 2018 17:50:20 +0530 Subject: leds: qpnp-flash: Introduce a function pointer for qpnp_flash_led_prepare Introduce a function pointer to avoid the compilation error due the same function name used in the legacy and v2 flash drivers. These two drivers need to be enabled in a single defconfig that supports multiple hardware platforms to achieve the binary compatibility. Change-Id: I1ded3d4d9013c6f7f56e0a8952f4b45d20b07326 Signed-off-by: Kiran Gunda Signed-off-by: Shilpa Suresh --- include/linux/leds-qpnp-flash.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include/linux') diff --git a/include/linux/leds-qpnp-flash.h b/include/linux/leds-qpnp-flash.h index 1fe6e1709fa6..e3b9cf148cbd 100644 --- a/include/linux/leds-qpnp-flash.h +++ b/include/linux/leds-qpnp-flash.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -21,7 +21,14 @@ #define FLASH_LED_PREPARE_OPTIONS_MASK GENMASK(3, 0) -int qpnp_flash_led_prepare(struct led_trigger *trig, int options, +#if (defined CONFIG_LEDS_QPNP_FLASH || defined CONFIG_LEDS_QPNP_FLASH_V2) +extern int (*qpnp_flash_led_prepare)(struct led_trigger *trig, int options, int *max_current); - +#else +static inline int qpnp_flash_led_prepare(struct led_trigger *trig, int options, + int *max_current) +{ + return -ENODEV; +} +#endif #endif -- cgit v1.2.3 From 217426d4c2ea6bda5205ca4b2b7f40128b12316e Mon Sep 17 00:00:00 2001 From: Subbaraman Narayanamurthy Date: Mon, 21 Mar 2016 15:54:35 -0700 Subject: power_supply: add support to control hvdcp3 detection Currently, HVDCP3 detection is enabled by default. Add support to control it dynamically through a power supply property "allow_hvdcp3". CRs-Fixed: 991060 Change-Id: Id283b572cdb51094ad53d590e230104dc3e1beb7 Signed-off-by: Subbaraman Narayanamurthy Signed-off-by: Shilpa Suresh --- include/linux/power_supply.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 23c1e473f34b..c0dff92be9b9 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -265,6 +265,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_BATTERY_INFO, POWER_SUPPLY_PROP_BATTERY_INFO_ID, POWER_SUPPLY_PROP_ENABLE_JEITA_DETECTION, + POWER_SUPPLY_PROP_ALLOW_HVDCP3, /* Local extensions of type int64_t */ POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT, /* Properties of type `const char *' */ -- cgit v1.2.3 From 7f05c8913fea861cf9207d53b0f05a3556b2cec8 Mon Sep 17 00:00:00 2001 From: Anirudh Ghayal Date: Thu, 4 Aug 2016 08:12:10 +0530 Subject: power: power_supply: Add property to limit pulses for HVDCP Use the property POWER_SUPPLY_PROP_MAX_PULSE_ALLOWED to specify the maximum pulses which can be supported for HVDCP3. This is used to limit the VBUS to a max value. CRs-Fixed: 1047232 Change-Id: I85677ba574ff3da2a38e06a2f25a43e80ae150d6 Signed-off-by: Anirudh Ghayal Signed-off-by: Vamshi Krishna B V Signed-off-by: Shilpa Suresh --- include/linux/power_supply.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index c0dff92be9b9..c3764d2a2934 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -266,6 +266,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_BATTERY_INFO_ID, POWER_SUPPLY_PROP_ENABLE_JEITA_DETECTION, POWER_SUPPLY_PROP_ALLOW_HVDCP3, + POWER_SUPPLY_PROP_MAX_PULSE_ALLOWED, /* Local extensions of type int64_t */ POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT, /* Properties of type `const char *' */ -- cgit v1.2.3