blob: 1491af38cc6e4bf7418998850bdc223b89c89c5d [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Nicolas Ferrec42aa772008-11-20 15:59:12 +01002#ifndef __LINUX_ATMEL_MCI_H
3#define __LINUX_ATMEL_MCI_H
Haavard Skinnemoen7d2be072008-06-30 18:35:03 +02004
Hans-Christian Egtvedt8ca28612014-08-07 15:14:06 +02005#include <linux/types.h>
Mans Rullgard74843782016-01-09 12:45:10 +00006#include <linux/dmaengine.h>
Hans-Christian Egtvedt8ca28612014-08-07 15:14:06 +02007
Ludovic Desroches2c96a292011-08-11 15:25:41 +00008#define ATMCI_MAX_NR_SLOTS 2
Haavard Skinnemoen965ebf32008-09-17 20:53:55 +02009
Haavard Skinnemoen6b918652008-08-07 14:08:49 +020010/**
11 * struct mci_slot_pdata - board-specific per-slot configuration
12 * @bus_width: Number of data lines wired up the slot
13 * @detect_pin: GPIO pin wired to the card detect switch
14 * @wp_pin: GPIO pin wired to the write protect sensor
Jonas Larsson1c1452b2009-03-31 11:16:48 +020015 * @detect_is_active_high: The state of the detect pin when it is active
Timo Kokkonen76d55562014-11-03 13:12:59 +020016 * @non_removable: The slot is not removable, only detect once
Haavard Skinnemoen6b918652008-08-07 14:08:49 +020017 *
18 * If a given slot is not present on the board, @bus_width should be
19 * set to 0. The other fields are ignored in this case.
20 *
21 * Any pins that aren't available should be set to a negative value.
Haavard Skinnemoen965ebf32008-09-17 20:53:55 +020022 *
23 * Note that support for multiple slots is experimental -- some cards
24 * might get upset if we don't get the clock management exactly right.
25 * But in most cases, it should work just fine.
Haavard Skinnemoen6b918652008-08-07 14:08:49 +020026 */
27struct mci_slot_pdata {
28 unsigned int bus_width;
Haavard Skinnemoen7d2be072008-06-30 18:35:03 +020029 int detect_pin;
30 int wp_pin;
Jonas Larsson1c1452b2009-03-31 11:16:48 +020031 bool detect_is_active_high;
Timo Kokkonen76d55562014-11-03 13:12:59 +020032 bool non_removable;
Haavard Skinnemoen7d2be072008-06-30 18:35:03 +020033};
34
Haavard Skinnemoen6b918652008-08-07 14:08:49 +020035/**
36 * struct mci_platform_data - board-specific MMC/SDcard configuration
Dan Williams74465b42009-01-06 11:38:16 -070037 * @dma_slave: DMA slave interface to use in data transfers.
Haavard Skinnemoen6b918652008-08-07 14:08:49 +020038 * @slot: Per-slot configuration data.
39 */
40struct mci_platform_data {
Mans Rullgard238d1c62016-01-09 12:45:11 +000041 void *dma_slave;
Mans Rullgard74843782016-01-09 12:45:10 +000042 dma_filter_fn dma_filter;
Ludovic Desroches2c96a292011-08-11 15:25:41 +000043 struct mci_slot_pdata slot[ATMCI_MAX_NR_SLOTS];
Haavard Skinnemoen6b918652008-08-07 14:08:49 +020044};
45
Nicolas Ferrec42aa772008-11-20 15:59:12 +010046#endif /* __LINUX_ATMEL_MCI_H */