Searched refs:mmc (Results 1 - 200 of 324) sorted by relevance

12

/linux-4.1.27/drivers/net/ethernet/stmicro/stmmac/
H A Dmmc_core.c27 #include "mmc.h"
157 * counter after a read. So all the field of the mmc struct
160 void dwmac_mmc_read(void __iomem *ioaddr, struct stmmac_counters *mmc) dwmac_mmc_read() argument
162 mmc->mmc_tx_octetcount_gb += readl(ioaddr + MMC_TX_OCTETCOUNT_GB); dwmac_mmc_read()
163 mmc->mmc_tx_framecount_gb += readl(ioaddr + MMC_TX_FRAMECOUNT_GB); dwmac_mmc_read()
164 mmc->mmc_tx_broadcastframe_g += readl(ioaddr + MMC_TX_BROADCASTFRAME_G); dwmac_mmc_read()
165 mmc->mmc_tx_multicastframe_g += readl(ioaddr + MMC_TX_MULTICASTFRAME_G); dwmac_mmc_read()
166 mmc->mmc_tx_64_octets_gb += readl(ioaddr + MMC_TX_64_OCTETS_GB); dwmac_mmc_read()
167 mmc->mmc_tx_65_to_127_octets_gb += dwmac_mmc_read()
169 mmc->mmc_tx_128_to_255_octets_gb += dwmac_mmc_read()
171 mmc->mmc_tx_256_to_511_octets_gb += dwmac_mmc_read()
173 mmc->mmc_tx_512_to_1023_octets_gb += dwmac_mmc_read()
175 mmc->mmc_tx_1024_to_max_octets_gb += dwmac_mmc_read()
177 mmc->mmc_tx_unicast_gb += readl(ioaddr + MMC_TX_UNICAST_GB); dwmac_mmc_read()
178 mmc->mmc_tx_multicast_gb += readl(ioaddr + MMC_TX_MULTICAST_GB); dwmac_mmc_read()
179 mmc->mmc_tx_broadcast_gb += readl(ioaddr + MMC_TX_BROADCAST_GB); dwmac_mmc_read()
180 mmc->mmc_tx_underflow_error += readl(ioaddr + MMC_TX_UNDERFLOW_ERROR); dwmac_mmc_read()
181 mmc->mmc_tx_singlecol_g += readl(ioaddr + MMC_TX_SINGLECOL_G); dwmac_mmc_read()
182 mmc->mmc_tx_multicol_g += readl(ioaddr + MMC_TX_MULTICOL_G); dwmac_mmc_read()
183 mmc->mmc_tx_deferred += readl(ioaddr + MMC_TX_DEFERRED); dwmac_mmc_read()
184 mmc->mmc_tx_latecol += readl(ioaddr + MMC_TX_LATECOL); dwmac_mmc_read()
185 mmc->mmc_tx_exesscol += readl(ioaddr + MMC_TX_EXESSCOL); dwmac_mmc_read()
186 mmc->mmc_tx_carrier_error += readl(ioaddr + MMC_TX_CARRIER_ERROR); dwmac_mmc_read()
187 mmc->mmc_tx_octetcount_g += readl(ioaddr + MMC_TX_OCTETCOUNT_G); dwmac_mmc_read()
188 mmc->mmc_tx_framecount_g += readl(ioaddr + MMC_TX_FRAMECOUNT_G); dwmac_mmc_read()
189 mmc->mmc_tx_excessdef += readl(ioaddr + MMC_TX_EXCESSDEF); dwmac_mmc_read()
190 mmc->mmc_tx_pause_frame += readl(ioaddr + MMC_TX_PAUSE_FRAME); dwmac_mmc_read()
191 mmc->mmc_tx_vlan_frame_g += readl(ioaddr + MMC_TX_VLAN_FRAME_G); dwmac_mmc_read()
194 mmc->mmc_rx_framecount_gb += readl(ioaddr + MMC_RX_FRAMECOUNT_GB); dwmac_mmc_read()
195 mmc->mmc_rx_octetcount_gb += readl(ioaddr + MMC_RX_OCTETCOUNT_GB); dwmac_mmc_read()
196 mmc->mmc_rx_octetcount_g += readl(ioaddr + MMC_RX_OCTETCOUNT_G); dwmac_mmc_read()
197 mmc->mmc_rx_broadcastframe_g += readl(ioaddr + MMC_RX_BROADCASTFRAME_G); dwmac_mmc_read()
198 mmc->mmc_rx_multicastframe_g += readl(ioaddr + MMC_RX_MULTICASTFRAME_G); dwmac_mmc_read()
199 mmc->mmc_rx_crc_error += readl(ioaddr + MMC_RX_CRC_ERRROR); dwmac_mmc_read()
200 mmc->mmc_rx_align_error += readl(ioaddr + MMC_RX_ALIGN_ERROR); dwmac_mmc_read()
201 mmc->mmc_rx_run_error += readl(ioaddr + MMC_RX_RUN_ERROR); dwmac_mmc_read()
202 mmc->mmc_rx_jabber_error += readl(ioaddr + MMC_RX_JABBER_ERROR); dwmac_mmc_read()
203 mmc->mmc_rx_undersize_g += readl(ioaddr + MMC_RX_UNDERSIZE_G); dwmac_mmc_read()
204 mmc->mmc_rx_oversize_g += readl(ioaddr + MMC_RX_OVERSIZE_G); dwmac_mmc_read()
205 mmc->mmc_rx_64_octets_gb += readl(ioaddr + MMC_RX_64_OCTETS_GB); dwmac_mmc_read()
206 mmc->mmc_rx_65_to_127_octets_gb += dwmac_mmc_read()
208 mmc->mmc_rx_128_to_255_octets_gb += dwmac_mmc_read()
210 mmc->mmc_rx_256_to_511_octets_gb += dwmac_mmc_read()
212 mmc->mmc_rx_512_to_1023_octets_gb += dwmac_mmc_read()
214 mmc->mmc_rx_1024_to_max_octets_gb += dwmac_mmc_read()
216 mmc->mmc_rx_unicast_g += readl(ioaddr + MMC_RX_UNICAST_G); dwmac_mmc_read()
217 mmc->mmc_rx_length_error += readl(ioaddr + MMC_RX_LENGTH_ERROR); dwmac_mmc_read()
218 mmc->mmc_rx_autofrangetype += readl(ioaddr + MMC_RX_AUTOFRANGETYPE); dwmac_mmc_read()
219 mmc->mmc_rx_pause_frames += readl(ioaddr + MMC_RX_PAUSE_FRAMES); dwmac_mmc_read()
220 mmc->mmc_rx_fifo_overflow += readl(ioaddr + MMC_RX_FIFO_OVERFLOW); dwmac_mmc_read()
221 mmc->mmc_rx_vlan_frames_gb += readl(ioaddr + MMC_RX_VLAN_FRAMES_GB); dwmac_mmc_read()
222 mmc->mmc_rx_watchdog_error += readl(ioaddr + MMC_RX_WATCHDOG_ERROR); dwmac_mmc_read()
224 mmc->mmc_rx_ipc_intr_mask += readl(ioaddr + MMC_RX_IPC_INTR_MASK); dwmac_mmc_read()
225 mmc->mmc_rx_ipc_intr += readl(ioaddr + MMC_RX_IPC_INTR); dwmac_mmc_read()
227 mmc->mmc_rx_ipv4_gd += readl(ioaddr + MMC_RX_IPV4_GD); dwmac_mmc_read()
228 mmc->mmc_rx_ipv4_hderr += readl(ioaddr + MMC_RX_IPV4_HDERR); dwmac_mmc_read()
229 mmc->mmc_rx_ipv4_nopay += readl(ioaddr + MMC_RX_IPV4_NOPAY); dwmac_mmc_read()
230 mmc->mmc_rx_ipv4_frag += readl(ioaddr + MMC_RX_IPV4_FRAG); dwmac_mmc_read()
231 mmc->mmc_rx_ipv4_udsbl += readl(ioaddr + MMC_RX_IPV4_UDSBL); dwmac_mmc_read()
233 mmc->mmc_rx_ipv4_gd_octets += readl(ioaddr + MMC_RX_IPV4_GD_OCTETS); dwmac_mmc_read()
234 mmc->mmc_rx_ipv4_hderr_octets += dwmac_mmc_read()
236 mmc->mmc_rx_ipv4_nopay_octets += dwmac_mmc_read()
238 mmc->mmc_rx_ipv4_frag_octets += readl(ioaddr + MMC_RX_IPV4_FRAG_OCTETS); dwmac_mmc_read()
239 mmc->mmc_rx_ipv4_udsbl_octets += dwmac_mmc_read()
243 mmc->mmc_rx_ipv6_gd_octets += readl(ioaddr + MMC_RX_IPV6_GD_OCTETS); dwmac_mmc_read()
244 mmc->mmc_rx_ipv6_hderr_octets += dwmac_mmc_read()
246 mmc->mmc_rx_ipv6_nopay_octets += dwmac_mmc_read()
249 mmc->mmc_rx_ipv6_gd += readl(ioaddr + MMC_RX_IPV6_GD); dwmac_mmc_read()
250 mmc->mmc_rx_ipv6_hderr += readl(ioaddr + MMC_RX_IPV6_HDERR); dwmac_mmc_read()
251 mmc->mmc_rx_ipv6_nopay += readl(ioaddr + MMC_RX_IPV6_NOPAY); dwmac_mmc_read()
254 mmc->mmc_rx_udp_gd += readl(ioaddr + MMC_RX_UDP_GD); dwmac_mmc_read()
255 mmc->mmc_rx_udp_err += readl(ioaddr + MMC_RX_UDP_ERR); dwmac_mmc_read()
256 mmc->mmc_rx_tcp_gd += readl(ioaddr + MMC_RX_TCP_GD); dwmac_mmc_read()
257 mmc->mmc_rx_tcp_err += readl(ioaddr + MMC_RX_TCP_ERR); dwmac_mmc_read()
258 mmc->mmc_rx_icmp_gd += readl(ioaddr + MMC_RX_ICMP_GD); dwmac_mmc_read()
259 mmc->mmc_rx_icmp_err += readl(ioaddr + MMC_RX_ICMP_ERR); dwmac_mmc_read()
261 mmc->mmc_rx_udp_gd_octets += readl(ioaddr + MMC_RX_UDP_GD_OCTETS); dwmac_mmc_read()
262 mmc->mmc_rx_udp_err_octets += readl(ioaddr + MMC_RX_UDP_ERR_OCTETS); dwmac_mmc_read()
263 mmc->mmc_rx_tcp_gd_octets += readl(ioaddr + MMC_RX_TCP_GD_OCTETS); dwmac_mmc_read()
264 mmc->mmc_rx_tcp_err_octets += readl(ioaddr + MMC_RX_TCP_ERR_OCTETS); dwmac_mmc_read()
265 mmc->mmc_rx_icmp_gd_octets += readl(ioaddr + MMC_RX_ICMP_GD_OCTETS); dwmac_mmc_read()
266 mmc->mmc_rx_icmp_err_octets += readl(ioaddr + MMC_RX_ICMP_ERR_OCTETS); dwmac_mmc_read()
H A Dmmc.h133 void dwmac_mmc_read(void __iomem *ioaddr, struct stmmac_counters *mmc);
H A Dstmmac.h93 struct stmmac_counters mmc; member in struct:stmmac_priv
/linux-4.1.27/drivers/mmc/core/
H A DMakefile2 # Makefile for the kernel mmc core.
7 mmc.o mmc_ops.o sd.o sd_ops.o \
H A Dhost.h2 * linux/drivers/mmc/core/host.h
13 #include <linux/mmc/host.h>
H A Dsd.h4 #include <linux/mmc/card.h>
H A Dpwrseq.c16 #include <linux/mmc/host.h>
27 .compatible = "mmc-pwrseq-simple",
30 .compatible = "mmc-pwrseq-emmc",
58 np = of_parse_phandle(host->parent->of_node, "mmc-pwrseq", 0); mmc_pwrseq_alloc()
81 dev_info(host->parent, "allocated mmc-pwrseq\n"); mmc_pwrseq_alloc()
H A Dsdio_bus.h2 * linux/drivers/mmc/core/sdio_bus.h
H A Dsdio_cis.h2 * linux/drivers/mmc/core/sdio_cis.h
H A Dsdio_ops.c2 * linux/drivers/mmc/sdio_ops.c
14 #include <linux/mmc/host.h>
15 #include <linux/mmc/card.h>
16 #include <linux/mmc/mmc.h>
17 #include <linux/mmc/sdio.h>
H A Dbus.h2 * linux/drivers/mmc/core/bus.h
H A Dsd_ops.h2 * linux/drivers/mmc/core/sd_ops.h
H A Dsdio_ops.h2 * linux/drivers/mmc/sdio_ops.c
H A Dquirks.c15 #include <linux/mmc/card.h>
16 #include <linux/mmc/sdio_ids.h>
H A Dhost.c2 * linux/drivers/mmc/core/host.c
26 #include <linux/mmc/host.h>
27 #include <linux/mmc/card.h>
28 #include <linux/mmc/slot-gpio.h>
310 * parse the properties and set respective generic mmc-host flags and
354 * mmc-gpio helpers are used to attach, configure and use them. If mmc_of_parse()
409 if (of_find_property(np, "cap-mmc-highspeed", &len)) mmc_of_parse()
431 if (of_find_property(np, "mmc-ddr-1_8v", &len)) mmc_of_parse()
433 if (of_find_property(np, "mmc-ddr-1_2v", &len)) mmc_of_parse()
435 if (of_find_property(np, "mmc-hs200-1_8v", &len)) mmc_of_parse()
437 if (of_find_property(np, "mmc-hs200-1_2v", &len)) mmc_of_parse()
439 if (of_find_property(np, "mmc-hs400-1_8v", &len)) mmc_of_parse()
441 if (of_find_property(np, "mmc-hs400-1_2v", &len)) mmc_of_parse()
487 dev_set_name(&host->class_dev, "mmc%d", host->index); mmc_alloc_host()
526 * @host: mmc host
560 * @host: mmc host
586 * @host: mmc host
H A Dmmc_ops.h2 * linux/drivers/mmc/core/mmc_ops.h
H A Ddebugfs.c19 #include <linux/mmc/card.h>
20 #include <linux/mmc/host.h>
124 str = "mmc high-speed"; mmc_ios_show()
139 str = "mmc DDR52"; mmc_ios_show()
142 str = "mmc HS200"; mmc_ios_show()
145 str = "mmc HS400"; mmc_ios_show()
H A Dsd_ops.c2 * linux/drivers/mmc/core/sd_ops.h
17 #include <linux/mmc/host.h>
18 #include <linux/mmc/card.h>
19 #include <linux/mmc/mmc.h>
20 #include <linux/mmc/sd.h>
H A Dsdio_irq.c2 * linux/drivers/mmc/core/sdio_irq.c
23 #include <linux/mmc/core.h>
24 #include <linux/mmc/host.h>
25 #include <linux/mmc/card.h>
26 #include <linux/mmc/sdio.h>
27 #include <linux/mmc/sdio_func.h>
H A Dslot-gpio.c16 #include <linux/mmc/host.h>
17 #include <linux/mmc/slot-gpio.h>
93 * @host: mmc host
172 * @host: mmc host
216 * @host: mmc host
263 * @host: mmc host
H A Dbus.c2 * linux/drivers/mmc/core/bus.c
22 #include <linux/mmc/card.h>
23 #include <linux/mmc/host.h>
105 retval = add_uevent_var(env, "MODALIAS=mmc:block"); mmc_bus_uevent()
201 .name = "mmc",
H A Dsdio_cis.c2 * linux/drivers/mmc/core/sdio_cis.c
19 #include <linux/mmc/host.h>
20 #include <linux/mmc/card.h>
21 #include <linux/mmc/sdio.h>
22 #include <linux/mmc/sdio_func.h>
H A Dpwrseq_emmc.c18 #include <linux/mmc/host.h>
H A Dsdio_bus.c2 * linux/drivers/mmc/core/sdio_bus.c
22 #include <linux/mmc/card.h>
23 #include <linux/mmc/host.h>
24 #include <linux/mmc/sdio_func.h>
H A Dcore.c2 * linux/drivers/mmc/core/core.c
33 #include <linux/mmc/card.h>
34 #include <linux/mmc/host.h>
35 #include <linux/mmc/mmc.h>
36 #include <linux/mmc/sd.h>
37 #include <linux/mmc/slot-gpio.h>
329 * Wakes up mmc context, passed as a callback to host controller driver
350 * Starts data mmc request execution
889 * @host: mmc host to claim
938 * @host: mmc host to release
1348 * @mmc: the host to regulate
1358 int mmc_regulator_set_ocr(struct mmc_host *mmc, mmc_regulator_set_ocr() argument
1384 if (result == 0 && !mmc->regulator_enabled) { mmc_regulator_set_ocr()
1387 mmc->regulator_enabled = true; mmc_regulator_set_ocr()
1389 } else if (mmc->regulator_enabled) { mmc_regulator_set_ocr()
1392 mmc->regulator_enabled = false; mmc_regulator_set_ocr()
1396 dev_err(mmc_dev(mmc), mmc_regulator_set_ocr()
1404 int mmc_regulator_get_supply(struct mmc_host *mmc) mmc_regulator_get_supply() argument
1406 struct device *dev = mmc_dev(mmc); mmc_regulator_get_supply()
1409 mmc->supply.vmmc = devm_regulator_get_optional(dev, "vmmc"); mmc_regulator_get_supply()
1410 mmc->supply.vqmmc = devm_regulator_get_optional(dev, "vqmmc"); mmc_regulator_get_supply()
1412 if (IS_ERR(mmc->supply.vmmc)) { mmc_regulator_get_supply()
1413 if (PTR_ERR(mmc->supply.vmmc) == -EPROBE_DEFER) mmc_regulator_get_supply()
1417 ret = mmc_regulator_get_ocrmask(mmc->supply.vmmc); mmc_regulator_get_supply()
1419 mmc->ocr_avail = ret; mmc_regulator_get_supply()
1424 if (IS_ERR(mmc->supply.vqmmc)) { mmc_regulator_get_supply()
1425 if (PTR_ERR(mmc->supply.vqmmc) == -EPROBE_DEFER) mmc_regulator_get_supply()
1735 * Assign a mmc bus handler to a host. Only one bus handler may control a
2697 * @host: mmc host
2700 * request mechanism, used by mmc core, host driver and mmc requests
H A Dcore.h2 * linux/drivers/mmc/core/core.h
H A Dpwrseq_simple.c18 #include <linux/mmc/host.h>
H A Dsdio.c2 * linux/drivers/mmc/sdio.c
15 #include <linux/mmc/host.h>
16 #include <linux/mmc/card.h>
17 #include <linux/mmc/mmc.h>
18 #include <linux/mmc/sdio.h>
19 #include <linux/mmc/sdio_func.h>
20 #include <linux/mmc/sdio_ids.h>
H A Dmmc_ops.c2 * linux/drivers/mmc/core/mmc_ops.h
17 #include <linux/mmc/host.h>
18 #include <linux/mmc/card.h>
19 #include <linux/mmc/mmc.h>
H A Dsdio_io.c2 * linux/drivers/mmc/core/sdio_io.c
13 #include <linux/mmc/host.h>
14 #include <linux/mmc/card.h>
15 #include <linux/mmc/sdio.h>
16 #include <linux/mmc/sdio_func.h>
/linux-4.1.27/drivers/mmc/host/
H A Dsdhci-pci-data.c2 #include <linux/mmc/sdhci-pci-data.h>
H A Dwmt-sdmmc.c29 #include <linux/mmc/host.h>
30 #include <linux/mmc/mmc.h>
31 #include <linux/mmc/sd.h>
189 struct mmc_host *mmc; member in struct:wmt_mci_priv
226 static void wmt_mci_read_response(struct mmc_host *mmc) wmt_mci_read_response() argument
233 priv = mmc_priv(mmc); wmt_mci_read_response()
257 static int wmt_mci_send_command(struct mmc_host *mmc, u8 command, u8 cmdtype, wmt_mci_send_command() argument
263 priv = mmc_priv(mmc); wmt_mci_send_command()
306 dma_unmap_sg(mmc_dev(priv->mmc), req->data->sg, wmt_complete_data_request()
309 dma_unmap_sg(mmc_dev(priv->mmc), req->data->sg, wmt_complete_data_request()
314 mmc_request_done(priv->mmc, req); wmt_complete_data_request()
316 wmt_mci_read_response(priv->mmc); wmt_complete_data_request()
319 mmc_request_done(priv->mmc, req); wmt_complete_data_request()
329 wmt_mci_send_command(priv->mmc, req->data->stop->opcode, wmt_complete_data_request()
391 mmc_detect_change(priv->mmc, 0); wmt_mci_regular_isr()
420 wmt_mci_read_response(priv->mmc); wmt_mci_regular_isr()
424 mmc_request_done(priv->mmc, priv->req); wmt_mci_regular_isr()
465 static void wmt_reset_hardware(struct mmc_host *mmc) wmt_reset_hardware() argument
470 priv = mmc_priv(mmc); wmt_reset_hardware()
504 static int wmt_dma_init(struct mmc_host *mmc) wmt_dma_init() argument
508 priv = mmc_priv(mmc); wmt_dma_init()
528 static void wmt_dma_config(struct mmc_host *mmc, u32 descaddr, u8 dir) wmt_dma_config() argument
533 priv = mmc_priv(mmc); wmt_dma_config()
562 static void wmt_mci_request(struct mmc_host *mmc, struct mmc_request *req) wmt_mci_request() argument
579 priv = mmc_priv(mmc); wmt_mci_request()
602 wmt_mci_send_command(mmc, command, cmdtype, arg, rsptype); wmt_mci_request()
610 wmt_dma_init(mmc); wmt_mci_request()
623 sg_cnt = dma_map_sg(mmc_dev(mmc), req->data->sg, wmt_mci_request()
629 sg_cnt = dma_map_sg(mmc_dev(mmc), req->data->sg, wmt_mci_request()
657 wmt_dma_config(mmc, priv->dma_desc_device_addr, wmt_mci_request()
660 wmt_dma_config(mmc, priv->dma_desc_device_addr, wmt_mci_request()
663 wmt_mci_send_command(mmc, command, cmdtype, arg, rsptype); wmt_mci_request()
673 static void wmt_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) wmt_mci_set_ios() argument
678 priv = mmc_priv(mmc); wmt_mci_set_ios()
681 wmt_reset_hardware(mmc); wmt_mci_set_ios()
713 static int wmt_mci_get_ro(struct mmc_host *mmc) wmt_mci_get_ro() argument
715 struct wmt_mci_priv *priv = mmc_priv(mmc); wmt_mci_get_ro()
720 static int wmt_mci_get_cd(struct mmc_host *mmc) wmt_mci_get_cd() argument
722 struct wmt_mci_priv *priv = mmc_priv(mmc); wmt_mci_get_cd()
754 struct mmc_host *mmc; wmt_mci_probe() local
784 mmc = mmc_alloc_host(sizeof(struct wmt_mci_priv), &pdev->dev); wmt_mci_probe()
785 if (!mmc) { wmt_mci_probe()
791 mmc->ops = &wmt_mci_ops; wmt_mci_probe()
792 mmc->f_min = wmt_caps->f_min; wmt_mci_probe()
793 mmc->f_max = wmt_caps->f_max; wmt_mci_probe()
794 mmc->ocr_avail = wmt_caps->ocr_avail; wmt_mci_probe()
795 mmc->caps = wmt_caps->caps; wmt_mci_probe()
797 mmc->max_seg_size = wmt_caps->max_seg_size; wmt_mci_probe()
798 mmc->max_segs = wmt_caps->max_segs; wmt_mci_probe()
799 mmc->max_blk_size = wmt_caps->max_blk_size; wmt_mci_probe()
801 mmc->max_req_size = (16*512*mmc->max_segs); wmt_mci_probe()
802 mmc->max_blk_count = mmc->max_req_size / 512; wmt_mci_probe()
804 priv = mmc_priv(mmc); wmt_mci_probe()
805 priv->mmc = mmc; wmt_mci_probe()
840 mmc->max_blk_count * 16, wmt_mci_probe()
849 platform_set_drvdata(pdev, mmc); wmt_mci_probe()
861 wmt_reset_hardware(mmc); wmt_mci_probe()
863 mmc_add_host(mmc); wmt_mci_probe()
875 mmc_free_host(mmc); wmt_mci_probe()
882 struct mmc_host *mmc; wmt_mci_remove() local
887 mmc = platform_get_drvdata(pdev); wmt_mci_remove()
888 priv = mmc_priv(mmc); wmt_mci_remove()
899 dma_free_coherent(&pdev->dev, priv->mmc->max_blk_count * 16, wmt_mci_remove()
902 mmc_remove_host(mmc); wmt_mci_remove()
915 mmc_free_host(mmc); wmt_mci_remove()
927 struct mmc_host *mmc = platform_get_drvdata(pdev); wmt_mci_suspend() local
930 if (!mmc) wmt_mci_suspend()
933 priv = mmc_priv(mmc); wmt_mci_suspend()
952 struct mmc_host *mmc = platform_get_drvdata(pdev); wmt_mci_resume() local
955 if (mmc) { wmt_mci_resume()
956 priv = mmc_priv(mmc); wmt_mci_resume()
H A Dtmio_mmc_pio.c2 * linux/drivers/mmc/host/tmio_mmc_pio.c
37 #include <linux/mmc/host.h>
38 #include <linux/mmc/mmc.h>
39 #include <linux/mmc/slot-gpio.h>
40 #include <linux/mmc/tmio.h>
47 #include <linux/mmc/sdio.h>
129 static void tmio_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable) tmio_mmc_enable_sdio_irq() argument
131 struct tmio_mmc_host *host = mmc_priv(mmc); tmio_mmc_enable_sdio_irq()
135 pm_runtime_get_sync(mmc_dev(mmc)); tmio_mmc_enable_sdio_irq()
148 pm_runtime_mark_last_busy(mmc_dev(mmc)); tmio_mmc_enable_sdio_irq()
149 pm_runtime_put_autosuspend(mmc_dev(mmc)); tmio_mmc_enable_sdio_irq()
159 for (clock = host->mmc->f_min, clk = 0x80000080; tmio_mmc_set_clock()
261 mmc_request_done(host->mmc, mrq); tmio_mmc_reset_work()
263 pm_runtime_mark_last_busy(mmc_dev(host->mmc)); tmio_mmc_reset_work()
264 pm_runtime_put_autosuspend(mmc_dev(host->mmc)); tmio_mmc_reset_work()
293 mmc_request_done(host->mmc, mrq); tmio_mmc_finish_request()
295 pm_runtime_mark_last_busy(mmc_dev(host->mmc)); tmio_mmc_finish_request()
296 pm_runtime_put_autosuspend(mmc_dev(host->mmc)); tmio_mmc_finish_request()
639 struct mmc_host *mmc = host->mmc; __tmio_mmc_card_detect_irq() local
645 if ((((ireg & TMIO_STAT_CARD_REMOVE) && mmc->card) || __tmio_mmc_card_detect_irq()
646 ((ireg & TMIO_STAT_CARD_INSERT) && !mmc->card)) && __tmio_mmc_card_detect_irq()
647 !work_pending(&mmc->detect.work)) __tmio_mmc_card_detect_irq()
648 mmc_detect_change(host->mmc, msecs_to_jiffies(100)); __tmio_mmc_card_detect_irq()
711 struct mmc_host *mmc = host->mmc; tmio_mmc_sdio_irq() local
728 if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ) tmio_mmc_sdio_irq()
729 mmc_signal_sdio_irq(mmc); tmio_mmc_sdio_irq()
763 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) { tmio_mmc_start_data()
768 mmc_hostname(host->mmc), data->blksz); tmio_mmc_start_data()
786 static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) tmio_mmc_request() argument
788 struct tmio_mmc_host *host = mmc_priv(mmc); tmio_mmc_request()
799 mmc_request_done(mmc, mrq); tmio_mmc_request()
810 pm_runtime_get_sync(mmc_dev(mmc)); tmio_mmc_request()
829 mmc_request_done(mmc, mrq); tmio_mmc_request()
831 pm_runtime_mark_last_busy(mmc_dev(mmc)); tmio_mmc_request()
832 pm_runtime_put_autosuspend(mmc_dev(mmc)); tmio_mmc_request()
837 struct mmc_host *mmc = host->mmc; tmio_mmc_clk_update() local
843 ret = host->clk_enable(host->pdev, &mmc->f_max); tmio_mmc_clk_update()
845 mmc->f_min = mmc->f_max / 512; tmio_mmc_clk_update()
852 struct mmc_host *mmc = host->mmc; tmio_mmc_power_on() local
860 if (!IS_ERR(mmc->supply.vmmc)) { tmio_mmc_power_on()
861 ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); tmio_mmc_power_on()
874 if (!IS_ERR(mmc->supply.vqmmc) && !ret) { tmio_mmc_power_on()
875 ret = regulator_enable(mmc->supply.vqmmc); tmio_mmc_power_on()
886 struct mmc_host *mmc = host->mmc; tmio_mmc_power_off() local
888 if (!IS_ERR(mmc->supply.vqmmc)) tmio_mmc_power_off()
889 regulator_disable(mmc->supply.vqmmc); tmio_mmc_power_off()
891 if (!IS_ERR(mmc->supply.vmmc)) tmio_mmc_power_off()
892 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); tmio_mmc_power_off()
917 static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) tmio_mmc_set_ios() argument
919 struct tmio_mmc_host *host = mmc_priv(mmc); tmio_mmc_set_ios()
923 pm_runtime_get_sync(mmc_dev(mmc)); tmio_mmc_set_ios()
982 pm_runtime_mark_last_busy(mmc_dev(mmc)); tmio_mmc_set_ios()
983 pm_runtime_put_autosuspend(mmc_dev(mmc)); tmio_mmc_set_ios()
986 static int tmio_mmc_get_ro(struct mmc_host *mmc) tmio_mmc_get_ro() argument
988 struct tmio_mmc_host *host = mmc_priv(mmc); tmio_mmc_get_ro()
990 int ret = mmc_gpio_get_ro(mmc); tmio_mmc_get_ro()
994 pm_runtime_get_sync(mmc_dev(mmc)); tmio_mmc_get_ro()
997 pm_runtime_mark_last_busy(mmc_dev(mmc)); tmio_mmc_get_ro()
998 pm_runtime_put_autosuspend(mmc_dev(mmc)); tmio_mmc_get_ro()
1026 struct mmc_host *mmc = host->mmc; tmio_mmc_init_ocr() local
1028 mmc_regulator_get_supply(mmc); tmio_mmc_init_ocr()
1031 if (!mmc->ocr_avail) tmio_mmc_init_ocr()
1032 mmc->ocr_avail = pdata->ocr_mask; tmio_mmc_init_ocr()
1038 if (!mmc->ocr_avail) tmio_mmc_init_ocr()
1051 if (of_get_property(np, "toshiba,mmc-wrprotect-disable", NULL)) tmio_mmc_of_parse()
1059 struct mmc_host *mmc; tmio_mmc_host_alloc() local
1061 mmc = mmc_alloc_host(sizeof(struct tmio_mmc_host), &pdev->dev); tmio_mmc_host_alloc()
1062 if (!mmc) tmio_mmc_host_alloc()
1065 host = mmc_priv(mmc); tmio_mmc_host_alloc()
1066 host->mmc = mmc; tmio_mmc_host_alloc()
1075 mmc_free_host(host->mmc); tmio_mmc_host_free()
1083 struct mmc_host *mmc = _host->mmc; tmio_mmc_host_probe() local
1097 ret = mmc_of_parse(mmc); tmio_mmc_host_probe()
1102 platform_set_drvdata(pdev, mmc); tmio_mmc_host_probe()
1117 mmc->ops = &tmio_mmc_ops; tmio_mmc_host_probe()
1118 mmc->caps |= MMC_CAP_4_BIT_DATA | pdata->capabilities; tmio_mmc_host_probe()
1119 mmc->caps2 |= pdata->capabilities2; tmio_mmc_host_probe()
1120 mmc->max_segs = 32; tmio_mmc_host_probe()
1121 mmc->max_blk_size = 512; tmio_mmc_host_probe()
1122 mmc->max_blk_count = (PAGE_CACHE_SIZE / mmc->max_blk_size) * tmio_mmc_host_probe()
1123 mmc->max_segs; tmio_mmc_host_probe()
1124 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; tmio_mmc_host_probe()
1125 mmc->max_seg_size = mmc->max_req_size; tmio_mmc_host_probe()
1128 mmc->caps & MMC_CAP_NEEDS_POLL || tmio_mmc_host_probe()
1129 mmc->caps & MMC_CAP_NONREMOVABLE || tmio_mmc_host_probe()
1130 mmc->slot.cd_irq >= 0); tmio_mmc_host_probe()
1133 mmc->f_max = pdata->hclk; tmio_mmc_host_probe()
1134 mmc->f_min = mmc->f_max / 512; tmio_mmc_host_probe()
1138 * Check the sanity of mmc->f_min to prevent tmio_mmc_set_clock() from tmio_mmc_host_probe()
1141 if (mmc->f_min == 0) { tmio_mmc_host_probe()
1191 ret = mmc_add_host(mmc); tmio_mmc_host_probe()
1200 ret = mmc_gpio_request_cd(mmc, pdata->cd_gpio, 0); tmio_mmc_host_probe()
1205 mmc_gpiod_request_cd_irq(mmc); tmio_mmc_host_probe()
1219 struct mmc_host *mmc = host->mmc; tmio_mmc_host_remove() local
1226 mmc_remove_host(mmc); tmio_mmc_host_remove()
1241 struct mmc_host *mmc = dev_get_drvdata(dev); tmio_mmc_host_runtime_suspend() local
1242 struct tmio_mmc_host *host = mmc_priv(mmc); tmio_mmc_host_runtime_suspend()
1258 struct mmc_host *mmc = dev_get_drvdata(dev); tmio_mmc_host_runtime_resume() local
1259 struct tmio_mmc_host *host = mmc_priv(mmc); tmio_mmc_host_runtime_resume()
H A Dbfin_sdh.c18 #include <linux/mmc/host.h>
59 struct mmc_host *mmc; member in struct:sdh_host
121 dev_dbg(mmc_dev(host->mmc), "%s enter flags: 0x%x\n", __func__, data->flags); sdh_setup_data()
158 host->dma_len = dma_map_sg(mmc_dev(host->mmc), data->sg, data->sg_len, host->dma_dir); sdh_setup_data()
174 dev_dbg(mmc_dev(host->mmc), "%d: start_addr:0x%lx, " sdh_setup_data()
206 dev_dbg(mmc_dev(host->mmc), "%s exit\n", __func__); sdh_setup_data()
215 dev_dbg(mmc_dev(host->mmc), "%s enter cmd: 0x%p\n", __func__, cmd); sdh_start_cmd()
246 dev_dbg(mmc_dev(host->mmc), "%s enter\n", __func__); sdh_finish_request()
250 mmc_request_done(host->mmc, mrq); sdh_finish_request()
258 dev_dbg(mmc_dev(host->mmc), "%s enter cmd: %p\n", __func__, cmd); sdh_cmd_done()
297 dev_dbg(mmc_dev(host->mmc), "%s enter stat: 0x%x\n", __func__, stat); sdh_data_done()
302 dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, sdh_data_done()
333 static void sdh_request(struct mmc_host *mmc, struct mmc_request *mrq) sdh_request() argument
335 struct sdh_host *host = mmc_priv(mmc); sdh_request()
338 dev_dbg(mmc_dev(host->mmc), "%s enter, mrp:%p, cmd:%p\n", __func__, mrq, mrq->cmd); sdh_request()
356 static void sdh_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) sdh_set_ios() argument
364 host = mmc_priv(mmc); sdh_set_ios()
450 dev_dbg(mmc_dev(host->mmc), "SDH: clk_div = 0x%x actual clock:%ld expected clock:%d\n", sdh_set_ios()
465 dev_dbg(mmc_dev(host->mmc), "%s enter, irq_stat: 0x%04lx\n", __func__, sdh_dma_irq()
479 dev_dbg(mmc_dev(host->mmc), "%s enter\n", __func__); sdh_stat_irq()
485 mmc_detect_change(host->mmc, 0); sdh_stat_irq()
502 dev_dbg(mmc_dev(host->mmc), "%s exit\n\n", __func__); sdh_stat_irq()
518 * mmc stack will do the detection. sdh_reset()
526 struct mmc_host *mmc; sdh_probe() local
537 mmc = mmc_alloc_host(sizeof(struct sdh_host), &pdev->dev); sdh_probe()
538 if (!mmc) { sdh_probe()
543 mmc->ops = &sdh_ops; sdh_probe()
545 mmc->max_segs = 1; sdh_probe()
547 mmc->max_segs = PAGE_SIZE / sizeof(struct dma_desc_array); sdh_probe()
550 mmc->max_seg_size = -1; sdh_probe()
552 mmc->max_seg_size = 1 << 16; sdh_probe()
554 mmc->max_blk_size = 1 << 11; sdh_probe()
555 mmc->max_blk_count = 1 << 11; sdh_probe()
556 mmc->max_req_size = PAGE_SIZE; sdh_probe()
557 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; sdh_probe()
558 mmc->f_max = get_sclk(); sdh_probe()
559 mmc->f_min = mmc->f_max >> 9; sdh_probe()
560 mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_NEEDS_POLL; sdh_probe()
561 host = mmc_priv(mmc); sdh_probe()
562 host->mmc = mmc; sdh_probe()
587 platform_set_drvdata(pdev, mmc); sdh_probe()
603 mmc_add_host(mmc); sdh_probe()
609 mmc_remove_host(mmc); sdh_probe()
614 mmc_free_host(mmc); sdh_probe()
621 struct mmc_host *mmc = platform_get_drvdata(pdev); sdh_remove() local
623 if (mmc) { sdh_remove()
624 struct sdh_host *host = mmc_priv(mmc); sdh_remove()
626 mmc_remove_host(mmc); sdh_remove()
633 mmc_free_host(mmc); sdh_remove()
H A Dmmci.c2 * linux/drivers/mmc/host/mmci.c - ARM PrimeCell MMCI PL180/1 driver
24 #include <linux/mmc/pm.h>
25 #include <linux/mmc/host.h>
26 #include <linux/mmc/card.h>
27 #include <linux/mmc/slot-gpio.h>
223 static int mmci_card_busy(struct mmc_host *mmc) mmci_card_busy() argument
225 struct mmci_host *host = mmc_priv(mmc); mmci_card_busy()
229 pm_runtime_get_sync(mmc_dev(mmc)); mmci_card_busy()
236 pm_runtime_mark_last_busy(mmc_dev(mmc)); mmci_card_busy()
237 pm_runtime_put_autosuspend(mmc_dev(mmc)); mmci_card_busy()
243 * Validate mmc prerequisites
252 dev_err(mmc_dev(host->mmc), mmci_validate_data()
359 host->mmc->actual_clock = host->cclk; mmci_set_clkreg()
361 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) mmci_set_clkreg()
363 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_8) mmci_set_clkreg()
366 if (host->mmc->ios.timing == MMC_TIMING_UHS_DDR50 || mmci_set_clkreg()
367 host->mmc->ios.timing == MMC_TIMING_MMC_DDR52) mmci_set_clkreg()
383 mmc_request_done(host->mmc, mrq); mmci_request_end()
385 pm_runtime_mark_last_busy(mmc_dev(host->mmc)); mmci_request_end()
386 pm_runtime_put_autosuspend(mmc_dev(host->mmc)); mmci_request_end()
435 host->dma_rx_channel = dma_request_slave_channel(mmc_dev(host->mmc), "rx"); mmci_dma_setup()
436 host->dma_tx_channel = dma_request_slave_channel(mmc_dev(host->mmc), "tx"); mmci_dma_setup()
459 dev_info(mmc_dev(host->mmc), "DMA channels RX %s, TX %s\n", mmci_dma_setup()
470 if (max_seg_size < host->mmc->max_seg_size) mmci_dma_setup()
471 host->mmc->max_seg_size = max_seg_size; mmci_dma_setup()
477 if (max_seg_size < host->mmc->max_seg_size) mmci_dma_setup()
478 host->mmc->max_seg_size = max_seg_size; mmci_dma_setup()
482 if (dml_hw_init(host, host->mmc->parent->of_node)) mmci_dma_setup()
501 dev_err(mmc_dev(host->mmc), "error during DMA transfer!\n"); mmci_dma_data_error()
557 dev_err(mmc_dev(host->mmc), "buggy DMA detected. Taking evasive action.\n"); mmci_dma_finalize()
658 dev_vdbg(mmc_dev(host->mmc), mmci_dma_start_data()
695 static void mmci_pre_request(struct mmc_host *mmc, struct mmc_request *mrq, mmci_pre_request() argument
698 struct mmci_host *host = mmc_priv(mmc); mmci_pre_request()
714 static void mmci_post_request(struct mmc_host *mmc, struct mmc_request *mrq, mmci_post_request() argument
717 struct mmci_host *host = mmc_priv(mmc); mmci_post_request()
790 dev_dbg(mmc_dev(host->mmc), "blksz %04x blks %04x flags %08x\n", mmci_start_data()
819 if (host->mmc->card && mmc_card_sdio(host->mmc->card)) { mmci_start_data()
840 if (host->mmc->ios.timing == MMC_TIMING_UHS_DDR50 || mmci_start_data()
841 host->mmc->ios.timing == MMC_TIMING_MMC_DDR52) mmci_start_data()
882 dev_dbg(mmc_dev(host->mmc), "op %02x arg %08x flags %08x\n", mmci_start_command()
937 dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ, status 0x%08x at 0x%08x\n", mmci_data_irq()
960 dev_err(mmc_dev(host->mmc), "stray MCI_DATABLOCKEND interrupt\n"); mmci_data_irq()
1163 dev_dbg(mmc_dev(host->mmc), "irq1 (pio) %08x\n", status); mmci_pio_irq()
1258 dev_dbg(mmc_dev(host->mmc), "irq0 (data+cmd) %08x\n", status); mmci_irq()
1280 static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq) mmci_request() argument
1282 struct mmci_host *host = mmc_priv(mmc); mmci_request()
1289 mmc_request_done(mmc, mrq); mmci_request()
1293 pm_runtime_get_sync(mmc_dev(mmc)); mmci_request()
1313 static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) mmci_set_ios() argument
1315 struct mmci_host *host = mmc_priv(mmc); mmci_set_ios()
1321 pm_runtime_get_sync(mmc_dev(mmc)); mmci_set_ios()
1324 host->plat->ios_handler(mmc_dev(mmc), ios)) mmci_set_ios()
1325 dev_err(mmc_dev(mmc), "platform ios_handler failed\n"); mmci_set_ios()
1329 if (!IS_ERR(mmc->supply.vmmc)) mmci_set_ios()
1330 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); mmci_set_ios()
1332 if (!IS_ERR(mmc->supply.vqmmc) && host->vqmmc_enabled) { mmci_set_ios()
1333 regulator_disable(mmc->supply.vqmmc); mmci_set_ios()
1339 if (!IS_ERR(mmc->supply.vmmc)) mmci_set_ios()
1340 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); mmci_set_ios()
1351 if (!IS_ERR(mmc->supply.vqmmc) && !host->vqmmc_enabled) { mmci_set_ios()
1352 ret = regulator_enable(mmc->supply.vqmmc); mmci_set_ios()
1354 dev_err(mmc_dev(mmc), mmci_set_ios()
1403 dev_err(mmc_dev(host->mmc), mmci_set_ios()
1418 pm_runtime_mark_last_busy(mmc_dev(mmc)); mmci_set_ios()
1419 pm_runtime_put_autosuspend(mmc_dev(mmc)); mmci_set_ios()
1422 static int mmci_get_cd(struct mmc_host *mmc) mmci_get_cd() argument
1424 struct mmci_host *host = mmc_priv(mmc); mmci_get_cd()
1426 unsigned int status = mmc_gpio_get_cd(mmc); mmci_get_cd()
1432 status = plat->status(mmc_dev(host->mmc)); mmci_get_cd()
1437 static int mmci_sig_volt_switch(struct mmc_host *mmc, struct mmc_ios *ios) mmci_sig_volt_switch() argument
1441 if (!IS_ERR(mmc->supply.vqmmc)) { mmci_sig_volt_switch()
1443 pm_runtime_get_sync(mmc_dev(mmc)); mmci_sig_volt_switch()
1447 ret = regulator_set_voltage(mmc->supply.vqmmc, mmci_sig_volt_switch()
1451 ret = regulator_set_voltage(mmc->supply.vqmmc, mmci_sig_volt_switch()
1455 ret = regulator_set_voltage(mmc->supply.vqmmc, mmci_sig_volt_switch()
1461 dev_warn(mmc_dev(mmc), "Voltage switch failed\n"); mmci_sig_volt_switch()
1463 pm_runtime_mark_last_busy(mmc_dev(mmc)); mmci_sig_volt_switch()
1464 pm_runtime_put_autosuspend(mmc_dev(mmc)); mmci_sig_volt_switch()
1480 static int mmci_of_parse(struct device_node *np, struct mmc_host *mmc) mmci_of_parse() argument
1482 struct mmci_host *host = mmc_priv(mmc); mmci_of_parse()
1483 int ret = mmc_of_parse(mmc); mmci_of_parse()
1501 if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL)) mmci_of_parse()
1502 mmc->caps |= MMC_CAP_MMC_HIGHSPEED; mmci_of_parse()
1503 if (of_get_property(np, "mmc-cap-sd-highspeed", NULL)) mmci_of_parse()
1504 mmc->caps |= MMC_CAP_SD_HIGHSPEED; mmci_of_parse()
1516 struct mmc_host *mmc; mmci_probe() local
1531 mmc = mmc_alloc_host(sizeof(struct mmci_host), &dev->dev); mmci_probe()
1532 if (!mmc) mmci_probe()
1535 ret = mmci_of_parse(np, mmc); mmci_probe()
1539 host = mmc_priv(mmc); mmci_probe()
1540 host->mmc = mmc; mmci_probe()
1544 dev_dbg(mmc_dev(mmc), "designer ID = 0x%02x\n", host->hw_designer); mmci_probe()
1545 dev_dbg(mmc_dev(mmc), "revision = 0x%01x\n", host->hw_revision); mmci_probe()
1575 dev_dbg(mmc_dev(mmc), "eventual mclk rate: %u Hz\n", mmci_probe()
1593 mmc->f_min = DIV_ROUND_UP(host->mclk, 257); mmci_probe()
1595 mmc->f_min = clk_round_rate(host->clk, 100000); mmci_probe()
1597 mmc->f_min = DIV_ROUND_UP(host->mclk, 512); mmci_probe()
1604 if (mmc->f_max) mmci_probe()
1605 mmc->f_max = variant->explicit_mclk_control ? mmci_probe()
1606 min(variant->f_max, mmc->f_max) : mmci_probe()
1607 min(host->mclk, mmc->f_max); mmci_probe()
1609 mmc->f_max = variant->explicit_mclk_control ? mmci_probe()
1613 dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max); mmci_probe()
1616 ret = mmc_regulator_get_supply(mmc); mmci_probe()
1620 if (!mmc->ocr_avail) mmci_probe()
1621 mmc->ocr_avail = plat->ocr_mask; mmci_probe()
1623 dev_warn(mmc_dev(mmc), "Platform OCR mask is ignored\n"); mmci_probe()
1628 mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH; mmci_probe()
1629 mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; mmci_probe()
1633 mmc->caps |= MMC_CAP_CMD23; mmci_probe()
1638 mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; mmci_probe()
1639 mmc->max_busy_timeout = 0; mmci_probe()
1642 mmc->ops = &mmci_ops; mmci_probe()
1645 mmc->pm_caps |= MMC_PM_KEEP_POWER; mmci_probe()
1650 mmc->max_segs = NR_SG; mmci_probe()
1657 mmc->max_req_size = (1 << variant->datalength_bits) - 1; mmci_probe()
1663 mmc->max_seg_size = mmc->max_req_size; mmci_probe()
1668 mmc->max_blk_size = 1 << 11; mmci_probe()
1674 mmc->max_blk_count = mmc->max_req_size >> 11; mmci_probe()
1690 ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL); mmci_probe()
1695 ret = mmc_gpio_request_cd(mmc, plat->gpio_cd, 0); mmci_probe()
1701 ret = mmc_gpiod_request_ro(mmc, "wp", 0, false, 0, NULL); mmci_probe()
1706 ret = mmc_gpio_request_ro(mmc, plat->gpio_wp); mmci_probe()
1729 amba_set_drvdata(dev, mmc); mmci_probe()
1732 mmc_hostname(mmc), amba_part(dev), amba_manf(dev), mmci_probe()
1741 mmc_add_host(mmc); mmci_probe()
1749 mmc_free_host(mmc); mmci_probe()
1755 struct mmc_host *mmc = amba_get_drvdata(dev); mmci_remove() local
1757 if (mmc) { mmci_remove()
1758 struct mmci_host *host = mmc_priv(mmc); mmci_remove()
1766 mmc_remove_host(mmc); mmci_remove()
1776 mmc_free_host(mmc); mmci_remove()
1820 struct mmc_host *mmc = amba_get_drvdata(adev); mmci_runtime_suspend() local
1822 if (mmc) { mmci_runtime_suspend()
1823 struct mmci_host *host = mmc_priv(mmc); mmci_runtime_suspend()
1835 struct mmc_host *mmc = amba_get_drvdata(adev); mmci_runtime_resume() local
1837 if (mmc) { mmci_runtime_resume()
1838 struct mmci_host *host = mmc_priv(mmc); mmci_runtime_resume()
H A Ddavinci_mmc.c29 #include <linux/mmc/host.h>
36 #include <linux/mmc/mmc.h>
41 #include <linux/platform_data/mmc-davinci.h>
184 struct mmc_host *mmc; member in struct:mmc_davinci_host
288 dev_dbg(mmc_dev(host->mmc), "CMD%d, arg 0x%08x%s\n", mmc_davinci_start_command()
329 dev_dbg(mmc_dev(host->mmc), "unknown resp_type %04x\n", mmc_davinci_start_command()
442 dev_dbg(mmc_dev(host->mmc), mmc_davinci_send_dma_request()
464 dev_dbg(mmc_dev(host->mmc), mmc_davinci_send_dma_request()
485 host->sg_len = dma_map_sg(mmc_dev(host->mmc), data->sg, data->sg_len, mmc_davinci_start_dma_transfer()
493 dma_unmap_sg(mmc_dev(host->mmc), mmc_davinci_start_dma_transfer()
528 &host->txdma, mmc_dev(host->mmc), "tx"); davinci_acquire_dma_channels()
530 dev_err(mmc_dev(host->mmc), "Can't get dma_tx channel\n"); davinci_acquire_dma_channels()
536 &host->rxdma, mmc_dev(host->mmc), "rx"); davinci_acquire_dma_channels()
538 dev_err(mmc_dev(host->mmc), "Can't get dma_rx channel\n"); davinci_acquire_dma_channels()
571 dev_dbg(mmc_dev(host->mmc), "%s %s, %d blocks of %d bytes\n", mmc_davinci_prepare_data()
575 dev_dbg(mmc_dev(host->mmc), " DTO %d cycles + %d ns\n", mmc_davinci_prepare_data()
628 static void mmc_davinci_request(struct mmc_host *mmc, struct mmc_request *req) mmc_davinci_request() argument
630 struct mmc_davinci_host *host = mmc_priv(mmc); mmc_davinci_request()
644 dev_err(mmc_dev(host->mmc), "still BUSY? bad ... \n"); mmc_davinci_request()
646 mmc_request_done(mmc, req); mmc_davinci_request()
683 static void calculate_clk_divider(struct mmc_host *mmc, struct mmc_ios *ios) calculate_clk_divider() argument
687 struct mmc_davinci_host *host = mmc_priv(mmc); calculate_clk_divider()
729 static void mmc_davinci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) mmc_davinci_set_ios() argument
731 struct mmc_davinci_host *host = mmc_priv(mmc); mmc_davinci_set_ios()
732 struct platform_device *pdev = to_platform_device(mmc->parent); mmc_davinci_set_ios()
735 dev_dbg(mmc_dev(host->mmc), mmc_davinci_set_ios()
753 dev_dbg(mmc_dev(host->mmc), "Enabling 8 bit mode\n"); mmc_davinci_set_ios()
759 dev_dbg(mmc_dev(host->mmc), "Enabling 4 bit mode\n"); mmc_davinci_set_ios()
770 dev_dbg(mmc_dev(host->mmc), "Enabling 1 bit mode\n"); mmc_davinci_set_ios()
782 calculate_clk_divider(mmc, ios); mmc_davinci_set_ios()
802 dev_warn(mmc_dev(host->mmc), "powerup timeout\n"); mmc_davinci_set_ios()
813 if (host->mmc->caps & MMC_CAP_SDIO_IRQ) { mmc_davinci_xfer_done()
822 mmc_signal_sdio_irq(host->mmc); mmc_davinci_xfer_done()
829 dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, mmc_davinci_xfer_done()
838 mmc_request_done(host->mmc, data->mrq); mmc_davinci_xfer_done()
866 mmc_request_done(host->mmc, cmd->mrq); mmc_davinci_cmd_done()
901 dev_dbg(mmc_dev(host->mmc), mmc_davinci_sdio_irq()
904 mmc_signal_sdio_irq(host->mmc); mmc_davinci_sdio_irq()
919 dev_dbg(mmc_dev(host->mmc), mmc_davinci_irq()
977 dev_err(mmc_dev(host->mmc), mmc_davinci_irq()
987 dev_dbg(mmc_dev(host->mmc), mmc_davinci_irq()
1011 dev_dbg(mmc_dev(host->mmc), "data %s %s error\n", mmc_davinci_irq()
1021 dev_dbg(mmc_dev(host->mmc), mmc_davinci_irq()
1035 dev_dbg(mmc_dev(host->mmc), "Command CRC error\n"); mmc_davinci_irq()
1054 static int mmc_davinci_get_cd(struct mmc_host *mmc) mmc_davinci_get_cd() argument
1056 struct platform_device *pdev = to_platform_device(mmc->parent); mmc_davinci_get_cd()
1064 static int mmc_davinci_get_ro(struct mmc_host *mmc) mmc_davinci_get_ro() argument
1066 struct platform_device *pdev = to_platform_device(mmc->parent); mmc_davinci_get_ro()
1074 static void mmc_davinci_enable_sdio_irq(struct mmc_host *mmc, int enable) mmc_davinci_enable_sdio_irq() argument
1076 struct mmc_davinci_host *host = mmc_priv(mmc); mmc_davinci_enable_sdio_irq()
1081 mmc_signal_sdio_irq(host->mmc); mmc_davinci_enable_sdio_irq()
1110 struct mmc_host *mmc; mmc_davinci_cpufreq_transition() local
1114 mmc = host->mmc; mmc_davinci_cpufreq_transition()
1118 spin_lock_irqsave(&mmc->lock, flags); mmc_davinci_cpufreq_transition()
1120 calculate_clk_divider(mmc, &mmc->ios); mmc_davinci_cpufreq_transition()
1121 spin_unlock_irqrestore(&mmc->lock, flags); mmc_davinci_cpufreq_transition()
1166 .name = "dm6441-mmc",
1169 .name = "da830-mmc",
1178 .compatible = "ti,dm6441-mmc",
1182 .compatible = "ti,da830-mmc",
1233 struct mmc_host *mmc = NULL; davinci_mmcsd_probe() local
1258 mmc = mmc_alloc_host(sizeof(struct mmc_davinci_host), &pdev->dev); davinci_mmcsd_probe()
1259 if (!mmc) davinci_mmcsd_probe()
1262 host = mmc_priv(mmc); davinci_mmcsd_probe()
1263 host->mmc = mmc; /* Important */ davinci_mmcsd_probe()
1307 mmc->caps |= MMC_CAP_NEEDS_POLL; davinci_mmcsd_probe()
1308 mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; davinci_mmcsd_probe()
1311 mmc->caps |= MMC_CAP_4_BIT_DATA; davinci_mmcsd_probe()
1314 mmc->caps |= (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA); davinci_mmcsd_probe()
1320 mmc->ops = &mmc_davinci_ops; davinci_mmcsd_probe()
1321 mmc->f_min = 312500; davinci_mmcsd_probe()
1322 mmc->f_max = 25000000; davinci_mmcsd_probe()
1324 mmc->f_max = pdata->max_freq; davinci_mmcsd_probe()
1326 mmc->caps |= pdata->caps; davinci_mmcsd_probe()
1327 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; davinci_mmcsd_probe()
1333 mmc->max_segs = MAX_NR_SG; davinci_mmcsd_probe()
1336 mmc->max_seg_size = MAX_CCNT * rw_threshold; davinci_mmcsd_probe()
1339 mmc->max_blk_size = 4095; /* BLEN is 12 bits */ davinci_mmcsd_probe()
1340 mmc->max_blk_count = 65535; /* NBLK is 16 bits */ davinci_mmcsd_probe()
1341 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; davinci_mmcsd_probe()
1343 dev_dbg(mmc_dev(host->mmc), "max_segs=%d\n", mmc->max_segs); davinci_mmcsd_probe()
1344 dev_dbg(mmc_dev(host->mmc), "max_blk_size=%d\n", mmc->max_blk_size); davinci_mmcsd_probe()
1345 dev_dbg(mmc_dev(host->mmc), "max_req_size=%d\n", mmc->max_req_size); davinci_mmcsd_probe()
1346 dev_dbg(mmc_dev(host->mmc), "max_seg_size=%d\n", mmc->max_seg_size); davinci_mmcsd_probe()
1356 ret = mmc_add_host(mmc); davinci_mmcsd_probe()
1360 ret = request_irq(irq, mmc_davinci_irq, 0, mmc_hostname(mmc), host); davinci_mmcsd_probe()
1366 mmc_hostname(mmc), host); davinci_mmcsd_probe()
1368 mmc->caps |= MMC_CAP_SDIO_IRQ; davinci_mmcsd_probe()
1371 rename_region(mem, mmc_hostname(mmc)); davinci_mmcsd_probe()
1373 dev_info(mmc_dev(host->mmc), "Using %s, %d-bit mode\n", davinci_mmcsd_probe()
1375 (mmc->caps & MMC_CAP_4_BIT_DATA) ? 4 : 1); davinci_mmcsd_probe()
1394 if (mmc) davinci_mmcsd_probe()
1395 mmc_free_host(mmc); davinci_mmcsd_probe()
1412 mmc_remove_host(host->mmc); davinci_mmcsd_remove()
1414 if (host->mmc->caps & MMC_CAP_SDIO_IRQ) davinci_mmcsd_remove()
1426 mmc_free_host(host->mmc); davinci_mmcsd_remove()
H A Dmxs-mmc.c38 #include <linux/mmc/host.h>
39 #include <linux/mmc/mmc.h>
40 #include <linux/mmc/sdio.h>
41 #include <linux/mmc/slot-gpio.h>
48 #define DRIVER_NAME "mxs-mmc"
65 struct mmc_host *mmc; member in struct:mxs_mmc_host
76 static int mxs_mmc_get_cd(struct mmc_host *mmc) mxs_mmc_get_cd() argument
78 struct mxs_mmc_host *host = mmc_priv(mmc); mxs_mmc_get_cd()
85 ret = mmc_gpio_get_cd(mmc); mxs_mmc_get_cd()
89 present = mmc->caps & MMC_CAP_NEEDS_POLL || mxs_mmc_get_cd()
93 if (mmc->caps2 & MMC_CAP2_CD_ACTIVE_HIGH) mxs_mmc_get_cd()
157 dma_unmap_sg(mmc_dev(host->mmc), data->sg, mxs_mmc_request_done()
176 mmc_request_done(host->mmc, mrq); mxs_mmc_request_done()
203 mmc_signal_sdio_irq(host->mmc); mxs_mmc_irq_handler()
235 dma_map_sg(mmc_dev(host->mmc), data->sg, mxs_mmc_prep_dma()
252 dma_unmap_sg(mmc_dev(host->mmc), data->sg, mxs_mmc_prep_dma()
289 dev_warn(mmc_dev(host->mmc), mxs_mmc_bc()
331 dev_warn(mmc_dev(host->mmc), mxs_mmc_ac()
461 dev_warn(mmc_dev(host->mmc), mxs_mmc_adtc()
484 dev_warn(mmc_dev(host->mmc), mxs_mmc_start_cmd()
490 static void mxs_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) mxs_mmc_request() argument
492 struct mxs_mmc_host *host = mmc_priv(mmc); mxs_mmc_request()
499 static void mxs_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) mxs_mmc_set_ios() argument
501 struct mxs_mmc_host *host = mmc_priv(mmc); mxs_mmc_set_ios()
514 static void mxs_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable) mxs_mmc_enable_sdio_irq() argument
516 struct mxs_mmc_host *host = mmc_priv(mmc); mxs_mmc_enable_sdio_irq()
540 mmc_signal_sdio_irq(host->mmc); mxs_mmc_enable_sdio_irq()
554 .name = "imx23-mmc",
557 .name = "imx28-mmc",
566 { .compatible = "fsl,imx23-mmc", .data = (void *) IMX23_SSP, },
567 { .compatible = "fsl,imx28-mmc", .data = (void *) IMX28_SSP, },
578 struct mmc_host *mmc; mxs_mmc_probe() local
588 mmc = mmc_alloc_host(sizeof(struct mxs_mmc_host), &pdev->dev); mxs_mmc_probe()
589 if (!mmc) mxs_mmc_probe()
592 host = mmc_priv(mmc); mxs_mmc_probe()
604 host->mmc = mmc; mxs_mmc_probe()
628 dev_err(&pdev->dev, "Failed to reset mmc: %d\n", ret); mxs_mmc_probe()
634 dev_err(mmc_dev(host->mmc), mxs_mmc_probe()
640 /* set mmc core parameters */ mxs_mmc_probe()
641 mmc->ops = &mxs_mmc_ops; mxs_mmc_probe()
642 mmc->caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | mxs_mmc_probe()
647 mmc->f_min = 400000; mxs_mmc_probe()
648 mmc->f_max = 288000000; mxs_mmc_probe()
650 ret = mmc_of_parse(mmc); mxs_mmc_probe()
654 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; mxs_mmc_probe()
656 mmc->max_segs = 52; mxs_mmc_probe()
657 mmc->max_blk_size = 1 << 0xf; mxs_mmc_probe()
658 mmc->max_blk_count = (ssp_is_old(ssp)) ? 0xff : 0xffffff; mxs_mmc_probe()
659 mmc->max_req_size = (ssp_is_old(ssp)) ? 0xffff : 0xffffffff; mxs_mmc_probe()
660 mmc->max_seg_size = dma_get_max_seg_size(ssp->dmach->device->dev); mxs_mmc_probe()
662 platform_set_drvdata(pdev, mmc); mxs_mmc_probe()
671 ret = mmc_add_host(mmc); mxs_mmc_probe()
675 dev_info(mmc_dev(host->mmc), "initialized\n"); mxs_mmc_probe()
684 mmc_free_host(mmc); mxs_mmc_probe()
690 struct mmc_host *mmc = platform_get_drvdata(pdev); mxs_mmc_remove() local
691 struct mxs_mmc_host *host = mmc_priv(mmc); mxs_mmc_remove()
694 mmc_remove_host(mmc); mxs_mmc_remove()
701 mmc_free_host(mmc); mxs_mmc_remove()
709 struct mmc_host *mmc = dev_get_drvdata(dev); mxs_mmc_suspend() local
710 struct mxs_mmc_host *host = mmc_priv(mmc); mxs_mmc_suspend()
719 struct mmc_host *mmc = dev_get_drvdata(dev); mxs_mmc_resume() local
720 struct mxs_mmc_host *host = mmc_priv(mmc); mxs_mmc_resume()
H A Dpxamci.c2 * linux/drivers/mmc/host/pxa.c - PXA MMCI driver
28 #include <linux/mmc/host.h>
41 #include <linux/platform_data/mmc-pxamci.h>
54 struct mmc_host *mmc; member in struct:pxamci_host
86 host->vcc = regulator_get_optional(mmc_dev(host->mmc), "vmmc"); pxamci_init_ocr()
91 host->mmc->ocr_avail = mmc_regulator_get_ocrmask(host->vcc); pxamci_init_ocr()
93 dev_warn(mmc_dev(host->mmc), pxamci_init_ocr()
99 host->mmc->ocr_avail = host->pdata ? pxamci_init_ocr()
115 ret = mmc_regulator_set_ocr(host->mmc, host->vcc, vdd); pxamci_set_power()
119 ret = mmc_regulator_set_ocr(host->mmc, host->vcc, 0); pxamci_set_power()
131 return host->pdata->setpower(mmc_dev(host->mmc), vdd); pxamci_set_power()
152 dev_err(mmc_dev(host->mmc), "unable to stop clock\n"); pxamci_stop_clock()
212 host->dma_len = dma_map_sg(mmc_dev(host->mmc), data->sg, data->sg_len, pxamci_setup_data()
296 mmc_request_done(host->mmc, mrq); pxamci_finish_request()
362 dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, pxamci_data_done()
412 mmc_signal_sdio_irq(host->mmc); pxamci_irq()
420 static void pxamci_request(struct mmc_host *mmc, struct mmc_request *mrq) pxamci_request() argument
422 struct pxamci_host *host = mmc_priv(mmc); pxamci_request()
449 static int pxamci_get_ro(struct mmc_host *mmc) pxamci_get_ro() argument
451 struct pxamci_host *host = mmc_priv(mmc); pxamci_get_ro()
460 return !!host->pdata->get_ro(mmc_dev(mmc)); pxamci_get_ro()
462 * Board doesn't support read only detection; let the mmc core pxamci_get_ro()
468 static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) pxamci_set_ios() argument
470 struct pxamci_host *host = mmc_priv(mmc); pxamci_set_ios()
515 dev_err(mmc_dev(mmc), "unable to set power\n"); pxamci_set_ios()
534 dev_dbg(mmc_dev(mmc), "PXAMCI: clkrt = %x cmdat = %x\n", pxamci_set_ios()
565 mmc_hostname(host->mmc), dma, dcsr); pxamci_dma_irq()
581 { .compatible = "marvell,pxa-mmc" },
605 /* pxa-mmc specific */ pxamci_of_init()
607 of_get_named_gpio(np, "pxa-mmc,gpio-power", 0); pxamci_of_init()
609 if (of_property_read_u32(np, "pxa-mmc,detect-delay-ms", &tmp) == 0) pxamci_of_init()
625 struct mmc_host *mmc; pxamci_probe() local
643 mmc = mmc_alloc_host(sizeof(struct pxamci_host), &pdev->dev); pxamci_probe()
644 if (!mmc) { pxamci_probe()
649 mmc->ops = &pxamci_ops; pxamci_probe()
655 mmc->max_segs = NR_SG; pxamci_probe()
660 mmc->max_seg_size = PAGE_SIZE; pxamci_probe()
665 mmc->max_blk_size = cpu_is_pxa25x() ? 1023 : 2048; pxamci_probe()
670 mmc->max_blk_count = 65535; pxamci_probe()
672 host = mmc_priv(mmc); pxamci_probe()
673 host->mmc = mmc; pxamci_probe()
690 mmc->f_min = (host->clkrate + 63) / 64; pxamci_probe()
691 mmc->f_max = (mmc_has_26MHz()) ? 26000000 : host->clkrate; pxamci_probe()
695 mmc->caps = 0; pxamci_probe()
698 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; pxamci_probe()
701 mmc->caps |= MMC_CAP_MMC_HIGHSPEED | pxamci_probe()
742 platform_set_drvdata(pdev, mmc); pxamci_probe()
764 ret = gpio_request(gpio_power, "mmc card power"); pxamci_probe()
773 ret = gpio_request(gpio_ro, "mmc card read only"); pxamci_probe()
781 ret = gpio_request(gpio_cd, "mmc card detect"); pxamci_probe()
790 "mmc card detect", mmc); pxamci_probe()
798 host->pdata->init(&pdev->dev, pxamci_detect_irq, mmc); pxamci_probe()
805 mmc_add_host(mmc); pxamci_probe()
826 if (mmc) pxamci_probe()
827 mmc_free_host(mmc); pxamci_probe()
834 struct mmc_host *mmc = platform_get_drvdata(pdev); pxamci_remove() local
837 if (mmc) { pxamci_remove()
838 struct pxamci_host *host = mmc_priv(mmc); pxamci_remove()
840 mmc_remove_host(mmc); pxamci_remove()
848 free_irq(gpio_to_irq(gpio_cd), mmc); pxamci_remove() local
859 host->pdata->exit(&pdev->dev, mmc); pxamci_remove()
878 mmc_free_host(mmc); pxamci_remove()
H A Dmxcmmc.c2 * linux/drivers/mmc/host/mxcmmc.c - Freescale i.MX MMCI driver
28 #include <linux/mmc/host.h>
29 #include <linux/mmc/card.h>
41 #include <linux/mmc/slot-gpio.h>
45 #include <linux/platform_data/mmc-mxcmmc.h>
49 #define DRIVER_NAME "mxc-mmc"
126 struct mmc_host *mmc; member in struct:mxcmci_host
167 .name = "imx21-mmc",
170 .name = "imx31-mmc",
183 .compatible = "fsl,imx21-mmc",
186 .compatible = "fsl,imx31-mmc",
243 if (!IS_ERR(host->mmc->supply.vmmc)) { mxcmci_set_power()
245 mmc_regulator_set_ocr(host->mmc, mxcmci_set_power()
246 host->mmc->supply.vmmc, vdd); mxcmci_set_power()
248 mmc_regulator_set_ocr(host->mmc, mxcmci_set_power()
249 host->mmc->supply.vmmc, 0); mxcmci_set_power()
253 host->pdata->setpower(mmc_dev(host->mmc), vdd); mxcmci_set_power()
265 dev_dbg(mmc_dev(host->mmc), "mxcmci_softreset\n"); mxcmci_softreset()
377 dev_dbg(mmc_dev(host->mmc), "%s: 0x%08x\n", __func__, stat); mxcmci_dma_callback()
405 dev_err(mmc_dev(host->mmc), "unhandled response type 0x%x\n", mxcmci_start_cmd()
451 mmc_request_done(host->mmc, req); mxcmci_finish_request()
466 dev_dbg(mmc_dev(host->mmc), "request failed. status: 0x%08x\n", mxcmci_finish_data()
469 dev_err(mmc_dev(host->mmc), "%s: -EILSEQ\n", __func__); mxcmci_finish_data()
474 dev_err(mmc_dev(host->mmc), mxcmci_finish_data()
478 dev_err(mmc_dev(host->mmc), mxcmci_finish_data()
483 dev_err(mmc_dev(host->mmc), mxcmci_finish_data()
487 dev_err(mmc_dev(host->mmc), "%s: -EIO\n", __func__); mxcmci_finish_data()
511 dev_dbg(mmc_dev(host->mmc), "CMD TIMEOUT\n"); mxcmci_read_response()
514 dev_dbg(mmc_dev(host->mmc), "cmd crc error\n"); mxcmci_read_response()
736 dev_dbg(mmc_dev(host->mmc), "%s: 0x%08x\n", __func__, stat); mxcmci_irq()
747 mmc_signal_sdio_irq(host->mmc); mxcmci_irq()
760 mmc_detect_change(host->mmc, msecs_to_jiffies(200)); mxcmci_irq()
765 static void mxcmci_request(struct mmc_host *mmc, struct mmc_request *req) mxcmci_request() argument
767 struct mxcmci_host *host = mmc_priv(mmc); mxcmci_request()
829 dev_dbg(mmc_dev(host->mmc), "scaler: %d divider: %d in: %d out: %d\n", mxcmci_set_clk_rate()
833 static int mxcmci_setup_dma(struct mmc_host *mmc) mxcmci_setup_dma() argument
835 struct mxcmci_host *host = mmc_priv(mmc); mxcmci_setup_dma()
849 static void mxcmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) mxcmci_set_ios() argument
851 struct mxcmci_host *host = mmc_priv(mmc); mxcmci_set_ios()
865 ret = mxcmci_setup_dma(mmc); mxcmci_set_ios()
867 dev_err(mmc_dev(host->mmc), mxcmci_set_ios()
900 struct mmc_host *mmc = data; mxcmci_detect_irq() local
902 dev_dbg(mmc_dev(mmc), "%s\n", __func__); mxcmci_detect_irq()
904 mmc_detect_change(mmc, msecs_to_jiffies(250)); mxcmci_detect_irq()
908 static int mxcmci_get_ro(struct mmc_host *mmc) mxcmci_get_ro() argument
910 struct mxcmci_host *host = mmc_priv(mmc); mxcmci_get_ro()
913 return !!host->pdata->get_ro(mmc_dev(mmc)); mxcmci_get_ro()
916 * context or gpio is invalid), then let the mmc core decide mxcmci_get_ro()
919 return mmc_gpio_get_ro(mmc); mxcmci_get_ro()
922 static void mxcmci_enable_sdio_irq(struct mmc_host *mmc, int enable) mxcmci_enable_sdio_irq() argument
924 struct mxcmci_host *host = mmc_priv(mmc); mxcmci_enable_sdio_irq()
972 struct mmc_host *mmc = (struct mmc_host *)data; mxcmci_watchdog() local
973 struct mxcmci_host *host = mmc_priv(mmc); mxcmci_watchdog()
979 dev_err(mmc_dev(host->mmc), mxcmci_watchdog()
983 dev_err(mmc_dev(host->mmc), mxcmci_watchdog()
996 mmc_request_done(host->mmc, req); mxcmci_watchdog()
1009 struct mmc_host *mmc; mxcmci_probe() local
1027 mmc = mmc_alloc_host(sizeof(*host), &pdev->dev); mxcmci_probe()
1028 if (!mmc) mxcmci_probe()
1031 host = mmc_priv(mmc); mxcmci_probe()
1041 ret = mmc_of_parse(mmc); mxcmci_probe()
1044 mmc->ops = &mxcmci_ops; mxcmci_probe()
1048 mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; mxcmci_probe()
1050 mmc->caps |= MMC_CAP_SDIO_IRQ; mxcmci_probe()
1053 mmc->max_blk_size = 2048; mxcmci_probe()
1054 mmc->max_blk_count = 65535; mxcmci_probe()
1055 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; mxcmci_probe()
1056 mmc->max_seg_size = mmc->max_req_size; mxcmci_probe()
1067 mmc->max_segs = 64; mxcmci_probe()
1069 host->mmc = mmc; mxcmci_probe()
1075 else if (!(mmc->caps & MMC_CAP_NONREMOVABLE) mxcmci_probe()
1079 ret = mmc_regulator_get_supply(mmc); mxcmci_probe()
1083 if (!mmc->ocr_avail) { mxcmci_probe()
1085 mmc->ocr_avail = pdata->ocr_avail; mxcmci_probe()
1087 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; mxcmci_probe()
1116 dev_err(mmc_dev(host->mmc), "wrong rev.no. 0x%08x. aborting.\n", mxcmci_probe()
1121 mmc->f_min = clk_get_rate(host->clk_per) >> 16; mxcmci_probe()
1122 mmc->f_max = clk_get_rate(host->clk_per) >> 1; mxcmci_probe()
1144 mmc->max_seg_size = dma_get_max_seg_size( mxcmci_probe()
1147 dev_info(mmc_dev(host->mmc), "dma not available. Using PIO\n"); mxcmci_probe()
1156 platform_set_drvdata(pdev, mmc); mxcmci_probe()
1160 host->mmc); mxcmci_probe()
1167 host->watchdog.data = (unsigned long)mmc; mxcmci_probe()
1169 mmc_add_host(mmc); mxcmci_probe()
1182 mmc_free_host(mmc); mxcmci_probe()
1189 struct mmc_host *mmc = platform_get_drvdata(pdev); mxcmci_remove() local
1190 struct mxcmci_host *host = mmc_priv(mmc); mxcmci_remove()
1192 mmc_remove_host(mmc); mxcmci_remove()
1195 host->pdata->exit(&pdev->dev, mmc); mxcmci_remove()
1203 mmc_free_host(mmc); mxcmci_remove()
1210 struct mmc_host *mmc = dev_get_drvdata(dev); mxcmci_suspend() local
1211 struct mxcmci_host *host = mmc_priv(mmc); mxcmci_suspend()
1220 struct mmc_host *mmc = dev_get_drvdata(dev); mxcmci_resume() local
1221 struct mxcmci_host *host = mmc_priv(mmc); mxcmci_resume()
1246 MODULE_ALIAS("platform:mxc-mmc");
H A Domap.c2 * linux/drivers/mmc/host/omap.c
27 #include <linux/mmc/host.h>
28 #include <linux/mmc/card.h>
29 #include <linux/mmc/mmc.h>
33 #include <linux/platform_data/mmc-omap.h>
116 struct mmc_host *mmc; member in struct:mmc_omap_slot
125 struct mmc_host * mmc; member in struct:mmc_omap_host
208 while (host->mmc != NULL) { mmc_omap_select_slot()
210 wait_event(host->slot_wq, host->mmc == NULL); mmc_omap_select_slot()
213 host->mmc = slot->mmc; mmc_omap_select_slot()
223 host->pdata->switch_slot(mmc_dev(slot->mmc), slot->id); mmc_omap_select_slot()
264 BUG_ON(slot == NULL || host->mmc == NULL); mmc_omap_release_slot()
289 host->mmc = new_slot->mmc; mmc_omap_release_slot()
295 host->mmc = NULL; mmc_omap_release_slot()
304 return slot->pdata->get_cover_state(mmc_dev(slot->mmc), mmc_omap_cover_is_open()
313 struct mmc_host *mmc = container_of(dev, struct mmc_host, class_dev); mmc_omap_show_cover_switch() local
314 struct mmc_omap_slot *slot = mmc_priv(mmc); mmc_omap_show_cover_switch()
326 struct mmc_host *mmc = container_of(dev, struct mmc_host, class_dev); mmc_omap_show_slot_name() local
327 struct mmc_omap_slot *slot = mmc_priv(mmc); mmc_omap_show_slot_name()
363 dev_err(mmc_dev(host->mmc), "Invalid response type: %04x\n", mmc_resp_type(cmd)); mmc_omap_start_command()
409 struct device *dev = mmc_dev(host->mmc); mmc_omap_release_dma()
459 struct mmc_host *mmc; mmc_omap_xfer_done() local
462 mmc = host->mmc; mmc_omap_xfer_done()
464 mmc_request_done(mmc, data->mrq); mmc_omap_xfer_done()
582 struct mmc_host *mmc; mmc_omap_cmd_done() local
587 mmc = host->mmc; mmc_omap_cmd_done()
589 mmc_request_done(mmc, cmd->mrq); mmc_omap_cmd_done()
603 dev_dbg(mmc_dev(host->mmc), "Aborting stuck command CMD%d\n", mmc_omap_abort_command()
611 struct mmc_host *mmc; mmc_omap_abort_command() local
618 mmc = host->mmc; mmc_omap_abort_command()
620 mmc_request_done(mmc, cmd->mrq); mmc_omap_abort_command()
713 dev_vdbg(mmc_dev(host->mmc), "%s\n", res); mmc_omap_report_irq()
732 dev_info(mmc_dev(host->slots[0]->mmc), mmc_omap_irq()
754 dev_dbg(mmc_dev(host->mmc), "MMC IRQ %04x (CMD %d): ", mmc_omap_irq()
770 dev_dbg(mmc_dev(host->mmc), "data timeout (CMD%d)\n", mmc_omap_irq()
781 dev_dbg(mmc_dev(host->mmc), mmc_omap_irq()
786 dev_dbg(mmc_dev(host->mmc), "data CRC error\n"); mmc_omap_irq()
797 dev_err(mmc_dev(host->mmc), mmc_omap_irq()
808 dev_err(mmc_dev(host->mmc), mmc_omap_irq()
815 dev_err(mmc_dev(host->mmc), mmc_omap_irq()
820 dev_dbg(mmc_dev(host->mmc), mmc_omap_irq()
872 sysfs_notify(&slot->mmc->class_dev.kobj, NULL, "cover_switch"); omap_mmc_notify_cover_event()
889 mmc_detect_change(slot->mmc, 0); mmc_omap_cover_handler()
897 if (slot->mmc->card == NULL || !mmc_card_present(slot->mmc->card)) mmc_omap_cover_handler()
1083 static void mmc_omap_request(struct mmc_host *mmc, struct mmc_request *req) mmc_omap_request() argument
1085 struct mmc_omap_slot *slot = mmc_priv(mmc); mmc_omap_request()
1090 if (host->mmc != NULL) { mmc_omap_request()
1096 host->mmc = mmc; mmc_omap_request()
1110 slot->pdata->set_power(mmc_dev(slot->mmc), slot->id, power_on, mmc_omap_set_power()
1125 static int mmc_omap_calc_divisor(struct mmc_host *mmc, struct mmc_ios *ios) mmc_omap_calc_divisor() argument
1127 struct mmc_omap_slot *slot = mmc_priv(mmc); mmc_omap_calc_divisor()
1153 static void mmc_omap_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) mmc_omap_set_ios() argument
1155 struct mmc_omap_slot *slot = mmc_priv(mmc); mmc_omap_set_ios()
1162 dsor = mmc_omap_calc_divisor(mmc, ios); mmc_omap_set_ios()
1185 slot->pdata->set_bus_mode(mmc_dev(mmc), slot->id, mmc_omap_set_ios()
1224 struct mmc_host *mmc; mmc_omap_new_slot() local
1227 mmc = mmc_alloc_host(sizeof(struct mmc_omap_slot), host->dev); mmc_omap_new_slot()
1228 if (mmc == NULL) mmc_omap_new_slot()
1231 slot = mmc_priv(mmc); mmc_omap_new_slot()
1233 slot->mmc = mmc; mmc_omap_new_slot()
1239 mmc->caps = 0; mmc_omap_new_slot()
1241 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_ERASE; mmc_omap_new_slot()
1243 mmc->ops = &mmc_omap_ops; mmc_omap_new_slot()
1244 mmc->f_min = 400000; mmc_omap_new_slot()
1247 mmc->f_max = 48000000; mmc_omap_new_slot()
1249 mmc->f_max = 24000000; mmc_omap_new_slot()
1251 mmc->f_max = min(host->pdata->max_freq, mmc->f_max); mmc_omap_new_slot()
1252 mmc->ocr_avail = slot->pdata->ocr_mask; mmc_omap_new_slot()
1258 mmc->max_segs = 32; mmc_omap_new_slot()
1259 mmc->max_blk_size = 2048; /* BLEN is 11 bits (+1) */ mmc_omap_new_slot()
1260 mmc->max_blk_count = 2048; /* NBLK is 11 bits (+1) */ mmc_omap_new_slot()
1261 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; mmc_omap_new_slot()
1262 mmc->max_seg_size = mmc->max_req_size; mmc_omap_new_slot()
1271 r = mmc_add_host(mmc); mmc_omap_new_slot()
1276 r = device_create_file(&mmc->class_dev, mmc_omap_new_slot()
1283 r = device_create_file(&mmc->class_dev, mmc_omap_new_slot()
1294 device_remove_file(&mmc->class_dev, &dev_attr_slot_name); mmc_omap_new_slot()
1296 mmc_remove_host(mmc); mmc_omap_new_slot()
1297 mmc_free_host(mmc); mmc_omap_new_slot()
1303 struct mmc_host *mmc = slot->mmc; mmc_omap_remove_slot() local
1306 device_remove_file(&mmc->class_dev, &dev_attr_slot_name); mmc_omap_remove_slot()
1308 device_remove_file(&mmc->class_dev, &dev_attr_cover_switch); mmc_omap_remove_slot()
1314 mmc_remove_host(mmc); mmc_omap_remove_slot()
1315 mmc_free_host(mmc); mmc_omap_remove_slot()
1487 { .compatible = "ti,omap2420-mmc", },
H A Dandroid-goldfish.c32 #include <linux/mmc/mmc.h>
33 #include <linux/mmc/sdio.h>
34 #include <linux/mmc/host.h>
35 #include <linux/mmc/card.h>
118 struct mmc_host *mmc; member in struct:goldfish_mmc_host
180 dev_err(mmc_dev(host->mmc), goldfish_mmc_start_command()
229 dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->sg_len, goldfish_mmc_xfer_done()
244 mmc_request_done(host->mmc, data->mrq); goldfish_mmc_xfer_done()
286 mmc_request_done(host->mmc, cmd->mrq); goldfish_mmc_cmd_done()
322 mmc_request_done(host->mmc, mrq); goldfish_mmc_irq()
350 mmc_detect_change(host->mmc, 0); goldfish_mmc_irq()
356 dev_info(mmc_dev(host->mmc),"spurious irq 0x%04x\n", status); goldfish_mmc_irq()
398 host->sg_len = dma_map_sg(mmc_dev(host->mmc), data->sg, goldfish_mmc_prepare_data()
413 static void goldfish_mmc_request(struct mmc_host *mmc, struct mmc_request *req) goldfish_mmc_request() argument
415 struct goldfish_mmc_host *host = mmc_priv(mmc); goldfish_mmc_request()
432 static void goldfish_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) goldfish_mmc_set_ios() argument
434 struct goldfish_mmc_host *host = mmc_priv(mmc); goldfish_mmc_set_ios()
440 static int goldfish_mmc_get_ro(struct mmc_host *mmc) goldfish_mmc_get_ro() argument
443 struct goldfish_mmc_host *host = mmc_priv(mmc); goldfish_mmc_get_ro()
457 struct mmc_host *mmc; goldfish_mmc_probe() local
469 mmc = mmc_alloc_host(sizeof(struct goldfish_mmc_host), &pdev->dev); goldfish_mmc_probe()
470 if (mmc == NULL) { goldfish_mmc_probe()
475 host = mmc_priv(mmc); goldfish_mmc_probe()
476 host->mmc = mmc; goldfish_mmc_probe()
478 pr_err("mmc: Mapping %lX to %lX\n", (long)res->start, (long)res->end); goldfish_mmc_probe()
496 mmc->ops = &goldfish_mmc_ops; goldfish_mmc_probe()
497 mmc->f_min = 400000; goldfish_mmc_probe()
498 mmc->f_max = 24000000; goldfish_mmc_probe()
499 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; goldfish_mmc_probe()
500 mmc->caps = MMC_CAP_4_BIT_DATA; goldfish_mmc_probe()
506 mmc->max_segs = 32; goldfish_mmc_probe()
507 mmc->max_blk_size = 2048; /* MMC_BLOCK_LENGTH is 11 bits (+1) */ goldfish_mmc_probe()
508 mmc->max_blk_count = 2048; /* MMC_BLOCK_COUNT is 11 bits (+1) */ goldfish_mmc_probe()
509 mmc->max_req_size = BUFFER_SIZE; goldfish_mmc_probe()
510 mmc->max_seg_size = mmc->max_req_size; goldfish_mmc_probe()
523 dev_warn(mmc_dev(host->mmc), goldfish_mmc_probe()
531 mmc_add_host(mmc); goldfish_mmc_probe()
540 mmc_free_host(host->mmc); goldfish_mmc_probe()
551 mmc_remove_host(host->mmc); goldfish_mmc_remove()
555 mmc_free_host(host->mmc); goldfish_mmc_remove()
H A Dsdhci-sirf.c11 #include <linux/mmc/host.h>
15 #include <linux/mmc/slot-gpio.h>
54 struct mmc_host *mmc = host->mmc; sdhci_sirf_execute_tuning() local
66 if (!mmc_send_tuning(mmc)) { sdhci_sirf_execute_tuning()
69 dev_dbg(mmc_dev(mmc), "%s: Found good phase = %d\n", sdhci_sirf_execute_tuning()
70 mmc_hostname(mmc), phase); sdhci_sirf_execute_tuning()
79 dev_dbg(mmc_dev(mmc), "%s: Found bad phase = %d\n", sdhci_sirf_execute_tuning()
80 mmc_hostname(mmc), phase); sdhci_sirf_execute_tuning()
100 dev_dbg(mmc_dev(mmc), "%s: Setting the tuning phase to %d\n", sdhci_sirf_execute_tuning()
101 mmc_hostname(mmc), phase); sdhci_sirf_execute_tuning()
106 dev_dbg(mmc_dev(mmc), "%s: No tuning point found\n", sdhci_sirf_execute_tuning()
107 mmc_hostname(mmc)); sdhci_sirf_execute_tuning()
176 ret = mmc_gpio_request_cd(host->mmc, priv->gpio_cd, 0); sdhci_sirf_probe()
182 mmc_gpiod_request_cd_irq(host->mmc); sdhci_sirf_probe()
H A Dmoxart-mmc.c25 #include <linux/mmc/host.h>
26 #include <linux/mmc/sd.h>
132 struct mmc_host *mmc; member in struct:moxart_host
198 dev_err(mmc_dev(host->mmc), "timed out waiting for status\n"); moxart_wait_for_status()
286 dev_err(mmc_dev(host->mmc), "dma_map_sg returned zero length\n"); moxart_transfer_dma()
397 static void moxart_request(struct mmc_host *mmc, struct mmc_request *mrq) moxart_request() argument
399 struct moxart_host *host = mmc_priv(mmc); moxart_request()
442 dev_err(mmc_dev(host->mmc), "card removed\n"); moxart_request()
462 mmc_request_done(host->mmc, mrq); moxart_request()
483 mmc_detect_change(host->mmc, 0); moxart_irq()
493 static void moxart_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) moxart_set_ios() argument
495 struct moxart_host *host = mmc_priv(mmc); moxart_set_ios()
543 static int moxart_get_ro(struct mmc_host *mmc) moxart_get_ro() argument
545 struct moxart_host *host = mmc_priv(mmc); moxart_get_ro()
561 struct mmc_host *mmc; moxart_probe() local
569 mmc = mmc_alloc_host(sizeof(struct moxart_host), dev); moxart_probe()
570 if (!mmc) { moxart_probe()
601 ret = mmc_of_parse(mmc); moxart_probe()
605 host = mmc_priv(mmc); moxart_probe()
606 host->mmc = mmc; moxart_probe()
617 mmc->ops = &moxart_ops; moxart_probe()
618 mmc->f_max = DIV_ROUND_CLOSEST(host->sysclk, 2); moxart_probe()
619 mmc->f_min = DIV_ROUND_CLOSEST(host->sysclk, CLK_DIV_MASK * 2); moxart_probe()
620 mmc->ocr_avail = 0xffff00; /* Support 2.0v - 3.6v power. */ moxart_probe()
651 mmc->caps |= MMC_CAP_4_BIT_DATA; moxart_probe()
654 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA; moxart_probe()
669 ret = devm_request_irq(dev, irq, moxart_irq, 0, "moxart-mmc", host); moxart_probe()
673 dev_set_drvdata(dev, mmc); moxart_probe()
674 mmc_add_host(mmc); moxart_probe()
681 if (mmc) moxart_probe()
682 mmc_free_host(mmc); moxart_probe()
688 struct mmc_host *mmc = dev_get_drvdata(&pdev->dev); moxart_remove() local
689 struct moxart_host *host = mmc_priv(mmc); moxart_remove()
693 if (mmc) { moxart_remove()
698 mmc_remove_host(mmc); moxart_remove()
699 mmc_free_host(mmc); moxart_remove()
710 { .compatible = "moxa,moxart-mmc" },
719 .name = "mmc-moxart",
725 MODULE_ALIAS("platform:mmc-moxart");
H A Dsdhci.c2 * linux/drivers/mmc/host/sdhci.c - Secure Digital Host Controller Interface driver
28 #include <linux/mmc/mmc.h>
29 #include <linux/mmc/host.h>
30 #include <linux/mmc/card.h>
31 #include <linux/mmc/sdio.h>
32 #include <linux/mmc/slot-gpio.h>
54 static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode);
86 mmc_hostname(host->mmc)); sdhci_dumpregs()
150 (host->mmc->caps & MMC_CAP_NONREMOVABLE)) sdhci_set_card_detection()
197 mmc_hostname(host->mmc), (int)mask); sdhci_reset()
228 static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios);
249 sdhci_set_ios(host->mmc, &host->mmc->ios); sdhci_init()
506 host->align_addr = dma_map_single(mmc_dev(host->mmc), sdhci_adma_table_pre()
508 if (dma_mapping_error(mmc_dev(host->mmc), host->align_addr)) sdhci_adma_table_pre()
593 dma_sync_single_for_device(mmc_dev(host->mmc), sdhci_adma_table_pre()
600 dma_unmap_single(mmc_dev(host->mmc), host->align_addr, sdhci_adma_table_pre()
623 dma_unmap_single(mmc_dev(host->mmc), host->align_addr, sdhci_adma_table_post()
635 dma_sync_sg_for_cpu(mmc_dev(host->mmc), data->sg, sdhci_adma_table_post()
655 dma_unmap_sg(mmc_dev(host->mmc), data->sg, sdhci_adma_table_post()
721 mmc_hostname(host->mmc), count, cmd->opcode); sdhci_calc_timeout()
770 BUG_ON(data->blksz > host->mmc->max_blk_size); sdhci_prepare_data()
982 dma_unmap_sg(mmc_dev(host->mmc), sdhci_finish_data()
1049 "inhibit bit(s).\n", mmc_hostname(host->mmc)); sdhci_send_command()
1077 mmc_hostname(host->mmc)); sdhci_send_command()
1174 mmc_hostname(host->mmc)); sdhci_get_preset_value()
1188 host->mmc->actual_clock = 0; sdhci_set_clock()
1258 host->mmc->actual_clock = (host->max_clk * clk_mul) / real_div; sdhci_set_clock()
1271 "stabilised.\n", mmc_hostname(host->mmc)); sdhci_set_clock()
1287 struct mmc_host *mmc = host->mmc; sdhci_set_power() local
1290 if (!IS_ERR(mmc->supply.vmmc)) { sdhci_set_power()
1292 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); sdhci_set_power()
1369 static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) sdhci_request() argument
1376 host = mmc_priv(mmc); sdhci_request()
1419 if (mmc->card) { sdhci_request()
1422 mmc->card->type == MMC_TYPE_MMC ? sdhci_request()
1433 sdhci_execute_tuning(mmc, tuning_opcode); sdhci_request()
1501 struct mmc_host *mmc = host->mmc; sdhci_do_set_ios() local
1507 if (!IS_ERR(mmc->supply.vmmc) && sdhci_do_set_ios()
1509 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); sdhci_do_set_ios()
1533 host->timeout_clk = host->mmc->actual_clock ? sdhci_do_set_ios()
1534 host->mmc->actual_clock / 1000 : sdhci_do_set_ios()
1536 host->mmc->max_busy_timeout = sdhci_do_set_ios()
1540 host->mmc->max_busy_timeout /= host->timeout_clk; sdhci_do_set_ios()
1646 static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) sdhci_set_ios() argument
1648 struct sdhci_host *host = mmc_priv(mmc); sdhci_set_ios()
1657 int gpio_cd = mmc_gpio_get_cd(host->mmc); sdhci_do_get_cd()
1664 (host->mmc->caps & MMC_CAP_NONREMOVABLE)) sdhci_do_get_cd()
1675 static int sdhci_get_cd(struct mmc_host *mmc) sdhci_get_cd() argument
1677 struct sdhci_host *host = mmc_priv(mmc); sdhci_get_cd()
1728 static void sdhci_hw_reset(struct mmc_host *mmc) sdhci_hw_reset() argument
1730 struct sdhci_host *host = mmc_priv(mmc); sdhci_hw_reset()
1736 static int sdhci_get_ro(struct mmc_host *mmc) sdhci_get_ro() argument
1738 struct sdhci_host *host = mmc_priv(mmc); sdhci_get_ro()
1761 static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) sdhci_enable_sdio_irq() argument
1763 struct sdhci_host *host = mmc_priv(mmc); sdhci_enable_sdio_irq()
1783 struct mmc_host *mmc = host->mmc; sdhci_do_start_signal_voltage_switch() local
1802 if (!IS_ERR(mmc->supply.vqmmc)) { sdhci_do_start_signal_voltage_switch()
1803 ret = regulator_set_voltage(mmc->supply.vqmmc, 2700000, sdhci_do_start_signal_voltage_switch()
1807 mmc_hostname(mmc)); sdhci_do_start_signal_voltage_switch()
1820 mmc_hostname(mmc)); sdhci_do_start_signal_voltage_switch()
1824 if (!IS_ERR(mmc->supply.vqmmc)) { sdhci_do_start_signal_voltage_switch()
1825 ret = regulator_set_voltage(mmc->supply.vqmmc, sdhci_do_start_signal_voltage_switch()
1829 mmc_hostname(mmc)); sdhci_do_start_signal_voltage_switch()
1851 mmc_hostname(mmc)); sdhci_do_start_signal_voltage_switch()
1855 if (!IS_ERR(mmc->supply.vqmmc)) { sdhci_do_start_signal_voltage_switch()
1856 ret = regulator_set_voltage(mmc->supply.vqmmc, 1100000, sdhci_do_start_signal_voltage_switch()
1860 mmc_hostname(mmc)); sdhci_do_start_signal_voltage_switch()
1871 static int sdhci_start_signal_voltage_switch(struct mmc_host *mmc, sdhci_start_signal_voltage_switch() argument
1874 struct sdhci_host *host = mmc_priv(mmc); sdhci_start_signal_voltage_switch()
1885 static int sdhci_card_busy(struct mmc_host *mmc) sdhci_card_busy() argument
1887 struct sdhci_host *host = mmc_priv(mmc); sdhci_card_busy()
1898 static int sdhci_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_ios *ios) sdhci_prepare_hs400_tuning() argument
1900 struct sdhci_host *host = mmc_priv(mmc); sdhci_prepare_hs400_tuning()
1910 static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode) sdhci_execute_tuning() argument
1912 struct sdhci_host *host = mmc_priv(mmc); sdhci_execute_tuning()
2017 if (mmc->ios.bus_width == MMC_BUS_WIDTH_8) sdhci_execute_tuning()
2020 else if (mmc->ios.bus_width == MMC_BUS_WIDTH_4) sdhci_execute_tuning()
2144 static void sdhci_post_req(struct mmc_host *mmc, struct mmc_request *mrq, sdhci_post_req() argument
2147 struct sdhci_host *host = mmc_priv(mmc); sdhci_post_req()
2153 dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, sdhci_post_req()
2172 sg_count = dma_map_sg(mmc_dev(host->mmc), data->sg, data->sg_len, sdhci_pre_dma_transfer()
2185 static void sdhci_pre_req(struct mmc_host *mmc, struct mmc_request *mrq, sdhci_pre_req() argument
2188 struct sdhci_host *host = mmc_priv(mmc); sdhci_pre_req()
2196 static void sdhci_card_event(struct mmc_host *mmc) sdhci_card_event() argument
2198 struct sdhci_host *host = mmc_priv(mmc); sdhci_card_event()
2213 mmc_hostname(host->mmc)); sdhci_card_event()
2215 mmc_hostname(host->mmc)); sdhci_card_event()
2305 mmc_request_done(host->mmc, mrq); sdhci_tasklet_finish()
2320 "interrupt.\n", mmc_hostname(host->mmc)); sdhci_timeout_timer()
2367 mmc_hostname(host->mmc), (unsigned)intmask); sdhci_cmd_irq()
2419 const char *name = mmc_hostname(host->mmc); sdhci_adma_show_error()
2493 mmc_hostname(host->mmc), (unsigned)intmask); sdhci_data_irq()
2508 pr_err("%s: ADMA error\n", mmc_hostname(host->mmc)); sdhci_data_irq()
2543 mmc_hostname(host->mmc), dmastart, sdhci_data_irq()
2590 mmc_hostname(host->mmc), intmask); sdhci_irq()
2631 mmc_hostname(host->mmc)); sdhci_irq()
2659 mmc_hostname(host->mmc), unexpected); sdhci_irq()
2678 sdhci_card_event(host->mmc); sdhci_thread_irq()
2679 mmc_detect_change(host->mmc, msecs_to_jiffies(200)); sdhci_thread_irq()
2683 sdio_run_irqs(host->mmc); sdhci_thread_irq()
2737 if (!device_may_wakeup(mmc_dev(host->mmc))) { sdhci_suspend_host()
2760 if (!device_may_wakeup(mmc_dev(host->mmc))) { sdhci_resume_host()
2763 mmc_hostname(host->mmc), host); sdhci_resume_host()
2771 if ((host->mmc->pm_flags & MMC_PM_KEEP_POWER) && sdhci_resume_host()
2777 sdhci_do_set_ios(host, &host->mmc->ios); sdhci_resume_host()
2779 sdhci_init(host, (host->mmc->pm_flags & MMC_PM_KEEP_POWER)); sdhci_resume_host()
2796 return pm_runtime_get_sync(host->mmc->parent); sdhci_runtime_pm_get()
2801 pm_runtime_mark_last_busy(host->mmc->parent); sdhci_runtime_pm_put()
2802 return pm_runtime_put_autosuspend(host->mmc->parent); sdhci_runtime_pm_put()
2810 pm_runtime_get_noresume(host->mmc->parent); sdhci_runtime_pm_bus_on()
2818 pm_runtime_put_noidle(host->mmc->parent); sdhci_runtime_pm_bus_off()
2862 sdhci_do_start_signal_voltage_switch(host, &host->mmc->ios); sdhci_runtime_resume_host()
2863 sdhci_do_set_ios(host, &host->mmc->ios); sdhci_runtime_resume_host()
2904 struct mmc_host *mmc; sdhci_alloc_host() local
2909 mmc = mmc_alloc_host(sizeof(struct sdhci_host) + priv_size, dev); sdhci_alloc_host()
2910 if (!mmc) sdhci_alloc_host()
2913 host = mmc_priv(mmc); sdhci_alloc_host()
2914 host->mmc = mmc; sdhci_alloc_host()
2923 struct mmc_host *mmc; sdhci_add_host() local
2934 mmc = host->mmc; sdhci_add_host()
2950 "You may experience problems.\n", mmc_hostname(mmc), sdhci_add_host()
2999 mmc_hostname(mmc)); sdhci_add_host()
3034 host->adma_table = dma_alloc_coherent(mmc_dev(mmc), sdhci_add_host()
3041 dma_free_coherent(mmc_dev(mmc), sdhci_add_host()
3047 mmc_hostname(mmc)); sdhci_add_host()
3053 mmc_hostname(mmc)); sdhci_add_host()
3055 dma_free_coherent(mmc_dev(mmc), host->adma_table_sz, sdhci_add_host()
3070 mmc_dev(mmc)->dma_mask = &host->dma_mask; sdhci_add_host()
3085 "frequency.\n", mmc_hostname(mmc)); sdhci_add_host()
3110 mmc->ops = &sdhci_ops; sdhci_add_host()
3111 mmc->f_max = host->max_clk; sdhci_add_host()
3113 mmc->f_min = host->ops->get_min_clock(host); sdhci_add_host()
3116 mmc->f_min = (host->max_clk * host->clk_mul) / 1024; sdhci_add_host()
3117 mmc->f_max = host->max_clk * host->clk_mul; sdhci_add_host()
3119 mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_300; sdhci_add_host()
3121 mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200; sdhci_add_host()
3132 mmc_hostname(mmc)); sdhci_add_host()
3143 mmc->max_busy_timeout = host->ops->get_max_timeout_count ? sdhci_add_host()
3145 mmc->max_busy_timeout /= host->timeout_clk; sdhci_add_host()
3148 mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23; sdhci_add_host()
3149 mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD; sdhci_add_host()
3160 DBG("%s: Auto-CMD23 available\n", mmc_hostname(mmc)); sdhci_add_host()
3162 DBG("%s: Auto-CMD23 unavailable\n", mmc_hostname(mmc)); sdhci_add_host()
3168 * 8-bit width must set "mmc->caps |= MMC_CAP_8_BIT_DATA;" in sdhci_add_host()
3173 mmc->caps |= MMC_CAP_4_BIT_DATA; sdhci_add_host()
3176 mmc->caps &= ~MMC_CAP_CMD23; sdhci_add_host()
3179 mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; sdhci_add_host()
3182 !(mmc->caps & MMC_CAP_NONREMOVABLE)) sdhci_add_host()
3183 mmc->caps |= MMC_CAP_NEEDS_POLL; sdhci_add_host()
3186 if (mmc_regulator_get_supply(mmc) == -EPROBE_DEFER) sdhci_add_host()
3190 if (!IS_ERR(mmc->supply.vqmmc)) { sdhci_add_host()
3191 ret = regulator_enable(mmc->supply.vqmmc); sdhci_add_host()
3192 if (!regulator_is_supported_voltage(mmc->supply.vqmmc, 1700000, sdhci_add_host()
3199 mmc_hostname(mmc), ret); sdhci_add_host()
3200 mmc->supply.vqmmc = ERR_PTR(-EINVAL); sdhci_add_host()
3211 mmc->caps |= MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25; sdhci_add_host()
3215 mmc->caps |= MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50; sdhci_add_host()
3220 mmc->caps2 |= MMC_CAP2_HS200; sdhci_add_host()
3222 mmc->caps |= MMC_CAP_UHS_SDR50; sdhci_add_host()
3226 mmc->caps2 |= MMC_CAP2_HS400; sdhci_add_host()
3228 if ((mmc->caps2 & MMC_CAP2_HSX00_1_2V) && sdhci_add_host()
3229 (IS_ERR(mmc->supply.vqmmc) || sdhci_add_host()
3230 !regulator_is_supported_voltage(mmc->supply.vqmmc, 1100000, sdhci_add_host()
3232 mmc->caps2 &= ~MMC_CAP2_HSX00_1_2V; sdhci_add_host()
3236 mmc->caps |= MMC_CAP_UHS_DDR50; sdhci_add_host()
3243 if (mmc->caps2 & MMC_CAP2_HS200) sdhci_add_host()
3248 mmc->caps |= MMC_CAP_DRIVER_TYPE_A; sdhci_add_host()
3250 mmc->caps |= MMC_CAP_DRIVER_TYPE_C; sdhci_add_host()
3252 mmc->caps |= MMC_CAP_DRIVER_TYPE_D; sdhci_add_host()
3279 if (!max_current_caps && !IS_ERR(mmc->supply.vmmc)) { sdhci_add_host()
3280 int curr = regulator_get_current_limit(mmc->supply.vmmc); sdhci_add_host()
3298 mmc->max_current_330 = ((max_current_caps & sdhci_add_host()
3306 mmc->max_current_300 = ((max_current_caps & sdhci_add_host()
3314 mmc->max_current_180 = ((max_current_caps & sdhci_add_host()
3325 if (mmc->ocr_avail) sdhci_add_host()
3326 ocr_avail = mmc->ocr_avail; sdhci_add_host()
3328 mmc->ocr_avail = ocr_avail; sdhci_add_host()
3329 mmc->ocr_avail_sdio = ocr_avail; sdhci_add_host()
3331 mmc->ocr_avail_sdio &= host->ocr_avail_sdio; sdhci_add_host()
3332 mmc->ocr_avail_sd = ocr_avail; sdhci_add_host()
3334 mmc->ocr_avail_sd &= host->ocr_avail_sd; sdhci_add_host()
3336 mmc->ocr_avail_sd &= ~MMC_VDD_165_195; sdhci_add_host()
3337 mmc->ocr_avail_mmc = ocr_avail; sdhci_add_host()
3339 mmc->ocr_avail_mmc &= host->ocr_avail_mmc; sdhci_add_host()
3341 if (mmc->ocr_avail == 0) { sdhci_add_host()
3343 "support voltages.\n", mmc_hostname(mmc)); sdhci_add_host()
3354 mmc->max_segs = SDHCI_MAX_SEGS; sdhci_add_host()
3356 mmc->max_segs = 1; sdhci_add_host()
3358 mmc->max_segs = SDHCI_MAX_SEGS; sdhci_add_host()
3365 mmc->max_req_size = 524288; sdhci_add_host()
3374 mmc->max_seg_size = 65535; sdhci_add_host()
3376 mmc->max_seg_size = 65536; sdhci_add_host()
3378 mmc->max_seg_size = mmc->max_req_size; sdhci_add_host()
3386 mmc->max_blk_size = 2; sdhci_add_host()
3388 mmc->max_blk_size = (caps[0] & SDHCI_MAX_BLOCK_MASK) >> sdhci_add_host()
3390 if (mmc->max_blk_size >= 3) { sdhci_add_host()
3392 mmc_hostname(mmc)); sdhci_add_host()
3393 mmc->max_blk_size = 0; sdhci_add_host()
3397 mmc->max_blk_size = 512 << mmc->max_blk_size; sdhci_add_host()
3402 mmc->max_blk_count = (host->quirks & SDHCI_QUIRK_NO_MULTIBLOCK) ? 1 : 65535; sdhci_add_host()
3424 IRQF_SHARED, mmc_hostname(mmc), host); sdhci_add_host()
3427 mmc_hostname(mmc), host->irq, ret); sdhci_add_host()
3437 "%s::", mmc_hostname(mmc)); sdhci_add_host()
3440 host->led.default_trigger = mmc_hostname(mmc); sdhci_add_host()
3443 ret = led_classdev_register(mmc_dev(mmc), &host->led); sdhci_add_host()
3446 mmc_hostname(mmc), ret); sdhci_add_host()
3453 mmc_add_host(mmc); sdhci_add_host()
3456 mmc_hostname(mmc), host->hw_name, dev_name(mmc_dev(mmc)), sdhci_add_host()
3482 struct mmc_host *mmc = host->mmc; sdhci_remove_host() local
3492 " transfer!\n", mmc_hostname(mmc)); sdhci_remove_host()
3503 mmc_remove_host(mmc); sdhci_remove_host()
3520 if (!IS_ERR(mmc->supply.vqmmc)) sdhci_remove_host()
3521 regulator_disable(mmc->supply.vqmmc); sdhci_remove_host()
3524 dma_free_coherent(mmc_dev(mmc), host->adma_table_sz, sdhci_remove_host()
3536 mmc_free_host(host->mmc); sdhci_free_host()
H A Dsunxi-mmc.c36 #include <linux/mmc/host.h>
37 #include <linux/mmc/sd.h>
38 #include <linux/mmc/sdio.h>
39 #include <linux/mmc/mmc.h>
40 #include <linux/mmc/core.h>
41 #include <linux/mmc/card.h>
42 #include <linux/mmc/slot-gpio.h>
221 struct mmc_host *mmc; member in struct:sunxi_mmc_host
261 dev_err(mmc_dev(host->mmc), "fatal err reset timeout\n"); sunxi_mmc_reset_host()
268 static int sunxi_mmc_init_host(struct mmc_host *mmc) sunxi_mmc_init_host() argument
271 struct sunxi_mmc_host *host = mmc_priv(mmc); sunxi_mmc_init_host()
339 dma_len = dma_map_sg(mmc_dev(host->mmc), data->sg, data->sg_len, sunxi_mmc_map_dma()
342 dev_err(mmc_dev(host->mmc), "dma_map_sg failed\n"); sunxi_mmc_map_dma()
348 dev_err(mmc_dev(host->mmc), sunxi_mmc_map_dma()
407 dev_err(mmc_dev(host->mmc), "send stop command failed\n"); sunxi_mmc_send_manual_stop()
423 /* For some cmds timeout is normal with sd/mmc cards */ sunxi_mmc_dump_errinfo()
429 dev_err(mmc_dev(host->mmc), sunxi_mmc_dump_errinfo()
431 host->mmc->index, cmd->opcode, sunxi_mmc_dump_errinfo()
490 dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, sunxi_mmc_finalize_request()
517 dev_dbg(mmc_dev(host->mmc), "irq: rq %p mi %08x idi %08x\n", sunxi_mmc_irq()
552 mmc_request_done(host->mmc, mrq); sunxi_mmc_irq()
555 mmc_signal_sdio_irq(host->mmc); sunxi_mmc_irq()
571 dev_err(mmc_dev(host->mmc), "no request for manual stop\n"); sunxi_mmc_handle_manual_stop()
575 dev_err(mmc_dev(host->mmc), "data error, sending stop command\n"); sunxi_mmc_handle_manual_stop()
591 mmc_request_done(host->mmc, mrq); sunxi_mmc_handle_manual_stop()
621 dev_err(mmc_dev(host->mmc), "fatal err update clk timeout\n"); sunxi_mmc_oclk_onoff()
635 dev_dbg(mmc_dev(host->mmc), "setting clk to %d, rounded %d\n", sunxi_mmc_clk_set_rate()
641 dev_err(mmc_dev(host->mmc), "error setting clk to %d: %d\n", sunxi_mmc_clk_set_rate()
686 static void sunxi_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) sunxi_mmc_set_ios() argument
688 struct sunxi_mmc_host *host = mmc_priv(mmc); sunxi_mmc_set_ios()
697 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); sunxi_mmc_set_ios()
699 host->ferror = sunxi_mmc_init_host(mmc); sunxi_mmc_set_ios()
703 dev_dbg(mmc_dev(mmc), "power on!\n"); sunxi_mmc_set_ios()
707 dev_dbg(mmc_dev(mmc), "power off!\n"); sunxi_mmc_set_ios()
709 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); sunxi_mmc_set_ios()
741 static void sunxi_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable) sunxi_mmc_enable_sdio_irq() argument
743 struct sunxi_mmc_host *host = mmc_priv(mmc); sunxi_mmc_enable_sdio_irq()
761 static void sunxi_mmc_hw_reset(struct mmc_host *mmc) sunxi_mmc_hw_reset() argument
763 struct sunxi_mmc_host *host = mmc_priv(mmc); sunxi_mmc_hw_reset()
770 static void sunxi_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) sunxi_mmc_request() argument
772 struct sunxi_mmc_host *host = mmc_priv(mmc); sunxi_mmc_request()
784 mmc_request_done(mmc, mrq); sunxi_mmc_request()
791 dev_err(mmc_dev(mmc), "map DMA failed\n"); sunxi_mmc_request()
794 mmc_request_done(mmc, mrq); sunxi_mmc_request()
837 dev_dbg(mmc_dev(mmc), "cmd %d(%08x) arg %x ie 0x%08x len %d\n", sunxi_mmc_request()
847 dma_unmap_sg(mmc_dev(mmc), data->sg, data->sg_len, sunxi_mmc_request()
850 dev_err(mmc_dev(mmc), "request already pending\n"); sunxi_mmc_request()
852 mmc_request_done(mmc, mrq); sunxi_mmc_request()
872 { .compatible = "allwinner,sun4i-a10-mmc", },
873 { .compatible = "allwinner,sun5i-a13-mmc", },
893 if (of_device_is_compatible(np, "allwinner,sun4i-a10-mmc")) sunxi_mmc_resource_request()
898 ret = mmc_regulator_get_supply(host->mmc); sunxi_mmc_resource_request()
916 host->clk_mmc = devm_clk_get(&pdev->dev, "mmc"); sunxi_mmc_resource_request()
918 dev_err(&pdev->dev, "Could not get mmc clock\n"); sunxi_mmc_resource_request()
946 dev_err(&pdev->dev, "Enable mmc clk err %d\n", ret); sunxi_mmc_resource_request()
980 sunxi_mmc_handle_manual_stop, 0, "sunxi-mmc", host); sunxi_mmc_resource_request()
999 struct mmc_host *mmc; sunxi_mmc_probe() local
1002 mmc = mmc_alloc_host(sizeof(struct sunxi_mmc_host), &pdev->dev); sunxi_mmc_probe()
1003 if (!mmc) { sunxi_mmc_probe()
1004 dev_err(&pdev->dev, "mmc alloc host failed\n"); sunxi_mmc_probe()
1008 host = mmc_priv(mmc); sunxi_mmc_probe()
1009 host->mmc = mmc; sunxi_mmc_probe()
1024 mmc->ops = &sunxi_mmc_ops; sunxi_mmc_probe()
1025 mmc->max_blk_count = 8192; sunxi_mmc_probe()
1026 mmc->max_blk_size = 4096; sunxi_mmc_probe()
1027 mmc->max_segs = PAGE_SIZE / sizeof(struct sunxi_idma_des); sunxi_mmc_probe()
1028 mmc->max_seg_size = (1 << host->idma_des_size_bits); sunxi_mmc_probe()
1029 mmc->max_req_size = mmc->max_seg_size * mmc->max_segs; sunxi_mmc_probe()
1031 mmc->f_min = 400000; sunxi_mmc_probe()
1032 mmc->f_max = 50000000; sunxi_mmc_probe()
1033 mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | sunxi_mmc_probe()
1036 ret = mmc_of_parse(mmc); sunxi_mmc_probe()
1040 ret = mmc_add_host(mmc); sunxi_mmc_probe()
1045 platform_set_drvdata(pdev, mmc); sunxi_mmc_probe()
1051 mmc_free_host(mmc); sunxi_mmc_probe()
1057 struct mmc_host *mmc = platform_get_drvdata(pdev); sunxi_mmc_remove() local
1058 struct sunxi_mmc_host *host = mmc_priv(mmc); sunxi_mmc_remove()
1060 mmc_remove_host(mmc); sunxi_mmc_remove()
1071 mmc_free_host(mmc); sunxi_mmc_remove()
1078 .name = "sunxi-mmc",
1089 MODULE_ALIAS("platform:sunxi-mmc");
H A Dusdhi6rol0.c19 #include <linux/mmc/host.h>
20 #include <linux/mmc/mmc.h>
21 #include <linux/mmc/sd.h>
22 #include <linux/mmc/sdio.h>
159 struct mmc_host *mmc; member in struct:usdhi6_host
208 dev_vdbg(mmc_dev(host->mmc), "%s(0x%p + 0x%x) = 0x%x\n", __func__, usdhi6_write()
215 dev_vdbg(mmc_dev(host->mmc), "%s(0x%p + 0x%x) = 0x%x\n", __func__, usdhi6_write16()
222 dev_vdbg(mmc_dev(host->mmc), "%s(0x%p + 0x%x) = 0x%x\n", __func__, usdhi6_read()
230 dev_vdbg(mmc_dev(host->mmc), "%s(0x%p + 0x%x) = 0x%x\n", __func__, usdhi6_read16()
282 dev_dbg(mmc_dev(host->mmc), usdhi6_error_code()
286 dev_warn(mmc_dev(host->mmc), usdhi6_error_code()
294 dev_warn(mmc_dev(host->mmc), "Err sts 0x%x, state %u, CMD%d\n", usdhi6_error_code()
316 dev_dbg(mmc_dev(host->mmc), "%s(): CMD%u of %u SG: %ux%u @ 0x%x\n", usdhi6_blk_bounce()
383 dev_dbg(mmc_dev(host->mmc), "Mapped %p (%lx) at %p + %u for CMD%u @ 0x%p\n", usdhi6_sg_map()
462 dev_dbg(mmc_dev(host->mmc), "%s(): %zu of %zu @ %zu\n", __func__, usdhi6_sg_advance()
506 dev_dbg(mmc_dev(host->mmc), "Mapped %p (%lx) at %p for CMD%u @ 0x%p\n", usdhi6_sg_advance()
552 dev_name(mmc_dev(host->mmc)), mrq)) usdhi6_dma_complete()
555 dev_dbg(mmc_dev(host->mmc), "%s(): CMD%u DMA completed\n", __func__, usdhi6_dma_complete()
596 dev_dbg(mmc_dev(host->mmc), "%s(): mapped %d -> %d, cookie %d @ %p\n", usdhi6_dma_setup()
604 dev_warn(mmc_dev(host->mmc), usdhi6_dma_setup()
626 dev_dbg(mmc_dev(host->mmc), "%s(): SG of %u: %ux%u\n", usdhi6_dma_kill()
639 dev_dbg(mmc_dev(host->mmc), "%s(): IO error %d, status 0x%x\n", usdhi6_dma_check_error()
647 dev_warn(mmc_dev(host->mmc), usdhi6_dma_check_error()
658 dev_warn(mmc_dev(host->mmc), "Unexpected response received!\n"); usdhi6_dma_check_error()
677 host->chan_tx = dma_request_slave_channel(mmc_dev(host->mmc), "tx"); usdhi6_dma_request()
678 dev_dbg(mmc_dev(host->mmc), "%s: TX: got channel %p\n", __func__, usdhi6_dma_request()
692 host->chan_rx = dma_request_slave_channel(mmc_dev(host->mmc), "rx"); usdhi6_dma_request()
693 dev_dbg(mmc_dev(host->mmc), "%s: RX: got channel %p\n", __func__, usdhi6_dma_request()
732 dev_err(mmc_dev(host->mmc), "SD bus busy, clock set aborted\n"); usdhi6_clk_set()
761 dev_dbg(mmc_dev(host->mmc), "target %lu, div %u, set %lu\n", usdhi6_clk_set()
788 struct mmc_host *mmc = host->mmc; usdhi6_set_power() local
790 if (!IS_ERR(mmc->supply.vmmc)) usdhi6_set_power()
792 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, usdhi6_set_power()
810 static void usdhi6_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) usdhi6_set_ios() argument
812 struct usdhi6_host *host = mmc_priv(mmc); usdhi6_set_ios()
816 dev_dbg(mmc_dev(mmc), "%uHz, OCR: %u, power %u, bus-width %u, timing %u\n", usdhi6_set_ios()
831 dev_err(mmc_dev(mmc), "Cannot reset the interface!\n"); usdhi6_set_ios()
846 dev_err(mmc_dev(mmc), usdhi6_set_ios()
885 dev_dbg(mmc_dev(host->mmc), "Set %s timeout %lu ticks @ %lu Hz\n", usdhi6_timeout_set()
909 dev_dbg(mmc_dev(host->mmc), "%s(CMD%d: %ux%u): err %d %d %d\n", usdhi6_request_done()
921 mmc_request_done(host->mmc, mrq); usdhi6_request_done()
967 dev_warn(mmc_dev(host->mmc), usdhi6_cmd_flags()
995 dev_dbg(mmc_dev(host->mmc), "Command active, request aborted\n"); usdhi6_rq_start()
1026 dev_warn(mmc_dev(host->mmc), "%s(): %u blocks of %u bytes\n", usdhi6_rq_start()
1043 dev_dbg(mmc_dev(host->mmc), usdhi6_rq_start()
1055 dev_dbg(mmc_dev(host->mmc), usdhi6_rq_start()
1062 dev_dbg(mmc_dev(host->mmc), "%s(): request opcode %u\n", usdhi6_rq_start()
1083 static void usdhi6_request(struct mmc_host *mmc, struct mmc_request *mrq) usdhi6_request() argument
1085 struct usdhi6_host *host = mmc_priv(mmc); usdhi6_request()
1101 static int usdhi6_get_cd(struct mmc_host *mmc) usdhi6_get_cd() argument
1103 struct usdhi6_host *host = mmc_priv(mmc); usdhi6_get_cd()
1114 return !status ^ !(mmc->caps2 & MMC_CAP2_CD_ACTIVE_HIGH); usdhi6_get_cd()
1117 static int usdhi6_get_ro(struct mmc_host *mmc) usdhi6_get_ro() argument
1119 struct usdhi6_host *host = mmc_priv(mmc); usdhi6_get_ro()
1130 return !status ^ !(mmc->caps2 & MMC_CAP2_RO_ACTIVE_HIGH); usdhi6_get_ro()
1133 static void usdhi6_enable_sdio_irq(struct mmc_host *mmc, int enable) usdhi6_enable_sdio_irq() argument
1135 struct usdhi6_host *host = mmc_priv(mmc); usdhi6_enable_sdio_irq()
1137 dev_dbg(mmc_dev(mmc), "%s(): %sable\n", __func__, enable ? "en" : "dis"); usdhi6_enable_sdio_irq()
1190 dev_err(mmc_dev(host->mmc), usdhi6_resp_read()
1209 dev_dbg(mmc_dev(host->mmc), "Response 0x%x\n", rsp[0]); usdhi6_resp_read()
1247 dev_dbg(mmc_dev(host->mmc), "%s(): %d\n", __func__, data->error); usdhi6_blk_read()
1290 dev_dbg(mmc_dev(host->mmc), "%s(): %d\n", __func__, data->error); usdhi6_blk_write()
1308 dev_err(mmc_dev(host->mmc), usdhi6_stop_cmd()
1470 dev_warn(mmc_dev(host->mmc), "%s(): %d\n", __func__, ret); usdhi6_sd_bh()
1479 dev_warn(mmc_dev(host->mmc), "%s(): %d\n", __func__, usdhi6_sd_bh()
1485 dev_err(mmc_dev(host->mmc), "Invalid state %u\n", host->wait); usdhi6_sd_bh()
1517 dev_warn(mmc_dev(host->mmc), "%s(): data error %d\n", usdhi6_sd_bh()
1542 dev_dbg(mmc_dev(host->mmc), usdhi6_sd()
1571 dev_warn(mmc_dev(host->mmc), usdhi6_sd()
1575 dev_dbg(mmc_dev(host->mmc), usdhi6_sd()
1588 dev_dbg(mmc_dev(host->mmc), "%s(): status 0x%x\n", __func__, status); usdhi6_sdio()
1595 mmc_signal_sdio_irq(host->mmc); usdhi6_sdio()
1603 struct mmc_host *mmc = host->mmc; usdhi6_cd() local
1616 if (!work_pending(&mmc->detect.work) && usdhi6_cd()
1618 !mmc->card) || usdhi6_cd()
1620 mmc->card))) usdhi6_cd()
1621 mmc_detect_change(mmc, msecs_to_jiffies(100)); usdhi6_cd()
1638 dev_warn(mmc_dev(host->mmc), usdhi6_timeout_work()
1652 dev_err(mmc_dev(host->mmc), "Invalid state %u\n", host->wait); usdhi6_timeout_work()
1668 dev_dbg(mmc_dev(host->mmc), usdhi6_timeout_work()
1698 struct mmc_host *mmc; usdhi6_probe() local
1714 mmc = mmc_alloc_host(sizeof(struct usdhi6_host), dev); usdhi6_probe()
1715 if (!mmc) usdhi6_probe()
1718 ret = mmc_of_parse(mmc); usdhi6_probe()
1722 mmc_regulator_get_supply(mmc); usdhi6_probe()
1724 host = mmc_priv(mmc); usdhi6_probe()
1725 host->mmc = mmc; usdhi6_probe()
1763 mmc->caps |= MMC_CAP_NEEDS_POLL; usdhi6_probe()
1780 mmc->ops = &usdhi6_ops; usdhi6_probe()
1781 mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | usdhi6_probe()
1784 mmc->max_segs = 32; usdhi6_probe()
1785 mmc->max_blk_size = 512; usdhi6_probe()
1786 mmc->max_req_size = PAGE_CACHE_SIZE * mmc->max_segs; usdhi6_probe()
1787 mmc->max_blk_count = mmc->max_req_size / mmc->max_blk_size; usdhi6_probe()
1796 mmc->max_seg_size = mmc->max_req_size; usdhi6_probe()
1797 if (!mmc->f_max) usdhi6_probe()
1798 mmc->f_max = host->imclk; usdhi6_probe()
1799 mmc->f_min = host->imclk / 512; usdhi6_probe()
1803 ret = mmc_add_host(mmc); usdhi6_probe()
1812 mmc_free_host(mmc); usdhi6_probe()
1821 mmc_remove_host(host->mmc); usdhi6_remove()
1827 mmc_free_host(host->mmc); usdhi6_remove()
H A Dsdricoh_cs.c38 #include <linux/mmc/host.h>
91 /* mmc privdata */
94 struct mmc_host *mmc; /* MMC structure */ member in struct:sdricoh_host
265 static void sdricoh_request(struct mmc_host *mmc, struct mmc_request *mrq) sdricoh_request() argument
267 struct sdricoh_host *host = mmc_priv(mmc); sdricoh_request()
351 mmc_request_done(mmc, mrq); sdricoh_request()
355 static void sdricoh_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) sdricoh_set_ios() argument
357 struct sdricoh_host *host = mmc_priv(mmc); sdricoh_set_ios()
376 static int sdricoh_get_ro(struct mmc_host *mmc) sdricoh_get_ro() argument
378 struct sdricoh_host *host = mmc_priv(mmc); sdricoh_get_ro()
397 /* initialize the control and register it to the mmc framework */ sdricoh_init_mmc()
403 struct mmc_host *mmc = NULL; sdricoh_init_mmc() local
420 dev_dbg(dev, "no supported mmc controller found\n"); sdricoh_init_mmc()
425 mmc = pcmcia_dev->priv = sdricoh_init_mmc()
427 if (!mmc) { sdricoh_init_mmc()
432 host = mmc_priv(mmc); sdricoh_init_mmc()
438 mmc->ops = &sdricoh_ops; sdricoh_init_mmc()
442 mmc->f_min = 450000; sdricoh_init_mmc()
443 mmc->f_max = 24000000; sdricoh_init_mmc()
444 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; sdricoh_init_mmc()
445 mmc->caps |= MMC_CAP_4_BIT_DATA; sdricoh_init_mmc()
447 mmc->max_seg_size = 1024 * 512; sdricoh_init_mmc()
448 mmc->max_blk_size = 512; sdricoh_init_mmc()
458 result = mmc_add_host(mmc); sdricoh_init_mmc()
461 dev_dbg(dev, "mmc host registered\n"); sdricoh_init_mmc()
468 if (mmc) sdricoh_init_mmc()
469 mmc_free_host(mmc); sdricoh_init_mmc()
474 /* search for supported mmc controllers */ sdricoh_pcmcia_probe()
482 /* search pci cardbus bridge that contains the mmc controller */ sdricoh_pcmcia_probe()
500 struct mmc_host *mmc = link->priv; sdricoh_pcmcia_detach() local
504 /* remove mmc host */ sdricoh_pcmcia_detach()
505 if (mmc) { sdricoh_pcmcia_detach()
506 struct sdricoh_host *host = mmc_priv(mmc); sdricoh_pcmcia_detach()
507 mmc_remove_host(mmc); sdricoh_pcmcia_detach()
510 mmc_free_host(mmc); sdricoh_pcmcia_detach()
525 struct mmc_host *mmc = link->priv; sdricoh_pcmcia_resume() local
527 sdricoh_reset(mmc_priv(mmc)); sdricoh_pcmcia_resume()
H A Dsdhci-msm.c2 * drivers/mmc/host/sdhci-msm.c - Qualcomm SDHCI Platform driver
20 #include <linux/mmc/mmc.h>
62 struct mmc_host *mmc; member in struct:sdhci_msm_host
71 struct mmc_host *mmc = host->mmc; msm_dll_poll_ck_out_en() local
79 dev_err(mmc_dev(mmc), "%s: CK_OUT_EN bit is not %d\n", msm_dll_poll_ck_out_en()
80 mmc_hostname(mmc), poll); msm_dll_poll_ck_out_en()
101 struct mmc_host *mmc = host->mmc; msm_config_cm_dll_phase() local
140 dev_err(mmc_dev(mmc), "%s: Failed to set DLL phase: %d\n", msm_config_cm_dll_phase()
141 mmc_hostname(mmc), phase); msm_config_cm_dll_phase()
166 struct mmc_host *mmc = host->mmc; msm_find_most_appropriate_phase() local
169 dev_err(mmc_dev(mmc), "%s: Invalid argument: total_phases=%d\n", msm_find_most_appropriate_phase()
170 mmc_hostname(mmc), total_phases); msm_find_most_appropriate_phase()
252 dev_err(mmc_dev(mmc), "%s: Invalid phase selected=%d\n", msm_find_most_appropriate_phase()
253 mmc_hostname(mmc), ret); msm_find_most_appropriate_phase()
290 struct mmc_host *mmc = host->mmc; msm_init_cm_dll() local
334 dev_err(mmc_dev(mmc), "%s: DLL failed to LOCK\n", msm_init_cm_dll()
335 mmc_hostname(mmc)); msm_init_cm_dll()
351 struct mmc_host *mmc = host->mmc; sdhci_msm_execute_tuning() local
352 struct mmc_ios ios = host->mmc->ios; sdhci_msm_execute_tuning()
376 rc = mmc_send_tuning(mmc); sdhci_msm_execute_tuning()
380 dev_dbg(mmc_dev(mmc), "%s: Found good phase = %d\n", sdhci_msm_execute_tuning()
381 mmc_hostname(mmc), phase); sdhci_msm_execute_tuning()
400 dev_dbg(mmc_dev(mmc), "%s: Setting the tuning phase to %d\n", sdhci_msm_execute_tuning()
401 mmc_hostname(mmc), phase); sdhci_msm_execute_tuning()
406 dev_dbg(mmc_dev(mmc), "%s: No tuning point found\n", sdhci_msm_execute_tuning()
407 mmc_hostname(mmc)); sdhci_msm_execute_tuning()
451 msm_host->mmc = host->mmc; sdhci_msm_probe()
454 ret = mmc_of_parse(host->mmc); sdhci_msm_probe()
H A Dtoshsd.c24 #include <linux/mmc/host.h>
25 #include <linux/mmc/mmc.h>
81 static void __toshsd_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) __toshsd_set_ios() argument
83 struct toshsd_host *host = mmc_priv(mmc); __toshsd_set_ios()
156 mmc_request_done(host->mmc, mrq); toshsd_finish_request()
360 __toshsd_set_ios(host->mmc, &host->mmc->ios); toshsd_irq()
365 /* Card insert/remove. The mmc controlling code is stateless. */ toshsd_irq()
374 mmc_detect_change(host->mmc, 1); toshsd_irq()
499 static void toshsd_request(struct mmc_host *mmc, struct mmc_request *mrq) toshsd_request() argument
501 struct toshsd_host *host = mmc_priv(mmc); toshsd_request()
507 mmc_request_done(mmc, mrq); toshsd_request()
527 static void toshsd_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) toshsd_set_ios() argument
529 struct toshsd_host *host = mmc_priv(mmc); toshsd_set_ios()
533 __toshsd_set_ios(mmc, ios); toshsd_set_ios()
537 static int toshsd_get_ro(struct mmc_host *mmc) toshsd_get_ro() argument
539 struct toshsd_host *host = mmc_priv(mmc); toshsd_get_ro()
545 static int toshsd_get_cd(struct mmc_host *mmc) toshsd_get_cd() argument
547 struct toshsd_host *host = mmc_priv(mmc); toshsd_get_cd()
611 struct mmc_host *mmc; toshsd_probe() local
618 mmc = mmc_alloc_host(sizeof(struct toshsd_host), &pdev->dev); toshsd_probe()
619 if (!mmc) { toshsd_probe()
624 host = mmc_priv(mmc); toshsd_probe()
625 host->mmc = mmc; toshsd_probe()
641 mmc->ops = &toshsd_ops; toshsd_probe()
642 mmc->caps = MMC_CAP_4_BIT_DATA; toshsd_probe()
643 mmc->ocr_avail = MMC_VDD_32_33; toshsd_probe()
645 mmc->f_min = HCLK / 512; toshsd_probe()
646 mmc->f_max = HCLK; toshsd_probe()
657 mmc_add_host(mmc); toshsd_probe()
671 mmc_free_host(mmc); toshsd_probe()
682 mmc_remove_host(host->mmc); toshsd_remove()
687 mmc_free_host(host->mmc); toshsd_remove()
H A Dushc.c24 #include <linux/mmc/host.h>
95 struct mmc_host *mmc; member in struct:ushc_data
190 mmc_signal_sdio_irq(ushc->mmc); int_callback()
194 mmc_detect_change(ushc->mmc, msecs_to_jiffies(100)); int_callback()
249 mmc_request_done(ushc->mmc, req); csw_callback()
252 static void ushc_request(struct mmc_host *mmc, struct mmc_request *req) ushc_request() argument
254 struct ushc_data *ushc = mmc_priv(mmc); ushc_request()
321 mmc_request_done(mmc, req); ushc_request()
375 static void ushc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ushc_set_ios() argument
377 struct ushc_data *ushc = mmc_priv(mmc); ushc_set_ios()
384 static int ushc_get_cd(struct mmc_host *mmc) ushc_get_cd() argument
386 struct ushc_data *ushc = mmc_priv(mmc); ushc_get_cd()
391 static void ushc_enable_sdio_irq(struct mmc_host *mmc, int enable) ushc_enable_sdio_irq() argument
393 struct ushc_data *ushc = mmc_priv(mmc); ushc_enable_sdio_irq()
412 mmc_free_host(ushc->mmc); ushc_clean_up()
425 struct mmc_host *mmc; ushc_probe() local
429 mmc = mmc_alloc_host(sizeof(struct ushc_data), &intf->dev); ushc_probe()
430 if (mmc == NULL) ushc_probe()
432 ushc = mmc_priv(mmc); ushc_probe()
436 ushc->mmc = mmc; ushc_probe()
449 mmc->ops = &ushc_ops; ushc_probe()
451 mmc->f_min = 400000; ushc_probe()
452 mmc->f_max = 50000000; ushc_probe()
453 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; ushc_probe()
454 mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; ushc_probe()
455 mmc->caps |= (ushc->caps & USHC_GET_CAPS_HIGH_SPD) ? MMC_CAP_SD_HIGHSPEED : 0; ushc_probe()
457 mmc->max_seg_size = 512*511; ushc_probe()
458 mmc->max_segs = 1; ushc_probe()
459 mmc->max_req_size = 512*511; ushc_probe()
460 mmc->max_blk_size = 512; ushc_probe()
461 mmc->max_blk_count = 511; ushc_probe()
516 ret = mmc_add_host(ushc->mmc); ushc_probe()
522 mmc_remove_host(ushc->mmc); ushc_probe()
546 mmc_remove_host(ushc->mmc); ushc_disconnect()
H A Dmvsdio.c26 #include <linux/mmc/host.h>
27 #include <linux/mmc/slot-gpio.h>
31 #include <linux/platform_data/mmc-mvsdio.h>
54 struct mmc_host *mmc; member in struct:mvsd_host
133 host->sg_frags = dma_map_sg(mmc_dev(host->mmc), data->sg, mvsd_setup_data()
142 static void mvsd_request(struct mmc_host *mmc, struct mmc_request *mrq) mvsd_request() argument
144 struct mvsd_host *host = mmc_priv(mmc); mvsd_request()
299 dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->sg_frags, mvsd_finish_data()
497 mmc_request_done(host->mmc, mrq); mvsd_irq()
503 mmc_signal_sdio_irq(host->mmc); mvsd_irq()
553 mmc_request_done(host->mmc, mrq); mvsd_timeout_timer()
556 static void mvsd_enable_sdio_irq(struct mmc_host *mmc, int enable) mvsd_enable_sdio_irq() argument
558 struct mvsd_host *host = mmc_priv(mmc); mvsd_enable_sdio_irq()
603 static void mvsd_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) mvsd_set_ios() argument
605 struct mvsd_host *host = mmc_priv(mmc); mvsd_set_ios()
701 struct mmc_host *mmc = NULL; mvsd_probe() local
712 mmc = mmc_alloc_host(sizeof(struct mvsd_host), &pdev->dev); mvsd_probe()
713 if (!mmc) { mvsd_probe()
718 host = mmc_priv(mmc); mvsd_probe()
719 host->mmc = mmc; mvsd_probe()
733 mmc->ops = &mvsd_ops; mvsd_probe()
735 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; mvsd_probe()
737 mmc->f_min = DIV_ROUND_UP(host->base_clock, MVSD_BASE_DIV_MAX); mvsd_probe()
738 mmc->f_max = MVSD_CLOCKRATE_MAX; mvsd_probe()
740 mmc->max_blk_size = 2048; mvsd_probe()
741 mmc->max_blk_count = 65535; mvsd_probe()
743 mmc->max_segs = 1; mvsd_probe()
744 mmc->max_seg_size = mmc->max_blk_size * mmc->max_blk_count; mvsd_probe()
745 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; mvsd_probe()
755 ret = mmc_of_parse(mmc); mvsd_probe()
766 mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ | mvsd_probe()
772 ret = mmc_gpio_request_cd(mmc, mvsd_probe()
778 mmc->caps |= MMC_CAP_NEEDS_POLL; mvsd_probe()
783 mmc_gpio_request_ro(mmc, mvsd_data->gpio_write_protect); mvsd_probe()
787 mmc->f_max = maxfreq; mvsd_probe()
811 platform_set_drvdata(pdev, mmc); mvsd_probe()
812 ret = mmc_add_host(mmc); mvsd_probe()
816 if (!(mmc->caps & MMC_CAP_NEEDS_POLL)) mvsd_probe()
824 if (mmc) { mvsd_probe()
827 mmc_free_host(mmc); mvsd_probe()
835 struct mmc_host *mmc = platform_get_drvdata(pdev); mvsd_remove() local
837 struct mvsd_host *host = mmc_priv(mmc); mvsd_remove()
839 mmc_remove_host(mmc); mvsd_remove()
845 mmc_free_host(mmc); mvsd_remove()
H A Drtsx_pci_sdmmc.c28 #include <linux/mmc/host.h>
29 #include <linux/mmc/mmc.h>
30 #include <linux/mmc/sd.h>
31 #include <linux/mmc/sdio.h>
32 #include <linux/mmc/card.h>
39 struct mmc_host *mmc; member in struct:realtek_pci_sdmmc
194 static void sdmmc_pre_req(struct mmc_host *mmc, struct mmc_request *mrq, sdmmc_pre_req() argument
197 struct realtek_pci_sdmmc *host = mmc_priv(mmc); sdmmc_pre_req()
211 static void sdmmc_post_req(struct mmc_host *mmc, struct mmc_request *mrq, sdmmc_post_req() argument
214 struct realtek_pci_sdmmc *host = mmc_priv(mmc); sdmmc_post_req()
445 struct mmc_host *mmc = host->mmc; sd_read_long_data() local
446 struct mmc_card *card = mmc->card; sd_read_long_data()
503 struct mmc_host *mmc = host->mmc; sd_write_long_data() local
504 struct mmc_card *card = mmc->card; sd_write_long_data()
805 struct mmc_host *mmc = host->mmc; sd_request() local
846 sdmmc_post_req(host->mmc, host->mrq, 0); sd_request()
873 mmc_request_done(mmc, mrq); sd_request()
876 static void sdmmc_request(struct mmc_host *mmc, struct mmc_request *mrq) sdmmc_request() argument
878 struct realtek_pci_sdmmc *host = mmc_priv(mmc); sdmmc_request()
1050 static void sdmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) sdmmc_set_ios() argument
1052 struct realtek_pci_sdmmc *host = mmc_priv(mmc); sdmmc_set_ios()
1098 static int sdmmc_get_ro(struct mmc_host *mmc) sdmmc_get_ro() argument
1100 struct realtek_pci_sdmmc *host = mmc_priv(mmc); sdmmc_get_ro()
1123 static int sdmmc_get_cd(struct mmc_host *mmc) sdmmc_get_cd() argument
1125 struct realtek_pci_sdmmc *host = mmc_priv(mmc); sdmmc_get_cd()
1221 static int sdmmc_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios) sdmmc_switch_voltage() argument
1223 struct realtek_pci_sdmmc *host = mmc_priv(mmc); sdmmc_switch_voltage()
1273 static int sdmmc_execute_tuning(struct mmc_host *mmc, u32 opcode) sdmmc_execute_tuning() argument
1275 struct realtek_pci_sdmmc *host = mmc_priv(mmc); sdmmc_execute_tuning()
1291 switch (mmc->ios.timing) { sdmmc_execute_tuning()
1312 if ((mmc->ios.timing == MMC_TIMING_UHS_SDR104) || sdmmc_execute_tuning()
1313 (mmc->ios.timing == MMC_TIMING_UHS_SDR50)) sdmmc_execute_tuning()
1315 else if (mmc->ios.timing == MMC_TIMING_UHS_DDR50) sdmmc_execute_tuning()
1337 struct mmc_host *mmc = host->mmc; init_extra_caps() local
1343 mmc->caps |= MMC_CAP_UHS_SDR50; init_extra_caps()
1345 mmc->caps |= MMC_CAP_UHS_SDR104; init_extra_caps()
1347 mmc->caps |= MMC_CAP_UHS_DDR50; init_extra_caps()
1349 mmc->caps |= MMC_CAP_1_8V_DDR; init_extra_caps()
1351 mmc->caps |= MMC_CAP_8_BIT_DATA; init_extra_caps()
1356 struct mmc_host *mmc = host->mmc; realtek_init_host() local
1358 mmc->f_min = 250000; realtek_init_host()
1359 mmc->f_max = 208000000; realtek_init_host()
1360 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; realtek_init_host()
1361 mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SD_HIGHSPEED | realtek_init_host()
1364 mmc->caps2 = MMC_CAP2_NO_PRESCAN_POWERUP | MMC_CAP2_FULL_PWR_CYCLE; realtek_init_host()
1365 mmc->max_current_330 = 400; realtek_init_host()
1366 mmc->max_current_180 = 800; realtek_init_host()
1367 mmc->ops = &realtek_pci_sdmmc_ops; realtek_init_host()
1371 mmc->max_segs = 256; realtek_init_host()
1372 mmc->max_seg_size = 65536; realtek_init_host()
1373 mmc->max_blk_size = 512; realtek_init_host()
1374 mmc->max_blk_count = 65535; realtek_init_host()
1375 mmc->max_req_size = 524288; realtek_init_host()
1383 mmc_detect_change(host->mmc, 0); rtsx_pci_sdmmc_card_event()
1388 struct mmc_host *mmc; rtsx_pci_sdmmc_drv_probe() local
1402 mmc = mmc_alloc_host(sizeof(*host), &pdev->dev); rtsx_pci_sdmmc_drv_probe()
1403 if (!mmc) rtsx_pci_sdmmc_drv_probe()
1406 host = mmc_priv(mmc); rtsx_pci_sdmmc_drv_probe()
1409 mmc_free_host(mmc); rtsx_pci_sdmmc_drv_probe()
1413 host->mmc = mmc; rtsx_pci_sdmmc_drv_probe()
1426 mmc_add_host(mmc); rtsx_pci_sdmmc_drv_probe()
1435 struct mmc_host *mmc; rtsx_pci_sdmmc_drv_remove() local
1443 mmc = host->mmc; rtsx_pci_sdmmc_drv_remove()
1451 mmc_hostname(mmc)); rtsx_pci_sdmmc_drv_remove()
1458 mmc_request_done(mmc, host->mrq); rtsx_pci_sdmmc_drv_remove()
1462 mmc_remove_host(mmc); rtsx_pci_sdmmc_drv_remove()
1469 mmc_free_host(mmc); rtsx_pci_sdmmc_drv_remove()
H A Domap_hsmmc.c2 * drivers/mmc/host/omap_hsmmc.c
36 #include <linux/mmc/host.h>
37 #include <linux/mmc/core.h>
38 #include <linux/mmc/mmc.h>
39 #include <linux/mmc/slot-gpio.h>
177 struct mmc_host *mmc; member in struct:omap_hsmmc_host
247 return mmc_gpio_get_cd(host->mmc); omap_hsmmc_card_detect()
254 return mmc_gpio_get_cd(host->mmc); omap_hsmmc_get_cover_state()
299 ret = mmc_regulator_set_ocr(host->mmc, host->vcc, vdd); omap_hsmmc_set_power()
304 ret = mmc_regulator_set_ocr(host->mmc, omap_hsmmc_set_power()
313 ret = mmc_regulator_set_ocr(host->mmc, omap_hsmmc_set_power()
423 static int omap_hsmmc_gpio_init(struct mmc_host *mmc, omap_hsmmc_gpio_init() argument
430 ret = mmc_gpio_request_cd(mmc, pdata->gpio_cod, 0); omap_hsmmc_gpio_init()
435 mmc_gpio_set_cd_isr(mmc, omap_hsmmc_cover_irq); omap_hsmmc_gpio_init()
437 ret = mmc_gpio_request_cd(mmc, pdata->gpio_cd, 0); omap_hsmmc_gpio_init()
445 ret = mmc_gpio_request_ro(mmc, pdata->gpio_wp); omap_hsmmc_gpio_init()
470 dev_dbg(mmc_dev(host->mmc), "MMC Clock is not stopped\n"); omap_hsmmc_stop_clock()
528 struct mmc_ios *ios = &host->mmc->ios; omap_hsmmc_set_clock()
533 dev_vdbg(mmc_dev(host->mmc), "Set clock to %uHz\n", ios->clock); omap_hsmmc_set_clock()
578 struct mmc_ios *ios = &host->mmc->ios; omap_hsmmc_set_bus_width()
606 struct mmc_ios *ios = &host->mmc->ios; omap_hsmmc_set_bus_mode()
624 struct mmc_ios *ios = &host->mmc->ios; omap_hsmmc_context_restore()
648 if (host->mmc->caps & MMC_CAP_SDIO_IRQ) omap_hsmmc_context_restore()
680 dev_dbg(mmc_dev(host->mmc), "context is restored: restore count %d\n", omap_hsmmc_context_restore()
755 struct mmc_host *mmc = container_of(dev, struct mmc_host, class_dev); omap_hsmmc_show_cover_switch() local
756 struct omap_hsmmc_host *host = mmc_priv(mmc); omap_hsmmc_show_cover_switch()
768 struct mmc_host *mmc = container_of(dev, struct mmc_host, class_dev); omap_hsmmc_show_slot_name() local
769 struct omap_hsmmc_host *host = mmc_priv(mmc); omap_hsmmc_show_slot_name()
785 dev_vdbg(mmc_dev(host->mmc), "%s: CMD%d, argument 0x%08x\n", omap_hsmmc_start_command()
786 mmc_hostname(host->mmc), cmd->opcode, cmd->arg); omap_hsmmc_start_command()
864 mmc_request_done(host->mmc, mrq); omap_hsmmc_request_done()
989 dev_vdbg(mmc_dev(host->mmc), "%s\n", res); omap_hsmmc_dbg_report_irq()
1030 dev_err(mmc_dev(host->mmc), omap_hsmmc_reset_controller_fsm()
1058 dev_vdbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status); omap_hsmmc_do_irq()
1086 dev_dbg(mmc_dev(host->mmc), "AC12 err: 0x%x\n", ac12); omap_hsmmc_do_irq()
1111 mmc_signal_sdio_irq(host->mmc); omap_hsmmc_irq()
1208 dev_err(mmc_dev(host->mmc), "Unable to switch operating voltage\n"); omap_hsmmc_switch_opcond()
1223 mmc_hostname(host->mmc)); omap_hsmmc_protect_card()
1230 mmc_hostname(host->mmc)); omap_hsmmc_protect_card()
1243 sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); omap_hsmmc_cover_irq()
1246 mmc_detect_change(host->mmc, (HZ * 200) / 1000); omap_hsmmc_cover_irq()
1279 mmc_request_done(host->mmc, mrq); omap_hsmmc_dma_callback()
1372 dev_err(mmc_dev(host->mmc), "prep_slave_sg() failed\n"); omap_hsmmc_setup_dma_transfer()
1463 dev_err(mmc_dev(host->mmc), "MMC start dma failure\n"); omap_hsmmc_prepare_data()
1470 static void omap_hsmmc_post_req(struct mmc_host *mmc, struct mmc_request *mrq, omap_hsmmc_post_req() argument
1473 struct omap_hsmmc_host *host = mmc_priv(mmc); omap_hsmmc_post_req()
1485 static void omap_hsmmc_pre_req(struct mmc_host *mmc, struct mmc_request *mrq, omap_hsmmc_pre_req() argument
1488 struct omap_hsmmc_host *host = mmc_priv(mmc); omap_hsmmc_pre_req()
1507 static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req) omap_hsmmc_request() argument
1509 struct omap_hsmmc_host *host = mmc_priv(mmc); omap_hsmmc_request()
1530 mmc_request_done(mmc, req); omap_hsmmc_request()
1545 mmc_request_done(mmc, req); omap_hsmmc_request()
1560 static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) omap_hsmmc_set_ios() argument
1562 struct omap_hsmmc_host *host = mmc_priv(mmc); omap_hsmmc_set_ios()
1599 dev_dbg(mmc_dev(host->mmc), omap_hsmmc_set_ios()
1614 static int omap_hsmmc_get_cd(struct mmc_host *mmc) omap_hsmmc_get_cd() argument
1616 struct omap_hsmmc_host *host = mmc_priv(mmc); omap_hsmmc_get_cd()
1623 static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card) omap_hsmmc_init_card() argument
1625 struct omap_hsmmc_host *host = mmc_priv(mmc); omap_hsmmc_init_card()
1631 static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable) omap_hsmmc_enable_sdio_irq() argument
1633 struct omap_hsmmc_host *host = mmc_priv(mmc); omap_hsmmc_enable_sdio_irq()
1668 struct mmc_host *mmc = host->mmc; omap_hsmmc_configure_wake_irq() local
1684 mmc_hostname(mmc), host); omap_hsmmc_configure_wake_irq()
1686 dev_err(mmc_dev(host->mmc), "Unable to request wake IRQ\n"); omap_hsmmc_configure_wake_irq()
1776 struct mmc_host *mmc = s->private; omap_hsmmc_regs_show() local
1777 struct omap_hsmmc_host *host = mmc_priv(mmc); omap_hsmmc_regs_show()
1779 seq_printf(s, "mmc%d:\n", mmc->index); omap_hsmmc_regs_show()
1781 (mmc->caps & MMC_CAP_SDIO_IRQ) ? "interrupt" : "polling"); omap_hsmmc_regs_show()
1783 if (mmc->caps & MMC_CAP_SDIO_IRQ) { omap_hsmmc_regs_show()
1825 static void omap_hsmmc_debugfs(struct mmc_host *mmc) omap_hsmmc_debugfs() argument
1827 if (mmc->debugfs_root) omap_hsmmc_debugfs()
1828 debugfs_create_file("regs", S_IRUSR, mmc->debugfs_root, omap_hsmmc_debugfs()
1829 mmc, &mmc_regs_fops); omap_hsmmc_debugfs()
1834 static void omap_hsmmc_debugfs(struct mmc_host *mmc) omap_hsmmc_debugfs() argument
1917 struct mmc_host *mmc; omap_hsmmc_probe() local
1955 mmc = mmc_alloc_host(sizeof(struct omap_hsmmc_host), &pdev->dev); omap_hsmmc_probe()
1956 if (!mmc) { omap_hsmmc_probe()
1961 ret = mmc_of_parse(mmc); omap_hsmmc_probe()
1965 host = mmc_priv(mmc); omap_hsmmc_probe()
1966 host->mmc = mmc; omap_hsmmc_probe()
1978 ret = omap_hsmmc_gpio_init(mmc, host, pdata); omap_hsmmc_probe()
1987 mmc->ops = &omap_hsmmc_ops; omap_hsmmc_probe()
1989 mmc->f_min = OMAP_MMC_MIN_CLOCK; omap_hsmmc_probe()
1992 mmc->f_max = pdata->max_freq; omap_hsmmc_probe()
1993 else if (mmc->f_max == 0) omap_hsmmc_probe()
1994 mmc->f_max = OMAP_MMC_MAX_CLOCK; omap_hsmmc_probe()
2024 dev_warn(mmc_dev(host->mmc), "Failed to enable debounce clk\n"); omap_hsmmc_probe()
2030 mmc->max_segs = 1024; omap_hsmmc_probe()
2032 mmc->max_blk_size = 512; /* Block Length at max can be 1024 */ omap_hsmmc_probe()
2033 mmc->max_blk_count = 0xFFFF; /* No. of Blocks is 16 bits */ omap_hsmmc_probe()
2034 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; omap_hsmmc_probe()
2035 mmc->max_seg_size = mmc->max_req_size; omap_hsmmc_probe()
2037 mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | omap_hsmmc_probe()
2040 mmc->caps |= mmc_pdata(host)->caps; omap_hsmmc_probe()
2041 if (mmc->caps & MMC_CAP_8_BIT_DATA) omap_hsmmc_probe()
2042 mmc->caps |= MMC_CAP_4_BIT_DATA; omap_hsmmc_probe()
2045 mmc->caps |= MMC_CAP_NONREMOVABLE; omap_hsmmc_probe()
2047 mmc->pm_caps |= mmc_pdata(host)->pm_caps; omap_hsmmc_probe()
2054 dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n"); omap_hsmmc_probe()
2062 dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n"); omap_hsmmc_probe()
2077 dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req); omap_hsmmc_probe()
2087 dev_err(mmc_dev(host->mmc), "unable to obtain TX DMA engine channel %u\n", tx_req); omap_hsmmc_probe()
2094 mmc_hostname(mmc), host); omap_hsmmc_probe()
2096 dev_err(mmc_dev(host->mmc), "Unable to grab HSMMC IRQ\n"); omap_hsmmc_probe()
2107 mmc->ocr_avail = mmc_pdata(host)->ocr_mask; omap_hsmmc_probe()
2121 mmc->caps |= MMC_CAP_SDIO_IRQ; omap_hsmmc_probe()
2125 mmc_add_host(mmc); omap_hsmmc_probe()
2128 ret = device_create_file(&mmc->class_dev, &dev_attr_slot_name); omap_hsmmc_probe()
2133 ret = device_create_file(&mmc->class_dev, omap_hsmmc_probe()
2139 omap_hsmmc_debugfs(mmc); omap_hsmmc_probe()
2146 mmc_remove_host(mmc); omap_hsmmc_probe()
2160 mmc_free_host(mmc); omap_hsmmc_probe()
2170 mmc_remove_host(host->mmc); omap_hsmmc_remove()
2184 mmc_free_host(host->mmc); omap_hsmmc_remove()
2199 if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) { omap_hsmmc_suspend()
2208 if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && omap_hsmmc_suspend()
2209 !(host->mmc->pm_flags & MMC_PM_WAKE_SDIO_IRQ)) omap_hsmmc_suspend()
2232 if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) omap_hsmmc_resume()
2237 if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && omap_hsmmc_resume()
2238 !(host->mmc->pm_flags & MMC_PM_WAKE_SDIO_IRQ)) omap_hsmmc_resume()
2258 if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && omap_hsmmc_runtime_suspend()
2303 if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && omap_hsmmc_runtime_resume()
H A Dtmio_mmc.c2 * linux/drivers/mmc/host/tmio_mmc.c
19 #include <linux/mmc/host.h>
109 pr_info("%s at 0x%08lx irq %d\n", mmc_hostname(host->mmc), tmio_mmc_probe()
128 struct mmc_host *mmc = platform_get_drvdata(pdev); tmio_mmc_remove() local
130 if (mmc) { tmio_mmc_remove()
131 struct tmio_mmc_host *host = mmc_priv(mmc); tmio_mmc_remove()
152 .name = "tmio-mmc",
164 MODULE_ALIAS("platform:tmio-mmc");
H A Dcb710-mmc.c2 * cb710/mmc.c
14 #include "cb710-mmc.h"
28 static void cb710_mmc_select_clock_divider(struct mmc_host *mmc, int hz) cb710_mmc_select_clock_divider() argument
30 struct cb710_slot *slot = cb710_mmc_to_slot(mmc); cb710_mmc_select_clock_divider()
444 static int cb710_mmc_command(struct mmc_host *mmc, struct mmc_command *cmd) cb710_mmc_command() argument
446 struct cb710_slot *slot = cb710_mmc_to_slot(mmc); cb710_mmc_command()
447 struct cb710_mmc_reader *reader = mmc_priv(mmc); cb710_mmc_command()
484 static void cb710_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) cb710_mmc_request() argument
486 struct cb710_slot *slot = cb710_mmc_to_slot(mmc); cb710_mmc_request()
487 struct cb710_mmc_reader *reader = mmc_priv(mmc); cb710_mmc_request()
494 if (!cb710_mmc_command(mmc, mrq->cmd) && mrq->stop) cb710_mmc_request()
495 cb710_mmc_command(mmc, mrq->stop); cb710_mmc_request()
561 static void cb710_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) cb710_mmc_set_ios() argument
563 struct cb710_slot *slot = cb710_mmc_to_slot(mmc); cb710_mmc_set_ios()
564 struct cb710_mmc_reader *reader = mmc_priv(mmc); cb710_mmc_set_ios()
567 cb710_mmc_select_clock_divider(mmc, ios->clock); cb710_mmc_set_ios()
600 static int cb710_mmc_get_ro(struct mmc_host *mmc) cb710_mmc_get_ro() argument
602 struct cb710_slot *slot = cb710_mmc_to_slot(mmc); cb710_mmc_get_ro()
608 static int cb710_mmc_get_cd(struct mmc_host *mmc) cb710_mmc_get_cd() argument
610 struct cb710_slot *slot = cb710_mmc_to_slot(mmc); cb710_mmc_get_cd()
618 struct mmc_host *mmc = cb710_slot_to_mmc(slot); cb710_mmc_irq_handler() local
619 struct cb710_mmc_reader *reader = mmc_priv(mmc); cb710_mmc_irq_handler()
637 mmc_detect_change(mmc, HZ/5); cb710_mmc_irq_handler()
650 struct mmc_host *mmc = (void *)data; cb710_mmc_finish_request_tasklet() local
651 struct cb710_mmc_reader *reader = mmc_priv(mmc); cb710_mmc_finish_request_tasklet()
655 mmc_request_done(mmc, mrq); cb710_mmc_finish_request_tasklet()
689 struct mmc_host *mmc; cb710_mmc_init() local
694 mmc = mmc_alloc_host(sizeof(*reader), cb710_slot_dev(slot)); cb710_mmc_init()
695 if (!mmc) cb710_mmc_init()
698 platform_set_drvdata(pdev, mmc); cb710_mmc_init()
706 mmc->ops = &cb710_mmc_host; cb710_mmc_init()
707 mmc->f_max = val; cb710_mmc_init()
708 mmc->f_min = val >> cb710_clock_divider_log2[CB710_MAX_DIVIDER_IDX]; cb710_mmc_init()
709 mmc->ocr_avail = MMC_VDD_32_33|MMC_VDD_33_34; cb710_mmc_init()
710 mmc->caps = MMC_CAP_4_BIT_DATA; cb710_mmc_init()
712 reader = mmc_priv(mmc); cb710_mmc_init()
715 cb710_mmc_finish_request_tasklet, (unsigned long)mmc); cb710_mmc_init()
722 err = mmc_add_host(mmc); cb710_mmc_init()
727 mmc_hostname(mmc)); cb710_mmc_init()
737 mmc_free_host(mmc); cb710_mmc_init()
744 struct mmc_host *mmc = cb710_slot_to_mmc(slot); cb710_mmc_exit() local
745 struct cb710_mmc_reader *reader = mmc_priv(mmc); cb710_mmc_exit()
749 mmc_remove_host(mmc); cb710_mmc_exit()
761 mmc_free_host(mmc); cb710_mmc_exit()
766 .driver.name = "cb710-mmc",
780 MODULE_ALIAS("platform:cb710-mmc");
H A Dsdhci-bcm-kona.c19 #include <linux/mmc/host.h>
27 #include <linux/mmc/slot-gpio.h>
145 ret = mmc_gpio_get_ro(host->mmc); sdhci_bcm_kona_sd_card_emulate()
166 if (mmc_gpio_get_cd(host->mmc) > 0) { sdhci_bcm_kona_card_event()
167 dev_dbg(mmc_dev(host->mmc), sdhci_bcm_kona_card_event()
171 dev_dbg(mmc_dev(host->mmc), sdhci_bcm_kona_card_event()
238 ret = mmc_of_parse(host->mmc); sdhci_bcm_kona_probe()
242 if (!host->mmc->f_max) { sdhci_bcm_kona_probe()
256 if (clk_set_rate(pltfm_priv->clk, host->mmc->f_max) != 0) { sdhci_bcm_kona_probe()
267 (host->mmc->caps & MMC_CAP_NONREMOVABLE) ? 'Y' : 'N'); sdhci_bcm_kona_probe()
269 (mmc_gpio_get_cd(host->mmc) != -ENOSYS) ? 'Y' : 'N', sdhci_bcm_kona_probe()
270 (mmc_gpio_get_ro(host->mmc) != -ENOSYS) ? 'Y' : 'N'); sdhci_bcm_kona_probe()
272 if (host->mmc->caps & MMC_CAP_NONREMOVABLE) sdhci_bcm_kona_probe()
276 (host->mmc->caps | MMC_CAP_8_BIT_DATA) ? 'Y' : 'N'); sdhci_bcm_kona_probe()
291 if (host->mmc->caps & MMC_CAP_NONREMOVABLE) { sdhci_bcm_kona_probe()
304 if (mmc_gpio_get_cd(host->mmc) > 0) sdhci_bcm_kona_probe()
H A DMakefile9 obj-$(CONFIG_MMC_MXS) += mxs-mmc.o
41 obj-$(CONFIG_MMC_CB710) += cb710-mmc.o
55 obj-$(CONFIG_MMC_MOXART) += moxart-mmc.o
56 obj-$(CONFIG_MMC_SUNXI) += sunxi-mmc.o
78 CFLAGS-cb710-mmc += -DDEBUG
H A Dau1xmmc.c2 * linux/drivers/mmc/host/au1xmmc.c - AU1XX0 MMC driver
13 * (drivers/mmc/wbsd.c) Copyright (C) 2004-2005 Pierre Ossman,
15 * (drivers/mmc/pxa.c) Copyright (C) 2003 Russell King,
44 #include <linux/mmc/host.h>
52 #define DRIVER_NAME "au1xxx-mmc"
90 struct mmc_host *mmc; member in struct:au1xmmc_host
215 host->platdata->set_power(host->mmc, state); au1xmmc_set_power()
218 static int au1xmmc_card_inserted(struct mmc_host *mmc) au1xmmc_card_inserted() argument
220 struct au1xmmc_host *host = mmc_priv(mmc); au1xmmc_card_inserted()
223 return !!host->platdata->card_inserted(host->mmc); au1xmmc_card_inserted()
228 static int au1xmmc_card_readonly(struct mmc_host *mmc) au1xmmc_card_readonly() argument
230 struct au1xmmc_host *host = mmc_priv(mmc); au1xmmc_card_readonly()
233 return !!host->platdata->card_readonly(mmc); au1xmmc_card_readonly()
254 mmc_request_done(host->mmc, mrq); au1xmmc_finish_request()
353 dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, host->dma.dir); au1xmmc_data_complete()
630 host->dma.len = dma_map_sg(mmc_dev(host->mmc), data->sg, au1xmmc_prepare_data()
682 dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, au1xmmc_prepare_data()
688 static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq) au1xmmc_request() argument
690 struct au1xmmc_host *host = mmc_priv(mmc); au1xmmc_request()
700 if (0 == au1xmmc_card_inserted(mmc)) { au1xmmc_request()
754 static void au1xmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) au1xmmc_set_ios() argument
756 struct au1xmmc_host *host = mmc_priv(mmc); au1xmmc_set_ios()
802 mmc_signal_sdio_irq(host->mmc); au1xmmc_irq()
928 static void au1xmmc_enable_sdio_irq(struct mmc_host *mmc, int en) au1xmmc_enable_sdio_irq() argument
930 struct au1xmmc_host *host = mmc_priv(mmc); au1xmmc_enable_sdio_irq()
948 struct mmc_host *mmc; au1xmmc_probe() local
953 mmc = mmc_alloc_host(sizeof(struct au1xmmc_host), &pdev->dev); au1xmmc_probe()
954 if (!mmc) { au1xmmc_probe()
960 host = mmc_priv(mmc); au1xmmc_probe()
961 host->mmc = mmc; au1xmmc_probe()
992 mmc->ops = &au1xmmc_ops; au1xmmc_probe()
994 mmc->f_min = 450000; au1xmmc_probe()
995 mmc->f_max = 24000000; au1xmmc_probe()
997 mmc->max_blk_size = 2048; au1xmmc_probe()
998 mmc->max_blk_count = 512; au1xmmc_probe()
1000 mmc->ocr_avail = AU1XMMC_OCR; au1xmmc_probe()
1001 mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; au1xmmc_probe()
1002 mmc->max_segs = AU1XMMC_DESCRIPTOR_COUNT; au1xmmc_probe()
1008 mmc->max_seg_size = AU1100_MMC_DESCRIPTOR_SIZE; au1xmmc_probe()
1011 mmc->max_seg_size = AU1200_MMC_DESCRIPTOR_SIZE; au1xmmc_probe()
1015 mmc->max_seg_size = AU1200_MMC_DESCRIPTOR_SIZE; au1xmmc_probe()
1016 mmc->f_max = 52000000; au1xmmc_probe()
1018 mmc->caps |= MMC_CAP_8_BIT_DATA; au1xmmc_probe()
1045 ret = host->platdata->cd_setup(mmc, 1); au1xmmc_probe()
1048 mmc->caps |= MMC_CAP_NEEDS_POLL; au1xmmc_probe()
1051 mmc->caps |= MMC_CAP_NEEDS_POLL; au1xmmc_probe()
1055 mmc->caps &= ~(host->platdata->mask_host_caps); au1xmmc_probe()
1072 led->name = mmc_hostname(mmc); au1xmmc_probe()
1074 led->default_trigger = mmc_hostname(mmc); au1xmmc_probe()
1075 ret = led_classdev_register(mmc_dev(mmc), led); au1xmmc_probe()
1083 ret = mmc_add_host(mmc); au1xmmc_probe()
1085 dev_err(&pdev->dev, "cannot add mmc host\n"); au1xmmc_probe()
1115 !(mmc->caps & MMC_CAP_NEEDS_POLL)) au1xmmc_probe()
1116 host->platdata->cd_setup(mmc, 0); au1xmmc_probe()
1128 mmc_free_host(mmc); au1xmmc_probe()
1138 mmc_remove_host(host->mmc); au1xmmc_remove()
1146 !(host->mmc->caps & MMC_CAP_NEEDS_POLL)) au1xmmc_remove()
1147 host->platdata->cd_setup(host->mmc, 0); au1xmmc_remove()
1170 mmc_free_host(host->mmc); au1xmmc_remove()
1240 MODULE_ALIAS("platform:au1xxx-mmc");
H A Djz4740_mmc.c16 #include <linux/mmc/host.h>
17 #include <linux/mmc/slot-gpio.h>
123 struct mmc_host *mmc; member in struct:jz4740_mmc_host
183 dev_err(mmc_dev(host->mmc), "Failed to get dma_tx channel\n"); jz4740_mmc_acquire_dma_channels()
189 dev_err(mmc_dev(host->mmc), "Failed to get dma_rx channel\n"); jz4740_mmc_acquire_dma_channels()
235 dev_warn(mmc_dev(host->mmc), jz4740_mmc_prepare_dma_data()
256 dev_err(mmc_dev(host->mmc), jz4740_mmc_prepare_dma_data()
306 dev_err(mmc_dev(host->mmc), jz4740_mmc_start_dma_transfer()
322 static void jz4740_mmc_pre_request(struct mmc_host *mmc, jz4740_mmc_pre_request() argument
326 struct jz4740_mmc_host *host = mmc_priv(mmc); jz4740_mmc_pre_request()
340 static void jz4740_mmc_post_request(struct mmc_host *mmc, jz4740_mmc_post_request() argument
344 struct jz4740_mmc_host *host = mmc_priv(mmc); jz4740_mmc_post_request()
417 mmc_request_done(host->mmc, req); jz4740_mmc_request_done()
792 mmc_signal_sdio_irq(host->mmc); jz_mmc_irq()
842 static void jz4740_mmc_request(struct mmc_host *mmc, struct mmc_request *req) jz4740_mmc_request() argument
844 struct jz4740_mmc_host *host = mmc_priv(mmc); jz4740_mmc_request()
859 static void jz4740_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) jz4740_mmc_set_ios() argument
861 struct jz4740_mmc_host *host = mmc_priv(mmc); jz4740_mmc_set_ios()
896 static void jz4740_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable) jz4740_mmc_enable_sdio_irq() argument
898 struct jz4740_mmc_host *host = mmc_priv(mmc); jz4740_mmc_enable_sdio_irq()
943 static int jz4740_mmc_request_gpios(struct mmc_host *mmc, jz4740_mmc_request_gpios() argument
953 mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH; jz4740_mmc_request_gpios()
955 mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; jz4740_mmc_request_gpios()
958 ret = mmc_gpio_request_cd(mmc, pdata->gpio_card_detect, 0); jz4740_mmc_request_gpios()
964 ret = mmc_gpio_request_ro(mmc, pdata->gpio_read_only); jz4740_mmc_request_gpios()
996 struct mmc_host *mmc; jz4740_mmc_probe() local
1002 mmc = mmc_alloc_host(sizeof(struct jz4740_mmc_host), &pdev->dev); jz4740_mmc_probe()
1003 if (!mmc) { jz4740_mmc_probe()
1004 dev_err(&pdev->dev, "Failed to alloc mmc host structure\n"); jz4740_mmc_probe()
1008 host = mmc_priv(mmc); jz4740_mmc_probe()
1018 host->clk = devm_clk_get(&pdev->dev, "mmc"); jz4740_mmc_probe()
1021 dev_err(&pdev->dev, "Failed to get mmc clock\n"); jz4740_mmc_probe()
1035 dev_err(&pdev->dev, "Failed to request mmc pins: %d\n", ret); jz4740_mmc_probe()
1039 ret = jz4740_mmc_request_gpios(mmc, pdev); jz4740_mmc_probe()
1043 mmc->ops = &jz4740_mmc_ops; jz4740_mmc_probe()
1044 mmc->f_min = JZ_MMC_CLK_RATE / 128; jz4740_mmc_probe()
1045 mmc->f_max = JZ_MMC_CLK_RATE; jz4740_mmc_probe()
1046 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; jz4740_mmc_probe()
1047 mmc->caps = (pdata && pdata->data_1bit) ? 0 : MMC_CAP_4_BIT_DATA; jz4740_mmc_probe()
1048 mmc->caps |= MMC_CAP_SDIO_IRQ; jz4740_mmc_probe()
1050 mmc->max_blk_size = (1 << 10) - 1; jz4740_mmc_probe()
1051 mmc->max_blk_count = (1 << 15) - 1; jz4740_mmc_probe()
1052 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; jz4740_mmc_probe()
1054 mmc->max_segs = 128; jz4740_mmc_probe()
1055 mmc->max_seg_size = mmc->max_req_size; jz4740_mmc_probe()
1057 host->mmc = mmc; jz4740_mmc_probe()
1081 ret = mmc_add_host(mmc); jz4740_mmc_probe()
1084 dev_err(&pdev->dev, "Failed to add mmc host: %d\n", ret); jz4740_mmc_probe()
1091 (mmc->caps & MMC_CAP_4_BIT_DATA) ? 4 : 1); jz4740_mmc_probe()
1104 mmc_free_host(mmc); jz4740_mmc_probe()
1117 mmc_remove_host(host->mmc); jz4740_mmc_remove()
1127 mmc_free_host(host->mmc); jz4740_mmc_remove()
1163 .name = "jz4740-mmc",
H A Drtsx_usb_sdmmc.c26 #include <linux/mmc/host.h>
27 #include <linux/mmc/mmc.h>
28 #include <linux/mmc/sd.h>
29 #include <linux/mmc/sdio.h>
30 #include <linux/mmc/card.h>
47 struct mmc_host *mmc; member in struct:rtsx_usb_sdmmc
763 static int sdmmc_get_ro(struct mmc_host *mmc) sdmmc_get_ro() argument
765 struct rtsx_usb_sdmmc *host = mmc_priv(mmc); sdmmc_get_ro()
791 static int sdmmc_get_cd(struct mmc_host *mmc) sdmmc_get_cd() argument
793 struct rtsx_usb_sdmmc *host = mmc_priv(mmc); sdmmc_get_cd()
822 static void sdmmc_request(struct mmc_host *mmc, struct mmc_request *mrq) sdmmc_request() argument
824 struct rtsx_usb_sdmmc *host = mmc_priv(mmc); sdmmc_request()
896 sdmmc_get_cd(mmc); sdmmc_request()
905 mmc_request_done(mmc, mrq); sdmmc_request()
1133 static void sdmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) sdmmc_set_ios() argument
1135 struct rtsx_usb_sdmmc *host = mmc_priv(mmc); sdmmc_set_ios()
1179 static int sdmmc_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios) sdmmc_switch_voltage() argument
1181 struct rtsx_usb_sdmmc *host = mmc_priv(mmc); sdmmc_switch_voltage()
1202 /* Let mmc core do the busy checking, simply stop the forced-toggle sdmmc_switch_voltage()
1228 static int sdmmc_card_busy(struct mmc_host *mmc) sdmmc_card_busy() argument
1230 struct rtsx_usb_sdmmc *host = mmc_priv(mmc); sdmmc_card_busy()
1268 static int sdmmc_execute_tuning(struct mmc_host *mmc, u32 opcode) sdmmc_execute_tuning() argument
1270 struct rtsx_usb_sdmmc *host = mmc_priv(mmc); sdmmc_execute_tuning()
1330 struct mmc_host *mmc = host->mmc; rtsx_usb_init_host() local
1332 mmc->f_min = 250000; rtsx_usb_init_host()
1333 mmc->f_max = 208000000; rtsx_usb_init_host()
1334 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; rtsx_usb_init_host()
1335 mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SD_HIGHSPEED | rtsx_usb_init_host()
1339 mmc->caps2 = MMC_CAP2_NO_PRESCAN_POWERUP | MMC_CAP2_FULL_PWR_CYCLE; rtsx_usb_init_host()
1341 mmc->max_current_330 = 400; rtsx_usb_init_host()
1342 mmc->max_current_180 = 800; rtsx_usb_init_host()
1343 mmc->ops = &rtsx_usb_sdmmc_ops; rtsx_usb_init_host()
1344 mmc->max_segs = 256; rtsx_usb_init_host()
1345 mmc->max_seg_size = 65536; rtsx_usb_init_host()
1346 mmc->max_blk_size = 512; rtsx_usb_init_host()
1347 mmc->max_blk_count = 65535; rtsx_usb_init_host()
1348 mmc->max_req_size = 524288; rtsx_usb_init_host()
1355 struct mmc_host *mmc; rtsx_usb_sdmmc_drv_probe() local
1368 mmc = mmc_alloc_host(sizeof(*host), &pdev->dev); rtsx_usb_sdmmc_drv_probe()
1369 if (!mmc) rtsx_usb_sdmmc_drv_probe()
1372 host = mmc_priv(mmc); rtsx_usb_sdmmc_drv_probe()
1374 host->mmc = mmc; rtsx_usb_sdmmc_drv_probe()
1384 "%s::", mmc_hostname(mmc)); rtsx_usb_sdmmc_drv_probe()
1387 host->led.default_trigger = mmc_hostname(mmc); rtsx_usb_sdmmc_drv_probe()
1390 err = led_classdev_register(mmc_dev(mmc), &host->led); rtsx_usb_sdmmc_drv_probe()
1397 mmc_add_host(mmc); rtsx_usb_sdmmc_drv_probe()
1405 struct mmc_host *mmc; rtsx_usb_sdmmc_drv_remove() local
1410 mmc = host->mmc; rtsx_usb_sdmmc_drv_remove()
1417 mmc_hostname(mmc)); rtsx_usb_sdmmc_drv_remove()
1421 mmc_request_done(mmc, host->mrq); rtsx_usb_sdmmc_drv_remove()
1425 mmc_remove_host(mmc); rtsx_usb_sdmmc_drv_remove()
1432 mmc_free_host(mmc); rtsx_usb_sdmmc_drv_remove()
H A Dof_mmc_spi.c25 #include <linux/mmc/core.h>
26 #include <linux/mmc/host.h>
54 irqreturn_t (*irqhandler)(int, void *), void *mmc) of_mmc_spi_init()
59 dev_name(dev), mmc); of_mmc_spi_init()
62 static void of_mmc_spi_exit(struct device *dev, void *mmc) of_mmc_spi_exit() argument
66 free_irq(oms->detect_irq, mmc); of_mmc_spi_exit()
53 of_mmc_spi_init(struct device *dev, irqreturn_t (*irqhandler)(int, void *), void *mmc) of_mmc_spi_init() argument
H A Dvub300.c47 #include <linux/mmc/host.h>
48 #include <linux/mmc/card.h>
49 #include <linux/mmc/sdio_func.h>
50 #include <linux/mmc/sdio_ids.h>
339 struct mmc_host *mmc; member in struct:vub300_mmc_host
375 struct mmc_host *mmc = vub300->mmc; vub300_delete() local
381 mmc_free_host(mmc); vub300_delete()
384 * which is contained at the end of struct mmc vub300_delete()
522 mmc_detect_change(vub300->mmc, 1); new_system_port_status()
526 mmc_detect_change(vub300->mmc, 0); new_system_port_status()
597 mmc_signal_sdio_irq(vub300->mmc); __vub300_irqpoll_response()
624 mmc_signal_sdio_irq(vub300->mmc); __vub300_irqpoll_response()
642 mmc_signal_sdio_irq(vub300->mmc); __vub300_irqpoll_response()
701 mmc_signal_sdio_irq(vub300->mmc); vub300_pollwork_thread()
731 } else if (vub300->mmc && vub300->mmc->card && vub300_deadwork_thread()
732 mmc_card_present(vub300->mmc->card)) { vub300_deadwork_thread()
1363 struct mmc_card *card = vub300->mmc->card; download_offload_pseudocode()
1759 if (likely(vub300->vub_name[0]) || !vub300->mmc->card || vub300_cmndwork_thread()
1760 !mmc_card_present(vub300->mmc->card)) { vub300_cmndwork_thread()
1766 } else if (0 == vub300->mmc->card->sdio_funcs) { vub300_cmndwork_thread()
1787 mmc_request_done(vub300->mmc, req); vub300_cmndwork_thread()
1795 mmc_request_done(vub300->mmc, req); vub300_cmndwork_thread()
1905 static void vub300_mmc_request(struct mmc_host *mmc, struct mmc_request *req) vub300_mmc_request() argument
1908 struct vub300_mmc_host *vub300 = mmc_priv(mmc); vub300_mmc_request()
1911 mmc_request_done(mmc, req); vub300_mmc_request()
1917 mmc_request_done(mmc, req); vub300_mmc_request()
1922 mmc_request_done(mmc, req); vub300_mmc_request()
1927 mmc_request_done(mmc, req); vub300_mmc_request()
1932 mmc_request_done(mmc, req); vub300_mmc_request()
1947 mmc_request_done(mmc, req); vub300_mmc_request()
2011 static void vub300_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) vub300_mmc_set_ios() argument
2013 struct vub300_mmc_host *vub300 = mmc_priv(mmc); vub300_mmc_set_ios()
2046 static int vub300_mmc_get_ro(struct mmc_host *mmc) vub300_mmc_get_ro() argument
2048 struct vub300_mmc_host *vub300 = mmc_priv(mmc); vub300_mmc_get_ro()
2052 static void vub300_enable_sdio_irq(struct mmc_host *mmc, int enable) vub300_enable_sdio_irq() argument
2054 struct vub300_mmc_host *vub300 = mmc_priv(mmc); vub300_enable_sdio_irq()
2062 mmc_signal_sdio_irq(vub300->mmc); vub300_enable_sdio_irq()
2080 static void vub300_init_card(struct mmc_host *mmc, struct mmc_card *card) vub300_init_card() argument
2082 struct vub300_mmc_host *vub300 = mmc_priv(mmc); vub300_init_card()
2104 struct mmc_host *mmc; vub300_probe() local
2128 /* this also allocates memory for our VUB300 mmc host device */ vub300_probe()
2129 mmc = mmc_alloc_host(sizeof(struct vub300_mmc_host), &udev->dev); vub300_probe()
2130 if (!mmc) { vub300_probe()
2136 mmc->caps = 0; vub300_probe()
2138 mmc->caps |= MMC_CAP_4_BIT_DATA; vub300_probe()
2140 mmc->caps |= MMC_CAP_SDIO_IRQ; vub300_probe()
2141 mmc->caps &= ~MMC_CAP_NEEDS_POLL; vub300_probe()
2148 mmc->caps |= MMC_CAP_MMC_HIGHSPEED; vub300_probe()
2149 mmc->caps |= MMC_CAP_SD_HIGHSPEED; vub300_probe()
2150 mmc->f_max = 24000000; vub300_probe()
2153 mmc->caps |= MMC_CAP_MMC_HIGHSPEED; vub300_probe()
2154 mmc->caps |= MMC_CAP_SD_HIGHSPEED; vub300_probe()
2155 mmc->f_max = 48000000; vub300_probe()
2157 mmc->f_min = 200000; vub300_probe()
2158 mmc->max_blk_count = 511; vub300_probe()
2159 mmc->max_blk_size = 512; vub300_probe()
2160 mmc->max_segs = 128; vub300_probe()
2162 mmc->max_req_size = force_max_req_size * 1024; vub300_probe()
2164 mmc->max_req_size = 64 * 1024; vub300_probe()
2165 mmc->max_seg_size = mmc->max_req_size; vub300_probe()
2166 mmc->ocr_avail = 0; vub300_probe()
2167 mmc->ocr_avail |= MMC_VDD_165_195; vub300_probe()
2168 mmc->ocr_avail |= MMC_VDD_20_21; vub300_probe()
2169 mmc->ocr_avail |= MMC_VDD_21_22; vub300_probe()
2170 mmc->ocr_avail |= MMC_VDD_22_23; vub300_probe()
2171 mmc->ocr_avail |= MMC_VDD_23_24; vub300_probe()
2172 mmc->ocr_avail |= MMC_VDD_24_25; vub300_probe()
2173 mmc->ocr_avail |= MMC_VDD_25_26; vub300_probe()
2174 mmc->ocr_avail |= MMC_VDD_26_27; vub300_probe()
2175 mmc->ocr_avail |= MMC_VDD_27_28; vub300_probe()
2176 mmc->ocr_avail |= MMC_VDD_28_29; vub300_probe()
2177 mmc->ocr_avail |= MMC_VDD_29_30; vub300_probe()
2178 mmc->ocr_avail |= MMC_VDD_30_31; vub300_probe()
2179 mmc->ocr_avail |= MMC_VDD_31_32; vub300_probe()
2180 mmc->ocr_avail |= MMC_VDD_32_33; vub300_probe()
2181 mmc->ocr_avail |= MMC_VDD_33_34; vub300_probe()
2182 mmc->ocr_avail |= MMC_VDD_34_35; vub300_probe()
2183 mmc->ocr_avail |= MMC_VDD_35_36; vub300_probe()
2184 mmc->ops = &vub300_mmc_ops; vub300_probe()
2185 vub300 = mmc_priv(mmc); vub300_probe()
2186 vub300->mmc = mmc; vub300_probe()
2305 (mmc->caps & MMC_CAP_SDIO_IRQ) ? "IRQs" : "POLL", vub300_probe()
2306 (mmc->caps & MMC_CAP_4_BIT_DATA) ? "4-bit" : "1-bit", vub300_probe()
2307 mmc->f_max / 1000000, vub300_probe()
2350 mmc_add_host(mmc); vub300_probe()
2353 mmc_free_host(mmc); vub300_probe()
2356 * which is contained at the end of struct mmc vub300_probe()
2370 if (!vub300 || !vub300->mmc) { vub300_disconnect()
2373 struct mmc_host *mmc = vub300->mmc; vub300_disconnect() local
2374 if (!vub300->mmc) { vub300_disconnect()
2382 mmc_remove_host(mmc); vub300_disconnect()
H A Ds3cmci.c2 * linux/drivers/mmc/s3cmci.h - Samsung S3C MCI driver
18 #include <linux/mmc/host.h>
32 #include <linux/platform_data/mmc-s3cmci.h>
146 static void s3cmci_send_request(struct mmc_host *mmc);
312 mmc_signal_sdio_irq(host->mmc); s3cmci_check_sdio_irq()
605 * was issued by mmc.c - therefore they are only set, when an error
625 mmc_signal_sdio_irq(host->mmc); s3cmci_irq()
820 mmc_detect_change(host->mmc, msecs_to_jiffies(500)); s3cmci_irq_cd()
894 s3cmci_send_request(host->mmc); finalize_request()
937 mmc_request_done(host->mmc, mrq); finalize_request()
1107 dma_map_sg(mmc_dev(host->mmc), data->sg, data->sg_len, s3cmci_prepare_dma()
1124 dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, s3cmci_prepare_dma()
1129 static void s3cmci_send_request(struct mmc_host *mmc) s3cmci_send_request() argument
1131 struct s3cmci_host *host = mmc_priv(mmc); s3cmci_send_request()
1155 mmc_request_done(mmc, mrq); s3cmci_send_request()
1169 mmc_request_done(mmc, mrq); s3cmci_send_request()
1181 static int s3cmci_card_present(struct mmc_host *mmc) s3cmci_card_present() argument
1183 struct s3cmci_host *host = mmc_priv(mmc); s3cmci_card_present()
1194 static void s3cmci_request(struct mmc_host *mmc, struct mmc_request *mrq) s3cmci_request() argument
1196 struct s3cmci_host *host = mmc_priv(mmc); s3cmci_request()
1198 host->status = "mmc request"; s3cmci_request()
1202 if (s3cmci_card_present(mmc) == 0) { s3cmci_request()
1205 mmc_request_done(mmc, mrq); s3cmci_request()
1207 s3cmci_send_request(mmc); s3cmci_request()
1233 static void s3cmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) s3cmci_set_ios() argument
1235 struct s3cmci_host *host = mmc_priv(mmc); s3cmci_set_ios()
1299 static int s3cmci_get_ro(struct mmc_host *mmc) s3cmci_get_ro() argument
1301 struct s3cmci_host *host = mmc_priv(mmc); s3cmci_get_ro()
1314 static void s3cmci_enable_sdio_irq(struct mmc_host *mmc, int enable) s3cmci_enable_sdio_irq() argument
1316 struct s3cmci_host *host = mmc_priv(mmc); s3cmci_enable_sdio_irq()
1375 struct mmc_host *mmc; s3cmci_cpufreq_transition() local
1381 mmc = host->mmc; s3cmci_cpufreq_transition()
1385 spin_lock_irqsave(&mmc->lock, flags); s3cmci_cpufreq_transition()
1389 if (mmc->ios.power_mode != MMC_POWER_OFF && s3cmci_cpufreq_transition()
1390 mmc->ios.clock != 0) s3cmci_cpufreq_transition()
1391 s3cmci_set_clk(host, &mmc->ios); s3cmci_cpufreq_transition()
1393 spin_unlock_irqrestore(&mmc->lock, flags); s3cmci_cpufreq_transition()
1552 struct mmc_host *mmc; s3cmci_probe() local
1559 mmc = mmc_alloc_host(sizeof(struct s3cmci_host), &pdev->dev); s3cmci_probe()
1560 if (!mmc) { s3cmci_probe()
1577 host = mmc_priv(mmc); s3cmci_probe()
1578 host->mmc = mmc; s3cmci_probe()
1719 mmc->ops = &s3cmci_ops; s3cmci_probe()
1720 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; s3cmci_probe()
1722 mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; s3cmci_probe()
1724 mmc->caps = MMC_CAP_4_BIT_DATA; s3cmci_probe()
1726 mmc->f_min = host->clk_rate / (host->clk_div * 256); s3cmci_probe()
1727 mmc->f_max = host->clk_rate / host->clk_div; s3cmci_probe()
1730 mmc->ocr_avail = host->pdata->ocr_avail; s3cmci_probe()
1732 mmc->max_blk_count = 4095; s3cmci_probe()
1733 mmc->max_blk_size = 4095; s3cmci_probe()
1734 mmc->max_req_size = 4095 * 512; s3cmci_probe()
1735 mmc->max_seg_size = mmc->max_req_size; s3cmci_probe()
1737 mmc->max_segs = 128; s3cmci_probe()
1750 ret = mmc_add_host(mmc); s3cmci_probe()
1752 dev_err(&pdev->dev, "failed to add mmc host.\n"); s3cmci_probe()
1758 platform_set_drvdata(pdev, mmc); s3cmci_probe()
1759 dev_info(&pdev->dev, "%s - using %s, %s SDIO IRQ\n", mmc_hostname(mmc), s3cmci_probe()
1761 mmc->caps & MMC_CAP_SDIO_IRQ ? "hw" : "sw"); s3cmci_probe()
1804 mmc_free_host(mmc); s3cmci_probe()
1812 struct mmc_host *mmc = platform_get_drvdata(pdev); s3cmci_shutdown() local
1813 struct s3cmci_host *host = mmc_priv(mmc); s3cmci_shutdown()
1820 mmc_remove_host(mmc); s3cmci_shutdown()
1826 struct mmc_host *mmc = platform_get_drvdata(pdev); s3cmci_remove() local
1827 struct s3cmci_host *host = mmc_priv(mmc); s3cmci_remove()
1855 mmc_free_host(mmc); s3cmci_remove()
H A Ddw_mmc-pci.c18 #include <linux/mmc/host.h>
19 #include <linux/mmc/mmc.h>
20 #include <linux/mmc/dw_mmc.h>
H A Ddw_mmc.c30 #include <linux/mmc/card.h>
31 #include <linux/mmc/host.h>
32 #include <linux/mmc/mmc.h>
33 #include <linux/mmc/sd.h>
34 #include <linux/mmc/sdio.h>
35 #include <linux/mmc/dw_mmc.h>
40 #include <linux/mmc/slot-gpio.h>
109 static int dw_mci_card_busy(struct mmc_host *mmc);
192 struct mmc_host *mmc = slot->mmc; dw_mci_init_debugfs() local
197 root = mmc->debugfs_root; dw_mci_init_debugfs()
228 dev_err(&mmc->class_dev, "failed to initialize debugfs for slot\n"); dw_mci_init_debugfs()
234 static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd) dw_mci_prepare_command() argument
237 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_prepare_command()
709 static void dw_mci_pre_req(struct mmc_host *mmc, dw_mci_pre_req() argument
713 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_pre_req()
728 static void dw_mci_post_req(struct mmc_host *mmc, dw_mci_post_req() argument
732 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_post_req()
951 dev_err(&slot->mmc->class_dev, mci_send_cmd()
983 dev_info(&slot->mmc->class_dev, dw_mci_setup_bus()
1047 cmdflags = dw_mci_prepare_command(slot->mmc, cmd); __dw_mci_start_request()
1081 host->stop_cmdr = dw_mci_prepare_command(slot->mmc, mrq->stop); __dw_mci_start_request()
1100 dev_vdbg(&slot->mmc->class_dev, "queue request: state=%d\n", dw_mci_queue_request()
1106 dev_warn(&slot->mmc->class_dev, dw_mci_queue_request()
1124 static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq) dw_mci_request() argument
1126 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_request()
1141 mmc_request_done(mmc, mrq); dw_mci_request()
1150 static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) dw_mci_set_ios() argument
1152 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_set_ios()
1182 * Use mirror of ios->clock to prevent race with mmc dw_mci_set_ios()
1192 if (!IS_ERR(mmc->supply.vmmc)) { dw_mci_set_ios()
1193 ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, dw_mci_set_ios()
1209 if (!IS_ERR(mmc->supply.vqmmc)) { dw_mci_set_ios()
1210 ret = regulator_enable(mmc->supply.vqmmc); dw_mci_set_ios()
1235 if (!IS_ERR(mmc->supply.vmmc)) dw_mci_set_ios()
1236 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); dw_mci_set_ios()
1238 if (!IS_ERR(mmc->supply.vqmmc) && slot->host->vqmmc_enabled) dw_mci_set_ios()
1239 regulator_disable(mmc->supply.vqmmc); dw_mci_set_ios()
1254 static int dw_mci_card_busy(struct mmc_host *mmc) dw_mci_card_busy() argument
1256 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_card_busy()
1268 static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios) dw_mci_switch_voltage() argument
1270 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_switch_voltage()
1292 if (!IS_ERR(mmc->supply.vqmmc)) { dw_mci_switch_voltage()
1293 ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv); dw_mci_switch_voltage()
1296 dev_dbg(&mmc->class_dev, dw_mci_switch_voltage()
1307 static int dw_mci_get_ro(struct mmc_host *mmc) dw_mci_get_ro() argument
1310 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_get_ro()
1311 int gpio_ro = mmc_gpio_get_ro(mmc); dw_mci_get_ro()
1323 dev_dbg(&mmc->class_dev, "card is %s\n", dw_mci_get_ro()
1329 static int dw_mci_get_cd(struct mmc_host *mmc) dw_mci_get_cd() argument
1332 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_get_cd()
1335 int gpio_cd = mmc_gpio_get_cd(mmc); dw_mci_get_cd()
1339 (mmc->caps & MMC_CAP_NONREMOVABLE)) dw_mci_get_cd()
1350 dev_dbg(&mmc->class_dev, "card is present\n"); dw_mci_get_cd()
1353 dev_dbg(&mmc->class_dev, "card is not present\n"); dw_mci_get_cd()
1360 static void dw_mci_init_card(struct mmc_host *mmc, struct mmc_card *card) dw_mci_init_card() argument
1362 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_init_card()
1370 if (mmc->caps & MMC_CAP_SDIO_IRQ) { dw_mci_init_card()
1394 static void dw_mci_enable_sdio_irq(struct mmc_host *mmc, int enb) dw_mci_enable_sdio_irq() argument
1396 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_enable_sdio_irq()
1414 static int dw_mci_execute_tuning(struct mmc_host *mmc, u32 opcode) dw_mci_execute_tuning() argument
1416 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_execute_tuning()
1426 static int dw_mci_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_ios *ios) dw_mci_prepare_hs400_tuning() argument
1428 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_prepare_hs400_tuning()
1458 struct mmc_host *prev_mmc = host->cur_slot->mmc;
1469 mmc_hostname(slot->mmc));
2179 if (slot->mmc->ops->card_event) dw_mci_handle_cd()
2180 slot->mmc->ops->card_event(slot->mmc); dw_mci_handle_cd()
2181 mmc_detect_change(slot->mmc, dw_mci_handle_cd()
2285 mmc_signal_sdio_irq(slot->mmc); dw_mci_interrupt()
2371 struct mmc_host *mmc; dw_mci_init_slot() local
2377 mmc = mmc_alloc_host(sizeof(struct dw_mci_slot), host->dev); dw_mci_init_slot()
2378 if (!mmc) dw_mci_init_slot()
2381 slot = mmc_priv(mmc); dw_mci_init_slot()
2384 slot->mmc = mmc; dw_mci_init_slot()
2390 mmc->ops = &dw_mci_ops; dw_mci_init_slot()
2393 mmc->f_min = DW_MCI_FREQ_MIN; dw_mci_init_slot()
2394 mmc->f_max = DW_MCI_FREQ_MAX; dw_mci_init_slot()
2396 mmc->f_min = freq[0]; dw_mci_init_slot()
2397 mmc->f_max = freq[1]; dw_mci_init_slot()
2401 ret = mmc_regulator_get_supply(mmc); dw_mci_init_slot()
2405 if (!mmc->ocr_avail) dw_mci_init_slot()
2406 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; dw_mci_init_slot()
2409 mmc->caps = host->pdata->caps; dw_mci_init_slot()
2412 mmc->pm_caps = host->pdata->pm_caps; dw_mci_init_slot()
2422 mmc->caps |= drv_data->caps[ctrl_id]; dw_mci_init_slot()
2425 mmc->caps2 = host->pdata->caps2; dw_mci_init_slot()
2427 ret = mmc_of_parse(mmc); dw_mci_init_slot()
2432 mmc->max_segs = host->pdata->blk_settings->max_segs; dw_mci_init_slot()
2433 mmc->max_blk_size = host->pdata->blk_settings->max_blk_size; dw_mci_init_slot()
2434 mmc->max_blk_count = host->pdata->blk_settings->max_blk_count; dw_mci_init_slot()
2435 mmc->max_req_size = host->pdata->blk_settings->max_req_size; dw_mci_init_slot()
2436 mmc->max_seg_size = host->pdata->blk_settings->max_seg_size; dw_mci_init_slot()
2440 mmc->max_segs = host->ring_size; dw_mci_init_slot()
2441 mmc->max_blk_size = 65536; dw_mci_init_slot()
2442 mmc->max_seg_size = DW_MCI_DESC_DATA_LENGTH; dw_mci_init_slot()
2443 mmc->max_req_size = mmc->max_seg_size * host->ring_size; dw_mci_init_slot()
2444 mmc->max_blk_count = mmc->max_req_size / 512; dw_mci_init_slot()
2446 mmc->max_segs = 64; dw_mci_init_slot()
2447 mmc->max_blk_size = 65536; /* BLKSIZ is 16 bits */ dw_mci_init_slot()
2448 mmc->max_blk_count = 512; dw_mci_init_slot()
2449 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; dw_mci_init_slot()
2450 mmc->max_seg_size = mmc->max_req_size; dw_mci_init_slot()
2454 if (dw_mci_get_cd(mmc)) dw_mci_init_slot()
2459 ret = mmc_add_host(mmc); dw_mci_init_slot()
2470 mmc_free_host(mmc); dw_mci_init_slot()
2476 /* Debugfs stuff is cleaned up by mmc core */ dw_mci_cleanup_slot()
2477 mmc_remove_host(slot->mmc); dw_mci_cleanup_slot()
2479 mmc_free_host(slot->mmc); dw_mci_cleanup_slot()
2729 if (IS_ERR_VALUE(mmc_gpio_get_cd(slot->mmc))) dw_mci_enable_cd()
2864 mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */ dw_mci_probe()
2978 mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */ dw_mci_remove()
3045 if (slot->mmc->pm_flags & MMC_PM_KEEP_POWER) { dw_mci_resume()
3046 dw_mci_set_ios(slot->mmc, &slot->mmc->ios); dw_mci_resume()
H A Dsdhci-cns3xxx.c17 #include <linux/mmc/host.h>
28 struct device *dev = mmc_dev(host->mmc); sdhci_cns3xxx_set_clock()
33 host->mmc->actual_clock = 0; sdhci_cns3xxx_set_clock()
H A Dvia-sdmmc.c2 * drivers/mmc/host/via-sdmmc.c - VIA SD/MMC Card Reader driver
17 #include <linux/mmc/host.h>
299 struct mmc_host *mmc; member in struct:via_crdr_mmc_host
473 dev_info(host->mmc->parent, "forcing card speed to 8MHz\n"); via_set_ddma()
488 BUG_ON(data->blksz > host->mmc->max_blk_size); via_sdc_preparedata()
489 BUG_ON(data->blocks > host->mmc->max_blk_count); via_sdc_preparedata()
493 count = dma_map_sg(mmc_dev(host->mmc), data->sg, data->sg_len, via_sdc_preparedata()
586 pr_err("%s: cmd->flag is not valid\n", mmc_hostname(host->mmc)); via_sdc_send_command()
637 dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, via_sdc_finish_data()
659 static void via_sdc_request(struct mmc_host *mmc, struct mmc_request *mrq) via_sdc_request() argument
666 host = mmc_priv(mmc); via_sdc_request()
719 static void via_sdc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) via_sdc_set_ios() argument
727 host = mmc_priv(mmc); via_sdc_set_ios()
781 static int via_sdc_get_ro(struct mmc_host *mmc) via_sdc_get_ro() argument
787 host = mmc_priv(mmc); via_sdc_get_ro()
843 mmc_hostname(host->mmc), intmask); via_sdc_cmd_isr()
921 mmc_hostname(sdhost->mmc), sd_status); via_sdc_isr()
945 "cmd:0x%x\n", mmc_hostname(sdhost->mmc), via_sdc_timeout()
984 mmc_request_done(host->mmc, mrq); via_sdc_tasklet_finish()
1009 mmc_hostname(host->mmc)); via_sdc_card_detect()
1028 mmc_detect_change(host->mmc, msecs_to_jiffies(500)); via_sdc_card_detect()
1033 struct mmc_host *mmc = host->mmc; via_init_mmc_host() local
1044 mmc->f_min = VIA_CRDR_MIN_CLOCK; via_init_mmc_host()
1045 mmc->f_max = VIA_CRDR_MAX_CLOCK; via_init_mmc_host()
1046 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; via_init_mmc_host()
1047 mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SD_HIGHSPEED; via_init_mmc_host()
1048 mmc->ops = &via_sdc_ops; via_init_mmc_host()
1051 mmc->max_segs = 1; via_init_mmc_host()
1053 mmc->max_blk_size = VIA_CRDR_MAX_BLOCK_LENGTH; via_init_mmc_host()
1054 mmc->max_blk_count = VIA_CRDR_MAX_BLOCK_COUNT; via_init_mmc_host()
1056 mmc->max_seg_size = mmc->max_blk_size * mmc->max_blk_count; via_init_mmc_host()
1057 mmc->max_req_size = mmc->max_seg_size; via_init_mmc_host()
1088 struct mmc_host *mmc; via_sd_probe() local
1110 mmc = mmc_alloc_host(sizeof(struct via_crdr_mmc_host), &pcidev->dev); via_sd_probe()
1111 if (!mmc) { via_sd_probe()
1116 sdhost = mmc_priv(mmc); via_sd_probe()
1117 sdhost->mmc = mmc; via_sd_probe()
1162 mmc_add_host(mmc); via_sd_probe()
1170 mmc_free_host(mmc); via_sd_probe()
1187 /* Ensure we don't accept more commands from mmc layer */ via_sd_remove()
1196 "transfer\n", mmc_hostname(sdhost->mmc)); via_sd_remove()
1209 mmc_remove_host(sdhost->mmc); via_sd_remove()
1224 mmc_free_host(sdhost->mmc); via_sd_remove()
H A Dsh_mmcif.c51 #include <linux/mmc/card.h>
52 #include <linux/mmc/core.h>
53 #include <linux/mmc/host.h>
54 #include <linux/mmc/mmc.h>
55 #include <linux/mmc/sdio.h>
56 #include <linux/mmc/sh_mmcif.h>
57 #include <linux/mmc/slot-gpio.h>
228 struct mmc_host *mmc; member in struct:sh_mmcif_host
937 static void sh_mmcif_request(struct mmc_host *mmc, struct mmc_request *mrq) sh_mmcif_request() argument
939 struct sh_mmcif_host *host = mmc_priv(mmc); sh_mmcif_request()
947 mmc_request_done(mmc, mrq); sh_mmcif_request()
964 mmc_request_done(mmc, mrq); sh_mmcif_request()
981 host->mmc->f_max = host->clk / 2; sh_mmcif_clk_update()
982 host->mmc->f_min = host->clk / 512; sh_mmcif_clk_update()
990 struct mmc_host *mmc = host->mmc; sh_mmcif_set_power() local
992 if (!IS_ERR(mmc->supply.vmmc)) sh_mmcif_set_power()
994 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, sh_mmcif_set_power()
998 static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) sh_mmcif_set_ios() argument
1000 struct sh_mmcif_host *host = mmc_priv(mmc); sh_mmcif_set_ios()
1055 static int sh_mmcif_get_cd(struct mmc_host *mmc) sh_mmcif_get_cd() argument
1057 struct sh_mmcif_host *host = mmc_priv(mmc); sh_mmcif_get_cd()
1059 int ret = mmc_gpio_get_cd(mmc); sh_mmcif_get_cd()
1141 dev_err(host->mmc->parent, sh_mmcif_end_cmd()
1146 dev_err(host->mmc->parent, "DMA timeout!\n"); sh_mmcif_end_cmd()
1149 dev_err(host->mmc->parent, sh_mmcif_end_cmd()
1268 mmc_request_done(host->mmc, mrq); sh_mmcif_irqt()
1359 mmc_request_done(host->mmc, mrq); mmcif_timeout_work()
1365 struct mmc_host *mmc = host->mmc; sh_mmcif_init_ocr() local
1367 mmc_regulator_get_supply(mmc); sh_mmcif_init_ocr()
1372 if (!mmc->ocr_avail) sh_mmcif_init_ocr()
1373 mmc->ocr_avail = pd->ocr; sh_mmcif_init_ocr()
1375 dev_warn(mmc_dev(mmc), "Platform OCR mask is ignored\n"); sh_mmcif_init_ocr()
1381 struct mmc_host *mmc; sh_mmcif_probe() local
1400 mmc = mmc_alloc_host(sizeof(struct sh_mmcif_host), &pdev->dev); sh_mmcif_probe()
1401 if (!mmc) sh_mmcif_probe()
1404 ret = mmc_of_parse(mmc); sh_mmcif_probe()
1408 host = mmc_priv(mmc); sh_mmcif_probe()
1409 host->mmc = mmc; sh_mmcif_probe()
1419 mmc->ops = &sh_mmcif_ops; sh_mmcif_probe()
1422 mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_WAIT_WHILE_BUSY; sh_mmcif_probe()
1424 mmc->caps |= pd->caps; sh_mmcif_probe()
1425 mmc->max_segs = 32; sh_mmcif_probe()
1426 mmc->max_blk_size = 512; sh_mmcif_probe()
1427 mmc->max_req_size = PAGE_CACHE_SIZE * mmc->max_segs; sh_mmcif_probe()
1428 mmc->max_blk_count = mmc->max_req_size / mmc->max_blk_size; sh_mmcif_probe()
1429 mmc->max_seg_size = mmc->max_req_size; sh_mmcif_probe()
1473 ret = mmc_gpio_request_cd(mmc, pd->cd_gpio, 0); sh_mmcif_probe()
1480 ret = mmc_add_host(mmc); sh_mmcif_probe()
1498 mmc_free_host(mmc); sh_mmcif_probe()
1512 mmc_remove_host(host->mmc); sh_mmcif_remove()
1518 * (a query on the linux-mmc mailing list didn't bring any replies). sh_mmcif_remove()
1523 mmc_free_host(host->mmc); sh_mmcif_remove()
H A Dwbsd.c2 * linux/drivers/mmc/host/wbsd.c - Winbond W83L51xD SD/MMC driver
35 #include <linux/mmc/host.h>
197 pr_err("%s: Resetting chip\n", mmc_hostname(host->mmc)); wbsd_reset()
232 mmc_request_done(host->mmc, mrq); wbsd_request_end()
726 mmc_hostname(host->mmc), count); wbsd_finish_data()
754 static void wbsd_request(struct mmc_host *mmc, struct mmc_request *mrq) wbsd_request() argument
756 struct wbsd_host *host = mmc_priv(mmc); wbsd_request()
807 mmc_hostname(host->mmc), cmd->opcode); wbsd_request()
850 static void wbsd_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) wbsd_set_ios() argument
852 struct wbsd_host *host = mmc_priv(mmc); wbsd_set_ios()
923 static int wbsd_get_ro(struct mmc_host *mmc) wbsd_get_ro() argument
925 struct wbsd_host *host = mmc_priv(mmc); wbsd_get_ro()
1032 mmc_hostname(host->mmc)); wbsd_tasklet_card()
1049 mmc_detect_change(host->mmc, msecs_to_jiffies(delay)); wbsd_tasklet_card()
1200 struct mmc_host *mmc; wbsd_alloc_mmc() local
1206 mmc = mmc_alloc_host(sizeof(struct wbsd_host), dev); wbsd_alloc_mmc()
1207 if (!mmc) wbsd_alloc_mmc()
1210 host = mmc_priv(mmc); wbsd_alloc_mmc()
1211 host->mmc = mmc; wbsd_alloc_mmc()
1218 mmc->ops = &wbsd_ops; wbsd_alloc_mmc()
1219 mmc->f_min = 375000; wbsd_alloc_mmc()
1220 mmc->f_max = 24000000; wbsd_alloc_mmc()
1221 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; wbsd_alloc_mmc()
1222 mmc->caps = MMC_CAP_4_BIT_DATA; wbsd_alloc_mmc()
1237 mmc->max_segs = 128; wbsd_alloc_mmc()
1242 mmc->max_req_size = 65536; wbsd_alloc_mmc()
1248 mmc->max_seg_size = mmc->max_req_size; wbsd_alloc_mmc()
1254 mmc->max_blk_size = 4087; wbsd_alloc_mmc()
1260 mmc->max_blk_count = mmc->max_req_size; wbsd_alloc_mmc()
1262 dev_set_drvdata(dev, mmc); wbsd_alloc_mmc()
1269 struct mmc_host *mmc; wbsd_free_mmc() local
1272 mmc = dev_get_drvdata(dev); wbsd_free_mmc()
1273 if (!mmc) wbsd_free_mmc()
1276 host = mmc_priv(mmc); wbsd_free_mmc()
1281 mmc_free_host(mmc); wbsd_free_mmc()
1396 host->dma_addr = dma_map_single(mmc_dev(host->mmc), host->dma_buffer, wbsd_request_dma()
1420 dma_unmap_single(mmc_dev(host->mmc), host->dma_addr, wbsd_request_dma()
1438 dma_unmap_single(mmc_dev(host->mmc), host->dma_addr, wbsd_release_dma()
1650 struct mmc_host *mmc = NULL; wbsd_init() local
1657 mmc = dev_get_drvdata(dev); wbsd_init()
1658 host = mmc_priv(mmc); wbsd_init()
1715 mmc_add_host(mmc); wbsd_init()
1717 pr_info("%s: W83L51xD", mmc_hostname(mmc)); wbsd_init()
1734 struct mmc_host *mmc = dev_get_drvdata(dev); wbsd_shutdown() local
1737 if (!mmc) wbsd_shutdown()
1740 host = mmc_priv(mmc); wbsd_shutdown()
1742 mmc_remove_host(mmc); wbsd_shutdown()
1814 struct mmc_host *mmc = platform_get_drvdata(dev); wbsd_platform_suspend() local
1817 if (mmc == NULL) wbsd_platform_suspend()
1822 host = mmc_priv(mmc); wbsd_platform_suspend()
1830 struct mmc_host *mmc = platform_get_drvdata(dev); wbsd_platform_resume() local
1833 if (mmc == NULL) wbsd_platform_resume()
1838 host = mmc_priv(mmc); wbsd_platform_resume()
1855 struct mmc_host *mmc = dev_get_drvdata(&pnp_dev->dev); wbsd_pnp_suspend() local
1857 if (mmc == NULL) wbsd_pnp_suspend()
1866 struct mmc_host *mmc = dev_get_drvdata(&pnp_dev->dev); wbsd_pnp_resume() local
1869 if (mmc == NULL) wbsd_pnp_resume()
1874 host = mmc_priv(mmc); wbsd_pnp_resume()
H A Dsdhci-pxav3.c25 #include <linux/mmc/card.h>
26 #include <linux/mmc/host.h>
27 #include <linux/mmc/slot-gpio.h>
168 host->mmc->caps &= ~MMC_CAP_1_8V_DDR; armada_38x_quirks()
179 struct platform_device *pdev = to_platform_device(mmc_dev(host->mmc)); pxav3_reset()
212 dev_dbg(mmc_dev(host->mmc), pxav3_gen_init_74_clocks()
241 dev_warn(mmc_dev(host->mmc), "74 clock interrupt not cleared\n"); pxav3_gen_init_74_clocks()
303 dev_dbg(mmc_dev(host->mmc), pxav3_set_uhs_signaling()
328 .compatible = "mrvl,pxav3-mmc",
398 host->mmc->caps |= MMC_CAP_1_8V_DDR; sdhci_pxav3_probe()
411 ret = mmc_of_parse(host->mmc); sdhci_pxav3_probe()
420 host->mmc->caps |= MMC_CAP_NONREMOVABLE; sdhci_pxav3_probe()
424 host->mmc->caps |= MMC_CAP_8_BIT_DATA; sdhci_pxav3_probe()
431 host->mmc->caps |= pdata->host_caps; sdhci_pxav3_probe()
433 host->mmc->caps2 |= pdata->host_caps2; sdhci_pxav3_probe()
435 host->mmc->pm_caps |= pdata->pm_caps; sdhci_pxav3_probe()
438 ret = mmc_gpio_request_cd(host->mmc, pdata->ext_cd_gpio, sdhci_pxav3_probe()
441 dev_err(mmc_dev(host->mmc), sdhci_pxav3_probe()
463 if (host->mmc->pm_caps & MMC_PM_KEEP_POWER) { sdhci_pxav3_probe()
465 host->mmc->pm_flags |= MMC_PM_WAKE_SDIO_IRQ; sdhci_pxav3_probe()
H A Dmmc_spi.c37 #include <linux/mmc/host.h>
38 #include <linux/mmc/mmc.h> /* for R1_SPI_* bit values */
39 #include <linux/mmc/slot-gpio.h>
49 * - For now, we won't try to interoperate with a real mmc/sd/sdio
51 * SPI protocol. The main reason for such configs would be mmc-ish
126 struct mmc_host *mmc; member in struct:mmc_spi_host
441 * On error, caller must cope with mmc core retry mechanism. That
679 if (host->mmc->use_spi_crc) mmc_spi_writeblock()
853 if (host->mmc->use_spi_crc) { mmc_spi_readblock()
1050 static void mmc_spi_request(struct mmc_host *mmc, struct mmc_request *mrq) mmc_spi_request() argument
1052 struct mmc_spi_host *host = mmc_priv(mmc); mmc_spi_request()
1079 mmc_request_done(host->mmc, mrq); mmc_spi_request()
1120 mmc_request_done(host->mmc, mrq); mmc_spi_request()
1181 static void mmc_spi_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) mmc_spi_set_ios() argument
1183 struct mmc_spi_host *host = mmc_priv(mmc); mmc_spi_set_ios()
1285 mmc_spi_detect_irq(int irq, void *mmc) mmc_spi_detect_irq() argument
1287 struct mmc_spi_host *host = mmc_priv(mmc); mmc_spi_detect_irq()
1290 mmc_detect_change(mmc, msecs_to_jiffies(delay_msec)); mmc_spi_detect_irq()
1297 struct mmc_host *mmc; mmc_spi_probe() local
1338 mmc = mmc_alloc_host(sizeof(*host), &spi->dev); mmc_spi_probe()
1339 if (!mmc) mmc_spi_probe()
1342 mmc->ops = &mmc_spi_ops; mmc_spi_probe()
1343 mmc->max_blk_size = MMC_SPI_BLOCKSIZE; mmc_spi_probe()
1344 mmc->max_segs = MMC_SPI_BLOCKSATONCE; mmc_spi_probe()
1345 mmc->max_req_size = MMC_SPI_BLOCKSATONCE * MMC_SPI_BLOCKSIZE; mmc_spi_probe()
1346 mmc->max_blk_count = MMC_SPI_BLOCKSATONCE; mmc_spi_probe()
1348 mmc->caps = MMC_CAP_SPI; mmc_spi_probe()
1358 mmc->f_min = 400000; mmc_spi_probe()
1359 mmc->f_max = spi->max_speed_hz; mmc_spi_probe()
1361 host = mmc_priv(mmc); mmc_spi_probe()
1362 host->mmc = mmc; mmc_spi_probe()
1372 mmc->ocr_avail = host->pdata->ocr_mask; mmc_spi_probe()
1373 if (!mmc->ocr_avail) { mmc_spi_probe()
1375 mmc->ocr_avail = MMC_VDD_32_33|MMC_VDD_33_34; mmc_spi_probe()
1383 dev_set_drvdata(&spi->dev, mmc); mmc_spi_probe()
1419 status = host->pdata->init(&spi->dev, mmc_spi_detect_irq, mmc); mmc_spi_probe()
1426 mmc->caps |= host->pdata->caps; mmc_spi_probe()
1427 mmc->caps2 |= host->pdata->caps2; mmc_spi_probe()
1430 status = mmc_add_host(mmc); mmc_spi_probe()
1435 status = mmc_gpio_request_cd(mmc, host->pdata->cd_gpio, mmc_spi_probe()
1444 mmc->caps &= ~MMC_CAP_NEEDS_POLL; mmc_spi_probe()
1445 mmc_gpiod_request_cd_irq(mmc); mmc_spi_probe()
1450 status = mmc_gpio_request_ro(mmc, host->pdata->ro_gpio); mmc_spi_probe()
1456 dev_name(&mmc->class_dev), mmc_spi_probe()
1461 (mmc->caps & MMC_CAP_NEEDS_POLL) mmc_spi_probe()
1466 mmc_remove_host (mmc); mmc_spi_probe()
1474 mmc_free_host(mmc); mmc_spi_probe()
1486 struct mmc_host *mmc = dev_get_drvdata(&spi->dev); mmc_spi_remove() local
1489 if (mmc) { mmc_spi_remove()
1490 host = mmc_priv(mmc); mmc_spi_remove()
1494 host->pdata->exit(&spi->dev, mmc); mmc_spi_remove()
1496 mmc_remove_host(mmc); mmc_spi_remove()
1508 spi->max_speed_hz = mmc->f_max; mmc_spi_remove()
1509 mmc_free_host(mmc); mmc_spi_remove()
1517 { .compatible = "mmc-spi-slot", },
H A Dsh_mobile_sdhi.c28 #include <linux/mmc/host.h>
29 #include <linux/mmc/sh_mobile_sdhi.h>
116 struct mmc_host *mmc = platform_get_drvdata(pdev); sh_mobile_sdhi_clk_enable() local
117 struct tmio_mmc_host *host = mmc_priv(mmc); sh_mobile_sdhi_clk_enable()
133 struct mmc_host *mmc = platform_get_drvdata(pdev); sh_mobile_sdhi_clk_disable() local
134 struct tmio_mmc_host *host = mmc_priv(mmc); sh_mobile_sdhi_clk_disable()
348 mmc_hostname(host->mmc), (unsigned long) sh_mobile_sdhi_probe()
350 host->mmc->f_max / 1000000); sh_mobile_sdhi_probe()
364 struct mmc_host *mmc = platform_get_drvdata(pdev); sh_mobile_sdhi_remove() local
365 struct tmio_mmc_host *host = mmc_priv(mmc); sh_mobile_sdhi_remove()
H A Dtifm_sd.c16 #include <linux/mmc/host.h>
621 static void tifm_sd_request(struct mmc_host *mmc, struct mmc_request *mrq) tifm_sd_request() argument
623 struct tifm_sd *host = mmc_priv(mmc); tifm_sd_request()
732 mmc_request_done(mmc, mrq); tifm_sd_request()
739 struct mmc_host *mmc = tifm_get_drvdata(sock); tifm_sd_end_cmd() local
783 mmc_request_done(mmc, mrq); tifm_sd_end_cmd()
797 static void tifm_sd_ios(struct mmc_host *mmc, struct mmc_ios *ios) tifm_sd_ios() argument
799 struct tifm_sd *host = mmc_priv(mmc); tifm_sd_ios()
864 static int tifm_sd_ro(struct mmc_host *mmc) tifm_sd_ro() argument
867 struct tifm_sd *host = mmc_priv(mmc); tifm_sd_ro()
949 struct mmc_host *mmc; tifm_sd_probe() local
960 mmc = mmc_alloc_host(sizeof(struct tifm_sd), &sock->dev); tifm_sd_probe()
961 if (!mmc) tifm_sd_probe()
964 host = mmc_priv(mmc); tifm_sd_probe()
965 tifm_set_drvdata(sock, mmc); tifm_sd_probe()
973 mmc->ops = &tifm_sd_ops; tifm_sd_probe()
974 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; tifm_sd_probe()
975 mmc->caps = MMC_CAP_4_BIT_DATA; tifm_sd_probe()
976 mmc->f_min = 20000000 / 60; tifm_sd_probe()
977 mmc->f_max = 24000000; tifm_sd_probe()
979 mmc->max_blk_count = 2048; tifm_sd_probe()
980 mmc->max_segs = mmc->max_blk_count; tifm_sd_probe()
981 mmc->max_blk_size = min(TIFM_MMCSD_MAX_BLOCK_SIZE, PAGE_SIZE); tifm_sd_probe()
982 mmc->max_seg_size = mmc->max_blk_count * mmc->max_blk_size; tifm_sd_probe()
983 mmc->max_req_size = mmc->max_seg_size; tifm_sd_probe()
990 rc = mmc_add_host(mmc); tifm_sd_probe()
994 mmc_free_host(mmc); tifm_sd_probe()
1000 struct mmc_host *mmc = tifm_get_drvdata(sock); tifm_sd_remove() local
1001 struct tifm_sd *host = mmc_priv(mmc); tifm_sd_remove()
1023 mmc_remove_host(mmc); tifm_sd_remove()
1026 mmc_free_host(mmc); tifm_sd_remove()
1038 struct mmc_host *mmc = tifm_get_drvdata(sock); tifm_sd_resume() local
1039 struct tifm_sd *host = mmc_priv(mmc); tifm_sd_resume()
H A Dcb710-mmc.h2 * cb710/cb710-mmc.h
30 static inline struct cb710_slot *cb710_mmc_to_slot(struct mmc_host *mmc) cb710_mmc_to_slot() argument
32 struct platform_device *pdev = container_of(mmc_dev(mmc), cb710_mmc_to_slot()
H A Ddw_mmc-pltfm.c20 #include <linux/mmc/host.h>
21 #include <linux/mmc/mmc.h>
22 #include <linux/mmc/dw_mmc.h>
H A Dsdhci-tegra.c23 #include <linux/mmc/card.h>
24 #include <linux/mmc/host.h>
25 #include <linux/mmc/slot-gpio.h>
119 return mmc_gpio_get_ro(host->mmc); tegra_sdhci_get_ro()
153 if ((host->mmc->caps & MMC_CAP_8_BIT_DATA) && tegra_sdhci_set_bus_width()
270 dev_err(mmc_dev(host->mmc), "failed to allocate tegra_host\n"); sdhci_tegra_probe()
277 rc = mmc_of_parse(host->mmc); sdhci_tegra_probe()
288 clk = devm_clk_get(mmc_dev(host->mmc), NULL); sdhci_tegra_probe()
290 dev_err(mmc_dev(host->mmc), "clk err\n"); sdhci_tegra_probe()
H A Datmel-mci.c33 #include <linux/platform_data/mmc-atmel-mci.h>
35 #include <linux/mmc/host.h>
36 #include <linux/mmc/sdio.h>
233 * @mmc: The mmc_host representing this slot.
251 struct mmc_host *mmc; member in struct:atmel_mci_slot
476 struct mmc_host *mmc = slot->mmc; atmci_init_debugfs() local
481 root = mmc->debugfs_root; atmci_init_debugfs()
513 dev_err(&mmc->class_dev, "failed to initialize debugfs for slot\n"); atmci_init_debugfs()
654 dev_vdbg(&slot->mmc->class_dev, "setting timeout to %u cycles\n", atmci_set_timeout()
662 static u32 atmci_prepare_command(struct mmc_host *mmc, atmci_prepare_command() argument
686 if (mmc->ios.bus_mode == MMC_BUSMODE_OPENDRAIN) atmci_prepare_command()
887 * We may not complete the mmc request here anyway atmci_dma_complete()
888 * because the mmc layer may call back and cause us to atmci_dma_complete()
1170 dev_dbg(&slot->mmc->class_dev, "WARNING: IMR=0x%08x\n", atmci_start_request()
1187 dev_vdbg(&slot->mmc->class_dev, "BLKR=0x%08x\n", atmci_start_request()
1195 cmdflags = atmci_prepare_command(slot->mmc, cmd); atmci_start_request()
1213 host->stop_cmdr = atmci_prepare_command(slot->mmc, mrq->stop); atmci_start_request()
1237 dev_vdbg(&slot->mmc->class_dev, "queue request: state=%d\n", atmci_queue_request()
1252 static void atmci_request(struct mmc_host *mmc, struct mmc_request *mrq) atmci_request() argument
1254 struct atmel_mci_slot *slot = mmc_priv(mmc); atmci_request()
1273 mmc_request_done(mmc, mrq); atmci_request()
1281 mmc_request_done(mmc, mrq); atmci_request()
1287 static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) atmci_set_ios() argument
1289 struct atmel_mci_slot *slot = mmc_priv(mmc); atmci_set_ios()
1318 * Use mirror of ios->clock to prevent race with mmc atmci_set_ios()
1332 dev_warn(&mmc->class_dev, atmci_set_ios()
1337 dev_warn(&mmc->class_dev, atmci_set_ios()
1347 dev_warn(&mmc->class_dev, atmci_set_ios()
1403 if (!IS_ERR(mmc->supply.vmmc)) atmci_set_ios()
1404 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); atmci_set_ios()
1408 if (!IS_ERR(mmc->supply.vmmc)) atmci_set_ios()
1409 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); atmci_set_ios()
1431 static int atmci_get_ro(struct mmc_host *mmc) atmci_get_ro() argument
1434 struct atmel_mci_slot *slot = mmc_priv(mmc); atmci_get_ro()
1438 dev_dbg(&mmc->class_dev, "card is %s\n", atmci_get_ro()
1445 static int atmci_get_cd(struct mmc_host *mmc) atmci_get_cd() argument
1448 struct atmel_mci_slot *slot = mmc_priv(mmc); atmci_get_cd()
1453 dev_dbg(&mmc->class_dev, "card is %spresent\n", atmci_get_cd()
1460 static void atmci_enable_sdio_irq(struct mmc_host *mmc, int enable) atmci_enable_sdio_irq() argument
1462 struct atmel_mci_slot *slot = mmc_priv(mmc); atmci_enable_sdio_irq()
1485 struct mmc_host *prev_mmc = host->cur_slot->mmc;
1507 mmc_hostname(slot->mmc));
1572 dev_vdbg(&slot->mmc->class_dev, "detect change: %d (was %d)\n", atmci_detect_change()
1579 dev_dbg(&slot->mmc->class_dev, "card %s\n", atmci_detect_change()
1638 mmc_request_done(slot->mmc, mrq); atmci_detect_change()
1644 mmc_detect_change(slot->mmc, 0); atmci_detect_change()
1999 mmc_signal_sdio_irq(slot->mmc); atmci_sdio_interrupt()
2152 struct mmc_host *mmc; atmci_init_slot() local
2155 mmc = mmc_alloc_host(sizeof(struct atmel_mci_slot), &host->pdev->dev); atmci_init_slot()
2156 if (!mmc) atmci_init_slot()
2159 slot = mmc_priv(mmc); atmci_init_slot()
2160 slot->mmc = mmc; atmci_init_slot()
2168 dev_dbg(&mmc->class_dev, atmci_init_slot()
2175 mmc->ops = &atmci_ops; atmci_init_slot()
2176 mmc->f_min = DIV_ROUND_UP(host->bus_hz, 512); atmci_init_slot()
2177 mmc->f_max = host->bus_hz / 2; atmci_init_slot()
2178 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; atmci_init_slot()
2180 mmc->caps |= MMC_CAP_SDIO_IRQ; atmci_init_slot()
2182 mmc->caps |= MMC_CAP_SD_HIGHSPEED; atmci_init_slot()
2189 mmc->caps |= MMC_CAP_4_BIT_DATA; atmci_init_slot()
2192 mmc->max_segs = 256; atmci_init_slot()
2193 mmc->max_blk_size = 4095; atmci_init_slot()
2194 mmc->max_blk_count = 256; atmci_init_slot()
2195 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; atmci_init_slot()
2196 mmc->max_seg_size = mmc->max_blk_size * mmc->max_segs; atmci_init_slot()
2198 mmc->max_segs = 64; atmci_init_slot()
2199 mmc->max_req_size = 32768 * 512; atmci_init_slot()
2200 mmc->max_blk_size = 32768; atmci_init_slot()
2201 mmc->max_blk_count = 512; atmci_init_slot()
2209 dev_dbg(&mmc->class_dev, "no detect pin available\n"); atmci_init_slot()
2219 mmc->caps |= MMC_CAP_NONREMOVABLE; atmci_init_slot()
2221 mmc->caps |= MMC_CAP_NEEDS_POLL; atmci_init_slot()
2227 dev_dbg(&mmc->class_dev, "no WP pin available\n"); atmci_init_slot()
2233 mmc_regulator_get_supply(mmc); atmci_init_slot()
2234 mmc_add_host(mmc); atmci_init_slot()
2245 "mmc-detect", slot); atmci_init_slot()
2247 dev_dbg(&mmc->class_dev, atmci_init_slot()
2262 /* Debugfs stuff is cleaned up by mmc core */ atmci_cleanup_slot()
2267 mmc_remove_host(slot->mmc); atmci_cleanup_slot()
2277 mmc_free_host(slot->mmc); atmci_cleanup_slot()
2469 host->buf_size = host->slot[0]->mmc->max_req_size; atmci_probe()
2477 if (host->slot[1]->mmc->max_req_size > host->buf_size) atmci_probe()
2479 host->slot[1]->mmc->max_req_size; atmci_probe()
H A Dsdhci-acpi.c40 #include <linux/mmc/host.h>
41 #include <linux/mmc/pm.h>
42 #include <linux/mmc/slot-gpio.h>
348 host->mmc->caps |= c->slot->chip->caps; sdhci_acpi_probe()
349 host->mmc->caps2 |= c->slot->chip->caps2; sdhci_acpi_probe()
350 host->mmc->pm_caps |= c->slot->chip->pm_caps; sdhci_acpi_probe()
354 host->mmc->caps |= c->slot->caps; sdhci_acpi_probe()
355 host->mmc->caps2 |= c->slot->caps2; sdhci_acpi_probe()
356 host->mmc->pm_caps |= c->slot->pm_caps; sdhci_acpi_probe()
359 host->mmc->caps2 |= MMC_CAP2_NO_PRESCAN_POWERUP; sdhci_acpi_probe()
364 if (mmc_gpiod_request_cd(host->mmc, NULL, 0, v, 0, NULL)) { sdhci_acpi_probe()
H A Dsdhci-esdhc-imx.c21 #include <linux/mmc/host.h>
22 #include <linux/mmc/mmc.h>
23 #include <linux/mmc/sdio.h>
24 #include <linux/mmc/slot-gpio.h>
29 #include <linux/platform_data/mmc-esdhc-imx.h>
598 host->mmc->actual_clock = 0; esdhc_pltfm_set_clock()
622 host->mmc->actual_clock = host_clock / pre_div / div; esdhc_pltfm_set_clock()
623 dev_dbg(mmc_dev(host->mmc), "desired SD clock: %d, actual: %d\n", esdhc_pltfm_set_clock()
624 clock, host->mmc->actual_clock); esdhc_pltfm_set_clock()
655 return mmc_gpio_get_ro(host->mmc); esdhc_pltfm_get_ro()
698 dev_dbg(mmc_dev(host->mmc), esdhc_prepare_tuning()
720 if (!mmc_send_tuning(host->mmc)) esdhc_executing_tuning()
729 if (mmc_send_tuning(host->mmc)) { esdhc_executing_tuning()
739 ret = mmc_send_tuning(host->mmc); esdhc_executing_tuning()
742 dev_dbg(mmc_dev(host->mmc), "tunning %s at 0x%x ret %d\n", esdhc_executing_tuning()
755 dev_dbg(mmc_dev(host->mmc), "change pinctrl state for uhs %d\n", uhs); esdhc_change_pinstate()
908 ret = mmc_of_parse(host->mmc); sdhci_esdhc_imx_probe_dt()
912 if (!IS_ERR_VALUE(mmc_gpio_get_cd(host->mmc))) sdhci_esdhc_imx_probe_dt()
987 dev_warn(mmc_dev(host->mmc), "could not get default state\n"); sdhci_esdhc_imx_probe()
1003 host->mmc->caps |= MMC_CAP_1_8V_DDR; sdhci_esdhc_imx_probe()
1017 if (!host->mmc->parent->platform_data) { sdhci_esdhc_imx_probe()
1018 dev_err(mmc_dev(host->mmc), "no board data!\n"); sdhci_esdhc_imx_probe()
1023 host->mmc->parent->platform_data); sdhci_esdhc_imx_probe()
1028 err = mmc_gpio_request_ro(host->mmc, boarddata->wp_gpio); sdhci_esdhc_imx_probe()
1030 dev_err(mmc_dev(host->mmc), sdhci_esdhc_imx_probe()
1034 host->mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; sdhci_esdhc_imx_probe()
1042 err = mmc_gpio_request_cd(host->mmc, boarddata->cd_gpio, 0); sdhci_esdhc_imx_probe()
1044 dev_err(mmc_dev(host->mmc), sdhci_esdhc_imx_probe()
1056 host->mmc->caps |= MMC_CAP_NONREMOVABLE; sdhci_esdhc_imx_probe()
1065 host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA; sdhci_esdhc_imx_probe()
1068 host->mmc->caps |= MMC_CAP_4_BIT_DATA; sdhci_esdhc_imx_probe()
1085 dev_warn(mmc_dev(host->mmc), sdhci_esdhc_imx_probe()
H A Ddw_mmc-k3.c14 #include <linux/mmc/host.h>
15 #include <linux/mmc/dw_mmc.h>
H A Ds3cmci.h2 * linux/drivers/mmc/s3cmci.h - Samsung S3C MCI driver
23 struct mmc_host *mmc; member in struct:s3cmci_host
H A Dsdhci-pxav2.c27 #include <linux/mmc/card.h>
28 #include <linux/mmc/host.h>
56 struct platform_device *pdev = to_platform_device(mmc_dev(host->mmc)); pxav2_reset()
125 .compatible = "mrvl,pxav2-mmc",
203 host->mmc->caps |= MMC_CAP_NONREMOVABLE; sdhci_pxav2_probe()
208 host->mmc->caps |= MMC_CAP_8_BIT_DATA; sdhci_pxav2_probe()
213 host->mmc->caps |= pdata->host_caps; sdhci_pxav2_probe()
215 host->mmc->pm_caps |= pdata->pm_caps; sdhci_pxav2_probe()
H A Ddw_mmc-rockchip.c13 #include <linux/mmc/host.h>
14 #include <linux/mmc/dw_mmc.h>
44 * cclkin: source clock of mmc controller dw_mci_rk3288_set_ios()
H A Dsdhci-spear.c2 * drivers/mmc/host/sdhci-spear.c
28 #include <linux/mmc/host.h>
29 #include <linux/mmc/slot-gpio.h>
115 ret = mmc_gpio_request_cd(host->mmc, sdhci->card_int_gpio, 0); sdhci_probe()
H A Dsdhci-of-hlwd.c2 * drivers/mmc/host/sdhci-of-hlwd.c
24 #include <linux/mmc/host.h>
H A Dsdhci-pci.c1 /* linux/drivers/mmc/host/sdhci-pci.c - SDHCI on PCI bus interface
22 #include <linux/mmc/host.h>
27 #include <linux/mmc/slot-gpio.h>
28 #include <linux/mmc/sdhci-pci-data.h>
113 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; mrst_hc_probe_slot()
133 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; pch_hc_probe_slot()
144 mmc_detect_change(host->mmc, msecs_to_jiffies(200)); sdhci_pci_sd_cd()
208 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE; mfd_emmc_probe_slot()
209 slot->host->mmc->caps2 |= MMC_CAP2_BOOTPART_NOACC | mfd_emmc_probe_slot()
216 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE; mfd_sdio_probe_slot()
271 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | byt_emmc_probe_slot()
275 slot->host->mmc->caps2 |= MMC_CAP2_HC_ERASE_SZ; byt_emmc_probe_slot()
284 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE | byt_sdio_probe_slot()
292 slot->host->mmc->caps |= MMC_CAP_BUS_WIDTH_TEST | byt_sd_probe_slot()
337 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | intel_mrfl_mmc_probe_slot()
502 slot->host->mmc->caps |= MMC_CAP_BUS_WIDTH_TEST; jmicron_probe_slot()
648 slot->host->mmc->caps2 |= MMC_CAP2_HS200; rtsx_probe_slot()
1247 slot_pm_flags = slot->host->mmc->pm_flags; sdhci_pci_suspend()
1458 ret = pci_request_region(pdev, bar, mmc_hostname(host->mmc)); sdhci_pci_probe_slot()
1480 slot->host->mmc->caps |= MMC_CAP_HW_RESET; sdhci_pci_probe_slot()
1488 host->mmc->pm_caps = MMC_PM_KEEP_POWER | MMC_PM_WAKE_SDIO_IRQ; sdhci_pci_probe_slot()
1489 host->mmc->slotno = slotno; sdhci_pci_probe_slot()
1490 host->mmc->caps2 |= MMC_CAP2_NO_PRESCAN_POWERUP; sdhci_pci_probe_slot()
1493 mmc_gpiod_request_cd(host->mmc, slot->cd_con_id, slot->cd_idx, sdhci_pci_probe_slot()
H A Dsdhci-s3c.c1 /* linux/drivers/mmc/host/sdhci-s3c.c
19 #include <linux/platform_data/mmc-sdhci-s3c.h>
30 #include <linux/mmc/host.h>
165 host->mmc->actual_clock = 0; sdhci_s3c_set_clock()
231 * To init mmc host properly a minimal clock value is needed. For high system
306 host->mmc->actual_clock = 0; sdhci_cmu_set_clock()
326 mmc_hostname(host->mmc), clock); sdhci_cmu_set_clock()
339 mmc_hostname(host->mmc)); sdhci_cmu_set_clock()
577 host->mmc->caps = MMC_CAP_NONREMOVABLE; sdhci_s3c_probe()
581 host->mmc->caps |= MMC_CAP_8_BIT_DATA; sdhci_s3c_probe()
583 host->mmc->caps |= MMC_CAP_4_BIT_DATA; sdhci_s3c_probe()
588 host->mmc->pm_caps |= pdata->pm_caps; sdhci_s3c_probe()
608 host->mmc->caps |= pdata->host_caps; sdhci_s3c_probe()
611 host->mmc->caps2 |= pdata->host_caps2; sdhci_s3c_probe()
618 ret = mmc_of_parse(host->mmc); sdhci_s3c_probe()
H A Dsdhci-st.c25 #include <linux/mmc/host.h>
153 struct mmc_host *mhost = host->mmc; st_mmcss_cconfig()
307 dev_warn(mmc_dev(host->mmc), "Error setting dll for clock " sdhci_st_set_uhs_signaling()
310 dev_dbg(mmc_dev(host->mmc), "uhs %d, ctrl_2 %04X\n", uhs, ctrl_2); sdhci_st_set_uhs_signaling()
365 clk = devm_clk_get(&pdev->dev, "mmc"); sdhci_st_probe()
384 ret = mmc_of_parse(host->mmc); sdhci_st_probe()
394 "top-mmc-delay"); sdhci_st_probe()
H A Dsdhci-iproc.c20 #include <linux/mmc/host.h>
44 mmc_hostname(host->mmc), reg, val); sdhci_iproc_readl()
65 mmc_hostname(host->mmc), reg, val); sdhci_iproc_writel()
199 mmc_of_parse(host->mmc); sdhci_iproc_probe()
203 host->mmc->caps |= MMC_CAP_1_8V_DDR; sdhci_iproc_probe()
H A Dsdhci-dove.c25 #include <linux/mmc/host.h>
95 ret = mmc_of_parse(host->mmc); sdhci_dove_probe()
H A Ddw_mmc-exynos.c15 #include <linux/mmc/host.h>
16 #include <linux/mmc/dw_mmc.h>
17 #include <linux/mmc/mmc.h>
453 struct mmc_host *mmc = slot->mmc; dw_mci_exynos_execute_tuning() local
464 if (!mmc_send_tuning(mmc)) dw_mci_exynos_execute_tuning()
H A Dmmci.h2 * linux/drivers/mmc/host/mmci.h - ARM PrimeCell MMCI PL180/1 driver
204 struct mmc_host *mmc; member in struct:mmci_host
H A Dmmci_qcom_dml.c18 #include <linux/mmc/host.h>
19 #include <linux/mmc/card.h>
H A Dsdhci_f_sdh30.c2 * linux/drivers/mmc/host/sdhci_f_sdh30.c
130 ret = mmc_of_parse(host->mmc); sdhci_f_sdh30_probe()
H A Dwbsd.h2 * linux/drivers/mmc/host/wbsd.h - Winbond W83L51xD SD/MMC driver
142 struct mmc_host* mmc; /* MMC structure */ member in struct:wbsd_host
H A Dsdhci-of-esdhc.c21 #include <linux/mmc/host.h>
206 host->mmc->actual_clock = 0; esdhc_of_set_clock()
230 dev_dbg(mmc_dev(host->mmc), "desired SD clock: %d, actual: %d\n", esdhc_of_set_clock()
373 ret = mmc_of_parse(host->mmc); sdhci_esdhc_probe()
H A Dsdhci-pltfm.c109 host->mmc->pm_caps |= MMC_PM_KEEP_POWER; sdhci_get_of_property()
112 host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ; sdhci_get_of_property()
157 mmc_hostname(host->mmc))) { sdhci_pltfm_init()
H A Dtmio_mmc.h2 * linux/drivers/mmc/host/tmio_mmc.h
21 #include <linux/mmc/tmio.h>
56 struct mmc_host *mmc; member in struct:tmio_mmc_host
H A Dtmio_mmc_dma.c2 * linux/drivers/mmc/tmio_mmc_dma.c
17 #include <linux/mmc/host.h>
18 #include <linux/mmc/tmio.h>
H A Ddw_mmc.h228 * @mmc: The mmc_host representing this slot.
245 struct mmc_host *mmc; member in struct:dw_mci_slot
268 * @caps: mmc subsystem specified capabilities of the controller(s).
H A Dsdhci-bcm2835.c24 #include <linux/mmc/host.h>
162 dev_err(mmc_dev(host->mmc), bcm2835_sdhci_probe()
H A Dsdhci-of-arasan.c176 ret = mmc_of_parse(host->mmc); sdhci_arasan_probe()
H A Dtoshsd.h165 struct mmc_host *mmc; member in struct:toshsd_host
/linux-4.1.27/arch/arm/mach-omap2/
H A Dhsmmc.c17 #include <linux/mmc/host.h>
40 struct omap_hsmmc_platform_data *mmc = dev->platform_data; omap_hsmmc1_before_set_reg() local
42 if (mmc->remux) omap_hsmmc1_before_set_reg()
43 mmc->remux(dev, power_on); omap_hsmmc1_before_set_reg()
65 if (mmc->internal_clock) { omap_hsmmc1_before_set_reg()
112 static void hsmmc2_select_input_clk_src(struct omap_hsmmc_platform_data *mmc) hsmmc2_select_input_clk_src() argument
117 if (mmc->internal_clock) hsmmc2_select_input_clk_src()
126 struct omap_hsmmc_platform_data *mmc = dev->platform_data; hsmmc2_before_set_reg() local
128 if (mmc->remux) hsmmc2_before_set_reg()
129 mmc->remux(dev, power_on); hsmmc2_before_set_reg()
132 hsmmc2_select_input_clk_src(mmc); hsmmc2_before_set_reg()
137 struct omap_hsmmc_platform_data *mmc = dev->platform_data; am35x_hsmmc2_set_power() local
140 hsmmc2_select_input_clk_src(mmc); am35x_hsmmc2_set_power()
236 struct omap_hsmmc_platform_data *mmc) omap_hsmmc_pdata_init()
250 snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i", omap_hsmmc_pdata_init()
251 c->mmc, 1); omap_hsmmc_pdata_init()
252 mmc->name = hc_name; omap_hsmmc_pdata_init()
253 mmc->caps = c->caps; omap_hsmmc_pdata_init()
254 mmc->internal_clock = !c->ext_clock; omap_hsmmc_pdata_init()
255 mmc->reg_offset = 0; omap_hsmmc_pdata_init()
259 mmc->gpio_cd = -EINVAL; omap_hsmmc_pdata_init()
260 mmc->gpio_cod = c->gpio_cd; omap_hsmmc_pdata_init()
262 /* card detect pin on the mmc socket itself */ omap_hsmmc_pdata_init()
263 mmc->gpio_cd = c->gpio_cd; omap_hsmmc_pdata_init()
264 mmc->gpio_cod = -EINVAL; omap_hsmmc_pdata_init()
266 mmc->gpio_wp = c->gpio_wp; omap_hsmmc_pdata_init()
268 mmc->remux = c->remux; omap_hsmmc_pdata_init()
269 mmc->init_card = c->init_card; omap_hsmmc_pdata_init()
272 mmc->nonremovable = 1; omap_hsmmc_pdata_init()
282 mmc->ocr_mask = MMC_VDD_165_195 | omap_hsmmc_pdata_init()
289 mmc->ocr_mask = c->ocr_mask; omap_hsmmc_pdata_init()
292 mmc->features |= HSMMC_HAS_PBIAS; omap_hsmmc_pdata_init()
294 switch (c->mmc) { omap_hsmmc_pdata_init()
296 if (mmc->features & HSMMC_HAS_PBIAS) { omap_hsmmc_pdata_init()
298 mmc->before_set_reg = omap_hsmmc_pdata_init()
300 mmc->after_set_reg = omap_hsmmc_pdata_init()
305 mmc->set_power = nop_mmc_set_power; omap_hsmmc_pdata_init()
312 mmc->caps = c->caps; omap_hsmmc_pdata_init()
317 mmc->set_power = am35x_hsmmc2_set_power; omap_hsmmc_pdata_init()
325 if (mmc->features & HSMMC_HAS_PBIAS) { omap_hsmmc_pdata_init()
327 mmc->before_set_reg = hsmmc2_before_set_reg; omap_hsmmc_pdata_init()
328 mmc->after_set_reg = NULL; omap_hsmmc_pdata_init()
334 mmc->before_set_reg = NULL; omap_hsmmc_pdata_init()
335 mmc->after_set_reg = NULL; omap_hsmmc_pdata_init()
338 pr_err("MMC%d configuration not supported!\n", c->mmc); omap_hsmmc_pdata_init()
358 for (; c->mmc; c++) { omap_hsmmc_late_init()
375 /* card detect pin on the mmc socket itself */ omap_hsmmc_late_init()
405 pr_err("Cannot allocate memory for mmc device!\n"); omap_hsmmc_init_one()
417 "mmc%d", ctrl_nr); omap_hsmmc_init_one()
500 for (; controllers->mmc; controllers++) omap_hsmmc_init()
501 omap_hsmmc_init_one(controllers, controllers->mmc); omap_hsmmc_init()
235 omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, struct omap_hsmmc_platform_data *mmc) omap_hsmmc_pdata_init() argument
H A Dhsmmc.h12 u8 mmc; /* controller 1/2/3 */ member in struct:omap2_hsmmc_info
14 * capabilities OR'd (ref. linux/mmc/host.h) */
19 bool deferred; /* mmc needs a deferred probe */
23 struct platform_device *pdev; /* mmc controller instance */
H A Dboard-omap3beagle.c34 #include <linux/mmc/host.h>
272 static struct omap2_hsmmc_info mmc[] = { variable in typeref:struct:omap2_hsmmc_info
274 .mmc = 1,
306 mmc[0].gpio_wp = beagle_config.mmc1_gpio_wp; beagle_twl_gpio_setup()
308 mmc[0].gpio_cd = gpio + 0; beagle_twl_gpio_setup()
309 omap_hsmmc_late_init(mmc); beagle_twl_gpio_setup()
547 mmc[0].caps = beagle_config.mmc_caps; omap3_beagle_init()
548 omap_hsmmc_init(mmc); omap3_beagle_init()
H A Dboard-omap3pandora.c36 #include <linux/mmc/host.h>
37 #include <linux/mmc/card.h>
269 .mmc = 1,
277 .mmc = 2,
286 .mmc = 3,
300 /* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */ omap3pandora_twl_gpio_setup()
H A Dboard-ldp.c30 #include <linux/mmc/host.h>
343 static struct omap2_hsmmc_info mmc[] __initdata = {
345 .mmc = 1,
415 omap_hsmmc_init(mmc); omap_ldp_init()
H A Dboard-cm-t35.c35 #include <linux/mmc/host.h>
396 static struct omap2_hsmmc_info mmc[] = { variable in typeref:struct:omap2_hsmmc_info
398 .mmc = 1,
405 .mmc = 2,
467 mmc[0].gpio_cd = gpio + 0; cm_t35_twl_gpio_setup()
468 omap_hsmmc_late_init(mmc); cm_t35_twl_gpio_setup()
720 omap_hsmmc_init(mmc); cm_t3x_common_init()
H A Dboard-overo.c38 #include <linux/mmc/host.h>
272 static struct omap2_hsmmc_info mmc[] = { variable in typeref:struct:omap2_hsmmc_info
274 .mmc = 1,
280 .mmc = 2,
508 omap_hsmmc_init(mmc); overo_init()
H A Dboard-omap3logic.c31 #include <linux/mmc/host.h>
103 .mmc = 1,
H A Dmsdi.c34 #include "mmc.h"
H A Dboard-n8x0.c24 #include <linux/mmc/host.h>
26 #include <linux/platform_data/mmc-omap.h>
34 #include "mmc.h"
H A Dboard-rx51-peripherals.c28 #include <linux/mmc/host.h>
493 static struct omap2_hsmmc_info mmc[] __initdata = {
496 .mmc = 1,
504 .mmc = 2,
1280 omap_hsmmc_init(mmc); rx51_peripherals_init()
/linux-4.1.27/arch/arm/mach-omap1/
H A Dmmc.h1 #include <linux/mmc/host.h>
2 #include <linux/platform_data/mmc-omap.h>
H A DMakefile31 obj-$(CONFIG_MACH_OMAP_H2) += board-h2.o board-h2-mmc.o \
38 obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o board-h3-mmc.o \
47 obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o
H A Dboard-h2-mmc.c2 * linux/arch/arm/mach-omap1/board-h2-mmc.c
7 * This code is based on linux/arch/arm/mach-omap2/board-n800-mmc.c, which is:
20 #include "mmc.h"
H A Dboard-h3-mmc.c2 * linux/arch/arm/mach-omap1/board-h3-mmc.c
7 * This code is based on linux/arch/arm/mach-omap2/board-n800-mmc.c, which is:
20 #include "mmc.h"
H A Dboard-sx1-mmc.c2 * linux/arch/arm/mach-omap1/board-sx1-mmc.c
7 * This code is based on linux/arch/arm/mach-omap1/board-h2-mmc.c, which is:
21 #include "mmc.h"
/linux-4.1.27/drivers/usb/wusbcore/
H A DMakefile12 mmc.o \
/linux-4.1.27/include/linux/platform_data/
H A Dmmc-davinci.h9 #include <linux/mmc/host.h>
23 /* any additional host capabilities: OR'd in to mmc->f_caps */
H A Dmmc-pxamci.h4 #include <linux/mmc/host.h>
H A Dmmc-esdhc-imx.h17 ESDHC_WP_CONTROLLER, /* mmc controller internal WP */
23 ESDHC_CD_CONTROLLER, /* mmc controller internal CD */
H A Dmmc-mxcmmc.h4 #include <linux/mmc/host.h>
H A Dmmc-s3cmci.h5 * struct s3c24xx_mci_pdata - sd/mmc controller platform data
44 * s3c24xx_mci_set_platdata - set platform data for mmc/sdi device
H A Dhsmmc-omap.h53 * need to OR'd all capabilities (ref. linux/mmc/host.h)
56 u32 pm_caps; /* PM capabilities of the mmc */
H A Dmmc-omap.h47 * need to OR'd all capabilities (ref. linux/mmc/host.h)
51 u32 pm_caps; /* PM capabilities of the mmc */
H A Dmmc-sdhci-s3c.h7 S3C_SDHCI_CD_INTERNAL, /* use mmc internal CD line */
/linux-4.1.27/drivers/net/wireless/rsi/
H A Drsi_sdio.h22 #include <linux/mmc/card.h>
23 #include <linux/mmc/mmc.h>
24 #include <linux/mmc/host.h>
25 #include <linux/mmc/sdio_func.h>
26 #include <linux/mmc/sdio.h>
27 #include <linux/mmc/sd.h>
28 #include <linux/mmc/sdio_ids.h>
/linux-4.1.27/drivers/mfd/
H A Dtc6387xb.c81 static void tc6387xb_mmc_pwr(struct platform_device *mmc, int state) tc6387xb_mmc_pwr() argument
83 struct platform_device *dev = to_platform_device(mmc->dev.parent); tc6387xb_mmc_pwr()
89 static void tc6387xb_mmc_clk_div(struct platform_device *mmc, int state) tc6387xb_mmc_clk_div() argument
91 struct platform_device *dev = to_platform_device(mmc->dev.parent); tc6387xb_mmc_clk_div()
98 static int tc6387xb_mmc_enable(struct platform_device *mmc) tc6387xb_mmc_enable() argument
100 struct platform_device *dev = to_platform_device(mmc->dev.parent); tc6387xb_mmc_enable()
111 static int tc6387xb_mmc_disable(struct platform_device *mmc) tc6387xb_mmc_disable() argument
113 struct platform_device *dev = to_platform_device(mmc->dev.parent); tc6387xb_mmc_disable()
131 .name = "tmio-mmc",
H A Dt7l66xb.c83 static int t7l66xb_mmc_enable(struct platform_device *mmc) t7l66xb_mmc_enable() argument
85 struct platform_device *dev = to_platform_device(mmc->dev.parent); t7l66xb_mmc_enable()
106 static int t7l66xb_mmc_disable(struct platform_device *mmc) t7l66xb_mmc_disable() argument
108 struct platform_device *dev = to_platform_device(mmc->dev.parent); t7l66xb_mmc_disable()
126 static void t7l66xb_mmc_pwr(struct platform_device *mmc, int state) t7l66xb_mmc_pwr() argument
128 struct platform_device *dev = to_platform_device(mmc->dev.parent); t7l66xb_mmc_pwr()
134 static void t7l66xb_mmc_clk_div(struct platform_device *mmc, int state) t7l66xb_mmc_clk_div() argument
136 struct platform_device *dev = to_platform_device(mmc->dev.parent); t7l66xb_mmc_clk_div()
170 .name = "tmio-mmc",
H A Dtc6393xb.c352 static int tc6393xb_mmc_enable(struct platform_device *mmc) tc6393xb_mmc_enable() argument
354 struct platform_device *dev = to_platform_device(mmc->dev.parent); tc6393xb_mmc_enable()
363 static int tc6393xb_mmc_resume(struct platform_device *mmc) tc6393xb_mmc_resume() argument
365 struct platform_device *dev = to_platform_device(mmc->dev.parent); tc6393xb_mmc_resume()
374 static void tc6393xb_mmc_pwr(struct platform_device *mmc, int state) tc6393xb_mmc_pwr() argument
376 struct platform_device *dev = to_platform_device(mmc->dev.parent); tc6393xb_mmc_pwr()
382 static void tc6393xb_mmc_clk_div(struct platform_device *mmc, int state) tc6393xb_mmc_clk_div() argument
384 struct platform_device *dev = to_platform_device(mmc->dev.parent); tc6393xb_mmc_clk_div()
404 .name = "tmio-mmc",
/linux-4.1.27/arch/arm/mach-imx/devices/
H A Dplatform-mxc-mmc.c29 imx_mxc_mmc_data_entry(MX21, "imx21-mmc", _id, _hwid, SZ_4K)
38 imx_mxc_mmc_data_entry(MX27, "imx21-mmc", _id, _hwid, SZ_4K)
47 imx_mxc_mmc_data_entry(MX31, "imx31-mmc", _id, _hwid, SZ_16K)
H A DMakefile21 obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o
H A Dplatform-sdhci-esdhc-imx.c9 #include <linux/platform_data/mmc-esdhc-imx.h>
H A Ddevices-common.h228 #include <linux/platform_data/mmc-mxcmmc.h>
283 #include <linux/platform_data/mmc-esdhc-imx.h>
/linux-4.1.27/drivers/clk/sunxi/
H A Dclk-mod0.c190 struct clk *mmc, *mmc_parent, *clk = hw->clk; mmc_get_phase() local
204 mmc = clk_get_parent(clk); mmc_get_phase()
205 if (!mmc) mmc_get_phase()
209 mmc_rate = clk_get_rate(mmc); mmc_get_phase()
214 mmc_parent = clk_get_parent(mmc); mmc_get_phase()
232 struct clk *mmc, *mmc_parent, *clk = hw->clk; mmc_set_phase() local
240 mmc = clk_get_parent(clk); mmc_set_phase()
241 if (!mmc) mmc_set_phase()
245 mmc_rate = clk_get_rate(mmc); mmc_set_phase()
250 mmc_parent = clk_get_parent(mmc); mmc_set_phase()
300 * sunxi_mmc_setup - Common setup function for mmc module clocks
384 CLK_OF_DECLARE(sun4i_a10_mmc, "allwinner,sun4i-a10-mmc-clk", sun4i_a10_mmc_setup);
392 CLK_OF_DECLARE(sun9i_a80_mmc, "allwinner,sun9i-a80-mmc-clk", sun9i_a80_mmc_setup);
H A Dclk-sun9i-mmc.c203 { .compatible = "allwinner,sun9i-a80-mmc-config-clk" },
209 .name = "sun9i-a80-mmc-config-clk",
/linux-4.1.27/drivers/media/
H A DMakefile31 obj-y += common/ platform/ pci/ usb/ mmc/ firewire/
/linux-4.1.27/arch/sh/boot/romimage/
H A DMakefile4 # create an romImage file suitable for burning to flash/mmc from zImage
H A Dmmcif-sh7724.c11 #include <linux/mmc/sh_mmcif.h>
12 #include <linux/mmc/boot.h>
/linux-4.1.27/drivers/net/wireless/brcm80211/brcmfmac/
H A Dof.c19 #include <linux/mmc/card.h>
21 #include <linux/mmc/sdio_func.h>
/linux-4.1.27/include/linux/spi/
H A Dmmc_spi.h16 * card slot. (Modeled after PXA mmc glue; see that for usage examples.)
39 /* Capabilities to pass into mmc core (e.g. MMC_CAP_NEEDS_POLL). */
/linux-4.1.27/arch/arm/mach-davinci/
H A Dda8xx-dt.c36 OF_DEV_AUXDATA("ti,da830-mmc", 0x01c40000, "da830-mmc.0", NULL),
H A Ddevices.c23 #include <linux/platform_data/mmc-davinci.h>
158 .name = "dm6441-mmc",
195 .name = "dm6441-mmc",
243 davinci_mmcsd1_device.name = "da830-mmc"; davinci_setup_mmc()
265 davinci_mmcsd0_device.name = "da830-mmc"; davinci_setup_mmc()
/linux-4.1.27/include/linux/amba/
H A Dmmci.h7 #include <linux/mmc/host.h>
14 * mmc/host.h
/linux-4.1.27/drivers/staging/gdm72xx/
H A Dsdio_boot.c22 #include <linux/mmc/core.h>
23 #include <linux/mmc/card.h>
24 #include <linux/mmc/sdio_func.h>
H A Dgdm_sdio.c18 #include <linux/mmc/core.h>
19 #include <linux/mmc/card.h>
20 #include <linux/mmc/sdio_func.h>
21 #include <linux/mmc/sdio_ids.h>
/linux-4.1.27/arch/m32r/kernel/
H A Dsmp.c250 unsigned long *mmc; smp_flush_tlb_mm() local
255 mmc = &mm->context[cpu_id]; smp_flush_tlb_mm()
259 if (*mmc != NO_CONTEXT) { smp_flush_tlb_mm()
261 *mmc = NO_CONTEXT; smp_flush_tlb_mm()
320 unsigned long *mmc; smp_flush_tlb_page() local
325 mmc = &mm->context[cpu_id]; smp_flush_tlb_page()
334 if (*mmc != NO_CONTEXT) { smp_flush_tlb_page()
337 va |= (*mmc & MMU_CONTEXT_ASID_MASK); smp_flush_tlb_page()
451 unsigned long *mmc = &flush_mm->context[cpu_id]; smp_invalidate_interrupt() local
457 *mmc = NO_CONTEXT; smp_invalidate_interrupt()
465 if (*mmc != NO_CONTEXT) { smp_invalidate_interrupt()
467 va |= (*mmc & MMU_CONTEXT_ASID_MASK); smp_invalidate_interrupt()
/linux-4.1.27/arch/alpha/include/asm/
H A Dtlbflush.h91 unsigned long *mmc = &mm->context[smp_processor_id()]; flush_tlb_other() local
94 if (*mmc) *mmc = 0; flush_tlb_other()
H A Dmmu_context.h137 unsigned long mmc; ev5_switch_mm() local
145 mmc = next_mm->context[cpu]; ev5_switch_mm()
146 if ((mmc ^ asn) & ~HARDWARE_ASN_MASK) { ev5_switch_mm()
147 mmc = __get_new_mm_context(next_mm, cpu); ev5_switch_mm()
148 next_mm->context[cpu] = mmc; ev5_switch_mm()
158 task_thread_info(next)->pcb.asn = mmc & HARDWARE_ASN_MASK; ev5_switch_mm()
/linux-4.1.27/include/linux/mmc/
H A Dhost.h2 * linux/include/linux/mmc/host.h
19 #include <linux/mmc/core.h>
20 #include <linux/mmc/card.h>
21 #include <linux/mmc/pm.h>
150 /* active mmc request */
153 * Check error status of completed mmc request.
176 * mmc_context_info - synchronization details for mmc context
179 * @is_waiting_last_req mmc context waiting for single running request
308 unsigned int max_blk_size; /* maximum size of one mmc block */
410 int mmc_regulator_set_ocr(struct mmc_host *mmc,
419 static inline int mmc_regulator_set_ocr(struct mmc_host *mmc, mmc_regulator_set_ocr() argument
427 int mmc_regulator_get_supply(struct mmc_host *mmc);
H A Dpm.h2 * linux/include/linux/mmc/pm.h
H A Dsh_mmcif.h2 * include/linux/mmc/sh_mmcif.h
75 #define CLK_ENABLE (1 << 24) /* 1: output mmc clock */
78 #define CLKDIV_4 (1 << 16) /* mmc clock frequency.
80 #define CLKDIV_256 (7 << 16) /* mmc clock frequency. (see above) */
H A Dsd.h2 * include/linux/mmc/sd.h
H A Dtmio.h2 * include/linux/mmc/tmio.h
H A Dsdio_func.h2 * include/linux/mmc/sdio_func.h
18 #include <linux/mmc/pm.h>
H A Dcard.h2 * linux/include/linux/mmc/card.h
14 #include <linux/mmc/core.h>
292 struct mmc_ext_csd ext_csd; /* mmc v4 extended card specific */
335 * The world is not perfect and supplies us with broken mmc/sdio devices.
H A Dcore.h2 * linux/include/linux/mmc/core.h
203 * @host: mmc host to claim
/linux-4.1.27/drivers/net/wireless/b43/
H A Dsdio.c16 #include <linux/mmc/card.h>
17 #include <linux/mmc/sdio_func.h>
18 #include <linux/mmc/sdio_ids.h>
/linux-4.1.27/arch/powerpc/platforms/83xx/
H A Dmpc832x_rdb.c21 #include <linux/mmc/host.h>
180 * mmc-spi-slot node. mpc832x_spi_init()
182 if (of_find_compatible_node(NULL, NULL, "mmc-spi-slot")) mpc832x_spi_init()
/linux-4.1.27/arch/arm/mach-imx/
H A Dclk-imx27.c184 clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx21-mmc.0"); mx27_clocks_init()
185 clk_register_clkdev(clk[IMX27_CLK_SDHC1_IPG_GATE], "ipg", "imx21-mmc.0"); mx27_clocks_init()
186 clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx21-mmc.1"); mx27_clocks_init()
187 clk_register_clkdev(clk[IMX27_CLK_SDHC2_IPG_GATE], "ipg", "imx21-mmc.1"); mx27_clocks_init()
188 clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx21-mmc.2"); mx27_clocks_init()
189 clk_register_clkdev(clk[IMX27_CLK_SDHC2_IPG_GATE], "ipg", "imx21-mmc.2"); mx27_clocks_init()
H A Dmach-mx21ads.c262 ret = gpio_request(MX21ADS_IO_SD_WP, "mmc-ro"); mx21ads_sdhc_init()
267 IRQF_TRIGGER_FALLING, "mmc-detect", data); mx21ads_sdhc_init()
H A Dmach-pca100.c249 IRQF_TRIGGER_FALLING, "imx-mmc-detect", data); pca100_sdhc2_init()
252 "pca100: Failed to request irq for sd/mmc detection\n"); pca100_sdhc2_init()
/linux-4.1.27/drivers/net/wireless/cw1200/
H A Dcw1200_sdio.c15 #include <linux/mmc/host.h>
16 #include <linux/mmc/sdio_func.h>
17 #include <linux/mmc/card.h>
18 #include <linux/mmc/sdio.h>
/linux-4.1.27/include/uapi/linux/mmc/
H A Dioctl.h52 * to the mmc bus device, an upper data transfer limit of MMC_IOC_MAX_BYTES
/linux-4.1.27/arch/arm/mach-pxa/
H A Dpxa-dt.c27 OF_DEV_AUXDATA("marvell,pxa-mmc", 0x41100000, "pxa2xx-mci.0", NULL),
H A Dgumstix.c44 #include <linux/platform_data/mmc-pxamci.h>
105 pr_debug("Gumstix mmc disabled\n"); gumstix_mmc_init()
H A Dcolibri-evalboard.c27 #include <linux/platform_data/mmc-pxamci.h>
H A Dcolibri-pxa270-income.c30 #include <linux/platform_data/mmc-pxamci.h>
H A Dcolibri-pxa3xx.c27 #include <linux/platform_data/mmc-pxamci.h>
H A Dpalmt5.c39 #include <linux/platform_data/mmc-pxamci.h>
H A Dcsb726.c26 #include <linux/platform_data/mmc-pxamci.h>
H A Didp.c38 #include <linux/platform_data/mmc-pxamci.h>
H A Dpalmld.c38 #include <linux/platform_data/mmc-pxamci.h>
/linux-4.1.27/arch/alpha/mm/
H A Dfault.c43 unsigned long mmc; __load_new_mm_context() local
46 mmc = __get_new_mm_context(next_mm, smp_processor_id()); __load_new_mm_context()
47 next_mm->context[smp_processor_id()] = mmc; __load_new_mm_context()
50 pcb->asn = mmc & HARDWARE_ASN_MASK; __load_new_mm_context()
/linux-4.1.27/drivers/net/wireless/ti/wlcore/
H A Dsdio.c28 #include <linux/mmc/sdio.h>
29 #include <linux/mmc/sdio_func.h>
30 #include <linux/mmc/sdio_ids.h>
31 #include <linux/mmc/card.h>
32 #include <linux/mmc/host.h>
/linux-4.1.27/arch/arm/mach-w90x900/
H A Dmfp.c161 } else if (strcmp(dev_id, "nuc900-mmc-port1") == 0) { mfp_set_groupg()
190 if (strcmp(dev_id, "nuc900-mmc-port0") == 0) { mfp_set_groupd()
/linux-4.1.27/drivers/net/wireless/brcm80211/include/
H A Dbrcm_hw_ids.h21 #include <linux/mmc/sdio_ids.h>
/linux-4.1.27/arch/arm/mach-rockchip/
H A Drockchip.c60 * with the mmc controllers making them unreliable rockchip_timer_init()
/linux-4.1.27/drivers/media/mmc/siano/
H A Dsmssdio.c41 #include <linux/mmc/card.h>
42 #include <linux/mmc/sdio_func.h>
43 #include <linux/mmc/sdio_ids.h>
/linux-4.1.27/drivers/mmc/card/
H A Dqueue.c2 * linux/drivers/mmc/card/queue.c
20 #include <linux/mmc/card.h>
21 #include <linux/mmc/host.h>
183 * @mq: mmc queue
184 * @card: mmc card to attach this queue
/linux-4.1.27/drivers/net/wireless/mwifiex/
H A Dsdio.h24 #include <linux/mmc/sdio.h>
25 #include <linux/mmc/sdio_ids.h>
26 #include <linux/mmc/sdio_func.h>
27 #include <linux/mmc/card.h>
28 #include <linux/mmc/host.h>
/linux-4.1.27/arch/arm/mach-shmobile/
H A Dboard-bockw.c19 #include <linux/mmc/host.h>
20 #include <linux/mmc/sh_mobile_sdhi.h>
21 #include <linux/mmc/sh_mmcif.h>
567 "mmc_data8", "mmc"),
569 "mmc_ctrl", "mmc"),
H A Dboard-marzen.c36 #include <linux/mmc/host.h>
37 #include <linux/mmc/sh_mobile_sdhi.h>
H A Dboard-kzm9g.c25 #include <linux/mmc/host.h>
26 #include <linux/mmc/sh_mmcif.h>
27 #include <linux/mmc/sh_mobile_sdhi.h>
/linux-4.1.27/arch/mips/alchemy/devboards/
H A Ddb1000.c28 #include <linux/mmc/host.h>
342 .name = "au1xxx-mmc",
377 .name = "au1xxx-mmc",
H A Ddb1300.c17 #include <linux/mmc/host.h>
561 .name = "au1xxx-mmc",
626 .name = "au1xxx-mmc",
/linux-4.1.27/arch/sh/boards/
H A Dboard-sh7757lcr.c21 #include <linux/mmc/host.h>
22 #include <linux/mmc/sh_mmcif.h>
23 #include <linux/mmc/sh_mobile_sdhi.h>
/linux-4.1.27/drivers/net/wireless/ath/ath6kl/
H A Dsdio.c19 #include <linux/mmc/card.h>
20 #include <linux/mmc/mmc.h>
21 #include <linux/mmc/host.h>
22 #include <linux/mmc/sdio_func.h>
23 #include <linux/mmc/sdio_ids.h>
24 #include <linux/mmc/sdio.h>
25 #include <linux/mmc/sd.h>
1266 * Empty handlers so that mmc subsystem doesn't remove us entirely during
/linux-4.1.27/arch/arm/mach-s3c24xx/
H A Dmach-at2440evb.c50 #include <linux/platform_data/mmc-s3cmci.h>
H A Dmach-n30.c30 #include <linux/mmc/host.h>
50 #include <linux/platform_data/mmc-s3cmci.h>
551 WARN_ON(gpio_request(S3C2410_GPG(4), "mmc power")); n30_init()
H A Dmach-rx1950.c38 #include <linux/mmc/host.h>
45 #include <linux/platform_data/mmc-s3cmci.h>
770 /* mmc power is disabled by default */ rx1950_init_machine()
/linux-4.1.27/arch/arm/plat-samsung/include/plat/
H A Dsdhci.h21 #include <linux/platform_data/mmc-sdhci-s3c.h>
/linux-4.1.27/drivers/scsi/
H A Dsr_vendor.c58 #define VENDOR_SCSI3 1 /* default: scsi-3 mmc */
77 /* this is true for scsi3/mmc drives - no more checks */ sr_vendor_init()
/linux-4.1.27/drivers/net/wireless/ti/wl1251/
H A Dsdio.c25 #include <linux/mmc/sdio_func.h>
26 #include <linux/mmc/sdio_ids.h>
/linux-4.1.27/drivers/bluetooth/
H A Dbtsdio.c34 #include <linux/mmc/sdio_ids.h>
35 #include <linux/mmc/sdio_func.h>
/linux-4.1.27/drivers/clk/hisilicon/
H A Dclk-hi3620.c441 pr_err("%s: fail to allocate mmc clk\n", __func__); hisi_register_clk_mmc()
494 pr_err("%s: fail to allocate mmc clk\n", __func__); hi3620_mmc_clk_init()
508 CLK_OF_DECLARE(hi3620_mmc_clk, "hisilicon,hi3620-mmc-clock", hi3620_mmc_clk_init);
/linux-4.1.27/drivers/s390/cio/
H A Dchsc.h171 u16 mmc; member in struct:chsc_scm_info
/linux-4.1.27/arch/mips/jz4740/
H A Dplatform.c106 .name = "jz4740-mmc",

Completed in 3145 milliseconds

12