drivers/ps3/ps3av_cmd.c
Source file repositories/reference/linux-study-clean/drivers/ps3/ps3av_cmd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/ps3/ps3av_cmd.c- Extension
.c- Size
- 23719 bytes
- Lines
- 925
- Domain
- Driver Families
- Bucket
- drivers/ps3
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/kernel.hlinux/delay.hasm/ps3av.hasm/ps3.hasm/ps3gpu.hvuart.h
Detected Declarations
function ps3av_cs_video2avfunction ps3av_cs_video2av_bitlenfunction ps3av_vid_video2avfunction ps3av_hdmi_rangefunction ps3av_cmd_initfunction ps3av_cmd_finfunction ps3av_cmd_av_video_mutefunction ps3av_cmd_av_video_disable_sigfunction ps3av_cmd_av_tv_mutefunction ps3av_cmd_enable_eventfunction ps3av_cmd_av_hdmi_modefunction ps3av_cmd_set_av_video_csfunction ps3av_cmd_set_video_modefunction ps3av_cmd_video_format_blackfunction ps3av_cmd_av_audio_mutefunction ps3av_cnv_mclkfunction ps3av_cnv_nsfunction ps3av_cnv_enablefunction ps3av_cnv_fifomapfunction ps3av_cnv_inputlenfunction ps3av_cnv_layoutfunction ps3av_cnv_infofunction ps3av_cnv_chstatfunction ps3av_cmd_set_av_audio_paramfunction ps3av_cmd_set_audio_modefunction ps3av_cmd_audio_modefunction ps3av_cmd_audio_mutefunction ps3av_cmd_audio_activefunction ps3av_cmd_avb_paramfunction ps3av_cmd_av_get_hw_conffunction ps3av_cmd_video_get_monitor_infoexport ps3av_mode_cs_info
Annotated Snippet
switch (ch) {
case PS3AV_CMD_AUDIO_NUM_OF_CH_8:
audio->audio_layout = PS3AV_CMD_AUDIO_LAYOUT_8CH;
break;
case PS3AV_CMD_AUDIO_NUM_OF_CH_6:
audio->audio_layout = PS3AV_CMD_AUDIO_LAYOUT_6CH;
break;
case PS3AV_CMD_AUDIO_NUM_OF_CH_2:
default:
audio->audio_layout = PS3AV_CMD_AUDIO_LAYOUT_2CH;
break;
}
} else {
audio->audio_layout = PS3AV_CMD_AUDIO_LAYOUT_2CH;
}
/* audio downmix permission */
audio->audio_downmix = PS3AV_CMD_AUDIO_DOWNMIX_PERMITTED;
/* audio downmix level shift (0:0dB to 15:15dB) */
audio->audio_downmix_level = 0; /* 0dB */
/* set ch status */
for (i = 0; i < 8; i++)
audio->audio_cs_info[i] = ps3av_mode_cs_info[i];
switch (fs) {
case PS3AV_CMD_AUDIO_FS_44K:
audio->audio_cs_info[3] &= ~CS_MASK;
audio->audio_cs_info[3] |= CS_44;
break;
case PS3AV_CMD_AUDIO_FS_88K:
audio->audio_cs_info[3] &= ~CS_MASK;
audio->audio_cs_info[3] |= CS_88;
break;
case PS3AV_CMD_AUDIO_FS_96K:
audio->audio_cs_info[3] &= ~CS_MASK;
audio->audio_cs_info[3] |= CS_96;
break;
case PS3AV_CMD_AUDIO_FS_176K:
audio->audio_cs_info[3] &= ~CS_MASK;
audio->audio_cs_info[3] |= CS_176;
break;
case PS3AV_CMD_AUDIO_FS_192K:
audio->audio_cs_info[3] &= ~CS_MASK;
audio->audio_cs_info[3] |= CS_192;
break;
default:
break;
}
/* non-audio bit */
spdif_through = audio->audio_cs_info[0] & 0x02;
/* pass through setting */
if (spdif_through &&
(avport == PS3AV_CMD_AVPORT_SPDIF_0 ||
avport == PS3AV_CMD_AVPORT_SPDIF_1 ||
avport == PS3AV_CMD_AVPORT_HDMI_0 ||
avport == PS3AV_CMD_AVPORT_HDMI_1)) {
audio->audio_word_bits = PS3AV_CMD_AUDIO_WORD_BITS_16;
audio->audio_format = PS3AV_CMD_AUDIO_FORMAT_BITSTREAM;
}
}
int ps3av_cmd_audio_mode(struct ps3av_pkt_audio_mode *audio_mode)
{
int res;
res = ps3av_do_pkt(PS3AV_CID_AUDIO_MODE, sizeof(*audio_mode),
sizeof(*audio_mode), &audio_mode->send_hdr);
if (res < 0)
return res;
res = get_status(audio_mode);
if (res)
printk(KERN_ERR "PS3AV_CID_AUDIO_MODE: failed %x\n", res);
return res;
}
int ps3av_cmd_audio_mute(int num_of_port, u32 *port, u32 mute)
{
int i, res;
struct ps3av_pkt_audio_mute audio_mute;
if (num_of_port > PS3AV_OPT_PORT_MAX)
return -EINVAL;
/* audio mute */
memset(&audio_mute, 0, sizeof(audio_mute));
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/delay.h`, `asm/ps3av.h`, `asm/ps3.h`, `asm/ps3gpu.h`, `vuart.h`.
- Detected declarations: `function ps3av_cs_video2av`, `function ps3av_cs_video2av_bitlen`, `function ps3av_vid_video2av`, `function ps3av_hdmi_range`, `function ps3av_cmd_init`, `function ps3av_cmd_fin`, `function ps3av_cmd_av_video_mute`, `function ps3av_cmd_av_video_disable_sig`, `function ps3av_cmd_av_tv_mute`, `function ps3av_cmd_enable_event`.
- Atlas domain: Driver Families / drivers/ps3.
- 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.