From d8d0e55ed104252f0295767d5e2e026c93404870 Mon Sep 17 00:00:00 2001 From: Michael Turquette Date: Thu, 17 Nov 2016 18:47:30 +0530 Subject: clk: introduce CLK_ENABLE_HAND_OFF flag Some clocks are critical to system operation (e.g. cpu, memory, etc) and should not be gated until a driver that knows best claims such a clock and expressly gates that clock through the normal clk.h api. The typical way to handle this is for the clk driver or some other early code to call clk_prepare_enable on this important clock as soon as it is registered and before the clk_disable_unused garbage collector kicks in. This patch introduces a formal way to handle this scenario that is provided by the clk framework. Clk driver authors can set the CLK_ENABLE_HAND_OFF flag in their clk data, which will cause the clk to be enabled in clk_register(). Then when the first clk consumer driver comes along and calls clk_get() & clk_prepare_enable(), the reference counts taken during clk registration are transfered (or handed off) to the clk consumer. At this point handling the clk is the same as any other clock which as not set the new CLK_ENABLE_HAND_OFF flag. In fact no changes to any clock consumer driver are needed for this to work. Change-Id: Ib5247f6bceb1f555c03103f061af089755b2de62 Signed-off-by: Michael Turquette Patch-mainline: patchwork.kernel.org @ 02/11/16, 9:19 Signed-off-by: Taniya Das --- include/linux/clk-provider.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/linux') diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 744167a9ca8b..f91991b97888 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -33,6 +33,9 @@ #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */ #define CLK_RECALC_NEW_RATES BIT(9) /* recalc rates after notifications */ #define CLK_IS_CRITICAL BIT(11) /* do not gate, ever */ +#define CLK_ENABLE_HAND_OFF BIT(12) /* enable clock when registered. + hand-off enable_count & prepare_count + to first consumer that enables clk */ #define CLK_IS_MEASURE BIT(14) /* measure clock */ struct clk; -- cgit v1.2.3 From 5207bf3492f9e48c9e45fbe9cac65ae292bfe2ca Mon Sep 17 00:00:00 2001 From: Subbaraman Narayanamurthy Date: Wed, 14 Dec 2016 15:05:22 -0800 Subject: power_supply: Add SOC_REPORTING_READY property Add SOC_REORTING_READY property to indicate if the SOC is ready to be reported. Change-Id: I53ac153ba9f7ae81bb0657b17e0e798fd3fe4f48 Signed-off-by: Subbaraman Narayanamurthy --- 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 9b6359241018..20280ff20e52 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -227,6 +227,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_PARALLEL_PERCENT, POWER_SUPPLY_PROP_PE_START, POWER_SUPPLY_PROP_SET_SHIP_MODE, + POWER_SUPPLY_PROP_SOC_REPORTING_READY, /* Local extensions of type int64_t */ POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT, /* Properties of type `const char *' */ -- cgit v1.2.3