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-15", 0, "enable",
84 GPIO_LOOKUP("gpio-48-63", 10, "int",
129 * On both N800 and N810, only the first of the two MMC controllers is in use.
130 * The two MMC slots are multiplexed via Menelaus companion chip over I2C.
134 * VMMC slot 1 on both N800 and N810
135 * VDCDC3_APE and VMCS2_APE slot 2 on N800
136 * GPIO23 and GPIO9 slot 2 EMMC on N810
144 .dev_id = "mmci-omap.0",
146 /* Slot switch, GPIO 96 */
147 GPIO_LOOKUP("gpio-80-111", 16,
154 .dev_id = "mmci-omap.0",
156 /* Slot index 1, VSD power, GPIO 23 */
157 GPIO_LOOKUP_IDX("gpio-16-31", 7,
159 /* Slot index 1, VIO power, GPIO 9 */
160 GPIO_LOOKUP_IDX("gpio-0-15", 9,
166 static int n8x0_mmc_set_power_menelaus(struct device *dev, int slot, in n8x0_mmc_set_power_menelaus() argument
172 dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1, in n8x0_mmc_set_power_menelaus()
175 if (slot == 0) { in n8x0_mmc_set_power_menelaus()
235 static int n8x0_mmc_set_power(struct device *dev, int slot, int power_on, in n8x0_mmc_set_power() argument
238 if (board_is_n800() || slot == 0) in n8x0_mmc_set_power()
239 return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd); in n8x0_mmc_set_power()
246 static int n8x0_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) in n8x0_mmc_set_bus_mode() argument
250 dev_dbg(dev, "Set slot %d bus mode %s\n", slot + 1, in n8x0_mmc_set_bus_mode()
251 bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull"); in n8x0_mmc_set_bus_mode()
252 BUG_ON(slot != 0 && slot != 1); in n8x0_mmc_set_bus_mode()
253 slot++; in n8x0_mmc_set_bus_mode()
256 r = menelaus_set_mmc_opendrain(slot, 1); in n8x0_mmc_set_bus_mode()
259 r = menelaus_set_mmc_opendrain(slot, 0); in n8x0_mmc_set_bus_mode()
265 dev_err(dev, "MMC: unable to set bus mode for slot %d\n", in n8x0_mmc_set_bus_mode()
266 slot); in n8x0_mmc_set_bus_mode()
270 static int n8x0_mmc_get_cover_state(struct device *dev, int slot) in n8x0_mmc_get_cover_state() argument
272 slot++; in n8x0_mmc_get_cover_state()
273 BUG_ON(slot != 1 && slot != 2); in n8x0_mmc_get_cover_state()
274 if (slot == 1) in n8x0_mmc_get_cover_state()
302 pr_warn("MMC: notify cover event not available\n"); in n8x0_mmc_callback()
349 /* All slot pin bits seem to be inversed until first switch change */ in n8x0_mmc_late_init()
382 * MMC controller1 has two slots that are multiplexed via I2C.
383 * MMC controller2 is not in use.
424 * Some Samsung Movinand chips do not like open-ended in n8x0_mmc_init()
425 * multi-block reads and fall to braind-dead state in n8x0_mmc_init()
502 .dev_id = "soc-audio",
504 GPIO_LOOKUP("gpio-0-15", 10, "headset", GPIO_ACTIVE_HIGH),
505 GPIO_LOOKUP("gpio-80-111", 21, "speaker", GPIO_ACTIVE_HIGH),
513 return -ENODEV; in n8x0_late_initcall()