summaryrefslogtreecommitdiff
path: root/components/drivers/sdio/dev_sdhci_dm.h
blob: c5b09980809d9c03e16ad97a9b145d6d520f7792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
 * Copyright (c) 2006-2024 RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author        Notes
 * 2024-08-16     zhujiale     first version
 */

#ifndef __DEV_SDHCI_DM_H__
#define __DEV_SDHCI_DM_H__

#include <rtthread.h>
#include <rtdevice.h>

struct rt_sdhci_pltfm_data
{
    const struct rt_sdhci_ops *ops;
    rt_uint32_t quirks;
    rt_uint32_t quirks2;
};

struct rt_sdhci_pltfm_host
{
    struct rt_clk *clk;
    rt_uint32_t clock;
    rt_uint16_t xfer_mode_shadow;

    rt_ubase_t private[];
};

void rt_sdhci_get_property(struct rt_platform_device *pdev);

rt_inline void rt_sdhci_get_of_property(struct rt_platform_device *pdev)
{
    return rt_sdhci_get_property(pdev);
}

extern struct rt_sdhci_host *rt_sdhci_pltfm_init(struct rt_platform_device *pdev,
                                                 const struct rt_sdhci_pltfm_data *pdata,
                                                 rt_size_t priv_size);
extern void rt_sdhci_pltfm_free(struct rt_platform_device *pdev);

extern rt_err_t rt_sdhci_pltfm_init_and_add_host(struct rt_platform_device *pdev,
                                                 const struct rt_sdhci_pltfm_data *pdata,
                                                 rt_size_t priv_size);

extern rt_err_t rt_sdhci_pltfm_remove(struct rt_platform_device *pdev);

extern rt_uint32_t rt_sdhci_pltfm_clk_get_max_clock(struct rt_sdhci_host *host);

rt_inline void *rt_sdhci_pltfm_priv(struct rt_sdhci_pltfm_host *host)
{
    return host->private;
}

rt_inline rt_err_t rt_sdhci_pltfm_suspend(struct rt_device *dev)
{
    return RT_EOK;
}

rt_inline rt_err_t rt_sdhci_pltfm_resume(struct rt_device *dev)
{
    return RT_EOK;
}

#endif /* __DEV_SDHCI_DM_H__ */