drivers/mmc/host/sdhci-of-aspeed-test.c
Source file repositories/reference/linux-study-clean/drivers/mmc/host/sdhci-of-aspeed-test.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mmc/host/sdhci-of-aspeed-test.c- Extension
.c- Size
- 3696 bytes
- Lines
- 100
- Domain
- Driver Families
- Bucket
- drivers/mmc
- 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
kunit/test.h
Detected Declarations
function aspeed_sdhci_phase_ddr52function aspeed_sdhci_phase_hs200
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/* Copyright (C) 2020 IBM Corp. */
#include <kunit/test.h>
static void aspeed_sdhci_phase_ddr52(struct kunit *test)
{
int rate = 52000000;
KUNIT_EXPECT_EQ(test, 0,
aspeed_sdhci_phase_to_tap(NULL, rate, 0));
KUNIT_EXPECT_EQ(test, 0,
aspeed_sdhci_phase_to_tap(NULL, rate, 1));
KUNIT_EXPECT_EQ(test, 1,
aspeed_sdhci_phase_to_tap(NULL, rate, 2));
KUNIT_EXPECT_EQ(test, 1,
aspeed_sdhci_phase_to_tap(NULL, rate, 3));
KUNIT_EXPECT_EQ(test, 2,
aspeed_sdhci_phase_to_tap(NULL, rate, 4));
KUNIT_EXPECT_EQ(test, 3,
aspeed_sdhci_phase_to_tap(NULL, rate, 5));
KUNIT_EXPECT_EQ(test, 14,
aspeed_sdhci_phase_to_tap(NULL, rate, 23));
KUNIT_EXPECT_EQ(test, 15,
aspeed_sdhci_phase_to_tap(NULL, rate, 24));
KUNIT_EXPECT_EQ(test, 15,
aspeed_sdhci_phase_to_tap(NULL, rate, 25));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 0,
aspeed_sdhci_phase_to_tap(NULL, rate, 180));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 0,
aspeed_sdhci_phase_to_tap(NULL, rate, 181));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 1,
aspeed_sdhci_phase_to_tap(NULL, rate, 182));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 1,
aspeed_sdhci_phase_to_tap(NULL, rate, 183));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 2,
aspeed_sdhci_phase_to_tap(NULL, rate, 184));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 3,
aspeed_sdhci_phase_to_tap(NULL, rate, 185));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 14,
aspeed_sdhci_phase_to_tap(NULL, rate, 203));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 15,
aspeed_sdhci_phase_to_tap(NULL, rate, 204));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 15,
aspeed_sdhci_phase_to_tap(NULL, rate, 205));
}
static void aspeed_sdhci_phase_hs200(struct kunit *test)
{
int rate = 200000000;
KUNIT_EXPECT_EQ(test, 0,
aspeed_sdhci_phase_to_tap(NULL, rate, 0));
KUNIT_EXPECT_EQ(test, 0,
aspeed_sdhci_phase_to_tap(NULL, rate, 5));
KUNIT_EXPECT_EQ(test, 1,
aspeed_sdhci_phase_to_tap(NULL, rate, 6));
KUNIT_EXPECT_EQ(test, 1,
aspeed_sdhci_phase_to_tap(NULL, rate, 7));
KUNIT_EXPECT_EQ(test, 14,
aspeed_sdhci_phase_to_tap(NULL, rate, 89));
KUNIT_EXPECT_EQ(test, 15,
aspeed_sdhci_phase_to_tap(NULL, rate, 90));
KUNIT_EXPECT_EQ(test, 15,
aspeed_sdhci_phase_to_tap(NULL, rate, 91));
KUNIT_EXPECT_EQ(test, 15,
aspeed_sdhci_phase_to_tap(NULL, rate, 96));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK,
aspeed_sdhci_phase_to_tap(NULL, rate, 180));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK,
aspeed_sdhci_phase_to_tap(NULL, rate, 185));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 1,
aspeed_sdhci_phase_to_tap(NULL, rate, 186));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 1,
aspeed_sdhci_phase_to_tap(NULL, rate, 187));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 14,
aspeed_sdhci_phase_to_tap(NULL, rate, 269));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 15,
aspeed_sdhci_phase_to_tap(NULL, rate, 270));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 15,
aspeed_sdhci_phase_to_tap(NULL, rate, 271));
KUNIT_EXPECT_EQ(test, ASPEED_SDHCI_TAP_PARAM_INVERT_CLK | 15,
aspeed_sdhci_phase_to_tap(NULL, rate, 276));
}
static struct kunit_case aspeed_sdhci_test_cases[] = {
KUNIT_CASE(aspeed_sdhci_phase_ddr52),
KUNIT_CASE(aspeed_sdhci_phase_hs200),
Annotation
- Immediate include surface: `kunit/test.h`.
- Detected declarations: `function aspeed_sdhci_phase_ddr52`, `function aspeed_sdhci_phase_hs200`.
- Atlas domain: Driver Families / drivers/mmc.
- 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.