69f799168c
GKI (arm64) relevant 137 out of 624 changes, affecting 192 files +1647/-1035a4f865ecdbnvmem: core: fix bit offsets of more than one byte [1 file, +17/-7]4327479e55nvmem: core: verify cell's raw_len [1 file, +12/-0]410f8b72e0nvmem: core: update raw_len if the bit reading is required [1 file, +3/-1]7aea1517fbscsi: ufs: Introduce quirk to extend PA_HIBERN8TIME for UFS devices [2 files, +35/-0]b730cb1096virtio_ring: Fix data race by tagging event_triggered as racy for KCSAN [1 file, +1/-1]2998813177dma/mapping.c: dev_dbg support for dma_addressing_limited [1 file, +10/-1]3eec42a17adma-mapping: avoid potential unused data compilation warning [1 file, +8/-4]97edaa0ec6cgroup: Fix compilation issue due to cgroup_mutex not being exported [1 file, +1/-1]f93675793bvhost_task: fix vhost_task_create() documentation [1 file, +1/-1]e22034cbeedma-mapping: Fix warning reported for missing prototype [1 file, +8/-8]4f5553a08ffs/buffer: split locking for pagecache lookups [1 file, +25/-16]e138fc2316fs/buffer: introduce sleeping flavors for pagecache lookups [2 files, +17/-0]a49a4a87cefs/buffer: use sleeping version of __find_get_block() [1 file, +9/-2]f1c5aa614bfs/jbd2: use sleeping version of __find_get_block() [1 file, +9/-6]9ece099e95fs/ext4: use sleeping version of sb_find_get_block() [1 file, +2/-1]64f505b08eblock: fix race between set_blocksize and read paths [4 files, +43/-1]218c838d03io_uring: don't duplicate flushing in io_req_post_cqe [1 file, +8/-3]8014d3e56ebpf: fix possible endless loop in BPF map iteration [1 file, +1/-1]d40ca27602fuse: Return EPERM rather than ENOSYS from link() [1 file, +2/-0]bab0bd1389exfat: call bh_read in get_block only when necessary [1 file, +77/-82]01677e7ee1io_uring/msg: initialise msg request opcode [1 file, +1/-0]e506751b7darm64: Add support for HIP09 Spectre-BHB mitigation [2 files, +3/-0]4f427ca9edtracing: Mark binary printing functions with __printf() attribute [4 files, +18/-21]15787ab82amailbox: use error ret code of of_parse_phandle_with_args() [1 file, +4/-3]f48ee562c0Bluetooth: Disable SCO support if READ_VOICE_SETTING is unsupported/broken [1 file, +3/-0]44b79041c4dql: Fix dql->limit value when reset. [1 file, +1/-1]ac30595154lockdep: Fix wait context check on softirq for PREEMPT_RT [1 file, +18/-0]e63b634806PCI: dwc: ep: Ensure proper iteration over outbound map windows [1 file, +1/-1]37ac2434aaext4: on a remount, only log the ro or r/w state when it has changed [1 file, +4/-3]1d1e1efad1libnvdimm/labels: Fix divide error in nd_label_data_init() [1 file, +2/-1]123bcd8f42pidfs: improve multi-threaded exec and premature thread-group leader exit polling [3 files, +9/-9]8f82cf305ecgroup/rstat: avoid disabling irqs for O(num_cpu) [1 file, +5/-7]a5a507fa5fblk-cgroup: improve policy registration error handling [1 file, +12/-10]94c3cbc69aext4: reorder capability check last [1 file, +2/-2]e658f2d94abpf: Return prog btf_id without capable check [1 file, +2/-2]e2520cc19bPCI: dwc: Use resource start as ioremap() input in dw_pcie_pme_turn_off() [1 file, +1/-1]50452704ecjbd2: do not try to recover wiped journal [1 file, +6/-5]dab35f4921tcp: reorganize tcp_in_ack_event() and tcp_count_delivered() [1 file, +32/-24]555c0b713cbpf: Allow pre-ordering for bpf cgroup progs [5 files, +30/-9]572ed3fb99kconfig: do not clear SYMBOL_VALID when reading include/config/auto.conf [1 file, +12/-7]174dedce64dm: restrict dm device size to 2^63-512 bytes [1 file, +4/-0]2f5f326214ext4: reject the 'data_err=abort' option in nojournal mode [1 file, +12/-0]d0dc233fe2posix-timers: Add cond_resched() to posix_timer_add() search loop [1 file, +1/-0]ae22452d15posix-timers: Ensure that timer initialization is fully visible [1 file, +14/-7]3fb9ee05ectimer_list: Don't use %pK through printk() [1 file, +2/-2]21153e0974netfilter: conntrack: Bound nf_conntrack sysctl writes [1 file, +9/-3]236a87e9d2PNP: Expand length of fixup id string [1 file, +1/-1]6215143ad3arm64/mm: Check pmd_table() in pmd_trans_huge() [1 file, +12/-12]8ad58a7ebaarm64/mm: Check PUD_TYPE_TABLE in pud_bad() [1 file, +2/-1]28306c58dammc: sdhci: Disable SD card clock before changing parameters [1 file, +7/-2]3a75fe58a1usb: xhci: Don't change the status of stalled TDs on failed Stop EP [1 file, +11/-1]101a3b9920printk: Check CON_SUSPEND when unblanking a console [1 file, +12/-2]faba68a86awifi: cfg80211: allow IR in 20 MHz configurations [5 files, +46/-25]c1502fc84dipv6: save dontfrag in cork [2 files, +6/-4]75ae2a3553badblocks: Fix a nonsense WARN_ON() which checks whether a u64 variable < 0 [1 file, +3/-2]7caad075accrypto: lzo - Fix compression buffer overrun [6 files, +106/-28]73d01bcbf2tcp: bring back NUMA dispersion in inet_ehash_locks_alloc() [1 file, +26/-11]1c17190880usb: xhci: set page size to the xHCI-supported size [2 files, +22/-20]93f581d763drm/gem: Test for imported GEM buffers with helper [2 files, +16/-2]c4525b513dnet: phylink: use pl->link_interface in phylink_expects_phy() [1 file, +1/-1]f29c876d72perf/core: Clean up perf_try_init_event() [1 file, +38/-27]af73c8fd73ublk: enforce ublks_max only for unprivileged devices [1 file, +27/-15]592ba27580perf/hw_breakpoint: Return EOPNOTSUPP for unsupported breakpoint type [1 file, +3/-2]3de322a98bscsi: logging: Fix scsi_logging_level bounds [1 file, +3/-1]f33b310eacipv4: fib: Move fib_valid_key_len() to rtm_to_fib_config(). [2 files, +16/-24]564f03a797block: mark bounce buffering as incompatible with integrity [2 files, +5/-2]82209faa87ublk: complete command synchronously on error [1 file, +6/-5]b98aad5e5emedia: uvcvideo: Add sanity check to uvc_ioctl_xu_ctrl_map [1 file, +6/-0]2d6231d5cemedia: uvcvideo: Handle uvc menu translation inside uvc_get_le_value [1 file, +32/-45]e359d62886perf: arm_pmuv3: Call kvm_vcpu_pmu_resync_el0() before enabling counters [1 file, +2/-2]673dde8d3cbpf: Search and add kfuncs in struct_ops prologue and epilogue [1 file, +24/-1]083383aba0cpuidle: menu: Avoid discarding useful information [1 file, +12/-1]20a53c3689loop: check in LO_FLAGS_DIRECT_IO in loop_default_blocksize [1 file, +1/-1]b55a97d1bddm: fix unconditional IO throttle caused by REQ_PREFLUSH [1 file, +6/-2]9f27b38771crypto: ahash - Set default reqsize from ahash_alg [2 files, +7/-0]897c98fb32crypto: skcipher - Zap type in crypto_alloc_sync_skcipher [1 file, +1/-0]4d9fa2ebc0net: ipv6: Init tunnel link-netns before registering dev [4 files, +9/-7]53f42776e4genirq/msi: Store the IOMMU IOVA directly in msi_desc instead of iommu_cookie [2 files, +25/-36]2b129e89b8bpf: don't do clean_live_states when state->loop_entry->branches > 0 [1 file, +4/-0]46ba5757a7bpf: copy_verifier_state() should copy 'loop_entry' field [1 file, +3/-0]82b54455b6PCI: Fix old_size lower bound in calculate_iosize() too [1 file, +2/-4]dc5f5c9d2bhrtimers: Replace hrtimer_clock_to_base_table with switch-case [1 file, +12/-17]000dd6e344ASoC: ops: Enforce platform maximum on initial value [1 file, +28/-1]c4260bf83bASoC: soc-dai: check return value at snd_soc_dai_set_tdm_slot() [1 file, +5/-3]5b1b4cb46dpinctrl: devicetree: do not goto err when probing hogs in pinctrl_dt_to_map [1 file, +8/-2]69689d1138media: v4l: Memset argument to 0 before calling get_mbus_config pad op [2 files, +5/-1]e6e31b0182sched: Reduce the default slice to avoid tasks getting an extra tick [1 file, +3/-3]ef31dc41cfphy: core: don't require set_mode() callback for phy_get_mode() to work [1 file, +4/-3]06daedb443xfrm: prevent high SEQ input in non-ESN mode [1 file, +12/-0]9f2911868aip: fib_rules: Fetch net from fib_rule in fib[46]_rule_configure(). [2 files, +4/-4]7fea5a9140r8152: add vendor/device ID pair for Dell Alienware AW1022z [2 files, +2/-0]16ddd67bb5pstore: Change kmsg_bytes storage size to u32 [3 files, +9/-8]73733c2fdbext4: don't write back data before punch hole in nojournal mode [1 file, +5/-13]1d15319323f2fs: introduce f2fs_base_attr for global sysfs entries [1 file, +52/-22]ded26f9e4cipv4: ip_gre: Fix set but not used warning in ipgre_err() if IPv4-only [1 file, +10/-6]76e56dbe50net: flush_backlog() small changes [1 file, +8/-4]58cdd1ee65bridge: mdb: Allow replace of a host-joined group [2 files, +2/-2]fcabb69674rcu: handle unstable rdp in rcu_read_unlock_strict() [2 files, +11/-2]d402437cdercu: fix header guard for rcu_all_qs() [1 file, +1/-1]887e39ac47perf: Avoid the read if the count is already updated [3 files, +24/-18]c80b2d159cbpf: Use kallsyms to find the function name of a struct_ops's stub function [1 file, +44/-54]46f1c2b508firmware: arm_scmi: Relax duplicate name constraint across protocol ids [1 file, +6/-13]1351052877drm/atomic: clarify the rules around drm_atomic_state->allow_modeset [1 file, +21/-2]9fddd1f154drm: Add valid clones check [1 file, +28/-0]ff214b079dnvme-pci: add quirks for device 126f:1001 [1 file, +3/-0]6d196cae4bnvme-pci: add quirks for WDC Blue SN550 15b7:5009 [1 file, +3/-0]6a09b6bad0ALSA: usb-audio: Fix duplicated name in MIDI substream names [1 file, +12/-4]ad3e83a6c8io_uring/fdinfo: annotate racy sq/cq head/tail reads [1 file, +2/-2]7f7c8c03febtrfs: correct the order of prelim_ref arguments in btrfs__prelim_ref [1 file, +1/-1]8cafd7266f__legitimize_mnt(): check for MNT_SYNC_UMOUNT should be under mount_lock [1 file, +1/-5]28756f22deespintcp: fix skb leaks [3 files, +9/-3]9cbca30102espintcp: remove encap socket caching to avoid reference leak [4 files, +8/-94]b1a687eb15xfrm: Fix UDP GRO handling for some corner cases [2 files, +20/-16]447c8f0c06kernel/fork: only call untrack_pfn_clear() on VMAs duplicated for fork() [1 file, +5/-4]252f78a931xfrm: Sanitize marks before insert [2 files, +6/-0]7207effe47driver core: Split devres APIs to device/devres.h [2 files, +125/-118]1e8b7e96f7Bluetooth: L2CAP: Fix not checking l2cap_chan security level [1 file, +8/-7]cd7f022296loop: don't require ->write_iter for writable files in loop_configure [1 file, +0/-3]873ebaf3c1io_uring: fix overflow resched cqe reordering [1 file, +1/-0]689a205cd9net/tipc: fix slab-use-after-free Read in tipc_aead_encrypt_done [1 file, +5/-0]adb05149a9can: slcan: allow reception of short error messages [1 file, +20/-6]cc55dd28c2can: bcm: add locking for bcm_op runtime updates [1 file, +45/-21]63567ecd99can: bcm: add missing rcu read protection for procfs content [1 file, +9/-4]bf85e49aafALSA: pcm: Fix race of buffer access at PCM OSS layer [3 files, +14/-2]e78908caf1pmdomain: core: Fix error checking in genpd_dev_pm_attach_by_id() [1 file, +1/-1]dc9bdfb9b0drm/edid: fixed the bug that hdr metadata was not reset [1 file, +1/-0]cb9a1019a6Input: xpad - add more controllers [1 file, +3/-0]9b8263cae6highmem: add folio_test_partial_kmap() [2 files, +12/-5]314bf771cbmemcg: always call cond_resched() after fn() [1 file, +2/-4]9da33ce114mm/page_alloc.c: avoid infinite retries caused by cpuset race [1 file, +8/-0]9f9517f156mm: mmap: map MAP_STACK to VM_NOHUGEPAGE only if THP is enabled [1 file, +2/-0]94efb0d656mm: vmalloc: actually use the in-place vrealloc region [1 file, +1/-0]483ac74183mm: vmalloc: only zero-init on vrealloc shrink [1 file, +7/-5]1d45e0170cspi: use container_of_cont() for to_spi_device() [1 file, +1/-4]d28b0305f7err.h: move IOMEM_ERR_PTR() to err.h [2 files, +3/-2]80eb73778dbpf: abort verification if env->cur_state->loop_entry != NULL [1 file, +4/-2]85fb1edd05drm/gem: Internally test import_attach for imported objects [1 file, +1/-2] Changes in 6.12.31 drm/amd/display: Configure DTBCLK_P with OPTC only for dcn401 drm/amd/display: Do not enable replay when vtotal update is pending. drm/amd/display: Correct timing_adjust_pending flag setting. drm/amd/display: Defer BW-optimization-blocked DRR adjustments i2c: designware: Use temporary variable for struct device i2c: designware: Fix an error handling path in i2c_dw_pci_probe() phy: renesas: rcar-gen3-usb2: Move IRQ request in probe phy: renesas: rcar-gen3-usb2: Lock around hardware registers and driver data phy: renesas: rcar-gen3-usb2: Assert PLL reset on PHY power off cpufreq: Add SM8650 to cpufreq-dt-platdev blocklist nvmem: rockchip-otp: Move read-offset into variant-data nvmem: rockchip-otp: add rk3576 variant data nvmem: core: fix bit offsets of more than one byte nvmem: core: verify cell's raw_len nvmem: core: update raw_len if the bit reading is required nvmem: qfprom: switch to 4-byte aligned reads scsi: target: iscsi: Fix timeout on deleted connection scsi: ufs: Introduce quirk to extend PA_HIBERN8TIME for UFS devices virtio_ring: Fix data race by tagging event_triggered as racy for KCSAN dma/mapping.c: dev_dbg support for dma_addressing_limited intel_th: avoid using deprecated page->mapping, index fields mei: vsc: Use struct vsc_tp_packet as vsc-tp tx_buf and rx_buf type dma-mapping: avoid potential unused data compilation warning cgroup: Fix compilation issue due to cgroup_mutex not being exported vhost_task: fix vhost_task_create() documentation vhost-scsi: protect vq->log_used with vq->mutex scsi: mpi3mr: Add level check to control event logging net: enetc: refactor bulk flipping of RX buffers to separate function dma-mapping: Fix warning reported for missing prototype ima: process_measurement() needlessly takes inode_lock() on MAY_READ fs/buffer: split locking for pagecache lookups fs/buffer: introduce sleeping flavors for pagecache lookups fs/buffer: use sleeping version of __find_get_block() fs/ocfs2: use sleeping version of __find_get_block() fs/jbd2: use sleeping version of __find_get_block() fs/ext4: use sleeping version of sb_find_get_block() drm/amd/display: Enable urgent latency adjustment on DCN35 drm/amdgpu: Allow P2P access through XGMI selftests/bpf: Mitigate sockmap_ktls disconnect_after_delete failure block: fix race between set_blocksize and read paths io_uring: don't duplicate flushing in io_req_post_cqe bpf: fix possible endless loop in BPF map iteration samples/bpf: Fix compilation failure for samples/bpf on LoongArch Fedora kconfig: merge_config: use an empty file as initfile x86/fred: Fix system hang during S4 resume with FRED enabled s390/vfio-ap: Fix no AP queue sharing allowed message written to kernel log cifs: Add fallback for SMB2 CREATE without FILE_READ_ATTRIBUTES cifs: Fix querying and creating MF symlinks over SMB1 cifs: Fix negotiate retry functionality smb: client: Store original IO parameters and prevent zero IO sizes fuse: Return EPERM rather than ENOSYS from link() exfat: call bh_read in get_block only when necessary io_uring/msg: initialise msg request opcode NFSv4: Check for delegation validity in nfs_start_delegation_return_locked() NFS: Don't allow waiting for exiting tasks SUNRPC: Don't allow waiting for exiting tasks arm64: Add support for HIP09 Spectre-BHB mitigation iommufd: Extend IOMMU_GET_HW_INFO to report PASID capability tracing: Mark binary printing functions with __printf() attribute ACPI: PNP: Add Intel OC Watchdog IDs to non-PNP device list tpm: Convert warn to dbg in tpm2_start_auth_session() mailbox: pcc: Use acpi_os_ioremap() instead of ioremap() mailbox: use error ret code of of_parse_phandle_with_args() riscv: Allow NOMMU kernels to access all of RAM fbdev: fsl-diu-fb: add missing device_remove_file() fbcon: Use correct erase colour for clearing in fbcon fbdev: core: tileblit: Implement missing margin clearing for tileblit cifs: Set default Netbios RFC1001 server name to hostname in UNC cifs: add validation check for the fields in smb_aces cifs: Fix establishing NetBIOS session for SMB2+ connection NFSv4: Treat ENETUNREACH errors as fatal for state recovery SUNRPC: rpc_clnt_set_transport() must not change the autobind setting SUNRPC: rpcbind should never reset the port to the value '0' spi-rockchip: Fix register out of bounds access ASoC: codecs: wsa884x: Correct VI sense channel mask ASoC: codecs: wsa883x: Correct VI sense channel mask mctp: Fix incorrect tx flow invalidation condition in mctp-i2c net: tn40xx: add pci-id of the aqr105-based Tehuti TN4010 cards net: tn40xx: create swnode for mdio and aqr105 phy and add to mdiobus thermal/drivers/mediatek/lvts: Start sensor interrupts disabled thermal/drivers/qoriq: Power down TMU on system suspend Bluetooth: btmtksdio: Prevent enabling interrupts after IRQ handler removal Bluetooth: Disable SCO support if READ_VOICE_SETTING is unsupported/broken dql: Fix dql->limit value when reset. lockdep: Fix wait context check on softirq for PREEMPT_RT objtool: Properly disable uaccess validation PCI: dwc: ep: Ensure proper iteration over outbound map windows r8169: disable RTL8126 ZRX-DC timeout tools/build: Don't pass test log files to linker pNFS/flexfiles: Report ENETDOWN as a connection error drm/amdgpu/discovery: check ip_discovery fw file available drm/amdkfd: set precise mem ops caps to disabled for gfx 11 and 12 PCI: vmd: Disable MSI remapping bypass under Xen xen/pci: Do not register devices with segments >= 0x10000 ext4: on a remount, only log the ro or r/w state when it has changed libnvdimm/labels: Fix divide error in nd_label_data_init() pidfs: improve multi-threaded exec and premature thread-group leader exit polling staging: vchiq_arm: Create keep-alive thread during probe mmc: host: Wait for Vdd to settle on card power off drm/amdgpu: Skip pcie_replay_count sysfs creation for VF cgroup/rstat: avoid disabling irqs for O(num_cpu) wifi: mt76: only mark tx-status-failed frames as ACKed on mt76x0/2 wifi: mt76: mt7996: fix SER reset trigger on WED reset wifi: mt76: mt7996: revise TXS size wifi: mt76: mt7925: load the appropriate CLC data based on hardware type wifi: mt76: mt7925: fix fails to enter low power mode in suspend state x86/headers: Replace __ASSEMBLY__ with __ASSEMBLER__ in UAPI headers x86/stackprotector/64: Only export __ref_stack_chk_guard on CONFIG_SMP x86/smpboot: Fix INIT delay assignment for extended Intel Families x86/microcode: Update the Intel processor flag scan check x86/mm: Check return value from memblock_phys_alloc_range() i2c: qup: Vote for interconnect bandwidth to DRAM i2c: pxa: fix call balance of i2c->clk handling routines btrfs: make btrfs_discard_workfn() block_group ref explicit btrfs: avoid linker error in btrfs_find_create_tree_block() btrfs: run btrfs_error_commit_super() early btrfs: fix non-empty delayed iputs list on unmount due to async workers btrfs: get zone unusable bytes while holding lock at btrfs_reclaim_bgs_work() btrfs: send: return -ENAMETOOLONG when attempting a path that is too long blk-cgroup: improve policy registration error handling drm/amdgpu: release xcp_mgr on exit drm/amd/display: Guard against setting dispclk low for dcn31x drm/amdgpu: adjust drm_firmware_drivers_only() handling i3c: master: svc: Fix missing STOP for master request s390/tlb: Use mm_has_pgste() instead of mm_alloc_pgste() dlm: make tcp still work in multi-link env clocksource/drivers/timer-riscv: Stop stimecmp when cpu hotplug um: Store full CSGSFS and SS register from mcontext um: Update min_low_pfn to match changes in uml_reserved wifi: mwifiex: Fix HT40 bandwidth issue. bnxt_en: Query FW parameters when the CAPS_CHANGE bit is set riscv: Call secondary mmu notifier when flushing the tlb ext4: reorder capability check last hypfs_create_cpu_files(): add missing check for hypfs_mkdir() failure scsi: st: Tighten the page format heuristics with MODE SELECT scsi: st: ERASE does not change tape location vfio/pci: Handle INTx IRQ_NOTCONNECTED bpf: Return prog btf_id without capable check PCI: dwc: Use resource start as ioremap() input in dw_pcie_pme_turn_off() jbd2: do not try to recover wiped journal tcp: reorganize tcp_in_ack_event() and tcp_count_delivered() rtc: rv3032: fix EERD location objtool: Fix error handling inconsistencies in check() thunderbolt: Do not add non-active NVM if NVM upgrade is disabled for retimer erofs: initialize decompression early spi: spi-mux: Fix coverity issue, unchecked return value ASoC: pcm6240: Drop bogus code handling IRQ as GPIO ASoC: mediatek: mt6359: Add stub for mt6359_accdet_enable_jack_detect bpf: Allow pre-ordering for bpf cgroup progs kbuild: fix argument parsing in scripts/config kconfig: do not clear SYMBOL_VALID when reading include/config/auto.conf crypto: octeontx2 - suppress auth failure screaming due to negative tests dm: restrict dm device size to 2^63-512 bytes net/smc: use the correct ndev to find pnetid by pnetid table xen: Add support for XenServer 6.1 platform device pinctrl-tegra: Restore SFSEL bit when freeing pins mfd: tps65219: Remove TPS65219_REG_TI_DEV_ID check drm/amdgpu/gfx12: don't read registers in mqd init drm/amdgpu/gfx11: don't read registers in mqd init drm/amdgpu: Update SRIOV video codec caps ASoC: sun4i-codec: support hp-det-gpios property clk: qcom: lpassaudiocc-sc7280: Add support for LPASS resets for QCM6490 ext4: reject the 'data_err=abort' option in nojournal mode ext4: do not convert the unwritten extents if data writeback fails RDMA/uverbs: Propagate errors from rdma_lookup_get_uobject() posix-timers: Add cond_resched() to posix_timer_add() search loop posix-timers: Ensure that timer initialization is fully visible net: stmmac: dwmac-rk: Validate GRF and peripheral GRF during probe net: hsr: Fix PRP duplicate detection timer_list: Don't use %pK through printk() wifi: rtw89: set force HE TB mode when connecting to 11ax AP netfilter: conntrack: Bound nf_conntrack sysctl writes PNP: Expand length of fixup id string phy: rockchip: usbdp: Only verify link rates/lanes/voltage when the corresponding set flags are set arm64/mm: Check pmd_table() in pmd_trans_huge() arm64/mm: Check PUD_TYPE_TABLE in pud_bad() mmc: dw_mmc: add exynos7870 DW MMC support mmc: sdhci: Disable SD card clock before changing parameters usb: xhci: Don't change the status of stalled TDs on failed Stop EP wifi: iwlwifi: mvm: fix setting the TK when associated hwmon: (dell-smm) Increment the number of fans iommu: Keep dev->iommu state consistent printk: Check CON_SUSPEND when unblanking a console wifi: iwlwifi: don't warn when if there is a FW error wifi: iwlwifi: w/a FW SMPS mode selection wifi: iwlwifi: fix debug actions order wifi: iwlwifi: mark Br device not integrated wifi: iwlwifi: fix the ECKV UEFI variable name wifi: mac80211: fix warning on disconnect during failed ML reconf wifi: mac80211_hwsim: Fix MLD address translation wifi: cfg80211: allow IR in 20 MHz configurations ipv6: save dontfrag in cork drm/amd/display: remove minimum Dispclk and apply oem panel timing. drm/amd/display: calculate the remain segments for all pipes drm/amd/display: not abort link train when bw is low drm/amd/display: Fix incorrect DPCD configs while Replay/PSR switch gfs2: Check for empty queue in run_queue auxdisplay: charlcd: Partially revert "Move hwidth and bwidth to struct hd44780_common" ASoC: qcom: sm8250: explicitly set format in sm8250_be_hw_params_fixup() badblocks: Fix a nonsense WARN_ON() which checks whether a u64 variable < 0 coresight-etb10: change etb_drvdata spinlock's type to raw_spinlock_t iommu/amd/pgtbl_v2: Improve error handling cpufreq: tegra186: Share policy per cluster watchdog: aspeed: Update bootstatus handling PCI: endpoint: pci-epf-test: Fix double free that causes kernel to oops misc: pci_endpoint_test: Give disabled BARs a distinct error code crypto: lzo - Fix compression buffer overrun crypto: mxs-dcp - Only set OTP_KEY bit for OTP key drm/amdkfd: Set per-process flags only once for gfx9/10/11/12 drm/amdkfd: Set per-process flags only once cik/vi drm/amdgpu: Fix missing drain retry fault the last entry arm64: tegra: p2597: Fix gpio for vdd-1v8-dis regulator arm64: tegra: Resize aperture for the IGX PCIe C5 slot powerpc/prom_init: Fixup missing #size-cells on PowerBook6,7 ALSA: seq: Improve data consistency at polling tcp: bring back NUMA dispersion in inet_ehash_locks_alloc() rtc: ds1307: stop disabling alarms on probe ieee802154: ca8210: Use proper setters and getters for bitwise types drm/xe: Nuke VM's mapping upon close drm/xe: Retry BO allocation soc: samsung: include linux/array_size.h where needed ARM: tegra: Switch DSI-B clock parent to PLLD on Tegra114 media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe() usb: xhci: set page size to the xHCI-supported size dm cache: prevent BUG_ON by blocking retries on failed device resumes soc: mediatek: mtk-mutex: Add DPI1 SOF/EOF to MT8188 mutex tables orangefs: Do not truncate file size drm/gem: Test for imported GEM buffers with helper net: phylink: use pl->link_interface in phylink_expects_phy() blk-throttle: don't take carryover for prioritized processing of metadata remoteproc: qcom_wcnss: Handle platforms with only single power domain drm/amdgpu: Do not program AGP BAR regs under SRIOV in gfxhub_v1_0.c drm/amd/display: Ensure DMCUB idle before reset on DCN31/DCN35 drm/amd/display: Skip checking FRL_MODE bit for PCON BW determination drm/amd/display: Fix DMUB reset sequence for DCN401 drm/amd/display: Fix p-state type when p-state is unsupported drm/amd/display: Request HW cursor on DCN3.2 with SubVP perf/core: Clean up perf_try_init_event() media: cx231xx: set device_caps for 417 pinctrl: bcm281xx: Use "unsigned int" instead of bare "unsigned" rcu: Fix get_state_synchronize_rcu_full() GP-start detection net: ethernet: ti: cpsw_new: populate netdev of_node net: phy: nxp-c45-tja11xx: add match_phy_device to TJA1103/TJA1104 dpll: Add an assertion to check freq_supported_num ublk: enforce ublks_max only for unprivileged devices iommufd: Disallow allocating nested parent domain with fault ID media: imx335: Set vblank immediately net: pktgen: fix mpls maximum labels list parsing perf/hw_breakpoint: Return EOPNOTSUPP for unsupported breakpoint type ALSA: hda/realtek: Enable PC beep passthrough for HP EliteBook 855 G7 scsi: logging: Fix scsi_logging_level bounds ipv4: fib: Move fib_valid_key_len() to rtm_to_fib_config(). drm/rockchip: vop2: Add uv swap for cluster window block: mark bounce buffering as incompatible with integrity ublk: complete command synchronously on error media: uvcvideo: Add sanity check to uvc_ioctl_xu_ctrl_map media: uvcvideo: Handle uvc menu translation inside uvc_get_le_value clk: imx8mp: inform CCF of maximum frequency of clocks x86/bugs: Make spectre user default depend on MITIGATION_SPECTRE_V2 hwmon: (gpio-fan) Add missing mutex locks ARM: at91: pm: fix at91_suspend_finish for ZQ calibration drm/mediatek: mtk_dpi: Add checks for reg_h_fre_con existence fpga: altera-cvp: Increase credit timeout perf: arm_pmuv3: Call kvm_vcpu_pmu_resync_el0() before enabling counters soc: apple: rtkit: Use high prio work queue soc: apple: rtkit: Implement OSLog buffers properly wifi: ath12k: Report proper tx completion status to mac80211 PCI: brcmstb: Expand inbound window size up to 64GB PCI: brcmstb: Add a softdep to MIP MSI-X driver firmware: arm_ffa: Set dma_mask for ffa devices drm/xe/vf: Retry sending MMIO request to GUC on timeout error drm/xe/pf: Create a link between PF and VF devices net/mlx5: Avoid report two health errors on same syndrome selftests/net: have `gro.sh -t` return a correct exit code pinctrl: sophgo: avoid to modify untouched bit when setting cv1800 pinconf drm/amdkfd: KFD release_work possible circular locking drm/xe: xe_gen_wa_oob: replace program_invocation_short_name leds: pwm-multicolor: Add check for fwnode_property_read_u32 net: ethernet: mtk_ppe_offload: Allow QinQ, double ETH_P_8021Q only net: xgene-v2: remove incorrect ACPI_PTR annotation bonding: report duplicate MAC address in all situations wifi: ath12k: Improve BSS discovery with hidden SSID in 6 GHz band soc: ti: k3-socinfo: Do not use syscon helper to build regmap bpf: Search and add kfuncs in struct_ops prologue and epilogue Octeontx2-af: RPM: Register driver with PCI subsys IDs x86/build: Fix broken copy command in genimage.sh when making isoimage drm/amd/display: handle max_downscale_src_width fail check drm/amd/display: fix dcn4x init failed drm/amd/display: Fix mismatch type comparison ASoC: mediatek: mt8188: Treat DMIC_GAINx_CUR as non-volatile ASoC: mediatek: mt8188: Add reference for dmic clocks x86/nmi: Add an emergency handler in nmi_desc & use it in nmi_shootdown_cpus() vhost-scsi: Return queue full for page alloc failures during copy vdpa/mlx5: Fix mlx5_vdpa_get_config() endianness on big-endian machines cpuidle: menu: Avoid discarding useful information media: adv7180: Disable test-pattern control on adv7180 media: tc358746: improve calculation of the D-PHY timing registers net/mlx5e: Add correct match to check IPSec syndromes for switchdev mode scsi: mpi3mr: Update timestamp only for supervisor IOCs loop: check in LO_FLAGS_DIRECT_IO in loop_default_blocksize libbpf: Fix out-of-bound read dm: fix unconditional IO throttle caused by REQ_PREFLUSH scsi: scsi_debug: First fixes for tapes net/mlx5: Change POOL_NEXT_SIZE define value and make it global x86/kaslr: Reduce KASLR entropy on most x86 systems crypto: ahash - Set default reqsize from ahash_alg crypto: skcipher - Zap type in crypto_alloc_sync_skcipher net: ipv6: Init tunnel link-netns before registering dev drm/xe/oa: Ensure that polled read returns latest data MIPS: Use arch specific syscall name match function drm/amdgpu: remove all KFD fences from the BO on release x86/locking: Use ALT_OUTPUT_SP() for percpu_{,try_}cmpxchg{64,128}_op() genirq/msi: Store the IOMMU IOVA directly in msi_desc instead of iommu_cookie MIPS: pm-cps: Use per-CPU variables as per-CPU, not per-core clocksource: mips-gic-timer: Enable counter when CPUs start PCI: epf-mhi: Update device ID for SA8775P scsi: mpt3sas: Send a diag reset if target reset fails wifi: rtw88: Fix rtw_init_vht_cap() for RTL8814AU wifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31 wifi: rtw89: fw: propagate error code from rtw89_h2c_tx() wifi: rtw89: fw: get sb_sel_ver via get_unaligned_le32() wifi: rtw89: fw: add blacklist to avoid obsolete secure firmware wifi: rtw89: 8922a: fix incorrect STA-ID in EHT MU PPDU net: pktgen: fix access outside of user given buffer in pktgen_thread_write() power: supply: axp20x_battery: Update temp sensor for AXP717 from device tree EDAC/ie31200: work around false positive build warning i3c: master: svc: Flush FIFO before sending Dynamic Address Assignment(DAA) mfd: axp20x: AXP717: Add AXP717_TS_PIN_CFG to writeable regs eeprom: ee1004: Check chip before probing irqchip/riscv-imsic: Separate next and previous pointers in IMSIC vector drm/amd/pm: Fetch current power limit from PMFW drm/amd/display: Add support for disconnected eDP streams drm/amd/display: Guard against setting dispclk low when active drm/amd/display: Fix BT2020 YCbCr limited/full range input drm/amd/display: Read LTTPR ALPM caps during link cap retrieval Revert "drm/amd/display: Request HW cursor on DCN3.2 with SubVP" drm/amd/display: Don't treat wb connector as physical in create_validate_stream_for_sink serial: mctrl_gpio: split disable_ms into sync and no_sync APIs RDMA/core: Fix best page size finding when it can cross SG entries pmdomain: imx: gpcv2: use proper helper for property detection can: c_can: Use of_property_present() to test existence of DT property bpf: don't do clean_live_states when state->loop_entry->branches > 0 bpf: copy_verifier_state() should copy 'loop_entry' field eth: mlx4: don't try to complete XDP frames in netpoll PCI: Fix old_size lower bound in calculate_iosize() too ACPI: HED: Always initialize before evged vxlan: Join / leave MC group after remote changes hrtimers: Replace hrtimer_clock_to_base_table with switch-case irqchip/riscv-imsic: Set irq_set_affinity() for IMSIC base media: test-drivers: vivid: don't call schedule in loop net/mlx5: Modify LSB bitmask in temperature event to include only the first bit net/mlx5: Apply rate-limiting to high temperature warning firmware: arm_ffa: Reject higher major version as incompatible firmware: arm_ffa: Handle the presence of host partition in the partition info firmware: xilinx: Dont send linux address to get fpga config get status ASoC: ops: Enforce platform maximum on initial value ASoC: tas2764: Add reg defaults for TAS2764_INT_CLK_CFG ASoC: tas2764: Mark SW_RESET as volatile ASoC: tas2764: Power up/down amp on mute ops ASoC: soc-dai: check return value at snd_soc_dai_set_tdm_slot() pinctrl: devicetree: do not goto err when probing hogs in pinctrl_dt_to_map smack: recognize ipv4 CIPSO w/o categories smack: Revert "smackfs: Added check catlen" kunit: tool: Use qboot on QEMU x86_64 media: i2c: imx219: Correct the minimum vblanking value media: v4l: Memset argument to 0 before calling get_mbus_config pad op net/mlx4_core: Avoid impossible mlx4_db_alloc() order value drm/xe: Stop ignoring errors from xe_ttm_stolen_mgr_init() drm/xe: Fix xe_tile_init_noalloc() error propagation clk: qcom: ipq5018: allow it to be bulid on arm32 clk: qcom: clk-alpha-pll: Do not use random stack value for recalc rate drm/xe/debugfs: fixed the return value of wedged_mode_set drm/xe/debugfs: Add missing xe_pm_runtime_put in wedge_mode_set x86/ibt: Handle FineIBT in handle_cfi_failure() x86/traps: Cleanup and robustify decode_bug() sched: Reduce the default slice to avoid tasks getting an extra tick serial: sh-sci: Update the suspend/resume support pinctrl: renesas: rzg2l: Add suspend/resume support for pull up/down phy: phy-rockchip-samsung-hdptx: Swap the definitions of LCPLL_REF and ROPLL_REF phy: core: don't require set_mode() callback for phy_get_mode() to work phy: exynos5-usbdrd: fix EDS distribution tuning (gs101) soundwire: amd: change the soundwire wake enable/disable sequence soundwire: cadence_master: set frame shape and divider based on actual clk freq net: stmmac: dwmac-loongson: Set correct {tx,rx}_fifo_size drm/amdgpu/mes11: fix set_hw_resources_1 calculation drm/amdkfd: fix missing L2 cache info in topology drm/amdgpu: Set snoop bit for SDMA for MI series drm/amd/display: pass calculated dram_speed_mts to dml2 drm/amd/display: Don't try AUX transactions on disconnected link drm/amdgpu: reset psp->cmd to NULL after releasing the buffer drm/amd/pm: Skip P2S load for SMU v13.0.12 drm/amd/display: Support multiple options during psr entry. Revert "drm/amd/display: Exit idle optimizations before attempt to access PHY" drm/amd/display: Update CR AUX RD interval interpretation drm/amd/display: Initial psr_version with correct setting drm/amd/display: Increase block_sequence array size drm/amd/display: Use Nominal vBlank If Provided Instead Of Capping It drm/amd/display: Populate register address for dentist for dcn401 drm/amdgpu: Use active umc info from discovery drm/amdgpu: enlarge the VBIOS binary size limit drm/amd/display/dm: drop hw_support check in amdgpu_dm_i2c_xfer() scsi: target: spc: Fix loop traversal in spc_rsoc_get_descr() net/mlx5: XDP, Enable TX side XDP multi-buffer support net/mlx5: Extend Ethtool loopback selftest to support non-linear SKB net/mlx5e: set the tx_queue_len for pfifo_fast net/mlx5e: reduce rep rxq depth to 256 for ECPF net/mlx5e: reduce the max log mpwrq sz for ECPF and reps drm/v3d: Add clock handling xfrm: prevent high SEQ input in non-ESN mode wifi: ath12k: fix the ampdu id fetch in the HAL_RX_MPDU_START TLV mptcp: pm: userspace: flags: clearer msg if no remote addr wifi: iwlwifi: use correct IMR dump variable wifi: iwlwifi: don't warn during reprobe wifi: mac80211: don't unconditionally call drv_mgd_complete_tx() wifi: mac80211: remove misplaced drv_mgd_complete_tx() call wifi: mac80211: set ieee80211_prep_tx_info::link_id upon Auth Rx net: fec: Refactor MAC reset to function powerpc/pseries/iommu: memory notifier incorrectly adds TCEs for pmemory powerpc/pseries/iommu: create DDW for devices with DMA mask less than 64-bits arch/powerpc/perf: Check the instruction type before creating sample with perf_mem_data_src ip: fib_rules: Fetch net from fib_rule in fib[46]_rule_configure(). r8152: add vendor/device ID pair for Dell Alienware AW1022z iio: adc: ad7944: don't use storagebits for sizing pstore: Change kmsg_bytes storage size to u32 leds: trigger: netdev: Configure LED blink interval for HW offload ext4: don't write back data before punch hole in nojournal mode ext4: remove writable userspace mappings before truncating page cache wifi: rtw88: Fix download_firmware_validate() for RTL8814AU wifi: rtw88: Fix __rtw_download_firmware() for RTL8814AU wifi: rtw89: coex: Assign value over than 0 to avoid firmware timer hang wifi: rtw89: fw: validate multi-firmware header before getting its size wifi: rtw89: fw: validate multi-firmware header before accessing wifi: rtw89: call power_on ahead before selecting firmware clk: qcom: camcc-sm8250: Use clk_rcg2_shared_ops for some RCGs net: page_pool: avoid false positive warning if NAPI was never added tools/power turbostat: Clustered Uncore MHz counters should honor show/hide options hwmon: (xgene-hwmon) use appropriate type for the latency value f2fs: introduce f2fs_base_attr for global sysfs entries media: qcom: camss: csid: Only add TPG v4l2 ctrl if TPG hardware is available media: qcom: camss: Add default case in vfe_src_pad_code drm/rockchip: vop2: Improve display modes handling on RK3588 HDMI0 eth: fbnic: set IFF_UNICAST_FLT to avoid enabling promiscuous mode when adding unicast addrs tools: ynl-gen: don't output external constants net/mlx5e: Avoid WARN_ON when configuring MQPRIO with HTB offload enabled cpufreq: amd-pstate: Remove unnecessary driver_lock in set_boost vxlan: Annotate FDB data races ipv4: ip_gre: Fix set but not used warning in ipgre_err() if IPv4-only r8169: don't scan PHY addresses > 0 net: flush_backlog() small changes bridge: mdb: Allow replace of a host-joined group ice: init flow director before RDMA ice: treat dyn_allowed only as suggestion rcu: handle quiescent states for PREEMPT_RCU=n, PREEMPT_COUNT=y rcu: handle unstable rdp in rcu_read_unlock_strict() rcu: fix header guard for rcu_all_qs() perf: Avoid the read if the count is already updated ice: count combined queues using Rx/Tx count drm/xe/relay: Don't use GFP_KERNEL for new transactions net/mana: fix warning in the writer of client oob scsi: lpfc: Handle duplicate D_IDs in ndlp search-by D_ID routine scsi: lpfc: Ignore ndlp rport mismatch in dev_loss_tmo callbk scsi: lpfc: Free phba irq in lpfc_sli4_enable_msi() when pci_irq_vector() fails scsi: st: Restore some drive settings after reset wifi: ath12k: Avoid napi_sync() before napi_enable() HID: usbkbd: Fix the bit shift number for LED_KANA arm64: zynqmp: add clock-output-names property in clock nodes ASoC: codecs: pcm3168a: Allow for 24-bit in provider mode ASoC: rt722-sdca: Add some missing readable registers irqchip/riscv-aplic: Add support for hart indexes dm vdo indexer: prevent unterminated string warning dm vdo: use a short static string for thread name prefix drm/ast: Find VBIOS mode from regular display size bpf: Use kallsyms to find the function name of a struct_ops's stub function bpftool: Fix readlink usage in get_fd_type firmware: arm_scmi: Relax duplicate name constraint across protocol ids perf/amd/ibs: Fix perf_ibs_op.cnt_mask for CurCnt perf/amd/ibs: Fix ->config to sample period calculation for OP PMU clk: renesas: rzg2l-cpg: Refactor Runtime PM clock validation wifi: rtl8xxxu: retry firmware download on error wifi: rtw88: Don't use static local variable in rtw8822b_set_tx_power_index_by_rate wifi: rtw89: add wiphy_lock() to work that isn't held wiphy_lock() yet spi: zynqmp-gqspi: Always acknowledge interrupts regulator: ad5398: Add device tree support wifi: ath12k: fix ath12k_hal_tx_cmd_ext_desc_setup() info1 override accel/qaic: Mask out SR-IOV PCI resources drm/xe/pf: Reset GuC VF config when unprovisioning critical resource wifi: ath9k: return by of_get_mac_address wifi: ath12k: Fetch regdb.bin file from board-2.bin wifi: ath12k: Fix end offset bit definition in monitor ring descriptor drm: bridge: adv7511: fill stream capabilities drm/nouveau: fix the broken marco GSP_MSG_MAX_SIZE wifi: ath11k: Use dma_alloc_noncoherent for rx_tid buffer allocation drm/xe: Move suballocator init to after display init drm/xe: Do not attempt to bootstrap VF in execlists mode wifi: rtw89: coex: Separated Wi-Fi connecting event from Wi-Fi scan event drm/xe/sa: Always call drm_suballoc_manager_fini() drm/xe: Reject BO eviction if BO is bound to current VM drm/atomic: clarify the rules around drm_atomic_state->allow_modeset drm/buddy: fix issue that force_merge cannot free all roots drm/panel-edp: Add Starry 116KHD024006 drm: Add valid clones check ASoC: imx-card: Adjust over allocation of memory in imx_card_parse_of() book3s64/radix: Fix compile errors when CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP=n pinctrl: meson: define the pull up/down resistor value as 60 kOhm smb: server: smb2pdu: check return value of xa_store() platform/x86/intel: hid: Add Pantherlake support platform/x86: asus-wmi: Disable OOBE state after resume from hibernation platform/x86: ideapad-laptop: add support for some new buttons ASoC: cs42l43: Disable headphone clamps during type detection ASoC: Intel: bytcr_rt5640: Add DMI quirk for Acer Aspire SW3-013 ALSA: hda/realtek: Add quirk for HP Spectre x360 15-df1xxx nvme-pci: add quirks for device 126f:1001 nvme-pci: add quirks for WDC Blue SN550 15b7:5009 ALSA: usb-audio: Fix duplicated name in MIDI substream names nvmet-tcp: don't restore null sk_state_change io_uring/fdinfo: annotate racy sq/cq head/tail reads cifs: Fix and improve cifs_query_path_info() and cifs_query_file_info() cifs: Fix changing times and read-only attr over SMB1 smb_set_file_info() function ASoC: intel/sdw_utils: Add volume limit to cs42l43 speakers btrfs: compression: adjust cb->compressed_folios allocation type btrfs: correct the order of prelim_ref arguments in btrfs__prelim_ref btrfs: handle empty eb->folios in num_extent_folios() btrfs: avoid NULL pointer dereference if no valid csum tree tools: ynl-gen: validate 0 len strings from kernel block: only update request sector if needed wifi: iwlwifi: add support for Killer on MTL x86/Kconfig: make CFI_AUTO_DEFAULT depend on !RUST or Rust >= 1.88 xenbus: Allow PVH dom0 a non-local xenstore drm/amd/display: Call FP Protect Before Mode Programming/Mode Support __legitimize_mnt(): check for MNT_SYNC_UMOUNT should be under mount_lock soundwire: bus: Fix race on the creation of the IRQ domain espintcp: fix skb leaks espintcp: remove encap socket caching to avoid reference leak xfrm: Fix UDP GRO handling for some corner cases dmaengine: idxd: Fix allowing write() from different address spaces x86/sev: Fix operator precedence in GHCB_MSR_VMPL_REQ_LEVEL macro kernel/fork: only call untrack_pfn_clear() on VMAs duplicated for fork() remoteproc: qcom_wcnss: Fix on platforms without fallback regulators clk: sunxi-ng: d1: Add missing divider for MMC mod clocks xfrm: Sanitize marks before insert dmaengine: idxd: Fix ->poll() return value dmaengine: fsl-edma: Fix return code for unhandled interrupts driver core: Split devres APIs to device/devres.h devres: Introduce devm_kmemdup_array() ASoC: SOF: Intel: hda: Fix UAF when reloading module irqchip/riscv-imsic: Start local sync timer on correct CPU perf/x86/intel: Fix segfault with PEBS-via-PT with sample_freq Bluetooth: L2CAP: Fix not checking l2cap_chan security level Bluetooth: btusb: use skb_pull to avoid unsafe access in QCA dump handling ptp: ocp: Limit signal/freq counts in summary output functions bridge: netfilter: Fix forwarding of fragmented packets ice: fix vf->num_mac count with port representors ice: Fix LACP bonds without SRIOV environment idpf: fix null-ptr-deref in idpf_features_check loop: don't require ->write_iter for writable files in loop_configure pinctrl: qcom: switch to devm_register_sys_off_handler() net: dwmac-sun8i: Use parsed internal PHY address instead of 1 net: lan743x: Restore SGMII CTRL register on resume io_uring: fix overflow resched cqe reordering idpf: fix idpf_vport_splitq_napi_poll() sch_hfsc: Fix qlen accounting bug when using peek in hfsc_enqueue() octeontx2-pf: Add AF_XDP non-zero copy support net/tipc: fix slab-use-after-free Read in tipc_aead_encrypt_done octeontx2-af: Set LMT_ENA bit for APR table entries octeontx2-af: Fix APR entry mapping based on APR_LMT_CFG clk: s2mps11: initialise clk_hw_onecell_data::num before accessing ::hws[] in probe() crypto: algif_hash - fix double free in hash_accept padata: do not leak refcount in reorder_work can: slcan: allow reception of short error messages can: bcm: add locking for bcm_op runtime updates can: bcm: add missing rcu read protection for procfs content ASoC: SOF: ipc4-control: Use SOF_CTRL_CMD_BINARY as numid for bytes_ext ASoC: SOF: Intel: hda-bus: Use PIO mode on ACE2+ platforms ASoc: SOF: topology: connect DAI to a single DAI link ASoC: SOF: ipc4-pcm: Delay reporting is only supported for playback direction ALSA: pcm: Fix race of buffer access at PCM OSS layer ALSA: hda/realtek: Add quirk for Lenovo Yoga Pro 7 14ASP10 llc: fix data loss when reading from a socket in llc_ui_recvmsg() can: kvaser_pciefd: Continue parsing DMA buf after dropped RX can: kvaser_pciefd: Fix echo_skb race net: dsa: microchip: linearize skb for tail-tagging switches vmxnet3: update MTU after device quiesce pmdomain: renesas: rcar: Remove obsolete nullify checks pmdomain: core: Fix error checking in genpd_dev_pm_attach_by_id() platform/x86: dell-wmi-sysman: Avoid buffer overflow in current_password_store() thermal: intel: x86_pkg_temp_thermal: Fix bogus trip temperature drm/edid: fixed the bug that hdr metadata was not reset smb: client: Fix use-after-free in cifs_fill_dirent arm64: dts: marvell: uDPU: define pinctrl state for alarm LEDs smb: client: Reset all search buffer pointers when releasing buffer Revert "drm/amd: Keep display off while going into S4" Input: xpad - add more controllers highmem: add folio_test_partial_kmap() memcg: always call cond_resched() after fn() mm/page_alloc.c: avoid infinite retries caused by cpuset race mm: mmap: map MAP_STACK to VM_NOHUGEPAGE only if THP is enabled mm: vmalloc: actually use the in-place vrealloc region mm: vmalloc: only zero-init on vrealloc shrink nilfs2: fix deadlock warnings caused by lock dependency in init_nilfs() Bluetooth: btmtksdio: Check function enabled before doing close Bluetooth: btmtksdio: Do close if SDIO card removed without close Revert "arm64: dts: allwinner: h6: Use RSB for AXP805 PMIC connection" ksmbd: fix stream write failure platform/x86: think-lmi: Fix attribute name usage for non-compliant items spi: use container_of_cont() for to_spi_device() spi: spi-fsl-dspi: restrict register range for regmap access spi: spi-fsl-dspi: Halt the module after a new message transfer spi: spi-fsl-dspi: Reset SR flags before sending a new message err.h: move IOMEM_ERR_PTR() to err.h gcc-15: make 'unterminated string initialization' just a warning gcc-15: disable '-Wunterminated-string-initialization' entirely for now Fix mis-uses of 'cc-option' for warning disablement kbuild: Properly disable -Wunterminated-string-initialization for clang drm/amd/display: Exit idle optimizations before accessing PHY bpf: abort verification if env->cur_state->loop_entry != NULL serial: sh-sci: Save and restore more registers drm/amdkfd: Correct F8_MODE for gfx950 watchdog: aspeed: fix 64-bit division pinctrl: tegra: Fix off by one in tegra_pinctrl_get_group() i3c: master: svc: Fix implicit fallthrough in svc_i3c_master_ibi_work() x86/mm/init: Handle the special case of device private pages in add_pages(), to not increase max_pfn and trigger dma_addressing_limited() bounce buffers bounce buffers drm/gem: Internally test import_attach for imported objects Linux 6.12.31 Change-Id: I017795966fb764f9320a6a0df1571d19e5e631fe Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
1629 lines
54 KiB
C
1629 lines
54 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
#ifndef __SOUND_PCM_H
|
|
#define __SOUND_PCM_H
|
|
|
|
/*
|
|
* Digital Audio (PCM) abstract layer
|
|
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>
|
|
* Abramo Bagnara <abramo@alsa-project.org>
|
|
*/
|
|
|
|
#include <sound/asound.h>
|
|
#include <sound/memalloc.h>
|
|
#include <sound/minors.h>
|
|
#include <linux/poll.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/bitops.h>
|
|
#include <linux/pm_qos.h>
|
|
#include <linux/refcount.h>
|
|
#include <linux/uio.h>
|
|
#include <linux/android_kabi.h>
|
|
|
|
#define snd_pcm_substream_chip(substream) ((substream)->private_data)
|
|
#define snd_pcm_chip(pcm) ((pcm)->private_data)
|
|
|
|
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
|
|
#include <sound/pcm_oss.h>
|
|
#endif
|
|
|
|
/*
|
|
* Hardware (lowlevel) section
|
|
*/
|
|
|
|
struct snd_pcm_hardware {
|
|
unsigned int info; /* SNDRV_PCM_INFO_* */
|
|
u64 formats; /* SNDRV_PCM_FMTBIT_* */
|
|
u32 subformats; /* for S32_LE, SNDRV_PCM_SUBFMTBIT_* */
|
|
unsigned int rates; /* SNDRV_PCM_RATE_* */
|
|
unsigned int rate_min; /* min rate */
|
|
unsigned int rate_max; /* max rate */
|
|
unsigned int channels_min; /* min channels */
|
|
unsigned int channels_max; /* max channels */
|
|
size_t buffer_bytes_max; /* max buffer size */
|
|
size_t period_bytes_min; /* min period size */
|
|
size_t period_bytes_max; /* max period size */
|
|
unsigned int periods_min; /* min # of periods */
|
|
unsigned int periods_max; /* max # of periods */
|
|
size_t fifo_size; /* fifo size in bytes */
|
|
};
|
|
|
|
struct snd_pcm_status64;
|
|
struct snd_pcm_substream;
|
|
|
|
struct snd_pcm_audio_tstamp_config; /* definitions further down */
|
|
struct snd_pcm_audio_tstamp_report;
|
|
|
|
struct snd_pcm_ops {
|
|
int (*open)(struct snd_pcm_substream *substream);
|
|
int (*close)(struct snd_pcm_substream *substream);
|
|
int (*ioctl)(struct snd_pcm_substream * substream,
|
|
unsigned int cmd, void *arg);
|
|
int (*hw_params)(struct snd_pcm_substream *substream,
|
|
struct snd_pcm_hw_params *params);
|
|
int (*hw_free)(struct snd_pcm_substream *substream);
|
|
int (*prepare)(struct snd_pcm_substream *substream);
|
|
int (*trigger)(struct snd_pcm_substream *substream, int cmd);
|
|
int (*sync_stop)(struct snd_pcm_substream *substream);
|
|
snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream);
|
|
int (*get_time_info)(struct snd_pcm_substream *substream,
|
|
struct timespec64 *system_ts, struct timespec64 *audio_ts,
|
|
struct snd_pcm_audio_tstamp_config *audio_tstamp_config,
|
|
struct snd_pcm_audio_tstamp_report *audio_tstamp_report);
|
|
int (*fill_silence)(struct snd_pcm_substream *substream, int channel,
|
|
unsigned long pos, unsigned long bytes);
|
|
int (*copy)(struct snd_pcm_substream *substream, int channel,
|
|
unsigned long pos, struct iov_iter *iter, unsigned long bytes);
|
|
struct page *(*page)(struct snd_pcm_substream *substream,
|
|
unsigned long offset);
|
|
int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma);
|
|
int (*ack)(struct snd_pcm_substream *substream);
|
|
|
|
ANDROID_KABI_RESERVE(1);
|
|
};
|
|
|
|
/*
|
|
*
|
|
*/
|
|
|
|
#if defined(CONFIG_SND_DYNAMIC_MINORS)
|
|
#define SNDRV_PCM_DEVICES (SNDRV_OS_MINORS-2)
|
|
#else
|
|
#define SNDRV_PCM_DEVICES 8
|
|
#endif
|
|
|
|
#define SNDRV_PCM_IOCTL1_RESET 0
|
|
/* 1 is absent slot. */
|
|
#define SNDRV_PCM_IOCTL1_CHANNEL_INFO 2
|
|
/* 3 is absent slot. */
|
|
#define SNDRV_PCM_IOCTL1_FIFO_SIZE 4
|
|
#define SNDRV_PCM_IOCTL1_SYNC_ID 5
|
|
|
|
#define SNDRV_PCM_TRIGGER_STOP 0
|
|
#define SNDRV_PCM_TRIGGER_START 1
|
|
#define SNDRV_PCM_TRIGGER_PAUSE_PUSH 3
|
|
#define SNDRV_PCM_TRIGGER_PAUSE_RELEASE 4
|
|
#define SNDRV_PCM_TRIGGER_SUSPEND 5
|
|
#define SNDRV_PCM_TRIGGER_RESUME 6
|
|
#define SNDRV_PCM_TRIGGER_DRAIN 7
|
|
|
|
#define SNDRV_PCM_POS_XRUN ((snd_pcm_uframes_t)-1)
|
|
|
|
/* If you change this don't forget to change rates[] table in pcm_native.c */
|
|
#define SNDRV_PCM_RATE_5512 (1U<<0) /* 5512Hz */
|
|
#define SNDRV_PCM_RATE_8000 (1U<<1) /* 8000Hz */
|
|
#define SNDRV_PCM_RATE_11025 (1U<<2) /* 11025Hz */
|
|
#define SNDRV_PCM_RATE_16000 (1U<<3) /* 16000Hz */
|
|
#define SNDRV_PCM_RATE_22050 (1U<<4) /* 22050Hz */
|
|
#define SNDRV_PCM_RATE_32000 (1U<<5) /* 32000Hz */
|
|
#define SNDRV_PCM_RATE_44100 (1U<<6) /* 44100Hz */
|
|
#define SNDRV_PCM_RATE_48000 (1U<<7) /* 48000Hz */
|
|
#define SNDRV_PCM_RATE_64000 (1U<<8) /* 64000Hz */
|
|
#define SNDRV_PCM_RATE_88200 (1U<<9) /* 88200Hz */
|
|
#define SNDRV_PCM_RATE_96000 (1U<<10) /* 96000Hz */
|
|
#define SNDRV_PCM_RATE_176400 (1U<<11) /* 176400Hz */
|
|
#define SNDRV_PCM_RATE_192000 (1U<<12) /* 192000Hz */
|
|
#define SNDRV_PCM_RATE_352800 (1U<<13) /* 352800Hz */
|
|
#define SNDRV_PCM_RATE_384000 (1U<<14) /* 384000Hz */
|
|
#define SNDRV_PCM_RATE_705600 (1U<<15) /* 705600Hz */
|
|
#define SNDRV_PCM_RATE_768000 (1U<<16) /* 768000Hz */
|
|
/* extended rates since 6.12 */
|
|
#define SNDRV_PCM_RATE_12000 (1U<<17) /* 12000Hz */
|
|
#define SNDRV_PCM_RATE_24000 (1U<<18) /* 24000Hz */
|
|
#define SNDRV_PCM_RATE_128000 (1U<<19) /* 128000Hz */
|
|
|
|
#define SNDRV_PCM_RATE_CONTINUOUS (1U<<30) /* continuous range */
|
|
#define SNDRV_PCM_RATE_KNOT (1U<<31) /* supports more non-continuous rates */
|
|
|
|
#define SNDRV_PCM_RATE_8000_44100 (SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_11025|\
|
|
SNDRV_PCM_RATE_16000|SNDRV_PCM_RATE_22050|\
|
|
SNDRV_PCM_RATE_32000|SNDRV_PCM_RATE_44100)
|
|
#define SNDRV_PCM_RATE_8000_48000 (SNDRV_PCM_RATE_8000_44100|SNDRV_PCM_RATE_48000)
|
|
#define SNDRV_PCM_RATE_8000_96000 (SNDRV_PCM_RATE_8000_48000|SNDRV_PCM_RATE_64000|\
|
|
SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000)
|
|
#define SNDRV_PCM_RATE_8000_192000 (SNDRV_PCM_RATE_8000_96000|SNDRV_PCM_RATE_176400|\
|
|
SNDRV_PCM_RATE_192000)
|
|
#define SNDRV_PCM_RATE_8000_384000 (SNDRV_PCM_RATE_8000_192000|\
|
|
SNDRV_PCM_RATE_352800|\
|
|
SNDRV_PCM_RATE_384000)
|
|
#define SNDRV_PCM_RATE_8000_768000 (SNDRV_PCM_RATE_8000_384000|\
|
|
SNDRV_PCM_RATE_705600|\
|
|
SNDRV_PCM_RATE_768000)
|
|
#define _SNDRV_PCM_FMTBIT(fmt) (1ULL << (__force int)SNDRV_PCM_FORMAT_##fmt)
|
|
#define SNDRV_PCM_FMTBIT_S8 _SNDRV_PCM_FMTBIT(S8)
|
|
#define SNDRV_PCM_FMTBIT_U8 _SNDRV_PCM_FMTBIT(U8)
|
|
#define SNDRV_PCM_FMTBIT_S16_LE _SNDRV_PCM_FMTBIT(S16_LE)
|
|
#define SNDRV_PCM_FMTBIT_S16_BE _SNDRV_PCM_FMTBIT(S16_BE)
|
|
#define SNDRV_PCM_FMTBIT_U16_LE _SNDRV_PCM_FMTBIT(U16_LE)
|
|
#define SNDRV_PCM_FMTBIT_U16_BE _SNDRV_PCM_FMTBIT(U16_BE)
|
|
#define SNDRV_PCM_FMTBIT_S24_LE _SNDRV_PCM_FMTBIT(S24_LE)
|
|
#define SNDRV_PCM_FMTBIT_S24_BE _SNDRV_PCM_FMTBIT(S24_BE)
|
|
#define SNDRV_PCM_FMTBIT_U24_LE _SNDRV_PCM_FMTBIT(U24_LE)
|
|
#define SNDRV_PCM_FMTBIT_U24_BE _SNDRV_PCM_FMTBIT(U24_BE)
|
|
// For S32/U32 formats, 'msbits' hardware parameter is often used to deliver information about the
|
|
// available bit count in most significant bit. It's for the case of so-called 'left-justified' or
|
|
// `right-padding` sample which has less width than 32 bit.
|
|
#define SNDRV_PCM_FMTBIT_S32_LE _SNDRV_PCM_FMTBIT(S32_LE)
|
|
#define SNDRV_PCM_FMTBIT_S32_BE _SNDRV_PCM_FMTBIT(S32_BE)
|
|
#define SNDRV_PCM_FMTBIT_U32_LE _SNDRV_PCM_FMTBIT(U32_LE)
|
|
#define SNDRV_PCM_FMTBIT_U32_BE _SNDRV_PCM_FMTBIT(U32_BE)
|
|
#define SNDRV_PCM_FMTBIT_FLOAT_LE _SNDRV_PCM_FMTBIT(FLOAT_LE)
|
|
#define SNDRV_PCM_FMTBIT_FLOAT_BE _SNDRV_PCM_FMTBIT(FLOAT_BE)
|
|
#define SNDRV_PCM_FMTBIT_FLOAT64_LE _SNDRV_PCM_FMTBIT(FLOAT64_LE)
|
|
#define SNDRV_PCM_FMTBIT_FLOAT64_BE _SNDRV_PCM_FMTBIT(FLOAT64_BE)
|
|
#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE _SNDRV_PCM_FMTBIT(IEC958_SUBFRAME_LE)
|
|
#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE _SNDRV_PCM_FMTBIT(IEC958_SUBFRAME_BE)
|
|
#define SNDRV_PCM_FMTBIT_MU_LAW _SNDRV_PCM_FMTBIT(MU_LAW)
|
|
#define SNDRV_PCM_FMTBIT_A_LAW _SNDRV_PCM_FMTBIT(A_LAW)
|
|
#define SNDRV_PCM_FMTBIT_IMA_ADPCM _SNDRV_PCM_FMTBIT(IMA_ADPCM)
|
|
#define SNDRV_PCM_FMTBIT_MPEG _SNDRV_PCM_FMTBIT(MPEG)
|
|
#define SNDRV_PCM_FMTBIT_GSM _SNDRV_PCM_FMTBIT(GSM)
|
|
#define SNDRV_PCM_FMTBIT_S20_LE _SNDRV_PCM_FMTBIT(S20_LE)
|
|
#define SNDRV_PCM_FMTBIT_U20_LE _SNDRV_PCM_FMTBIT(U20_LE)
|
|
#define SNDRV_PCM_FMTBIT_S20_BE _SNDRV_PCM_FMTBIT(S20_BE)
|
|
#define SNDRV_PCM_FMTBIT_U20_BE _SNDRV_PCM_FMTBIT(U20_BE)
|
|
#define SNDRV_PCM_FMTBIT_SPECIAL _SNDRV_PCM_FMTBIT(SPECIAL)
|
|
#define SNDRV_PCM_FMTBIT_S24_3LE _SNDRV_PCM_FMTBIT(S24_3LE)
|
|
#define SNDRV_PCM_FMTBIT_U24_3LE _SNDRV_PCM_FMTBIT(U24_3LE)
|
|
#define SNDRV_PCM_FMTBIT_S24_3BE _SNDRV_PCM_FMTBIT(S24_3BE)
|
|
#define SNDRV_PCM_FMTBIT_U24_3BE _SNDRV_PCM_FMTBIT(U24_3BE)
|
|
#define SNDRV_PCM_FMTBIT_S20_3LE _SNDRV_PCM_FMTBIT(S20_3LE)
|
|
#define SNDRV_PCM_FMTBIT_U20_3LE _SNDRV_PCM_FMTBIT(U20_3LE)
|
|
#define SNDRV_PCM_FMTBIT_S20_3BE _SNDRV_PCM_FMTBIT(S20_3BE)
|
|
#define SNDRV_PCM_FMTBIT_U20_3BE _SNDRV_PCM_FMTBIT(U20_3BE)
|
|
#define SNDRV_PCM_FMTBIT_S18_3LE _SNDRV_PCM_FMTBIT(S18_3LE)
|
|
#define SNDRV_PCM_FMTBIT_U18_3LE _SNDRV_PCM_FMTBIT(U18_3LE)
|
|
#define SNDRV_PCM_FMTBIT_S18_3BE _SNDRV_PCM_FMTBIT(S18_3BE)
|
|
#define SNDRV_PCM_FMTBIT_U18_3BE _SNDRV_PCM_FMTBIT(U18_3BE)
|
|
#define SNDRV_PCM_FMTBIT_G723_24 _SNDRV_PCM_FMTBIT(G723_24)
|
|
#define SNDRV_PCM_FMTBIT_G723_24_1B _SNDRV_PCM_FMTBIT(G723_24_1B)
|
|
#define SNDRV_PCM_FMTBIT_G723_40 _SNDRV_PCM_FMTBIT(G723_40)
|
|
#define SNDRV_PCM_FMTBIT_G723_40_1B _SNDRV_PCM_FMTBIT(G723_40_1B)
|
|
#define SNDRV_PCM_FMTBIT_DSD_U8 _SNDRV_PCM_FMTBIT(DSD_U8)
|
|
#define SNDRV_PCM_FMTBIT_DSD_U16_LE _SNDRV_PCM_FMTBIT(DSD_U16_LE)
|
|
#define SNDRV_PCM_FMTBIT_DSD_U32_LE _SNDRV_PCM_FMTBIT(DSD_U32_LE)
|
|
#define SNDRV_PCM_FMTBIT_DSD_U16_BE _SNDRV_PCM_FMTBIT(DSD_U16_BE)
|
|
#define SNDRV_PCM_FMTBIT_DSD_U32_BE _SNDRV_PCM_FMTBIT(DSD_U32_BE)
|
|
|
|
#ifdef SNDRV_LITTLE_ENDIAN
|
|
#define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE
|
|
#define SNDRV_PCM_FMTBIT_U16 SNDRV_PCM_FMTBIT_U16_LE
|
|
#define SNDRV_PCM_FMTBIT_S24 SNDRV_PCM_FMTBIT_S24_LE
|
|
#define SNDRV_PCM_FMTBIT_U24 SNDRV_PCM_FMTBIT_U24_LE
|
|
#define SNDRV_PCM_FMTBIT_S32 SNDRV_PCM_FMTBIT_S32_LE
|
|
#define SNDRV_PCM_FMTBIT_U32 SNDRV_PCM_FMTBIT_U32_LE
|
|
#define SNDRV_PCM_FMTBIT_FLOAT SNDRV_PCM_FMTBIT_FLOAT_LE
|
|
#define SNDRV_PCM_FMTBIT_FLOAT64 SNDRV_PCM_FMTBIT_FLOAT64_LE
|
|
#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE
|
|
#define SNDRV_PCM_FMTBIT_S20 SNDRV_PCM_FMTBIT_S20_LE
|
|
#define SNDRV_PCM_FMTBIT_U20 SNDRV_PCM_FMTBIT_U20_LE
|
|
#endif
|
|
#ifdef SNDRV_BIG_ENDIAN
|
|
#define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_BE
|
|
#define SNDRV_PCM_FMTBIT_U16 SNDRV_PCM_FMTBIT_U16_BE
|
|
#define SNDRV_PCM_FMTBIT_S24 SNDRV_PCM_FMTBIT_S24_BE
|
|
#define SNDRV_PCM_FMTBIT_U24 SNDRV_PCM_FMTBIT_U24_BE
|
|
#define SNDRV_PCM_FMTBIT_S32 SNDRV_PCM_FMTBIT_S32_BE
|
|
#define SNDRV_PCM_FMTBIT_U32 SNDRV_PCM_FMTBIT_U32_BE
|
|
#define SNDRV_PCM_FMTBIT_FLOAT SNDRV_PCM_FMTBIT_FLOAT_BE
|
|
#define SNDRV_PCM_FMTBIT_FLOAT64 SNDRV_PCM_FMTBIT_FLOAT64_BE
|
|
#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE
|
|
#define SNDRV_PCM_FMTBIT_S20 SNDRV_PCM_FMTBIT_S20_BE
|
|
#define SNDRV_PCM_FMTBIT_U20 SNDRV_PCM_FMTBIT_U20_BE
|
|
#endif
|
|
|
|
#define _SNDRV_PCM_SUBFMTBIT(fmt) BIT((__force int)SNDRV_PCM_SUBFORMAT_##fmt)
|
|
#define SNDRV_PCM_SUBFMTBIT_STD _SNDRV_PCM_SUBFMTBIT(STD)
|
|
#define SNDRV_PCM_SUBFMTBIT_MSBITS_MAX _SNDRV_PCM_SUBFMTBIT(MSBITS_MAX)
|
|
#define SNDRV_PCM_SUBFMTBIT_MSBITS_20 _SNDRV_PCM_SUBFMTBIT(MSBITS_20)
|
|
#define SNDRV_PCM_SUBFMTBIT_MSBITS_24 _SNDRV_PCM_SUBFMTBIT(MSBITS_24)
|
|
|
|
struct snd_pcm_file {
|
|
struct snd_pcm_substream *substream;
|
|
int no_compat_mmap;
|
|
unsigned int user_pversion; /* supported protocol version */
|
|
};
|
|
|
|
struct snd_pcm_hw_rule;
|
|
typedef int (*snd_pcm_hw_rule_func_t)(struct snd_pcm_hw_params *params,
|
|
struct snd_pcm_hw_rule *rule);
|
|
|
|
struct snd_pcm_hw_rule {
|
|
unsigned int cond;
|
|
int var;
|
|
int deps[5];
|
|
|
|
snd_pcm_hw_rule_func_t func;
|
|
void *private;
|
|
};
|
|
|
|
struct snd_pcm_hw_constraints {
|
|
struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
|
|
SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
|
|
struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
|
|
SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
|
|
unsigned int rules_num;
|
|
unsigned int rules_all;
|
|
struct snd_pcm_hw_rule *rules;
|
|
};
|
|
|
|
static inline struct snd_mask *constrs_mask(struct snd_pcm_hw_constraints *constrs,
|
|
snd_pcm_hw_param_t var)
|
|
{
|
|
return &constrs->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK];
|
|
}
|
|
|
|
static inline struct snd_interval *constrs_interval(struct snd_pcm_hw_constraints *constrs,
|
|
snd_pcm_hw_param_t var)
|
|
{
|
|
return &constrs->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
|
|
}
|
|
|
|
struct snd_ratnum {
|
|
unsigned int num;
|
|
unsigned int den_min, den_max, den_step;
|
|
};
|
|
|
|
struct snd_ratden {
|
|
unsigned int num_min, num_max, num_step;
|
|
unsigned int den;
|
|
};
|
|
|
|
struct snd_pcm_hw_constraint_ratnums {
|
|
int nrats;
|
|
const struct snd_ratnum *rats;
|
|
};
|
|
|
|
struct snd_pcm_hw_constraint_ratdens {
|
|
int nrats;
|
|
const struct snd_ratden *rats;
|
|
};
|
|
|
|
struct snd_pcm_hw_constraint_list {
|
|
const unsigned int *list;
|
|
unsigned int count;
|
|
unsigned int mask;
|
|
};
|
|
|
|
struct snd_pcm_hw_constraint_ranges {
|
|
unsigned int count;
|
|
const struct snd_interval *ranges;
|
|
unsigned int mask;
|
|
};
|
|
|
|
/*
|
|
* userspace-provided audio timestamp config to kernel,
|
|
* structure is for internal use only and filled with dedicated unpack routine
|
|
*/
|
|
struct snd_pcm_audio_tstamp_config {
|
|
/* 5 of max 16 bits used */
|
|
u32 type_requested:4;
|
|
u32 report_delay:1; /* add total delay to A/D or D/A */
|
|
};
|
|
|
|
static inline void snd_pcm_unpack_audio_tstamp_config(__u32 data,
|
|
struct snd_pcm_audio_tstamp_config *config)
|
|
{
|
|
config->type_requested = data & 0xF;
|
|
config->report_delay = (data >> 4) & 1;
|
|
}
|
|
|
|
/*
|
|
* kernel-provided audio timestamp report to user-space
|
|
* structure is for internal use only and read by dedicated pack routine
|
|
*/
|
|
struct snd_pcm_audio_tstamp_report {
|
|
/* 6 of max 16 bits used for bit-fields */
|
|
|
|
/* for backwards compatibility */
|
|
u32 valid:1;
|
|
|
|
/* actual type if hardware could not support requested timestamp */
|
|
u32 actual_type:4;
|
|
|
|
/* accuracy represented in ns units */
|
|
u32 accuracy_report:1; /* 0 if accuracy unknown, 1 if accuracy field is valid */
|
|
u32 accuracy; /* up to 4.29s, will be packed in separate field */
|
|
};
|
|
|
|
static inline void snd_pcm_pack_audio_tstamp_report(__u32 *data, __u32 *accuracy,
|
|
const struct snd_pcm_audio_tstamp_report *report)
|
|
{
|
|
u32 tmp;
|
|
|
|
tmp = report->accuracy_report;
|
|
tmp <<= 4;
|
|
tmp |= report->actual_type;
|
|
tmp <<= 1;
|
|
tmp |= report->valid;
|
|
|
|
*data &= 0xffff; /* zero-clear MSBs */
|
|
*data |= (tmp << 16);
|
|
*accuracy = report->accuracy;
|
|
}
|
|
|
|
|
|
struct snd_pcm_runtime {
|
|
/* -- Status -- */
|
|
snd_pcm_state_t state; /* stream state */
|
|
snd_pcm_state_t suspended_state; /* suspended stream state */
|
|
struct snd_pcm_substream *trigger_master;
|
|
struct timespec64 trigger_tstamp; /* trigger timestamp */
|
|
bool trigger_tstamp_latched; /* trigger timestamp latched in low-level driver/hardware */
|
|
int overrange;
|
|
snd_pcm_uframes_t avail_max;
|
|
snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */
|
|
snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */
|
|
unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */
|
|
unsigned long hw_ptr_buffer_jiffies; /* buffer time in jiffies */
|
|
snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */
|
|
u64 hw_ptr_wrap; /* offset for hw_ptr due to boundary wrap-around */
|
|
|
|
/* -- HW params -- */
|
|
snd_pcm_access_t access; /* access mode */
|
|
snd_pcm_format_t format; /* SNDRV_PCM_FORMAT_* */
|
|
snd_pcm_subformat_t subformat; /* subformat */
|
|
unsigned int rate; /* rate in Hz */
|
|
unsigned int channels; /* channels */
|
|
snd_pcm_uframes_t period_size; /* period size */
|
|
unsigned int periods; /* periods */
|
|
snd_pcm_uframes_t buffer_size; /* buffer size */
|
|
snd_pcm_uframes_t min_align; /* Min alignment for the format */
|
|
size_t byte_align;
|
|
unsigned int frame_bits;
|
|
unsigned int sample_bits;
|
|
unsigned int info;
|
|
unsigned int rate_num;
|
|
unsigned int rate_den;
|
|
unsigned int no_period_wakeup: 1;
|
|
|
|
/* -- SW params; see struct snd_pcm_sw_params for comments -- */
|
|
int tstamp_mode;
|
|
unsigned int period_step;
|
|
snd_pcm_uframes_t start_threshold;
|
|
snd_pcm_uframes_t stop_threshold;
|
|
snd_pcm_uframes_t silence_threshold;
|
|
snd_pcm_uframes_t silence_size;
|
|
snd_pcm_uframes_t boundary;
|
|
|
|
/* internal data of auto-silencer */
|
|
snd_pcm_uframes_t silence_start; /* starting pointer to silence area */
|
|
snd_pcm_uframes_t silence_filled; /* already filled part of silence area */
|
|
|
|
bool std_sync_id; /* hardware synchronization - standard per card ID */
|
|
|
|
/* -- mmap -- */
|
|
struct snd_pcm_mmap_status *status;
|
|
struct snd_pcm_mmap_control *control;
|
|
|
|
/* -- locking / scheduling -- */
|
|
snd_pcm_uframes_t twake; /* do transfer (!poll) wakeup if non-zero */
|
|
wait_queue_head_t sleep; /* poll sleep */
|
|
wait_queue_head_t tsleep; /* transfer sleep */
|
|
struct snd_fasync *fasync;
|
|
bool stop_operating; /* sync_stop will be called */
|
|
struct mutex buffer_mutex; /* protect for buffer changes */
|
|
atomic_t buffer_accessing; /* >0: in r/w operation, <0: blocked */
|
|
|
|
/* -- private section -- */
|
|
void *private_data;
|
|
void (*private_free)(struct snd_pcm_runtime *runtime);
|
|
|
|
/* -- hardware description -- */
|
|
struct snd_pcm_hardware hw;
|
|
struct snd_pcm_hw_constraints hw_constraints;
|
|
|
|
/* -- timer -- */
|
|
unsigned int timer_resolution; /* timer resolution */
|
|
int tstamp_type; /* timestamp type */
|
|
|
|
/* -- DMA -- */
|
|
unsigned char *dma_area; /* DMA area */
|
|
dma_addr_t dma_addr; /* physical bus address (not accessible from main CPU) */
|
|
size_t dma_bytes; /* size of DMA area */
|
|
|
|
struct snd_dma_buffer *dma_buffer_p; /* allocated buffer */
|
|
unsigned int buffer_changed:1; /* buffer allocation changed; set only in managed mode */
|
|
|
|
/* -- audio timestamp config -- */
|
|
struct snd_pcm_audio_tstamp_config audio_tstamp_config;
|
|
struct snd_pcm_audio_tstamp_report audio_tstamp_report;
|
|
struct timespec64 driver_tstamp;
|
|
|
|
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
|
|
/* -- OSS things -- */
|
|
struct snd_pcm_oss_runtime oss;
|
|
#endif
|
|
|
|
ANDROID_KABI_RESERVE(1);
|
|
ANDROID_KABI_RESERVE(2);
|
|
};
|
|
|
|
struct snd_pcm_group { /* keep linked substreams */
|
|
spinlock_t lock;
|
|
struct mutex mutex;
|
|
struct list_head substreams;
|
|
refcount_t refs;
|
|
};
|
|
|
|
struct pid;
|
|
|
|
struct snd_pcm_substream {
|
|
struct snd_pcm *pcm;
|
|
struct snd_pcm_str *pstr;
|
|
void *private_data; /* copied from pcm->private_data */
|
|
int number;
|
|
char name[32]; /* substream name */
|
|
int stream; /* stream (direction) */
|
|
struct pm_qos_request latency_pm_qos_req; /* pm_qos request */
|
|
size_t buffer_bytes_max; /* limit ring buffer size */
|
|
struct snd_dma_buffer dma_buffer;
|
|
size_t dma_max;
|
|
/* -- hardware operations -- */
|
|
const struct snd_pcm_ops *ops;
|
|
/* -- runtime information -- */
|
|
struct snd_pcm_runtime *runtime;
|
|
/* -- timer section -- */
|
|
struct snd_timer *timer; /* timer */
|
|
unsigned timer_running: 1; /* time is running */
|
|
long wait_time; /* time in ms for R/W to wait for avail */
|
|
/* -- next substream -- */
|
|
struct snd_pcm_substream *next;
|
|
/* -- linked substreams -- */
|
|
struct list_head link_list; /* linked list member */
|
|
struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */
|
|
struct snd_pcm_group *group; /* pointer to current group */
|
|
/* -- assigned files -- */
|
|
int ref_count;
|
|
atomic_t mmap_count;
|
|
unsigned int f_flags;
|
|
void (*pcm_release)(struct snd_pcm_substream *);
|
|
struct pid *pid;
|
|
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
|
|
/* -- OSS things -- */
|
|
struct snd_pcm_oss_substream oss;
|
|
#endif
|
|
#ifdef CONFIG_SND_VERBOSE_PROCFS
|
|
struct snd_info_entry *proc_root;
|
|
#endif /* CONFIG_SND_VERBOSE_PROCFS */
|
|
/* misc flags */
|
|
unsigned int hw_opened: 1;
|
|
unsigned int managed_buffer_alloc:1;
|
|
#ifdef CONFIG_SND_PCM_XRUN_DEBUG
|
|
unsigned int xrun_counter; /* number of times xrun happens */
|
|
#endif /* CONFIG_SND_PCM_XRUN_DEBUG */
|
|
|
|
ANDROID_KABI_RESERVE(1);
|
|
};
|
|
|
|
#define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0)
|
|
|
|
|
|
struct snd_pcm_str {
|
|
int stream; /* stream (direction) */
|
|
struct snd_pcm *pcm;
|
|
/* -- substreams -- */
|
|
unsigned int substream_count;
|
|
unsigned int substream_opened;
|
|
struct snd_pcm_substream *substream;
|
|
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
|
|
/* -- OSS things -- */
|
|
struct snd_pcm_oss_stream oss;
|
|
#endif
|
|
#ifdef CONFIG_SND_VERBOSE_PROCFS
|
|
struct snd_info_entry *proc_root;
|
|
#ifdef CONFIG_SND_PCM_XRUN_DEBUG
|
|
unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */
|
|
#endif
|
|
#endif
|
|
struct snd_kcontrol *chmap_kctl; /* channel-mapping controls */
|
|
struct device *dev;
|
|
|
|
ANDROID_KABI_RESERVE(1);
|
|
};
|
|
|
|
struct snd_pcm {
|
|
struct snd_card *card;
|
|
struct list_head list;
|
|
int device; /* device number */
|
|
unsigned int info_flags;
|
|
unsigned short dev_class;
|
|
unsigned short dev_subclass;
|
|
char id[64];
|
|
char name[80];
|
|
struct snd_pcm_str streams[2];
|
|
struct mutex open_mutex;
|
|
wait_queue_head_t open_wait;
|
|
void *private_data;
|
|
void (*private_free) (struct snd_pcm *pcm);
|
|
bool internal; /* pcm is for internal use only */
|
|
bool nonatomic; /* whole PCM operations are in non-atomic context */
|
|
bool no_device_suspend; /* don't invoke device PM suspend */
|
|
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
|
|
struct snd_pcm_oss oss;
|
|
#endif
|
|
|
|
ANDROID_KABI_RESERVE(1);
|
|
};
|
|
|
|
/*
|
|
* Registering
|
|
*/
|
|
|
|
extern const struct file_operations snd_pcm_f_ops[2];
|
|
|
|
int snd_pcm_new(struct snd_card *card, const char *id, int device,
|
|
int playback_count, int capture_count,
|
|
struct snd_pcm **rpcm);
|
|
int snd_pcm_new_internal(struct snd_card *card, const char *id, int device,
|
|
int playback_count, int capture_count,
|
|
struct snd_pcm **rpcm);
|
|
int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count);
|
|
|
|
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
|
|
struct snd_pcm_notify {
|
|
int (*n_register) (struct snd_pcm * pcm);
|
|
int (*n_disconnect) (struct snd_pcm * pcm);
|
|
int (*n_unregister) (struct snd_pcm * pcm);
|
|
struct list_head list;
|
|
};
|
|
int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree);
|
|
#endif
|
|
|
|
/*
|
|
* Native I/O
|
|
*/
|
|
|
|
int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info);
|
|
int snd_pcm_info_user(struct snd_pcm_substream *substream,
|
|
struct snd_pcm_info __user *info);
|
|
int snd_pcm_status64(struct snd_pcm_substream *substream,
|
|
struct snd_pcm_status64 *status);
|
|
int snd_pcm_start(struct snd_pcm_substream *substream);
|
|
int snd_pcm_stop(struct snd_pcm_substream *substream, snd_pcm_state_t status);
|
|
int snd_pcm_drain_done(struct snd_pcm_substream *substream);
|
|
int snd_pcm_stop_xrun(struct snd_pcm_substream *substream);
|
|
#ifdef CONFIG_PM
|
|
int snd_pcm_suspend_all(struct snd_pcm *pcm);
|
|
#else
|
|
static inline int snd_pcm_suspend_all(struct snd_pcm *pcm)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif
|
|
int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
|
|
int snd_pcm_open_substream(struct snd_pcm *pcm, int stream, struct file *file,
|
|
struct snd_pcm_substream **rsubstream);
|
|
void snd_pcm_release_substream(struct snd_pcm_substream *substream);
|
|
int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, struct file *file,
|
|
struct snd_pcm_substream **rsubstream);
|
|
void snd_pcm_detach_substream(struct snd_pcm_substream *substream);
|
|
int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area);
|
|
|
|
|
|
#ifdef CONFIG_SND_DEBUG
|
|
void snd_pcm_debug_name(struct snd_pcm_substream *substream,
|
|
char *name, size_t len);
|
|
#else
|
|
static inline void
|
|
snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size)
|
|
{
|
|
*buf = 0;
|
|
}
|
|
#endif
|
|
|
|
/*
|
|
* PCM library
|
|
*/
|
|
|
|
/**
|
|
* snd_pcm_stream_linked - Check whether the substream is linked with others
|
|
* @substream: substream to check
|
|
*
|
|
* Return: true if the given substream is being linked with others
|
|
*/
|
|
static inline int snd_pcm_stream_linked(struct snd_pcm_substream *substream)
|
|
{
|
|
return substream->group != &substream->self_group;
|
|
}
|
|
|
|
void snd_pcm_stream_lock(struct snd_pcm_substream *substream);
|
|
void snd_pcm_stream_unlock(struct snd_pcm_substream *substream);
|
|
void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream);
|
|
void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream);
|
|
unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream);
|
|
unsigned long _snd_pcm_stream_lock_irqsave_nested(struct snd_pcm_substream *substream);
|
|
|
|
/**
|
|
* snd_pcm_stream_lock_irqsave - Lock the PCM stream
|
|
* @substream: PCM substream
|
|
* @flags: irq flags
|
|
*
|
|
* This locks the PCM stream like snd_pcm_stream_lock() but with the local
|
|
* IRQ (only when nonatomic is false). In nonatomic case, this is identical
|
|
* as snd_pcm_stream_lock().
|
|
*/
|
|
#define snd_pcm_stream_lock_irqsave(substream, flags) \
|
|
do { \
|
|
typecheck(unsigned long, flags); \
|
|
flags = _snd_pcm_stream_lock_irqsave(substream); \
|
|
} while (0)
|
|
void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream,
|
|
unsigned long flags);
|
|
|
|
/**
|
|
* snd_pcm_stream_lock_irqsave_nested - Single-nested PCM stream locking
|
|
* @substream: PCM substream
|
|
* @flags: irq flags
|
|
*
|
|
* This locks the PCM stream like snd_pcm_stream_lock_irqsave() but with
|
|
* the single-depth lockdep subclass.
|
|
*/
|
|
#define snd_pcm_stream_lock_irqsave_nested(substream, flags) \
|
|
do { \
|
|
typecheck(unsigned long, flags); \
|
|
flags = _snd_pcm_stream_lock_irqsave_nested(substream); \
|
|
} while (0)
|
|
|
|
/* definitions for guard(); use like guard(pcm_stream_lock) */
|
|
DEFINE_LOCK_GUARD_1(pcm_stream_lock, struct snd_pcm_substream,
|
|
snd_pcm_stream_lock(_T->lock),
|
|
snd_pcm_stream_unlock(_T->lock))
|
|
DEFINE_LOCK_GUARD_1(pcm_stream_lock_irq, struct snd_pcm_substream,
|
|
snd_pcm_stream_lock_irq(_T->lock),
|
|
snd_pcm_stream_unlock_irq(_T->lock))
|
|
DEFINE_LOCK_GUARD_1(pcm_stream_lock_irqsave, struct snd_pcm_substream,
|
|
snd_pcm_stream_lock_irqsave(_T->lock, _T->flags),
|
|
snd_pcm_stream_unlock_irqrestore(_T->lock, _T->flags),
|
|
unsigned long flags)
|
|
|
|
/**
|
|
* snd_pcm_group_for_each_entry - iterate over the linked substreams
|
|
* @s: the iterator
|
|
* @substream: the substream
|
|
*
|
|
* Iterate over the all linked substreams to the given @substream.
|
|
* When @substream isn't linked with any others, this gives returns @substream
|
|
* itself once.
|
|
*/
|
|
#define snd_pcm_group_for_each_entry(s, substream) \
|
|
list_for_each_entry(s, &substream->group->substreams, link_list)
|
|
|
|
#define for_each_pcm_streams(stream) \
|
|
for (stream = SNDRV_PCM_STREAM_PLAYBACK; \
|
|
stream <= SNDRV_PCM_STREAM_LAST; \
|
|
stream++)
|
|
|
|
/**
|
|
* snd_pcm_running - Check whether the substream is in a running state
|
|
* @substream: substream to check
|
|
*
|
|
* Return: true if the given substream is in the state RUNNING, or in the
|
|
* state DRAINING for playback.
|
|
*/
|
|
static inline int snd_pcm_running(struct snd_pcm_substream *substream)
|
|
{
|
|
return (substream->runtime->state == SNDRV_PCM_STATE_RUNNING ||
|
|
(substream->runtime->state == SNDRV_PCM_STATE_DRAINING &&
|
|
substream->stream == SNDRV_PCM_STREAM_PLAYBACK));
|
|
}
|
|
|
|
/**
|
|
* __snd_pcm_set_state - Change the current PCM state
|
|
* @runtime: PCM runtime to set
|
|
* @state: the current state to set
|
|
*
|
|
* Call within the stream lock
|
|
*/
|
|
static inline void __snd_pcm_set_state(struct snd_pcm_runtime *runtime,
|
|
snd_pcm_state_t state)
|
|
{
|
|
runtime->state = state;
|
|
runtime->status->state = state; /* copy for mmap */
|
|
}
|
|
|
|
/**
|
|
* bytes_to_samples - Unit conversion of the size from bytes to samples
|
|
* @runtime: PCM runtime instance
|
|
* @size: size in bytes
|
|
*
|
|
* Return: the size in samples
|
|
*/
|
|
static inline ssize_t bytes_to_samples(struct snd_pcm_runtime *runtime, ssize_t size)
|
|
{
|
|
return size * 8 / runtime->sample_bits;
|
|
}
|
|
|
|
/**
|
|
* bytes_to_frames - Unit conversion of the size from bytes to frames
|
|
* @runtime: PCM runtime instance
|
|
* @size: size in bytes
|
|
*
|
|
* Return: the size in frames
|
|
*/
|
|
static inline snd_pcm_sframes_t bytes_to_frames(struct snd_pcm_runtime *runtime, ssize_t size)
|
|
{
|
|
return size * 8 / runtime->frame_bits;
|
|
}
|
|
|
|
/**
|
|
* samples_to_bytes - Unit conversion of the size from samples to bytes
|
|
* @runtime: PCM runtime instance
|
|
* @size: size in samples
|
|
*
|
|
* Return: the byte size
|
|
*/
|
|
static inline ssize_t samples_to_bytes(struct snd_pcm_runtime *runtime, ssize_t size)
|
|
{
|
|
return size * runtime->sample_bits / 8;
|
|
}
|
|
|
|
/**
|
|
* frames_to_bytes - Unit conversion of the size from frames to bytes
|
|
* @runtime: PCM runtime instance
|
|
* @size: size in frames
|
|
*
|
|
* Return: the byte size
|
|
*/
|
|
static inline ssize_t frames_to_bytes(struct snd_pcm_runtime *runtime, snd_pcm_sframes_t size)
|
|
{
|
|
return size * runtime->frame_bits / 8;
|
|
}
|
|
|
|
/**
|
|
* frame_aligned - Check whether the byte size is aligned to frames
|
|
* @runtime: PCM runtime instance
|
|
* @bytes: size in bytes
|
|
*
|
|
* Return: true if aligned, or false if not
|
|
*/
|
|
static inline int frame_aligned(struct snd_pcm_runtime *runtime, ssize_t bytes)
|
|
{
|
|
return bytes % runtime->byte_align == 0;
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_lib_buffer_bytes - Get the buffer size of the current PCM in bytes
|
|
* @substream: PCM substream
|
|
*
|
|
* Return: buffer byte size
|
|
*/
|
|
static inline size_t snd_pcm_lib_buffer_bytes(struct snd_pcm_substream *substream)
|
|
{
|
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
|
return frames_to_bytes(runtime, runtime->buffer_size);
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_lib_period_bytes - Get the period size of the current PCM in bytes
|
|
* @substream: PCM substream
|
|
*
|
|
* Return: period byte size
|
|
*/
|
|
static inline size_t snd_pcm_lib_period_bytes(struct snd_pcm_substream *substream)
|
|
{
|
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
|
return frames_to_bytes(runtime, runtime->period_size);
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_playback_avail - Get the available (writable) space for playback
|
|
* @runtime: PCM runtime instance
|
|
*
|
|
* Result is between 0 ... (boundary - 1)
|
|
*
|
|
* Return: available frame size
|
|
*/
|
|
static inline snd_pcm_uframes_t snd_pcm_playback_avail(struct snd_pcm_runtime *runtime)
|
|
{
|
|
snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr;
|
|
if (avail < 0)
|
|
avail += runtime->boundary;
|
|
else if ((snd_pcm_uframes_t) avail >= runtime->boundary)
|
|
avail -= runtime->boundary;
|
|
return avail;
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_capture_avail - Get the available (readable) space for capture
|
|
* @runtime: PCM runtime instance
|
|
*
|
|
* Result is between 0 ... (boundary - 1)
|
|
*
|
|
* Return: available frame size
|
|
*/
|
|
static inline snd_pcm_uframes_t snd_pcm_capture_avail(struct snd_pcm_runtime *runtime)
|
|
{
|
|
snd_pcm_sframes_t avail = runtime->status->hw_ptr - runtime->control->appl_ptr;
|
|
if (avail < 0)
|
|
avail += runtime->boundary;
|
|
return avail;
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_playback_hw_avail - Get the queued space for playback
|
|
* @runtime: PCM runtime instance
|
|
*
|
|
* Return: available frame size
|
|
*/
|
|
static inline snd_pcm_sframes_t snd_pcm_playback_hw_avail(struct snd_pcm_runtime *runtime)
|
|
{
|
|
return runtime->buffer_size - snd_pcm_playback_avail(runtime);
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_capture_hw_avail - Get the free space for capture
|
|
* @runtime: PCM runtime instance
|
|
*
|
|
* Return: available frame size
|
|
*/
|
|
static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(struct snd_pcm_runtime *runtime)
|
|
{
|
|
return runtime->buffer_size - snd_pcm_capture_avail(runtime);
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_playback_ready - check whether the playback buffer is available
|
|
* @substream: the pcm substream instance
|
|
*
|
|
* Checks whether enough free space is available on the playback buffer.
|
|
*
|
|
* Return: Non-zero if available, or zero if not.
|
|
*/
|
|
static inline int snd_pcm_playback_ready(struct snd_pcm_substream *substream)
|
|
{
|
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
|
return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min;
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_capture_ready - check whether the capture buffer is available
|
|
* @substream: the pcm substream instance
|
|
*
|
|
* Checks whether enough capture data is available on the capture buffer.
|
|
*
|
|
* Return: Non-zero if available, or zero if not.
|
|
*/
|
|
static inline int snd_pcm_capture_ready(struct snd_pcm_substream *substream)
|
|
{
|
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
|
return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min;
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_playback_data - check whether any data exists on the playback buffer
|
|
* @substream: the pcm substream instance
|
|
*
|
|
* Checks whether any data exists on the playback buffer.
|
|
*
|
|
* Return: Non-zero if any data exists, or zero if not. If stop_threshold
|
|
* is bigger or equal to boundary, then this function returns always non-zero.
|
|
*/
|
|
static inline int snd_pcm_playback_data(struct snd_pcm_substream *substream)
|
|
{
|
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
|
|
|
if (runtime->stop_threshold >= runtime->boundary)
|
|
return 1;
|
|
return snd_pcm_playback_avail(runtime) < runtime->buffer_size;
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_playback_empty - check whether the playback buffer is empty
|
|
* @substream: the pcm substream instance
|
|
*
|
|
* Checks whether the playback buffer is empty.
|
|
*
|
|
* Return: Non-zero if empty, or zero if not.
|
|
*/
|
|
static inline int snd_pcm_playback_empty(struct snd_pcm_substream *substream)
|
|
{
|
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
|
return snd_pcm_playback_avail(runtime) >= runtime->buffer_size;
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_capture_empty - check whether the capture buffer is empty
|
|
* @substream: the pcm substream instance
|
|
*
|
|
* Checks whether the capture buffer is empty.
|
|
*
|
|
* Return: Non-zero if empty, or zero if not.
|
|
*/
|
|
static inline int snd_pcm_capture_empty(struct snd_pcm_substream *substream)
|
|
{
|
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
|
return snd_pcm_capture_avail(runtime) == 0;
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_trigger_done - Mark the master substream
|
|
* @substream: the pcm substream instance
|
|
* @master: the linked master substream
|
|
*
|
|
* When multiple substreams of the same card are linked and the hardware
|
|
* supports the single-shot operation, the driver calls this in the loop
|
|
* in snd_pcm_group_for_each_entry() for marking the substream as "done".
|
|
* Then most of trigger operations are performed only to the given master
|
|
* substream.
|
|
*
|
|
* The trigger_master mark is cleared at timestamp updates at the end
|
|
* of trigger operations.
|
|
*/
|
|
static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream,
|
|
struct snd_pcm_substream *master)
|
|
{
|
|
substream->runtime->trigger_master = master;
|
|
}
|
|
|
|
static inline int hw_is_mask(int var)
|
|
{
|
|
return var >= SNDRV_PCM_HW_PARAM_FIRST_MASK &&
|
|
var <= SNDRV_PCM_HW_PARAM_LAST_MASK;
|
|
}
|
|
|
|
static inline int hw_is_interval(int var)
|
|
{
|
|
return var >= SNDRV_PCM_HW_PARAM_FIRST_INTERVAL &&
|
|
var <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL;
|
|
}
|
|
|
|
static inline struct snd_mask *hw_param_mask(struct snd_pcm_hw_params *params,
|
|
snd_pcm_hw_param_t var)
|
|
{
|
|
return ¶ms->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK];
|
|
}
|
|
|
|
static inline struct snd_interval *hw_param_interval(struct snd_pcm_hw_params *params,
|
|
snd_pcm_hw_param_t var)
|
|
{
|
|
return ¶ms->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
|
|
}
|
|
|
|
static inline const struct snd_mask *hw_param_mask_c(const struct snd_pcm_hw_params *params,
|
|
snd_pcm_hw_param_t var)
|
|
{
|
|
return ¶ms->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK];
|
|
}
|
|
|
|
static inline const struct snd_interval *hw_param_interval_c(const struct snd_pcm_hw_params *params,
|
|
snd_pcm_hw_param_t var)
|
|
{
|
|
return ¶ms->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
|
|
}
|
|
|
|
/**
|
|
* params_channels - Get the number of channels from the hw params
|
|
* @p: hw params
|
|
*
|
|
* Return: the number of channels
|
|
*/
|
|
static inline unsigned int params_channels(const struct snd_pcm_hw_params *p)
|
|
{
|
|
return hw_param_interval_c(p, SNDRV_PCM_HW_PARAM_CHANNELS)->min;
|
|
}
|
|
|
|
/**
|
|
* params_rate - Get the sample rate from the hw params
|
|
* @p: hw params
|
|
*
|
|
* Return: the sample rate
|
|
*/
|
|
static inline unsigned int params_rate(const struct snd_pcm_hw_params *p)
|
|
{
|
|
return hw_param_interval_c(p, SNDRV_PCM_HW_PARAM_RATE)->min;
|
|
}
|
|
|
|
/**
|
|
* params_period_size - Get the period size (in frames) from the hw params
|
|
* @p: hw params
|
|
*
|
|
* Return: the period size in frames
|
|
*/
|
|
static inline unsigned int params_period_size(const struct snd_pcm_hw_params *p)
|
|
{
|
|
return hw_param_interval_c(p, SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->min;
|
|
}
|
|
|
|
/**
|
|
* params_periods - Get the number of periods from the hw params
|
|
* @p: hw params
|
|
*
|
|
* Return: the number of periods
|
|
*/
|
|
static inline unsigned int params_periods(const struct snd_pcm_hw_params *p)
|
|
{
|
|
return hw_param_interval_c(p, SNDRV_PCM_HW_PARAM_PERIODS)->min;
|
|
}
|
|
|
|
/**
|
|
* params_buffer_size - Get the buffer size (in frames) from the hw params
|
|
* @p: hw params
|
|
*
|
|
* Return: the buffer size in frames
|
|
*/
|
|
static inline unsigned int params_buffer_size(const struct snd_pcm_hw_params *p)
|
|
{
|
|
return hw_param_interval_c(p, SNDRV_PCM_HW_PARAM_BUFFER_SIZE)->min;
|
|
}
|
|
|
|
/**
|
|
* params_buffer_bytes - Get the buffer size (in bytes) from the hw params
|
|
* @p: hw params
|
|
*
|
|
* Return: the buffer size in bytes
|
|
*/
|
|
static inline unsigned int params_buffer_bytes(const struct snd_pcm_hw_params *p)
|
|
{
|
|
return hw_param_interval_c(p, SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->min;
|
|
}
|
|
|
|
int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v);
|
|
int snd_interval_list(struct snd_interval *i, unsigned int count,
|
|
const unsigned int *list, unsigned int mask);
|
|
int snd_interval_ranges(struct snd_interval *i, unsigned int count,
|
|
const struct snd_interval *list, unsigned int mask);
|
|
int snd_interval_ratnum(struct snd_interval *i,
|
|
unsigned int rats_count, const struct snd_ratnum *rats,
|
|
unsigned int *nump, unsigned int *denp);
|
|
|
|
void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params);
|
|
void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var);
|
|
|
|
int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
|
|
|
|
int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
|
|
u_int64_t mask);
|
|
int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
|
|
unsigned int min, unsigned int max);
|
|
int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var);
|
|
int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime,
|
|
unsigned int cond,
|
|
snd_pcm_hw_param_t var,
|
|
const struct snd_pcm_hw_constraint_list *l);
|
|
int snd_pcm_hw_constraint_ranges(struct snd_pcm_runtime *runtime,
|
|
unsigned int cond,
|
|
snd_pcm_hw_param_t var,
|
|
const struct snd_pcm_hw_constraint_ranges *r);
|
|
int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime,
|
|
unsigned int cond,
|
|
snd_pcm_hw_param_t var,
|
|
const struct snd_pcm_hw_constraint_ratnums *r);
|
|
int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime,
|
|
unsigned int cond,
|
|
snd_pcm_hw_param_t var,
|
|
const struct snd_pcm_hw_constraint_ratdens *r);
|
|
int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime,
|
|
unsigned int cond,
|
|
unsigned int width,
|
|
unsigned int msbits);
|
|
int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime,
|
|
unsigned int cond,
|
|
snd_pcm_hw_param_t var,
|
|
unsigned long step);
|
|
int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime,
|
|
unsigned int cond,
|
|
snd_pcm_hw_param_t var);
|
|
int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime,
|
|
unsigned int base_rate);
|
|
int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime,
|
|
unsigned int cond,
|
|
int var,
|
|
snd_pcm_hw_rule_func_t func, void *private,
|
|
int dep, ...);
|
|
|
|
/**
|
|
* snd_pcm_hw_constraint_single() - Constrain parameter to a single value
|
|
* @runtime: PCM runtime instance
|
|
* @var: The hw_params variable to constrain
|
|
* @val: The value to constrain to
|
|
*
|
|
* Return: Positive if the value is changed, zero if it's not changed, or a
|
|
* negative error code.
|
|
*/
|
|
static inline int snd_pcm_hw_constraint_single(
|
|
struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
|
|
unsigned int val)
|
|
{
|
|
return snd_pcm_hw_constraint_minmax(runtime, var, val, val);
|
|
}
|
|
|
|
int snd_pcm_format_signed(snd_pcm_format_t format);
|
|
int snd_pcm_format_unsigned(snd_pcm_format_t format);
|
|
int snd_pcm_format_linear(snd_pcm_format_t format);
|
|
int snd_pcm_format_little_endian(snd_pcm_format_t format);
|
|
int snd_pcm_format_big_endian(snd_pcm_format_t format);
|
|
#if 0 /* just for kernel-doc */
|
|
/**
|
|
* snd_pcm_format_cpu_endian - Check the PCM format is CPU-endian
|
|
* @format: the format to check
|
|
*
|
|
* Return: 1 if the given PCM format is CPU-endian, 0 if
|
|
* opposite, or a negative error code if endian not specified.
|
|
*/
|
|
int snd_pcm_format_cpu_endian(snd_pcm_format_t format);
|
|
#endif /* DocBook */
|
|
#ifdef SNDRV_LITTLE_ENDIAN
|
|
#define snd_pcm_format_cpu_endian(format) snd_pcm_format_little_endian(format)
|
|
#else
|
|
#define snd_pcm_format_cpu_endian(format) snd_pcm_format_big_endian(format)
|
|
#endif
|
|
int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */
|
|
int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */
|
|
ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
|
|
const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format);
|
|
int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames);
|
|
|
|
void snd_pcm_set_ops(struct snd_pcm * pcm, int direction,
|
|
const struct snd_pcm_ops *ops);
|
|
void snd_pcm_set_sync_per_card(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params,
|
|
const unsigned char *id, unsigned int len);
|
|
/**
|
|
* snd_pcm_set_sync - set the PCM sync id
|
|
* @substream: the pcm substream
|
|
*
|
|
* Use the default PCM sync identifier for the specific card.
|
|
*/
|
|
static inline void snd_pcm_set_sync(struct snd_pcm_substream *substream)
|
|
{
|
|
substream->runtime->std_sync_id = true;
|
|
}
|
|
int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
|
|
unsigned int cmd, void *arg);
|
|
void snd_pcm_period_elapsed_under_stream_lock(struct snd_pcm_substream *substream);
|
|
void snd_pcm_period_elapsed(struct snd_pcm_substream *substream);
|
|
snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
|
|
void *buf, bool interleaved,
|
|
snd_pcm_uframes_t frames, bool in_kernel);
|
|
|
|
static inline snd_pcm_sframes_t
|
|
snd_pcm_lib_write(struct snd_pcm_substream *substream,
|
|
const void __user *buf, snd_pcm_uframes_t frames)
|
|
{
|
|
return __snd_pcm_lib_xfer(substream, (void __force *)buf, true, frames, false);
|
|
}
|
|
|
|
static inline snd_pcm_sframes_t
|
|
snd_pcm_lib_read(struct snd_pcm_substream *substream,
|
|
void __user *buf, snd_pcm_uframes_t frames)
|
|
{
|
|
return __snd_pcm_lib_xfer(substream, (void __force *)buf, true, frames, false);
|
|
}
|
|
|
|
static inline snd_pcm_sframes_t
|
|
snd_pcm_lib_writev(struct snd_pcm_substream *substream,
|
|
void __user **bufs, snd_pcm_uframes_t frames)
|
|
{
|
|
return __snd_pcm_lib_xfer(substream, (void *)bufs, false, frames, false);
|
|
}
|
|
|
|
static inline snd_pcm_sframes_t
|
|
snd_pcm_lib_readv(struct snd_pcm_substream *substream,
|
|
void __user **bufs, snd_pcm_uframes_t frames)
|
|
{
|
|
return __snd_pcm_lib_xfer(substream, (void *)bufs, false, frames, false);
|
|
}
|
|
|
|
static inline snd_pcm_sframes_t
|
|
snd_pcm_kernel_write(struct snd_pcm_substream *substream,
|
|
const void *buf, snd_pcm_uframes_t frames)
|
|
{
|
|
return __snd_pcm_lib_xfer(substream, (void *)buf, true, frames, true);
|
|
}
|
|
|
|
static inline snd_pcm_sframes_t
|
|
snd_pcm_kernel_read(struct snd_pcm_substream *substream,
|
|
void *buf, snd_pcm_uframes_t frames)
|
|
{
|
|
return __snd_pcm_lib_xfer(substream, buf, true, frames, true);
|
|
}
|
|
|
|
static inline snd_pcm_sframes_t
|
|
snd_pcm_kernel_writev(struct snd_pcm_substream *substream,
|
|
void **bufs, snd_pcm_uframes_t frames)
|
|
{
|
|
return __snd_pcm_lib_xfer(substream, bufs, false, frames, true);
|
|
}
|
|
|
|
static inline snd_pcm_sframes_t
|
|
snd_pcm_kernel_readv(struct snd_pcm_substream *substream,
|
|
void **bufs, snd_pcm_uframes_t frames)
|
|
{
|
|
return __snd_pcm_lib_xfer(substream, bufs, false, frames, true);
|
|
}
|
|
|
|
int snd_pcm_hw_limit_rates(struct snd_pcm_hardware *hw);
|
|
|
|
static inline int
|
|
snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime)
|
|
{
|
|
return snd_pcm_hw_limit_rates(&runtime->hw);
|
|
}
|
|
|
|
unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate);
|
|
unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit);
|
|
unsigned int snd_pcm_rate_mask_intersect(unsigned int rates_a,
|
|
unsigned int rates_b);
|
|
unsigned int snd_pcm_rate_range_to_bits(unsigned int rate_min,
|
|
unsigned int rate_max);
|
|
|
|
/**
|
|
* snd_pcm_set_runtime_buffer - Set the PCM runtime buffer
|
|
* @substream: PCM substream to set
|
|
* @bufp: the buffer information, NULL to clear
|
|
*
|
|
* Copy the buffer information to runtime->dma_buffer when @bufp is non-NULL.
|
|
* Otherwise it clears the current buffer information.
|
|
*/
|
|
static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream,
|
|
struct snd_dma_buffer *bufp)
|
|
{
|
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
|
if (bufp) {
|
|
runtime->dma_buffer_p = bufp;
|
|
runtime->dma_area = bufp->area;
|
|
runtime->dma_addr = bufp->addr;
|
|
runtime->dma_bytes = bufp->bytes;
|
|
} else {
|
|
runtime->dma_buffer_p = NULL;
|
|
runtime->dma_area = NULL;
|
|
runtime->dma_addr = 0;
|
|
runtime->dma_bytes = 0;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_gettime - Fill the timespec64 depending on the timestamp mode
|
|
* @runtime: PCM runtime instance
|
|
* @tv: timespec64 to fill
|
|
*/
|
|
static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime,
|
|
struct timespec64 *tv)
|
|
{
|
|
switch (runtime->tstamp_type) {
|
|
case SNDRV_PCM_TSTAMP_TYPE_MONOTONIC:
|
|
ktime_get_ts64(tv);
|
|
break;
|
|
case SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW:
|
|
ktime_get_raw_ts64(tv);
|
|
break;
|
|
default:
|
|
ktime_get_real_ts64(tv);
|
|
break;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Memory
|
|
*/
|
|
|
|
void snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream);
|
|
void snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm);
|
|
void snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream,
|
|
int type, struct device *data,
|
|
size_t size, size_t max);
|
|
void snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm,
|
|
int type, void *data,
|
|
size_t size, size_t max);
|
|
int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size);
|
|
int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
|
|
|
|
int snd_pcm_set_managed_buffer(struct snd_pcm_substream *substream, int type,
|
|
struct device *data, size_t size, size_t max);
|
|
int snd_pcm_set_managed_buffer_all(struct snd_pcm *pcm, int type,
|
|
struct device *data,
|
|
size_t size, size_t max);
|
|
|
|
/**
|
|
* snd_pcm_set_fixed_buffer - Preallocate and set up the fixed size PCM buffer
|
|
* @substream: the pcm substream instance
|
|
* @type: DMA type (SNDRV_DMA_TYPE_*)
|
|
* @data: DMA type dependent data
|
|
* @size: the requested pre-allocation size in bytes
|
|
*
|
|
* This is a variant of snd_pcm_set_managed_buffer(), but this pre-allocates
|
|
* only the given sized buffer and doesn't allow re-allocation nor dynamic
|
|
* allocation of a larger buffer unlike the standard one.
|
|
* The function may return -ENOMEM error, hence the caller must check it.
|
|
*
|
|
* Return: zero if successful, or a negative error code
|
|
*/
|
|
static inline int __must_check
|
|
snd_pcm_set_fixed_buffer(struct snd_pcm_substream *substream, int type,
|
|
struct device *data, size_t size)
|
|
{
|
|
return snd_pcm_set_managed_buffer(substream, type, data, size, 0);
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_set_fixed_buffer_all - Preallocate and set up the fixed size PCM buffer
|
|
* @pcm: the pcm instance
|
|
* @type: DMA type (SNDRV_DMA_TYPE_*)
|
|
* @data: DMA type dependent data
|
|
* @size: the requested pre-allocation size in bytes
|
|
*
|
|
* Apply the set up of the fixed buffer via snd_pcm_set_fixed_buffer() for
|
|
* all substream. If any of allocation fails, it returns -ENOMEM, hence the
|
|
* caller must check the return value.
|
|
*
|
|
* Return: zero if successful, or a negative error code
|
|
*/
|
|
static inline int __must_check
|
|
snd_pcm_set_fixed_buffer_all(struct snd_pcm *pcm, int type,
|
|
struct device *data, size_t size)
|
|
{
|
|
return snd_pcm_set_managed_buffer_all(pcm, type, data, size, 0);
|
|
}
|
|
|
|
#define snd_pcm_get_dma_buf(substream) ((substream)->runtime->dma_buffer_p)
|
|
|
|
/**
|
|
* snd_pcm_sgbuf_get_addr - Get the DMA address at the corresponding offset
|
|
* @substream: PCM substream
|
|
* @ofs: byte offset
|
|
*
|
|
* Return: DMA address
|
|
*/
|
|
static inline dma_addr_t
|
|
snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs)
|
|
{
|
|
return snd_sgbuf_get_addr(snd_pcm_get_dma_buf(substream), ofs);
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_sgbuf_get_chunk_size - Compute the max size that fits within the
|
|
* contig. page from the given size
|
|
* @substream: PCM substream
|
|
* @ofs: byte offset
|
|
* @size: byte size to examine
|
|
*
|
|
* Return: chunk size
|
|
*/
|
|
static inline unsigned int
|
|
snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream,
|
|
unsigned int ofs, unsigned int size)
|
|
{
|
|
return snd_sgbuf_get_chunk_size(snd_pcm_get_dma_buf(substream), ofs, size);
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_mmap_data_open - increase the mmap counter
|
|
* @area: VMA
|
|
*
|
|
* PCM mmap callback should handle this counter properly
|
|
*/
|
|
static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area)
|
|
{
|
|
struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
|
|
atomic_inc(&substream->mmap_count);
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_mmap_data_close - decrease the mmap counter
|
|
* @area: VMA
|
|
*
|
|
* PCM mmap callback should handle this counter properly
|
|
*/
|
|
static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area)
|
|
{
|
|
struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
|
|
atomic_dec(&substream->mmap_count);
|
|
}
|
|
|
|
int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
|
|
struct vm_area_struct *area);
|
|
/* mmap for io-memory area */
|
|
#if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA)
|
|
#define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP
|
|
int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_struct *area);
|
|
#else
|
|
#define SNDRV_PCM_INFO_MMAP_IOMEM 0
|
|
#define snd_pcm_lib_mmap_iomem NULL
|
|
#endif
|
|
|
|
void snd_pcm_runtime_buffer_set_silence(struct snd_pcm_runtime *runtime);
|
|
|
|
/**
|
|
* snd_pcm_limit_isa_dma_size - Get the max size fitting with ISA DMA transfer
|
|
* @dma: DMA number
|
|
* @max: pointer to store the max size
|
|
*/
|
|
static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max)
|
|
{
|
|
*max = dma < 4 ? 64 * 1024 : 128 * 1024;
|
|
}
|
|
|
|
/*
|
|
* Misc
|
|
*/
|
|
|
|
#define SNDRV_PCM_DEFAULT_CON_SPDIF (IEC958_AES0_CON_EMPHASIS_NONE|\
|
|
(IEC958_AES1_CON_ORIGINAL<<8)|\
|
|
(IEC958_AES1_CON_PCM_CODER<<8)|\
|
|
(IEC958_AES3_CON_FS_48000<<24))
|
|
|
|
const char *snd_pcm_format_name(snd_pcm_format_t format);
|
|
|
|
/**
|
|
* snd_pcm_direction_name - Get a string naming the direction of a stream
|
|
* @direction: Stream's direction, one of SNDRV_PCM_STREAM_XXX
|
|
*
|
|
* Returns a string naming the direction of the stream.
|
|
*/
|
|
static inline const char *snd_pcm_direction_name(int direction)
|
|
{
|
|
if (direction == SNDRV_PCM_STREAM_PLAYBACK)
|
|
return "Playback";
|
|
else
|
|
return "Capture";
|
|
}
|
|
|
|
/**
|
|
* snd_pcm_stream_str - Get a string naming the direction of a stream
|
|
* @substream: the pcm substream instance
|
|
*
|
|
* Return: A string naming the direction of the stream.
|
|
*/
|
|
static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream)
|
|
{
|
|
return snd_pcm_direction_name(substream->stream);
|
|
}
|
|
|
|
/*
|
|
* PCM channel-mapping control API
|
|
*/
|
|
/* array element of channel maps */
|
|
struct snd_pcm_chmap_elem {
|
|
unsigned char channels;
|
|
unsigned char map[15];
|
|
};
|
|
|
|
/* channel map information; retrieved via snd_kcontrol_chip() */
|
|
struct snd_pcm_chmap {
|
|
struct snd_pcm *pcm; /* assigned PCM instance */
|
|
int stream; /* PLAYBACK or CAPTURE */
|
|
struct snd_kcontrol *kctl;
|
|
const struct snd_pcm_chmap_elem *chmap;
|
|
unsigned int max_channels;
|
|
unsigned int channel_mask; /* optional: active channels bitmask */
|
|
void *private_data; /* optional: private data pointer */
|
|
};
|
|
|
|
/**
|
|
* snd_pcm_chmap_substream - get the PCM substream assigned to the given chmap info
|
|
* @info: chmap information
|
|
* @idx: the substream number index
|
|
*
|
|
* Return: the matched PCM substream, or NULL if not found
|
|
*/
|
|
static inline struct snd_pcm_substream *
|
|
snd_pcm_chmap_substream(struct snd_pcm_chmap *info, unsigned int idx)
|
|
{
|
|
struct snd_pcm_substream *s;
|
|
for (s = info->pcm->streams[info->stream].substream; s; s = s->next)
|
|
if (s->number == idx)
|
|
return s;
|
|
return NULL;
|
|
}
|
|
|
|
/* ALSA-standard channel maps (RL/RR prior to C/LFE) */
|
|
extern const struct snd_pcm_chmap_elem snd_pcm_std_chmaps[];
|
|
/* Other world's standard channel maps (C/LFE prior to RL/RR) */
|
|
extern const struct snd_pcm_chmap_elem snd_pcm_alt_chmaps[];
|
|
|
|
/* bit masks to be passed to snd_pcm_chmap.channel_mask field */
|
|
#define SND_PCM_CHMAP_MASK_24 ((1U << 2) | (1U << 4))
|
|
#define SND_PCM_CHMAP_MASK_246 (SND_PCM_CHMAP_MASK_24 | (1U << 6))
|
|
#define SND_PCM_CHMAP_MASK_2468 (SND_PCM_CHMAP_MASK_246 | (1U << 8))
|
|
|
|
int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream,
|
|
const struct snd_pcm_chmap_elem *chmap,
|
|
int max_channels,
|
|
unsigned long private_value,
|
|
struct snd_pcm_chmap **info_ret);
|
|
|
|
/**
|
|
* pcm_format_to_bits - Strong-typed conversion of pcm_format to bitwise
|
|
* @pcm_format: PCM format
|
|
*
|
|
* Return: 64bit mask corresponding to the given PCM format
|
|
*/
|
|
static inline u64 pcm_format_to_bits(snd_pcm_format_t pcm_format)
|
|
{
|
|
return 1ULL << (__force int) pcm_format;
|
|
}
|
|
|
|
/**
|
|
* pcm_for_each_format - helper to iterate for each format type
|
|
* @f: the iterator variable in snd_pcm_format_t type
|
|
*/
|
|
#define pcm_for_each_format(f) \
|
|
for ((f) = SNDRV_PCM_FORMAT_FIRST; \
|
|
(__force int)(f) <= (__force int)SNDRV_PCM_FORMAT_LAST; \
|
|
(f) = (__force snd_pcm_format_t)((__force int)(f) + 1))
|
|
|
|
/* printk helpers */
|
|
#define pcm_err(pcm, fmt, args...) \
|
|
dev_err((pcm)->card->dev, fmt, ##args)
|
|
#define pcm_warn(pcm, fmt, args...) \
|
|
dev_warn((pcm)->card->dev, fmt, ##args)
|
|
#define pcm_dbg(pcm, fmt, args...) \
|
|
dev_dbg((pcm)->card->dev, fmt, ##args)
|
|
|
|
/* helpers for copying between iov_iter and iomem */
|
|
int copy_to_iter_fromio(struct iov_iter *itert, const void __iomem *src,
|
|
size_t count);
|
|
int copy_from_iter_toio(void __iomem *dst, struct iov_iter *iter, size_t count);
|
|
|
|
struct snd_pcm_status64 {
|
|
snd_pcm_state_t state; /* stream state */
|
|
u8 rsvd[4];
|
|
s64 trigger_tstamp_sec; /* time when stream was started/stopped/paused */
|
|
s64 trigger_tstamp_nsec;
|
|
s64 tstamp_sec; /* reference timestamp */
|
|
s64 tstamp_nsec;
|
|
snd_pcm_uframes_t appl_ptr; /* appl ptr */
|
|
snd_pcm_uframes_t hw_ptr; /* hw ptr */
|
|
snd_pcm_sframes_t delay; /* current delay in frames */
|
|
snd_pcm_uframes_t avail; /* number of frames available */
|
|
snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */
|
|
snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */
|
|
snd_pcm_state_t suspended_state; /* suspended stream state */
|
|
__u32 audio_tstamp_data; /* needed for 64-bit alignment, used for configs/report to/from userspace */
|
|
s64 audio_tstamp_sec; /* sample counter, wall clock, PHC or on-demand sync'ed */
|
|
s64 audio_tstamp_nsec;
|
|
s64 driver_tstamp_sec; /* useful in case reference system tstamp is reported with delay */
|
|
s64 driver_tstamp_nsec;
|
|
__u32 audio_tstamp_accuracy; /* in ns units, only valid if indicated in audio_tstamp_data */
|
|
unsigned char reserved[52-4*sizeof(s64)]; /* must be filled with zero */
|
|
};
|
|
|
|
#define SNDRV_PCM_IOCTL_STATUS64 _IOR('A', 0x20, struct snd_pcm_status64)
|
|
#define SNDRV_PCM_IOCTL_STATUS_EXT64 _IOWR('A', 0x24, struct snd_pcm_status64)
|
|
|
|
struct snd_pcm_status32 {
|
|
snd_pcm_state_t state; /* stream state */
|
|
s32 trigger_tstamp_sec; /* time when stream was started/stopped/paused */
|
|
s32 trigger_tstamp_nsec;
|
|
s32 tstamp_sec; /* reference timestamp */
|
|
s32 tstamp_nsec;
|
|
u32 appl_ptr; /* appl ptr */
|
|
u32 hw_ptr; /* hw ptr */
|
|
s32 delay; /* current delay in frames */
|
|
u32 avail; /* number of frames available */
|
|
u32 avail_max; /* max frames available on hw since last status */
|
|
u32 overrange; /* count of ADC (capture) overrange detections from last status */
|
|
snd_pcm_state_t suspended_state; /* suspended stream state */
|
|
u32 audio_tstamp_data; /* needed for 64-bit alignment, used for configs/report to/from userspace */
|
|
s32 audio_tstamp_sec; /* sample counter, wall clock, PHC or on-demand sync'ed */
|
|
s32 audio_tstamp_nsec;
|
|
s32 driver_tstamp_sec; /* useful in case reference system tstamp is reported with delay */
|
|
s32 driver_tstamp_nsec;
|
|
u32 audio_tstamp_accuracy; /* in ns units, only valid if indicated in audio_tstamp_data */
|
|
unsigned char reserved[52-4*sizeof(s32)]; /* must be filled with zero */
|
|
};
|
|
|
|
#define SNDRV_PCM_IOCTL_STATUS32 _IOR('A', 0x20, struct snd_pcm_status32)
|
|
#define SNDRV_PCM_IOCTL_STATUS_EXT32 _IOWR('A', 0x24, struct snd_pcm_status32)
|
|
|
|
#endif /* __SOUND_PCM_H */
|