sound/soc/codecs/rt700-sdw.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/rt700-sdw.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/rt700-sdw.c- Extension
.c- Size
- 13677 bytes
- Lines
- 561
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/device.hlinux/mod_devicetable.hlinux/soundwire/sdw.hlinux/soundwire/sdw_type.hlinux/soundwire/sdw_registers.hlinux/module.hlinux/pm_runtime.hlinux/regmap.hsound/soc.hrt700.hrt700-sdw.h
Detected Declarations
function rt700_readable_registerfunction rt700_volatile_registerfunction rt700_sdw_readfunction rt700_sdw_writefunction rt700_update_statusfunction rt700_read_propfunction rt700_bus_configfunction rt700_interrupt_callbackfunction rt700_sdw_probefunction rt700_sdw_removefunction rt700_dev_suspendfunction rt700_dev_system_suspendfunction rt700_dev_resume
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
//
// rt700-sdw.c -- rt700 ALSA SoC audio driver
//
// Copyright(c) 2019 Realtek Semiconductor Corp.
//
//
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/mod_devicetable.h>
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_type.h>
#include <linux/soundwire/sdw_registers.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <sound/soc.h>
#include "rt700.h"
#include "rt700-sdw.h"
static bool rt700_readable_register(struct device *dev, unsigned int reg)
{
switch (reg) {
case 0x00e0:
case 0x00f0:
case 0x2000 ... 0x200e:
case 0x2012 ... 0x2016:
case 0x201a ... 0x2027:
case 0x2029 ... 0x202a:
case 0x202d ... 0x2034:
case 0x2200 ... 0x2204:
case 0x2206 ... 0x2212:
case 0x2220 ... 0x2223:
case 0x2230 ... 0x2231:
case 0x3000 ... 0x3fff:
case 0x7000 ... 0x7fff:
case 0x8300 ... 0x83ff:
case 0x9c00 ... 0x9cff:
case 0xb900 ... 0xb9ff:
case 0x75201a:
case 0x752045:
case 0x752046:
case 0x752048:
case 0x75204a:
case 0x75206b:
case 0x752080:
case 0x752081:
return true;
default:
return false;
}
}
static bool rt700_volatile_register(struct device *dev, unsigned int reg)
{
switch (reg) {
case 0x2009:
case 0x2016:
case 0x201b:
case 0x201c:
case 0x201d:
case 0x201f:
case 0x2021:
case 0x2023:
case 0x2230:
case 0x200b ... 0x200e: /* i2c read */
case 0x2012 ... 0x2015: /* HD-A read */
case 0x202d ... 0x202f: /* BRA */
case 0x2201 ... 0x2212: /* i2c debug */
case 0x2220 ... 0x2223: /* decoded HD-A */
case 0x9c00 ... 0x9cff:
case 0xb900 ... 0xb9ff:
case 0xff01:
case 0x75201a:
case 0x752046:
case 0x752080:
case 0x752081:
return true;
default:
return false;
}
}
static int rt700_sdw_read(void *context, unsigned int reg, unsigned int *val)
{
struct device *dev = context;
struct rt700_priv *rt700 = dev_get_drvdata(dev);
unsigned int sdw_data_3, sdw_data_2, sdw_data_1, sdw_data_0;
unsigned int reg2 = 0, reg3 = 0, reg4 = 0, mask, nid, val2;
Annotation
- Immediate include surface: `linux/delay.h`, `linux/device.h`, `linux/mod_devicetable.h`, `linux/soundwire/sdw.h`, `linux/soundwire/sdw_type.h`, `linux/soundwire/sdw_registers.h`, `linux/module.h`, `linux/pm_runtime.h`.
- Detected declarations: `function rt700_readable_register`, `function rt700_volatile_register`, `function rt700_sdw_read`, `function rt700_sdw_write`, `function rt700_update_status`, `function rt700_read_prop`, `function rt700_bus_config`, `function rt700_interrupt_callback`, `function rt700_sdw_probe`, `function rt700_sdw_remove`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.