sound/soc/rockchip/rockchip_max98090.c
Source file repositories/reference/linux-study-clean/sound/soc/rockchip/rockchip_max98090.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/rockchip/rockchip_max98090.c- Extension
.c- Size
- 12139 bytes
- Lines
- 470
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/of.hlinux/platform_device.hlinux/slab.hsound/core.hsound/jack.hsound/pcm.hsound/pcm_params.hsound/soc.hrockchip_i2s.h../codecs/ts3a227e.h
Detected Declarations
function rk_jack_eventfunction rk_initfunction rk_aif1_hw_paramsfunction rk_aif1_startupfunction rk_hdmi_initfunction rk_98090_headset_initfunction rk_parse_headset_from_offunction snd_rk_mc_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Rockchip machine ASoC driver for boards using a MAX90809 CODEC.
*
* Copyright (c) 2014, ROCKCHIP CORPORATION. All rights reserved.
*/
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/jack.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include "rockchip_i2s.h"
#include "../codecs/ts3a227e.h"
#define DRV_NAME "rockchip-snd-max98090"
static struct snd_soc_jack headset_jack;
/* Headset jack detection DAPM pins */
static struct snd_soc_jack_pin headset_jack_pins[] = {
{
.pin = "Headphone",
.mask = SND_JACK_HEADPHONE,
},
{
.pin = "Headset Mic",
.mask = SND_JACK_MICROPHONE,
},
};
#define RK_MAX98090_WIDGETS \
SND_SOC_DAPM_HP("Headphone", NULL), \
SND_SOC_DAPM_MIC("Headset Mic", NULL), \
SND_SOC_DAPM_MIC("Int Mic", NULL), \
SND_SOC_DAPM_SPK("Speaker", NULL)
#define RK_HDMI_WIDGETS \
SND_SOC_DAPM_LINE("HDMI", NULL)
static const struct snd_soc_dapm_widget rk_max98090_dapm_widgets[] = {
RK_MAX98090_WIDGETS,
};
static const struct snd_soc_dapm_widget rk_hdmi_dapm_widgets[] = {
RK_HDMI_WIDGETS,
};
static const struct snd_soc_dapm_widget rk_max98090_hdmi_dapm_widgets[] = {
RK_MAX98090_WIDGETS,
RK_HDMI_WIDGETS,
};
#define RK_MAX98090_AUDIO_MAP \
{"IN34", NULL, "Headset Mic"}, \
{"Headset Mic", NULL, "MICBIAS"}, \
{"DMICL", NULL, "Int Mic"}, \
{"Headphone", NULL, "HPL"}, \
{"Headphone", NULL, "HPR"}, \
{"Speaker", NULL, "SPKL"}, \
{"Speaker", NULL, "SPKR"}
#define RK_HDMI_AUDIO_MAP \
{"HDMI", NULL, "TX"}
static const struct snd_soc_dapm_route rk_max98090_audio_map[] = {
RK_MAX98090_AUDIO_MAP,
};
static const struct snd_soc_dapm_route rk_hdmi_audio_map[] = {
RK_HDMI_AUDIO_MAP,
};
static const struct snd_soc_dapm_route rk_max98090_hdmi_audio_map[] = {
RK_MAX98090_AUDIO_MAP,
RK_HDMI_AUDIO_MAP,
};
#define RK_MAX98090_CONTROLS \
SOC_DAPM_PIN_SWITCH("Headphone"), \
SOC_DAPM_PIN_SWITCH("Headset Mic"), \
SOC_DAPM_PIN_SWITCH("Int Mic"), \
SOC_DAPM_PIN_SWITCH("Speaker")
Annotation
- Immediate include surface: `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/slab.h`, `sound/core.h`, `sound/jack.h`, `sound/pcm.h`, `sound/pcm_params.h`.
- Detected declarations: `function rk_jack_event`, `function rk_init`, `function rk_aif1_hw_params`, `function rk_aif1_startup`, `function rk_hdmi_init`, `function rk_98090_headset_init`, `function rk_parse_headset_from_of`, `function snd_rk_mc_probe`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
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.