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>
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>
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>
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>
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>
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>
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>
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>
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>
'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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
'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>
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>
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>
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>
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>
This reverts commit dbd0339fd7df91a34c1736a20599d74612e74553.
Will change to SMEM approach, so revert this change.
Change-Id: Ia2a4d5489631ff458d3d5854aa74909c7724bcdc
Signed-off-by: Huang Yiwei <hyiwei@codeaurora.org>
Signed-off-by: Prasad Sodagudi <quic_psodagud@quicinc.com>
With latest community guideliens replace the existing /* fall through */
comments and its variants with the new pseudo-keyword macro fallthrough[1].
In this driver /* fall through */ comments are not there, So add
fallthrough to avoid compilation errors.
[1] - https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Change-Id: I3ba35159f7d2f0a261391ef06f274d85bad47497
Signed-off-by: Prasad Sodagudi <quic_psodagud@quicinc.com>
* refs/heads/tmp-05713a3:
ANDROID: Creating boot.img for x86_64 GKI
Linux 5.18
afs: Fix afs_getattr() to refetch file status if callback break occurred
perf session: Fix Intel LBR callstack entries and nr print message
perf test bpf: Skip test if clang is not present
perf test session topology: Fix test to skip the test in guest environment
perf bench numa: Address compiler error on s390
perf test: Avoid shell test description infinite loop
perf regs x86: Fix arch__intr_reg_mask() for the hybrid platform
perf test: Fix "all PMU test" to skip hv_24x7/hv_gpci tests on powerpc
drivers: i2c: thunderx: Allow driver to work with ACPI defined TWSI controllers
i2c: ismt: Provide a DMA buffer for Interrupt Cause Logging
i2c: mt7621: fix missing clk_disable_unprepare() on error in mtk_i2c_probe()
perf: Fix sys_perf_event_open() race against self
KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID
KVM: x86: hyper-v: fix type of valid_bank_mask
KVM: Free new dirty bitmap if creating a new memslot fails
gpio: mvebu/pwm: Refuse requests with inverted polarity
gpio: gpio-vf610: do not touch other bits when set the target bit
perf stat: Fix and validate CPU map inputs in synthetic PERF_RECORD_STAT events
KVM: eventfd: Fix false positive RCU usage warning
perf build: Fix check for btf__load_from_kernel_by_id() in libbpf
selftests: kvm/x86: Verify the pmu event filter matches the correct event
selftests: kvm/x86: Add the helper function create_pmu_event_filter
kvm: x86/pmu: Fix the compare function used by the pmu event filter
scsi: ufs: core: Fix referencing invalid rsp field
riscv: dts: microchip: fix gpio1 reg property typo
riscv: dts: sifive: fu540-c000: align dma node name with dtschema
mmc: core: Fix busy polling for MMC_SEND_OP_COND again
drm/i915: Use i915_gem_object_ggtt_pin_ww for reloc_iomap
net: bridge: Clear offload_fwd_mark when passing frame up bridge interface.
ptp: ocp: change sysfs attr group handling
selftests: forwarding: fix missing backslash
Input: ili210x - use one common reset implementation
Input: ili210x - fix reset timing
drm/amd: Don't reset dGPUs if the system is going to s2idle
libceph: fix misleading ceph_osdc_cancel_request() comment
libceph: fix potential use-after-free on linger ping and resends
Fix double fget() in vhost_net_set_backend()
vdpa/mlx5: Use consistent RQT size
netfilter: nf_tables: disable expression reduction infra
netfilter: flowtable: move dst_check to packet path
netfilter: flowtable: fix TCP flow teardown
net: ftgmac100: Disable hardware checksum on AST2600
igb: skip phy status check where unavailable
nfc: pn533: Fix buggy cleanup order
mptcp: Do TCP fallback on early DSS checksum failure
mptcp: fix checksum byte order
ARM: 9197/1: spectre-bhb: fix loop8 sequence for Thumb2
ARM: 9196/1: spectre-bhb: enable for Cortex-A15
net: af_key: check encryption module availability consistency
net: af_key: add check for pfkey_broadcast in function pfkey_process
percpu_ref_init(): clean ->percpu_count_ref on failure
net/mlx5: Drain fw_reset when removing device
net/mlx5e: CT: Fix setting flow_source for smfs ct tuples
net/mlx5e: CT: Fix support for GRE tuples
net/mlx5e: Remove HW-GRO from reported features
net/mlx5e: Properly block HW GRO when XDP is enabled
net/mlx5e: Properly block LRO when XDP is enabled
net/mlx5e: Block rx-gro-hw feature in switchdev mode
net/mlx5e: Wrap mlx5e_trap_napi_poll into rcu_read_lock
net/mlx5: DR, Ignore modify TTL on RX if device doesn't support it
net/mlx5: Initialize flow steering during driver probe
net/mlx5: DR, Fix missing flow_source when creating multi-destination FW table
scsi: target: Fix incorrect use of cpumask_t
NFC: nci: fix sleep in atomic context bugs caused by nci_skb_alloc
net/qla3xxx: Fix a test in ql_reset_work()
selinux: fix bad cleanup on error in hashtab_duplicate()
drm/dp/mst: fix a possible memory leak in fetch_monitor_name()
parisc: Fix patch code locking and flushing
parisc: Rewrite cache flush code for PA8800/PA8900
parisc: Disable debug code regarding cache flushes in handle_nadtlb_fault()
clk: at91: generated: consider range when calculating best rate
audit,io_uring,io-wq: call __audit_uring_exit for dummy contexts
io_uring: don't attempt to IOPOLL for MSG_RING requests
ice: Fix interrupt moderation settings getting cleared
ice: fix possible under reporting of ethtool Tx and Rx statistics
ice: fix crash when writing timestamp on RX rings
arm64: mte: Ensure the cleared tags are visible before setting the PTE
arm64: kexec: load from kimage prior to clobbering
arm64: paravirt: Use RCU read locks to guard stolen_time
dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace
net: vmxnet3: fix possible NULL pointer dereference in vmxnet3_rq_cleanup()
net: vmxnet3: fix possible use-after-free bugs in vmxnet3_rq_alloc_rx_buf()
xfrm: set dst dev to blackhole_netdev instead of loopback_dev in ifdown
net: systemport: Fix an error handling path in bcm_sysport_probe()
net: lan966x: Fix assignment of the MAC address
Revert "clk: sunxi-ng: sun6i-rtc: Add support for H6"
clk: bcm2835: fix bcm2835_clock_choose_div
ptp: ocp: have adjtime handle negative delta_ns correctly
netfilter: nft_flow_offload: fix offload with pppoe + vlan
net: fix dev_fill_forward_path with pppoe + bridge
netfilter: nft_flow_offload: skip dst neigh lookup for ppp devices
netfilter: flowtable: fix excessive hw offload attempts after failure
net/sched: act_pedit: sanitize shift argument before usage
ALSA: usb-audio: Restore Rane SL-1 quirk
ALSA: hda/realtek: fix right sounds and mute/micmute LEDs for HP machine
xfrm: fix "disable_policy" flag use when arriving from different devices
i915/guc/reset: Make __guc_reset_context aware of guilty engines
drm/i915/dmc: Add MMIO range restrictions
KVM: arm64: Don't hypercall before EL2 init
KVM: arm64: vgic-v3: Consistently populate ID_AA64PFR0_EL1.GIC
can: m_can: remove support for custom bit timing, take #2
Revert "can: m_can: pci: use custom bit timings for Elkhart Lake"
net: macb: Increment rx bd head after allocating skb and buffer
selftests: mptcp: add subflow limits test-cases
mptcp: fix subflow accounting on close
pinctrl: sunxi: f1c100s: Fix signal name comment for PA2 SPI pin
pinctrl: sunxi: fix f1c100s uart2 function
block/mq-deadline: Set the fifo_time member also if inserting at head
dma-buf: ensure unique directory name for dmabuf stats
Revert "tcp/dccp: get rid of inet_twsk_purge()"
net: ipa: get rid of a duplicate initialization
net: ipa: record proper RX transaction count
net: ipa: certain dropped packets aren't accounted for
crypto: qcom-rng - fix infinite loop on requests not multiple of WORD_SZ
ALSA: hda/realtek: Add quirk for TongFang devices with pop noise
KVM: x86/mmu: Update number of zapped pages even if page list is stable
io_uring: fix ordering of args in io_uring_queue_async_work
ALSA: hda/realtek: Add quirk for the Framework Laptop
ALSA: wavefront: Proper check of get_user() error
ALSA: hda/realtek: Add quirk for Dell Latitude 7520
ALSA: hda - fix unused Realtek function when PM is not enabled
ALSA: usb-audio: Don't get sample rate for MCT Trigger 5 USB-to-HDMI
pinctrl: mediatek: mt8365: fix IES control pins
pinctrl: ocelot: Fix for lan966x alt mode
MAINTAINERS: omap: remove me as a maintainer
dt-bindings: input: mediatek,mt6779-keypad: update maintainer
ARM: dts: aspeed: Add video engine to g6
ARM: dts: aspeed: romed8hm3: Fix GPIOB0 name
ARM: dts: aspeed: romed8hm3: Add lm25066 sense resistor values
ARM: dts: aspeed-g6: fix SPI1/SPI2 quad pin group
ARM: dts: aspeed-g6: add FWQSPI group in pinctrl dtsi
dt-bindings: pinctrl: aspeed-g6: add FWQSPI function/group
pinctrl: pinctrl-aspeed-g6: add FWQSPI function-group
dt-bindings: pinctrl: aspeed-g6: remove FWQSPID group
pinctrl: pinctrl-aspeed-g6: remove FWQSPID group in pinctrl
ARM: dts: aspeed-g6: remove FWQSPID group in pinctrl dtsi
arm64: dts: qcom: sm8250: don't enable rx/tx macro by default
arm64: dts: rockchip: Add gmac1 and change network settings of bpi-r2-pro
arm64: dts: rockchip: Change io-domains of bpi-r2-pro
Conflicts:
Documentation/devicetree/bindings
Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml
Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml
Upstream-Build:ks_qcom-android-mainline-keystone-qcom-release@8672405 SKQ4.220601.002
Change-Id: Id10170c7c63104e42071470f906a8d22e4c312ef
Signed-off-by: jianzhou <quic_jianzhou@quicinc.com>