• Home
  • Raw
  • Download

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
19 #include <linux/spi/spi.h>
21 #include <linux/mmc/host.h>
22 #include <linux/platform_data/spi-omap2-mcspi.h>
23 #include <linux/platform_data/mmc-omap.h>
28 #include <asm/mach-types.h>
31 #include "mmc.h"
33 #include "common-board-devices.h"
57 else if (of_machine_is_compatible("nokia,n810-wimax")) in board_check_revision()
82 i--; in tusb_set_power()
87 retval = -ENODEV; in tusb_set_power()
164 * On both N800 and N810, only the first of the two MMC controllers is in use.
165 * The two MMC slots are multiplexed via Menelaus companion chip over I2C.
169 * VMMC slot 1 on both N800 and N810
170 * VDCDC3_APE and VMCS2_APE slot 2 on N800
171 * GPIO23 and GPIO9 slot 2 EMMC on N810
182 static int n8x0_mmc_switch_slot(struct device *dev, int slot) in n8x0_mmc_switch_slot() argument
185 dev_dbg(dev, "Choose slot %d\n", slot + 1); in n8x0_mmc_switch_slot()
187 gpio_set_value(N8X0_SLOT_SWITCH_GPIO, slot); in n8x0_mmc_switch_slot()
191 static int n8x0_mmc_set_power_menelaus(struct device *dev, int slot, in n8x0_mmc_set_power_menelaus() argument
197 dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1, in n8x0_mmc_set_power_menelaus()
200 if (slot == 0) { in n8x0_mmc_set_power_menelaus()
278 static int n8x0_mmc_set_power(struct device *dev, int slot, int power_on, in n8x0_mmc_set_power() argument
281 if (board_is_n800() || slot == 0) in n8x0_mmc_set_power()
282 return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd); in n8x0_mmc_set_power()
289 static int n8x0_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) in n8x0_mmc_set_bus_mode() argument
293 dev_dbg(dev, "Set slot %d bus mode %s\n", slot + 1, in n8x0_mmc_set_bus_mode()
294 bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull"); in n8x0_mmc_set_bus_mode()
295 BUG_ON(slot != 0 && slot != 1); in n8x0_mmc_set_bus_mode()
296 slot++; in n8x0_mmc_set_bus_mode()
299 r = menelaus_set_mmc_opendrain(slot, 1); in n8x0_mmc_set_bus_mode()
302 r = menelaus_set_mmc_opendrain(slot, 0); in n8x0_mmc_set_bus_mode()
308 dev_err(dev, "MMC: unable to set bus mode for slot %d\n", in n8x0_mmc_set_bus_mode()
309 slot); in n8x0_mmc_set_bus_mode()
313 static int n8x0_mmc_get_cover_state(struct device *dev, int slot) in n8x0_mmc_get_cover_state() argument
315 slot++; in n8x0_mmc_get_cover_state()
316 BUG_ON(slot != 1 && slot != 2); in n8x0_mmc_get_cover_state()
317 if (slot == 1) in n8x0_mmc_get_cover_state()
345 pr_warn("MMC: notify cover event not available\n"); in n8x0_mmc_callback()
392 /* All slot pin bits seem to be inversed until first switch change */ in n8x0_mmc_late_init()
432 * MMC controller1 has two slots that are multiplexed via I2C.
433 * MMC controller2 is not in use.
468 { N810_EMMC_VSD_GPIO, GPIOF_OUT_INIT_LOW, "MMC slot 2 Vddf" },
469 { N810_EMMC_VIO_GPIO, GPIOF_OUT_INIT_LOW, "MMC slot 2 Vdd" },
480 * Some Samsung Movinand chips do not like open-ended in n8x0_mmc_init()
481 * multi-block reads and fall to braind-dead state in n8x0_mmc_init()
490 "MMC slot switch"); in n8x0_mmc_init()
577 return -ENODEV; in n8x0_late_initcall()