blob: 33310b11cbddcf442122917a5e92a900ef7710e5 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Ben Dooksedb5a982008-06-30 22:40:29 +01002#ifndef _ARCH_MCI_H
3#define _ARCH_MCI_H
4
Ben Dooks95eb5692009-11-13 22:34:22 +00005/**
6 * struct s3c24xx_mci_pdata - sd/mmc controller platform data
7 * @no_wprotect: Set this to indicate there is no write-protect switch.
8 * @no_detect: Set this if there is no detect switch.
9 * @wprotect_invert: Invert the default sense of the write protect switch.
Ben Dooks95eb5692009-11-13 22:34:22 +000010 * @use_dma: Set to allow the use of DMA.
11 * @gpio_detect: GPIO number for the card detect line.
12 * @gpio_wprotect: GPIO number for the write protect line.
13 * @ocr_avail: The mask of the available power states, non-zero to use.
14 * @set_power: Callback to control the power mode.
15 *
16 * The @gpio_detect is used for card detection when @no_wprotect is unset,
17 * and the default sense is that 0 returned from gpio_get_value() means
18 * that a card is inserted. If @detect_invert is set, then the value from
19 * gpio_get_value() is inverted, which makes 1 mean card inserted.
20 *
21 * The driver will use @gpio_wprotect to signal whether the card is write
22 * protected if @no_wprotect is not set. A 0 returned from gpio_get_value()
23 * means the card is read/write, and 1 means read-only. The @wprotect_invert
24 * will invert the value returned from gpio_get_value().
25 *
26 * Card power is set by @ocr_availa, using MCC_VDD_ constants if it is set
27 * to a non-zero value, otherwise the default of 3.2-3.4V is used.
28 */
Ben Dooksedb5a982008-06-30 22:40:29 +010029struct s3c24xx_mci_pdata {
Kukjin Kimdc98e412011-09-28 20:48:52 +090030 unsigned int no_wprotect:1;
31 unsigned int no_detect:1;
32 unsigned int wprotect_invert:1;
Kukjin Kimdc98e412011-09-28 20:48:52 +090033 unsigned int use_dma:1;
Ben Dookscf0984c2008-06-30 22:40:30 +010034
Ben Dooksedb5a982008-06-30 22:40:29 +010035 unsigned long ocr_avail;
36 void (*set_power)(unsigned char power_mode,
37 unsigned short vdd);
38};
39
Ben Dooks22c810a2010-01-18 16:24:22 +090040/**
41 * s3c24xx_mci_set_platdata - set platform data for mmc/sdi device
42 * @pdata: The platform data
43 *
44 * Copy the platform data supplied by @pdata so that this can be marked
45 * __initdata.
46 */
47extern void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata);
48
Ben Dooksedb5a982008-06-30 22:40:29 +010049#endif /* _ARCH_NCI_H */