drivers/mmc/host/renesas_sdhi.h
Source file repositories/reference/linux-study-clean/drivers/mmc/host/renesas_sdhi.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/mmc/host/renesas_sdhi.h- Extension
.h- Size
- 3071 bytes
- Lines
- 114
- 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
linux/device.hlinux/dmaengine.hlinux/platform_device.hlinux/workqueue.htmio_mmc.h
Detected Declarations
struct renesas_sdhi_sccstruct renesas_sdhi_of_datastruct renesas_sdhi_quirksstruct renesas_sdhi_of_data_with_quirksstruct renesas_sdhi_dmastruct renesas_sdhi
Annotated Snippet
struct renesas_sdhi_scc {
unsigned long clk_rate; /* clock rate for SDR104 */
u32 tap; /* sampling clock position for SDR104/HS400 (8 TAP) */
u32 tap_hs400_4tap; /* sampling clock position for HS400 (4 TAP) */
};
#define SDHI_FLAG_NEED_CLKH_FALLBACK BIT(0)
struct renesas_sdhi_of_data {
unsigned long tmio_flags;
u32 tmio_ocr_mask;
unsigned long capabilities;
unsigned long capabilities2;
enum dma_slave_buswidth dma_buswidth;
dma_addr_t dma_rx_offset;
unsigned int bus_shift;
int scc_offset;
struct renesas_sdhi_scc *taps;
int taps_num;
unsigned int max_blk_count;
unsigned short max_segs;
unsigned long sdhi_flags;
};
#define SDHI_CALIB_TABLE_MAX 32
#define sdhi_has_quirk(p, q) ((p)->quirks && (p)->quirks->q)
struct renesas_sdhi_quirks {
bool hs400_disabled;
bool hs400_4taps;
bool fixed_addr_mode;
bool dma_one_rx_only;
bool manual_tap_correction;
bool old_info1_layout;
u32 hs400_bad_taps;
const u8 (*hs400_calib_table)[SDHI_CALIB_TABLE_MAX];
};
struct renesas_sdhi_of_data_with_quirks {
const struct renesas_sdhi_of_data *of_data;
const struct renesas_sdhi_quirks *quirks;
};
/* We want both end_flags to be set before we mark DMA as finished */
#define SDHI_DMA_END_FLAG_DMA 0
#define SDHI_DMA_END_FLAG_ACCESS 1
struct renesas_sdhi_dma {
unsigned long end_flags;
enum dma_slave_buswidth dma_buswidth;
dma_filter_fn filter;
void (*enable)(struct tmio_mmc_host *host, bool enable);
struct completion dma_dataend;
struct work_struct dma_complete;
};
struct renesas_sdhi {
struct clk *clk;
struct clk *clkh;
struct clk *clk_cd;
struct tmio_mmc_data mmc_data;
struct renesas_sdhi_dma dma_priv;
const struct renesas_sdhi_quirks *quirks;
struct pinctrl *pinctrl;
struct pinctrl_state *pins_default, *pins_uhs;
void __iomem *scc_ctl;
u32 scc_tappos;
u32 scc_tappos_hs400;
const u8 *adjust_hs400_calib_table;
bool needs_adjust_hs400;
bool card_is_sdio;
/* Tuning values: 1 for success, 0 for failure */
DECLARE_BITMAP(taps, BITS_PER_LONG);
/* Sampling data comparison: 1 for match, 0 for mismatch */
DECLARE_BITMAP(smpcmp, BITS_PER_LONG);
unsigned int tap_num;
unsigned int tap_set;
struct reset_control *rstc;
struct tmio_mmc_host *host;
struct regulator_dev *rdev;
};
#define host_to_priv(host) \
container_of((host)->pdata, struct renesas_sdhi, mmc_data)
int renesas_sdhi_probe(struct platform_device *pdev,
const struct tmio_mmc_dma_ops *dma_ops,
Annotation
- Immediate include surface: `linux/device.h`, `linux/dmaengine.h`, `linux/platform_device.h`, `linux/workqueue.h`, `tmio_mmc.h`.
- Detected declarations: `struct renesas_sdhi_scc`, `struct renesas_sdhi_of_data`, `struct renesas_sdhi_quirks`, `struct renesas_sdhi_of_data_with_quirks`, `struct renesas_sdhi_dma`, `struct renesas_sdhi`.
- 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.