Lines Matching +full:mmc +full:- +full:spi +full:- +full:slot

1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/arch/arm/mach-omap2/board-n8x0.c
5 * Copyright (C) 2005-2009 Nokia Corporation
8 * Modified from mach-omap2/board-generic.c
20 #include <linux/spi/spi.h>
22 #include <linux/mmc/host.h>
23 #include <linux/platform_data/spi-omap2-mcspi.h>
24 #include <linux/platform_data/mmc-omap.h>
28 #include <asm/mach-types.h>
31 #include "mmc.h"
32 #include "usb-tusb6010.h"
34 #include "common-board-devices.h"
56 else if (of_machine_is_compatible("nokia,n810-wimax")) in board_check_revision()
80 .dev_id = "musb-tusb",
82 GPIO_LOOKUP("gpio-0-31", 0, "enable", GPIO_ACTIVE_HIGH),
83 GPIO_LOOKUP("gpio-32-63", 26, "int", GPIO_ACTIVE_HIGH),
127 * On both N800 and N810, only the first of the two MMC controllers is in use.
128 * The two MMC slots are multiplexed via Menelaus companion chip over I2C.
132 * VMMC slot 1 on both N800 and N810
133 * VDCDC3_APE and VMCS2_APE slot 2 on N800
134 * GPIO23 and GPIO9 slot 2 EMMC on N810
142 .dev_id = "mmci-omap.0",
144 /* Slot switch, GPIO 96 */
145 GPIO_LOOKUP("gpio-96-127", 0, "switch", GPIO_ACTIVE_HIGH),
151 .dev_id = "mmci-omap.0",
153 /* Slot switch, GPIO 96 */
154 GPIO_LOOKUP("gpio-96-127", 0, "switch", GPIO_ACTIVE_HIGH),
155 /* Slot index 1, VSD power, GPIO 23 */
156 GPIO_LOOKUP_IDX("gpio-0-31", 23, "vsd", 1, GPIO_ACTIVE_HIGH),
157 /* Slot index 1, VIO power, GPIO 9 */
158 GPIO_LOOKUP_IDX("gpio-0-31", 9, "vio", 1, GPIO_ACTIVE_HIGH),
163 static int n8x0_mmc_set_power_menelaus(struct device *dev, int slot, in n8x0_mmc_set_power_menelaus() argument
169 dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1, in n8x0_mmc_set_power_menelaus()
172 if (slot == 0) { in n8x0_mmc_set_power_menelaus()
232 static int n8x0_mmc_set_power(struct device *dev, int slot, int power_on, in n8x0_mmc_set_power() argument
235 if (board_is_n800() || slot == 0) in n8x0_mmc_set_power()
236 return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd); in n8x0_mmc_set_power()
243 static int n8x0_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) in n8x0_mmc_set_bus_mode() argument
247 dev_dbg(dev, "Set slot %d bus mode %s\n", slot + 1, in n8x0_mmc_set_bus_mode()
248 bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull"); in n8x0_mmc_set_bus_mode()
249 BUG_ON(slot != 0 && slot != 1); in n8x0_mmc_set_bus_mode()
250 slot++; in n8x0_mmc_set_bus_mode()
253 r = menelaus_set_mmc_opendrain(slot, 1); in n8x0_mmc_set_bus_mode()
256 r = menelaus_set_mmc_opendrain(slot, 0); in n8x0_mmc_set_bus_mode()
262 dev_err(dev, "MMC: unable to set bus mode for slot %d\n", in n8x0_mmc_set_bus_mode()
263 slot); in n8x0_mmc_set_bus_mode()
267 static int n8x0_mmc_get_cover_state(struct device *dev, int slot) in n8x0_mmc_get_cover_state() argument
269 slot++; in n8x0_mmc_get_cover_state()
270 BUG_ON(slot != 1 && slot != 2); in n8x0_mmc_get_cover_state()
271 if (slot == 1) in n8x0_mmc_get_cover_state()
299 pr_warn("MMC: notify cover event not available\n"); in n8x0_mmc_callback()
346 /* All slot pin bits seem to be inversed until first switch change */ in n8x0_mmc_late_init()
379 * MMC controller1 has two slots that are multiplexed via I2C.
380 * MMC controller2 is not in use.
419 * Some Samsung Movinand chips do not like open-ended in n8x0_mmc_init()
420 * multi-block reads and fall to braind-dead state in n8x0_mmc_init()
499 .dev_id = "soc-audio",
501 GPIO_LOOKUP("gpio-0-15", 10, "headset", GPIO_ACTIVE_HIGH),
502 GPIO_LOOKUP("gpio-80-111", 21, "speaker", GPIO_ACTIVE_HIGH),
510 return -ENODEV; in n8x0_late_initcall()