Path: blob/master/drivers/mmc/host/sdhci-of-hlwd.c
15111 views
/*1* drivers/mmc/host/sdhci-of-hlwd.c2*3* Nintendo Wii Secure Digital Host Controller Interface.4* Copyright (C) 2009 The GameCube Linux Team5* Copyright (C) 2009 Albert Herranz6*7* Based on sdhci-of-esdhc.c8*9* Copyright (c) 2007 Freescale Semiconductor, Inc.10* Copyright (c) 2009 MontaVista Software, Inc.11*12* Authors: Xiaobo Xie <[email protected]>13* Anton Vorontsov <[email protected]>14*15* This program is free software; you can redistribute it and/or modify16* it under the terms of the GNU General Public License as published by17* the Free Software Foundation; either version 2 of the License, or (at18* your option) any later version.19*/2021#include <linux/delay.h>22#include <linux/mmc/host.h>23#include "sdhci-of.h"24#include "sdhci.h"2526/*27* Ops and quirks for the Nintendo Wii SDHCI controllers.28*/2930/*31* We need a small delay after each write, or things go horribly wrong.32*/33#define SDHCI_HLWD_WRITE_DELAY 5 /* usecs */3435static void sdhci_hlwd_writel(struct sdhci_host *host, u32 val, int reg)36{37sdhci_be32bs_writel(host, val, reg);38udelay(SDHCI_HLWD_WRITE_DELAY);39}4041static void sdhci_hlwd_writew(struct sdhci_host *host, u16 val, int reg)42{43sdhci_be32bs_writew(host, val, reg);44udelay(SDHCI_HLWD_WRITE_DELAY);45}4647static void sdhci_hlwd_writeb(struct sdhci_host *host, u8 val, int reg)48{49sdhci_be32bs_writeb(host, val, reg);50udelay(SDHCI_HLWD_WRITE_DELAY);51}5253struct sdhci_of_data sdhci_hlwd = {54.quirks = SDHCI_QUIRK_32BIT_DMA_ADDR |55SDHCI_QUIRK_32BIT_DMA_SIZE,56.ops = {57.read_l = sdhci_be32bs_readl,58.read_w = sdhci_be32bs_readw,59.read_b = sdhci_be32bs_readb,60.write_l = sdhci_hlwd_writel,61.write_w = sdhci_hlwd_writew,62.write_b = sdhci_hlwd_writeb,63},64};656667