drivers/soundwire/intel.c
Source file repositories/reference/linux-study-clean/drivers/soundwire/intel.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/soundwire/intel.c- Extension
.c- Size
- 29311 bytes
- Lines
- 1114
- Domain
- Driver Families
- Bucket
- drivers/soundwire
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/cleanup.hlinux/debugfs.hlinux/delay.hlinux/io.hsound/pcm_params.hlinux/pm_runtime.hsound/soc.hlinux/soundwire/sdw_registers.hlinux/soundwire/sdw.hlinux/soundwire/sdw_intel.hcadence_master.hbus.hintel.h
Detected Declarations
function intel_wait_bitfunction intel_clear_bitfunction intel_set_bitfunction intel_sprintffunction intel_reg_showfunction intel_set_m_datamodefunction intel_set_s_datamodefunction intel_debugfs_initfunction intel_debugfs_exitfunction intel_debugfs_initfunction intel_shim_master_ip_to_gluefunction intel_shim_initfunction intel_shim_check_wakefunction intel_shim_wakefunction intel_check_cmdsync_unlockedfunction intel_link_power_upfunction intel_link_power_downfunction intel_shim_sync_armfunction intel_shim_sync_go_unlockedfunction intel_shim_sync_gofunction intel_pdi_initfunction intel_pdi_get_ch_capfunction intel_pdi_get_ch_updatefunction intel_pdi_stream_ch_updatefunction intel_pdi_shim_configurefunction intel_pdi_alh_configurefunction intel_params_streamfunction intel_free_streamfunction intel_hw_paramsfunction intel_preparefunction intel_hw_freefunction intel_pcm_set_sdw_streamfunction intel_triggerfunction intel_component_probefunction intel_component_dais_suspendfunction intel_create_daifunction intel_register_dai
Annotated Snippet
static void intel_debugfs_init(struct sdw_intel *sdw) {}
static void intel_debugfs_exit(struct sdw_intel *sdw) {}
#endif /* CONFIG_DEBUG_FS */
/*
* shim ops
*/
/* this needs to be called with shim_lock */
static void intel_shim_glue_to_master_ip(struct sdw_intel *sdw)
{
void __iomem *shim = sdw->link_res->shim;
unsigned int link_id = sdw->instance;
u16 ioctl;
/* Switch to MIP from Glue logic */
ioctl = intel_readw(shim, SDW_SHIM_IOCTL(link_id));
ioctl &= ~(SDW_SHIM_IOCTL_DOE);
intel_writew(shim, SDW_SHIM_IOCTL(link_id), ioctl);
usleep_range(10, 15);
ioctl &= ~(SDW_SHIM_IOCTL_DO);
intel_writew(shim, SDW_SHIM_IOCTL(link_id), ioctl);
usleep_range(10, 15);
ioctl |= (SDW_SHIM_IOCTL_MIF);
intel_writew(shim, SDW_SHIM_IOCTL(link_id), ioctl);
usleep_range(10, 15);
ioctl &= ~(SDW_SHIM_IOCTL_BKE);
ioctl &= ~(SDW_SHIM_IOCTL_COE);
intel_writew(shim, SDW_SHIM_IOCTL(link_id), ioctl);
usleep_range(10, 15);
/* at this point Master IP has full control of the I/Os */
}
/* this needs to be called with shim_lock */
static void intel_shim_master_ip_to_glue(struct sdw_intel *sdw)
{
unsigned int link_id = sdw->instance;
void __iomem *shim = sdw->link_res->shim;
u16 ioctl;
/* Glue logic */
ioctl = intel_readw(shim, SDW_SHIM_IOCTL(link_id));
ioctl |= SDW_SHIM_IOCTL_BKE;
ioctl |= SDW_SHIM_IOCTL_COE;
intel_writew(shim, SDW_SHIM_IOCTL(link_id), ioctl);
usleep_range(10, 15);
ioctl &= ~(SDW_SHIM_IOCTL_MIF);
intel_writew(shim, SDW_SHIM_IOCTL(link_id), ioctl);
usleep_range(10, 15);
/* at this point Integration Glue has full control of the I/Os */
}
/* this needs to be called with shim_lock */
static void intel_shim_init(struct sdw_intel *sdw)
{
void __iomem *shim = sdw->link_res->shim;
unsigned int link_id = sdw->instance;
u16 ioctl = 0, act;
/* Initialize Shim */
ioctl |= SDW_SHIM_IOCTL_BKE;
intel_writew(shim, SDW_SHIM_IOCTL(link_id), ioctl);
usleep_range(10, 15);
ioctl |= SDW_SHIM_IOCTL_WPDD;
intel_writew(shim, SDW_SHIM_IOCTL(link_id), ioctl);
usleep_range(10, 15);
ioctl |= SDW_SHIM_IOCTL_DO;
intel_writew(shim, SDW_SHIM_IOCTL(link_id), ioctl);
usleep_range(10, 15);
ioctl |= SDW_SHIM_IOCTL_DOE;
intel_writew(shim, SDW_SHIM_IOCTL(link_id), ioctl);
usleep_range(10, 15);
intel_shim_glue_to_master_ip(sdw);
act = intel_readw(shim, SDW_SHIM_CTMCTL(link_id));
u16p_replace_bits(&act, 0x1, SDW_SHIM_CTMCTL_DOAIS);
act |= SDW_SHIM_CTMCTL_DACTQE;
act |= SDW_SHIM_CTMCTL_DODS;
intel_writew(shim, SDW_SHIM_CTMCTL(link_id), act);
usleep_range(10, 15);
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/cleanup.h`, `linux/debugfs.h`, `linux/delay.h`, `linux/io.h`, `sound/pcm_params.h`, `linux/pm_runtime.h`, `sound/soc.h`.
- Detected declarations: `function intel_wait_bit`, `function intel_clear_bit`, `function intel_set_bit`, `function intel_sprintf`, `function intel_reg_show`, `function intel_set_m_datamode`, `function intel_set_s_datamode`, `function intel_debugfs_init`, `function intel_debugfs_exit`, `function intel_debugfs_init`.
- Atlas domain: Driver Families / drivers/soundwire.
- Implementation status: integration 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.