Commit Graph

798427 Commits

Author SHA1 Message Date
Saravana Kannan
2071154513 ANDROID: GKI: clk: Initialize in stack clk_init_data to 0 in all drivers
This allows adding fields to clk_init_data without having to explicitly
set those fields in all the drivers.

Bug: 150506629
Signed-off-by: Saravana Kannan <saravanak@google.com>
Change-Id: I0ff4e5108541b9f6e3e3e3f984a277b6954a629c
2020-04-02 18:04:21 -07:00
Channagoud Kadabi
1f01baa02c ANDROID: GKI: drivers: clksource: Add API to return cval
Sleep driver needs to program the absolute clock value for next expiry
into pdc register for system wake up. Add an API to read the cval low
and high counters.

Signed-off-by: Channagoud Kadabi <ckadabi@codeaurora.org>
Bug: 152635062
Test: build
(cherry picked from commit ee514e9083c5d9f3312a54fd317786da7c9abdb1)
[surenb: replaced out-of-tree readl_relaxed_no_log with functionally
identical in-tree readl_relaxed]
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I1244c31c8a2717a6f2002cac3b26ee3526409058
Merged-In: I1244c31c8a2717a6f2002cac3b26ee3526409058
2020-04-02 23:32:47 +00:00
Saravana Kannan
3179a1a38d ANDROID: GKI: clk: Add support for voltage voting
This change adds support for voltage voting in the clock framework. This
will NOT be carried over to newer kernels.

Bug: 150506629
Signed-off-by: David Collins <collinsd@codeaurora.org>
Signed-off-by: David Dai <daidavid1@codeaurora.org>
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Signed-off-by: Shefali Jain <shefjain@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Taniya Das <tdas@codeaurora.org>
[saravanak: Squashed the following commits and dropped some debug code
	    and code whose functionality that's replaced by clk_sync_state()
	ff5ce501ba80 clk: do not vote for vdd_class level with 0 Hz rate_max
	96f0596cc03a clk: provider: cleanup of unused use_max_uV
	83d12e55ba9d clk: Always vote INT_MAX as maximum voltage for a rail
	352850e65775 clk: handle reentrant clk_set_rate() calls from clock supply regulators
	0d8060cd6b63 clk: add bus voting to rate_get, rate_set, enable_set debug functions
	d4c36a3d1038 clk: remove prepare lock and bus voting in clk_debug_print_hw
	813f66628115 clk: add bus voting ops for debug purposes
	7e0561072d82 clk: qcom: Fix return value check for round rate during clock registration
	c4540b8ee30c clk: fix conflicting bit for measure clock flag
	fa9b30447f77 clk: correct vdd_class voting scheme used during clock rate changes
	61dad2894f52 clk: Move VDD voltage voting from core clock to top clock
	0cbef8b6fc58 clk: qcom: Add support to log PLL/RCGR values in case of failure
	bcc43f7a193b clk: qcom: Add support for debugfs measure clock
	1ac9516f7402 clk: Export the clock driver's voltage voting APIs
	c4316254d2f9 clk: add/modify debugfs support for clocks
	d30b895f2155 clk: move check for CLK_ENABLE_HAND_OFF at unused tree
	11032174cac0 clk: Add support to provide OPP tables for clocks
	f349485712d2 clk: Add support to vote to regulator framework from clk framework
	81286aed669c clk: Check for failure at clk_change_rate
	6a4951a8308c clk: qcom: clk-voter: Add support for voter clocks
	b904878a04fb clk: Add support to set custom flags with clk_set_flags ]
Signed-off-by: Saravana Kannan <saravanak@google.com>
Change-Id: I95574f11053e8f3762c8d660183ce5004ff5cc5b
2020-04-02 16:27:12 -07:00
Saravana Kannan
1d887ea976 ANDROID: GKI: kernel: Export task and IRQ affinity symbols
A module uses these symbols. So, export them to allow loading of that
module.

Bug: 149816871
Bug: 149256712
Signed-off-by: Saravana Kannan <saravanak@google.com>
Change-Id: I949da5d091894ea3d79a6c9244bfc2f8426eee71
(cherry picked from commit dc928ba3bdfb4527e0ffca7c491d946a02e5bd11)
[ qperret: made changes to commit message for AOSP compliance ]
Signed-off-by: Quentin Perret <qperret@google.com>
2020-04-02 16:27:12 -07:00
Saravana Kannan
95b8a4b5b1 ANDROID: GKI: regulator: core: Add support for regulator providers with sync state
Regulator providers whose drivers have sync_state() implemented will
disable their regulators once all their consumers have probed. So during
late_initcall_sync(), don't disable unused regulators of these regulator
providers.

Also, provide a regulator_sync_state() API that regulator providers can
use to disable all their unused regulators once the get their
sync_state() callback.

Bug: 144127090
Bug: 150508586
Signed-off-by: Saravana Kannan <saravanak@google.com>
Change-Id: I5cc32730214c8e769c2a55cbe3b702cf6bb9016a
2020-04-02 16:27:12 -07:00
David Collins
4bad67ba2a ANDROID: GKI: regulator: Call proxy-consumer functions for each regulator registered
Add a call to regulator_proxy_consumer_register() at the end of
regulator_register() and a call to
regulator_proxy_consumer_unregister() at the beginning of
regulator_unregister().  These calls ensure that proxy consumer
features may be used by any type of regulator regardless of the
driver supporting it.

Bug: 150508586
Change-Id: Ia70da1df47042fa673c42f389136557f868d19a3
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit ff753edc6d60e1e1043931409e6d3ac6e01b8108)
[Fixed minor conflicts from dropping an earlier debugfs patch]
Signed-off-by: Saravana Kannan <saravanak@google.com>
2020-04-02 16:27:12 -07:00
David Collins
653a867e09 ANDROID: GKI: regulator: Add proxy consumer driver
Add a proxy consumer driver which can be used to ensure that a
given regulator maintains a certain minimum state during bootup.
Enable state, voltage, and current may be forced to specified
levels.

Bug: 150508586
Change-Id: I0ccc63a41684462684ac737fb2f4129a3e6e4aea
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit cf03466c074e912a8aa3e079e1b7ea1cc17b18ba)
[Also squashed e9a05bb4d3f0 "spdx: Modify spdx tag from GPL-2.0 to GPL-2.0-only"]
Signed-off-by: Saravana Kannan <saravanak@google.com>
2020-04-02 16:27:12 -07:00
David Collins
b4270a93c7 ANDROID: GKI: regulator: core: allow long device tree supply regulator property names
The length 32 buffer in of_get_regulator() limits the maximum
possible supply name to 24 characters (32 - 1 [null terminator]
- 7 [strlen("-supply")]).  This causes problems for device
nodes with longer supply property names.

Increase the size of the buffer to remove this artificial
restriction.

Bug: 150508586
Change-Id: Ic28ee290dcd7411ba8325a2b42c12173958a11d8
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit f6d207a3235617a4acffb246f3817c32bd30ee39)
Signed-off-by: Saravana Kannan <saravanak@google.com>
2020-04-02 16:27:12 -07:00
David Collins
fbb4d2d856 ANDROID: GKI: Revert "regulator: Enable supply regulator if child rail is enabled."
This reverts commit b2296bd43e ("regulator: Enable supply
regulator if child rail is enabled.").

The change results in the following incorrect behavior.
If a given regulator has a parent supply and the regulator is
enabled either before or during regulator_register(), then
regulator_enable() is called on the supply.  Unfortunately, there
is no matching regulator_disable() call.  This means that the
parent supply will stay enabled forever even if the child is
disabled later.

The stated goal of the change was to enable the parent of a
regulator which was enabled based on its machine constraints.
However, the only constraints that leads to enable() being called
for a regulator are boot-on or always-on.  If these have been
specified for a child regulator then they should have also been
specified for its parent regulator.  Therefore, there should be
no need to explicitly enable the parent when the child is
registered.

Bug: 150508586
Change-Id: Ib8e6db65dcd44c27ef99509ff0cfd2f8e16e9f65
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit 7a88f5efeab2059093e2398d57d6cd36220b6bc5)
Signed-off-by: Saravana Kannan <saravanak@google.com>
2020-04-02 16:27:11 -07:00
David Collins
59e9e8c8fd ANDROID: GKI: regulator: Remove redundant set_mode call in drms_uA_update
The regulator framework checks if the current mode is the same as the
one being requested inside of regulator_set_mode. However, when
DRMS changing is allowed, regulator_enable calls drms_uA_update.
This function does not check the value of get_mode before calling
set_mode.

Modify drms_uA_update so that set_mode is only called if the requested
mode is different from the current mode returned by get_mode.

Bug: 150508586
Change-Id: Ifb4f3069cf946e8474565ee82508c1ff45b36543
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit 4c40b0f70455f6207c0c26994a50a640160d2a69)
Signed-off-by: Saravana Kannan <saravanak@google.com>
2020-04-02 16:27:11 -07:00
Subash Abhinov Kasiviswanathan
8ba14953de ANDROID: GKI: net: Add the get current NAPI context API
Commit 69235aa80090 ("net: Remove the get current NAPI context API")
removed the definition of get_current_napi_context() as rmnet_data
was no longer using it. However, the rmnet_data change to use its
NAPI in multiple contexts was prone to race in hotplug scenarios.

Add back get_current_napi_context() and current_napi to the
softnet_data struct.

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
(cherry picked from commit 05b3252cf566eb04c7c5484c912ae6f8f9fb1dd5)
[surenb cherry-picked from
05b3252cf566 net: Add the get current NAPI context API
to fix ABI diffs caused by get_current_napi_context function]

Bug: 151108843
Test: build
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I4d5b81c734e4a5daa2fae3cb7d6538821d46ff64
Merged-In: I4d5b81c734e4a5daa2fae3cb7d6538821d46ff64
2020-04-02 23:22:33 +00:00
Suren Baghdasaryan
ac236165f2 ANDROID: GKI: remove DRM_KMS_CMA_HELPER from GKI configuration
DRM_KMS_CMA_HELPER config option select FB_DEFERRED_IO config which
in turn causes ABI differences inside struct fb_info. Remove this config
option since it's not required in 4.19 GKI.

Bug: 152530986
Test: build
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I0a569544aecff61805e7398fa81b1409fc50496b
Merged-In: I0a569544aecff61805e7398fa81b1409fc50496b
2020-04-02 23:21:45 +00:00
Suren Baghdasaryan
bc39cf0bc8 ANDROID: GKI: edac: Fix ABI diffs in edac_device_ctl_info struct
Add edac_device_ctl_info struct members causing ABI diffs. This
patch skips sysfs changes and ignores the deferrable flag from the
original patchset.

Bug: 152456530
Test: build and boot
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Signed-off-by: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
[surenb: Squashed the following commits and kept only
edac_device_ctl_info struct changes:
	117ab600649a edac: Allow panic on correctable errors (CE).
        1b9a7044541d edac: Allow the option of creating a deferrable work for polling]
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: If301dd0134c819167c81004468082a68735d9bd7
Merged-In: If301dd0134c819167c81004468082a68735d9bd7
2020-04-02 23:21:22 +00:00
Fenglin Wu
0c0baede19 ANDROID: GKI: pwm: Add different PWM output types support
Normally, PWM channel has fixed output until software request to change
its settings. There are some PWM devices which their outputs could be
changed autonomously according to a predefined pattern programmed in
hardware. Add pwm_output_type enum type to identify these two different
PWM types and add relevant helper functions to set and get PWM output
types and pattern.

Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Bug: 152542675
Test: build and boot
(cherry picked from commit 9e880ec791d4b4ad9f9bc257d9e20c59c3c9d90f)
[surenb: removed sysfs changes and fixed checkpatch.pl error in
pwm_get_output_type_supported function from pwm.h]
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I4a457636547e3225d8f10cfb3237765f500d9cc7
Merged-In: I4a457636547e3225d8f10cfb3237765f500d9cc7
2020-04-02 23:19:22 +00:00
Srinivas Dasari
052c2f7381 UPSTREAM: cfg80211: Authentication offload to user space in AP mode
commit 40cbfa9021 ("cfg80211/nl80211: Optional authentication
offload to userspace")' introduced authentication offload to user
space by the host drivers in station mode. This commit extends
the same for the AP mode too.

Extend NL80211_ATTR_EXTERNAL_AUTH_SUPPORT to also claim the
support of external authentication from the user space in AP mode.
A new flag parameter is introduced in cfg80211_ap_settings to
intend the same while "start ap".

Host driver to use NL80211_CMD_FRAME interface to transmit and
receive the authentication frames to / from the user space.

Host driver to indicate the flag NL80211_RXMGMT_FLAG_EXTERNAL_AUTH
while sending the authentication frame to the user space. This
intends to the user space that the driver wishes it to process
the authentication frame for certain protocols, though it had
initially advertised the support for SME functionality.

User space shall accordingly do the authentication and indicate
its final status through the command NL80211_CMD_EXTERNAL_AUTH.
Allow the command even if userspace doesn't include the attribute
NL80211_ATTR_SSID for AP interface.

Host driver shall continue with the association sequence and
indicate the STA connection status through cfg80211_new_sta.

To facilitate the host drivers in AP mode for matching the pmkid
by the stations during the association, NL80211_CMD_EXTERNAL_AUTH
is also enhanced to include the pmkid to drivers after
the authentication.
This pmkid can also be used in the STA mode to include in the
association request.

Also modify nl80211_external_auth to not mandate SSID in AP mode.

Signed-off-by: Srinivas Dasari <dasaris@codeaurora.org>
[remove useless nla_get_flag() usage]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit fe4943702c)
Bug: 153011874
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Iecdd38a0b6fa7726938c905c4810b9879bc48530
2020-04-02 12:51:05 -07:00
Paul Lawrence
8794e1ed09 ANDROID: Incremental fs: Fix four resource bugs
Without these, you can't unmount a volume on which incfs was
mounted and the tests run.

Also incfs_tests would fail sporadically without the fix to
test_inode

Test: Run incfs_test and unmount underlying volume 1000 times
Bug: 152636070
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I88f11f5d4269c22d9073e5eb671d0c7cc4629f6c
(cherry picked from commit c062bc8e76)
2020-04-02 16:51:41 +00:00
Will McVicker
a2156f0878 ANDROID: Bulk update the ABI xml based on the referenced bugs.
Leaf changes summary: 27 artifacts changed (1 filtered out)
Changed leaf types summary: 27 (1 filtered out) leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

Signed-off-by: Will McVicker <willmcvicker@google.com>
Bug: 148872640
Bug: 151792119
Bug: 152659776
Bug: 152917514
Change-Id: I92e377327f32eab5f78058ef5c2c364ef903c881
2020-04-02 15:51:45 +00:00
Will McVicker
7b8719ed1c ANDROID: GKI: block: resolve ABI diff when CONFIG_BLK_DEV_BSG is unset
If CONFIG_BLK_DEV_BSG is disabled on the vendor side, then struct
request_queue will have an ABI diff. Remove the #ifdef in the struct so
that vendors can choose whether or not to use the config.

'struct request_queue at blkdev.h:434:1' changed:¬
  type size changed from 17600 to 17920 (in bits)¬
  2 data member insertions:¬
    'bsg_job_fn* request_queue::bsg_job_fn', at offset 13952 (in bits) at blkdev.h:650:1¬
    'bsg_class_device request_queue::bsg_dev', at offset 14016 (in bits) at blkdev.h:651:1¬

Signed-off-by: Will McVicker <willmcvicker@google.com>
Bug: 152917514
Test: compile, verify ABI diff
Change-Id: Iec2e3460b717b667fcc0409cbc4ec985cfe0f69c
2020-04-01 16:26:56 -07:00
Pradeep P V K
2cde93c790 ANDROID: GKI: bfq-iosched: update struct elevator_mq_ops ABI
Add the function pointer elevator_registered_fn to the struct
elevator_mq_ops to allow vendors use of this function.

Bug: 152659776
Test: compile
Change-Id: I9e55eee03917a1ab07fbd3f04635ca1a6541b860
Signed-off-by: Pradeep P V K <ppvk@codeaurora.org>
(cherry picked from commit da1defc781fdbf66a12ff8dbb1926d5fc507521e)
[willmcvicker: only cherry-picked the ABI diff]
Signed-off-by: Will McVicker <willmcvicker@google.com>
2020-04-01 15:20:12 -07:00
Maria Yu
9298a1e640 ANDROID: GKI: locking/rwsem: add vendor field to struct rw_semaphore
For ABI compatibility, we are adding a vendor field to support the
config CONFIG_RWSEM_PRIO_AWARE.

Bug: 151792119
Bug: 148872640
Signed-off-by: Maria Yu <aiquny@codeaurora.org>
Signed-off-by: Biao long <blong@codeaurora.org>
[willmcvicker: Only cherry-picked the ABI diff]
(cherry picked from commit c4b6927bb644d57775c601bbd5d9ce3f346ee1b9)
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: I3f289e2992af340b56c2df532ffeb418abf3da79
2020-04-01 15:20:12 -07:00
Will McVicker
46a302bbb0 ANDROID: GKI: fs: add umount_end() function to struct super_operations
This reduces the ABI diff for the module_layout symbol.

Bug: 148872640
Test: compile test
(cherry picked from commit ee7bdc62fd01050285a88be851e2d2df7ff2818e)
[willmcvicker: Only cherry-picked the ABI difference]
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: I1e7e110316d90d190cb4fa1dcd18b70d0d6045f5
2020-04-01 15:20:11 -07:00
Will McVicker
996e3ccc2d ANDROID: GKI: perf: Add fields for CPU hotplug feature
Pull in the ABI diff changes for the CPU hotplug feature. The full
feature can be found in commit 3d3eb5fb85d97 ("perf: add hotplug
support").

Bug: 148872640
Test: compile test
(cherry picked from commit 3d3eb5fb85d97667525d08219eb03e42188ac897)
[willmcvicker: Only cherry-picked the ABI difference]
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: I41982f50bcda29e4659f3ec0ffd4517884a7b6d0
2020-04-01 15:20:11 -07:00
Will McVicker
d66eb53ffd ANDROID: GKI: perf: Add field for struct perf_event
Adds the new struct variable "readable_on_cpus" to reduce the ABI
diff. The Full feature is under commit f994cb43aa705 ("perf/core:
Add support for PMUs that can be read from more than 1 CPU").

Bug: 148872640
Test: compile test
(cherry picked from commit f994cb43aa705bb5301c83dae36a1f12fe11c3cd)
[Only cherry-picked the ABI difference]
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: If46a71163efde2245e955b23da58550e21082e62
2020-04-01 15:20:11 -07:00
Pavankumar Kondeti
37d63f2459 ANDROID: GKI: cpuset: add field for task affinity for cpusets
This updates the struct task_struct ABI to include a field for vendors
to support task affinity for cpusets.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Bug: 148872640
Bug: 149816871
Change-Id: I6c2ec1d5e3d994e176926d94b9e0cc92418020cc
Signed-off-by: Will McVicker <willmcvicker@google.com>
(cherry picked from commit b4fee475f8d7a3327bc63e665ffbfdd63ab4bcc7)
[only cherry-picked the ABI difference]
2020-04-01 15:20:11 -07:00
Eric Biggers
66042ce5c2 UPSTREAM: ubifs: wire up FS_IOC_GET_ENCRYPTION_NONCE
This new ioctl retrieves a file's encryption nonce, which is useful for
testing.  See the corresponding fs/crypto/ patch for more details.

Link: https://lore.kernel.org/r/20200314205052.93294-5-ebiggers@kernel.org
Change-Id: I8f15e873b41e036bc039119a579beac1b78f937b
Bug: 151100202
(cherry picked from commit 861261f2a9)
Signed-off-by: Eric Biggers <ebiggers@google.com>
2020-04-01 09:48:10 -07:00
Eric Biggers
e6d34c1d6c UPSTREAM: f2fs: wire up FS_IOC_GET_ENCRYPTION_NONCE
This new ioctl retrieves a file's encryption nonce, which is useful for
testing.  See the corresponding fs/crypto/ patch for more details.

Link: https://lore.kernel.org/r/20200314205052.93294-4-ebiggers@kernel.org
(cherry picked from commit ee446e1af4)
Bug: 151100202
Change-Id: I26037efc77774c04951da887d8557a15ce6a23ed
Signed-off-by: Eric Biggers <ebiggers@google.com>
2020-04-01 09:48:10 -07:00
Eric Biggers
cbdb58a65c UPSTREAM: ext4: wire up FS_IOC_GET_ENCRYPTION_NONCE
This new ioctl retrieves a file's encryption nonce, which is useful for
testing.  See the corresponding fs/crypto/ patch for more details.

Link: https://lore.kernel.org/r/20200314205052.93294-3-ebiggers@kernel.org
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit 7ec9f3b47a)
Bug: 151100202
Change-Id: I85350aed66285b92444d37c8cd840fb03d2ca25d
Signed-off-by: Eric Biggers <ebiggers@google.com>
2020-04-01 09:48:10 -07:00
Eric Biggers
4182a31c77 UPSTREAM: fscrypt: add FS_IOC_GET_ENCRYPTION_NONCE ioctl
Add an ioctl FS_IOC_GET_ENCRYPTION_NONCE which retrieves the nonce from
an encrypted file or directory.  The nonce is the 16-byte random value
stored in the inode's encryption xattr.  It is normally used together
with the master key to derive the inode's actual encryption key.

The nonces are needed by automated tests that verify the correctness of
the ciphertext on-disk.  Except for the IV_INO_LBLK_64 case, there's no
way to replicate a file's ciphertext without knowing that file's nonce.

The nonces aren't secret, and the existing ciphertext verification tests
in xfstests retrieve them from disk using debugfs or dump.f2fs.  But in
environments that lack these debugging tools, getting the nonces by
manually parsing the filesystem structure would be very hard.

To make this important type of testing much easier, let's just add an
ioctl that retrieves the nonce.

Link: https://lore.kernel.org/r/20200314205052.93294-2-ebiggers@kernel.org
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit e98ad46475)
Bug: 151100202
Change-Id: Ieef2c57b9257ae38eb2e5c1a018ca6f325bb62dd
Signed-off-by: Eric Biggers <ebiggers@google.com>
2020-04-01 09:48:10 -07:00
Andrey Konovalov
d63a6475b8 UPSTREAM: usb: raw_gadget: fix compilation warnings in uapi headers
(Upstream commit 956ae8df7fed0a2acc7ae934f24493eaeb031f62.)

Mark usb_raw_io_flags_valid() and usb_raw_io_flags_zero() as inline to
fix the following warnings:

./usr/include/linux/usb/raw_gadget.h:69:12: warning: unused function 'usb_raw_io_flags_valid' [-Wunused-function]
./usr/include/linux/usb/raw_gadget.h:74:12: warning: unused function 'usb_raw_io_flags_zero' [-Wunused-function]

Reported-by: kernelci.org bot <bot@kernelci.org>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Link: https://lore.kernel.org/r/6206b80b3810f95bfe1d452de45596609a07b6ea.1584456779.git.andreyknvl@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 147413187
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Change-Id: I9bc9708a39f3af4e6a892685530ff04cdf5abe64
2020-03-31 17:40:18 +02:00
Andrey Konovalov
a59105f5c9 BACKPORT: usb: gadget: add raw-gadget interface
Conflict: documentation/usb/index.rst is missing.

(Upstream commit f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10.)

USB Raw Gadget is a kernel module that provides a userspace interface for
the USB Gadget subsystem. Essentially it allows to emulate USB devices
from userspace. Enabled with CONFIG_USB_RAW_GADGET. Raw Gadget is
currently a strictly debugging feature and shouldn't be used in
production.

Raw Gadget is similar to GadgetFS, but provides a more low-level and
direct access to the USB Gadget layer for the userspace. The key
differences are:

1. Every USB request is passed to the userspace to get a response, while
   GadgetFS responds to some USB requests internally based on the provided
   descriptors. However note, that the UDC driver might respond to some
   requests on its own and never forward them to the Gadget layer.

2. GadgetFS performs some sanity checks on the provided USB descriptors,
   while Raw Gadget allows you to provide arbitrary data as responses to
   USB requests.

3. Raw Gadget provides a way to select a UDC device/driver to bind to,
   while GadgetFS currently binds to the first available UDC.

4. Raw Gadget uses predictable endpoint names (handles) across different
   UDCs (as long as UDCs have enough endpoints of each required transfer
   type).

5. Raw Gadget has ioctl-based interface instead of a filesystem-based one.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Bug: 147413187
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Change-Id: Ib48759bda0651e685160c532bed55b7335a39034
2020-03-31 17:40:01 +02:00
Masahiro Yamada
f09c2b483d UPSTREAM: usb: gadget: move choice ... endchoice to legacy/Kconfig
(Upstream commit 10e5e6c2496354f0afec82dba459339c421badbf.)

drivers/usb/gadget/Kconfig includes drivers/usb/gadget/legacy/Kconfig
inside the 'choice' block. The current Kconfig allows this, but I'd
like to discourage this usage.

People tend to mess up the structure without noticing that entire
drivers/usb/gadget/legacy/Kconfig is placed in the choice context.
In fact, legacy/Kconfig mixes up bool and tristate in the choice,
and creates nested choice, etc.

This commit does not change the behavior, but it will help people
notice how badly this Kconfig file is written.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20191211073857.16780-1-masahiroy@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 147413187
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Change-Id: Ib2b96fd9c2acb681b2186eb89ec1f0f2b18d0e89
2020-03-31 17:38:29 +02:00
Maciej Żenczykowski
196eb52d17 UPSTREAM: ipv6: ndisc: add support for 'PREF64' dns64 prefix identifier
This is trivial since we already have support for the entirely
identical (from the kernel's point of view) RDNSS, DNSSL, etc. that
also contain opaque data that needs to be passed down to userspace
for further processing.

As specified in draft-ietf-6man-ra-pref64-09 (while it is still a draft,
it is purely waiting on the RFC Editor for cleanups and publishing):
  PREF64 option contains lifetime and a (up to) 96-bit IPv6 prefix.

The 8-bit identifier of the option type as assigned by the IANA is 38.

Since we lack DNS64/NAT64/CLAT support in kernel at the moment,
thus this option should also be passed on to userland.

See:
  https://tools.ietf.org/html/draft-ietf-6man-ra-pref64-09
  https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml#icmpv6-parameters-5

Cc: Erik Kline <ek@google.com>
Cc: Jen Linkova <furry@google.com>
Cc: Lorenzo Colitti <lorenzo@google.com>
Cc: Michael Haro <mharo@google.com>
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Acked-By: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c24a77edc9)
Bug: 150648313
Change-Id: I02bff2103194a8171f907e82f811d7ab66962138
2020-03-31 08:40:11 +00:00
Ram Muthiah
580730507c ANDROID: GKI: Removed cuttlefish configs
Configs were moved to repo cuttlefish-modules.

Bug: 151981046
Test: Treehugger
Signed-off-by: Ram Muthiah <rammuthiah@google.com>
Change-Id: I217422c401c6ea183ce974c1d156abd4d9e209a6
2020-03-30 22:03:34 -07:00
Alistair Delva
78e767a83b ANDROID: clang: update to 10.0.5
Bug: 151950245
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: I8d2182f5f09dd3f148afd5259557f8487af23304
2020-03-30 20:08:33 +00:00
glider@google.com
23c8ef5a2f FROMLIST: arm64: define __alloc_zeroed_user_highpage
When running the kernel with init_on_alloc=1, calling the default
implementation of __alloc_zeroed_user_highpage() from include/linux/highmem.h
leads to double-initialization of the allocated page (first by the page
allocator, then by clear_user_page().
Calling alloc_page_vma() with __GFP_ZERO, similarly to e.g. x86, seems
to be enough to ensure the user page is zeroed only once.

Signed-off-by: Alexander Potapenko <glider@google.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Bug: 149975351
Link: https://lore.kernel.org/linux-arm-kernel/20200312155920.50067-1-glider@google.com/
Change-Id: I3ff7c3fb082b420491313e0fdd841ce340989d72
Signed-off-by: Alexander Potapenko <glider@google.com>
2020-03-30 09:39:16 +00:00
Paul Lawrence
05cf04f60a ANDROID: Incremental fs: Add INCFS_IOC_GET_FILLED_BLOCKS
Test: incfs_test passes
Bug: 151240628
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I66d0ba1911adc5d68ed404585222e6a81a7eb94f
(cherry picked from commit 8d963bb240)
2020-03-30 04:47:45 +00:00
Paul Lawrence
f2e257e60e ANDROID: Incremental fs: Fix two typos
Test: incfs_test passes
Bug: 151240628
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I627e683b562329fd57aedc8393e22449ff09ee1f
(cherry picked from commit 06c715e275)
2020-03-30 04:46:38 +00:00
Mark Salyzyn
2b4e065e3a ANDROID: GKI: Update ABI
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 1 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

'enum power_supply_property at power_supply.h:170:1' changed:
  type size hasn't changed
  3 enumerator insertions:
    'power_supply_property::POWER_SUPPLY_PROP_CUTOFF_SOC' value '189'
    'power_supply_property::POWER_SUPPLY_PROP_SYS_SOC' value '190'
    'power_supply_property::POWER_SUPPLY_PROP_BATT_SOC' value '191'
  30 enumerator changes:
    'power_supply_property::POWER_SUPPLY_PROP_BATT_CE_CTRL' from value '189' to '192' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_FULL_ESTIMATE' from value '190' to '193' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_RESISTANCE_AVG' from value '191' to '194' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_RES_FILTER_COUNT' from value '192' to '195' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_AICL_DONE' from value '193' to '196' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_VOLTAGE_STEP' from value '194' to '197' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_OTG_FASTROLESWAP' from value '195' to '198' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_APSD_RERUN' from value '196' to '199' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_APSD_TIMEOUT' from value '197' to '200' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CP_STATUS1' from value '198' to '201' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CP_STATUS2' from value '199' to '202' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CP_ENABLE' from value '200' to '203' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CP_SWITCHER_EN' from value '201' to '204' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CP_DIE_TEMP' from value '202' to '205' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CP_ISNS' from value '203' to '206' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CP_ISNS_SLAVE' from value '204' to '207' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CP_TOGGLE_SWITCHER' from value '205' to '208' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CP_IRQ_STATUS' from value '206' to '209' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CP_ILIM' from value '207' to '210' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_IRQ_STATUS' from value '208' to '211' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_PARALLEL_OUTPUT_MODE' from value '209' to '212' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_ALIGNMENT' from value '210' to '213' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT' from value '211' to '214' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_CHARGER_STATE' from value '212' to '215' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_MODEL_NAME' from value '213' to '216' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_PTMC_ID' from value '214' to '217' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_MANUFACTURER' from value '215' to '218' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_BATTERY_TYPE' from value '216' to '219' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_CYCLE_COUNTS' from value '217' to '220' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_SERIAL_NUMBER' from value '218' to '221' at power_supply.h:170:1

  7 impacted interfaces:
    function power_supply* devm_power_supply_register(device*, const power_supply_desc*, const power_supply_config*)
    function void power_supply_changed(power_supply*)
    function power_supply* power_supply_get_by_name(const char*)
    function void* power_supply_get_drvdata(power_supply*)
    function int power_supply_get_property(power_supply*, power_supply_property, power_supply_propval*)
    function void power_supply_put(power_supply*)
    function int power_supply_set_property(power_supply*, power_supply_property, const power_supply_propval*)

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I93153b9c6bff1a14d2dfcd62b71e8c3f08cf03a2
2020-03-27 14:39:17 -07:00
Ken Tsou
5635d7649c ANDROID: GKI: power_supply: add more soc properties
cutoff_soc, sys_soc, batt_soc
  for battery history collection

Bug: 151994696
Change-Id: Ie564f89799d866e809c62ffe7a4875332d3ce032
Signed-off-by: Ken Tsou <kentsou@google.com>
(cherry picked from commit 304f7a3744b14910ffaa0dfe1c61b938d04a7921)
(cherry picked from commit 7f340dc74b737f300625e0278c97d343fcaa9084)
(cherry picked from commit 9741511073c137120ac6cc66aa7c31f645b1d61d)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
2020-03-27 14:29:21 -07:00
Mark Salyzyn
65f5cee0e0 ANDROID: GKI: Update ABI
Leaf changes summary: 1 artifact changed (2 filtered out)
Changed leaf types summary: 1 (2 filtered out) leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

'enum power_supply_property at power_supply.h:87:1' changed:
  type size hasn't changed
  152 enumerator insertions:
    'power_supply_property::POWER_SUPPLY_PROP_USB_HC' value '64'
    'power_supply_property::POWER_SUPPLY_PROP_USB_OTG' value '65'
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_ENABLED' value '66'
    'power_supply_property::POWER_SUPPLY_PROP_SET_SHIP_MODE' value '67'
    'power_supply_property::POWER_SUPPLY_PROP_REAL_TYPE' value '68'
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_NOW_RAW' value '69'
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_NOW_ERROR' value '70'
    'power_supply_property::POWER_SUPPLY_PROP_CAPACITY_RAW' value '71'
    'power_supply_property::POWER_SUPPLY_PROP_BATTERY_CHARGING_ENABLED' value '72'
    'power_supply_property::POWER_SUPPLY_PROP_CHARGING_ENABLED' value '73'
    'power_supply_property::POWER_SUPPLY_PROP_STEP_CHARGING_ENABLED' value '74'
    'power_supply_property::POWER_SUPPLY_PROP_STEP_CHARGING_STEP' value '75'
    'power_supply_property::POWER_SUPPLY_PROP_PIN_ENABLED' value '76'
    'power_supply_property::POWER_SUPPLY_PROP_INPUT_SUSPEND' value '77'
    'power_supply_property::POWER_SUPPLY_PROP_INPUT_VOLTAGE_REGULATION' value '78'
    'power_supply_property::POWER_SUPPLY_PROP_INPUT_CURRENT_MAX' value '79'
    'power_supply_property::POWER_SUPPLY_PROP_INPUT_CURRENT_TRIM' value '80'
    'power_supply_property::POWER_SUPPLY_PROP_INPUT_CURRENT_SETTLED' value '81'
    'power_supply_property::POWER_SUPPLY_PROP_INPUT_VOLTAGE_SETTLED' value '82'
    'power_supply_property::POWER_SUPPLY_PROP_VCHG_LOOP_DBC_BYPASS' value '83'
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_COUNTER_SHADOW' value '84'
    'power_supply_property::POWER_SUPPLY_PROP_HI_POWER' value '85'
    'power_supply_property::POWER_SUPPLY_PROP_LOW_POWER' value '86'
    'power_supply_property::POWER_SUPPLY_PROP_COOL_TEMP' value '87'
    'power_supply_property::POWER_SUPPLY_PROP_WARM_TEMP' value '88'
    'power_supply_property::POWER_SUPPLY_PROP_COLD_TEMP' value '89'
    'power_supply_property::POWER_SUPPLY_PROP_HOT_TEMP' value '90'
    'power_supply_property::POWER_SUPPLY_PROP_SYSTEM_TEMP_LEVEL' value '91'
    'power_supply_property::POWER_SUPPLY_PROP_RESISTANCE' value '92'
    'power_supply_property::POWER_SUPPLY_PROP_RESISTANCE_CAPACITIVE' value '93'
    'power_supply_property::POWER_SUPPLY_PROP_RESISTANCE_ID' value '94'
    'power_supply_property::POWER_SUPPLY_PROP_RESISTANCE_NOW' value '95'
    'power_supply_property::POWER_SUPPLY_PROP_FLASH_CURRENT_MAX' value '96'
    'power_supply_property::POWER_SUPPLY_PROP_UPDATE_NOW' value '97'
    'power_supply_property::POWER_SUPPLY_PROP_ESR_COUNT' value '98'
    'power_supply_property::POWER_SUPPLY_PROP_BUCK_FREQ' value '99'
    'power_supply_property::POWER_SUPPLY_PROP_BOOST_CURRENT' value '100'
    'power_supply_property::POWER_SUPPLY_PROP_SAFETY_TIMER_ENABLE' value '101'
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_DONE' value '102'
    'power_supply_property::POWER_SUPPLY_PROP_FLASH_ACTIVE' value '103'
    'power_supply_property::POWER_SUPPLY_PROP_FLASH_TRIGGER' value '104'
    'power_supply_property::POWER_SUPPLY_PROP_FORCE_TLIM' value '105'
    'power_supply_property::POWER_SUPPLY_PROP_DP_DM' value '106'
    'power_supply_property::POWER_SUPPLY_PROP_INPUT_CURRENT_LIMITED' value '107'
    'power_supply_property::POWER_SUPPLY_PROP_INPUT_CURRENT_NOW' value '108'
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_QNOVO_ENABLE' value '109'
    'power_supply_property::POWER_SUPPLY_PROP_CURRENT_QNOVO' value '110'
    'power_supply_property::POWER_SUPPLY_PROP_VOLTAGE_QNOVO' value '111'
    'power_supply_property::POWER_SUPPLY_PROP_RERUN_AICL' value '112'
    'power_supply_property::POWER_SUPPLY_PROP_CYCLE_COUNT_ID' value '113'
    'power_supply_property::POWER_SUPPLY_PROP_SAFETY_TIMER_EXPIRED' value '114'
    'power_supply_property::POWER_SUPPLY_PROP_RESTRICTED_CHARGING' value '115'
    'power_supply_property::POWER_SUPPLY_PROP_CURRENT_CAPABILITY' value '116'
    'power_supply_property::POWER_SUPPLY_PROP_TYPEC_MODE' value '117'
    'power_supply_property::POWER_SUPPLY_PROP_TYPEC_CC_ORIENTATION' value '118'
    'power_supply_property::POWER_SUPPLY_PROP_TYPEC_POWER_ROLE' value '119'
    'power_supply_property::POWER_SUPPLY_PROP_TYPEC_SRC_RP' value '120'
    'power_supply_property::POWER_SUPPLY_PROP_PD_ALLOWED' value '121'
    'power_supply_property::POWER_SUPPLY_PROP_PD_ACTIVE' value '122'
    'power_supply_property::POWER_SUPPLY_PROP_PD_IN_HARD_RESET' value '123'
    'power_supply_property::POWER_SUPPLY_PROP_PD_CURRENT_MAX' value '124'
    'power_supply_property::POWER_SUPPLY_PROP_PD_USB_SUSPEND_SUPPORTED' value '125'
    'power_supply_property::POWER_SUPPLY_PROP_CHARGER_TEMP' value '126'
    'power_supply_property::POWER_SUPPLY_PROP_CHARGER_TEMP_MAX' value '127'
    'power_supply_property::POWER_SUPPLY_PROP_PARALLEL_DISABLE' value '128'
    'power_supply_property::POWER_SUPPLY_PROP_PE_START' value '129'
    'power_supply_property::POWER_SUPPLY_PROP_SOC_REPORTING_READY' value '130'
    'power_supply_property::POWER_SUPPLY_PROP_DEBUG_BATTERY' value '131'
    'power_supply_property::POWER_SUPPLY_PROP_FCC_DELTA' value '132'
    'power_supply_property::POWER_SUPPLY_PROP_ICL_REDUCTION' value '133'
    'power_supply_property::POWER_SUPPLY_PROP_PARALLEL_MODE' value '134'
    'power_supply_property::POWER_SUPPLY_PROP_DIE_HEALTH' value '135'
    'power_supply_property::POWER_SUPPLY_PROP_CONNECTOR_HEALTH' value '136'
    'power_supply_property::POWER_SUPPLY_PROP_CTM_CURRENT_MAX' value '137'
    'power_supply_property::POWER_SUPPLY_PROP_HW_CURRENT_MAX' value '138'
    'power_supply_property::POWER_SUPPLY_PROP_PR_SWAP' value '139'
    'power_supply_property::POWER_SUPPLY_PROP_CC_STEP' value '140'
    'power_supply_property::POWER_SUPPLY_PROP_CC_STEP_SEL' value '141'
    'power_supply_property::POWER_SUPPLY_PROP_SW_JEITA_ENABLED' value '142'
    'power_supply_property::POWER_SUPPLY_PROP_PD_VOLTAGE_MAX' value '143'
    'power_supply_property::POWER_SUPPLY_PROP_PD_VOLTAGE_MIN' value '144'
    'power_supply_property::POWER_SUPPLY_PROP_SDP_CURRENT_MAX' value '145'
    'power_supply_property::POWER_SUPPLY_PROP_CONNECTOR_TYPE' value '146'
    'power_supply_property::POWER_SUPPLY_PROP_PARALLEL_BATFET_MODE' value '147'
    'power_supply_property::POWER_SUPPLY_PROP_PARALLEL_FCC_MAX' value '148'
    'power_supply_property::POWER_SUPPLY_PROP_MIN_ICL' value '149'
    'power_supply_property::POWER_SUPPLY_PROP_MOISTURE_DETECTED' value '150'
    'power_supply_property::POWER_SUPPLY_PROP_BATT_PROFILE_VERSION' value '151'
    'power_supply_property::POWER_SUPPLY_PROP_BATT_FULL_CURRENT' value '152'
    'power_supply_property::POWER_SUPPLY_PROP_RECHARGE_SOC' value '153'
    'power_supply_property::POWER_SUPPLY_PROP_HVDCP_OPTI_ALLOWED' value '154'
    'power_supply_property::POWER_SUPPLY_PROP_SMB_EN_MODE' value '155'
    'power_supply_property::POWER_SUPPLY_PROP_SMB_EN_REASON' value '156'
    'power_supply_property::POWER_SUPPLY_PROP_ESR_ACTUAL' value '157'
    'power_supply_property::POWER_SUPPLY_PROP_ESR_NOMINAL' value '158'
    'power_supply_property::POWER_SUPPLY_PROP_SOH' value '159'
    'power_supply_property::POWER_SUPPLY_PROP_CLEAR_SOH' value '160'
    'power_supply_property::POWER_SUPPLY_PROP_FORCE_RECHARGE' value '161'
    'power_supply_property::POWER_SUPPLY_PROP_FCC_STEPPER_ENABLE' value '162'
    'power_supply_property::POWER_SUPPLY_PROP_TOGGLE_STAT' value '163'
    'power_supply_property::POWER_SUPPLY_PROP_MAIN_FCC_MAX' value '164'
    'power_supply_property::POWER_SUPPLY_PROP_FG_RESET' value '165'
    'power_supply_property::POWER_SUPPLY_PROP_QC_OPTI_DISABLE' value '166'
    'power_supply_property::POWER_SUPPLY_PROP_CC_SOC' value '167'
    'power_supply_property::POWER_SUPPLY_PROP_BATT_AGE_LEVEL' value '168'
    'power_supply_property::POWER_SUPPLY_PROP_SCALE_MODE_EN' value '169'
    'power_supply_property::POWER_SUPPLY_PROP_VOLTAGE_VPH' value '170'
    'power_supply_property::POWER_SUPPLY_PROP_CHIP_VERSION' value '171'
    'power_supply_property::POWER_SUPPLY_PROP_THERM_ICL_LIMIT' value '172'
    'power_supply_property::POWER_SUPPLY_PROP_DC_RESET' value '173'
    'power_supply_property::POWER_SUPPLY_PROP_VOLTAGE_MAX_LIMIT' value '174'
    'power_supply_property::POWER_SUPPLY_PROP_REAL_CAPACITY' value '175'
    'power_supply_property::POWER_SUPPLY_PROP_FORCE_MAIN_ICL' value '176'
    'power_supply_property::POWER_SUPPLY_PROP_FORCE_MAIN_FCC' value '177'
    'power_supply_property::POWER_SUPPLY_PROP_COMP_CLAMP_LEVEL' value '178'
    'power_supply_property::POWER_SUPPLY_PROP_ADAPTER_CC_MODE' value '179'
    'power_supply_property::POWER_SUPPLY_PROP_SKIN_HEALTH' value '180'
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_DISABLE' value '181'
    'power_supply_property::POWER_SUPPLY_PROP_ADAPTER_DETAILS' value '182'
    'power_supply_property::POWER_SUPPLY_PROP_DEAD_BATTERY' value '183'
    'power_supply_property::POWER_SUPPLY_PROP_VOLTAGE_FIFO' value '184'
    'power_supply_property::POWER_SUPPLY_PROP_CC_UAH' value '185'
    'power_supply_property::POWER_SUPPLY_PROP_OPERATING_FREQ' value '186'
    'power_supply_property::POWER_SUPPLY_PROP_AICL_DELAY' value '187'
    'power_supply_property::POWER_SUPPLY_PROP_AICL_ICL' value '188'
    'power_supply_property::POWER_SUPPLY_PROP_BATT_CE_CTRL' value '189'
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_FULL_ESTIMATE' value '190'
    'power_supply_property::POWER_SUPPLY_PROP_RESISTANCE_AVG' value '191'
    'power_supply_property::POWER_SUPPLY_PROP_RES_FILTER_COUNT' value '192'
    'power_supply_property::POWER_SUPPLY_PROP_AICL_DONE' value '193'
    'power_supply_property::POWER_SUPPLY_PROP_VOLTAGE_STEP' value '194'
    'power_supply_property::POWER_SUPPLY_PROP_OTG_FASTROLESWAP' value '195'
    'power_supply_property::POWER_SUPPLY_PROP_APSD_RERUN' value '196'
    'power_supply_property::POWER_SUPPLY_PROP_APSD_TIMEOUT' value '197'
    'power_supply_property::POWER_SUPPLY_PROP_CP_STATUS1' value '198'
    'power_supply_property::POWER_SUPPLY_PROP_CP_STATUS2' value '199'
    'power_supply_property::POWER_SUPPLY_PROP_CP_ENABLE' value '200'
    'power_supply_property::POWER_SUPPLY_PROP_CP_SWITCHER_EN' value '201'
    'power_supply_property::POWER_SUPPLY_PROP_CP_DIE_TEMP' value '202'
    'power_supply_property::POWER_SUPPLY_PROP_CP_ISNS' value '203'
    'power_supply_property::POWER_SUPPLY_PROP_CP_ISNS_SLAVE' value '204'
    'power_supply_property::POWER_SUPPLY_PROP_CP_TOGGLE_SWITCHER' value '205'
    'power_supply_property::POWER_SUPPLY_PROP_CP_IRQ_STATUS' value '206'
    'power_supply_property::POWER_SUPPLY_PROP_CP_ILIM' value '207'
    'power_supply_property::POWER_SUPPLY_PROP_IRQ_STATUS' value '208'
    'power_supply_property::POWER_SUPPLY_PROP_PARALLEL_OUTPUT_MODE' value '209'
    'power_supply_property::POWER_SUPPLY_PROP_ALIGNMENT' value '210'
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT' value '211'
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_CHARGER_STATE' value '212'
    'power_supply_property::POWER_SUPPLY_PROP_PTMC_ID' value '214'
    'power_supply_property::POWER_SUPPLY_PROP_BATTERY_TYPE' value '216'
    'power_supply_property::POWER_SUPPLY_PROP_CYCLE_COUNTS' value '217'
  3 enumerator changes:
    'power_supply_property::POWER_SUPPLY_PROP_MODEL_NAME' from value '64' to '213' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_MANUFACTURER' from value '65' to '215' at power_supply.h:170:1
    'power_supply_property::POWER_SUPPLY_PROP_SERIAL_NUMBER' from value '66' to '218' at power_supply.h:170:1

  7 impacted interfaces:
    function power_supply* devm_power_supply_register(device*, const power_supply_desc*, const power_supply_config*)
    function void power_supply_changed(power_supply*)
    function power_supply* power_supply_get_by_name(const char*)
    function void* power_supply_get_drvdata(power_supply*)
    function int power_supply_get_property(power_supply*, power_supply_property, power_supply_propval*)
    function void power_supply_put(power_supply*)
    function int power_supply_set_property(power_supply*, power_supply_property, const power_supply_propval*)

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I1deb4923b541cc654c0a3893ea16afb291c3f575
2020-03-27 12:41:28 -07:00
YiHsiang Peng
363ef6df52 ANDROID: GKI: google_battery: return string type for serial_number property
Bug: 146759409
Change-Id: Idbd61d9007e645b78eba1690ad6e58825f79787d
Signed-off-by: YiHsiang Peng <yihsiangpeng@google.com>
(cherry picked from commit 686c676a7fc07b45d364408eb1c125523e2a7e5f)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
2020-03-27 11:20:52 -07:00
Mark Salyzyn
0de5e99fb8 ANDROID: GKI: power: supply: Add APSD based power-supply properties
Add following power_supply properties:

POWER_SUPPLY_PROP_APSD_RERUN - Property to re-run charger power source
detection.

POWER_SUPPLY_PROP_APSD_TIMEOUT - Property to report APSD timer status.

Change-Id: I2f8649461e5906f17adc5b360afed20b5fa6f58c
Signed-off-by: Ashish Chavan <ashichav@codeaurora.org>
(cherry picked from commit 9228d604549389c9f8ee65272f30b733d4125ccc)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
2020-03-27 11:20:52 -07:00
Mark Salyzyn
c5bdb8464b ANDROID: GKI: power: supply: Remove "Wipower" PSY type
Remove "Wipower" PSY type as it is not used by any driver.

Change-Id: Ib198b38a22c275ff1c390f1e5eac12a4e914b66b
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
(cherry picked from commit 5573bd8e6fb4b03d105f32dc0a5dee3b8b8f60f9)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
2020-03-27 11:20:52 -07:00
Mark Salyzyn
8eb88369ba ANDROID: GKI: power: supply: Add support for HVDCP_3P5
Add necessary macros to support and report HVDCP_3P5 adapter.

Change-Id: I43c977efdae58551bb934589c05be5960f34fff9
Signed-off-by: Ashish Chavan <ashichav@codeaurora.org>
(cherry picked from commit be88e7b3e9588f69ff4870c23c886b3c45761812)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
2020-03-27 11:20:51 -07:00
Kyle Tso
4c6b35adc1 ANDROID: GKI: power_supply: Define Debug Accessory Mode
PM8150B is able to detect Debug Accessory Modes and Non-Compliant cables
with CC pulled-up with the same Rp values. Define them in power_supply
framework for other drivers who need this information.

Bug: 139264914
Change-Id: I43c3e3ed64c9de73c70dde4663c4e89d9d241996
Signed-off-by: Kyle Tso <kyletso@google.com>
(cherry picked from commit 22dc877f78abd2f375e3d93003b966014b8f05b8)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
2020-03-27 11:20:51 -07:00
Mark Salyzyn
f022b1256d ANDROID: GKI: power: supply: Add POWER_SUPPLY_PROP_AICL_*
Partially taken from commit b81ebe136c51cdb27b2a374e66eb23c92a81ab40
("power: smb5-lib: tuning dcin aicl")

Signed-off-by: YiHsiang Peng <yihsiangpeng@google.com>
Bug: 146538840
(cherry picked from commit b81ebe136c51cdb27b2a374e66eb23c92a81ab40)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I4fb09481e0da0de5acbd27b7c2c20b67a8305fa2
2020-03-27 11:20:51 -07:00
Mark Salyzyn
caaeb5f710 ANDROID: GKI: power: supply: Add POWER_SUPPLY_PROP_ALIGNMENT
Partially taken from commit 3c7e776d03e956a0889c849c384d18400ef0e28e
("p9221: add wireless/align node for move to center")

Signed-off-by: Wilson Chan <wtchan@google.com>
Bug: 140835784
Signed-off-by: YiHsiang Peng <yihsiangpeng@google.com>
(cherry picked from commit 3c7e776d03e956a0889c849c384d18400ef0e28e)
(cherry picked from commit bc1980052972b75422db80dfd5b5756c2d42f978)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I468f18c1f1d761565e15944b5bc58f82244924d4
2020-03-27 11:20:51 -07:00
Sahil Chandna
63ea9d3f6b ANDROID: GKI: power_supply: Add CP_ISNS_SLAVE power supply property
Add power supply property POWER_SUPPLY_PROP_CP_ISNS_SLAVE to
expose ISNS of slave SMB1390.

Signed-off-by: Sahil Chandna <chandna@codeaurora.org>
(cherry picked from commit 88073715e166e8042f90ed0fb41b384b6dd5e69e)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: Iec34bf19070e2587a26a92abfefbea0da01fdd6b
2020-03-27 11:20:50 -07:00
Ashay Jaiswal
cb77fe70ec ANDROID: GKI: power_supply: add properties to report parallel connection topology
Add power_supply properties to report and the connection topology
of parallel charger(input and output).

Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
(cherry picked from commit ad45db3e1f38bc72949d57d4926e7d5ef7c58e56)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: Id4e9e3c23d83e58906e0cb3dd208b57089eed81a
2020-03-27 11:20:50 -07:00
Ashay Jaiswal
f7b16318ce ANDROID: GKI: power_supply: add POWER_SUPPLY_PROP_IRQ_STATUS property
Add "POWER_SUPPLY_PROP_IRQ_STATUS" property, this can be used
by drivers to report interrupt status.

Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
(cherry picked from commit 74b1cb85b8eb3fd14b21d5625dc7a39a50e9377a)
Signed-off-by: Mark Salyzyn <salyyzn@google.com>
Bug: 150789066
Change-Id: I846f98647844754b71de8b1ecd90abe0c2058709
2020-03-27 11:20:50 -07:00