Commit Graph

1094871 Commits

Author SHA1 Message Date
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
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
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
qctecmdr
4a001b7ca3 Merge "soc: qcom: pmic-pon-log: add support for multiple NVMEM devices" 2022-06-05 23:08:56 -07:00
qctecmdr
06e0b49baa Merge "soc: qcom: Add QTI PBS driver" 2022-06-04 12:34:23 -07:00
qctecmdr
5a682e3d5e Merge "arm64: defconfig: Enable socinfo and smem drivers for pineapple SoC" 2022-06-04 12:34:22 -07:00
qctecmdr
c538cd76d3 Merge "soc: qcom: Add fallthrough macro for notifying intentional fall through" 2022-06-04 09:38:56 -07:00
qctecmdr
0a2dfab4a7 Merge "iio: qcom-spmi-adc5: add support to read current channels" 2022-06-04 09:38:55 -07:00
qctecmdr
0027140a17 Merge "Merge keystone/android-mainline-keystone-qcom-release.5.18.0 (05713a3) into msm-pineapple" 2022-06-03 16:10:31 -07:00
Prasad Sodagudi
fe41da5cbe arm64: defconfig: Enable socinfo and smem drivers for pineapple SoC
Enable socinfo and smem drivers for pineappe SoC.

Change-Id: I4b28cafa6f9a6e7f6eca325d69e4d0959cbe07c8
Signed-off-by: Prasad Sodagudi <quic_psodagud@quicinc.com>
2022-06-03 15:51:38 -07:00
Huang Yiwei
f32a0cd31e Revert "soc: qcom: socinfo: Add soc_sku name support"
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>
2022-06-03 15:51:37 -07:00
Prasad Sodagudi
a2a56b8cff soc: qcom: Add fallthrough macro for notifying intentional fall through
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>
2022-06-03 15:50:22 -07:00
qctecmdr
c44a67c2ce Merge "mailbox: Add snapshot of MSM QMP driver" 2022-06-03 12:55:07 -07:00
qctecmdr
e9b68da559 Merge "modules.list.msm.pineapple: Add dispcc module" 2022-06-03 12:55:05 -07:00
jianzhou
ad3bc4f6f6 Merge keystone/android-mainline-keystone-qcom-release.5.18.0 (05713a3) into msm-pineapple
* 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>
2022-06-03 05:31:07 -07:00
Maulik Shah
12a001def6 soc: qcom: Add cpuss sleep stats driver snapshot
This is a snapshot taken of cpuss sleep stats driver from msm-5.10
'commit <38857e954dd5> ("icnss2: Support wlan PON/POFF Sequence via
PMIC")'.

Updates:
	- Use strscpy inplace of strlcpy

Change-Id: I8d2e050dd0a690168dc4a79e7d23f770072713c6
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-06-02 11:12:32 -07:00
qctecmdr
d8f988289f Merge "pinctrl: qcom: spmi-gpio: add support for LV_VIN2 and MV_VIN3 subtypes" 2022-06-02 03:13:23 -07:00
qctecmdr
d2ce2b675b Merge "regulator: rpmh-regulator: fix rpmh_regulator_init_vreg_supply memory leak" 2022-06-01 23:49:50 -07:00
Subbaraman Narayanamurthy
89afc38fb2 iio: adc: qcom-spmi-adc5-gen3: Update ratios for SMB_* channels for ADC7
As per the hardware recommendation, add a ratio of 41/40 (i.e.
numerator 40 and denominator 41 based on how it's used in our
calculations) for the ADC channels that use SMB_TEMP pin because
of the voltage divider circuit with a 1 K and 40 K in parallel.

Change-Id: Id2d23c040fc3b38a826212b10152b6644918c96d
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
2022-06-01 17:34:35 -07:00
Anjelique Melendez
88d5476b30 dt-bindings: iio: Add the ADC5 GEN3 Channel info for SMB139x
Add the ADC5 GEN3 channels used by SMB139x.

Change-Id: Ibdf37c90397ae10a87f7607ebb1ddc2445d698c7
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-01 17:34:35 -07:00
Anjelique Melendez
c9265a0486 iio: qcom-spmi-adc5-gen3: Update scaling index of ICHG_FB channel
Update scaling index of ICHG_FB channel used in ADC5 GEN3.

Change-Id: Iaa17e7c7a44288091818d28d6e0286d46f0eea6d
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
[quic_collinsd@quicinc.com: changed prescale "num" and "den"
 to "numerator" and "denominator" respectively]
Signed-off-by: David Collins <quic_collinsd@quicinc.com>
2022-06-01 17:34:35 -07:00
Anjelique Melendez
da7e8fbcc1 dt-bindings: iio: add ICHG_FB channel on PM8550B
Add ICHG_FB channel on PM8550B.

Change-Id: If8d229673442745d4fffd7b31120ef1ed9f9b1b3
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-01 17:34:35 -07:00
Anjelique Melendez
23dbb35078 iio: adc: qcom-spmi-adc5-gen3: Fix __tm_handler_work() loop conditions
Currently __tm_handler_work() assumes that each element in chan_props[]
represents 1 SDAM register. However, chan_props[] has an element for every
ADC and ADC TM channel. Since every ADC channel shares the same SDAM
register the loop within __tm_handler_work() has incorrect conditions. Fix
this.

While at it, remove __tm_handler_work() which was invoked for every SDAM
as tm_handler_work() goes through all channels.

Change-Id: I5f3444ab831ff2067a1a53f49dea0c5dbbdc8758
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-01 17:34:35 -07:00
Subbaraman Narayanamurthy
d43304f631 iio: adc: qcom-spmi-adc5-gen3: Add TEMP_ALARM_LITE to adc5_chans_pmic[]
Add TEMP_ALARM_LITE channel mapping so that the proper scaling
function can be used with ADC code obtained after the conversion.

Change-Id: I4ad0564ba4e4bd3d8409e3923d4b0ad5f0395503
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
2022-06-01 17:34:35 -07:00
Subbaraman Narayanamurthy
b7b22a2a30 dt-bindings: iio: qcom,spmi-vadc: add ADC5_GEN3_TEMP_ALARM_LITE channel
Add ADC5_GEN3_TEMP_ALARM_LITE channel id that can be read from
PM8550B PMIC. Also, update ADC5_GEN3_ICHG_SMB channel that
was using the same channel id before.

Change-Id: Ic8d69fc651abe73ab11a8086876d2d2dea686542
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
2022-06-01 17:34:35 -07:00
Anjelique Melendez
bb50d6564d iio: adc: qcom-spmi-adc5-gen3: Fix order of adc5_gen3_probe()
Currently adc5_gen3_probe() registers thermal zone devices and then
registers interrupt handlers. While registering the thermal zones the
ADC5 GEN3 TM get/set callbacks are called by thermal framework that relies
on interrupt completion. Since interrupts have not been registered the
callbacks will time out. Fix this and add error handling for thermal zone
registration.

Change-Id: I3ad94211f7831c94b0847fda549295ecfebcb90b
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-01 17:34:35 -07:00
Anjelique Melendez
2d1c9eacee iio: adc: qcom-spmi-adc5-gen3: Fix SID config when reading ADC channel
Currently, when reading an ADC channel the SID is always configured to 0.
This is causing incorrect readings for ADC and ADC TM channels. Fix this.

Change-Id: If6332c6ec83f04ce4294df27e5bdb784cc5d23be
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-01 17:34:35 -07:00
Subbaraman Narayanamurthy
7ad32f5546 iio: adc: qcom-spmi-adc5-gen3: Remove adc5_prescaling_from_dt()
adc5_prescaling_from_dt() is not needed as that is replaced with
qcom_adc5_prescaling_from_dt() in qcom-vadc-common.c. Since
adc5_prescale_ratios[] is also used from qcom-vadc-common.c and
not needed in qcom-spmi-adc5-gen3.c, remove it.

With the above change, adc5_chans_pmic[] needs to be updated with
the right indices. Update it.

Change-Id: Ibeb8ef6d9436ae448aadc9a99e5d0ef69767ac47
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
[quic_collinsd@quicinc.com: fixed minor merge conflict]
Signed-off-by: David Collins <quic_collinsd@quicinc.com>
2022-06-01 17:34:30 -07:00
Subbaraman Narayanamurthy
48efaf8e96 iio: adc: qcom-spmi-adc5-gen3: Fix some indentation
Fix the indentation to keep it uniform and readable.

Change-Id: I73da8941c72857a9f63dca3e8085873413b3a1f2
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
2022-06-01 17:33:43 -07:00
Anjelique Melendez
0801e19f08 dt-bindings: iio: Correct PM8550B ADC channel names
Typo found in two of PM8550B ADC channel names. Fix them.

Change-Id: I3e69402f3837cb6e29d84ea1ddb789801c72ec2f
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-01 17:33:43 -07:00
Anjelique Melendez
4a630f55ec iio: adc: qcom-spmi-adc5-gen3: Fix calls to qcom_adc5_hw_scale()
Currently, calls to qcom_adc5_hw_scale() are passing in a prescale pointer.
The qcom_adc5_hw_scale() function signature asks for the prescale int and
interanally will get the prescale pointer. Fix this.

Change-Id: I4cf630cf47f0b69678b69aecd5058e510bde6b3c
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-01 17:33:42 -07:00
Anjelique Melendez
1d56dd15cb iio: adc: qcom-spmi-adc5-gen3: Fix interrupt handler returns
Currently, the adc5 gen3 interrupt handler always returns IRQ_HANDLED.
Fix the handler so that on errors IRQ_NONE is returned.

Change-Id: I2ccebb985c81ad9de57b829b469ec8e58437f9e9
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-01 17:33:42 -07:00
Anjelique Melendez
f394355bf8 dt-bindings: iio: Add ADC5 GEN3 Channel info for Kalama PMICs
Add the ADC5 GEN3 channels used by PMK8550, PM8550 and PM8550B.

Change-Id: I0a52446634dfa2108e1b3f2c0e990610138340b9
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-01 17:33:42 -07:00
Anjelique Melendez
94067cd605 iio: adc: qcom-spmi-adc5-gen3: Add support for multiple SDAMs
Currently, ADC5 GEN3 driver allows up to 8 channels. In Kalama up to 16
channels can be configured over 2 SDAMS. Update member variables,
interrupt handling and read and write functions so that driver can handle
2 or more SDAMS.

Change-Id: I2d65d9a420092db98cdbf27bba5188700c46fd0a
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-01 17:33:42 -07:00
Anjelique Melendez
ef18fb11e3 iio: adc: qcom-spmi-adc5-gen3: Update max channels
Currently, ADC5 GEN3 driver allows up to 8 channels. In Kalama up to 16
channels can be configured over 2 SDAMs. Dynamically set max_channels
based on number of registers(SDAMs) specified.

Change-Id: I789b142306dfb0099d955f9e166c17b331a47517
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-01 17:33:42 -07:00
Anjelique Melendez
0d427cfc41 iio: adc: qcom-spmi-adc5-gen3: Add support for qcom,debug-base
Currently, the debug base address is defined under the reg property. This
would be confusing if multiple addresses are specified under reg property
to support more ADC channels. Separate debug base into its own property.

Change-Id: Id96621bafd85bde0e601a89849aef7f094f53bf9
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-06-01 17:33:42 -07:00
Subbaraman Narayanamurthy
22fcbb9e51 iio: adc: qcom-spmi-adc5-gen3: Fix driver name
Fix the typo for driver name.

Change-Id: Ie65784e7c2920b7bdb61213524bbddb462d271be
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
2022-06-01 17:33:39 -07:00
Jishnu Prakash
3a2a5ea5ee iio: qcom-spmi-adc5-gen3 : add support to clear conversion fault
When an ADC conversion results in a conversion fault, the
conversion fault bit in the status register is set, but never
cleared, by PBS, causing an error print for conversion fault
to appear for all future conversions. Update interrupt handler
to clear conversion fault bit if it is found set.

Change-Id: I83b36ce585ab5d20639dbf5050f91e8850cc2b75
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
2022-06-01 17:30:42 -07:00
Jishnu Prakash
7722611a92 iio: qcom-spmi-adc5: Add support for SW calibrated ADC
Add support for reading ADC channels on a PMIC7 ADC directly from
the ADC_PBS peripheral on that PMIC instead of through PMK8350
ADC peripheral using PBS, for targets where PMK8350 does not run in
master mode.

The conversion request sequence for using ADC_PBS is similar to
the existing one for ADC7, with some differences in register
writes. In addition, SW now performs calibration in place of PBS,
for every conversion, by reading the three calibration channels,
calculating the reference values and entering them in the
calibration registers.

Change-Id: I9e47ed69e75ee2580a37195ea9063f24ffb8aac5
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
[quic_subbaram@quicinc.com: Fixed merge conflicts and modified
 to compile with upstream driver version.]
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
2022-06-01 17:30:42 -07:00