Commit Graph

1094936 Commits

Author SHA1 Message Date
qctecmdr
2ca7ee6417 Merge "modules.list.msm.pineapple: add several regulator modules" 2022-06-11 13:06:25 -07:00
David Collins
600b6629c2 modules.list.msm.pineapple: add several regulator modules
Add debug-regulator.ko, proxy-consumer.ko, and rpmh-regulator.ko
to the pineapple first stage modules list.  This ensures that
dependencies are met whenever these drivers are enabled.

Change-Id: I6126259803559ec212d62ecc62ee743ae4fb633e
Signed-off-by: David Collins <quic_collinsd@quicinc.com>
2022-06-09 15:58:11 -07:00
David Collins
7453703eaf android: abi_gki_aarch64_qcom: allow symbols needed by PMIC drivers
Add symbols utilized by PMIC drivers to the ABI symbol list.

Change-Id: Ia822d41a7e86fa8efd66798004bfa90dbce2c854
Signed-off-by: David Collins <quic_collinsd@quicinc.com>
2022-06-09 15:58:11 -07:00
Jishnu Prakash
d116d1e14c soc: qcom: pmic_glink: Fix a race condition in removing rpmsg device
When a pmic_glink client tries to perform a transaction through
pmic_glink_write API during the time when rpmsg device is being
removed, there is a possibility for client attempting to send
a message after rpmsg device has been marked NULL. Add a
read-write semaphore to ensure multiple glink clients can
still perform transactions in parallel while ensuring rpmsg
device removal cannot be done concurrently with transactions.

Change-Id: Ibeeced29d338154cebb2b47729a652cfe148dd83
Signed-off-by: Jishnu Prakash <quic_jprakash@quicinc.com>
2022-06-09 15:09:15 -07:00
qctecmdr
98b7580d6c Merge "modules.list.msm.pineapple: Add gdsc-regulator module" 2022-06-09 09:09:00 -07:00
qctecmdr
27b92805a6 Merge "arm64: defconfig: Enable Boot Statistics driver for pineapple" 2022-06-09 09:09:00 -07:00
qctecmdr
b9414cc501 Merge "leds: leds-qti-flash: update locking used for trigger iteration" 2022-06-08 05:10:08 -07:00
qctecmdr
6e8751ae53 Merge "spmi: pmic-arb: add support for HW version 7" 2022-06-08 02:27:45 -07:00
qctecmdr
f829779b80 Merge "defconfig: pineapple-gki: Enable governor driver" 2022-06-08 02:27:44 -07:00
qctecmdr
b7e16f10d2 Merge "pwm: pwm-qti-lpg: Fix pause_hi_count & pause_lo_count initialization" 2022-06-08 02:27:44 -07:00
qctecmdr
fccc41b1ec Merge "hwmon: qti_amoled_ecm: Support getting sdam_index for more than 2 SDAMs" 2022-06-07 23:38:10 -07:00
qctecmdr
832a93f1cf Merge "leds: qti-flash: Support zero duration for flash safety timer" 2022-06-07 23:38:09 -07:00
qctecmdr
52dfd52e33 Merge "kernel: Add a snapshot of the msm_sysstats driver from msm-5.15" 2022-06-07 23:38:08 -07:00
qctecmdr
386aa76ed8 Merge "regulator: add QTI regulator OCP notifier driver" 2022-06-07 23:38:08 -07:00
qctecmdr
c499516e2e Merge "soc: qcom: msm_ext_display: add header file for msm external display" 2022-06-07 23:38:07 -07:00
qctecmdr
fe94365a51 Merge "soc: qcom: Add cpuss sleep stats driver snapshot" 2022-06-07 20:50:06 -07:00
qctecmdr
6118b9bca9 Merge "iio: adc: qcom-spmi-adc5-gen3: Update ratios for SMB_* channels for ADC7" 2022-06-07 20:50:05 -07:00
qctecmdr
00c6ac2216 Merge "mfd: qcom-i2c-pmic: Reduce the stat-toggle delay" 2022-06-07 20:50:05 -07:00
qctecmdr
4dec50bc15 Merge "input: qcom-hv-haptics: add high-voltage check for HAP525_HV module" 2022-06-07 20:50:04 -07:00
qctecmdr
919f6e5afd Merge "leds-qti-tri-led: Switch to use qpnp_lpg_pwm_{set_output_type,get_output_types_supported}" 2022-06-07 20:50:02 -07:00
qctecmdr
fdf4d5a92f Merge "iio: adc: qcom-spmi-adc5-gen3: Fix calls to qcom_adc5_hw_scale()" 2022-06-07 13:57:46 -07:00
Rashid Zafar
cc462eb6e6 defconfig: pineapple-gki: Enable governor driver
Enable the governor driver for Pineapple.

Change-Id: I38798c42dca86a9284186687cbc28168c2ac18ef
Signed-off-by: Rashid Zafar <quic_rzafar@quicinc.com>
2022-06-07 12:29:44 -07:00
Rashid Zafar
c4354bba6e cpuidle: governors: Add snapshot of qcom-lpm governor
Add snapshot of qcom-lpm governor from msm-5.15
'commit <0050a5bbad2c> ("cpuidle: governors: qcom-lpm:
 Ignore IPI trace when suspend in progress")'.

Change-Id: I354b9f34867d42ca0899adc3f593a4a3e33da20d
Signed-off-by: Rashid Zafar <quic_rzafar@quicinc.com>
2022-06-07 12:28:24 -07:00
Huang Yiwei
f99cad7841 arm64: defconfig: Enable Boot Statistics driver for pineapple
Enable Boot Statistics driver for pineapple.

Change-Id: Ia5cab4667089043ee996e5a4f52c38787634500e
Signed-off-by: Huang Yiwei <quic_hyiwei@quicinc.com>
2022-06-07 22:04:42 +08:00
Subbaraman Narayanamurthy
131656a2b7 hwmon: qti_amoled_ecm: Support getting sdam_index for more than 2 SDAMs
Currently, sdam_num is used to read SDAM_INDEX for reading samples
from each SDAM. However, it works well only when 2 SDAMs are used.
If ECM supports more than 2 SDAMs, SDAM_INDEX read for the third
SDAM (and after) would be incorrect. Fix it.

Change-Id: Ibf2219b80a7480a0fda11df974786c1d123ba492
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-06-06 17:10:19 -07:00
Subbaraman Narayanamurthy
c96271dd6d hwmon: qti_amoled_ecm: update ecm_reset_sdam_config()
Currently ECM_SEND_IRQ and ECM_WRITE_TO_SDAM offsets in first
SDAM is initialized to 0x03 to enable storing samples in two
SDAMs for ECM. With an additional SDAM for ECM, these registers
should be initialized accordingly. Support this by updating those
registers with a value based on number of SDAMs.

Change-Id: Icd262907e4fb71f8696b34f9ebf2463e281a2f66
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-06-06 17:10:18 -07:00
Fenglin Wu
b731ccd999 hwmon: qti_amoled_ecm: return avg_current as 0 upon error exceptions
Avg_current is an unsigned 16-bit data and assigning it a negative
value would make it being shown as a very big positive value which
doesn't make sense for ECM current measurement. Instead, assign it
to 0 upon error exceptions and print out corresponding messages.

Change-Id: I438667e40d63e4142860b7de4e7cf7495d3c424e
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
2022-06-06 17:10:18 -07:00
Fenglin Wu
48c3279d8d hwmon: amoled-ecm: add support to re-enable ECM dynamically
When ECM is enabled, disable ECM if display goes blank, and re-enable
ECM once display restores to unblank. This helps in keeping ECM HW
enabled only when display is active.

Meanwhile, update the logic a little bit on calculating the average
current. When any of the accumulated values is invalid, just ignore
the calculation instead of disabling the ECM.

Change-Id: Ibfe973df4dabd1b1cd48927ce567a094da6382a3
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
2022-06-06 17:10:18 -07:00
Subbaraman Narayanamurthy
ad61c83861 hwmon: qti_amoled_ecm: add debug log for nvmem writes
Add a wrapper function ecm_nvmem_device_write() which can log
the nvmem writes. This is useful for debugging.

Change-Id: Icc4ee6ff50b46f92e0169660e3400d80f7d4da37
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-06-06 17:10:18 -07:00
Subbaraman Narayanamurthy
d5109e4d3d hwmon: qti_amoled_ecm: Fix initial value for ECM_WRITE_TO_SDAM
Whenever ECM is enabled by the user, some SDAM registers are
initialized for the proper operation. Change the initial value
for ECM_WRITE_TO_SDAM as per the hardware recommendation.

Change-Id: I7a414bb83640178055f3c5a463daa6328aaef69c
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-06-06 17:10:18 -07:00
Shyam Kumar Thella
50499dcf75 hwmon: Add QTI AMOLED ECM driver
AMOLED ECM (Embedded Current Measurement) is a method to measure OLED
display power consumption with a time granularity in sub-frame or
multiple frames of image data. ECM can be for a short period or for a
longer period.

Change-Id: I7ea0b7d8d5961ec015c5a79ee2037ff36329f775
Signed-off-by: Shyam Kumar Thella <sthella@codeaurora.org>
2022-06-06 17:10:18 -07:00
Anjelique Melendez
db8db967e1 pwm: pwm-qti-lpg: Fix pause_hi_count & pause_lo_count initialization
Currently, if qcom,ramp-pause-hi-count or qcom,ramp-pause-lo-count
property is not defined in DT, then pause_hi_count/pause_lo_count will
be initialized with incorrect values. Fix this.

Change-Id: I1bd91b64a795730bfbae406111c53a691e314196
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-06 15:33:08 -07:00
Anjelique Melendez
642889346a pwm: qti-lpg: Fix DT property for reading tick duration
Tick duration defines the tick duration (in microseconds) for the clock
that PPG uses, which is used to program the ramp step duration for the
pattern. It's currently read via "qcom,tick-period-us" property which is
not matching with DT binding "qcom,tick-duration-us". Fix it.

Change-Id: I92cf4b8acc0cb36ec970a8644126fd92652b0091
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-06 15:33:08 -07:00
Subbaraman Narayanamurthy
0963865b68 pwm: pwm-qti-lpg: add qpnp_lpg_pwm_{set_output_type,get_output_types_supported}
'Commit 106a4b85e0
("BACKPORT: FROMLIST: pwm: Add support for different PWM output types")'
cannot be carried forward. Hence to support breath functionality
in leds-qti-tri-led driver, add the following APIs.

- qpnp_lpg_pwm_set_output_type
- qpnp_lpg_pwm_get_output_types_supported

This is needed to switch PWM output type to PWM (fixed) or LPG/PPG
(modulated).

Change-Id: I932dd03dea35377727fb28bafa87cfbcf7e95c97
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-06-06 15:33:08 -07:00
Subbaraman Narayanamurthy
ae52ee9ba4 pwm: pwm-qti-lpg: Fix usage of pwmchip_remove()
pwmchip_remove() doesn't return int anymore. Fix it. Since rc
doesn't have any use, remove it.

Change-Id: I7d07d5c9f02a59edd7d0da5353502536d9ec16f8
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-06-06 15:33:08 -07:00
Guru Das Srinagesh
189c045715 pwm: qti-lpg: Add ramp pause support for PPG
Add support for configuring user-defined ramp-pause-hi/lo count in SDAM
to support PPG with the following device tree properties.
 - qcom,ramp-pause-hi-count
 - qcom,ramp-pause-lo-count

The qpnp_lpg_parse_pattern_dt() function has been refactored to fix the
cyclomatic complexity warning.

Change-Id: Ib35dbe8ef0ff354ea84aeed8a24d41868a1b7502
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
2022-06-06 15:33:08 -07:00
Guru Das Srinagesh
2ab20677d4 pwm: qti-lpg: Add support for FM MODE
PWM channels that are configured to support Variable Frequency Mode
generate a signal of fixed duty cycle (50%) and variable frequency. In
such cases, the desired frequency setting is calculated differently
internally, according to a new formula.

Change-Id: I5cbbab9fa75fdd22c75811e5f61e69b8f4abe020
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
2022-06-06 15:33:07 -07:00
Subbaraman Narayanamurthy
4b49bbb8e9 pwm: pwm-qti-lpg: Don't print error log for -EPROBE_DEFER
Currently, an error log is printed every time when parsing a DT
property fails because of probe deferral. Fix it.

Change-Id: Ic63c18393494b38bfb09a7ca85fd738dd2de56fd
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-06-06 15:33:07 -07:00
Guru Das Srinagesh
ed90ef941a pwm: qti-lpg: Read tick duration via device tree
Tick duration defines the tick duration (in microseconds) for the clock
that PPG uses which is used to program the ramp step duration for the
pattern. If unspecified, the default value is 7800 us.

Change-Id: I7cd96d74a39becffbf9a008610c0092ad2462446
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
2022-06-06 15:33:07 -07:00
Guru Das Srinagesh
0a310a382d pwm: qti-lpg: Adapt to two-nvmem PBS triggering scheme
PM8350C PWM PPG does away with the need to directly manage the PBS
triggering via the PBS driver APIs by using a single register write to
an SDAM register instead. A PBS sequence thus triggered should be duly
cleared before next use. The existing scheme is also retained for
backward compatibility with targets that use a single-nvmem scheme.

The new PBS triggering scheme also expects a change in the way the high
and low indices pertaining to the pattern are specified.

Change-Id: I7d07dc611f98ce32cf5e8ba7de758fbbc3513f4b
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
2022-06-06 15:33:07 -07:00
Guru Das Srinagesh
58e0aa7ea2 pwm: qti-lpg: Support two-nvmem PPG scheme
On PMICs such as PM8350C, the lookup table containing the pattern data
is stored in a separate nvmem device from the one where the per-channel
data is stored.

Add two separate nvmems to handle this case while maintaining backward
compatibility for those targets that use only a single nvmem device.
Differentiate between the two schemes via an enum.

Change-Id: I2826a9acc8cee4d83b6cf2bf2d4d60b1ec3b67d7
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
2022-06-06 15:33:07 -07:00
Guru Das Srinagesh
8a4b0f1cf4 pwm: qti-lpg: Fix erroneous clearing of LUT
The memory allocated for the lookup table (LUT) is getting cleared even
when a valid nvmem and PBS configuration is detected. Fix this by
ensuring that this happens only when neither a LUT peripheral's address
nor a valid nvmem configuration is detected.

Fixes: 218908e84878 ("pwm: pwm-qti-lpg: Refactor qpnp_lpg_parse_dt() for
readability").

Change-Id: I59467d46779e0a01bf0843863680ec2a8f85f2ce
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
2022-06-06 15:33:07 -07:00
Guru Das Srinagesh
55ade49b28 pwm: pwm-qti-lpg: Refactor qpnp_lpg_parse_dt() for readability
Add helper functions to parse pattern-related properties and related
init logic, and clarify the qpnp_lpg_parse_dt function to make the code
flow clear in the cases wherein either SDAM or LUT, or neither of the
two is specified. Also add of_node_put() statements for the PBS node in
error paths.

Change-Id: I8055c61db9a8283e6c4d9dacf57012ff1d9227dd
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
2022-06-06 15:33:07 -07:00
Guru Das Srinagesh
587f346193 pwm: pwm-qti-lpg: Handle nvmem device lookup failure properly
Due to commit 95b65195d5 ("nvmem: core: Always reference the device
returned by nvmem_device_get()") failures in nvmem device lookup return
-EPROBE_DEFER instead of NULL. This causes probe failure of the
pwm-qti-lpg driver when pwm devices are defined in the device tree
without nvmem nodes, which is undesirable.

Fix this by attempting to get the nvmem device only if it is present.

Change-Id: Ifa136bb9b78e4b9e0894854768e9a6cc060d5261
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
2022-06-06 15:33:07 -07:00
Guru Das Srinagesh
64f051b078 pwm: Add snapshot of QTI PWM LPG driver
The QTI PWM LPG driver supports the configuration of PWM/LPG channels on
QTI PMICs.

This is a snapshot of the driver taken from msm-4.19 as of commit
cf2cbb63fb60 ("Merge "input: touchscreen: synaptics_tcm: enable touch
driver"") with the following modifications:
  - Remove config_extend callback and pwm_get_period_extend()
  - Remove struct output_pattern and all its references
  - Remove enable, disable and config pwm_ops callbacks and instead use
    only apply()
  - Remove output_type callbacks
  - Remove support for dbg_show callback

Change-Id: I28571a8c6d5b0d5ac0cad113e77f3b5de8bf97c4
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
[quic_collinsd@quicinc.com: fixed "sychronization" typo]
Signed-off-by: David Collins <quic_collinsd@quicinc.com>
2022-06-06 15:31:37 -07:00
Subbaraman Narayanamurthy
296495669f leds-qti-tri-led: Switch to use qpnp_lpg_pwm_{set_output_type,get_output_types_supported}
'Commit 106a4b85e0
("BACKPORT: FROMLIST: pwm: Add support for different PWM output types")'
cannot be carried forward. To support breath functionality make use of
the following APIs.

- qpnp_lpg_pwm_set_output_type
- qpnp_lpg_pwm_get_output_types_supported

This is needed to switch PWM output type to PWM (fixed) or LPG/PPG
(modulated).

Change-Id: I7e82f5d102b382c2a059e7b11a907c1d0c654b26
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-06-06 15:01:47 -07:00
Subbaraman Narayanamurthy
12e992f5a6 leds: leds-qti-tri-led: Don't print error log for -EPROBE_DEFER
Currently, an error log is printed every time when parsing a DT
property fails because of probe deferral. Fix it.

Change-Id: I5d7781baa1fdfaf1abaccb3b0bfbee3f14eeea24
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-06-06 15:01:09 -07:00
Guru Das Srinagesh
b9ce15e6f7 leds: Add snapshot of QTI Tri-LED driver
The QTI Tri-LED driver enables the configuration of the output of LED
channels in the TRI_LED and HR_LED peripherals found in QTI PMICs.

This is a snapshot of the driver taken from msm-4.19 as of commit
cf2cbb63fb60 ("Merge "input: touchscreen: synaptics_tcm: enable touch
driver"") with the following modifications:
  - Remove the setting of struct pwm_output_pattern to NULL in
    __tri_led_config_pwm()
  - Remove LED_KEEP_TRIGGER from qpnp_tri_led_register()
  - Add a MODULE_SOFTDEP link to the QTI PWM LPG driver so that modprobe
    can enforce the functional dependency on it.

Change-Id: I7ceb2ff1a9ed1fec09651744ec2e7b2ba73f1bae
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
2022-06-06 14:37:48 -07:00
Shashank Babu Chinta Venkata
31960cf250 soc: qcom: panel_event_notifier: add panel_event_notifier driver
Add a notification frameowrk to notify all clients
interested in getting various display panel events
like power on, power off, FPS change, etc. Clients
can use these notifications for power saving or
align its operations with display panel power state.

Change-Id: Ic4ed7f3207111824a5da84ed2a5a2e0e50e925f0
Signed-off-by: Shashank Babu Chinta Venkata <sbchin@codeaurora.org>
2022-06-06 11:31:37 -07:00
Chris Goldsworthy
dc19de7dfb kernel: Add a snapshot of the msm_sysstats driver from msm-5.15
Add a snapshot of the msm_sysstats driver from msm-5.15 as of commit
9f8fd408d270 ("Merge "msm: adsprpc: Enable fastrpc driver in TVM"").

Change-Id: I5a065acee6f75cb3ec887d675837f8a729dadce2
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2022-06-06 10:13:28 -07:00