Commit graph

94 commits

Author SHA1 Message Date
Florian Leeber
97a8e46bdb Make the same dirty hack as Erfan lol
Change-Id: Ic8539f23279dbd63e5106b916d7ec0c710dee0de
2021-06-17 23:34:57 +02:00
liochen
8148b9d900 Synchronize codes for OnePlus5 & 5T OxygenOS 9.0.0
kernel device tree source code for OnePlus 5 & 5T P device

Change-Id: I84f40e66833ea1ce30eb1d9a710d6e1529e9e637
2018-12-26 11:02:39 +08:00
Ashay Jaiswal
eafe2f3d08 power: power_supply: add property for FCC stepper
Add power_supply property POWER_SUPPLY_PROP_FCC_STEPPER_ENABLE
which reports the state of FCC stepped feature.

Change-Id: Ibbb6e6fa7bba6b804a94bb93ddc75e5dfe0afdd1
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
2018-06-14 15:29:34 +05:30
Subbaraman Narayanamurthy
063d7870ec power_supply: add POWER_SUPPLY_PROP_{COLD,HOT}_TEMP properties
Add POWER_SUPPLY_PROP_COLD_TEMP and POWER_SUPPLY_PROP_HOT_TEMP
properties to represent Cold and Hot JEITA thresholds of the
battery.

Change-Id: Id5e16a4f7b20bb05d997277d20db05fc08db9f33
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2017-08-31 19:25:32 -07:00
Nicholas Troast
dcdf2ac6c1 power_supply: add properties for SDP current and PD voltage
SDP_CURRENT_MAX is used to communicate the maximum current negotiated by
the USB phy. PD_VOLTAGE_MAX is used to communicate the maximum voltage
negotiated by the PD phy. PD_VOLTAGE_MIN is used to communicate the
minimum voltage negotiated by the PD phy.

Change-Id: I8332f7072c99c2c4e009607d92ccfb47534cc23b
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2017-08-10 15:42:12 -07:00
Ashay Jaiswal
04e88147af power: power_supply: add property for sw based JEITA
Add power_supply property to enable/disable software based
JEITA charging.

Change-Id: I9fca73c1de524e78c3df83b02a9f5a64488eaae0
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2017-08-09 09:47:17 +05:30
Nicholas Troast
eb8700f685 power_supply: add CC_STEP and CC_STEP_SEL properties
There are several algorithms which modify the charge current in steps
across the charge cycle. CC_STEP is used to notify of all the upcoming
charge currents.

The CC_STEP_SEL property is used to select the index of the CC_STEP to
read or modify using the CC_STEP property.

Change-Id: Ieeb533b758035c1c408cdfd68f001374bf0987a5
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2017-07-31 19:28:01 -07:00
Ashay Jaiswal
0e27e3bc5b power: power_supply_sysfs: Add support for Floating charger
Add support to register a Floating type charger.

Change-Id: Ib65eff52a42d639a90f162488337a554deab4bfa
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
2017-06-21 12:03:08 +05:30
Abhijeet Dharmapurikar
e91e2202ec power_supply: introduce PR_SWAP property
Introduce POWER_SUPPLY_PROP_PR_SWAP to notify if the device is in
power role swap.

Change-Id: I8d0cb3a71ec1a646b7ec37405e66cb00ddc40e0d
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2017-05-26 11:29:38 -07:00
Fenglin Wu
2fc978c8b7 power_supply: Add REAL_TYPE power_supply_property
Add REAL_TYPE power_supply property to record the real time charger
type.

Change-Id: I5fb2e3e3e782bcac0f8dd6071a830bcf370ebbd4
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
2017-05-01 19:37:08 -07:00
Ashay Jaiswal
17d9f0383d power_supply: add HW_CURRENT_MAX power_supply property
Add support for HW_CURRENT_MAX property which returns maximum
input current that can be set for an adapter. This property will
be specifically used by parallel charger to cast an initial ICL
vote.

CRs-Fixed: 2014572
Change-Id: I49e80e6b25f40791d9035bc1567fdf881914b1e8
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2017-04-05 10:02:54 +05:30
Harry Yang
e8ec8823d3 power_supply: add CHARGE_QNOVO_ENABLE property
Add the property to enable qnovo algorithm for charging.

Change-Id: I110f386d5cf86a4718e7d55af3068fd357dca8e9
Signed-off-by: Harry Yang <harryy@codeaurora.org>
2017-03-20 14:58:44 -07:00
Linux Build Service Account
58a2863f69 Merge "qcom: smb-lib: make smb_irq_info common for smb2 and smb138x chargers" 2017-02-11 01:25:23 -08:00
Nicholas Troast
d86ba09f57 power_supply: add INPUT_VOLTAGE_SETTLED property
INPUT_VOLTAGE_SETTLED is the negotiated adapter voltage setting.

Change-Id: I2ac529a77e8ed007c908c4f37eea718a80bc11d3
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2017-02-10 16:16:47 -08:00
Harry Yang
5e55ca1847 power_supply: Add CURRENT_QNOVO and VOLTAGE_QNOVO properties
CURRENT_QNOVO - force fast charge current value
VOLTAGE_QNOVO - force float voltage value

CRs-Fixed: 2004173
Change-Id: I7569052fd2cb6d1ce9a3a8e69e79b950a6c62d57
Signed-off-by: Harry Yang <harryy@codeaurora.org>
2017-02-10 15:31:19 -08:00
Nicholas Troast
fcc57cd62f power_supply: add CTM_CURRENT_MAX property
POWER_SUPPLY_PROP_CTM_CURRENT_MAX is needed by CTM to limit USB input
current. Add it.

Change-Id: I8aac65a91959300676cf7e1c2685a557f322c509
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2017-02-10 12:52:15 +05:30
Nicholas Troast
683a347835 power: supply: qcom: implement die and connector health property
The die and connector health properties expose the comparator output of
the thermal regulation. If both die and skin temperature regulation is
enabled then the output of the comparator will be the higher of the two.
The property values can be one of: Unknown, Cool, Warm, Hot, Overheat.

Change-Id: Ic92c9cb08ec42fd2c2f26a54687a17e3b05b388f
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2017-02-10 12:52:14 +05:30
Nicholas Troast
e93616b414 power_supply: add DIE_HEALTH and CONNECTOR_HEALTH properties
The DIE_HEALTH and CONNECTOR_HEALTH properties are used to show the
output of the thermal regulation TEMP_RANGE.

Change-Id: Ice3f159b7775084bdd0099047d4660a1e5edce98
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2017-02-10 12:52:13 +05:30
Nicholas Troast
6cce933457 power_supply: add CONNECTOR_THERM_ZONE property
The CONNECTOR_THERM_ZONE property shows which thermal zone the
connector temperature is currently in.

Change-Id: I669344feea13f34f98ee808cae5649766543201a
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2017-02-07 13:39:39 -08:00
Abhijeet Dharmapurikar
6802881be0 power_supply: remove PARALLEL_PERCENT property
There is no need for this property. Remove it.

Change-Id: I656eb51f8b9690d0c1046d1c82d2575fae270a40
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2017-01-31 22:23:42 -08:00
Abhijeet Dharmapurikar
c2ccc0e909 power_supply: Add type and properties for parallel charger
USB Main charger type represents the main charging path. This will
be used to control charging parameters on the main charger.

FCC_DELTA property will be used to indicate whether hw implements
any FCC mitigation. This will be used to calculate the effective FCC
and set the FCC on the PMI.

PARALLEL_MODE property indicates whether the parallel charger chip is
configured in a mid-mid or usbin-usbin configuration.

ICL_REDUCTION property indicates by how much should the main charger
reduce its input current.

Change-Id: I3b064314e6b5c28a7ea9f79ac52f3a26749605fb
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2017-01-30 15:41:49 -08:00
Ashay Jaiswal
bafe291f17 power_supply: add power supply property to support debug battery
Add power supply property to report debug/fake battery status.

CRs-Fixed: 1107245
Change-Id: I5590a772604986de8eed1c8417411dac62668440
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
2017-01-17 20:29:29 -08:00
Subbaraman Narayanamurthy
5207bf3492 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 <subbaram@codeaurora.org>
2016-12-22 15:10:42 -08:00
Fenglin Wu
2a16792344 power: power_supply: Add property for ship mode
In ship mode the charger module opens the bat-fet and disconnects the
battery from the system. This is for the non-removable battery designs
to avoid them from being discharged when shipped/on-shelf.

The ship mode is enabled during the final stage of power-off typically
from the PON driver. Hence, add property POWER_SUPPLY_PROP_SET_SHIP_MODE
to force the device into ship-mode.

CRs-Fixed: 1092969
Change-Id: I43893355db063d99b6faf965093fad74ec0c9253
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
2016-12-16 13:43:59 +08:00
Harry Yang
a5dea1fbd6 power_supply: Add BOOST_CURRENT property
This property will be used to indicate to the boost current
after the boost is turned on.

CRs-Fixed: 1095917
Change-Id: Ie667fa49c4a8e8c008e8866f655e3bbe3e69e156
Signed-off-by: Harry Yang <harryy@codeaurora.org>
2016-12-07 10:18:04 -08:00
Abhijeet Dharmapurikar
cb6c743a06 power_supply: Add PE_START property
This property will be used to indicate to the policy engine that it
should start its activities.

Change-Id: I9deb48f7bff71b022c5899e6eff7617526d02324
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-19 16:27:04 -07:00
Harry Yang
3570e9ed98 power_supply: add property to reflect switcher frequency
Modern battery chargers use a switching buck whose frequency
can be adjusted. Create a property to read/update it.

CRs-Fixed: 1048242
Change-Id: I7611e6b697222427303df47f837716005e013443
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:17 -07:00
Nicholas Troast
bb659da62a power_supply: add PARALLEL_PERCENT property
The PARALLEL_PERCENT property is used for the parallel distribution
percentage.

Change-Id: I7d2a7a775437770075ddbd2d1a36ce5d9e44a631
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2016-10-17 11:54:03 -07:00
Jack Pham
9ed824e16b power_supply: Add additional USB PD properties
Add additional properties for USB PD usage:
- POWER_SUPPLY_PROP_PD_IN_HARD_RESET is set when PD is
  undergoing a hard reset
- POWER_SUPPLY_PROP_PD_CURRENT_MAX used to indicate the
  current limit as negotiated over PD
- POWER_SUPPLY_PROP_PD_USB_SUSPEND_SUPPORTED is set when
  USB suspend current limit must be honored when USB bus
  is suspended

Also add enums to distinguish PD activity state: inactive, active.

Change-Id: I0a3d98ac1e1202e5b655b2e3a8102691b61359c8
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-10-14 17:51:45 -07:00
Nicholas Troast
5b0ad6818a power_supply: add PARALLEL_DISABLE property
The PARALLEL_DISABLE property is used to enable or disable parallel
charging.

Change-Id: If2845efa942abc5849890b45de525222632b32db
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2016-10-10 16:27:06 -07:00
Harry Yang
192d510128 power_supply: add two properties for step charging
STEP_CHARGING_ENABLED indicates if step charging is enabled or not.
STEP_CHARGING_STEP reflects step charging phase.

Both properties are added for the purpose of testing and debugging.

CRs-Fixed: 1052854
Change-Id: I7d7517ab3f172016bb2f1c23fb2788bbd2d01086
Signed-off-by: Harry Yang <harryy@codeaurora.org>
2016-09-07 00:45:05 -07:00
Linux Build Service Account
5abea2b1d9 Merge "qcom-charger: smb138x-charger: add parallel enable status properties" 2016-08-11 12:48:35 -07:00
Nicholas Troast
9c58552698 power_supply: add PIN_ENABLED property
Hardware disables the parallel charger via the CHG_EN pin. Add a new
property called PIN_ENABLED which reflects the status of the CHG_EN pin.

Change-Id: I79f95b145176b66d6b8cec5a21922ea16c2c8206
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2016-08-02 14:02:41 -07:00
Nicholas Troast
5bd071c647 power_supply: add CHARGER_TEMP and CHARGER_TEMP_MAX properties
CHARGER_TEMP reflects the temperature of the charging chip, and
CHARGER_TEMP_MAX reflects the temperature threshold at which the
hardware will take action to reduce the temperature of the charger.

Change-Id: I9cba8e370c753ac5aa33252fce0ea446f061b4c0
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2016-08-01 10:29:26 -07:00
Nicholas Troast
4e468402df power_supply: add INPUT_SUSPEND power supply property
POWER_SUPPLY_PROP_CHARGING_ENABLED has been used to indicate enabling
the charge path in some drivers and enabling the input path in others.
This leads to confusion of what charging enabled really means.

POWER_SUPPLY_PROP_BATTERY_CHARGING_ENABLED was introduced to indicate
enabling the charge path, and in this case
POWER_SUPPLY_PROP_CHARGING_ENABLED is used to indicate enabling the
input path. Since these are similarly named it leads to even more
confusion.

In an attempt to fix this confusion we introduce a new power supply
property POWER_SUPPLY_PROP_INPUT_SUSPEND which indicates suspending the
input path of the power supply. POWER_SUPPLY_PROP_CHARGING_ENABLED takes
its original definition of enabling the charge path. Then
POWER_SUPPLY_PROP_BATTERY_CHARGING_ENABLED will be retired from use.

CRs-Fixed: 1005389
Change-Id: I1ca8f5748a56a9395caa8ed8ed18f70e69f0cbe8
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2016-05-06 12:06:23 -07:00
Jack Pham
27f3e78625 power_supply: Add additional USB Type-C properties
Introduce the power_supply_typec_mode enum definitions which
will allow a charger to indicate the type of USB Type-C
connection that is established. Also add additional properties
for indicating CC pin orientation, changing source/sink power
role (useful for dynamic power role swap), and a flag to allow
the charger to expect VBUS changes during USB Power Delivery
power negotiation.

CRs-Fixed: 1005389
Change-Id: Iba9b652335fba4ee4f24a17eba8abdd5c85c21bb
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2016-05-06 12:06:23 -07:00
Abhijeet Dharmapurikar
77dd355971 qpnp: Add snapshot of some qpnp, regulator and charger drivers
This snapshot is taken as of msm-3.18 commit
9da4ddc (Merge "clk: msm: clock-gcc: Associate gfx rail
voting with gfx3d branch")

Change-Id: Idd2f467f1f1863a156d1757589dfe78158f0e43f
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-03-01 12:22:31 -08:00
Todd Poynor
8774e7626b power: Add property CHARGE_COUNTER_EXT and 64-bit precision properties
Add POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT that stores accumulated charge
in nAh units as a signed 64-bit value.

Add generic support for signed 64-bit property values.

Change-Id: I2bd34b1e95ffba24e7bfef81f398f22bd2aaf05e
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2016-02-16 13:53:37 -08:00
Todd Poynor
b677957275 power: power_supply: add POWER_SUPPLY_PROP_CHARGE_ENABLED
Change-Id: I3e93b502452811cbfc4d904202b4f1d94edc143d
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2016-02-16 13:53:33 -08:00
Todd Poynor
ec5fbe34c1 power: power_supply: add POWER_SUPPLY_PROP_USB_OTG
Change-Id: Idfc6ef2e37d62aad6f26cc8eafa53db642cd352b
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2016-02-16 13:53:33 -08:00
Todd Poynor
9a9fbfd35e power: power_supply: move POWER_SUPPLY_PROP_USB_HC to type 'int' order
Change-Id: I001af30ab5fe06dde5f368241f21b9e0864777a1
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2016-02-16 13:53:32 -08:00
Todd Poynor
f72efc79c0 power_supply: Add custom property for USB High Current mode
For smb347.

Change-Id: I3323469072e1ee5085d61af8a89612b06b91f94a
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2016-02-16 13:53:32 -08:00
Krzysztof Kozlowski
5c6e3a97e9 power_supply: sysfs: Bring back write to writeable properties
The fix for NULL pointer exception related to calling uevent for not
finished probe caused to set all writeable properties as non-writeable.
This was caused by checking if property is writeable before the initial
increase of power supply usage counter and in the same time using
wrapper over property_is_writeable(). The wrapper returns ENODEV if the
usage counter is still 0.

The call trace looked like:
  device probe:
    power_supply_register()
      use_cnt = 0;
      device_add()
        create sysfs entries
          power_supply_attr_is_visible()
            power_supply_property_is_writeable()
              if (use_cnt == 0) return -ENODEV;
      use_cnt++;

Replace the usage of wrapper with direct call to property_is_writeable()
from driver. This should be safe call during device probe because
implementations of this callback just return 0/1 for different
properties and they do not access any of the driver's internal data.

Fixes: 8e59c7f234 ("power_supply: Fix NULL pointer dereference during bq27x00_battery probe")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-06-10 16:10:59 +02:00
Krzysztof Kozlowski
a9f6a19b57 power_supply: Use wrappers to avoid races when registering power supply
Use wrappers over get_property() and set_property() internally in power
supply and for sysfs interface. The wrappers provide safe access if
power supply is not yet registered or t is being destroyed.

In case of syfs the theoretical race could happen between ending of
driver's probe and parallel sysfs access:
some_driver_probe()                    userspace
====================================   ===========================
  drv->psy = power_supply_register()
    device_add()
      sysfs entries are created
    atomic_inc(&psy->use_cnt);
                                       store on sysfs attributes
                                         drv->set_property()
                                           dereference of drv->psy
  drv->psy = returned psy;

For leds the race could happen between power supply being destroyed and
ongoing power_supply_changed_work().

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-23 20:06:19 +02:00
Krzysztof Kozlowski
297d716f62 power_supply: Change ownership from driver to core
Change the ownership of power_supply structure from each driver
implementing the class to the power supply core.

The patch changes power_supply_register() function thus all drivers
implementing power supply class are adjusted.

Each driver provides the implementation of power supply. However it
should not be the owner of power supply class instance because it is
exposed by core to other subsystems with power_supply_get_by_name().
These other subsystems have no knowledge when the driver will unregister
the power supply. This leads to several issues when driver is unbound -
mostly because user of power supply accesses freed memory.

Instead let the core own the instance of struct 'power_supply'.  Other
users of this power supply will still access valid memory because it
will be freed when device reference count reaches 0. Currently this
means "it will leak" but power_supply_put() call in next patches will
solve it.

This solves invalid memory references in following race condition
scenario:

Thread 1: charger manager
Thread 2: power supply driver, used by charger manager

THREAD 1 (charger manager)         THREAD 2 (power supply driver)
==========================         ==============================
psy = power_supply_get_by_name()
                                   Driver unbind, .remove
                                     power_supply_unregister()
                                     Device fully removed
psy->get_property()

The 'get_property' call is executed in invalid context because the driver was
unbound and struct 'power_supply' memory was freed.

This could be observed easily with charger manager driver (here compiled
with max17040 fuel gauge):

$ cat /sys/devices/virtual/power_supply/cm-battery/capacity &
$ echo "1-0036" > /sys/bus/i2c/drivers/max17040/unbind
[   55.725123] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[   55.732584] pgd = d98d4000
[   55.734060] [00000000] *pgd=5afa2831, *pte=00000000, *ppte=00000000
[   55.740318] Internal error: Oops: 80000007 [#1] PREEMPT SMP ARM
[   55.746210] Modules linked in:
[   55.749259] CPU: 1 PID: 2936 Comm: cat Tainted: G        W       3.19.0-rc1-next-20141226-00048-gf79f475f3c44-dirty #1496
[   55.760190] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[   55.766270] task: d9b76f00 ti: daf54000 task.ti: daf54000
[   55.771647] PC is at 0x0
[   55.774182] LR is at charger_get_property+0x2f4/0x36c
[   55.779201] pc : [<00000000>]    lr : [<c034b0b4>]    psr: 60000013
[   55.779201] sp : daf55e90  ip : 00000003  fp : 00000000
[   55.790657] r10: 00000000  r9 : c06e2878  r8 : d9b26c68
[   55.795865] r7 : dad81610  r6 : daec7410  r5 : daf55ebc  r4 : 00000000
[   55.802367] r3 : 00000000  r2 : daf55ebc  r1 : 0000002a  r0 : d9b26c68
[   55.808879] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   55.815994] Control: 10c5387d  Table: 598d406a  DAC: 00000015
[   55.821723] Process cat (pid: 2936, stack limit = 0xdaf54210)
[   55.827451] Stack: (0xdaf55e90 to 0xdaf56000)
[   55.831795] 5e80:                                     60000013 c01459c4 0000002a c06f8ef8
[   55.839956] 5ea0: db651000 c06f8ef8 daebac00 c04cb668 daebac08 c0346864 00000000 c01459c4
[   55.848115] 5ec0: d99eaa80 c06f8ef8 00000fff 00001000 db651000 c027f25c c027f240 d99eaa80
[   55.856274] 5ee0: d9a06c00 c0146218 daf55f18 00001000 d99eaa80 db4c18c0 00000001 00000001
[   55.864468] 5f00: daf55f80 c0144c78 c0144c54 c0107f90 00015000 d99eaab0 00000000 00000000
[   55.872603] 5f20: 000051c7 00000000 db4c18c0 c04a9370 00015000 00001000 daf55f80 00001000
[   55.880763] 5f40: daf54000 00015000 00000000 c00e53dc db4c18c0 c00e548c 0000000d 00008124
[   55.888937] 5f60: 00000001 00000000 00000000 db4c18c0 db4c18c0 00001000 00015000 c00e5550
[   55.897099] 5f80: 00000000 00000000 00001000 00001000 00015000 00000003 00000003 c000f364
[   55.905239] 5fa0: 00000000 c000f1a0 00001000 00015000 00000003 00015000 00001000 0001333c
[   55.913399] 5fc0: 00001000 00015000 00000003 00000003 00000002 00000000 00000000 00000000
[   55.921560] 5fe0: 7fffe000 be999850 0000a225 b6f3c19c 60000010 00000003 00000000 00000000
[   55.929744] [<c034b0b4>] (charger_get_property) from [<c0346864>] (power_supply_show_property+0x48/0x20c)
[   55.939286] [<c0346864>] (power_supply_show_property) from [<c027f25c>] (dev_attr_show+0x1c/0x48)
[   55.948130] [<c027f25c>] (dev_attr_show) from [<c0146218>] (sysfs_kf_seq_show+0x84/0x104)
[   55.956298] [<c0146218>] (sysfs_kf_seq_show) from [<c0144c78>] (kernfs_seq_show+0x24/0x28)
[   55.964536] [<c0144c78>] (kernfs_seq_show) from [<c0107f90>] (seq_read+0x1b0/0x484)
[   55.972172] [<c0107f90>] (seq_read) from [<c00e53dc>] (__vfs_read+0x18/0x4c)
[   55.979188] [<c00e53dc>] (__vfs_read) from [<c00e548c>] (vfs_read+0x7c/0x100)
[   55.986304] [<c00e548c>] (vfs_read) from [<c00e5550>] (SyS_read+0x40/0x8c)
[   55.993164] [<c00e5550>] (SyS_read) from [<c000f1a0>] (ret_fast_syscall+0x0/0x48)
[   56.000626] Code: bad PC value
[   56.011652] ---[ end trace 7b64343fbdae8ef1 ]---

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

[for the nvec part]
Reviewed-by: Marc Dietrich <marvin24@gmx.de>

[for compal-laptop.c]
Acked-by: Darren Hart <dvhart@linux.intel.com>

[for the mfd part]
Acked-by: Lee Jones <lee.jones@linaro.org>

[for the hid part]
Acked-by: Jiri Kosina <jkosina@suse.cz>

[for the acpi part]
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-03-13 23:15:51 +01:00
Krzysztof Kozlowski
ee8f334a9a power_supply: sysfs: Use power_supply_*() API for accessing function attrs
Replace direct calls to power supply function attributes with wrappers.
Wrappers provide safe access in case of unregistering the power
supply (e.g. by removing the driver). Replace:
 - get_property -> power_supply_get_property
 - set_property -> power_supply_set_property
 - property_is_writeable -> power_supply_property_is_writeable

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-03-13 23:15:48 +01:00
Viresh Kumar
73b4a087ba power-supply: Check for failures only when we can fail
In power_supply_show_property() routine, we call ->get_property() conditionally
and should check for failure in that case only. There is no point comparing
'ret' for errors when 'ret' is surely zero.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2014-09-16 11:01:37 +02:00
Ramakrishna Pallala
a8adcc9012 power_supply: Add boot and calibration attributes
Usually PMIC's come with coulomb counting mechanism which can be
used to implement a Fuel Gauginig solution in Software itself.
One of key input to these SW Fuel Gauge solutioons is the boot up
parameters like boot voltage and boot current.

This patch adds the VOLTAGE_BOOT and CURRENT_BOOT power supply attributes
to report bootup voltage and current.

This patch also adds CALIBRATE power supply attribute which useful is
for calibrating the battery/coulomb counter.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2014-09-06 21:05:04 +02:00
Jenny TC
6bb1d272d7 power_supply: Add inlmt,iterm, min/max temp props
Add new power supply properties for input current, charge termination
current, min and max temperature

POWER_SUPPLY_PROP_TEMP_MIN - minimum operatable temperature
POWER_SUPPLY_PROP_TEMP_MAX - maximum operatable temperature

POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT - input current limit programmed
by charger. Indicates the input current for a charging source.

POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT - Charge termination current used
to detect the end of charge condition

Signed-off-by: Jenny TC <jenny.tc@intel.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2014-07-18 23:40:23 +02:00
Jingoo Han
f107ae11f0 power_supply: Replace strict_strtol() with kstrtol()
The usage of strict_strtol() is not preferred, because strict_strtol() is
obsolete. Thus, kstrtol() should be used.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-08-09 14:49:49 -07:00