2018-08-22 06:02:17 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2017-05-10 17:25:28 +08:00
|
|
|
/*
|
|
|
|
* Renesas Mobile SDHI
|
|
|
|
*
|
|
|
|
* Copyright (C) 2017 Horms Solutions Ltd., Simon Horman
|
|
|
|
* Copyright (C) 2017 Renesas Electronics Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef RENESAS_SDHI_H
|
|
|
|
#define RENESAS_SDHI_H
|
|
|
|
|
2017-05-10 17:25:30 +08:00
|
|
|
#include <linux/platform_device.h>
|
2017-05-10 17:25:28 +08:00
|
|
|
#include "tmio_mmc.h"
|
|
|
|
|
2017-05-10 17:25:30 +08:00
|
|
|
struct renesas_sdhi_scc {
|
|
|
|
unsigned long clk_rate; /* clock rate for SDR104 */
|
|
|
|
u32 tap; /* sampling clock position for SDR104 */
|
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
2017-06-17 00:11:03 +08:00
|
|
|
unsigned int bus_shift;
|
2017-05-10 17:25:30 +08:00
|
|
|
int scc_offset;
|
|
|
|
struct renesas_sdhi_scc *taps;
|
|
|
|
int taps_num;
|
2017-06-21 22:00:27 +08:00
|
|
|
unsigned int max_blk_count;
|
|
|
|
unsigned short max_segs;
|
2017-05-10 17:25:30 +08:00
|
|
|
};
|
|
|
|
|
2017-11-25 00:24:47 +08:00
|
|
|
struct tmio_mmc_dma {
|
|
|
|
enum dma_slave_buswidth dma_buswidth;
|
|
|
|
bool (*filter)(struct dma_chan *chan, void *arg);
|
|
|
|
void (*enable)(struct tmio_mmc_host *host, bool enable);
|
2017-11-25 00:24:48 +08:00
|
|
|
struct completion dma_dataend;
|
|
|
|
struct tasklet_struct dma_complete;
|
2017-11-25 00:24:47 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct renesas_sdhi {
|
|
|
|
struct clk *clk;
|
|
|
|
struct clk *clk_cd;
|
|
|
|
struct tmio_mmc_data mmc_data;
|
|
|
|
struct tmio_mmc_dma dma_priv;
|
|
|
|
struct pinctrl *pinctrl;
|
|
|
|
struct pinctrl_state *pins_default, *pins_uhs;
|
|
|
|
void __iomem *scc_ctl;
|
2017-11-25 00:24:49 +08:00
|
|
|
u32 scc_tappos;
|
2017-11-25 00:24:47 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#define host_to_priv(host) \
|
|
|
|
container_of((host)->pdata, struct renesas_sdhi, mmc_data)
|
|
|
|
|
2017-05-10 17:25:30 +08:00
|
|
|
int renesas_sdhi_probe(struct platform_device *pdev,
|
2017-06-17 00:11:04 +08:00
|
|
|
const struct tmio_mmc_dma_ops *dma_ops);
|
2017-05-10 17:25:30 +08:00
|
|
|
int renesas_sdhi_remove(struct platform_device *pdev);
|
2017-05-10 17:25:28 +08:00
|
|
|
#endif
|