lkml.org 
[lkml]   [2010]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Subject: [PATCH] v2.6.32: Add new device IDs and quircks for MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM
This should go to linux-mmc@vger.kernel.org (cc:d). And you should
probably resend it with the patch as an attachment as your mail client
seems to fudge it up pretty heavily. Lastly, have a look at
Documentation/SubmittingPatches as there is some formalia you need to
take care of.

Rgds
Pierre

On Thu, 4 Feb 2010 15:23:29 +0800
"Hardys Lv(WH)" <hardys.lv@o2micro.com> wrote:

>
>
> diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
>
> index e035664..f38bd1f 100644
>
> --- a/drivers/mmc/host/sdhci-pci.c
>
> +++ b/drivers/mmc/host/sdhci-pci.c
>
> @@ -285,6 +285,73 @@ static const struct sdhci_pci_fixes sdhci_jmicron =
> {
>
> .resume = jmicron_resume,
>
> };
>
>
>
> +/* SysKonnect CardBus2SDIO extra registers */
>
> +#define SYSKT_CTRL 0x200
>
> +#define SYSKT_RDFIFO_STAT 0x204
>
> +#define SYSKT_WRFIFO_STAT 0x208
>
> +#define SYSKT_POWER_DATA 0x20c
>
> +#define SYSKT_POWER_330 0xef
>
> +#define SYSKT_POWER_300 0xf8
>
> +#define SYSKT_POWER_184 0xcc
>
> +#define SYSKT_POWER_CMD 0x20d
>
> +#define SYSKT_POWER_START (1 << 7)
>
> +#define SYSKT_POWER_STATUS 0x20e
>
> +#define SYSKT_POWER_STATUS_OK (1 << 0)
>
> +#define SYSKT_BOARD_REV 0x210
>
> +#define SYSKT_CHIP_REV 0x211
>
> +#define SYSKT_CONF_DATA 0x212
>
> +#define SYSKT_CONF_DATA_1V8 (1 << 2)
>
> +#define SYSKT_CONF_DATA_2V5 (1 << 1)
>
> +#define SYSKT_CONF_DATA_3V3 (1 << 0)
>
> +
>
> +static int syskt_probe(struct sdhci_pci_chip *chip)
>
> +{
>
> + if ((chip->pdev->class & 0x0000FF) == PCI_SDHCI_IFVENDOR) {
>
> + chip->pdev->class &= ~0x0000FF;
>
> + chip->pdev->class |= PCI_SDHCI_IFDMA;
>
> + }
>
> + return 0;
>
> +}
>
> +
>
> +static int syskt_probe_slot(struct sdhci_pci_slot *slot)
>
> +{
>
> + int tm, ps;
>
> +
>
> + u8 board_rev = readb(slot->host->ioaddr + SYSKT_BOARD_REV);
>
> + u8 chip_rev = readb(slot->host->ioaddr + SYSKT_CHIP_REV);
>
> + dev_info(&slot->chip->pdev->dev, "SysKonnect CardBus2SDIO, "
>
> + "board rev %d.%d, chip rev
> %d.%d\n",
>
> + board_rev >> 4, board_rev &
> 0xf,
>
> + chip_rev >> 4, chip_rev &
> 0xf);
>
> + if (chip_rev >= 0x20)
>
> + slot->host->quirks |= SDHCI_QUIRK_FORCE_DMA;
>
> +
>
> + writeb(SYSKT_POWER_330, slot->host->ioaddr + SYSKT_POWER_DATA);
>
> + writeb(SYSKT_POWER_START, slot->host->ioaddr + SYSKT_POWER_CMD);
>
> + udelay(50);
>
> + tm = 10; /* Wait max 1 ms */
>
> + do {
>
> + ps = readw(slot->host->ioaddr + SYSKT_POWER_STATUS);
>
> + if (ps & SYSKT_POWER_STATUS_OK)
>
> + break;
>
> + udelay(100);
>
> + } while (--tm);
>
> + if (!tm) {
>
> + dev_err(&slot->chip->pdev->dev,
>
> + "power regulator never stabilized");
>
> + writeb(0, slot->host->ioaddr + SYSKT_POWER_CMD);
>
> + return -ENODEV;
>
> + }
>
> +
>
> + return 0;
>
> +}
>
> +
>
> +static const struct sdhci_pci_fixes sdhci_syskt = {
>
> + .quirks = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER,
>
> + .probe = syskt_probe,
>
> + .probe_slot = syskt_probe_slot,
>
> +};
>
> +
>
> static int via_probe(struct sdhci_pci_chip *chip)
>
> {
>
> if (chip->pdev->revision == 0x10)
>
> @@ -297,6 +364,14 @@ static const struct sdhci_pci_fixes sdhci_via = {
>
> .probe = via_probe,
>
> };
>
>
>
> +#ifndef PCI_DEVICE_ID_O2_8120
>
> +#define PCI_DEVICE_ID_O2_8120 0x8120
>
> +#endif
>
> +
>
> +#ifndef PCI_DEVICE_ID_O2_8220
>
> +#define PCI_DEVICE_ID_O2_8220 0x8220
>
> +#endif
>
> +
>
> static const struct pci_device_id pci_ids[] __devinitdata = {
>
> {
>
> .vendor = PCI_VENDOR_ID_RICOH,
>
> @@ -363,6 +438,14 @@ static const struct pci_device_id pci_ids[]
> __devinitdata = {
>
> },
>
>
>
> {
>
> + .vendor = PCI_VENDOR_ID_SYSKONNECT,
>
> + .device = 0x8000,
>
> + .subvendor = PCI_ANY_ID,
>
> + .subdevice = PCI_ANY_ID,
>
> + .driver_data = (kernel_ulong_t)&sdhci_syskt,
>
> + },
>
> +
>
> + {
>
> .vendor = PCI_VENDOR_ID_VIA,
>
> .device = 0x95d0,
>
> .subvendor = PCI_ANY_ID,
>
> @@ -370,6 +453,22 @@ static const struct pci_device_id pci_ids[]
> __devinitdata = {
>
> .driver_data = (kernel_ulong_t)&sdhci_via,
>
> },
>
>
>
> + {
>
> + .vendor = PCI_VENDOR_ID_O2,
>
> + .device = PCI_DEVICE_ID_O2_8120,
>
> + .subvendor = PCI_ANY_ID,
>
> + .subdevice = PCI_ANY_ID,
>
> + .driver_data = (kernel_ulong_t)&sdhci_o2,
>
> + },
>
> +
>
> + {
>
> + .vendor = PCI_VENDOR_ID_O2,
>
> + .device = PCI_DEVICE_ID_O2_8220,
>
> + .subvendor = PCI_ANY_ID,
>
> + .subdevice = PCI_ANY_ID,
>
> + .driver_data = (kernel_ulong_t)&sdhci_o2,
>
> + },
>
> +
>
> { /* Generic SD host controller */
>
> PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8),
> 0xFFFF00)
>
> },
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>
> index c279fbc..b2c26ff 100644
>
> --- a/drivers/mmc/host/sdhci.c
>
> +++ b/drivers/mmc/host/sdhci.c
>
> @@ -478,6 +478,15 @@ static int sdhci_adma_table_pre(struct sdhci_host
> *host,
>
> desc[1] = 0x00;
>
> desc[0] = 0x21; /* tran, valid */
>
>
>
> + /*
>
> + * Some host controller only doesn't support attribute
> nop
>
> + * as the last ADMA table entry.
>
> + */
>
> + if ((host->quirks & SDHCI_QUICK_ADMA_TABLE_ENTRY) &&
>
> + (i == (host->sg_count-1))) {
>
> + desc[0] = 0x23; /* tran, valid, end*/
>
> + }
>
> +
>
> desc += 8;
>
>
>
> /*
>
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
>
> index ce5f1d7..2fa8245 100644
>
> --- a/drivers/mmc/host/sdhci.h
>
> +++ b/drivers/mmc/host/sdhci.h
>
> @@ -8,6 +8,8 @@
>
> * the Free Software Foundation; either version 2 of the License, or
> (at
>
> * your option) any later version.
>
> */
>
> +#ifndef __SDHCI_H
>
> +#define __SDHCI_H
>
>
>
> #include <linux/scatterlist.h>
>
> #include <linux/compiler.h>
>
> @@ -234,6 +236,8 @@ struct sdhci_host {
>
> #define SDHCI_QUIRK_DELAY_AFTER_POWER (1<<23)
>
> /* Controller uses SDCLK instead of TMCLK for data timeouts */
>
> #define SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK (1<<24)
>
> +/* Controller only support ADMA table entry with attr=0x21 or 0x23 */
>
> +#define SDHCI_QUICK_ADMA_TABLE_ENTRY (1<<25)
>
>
>
> int irq; /* Device IRQ */
>
> void __iomem * ioaddr; /* Mapped
> address */
>
> @@ -408,3 +412,5 @@ extern void sdhci_remove_host(struct sdhci_host
> *host, int dead);
>
> extern int sdhci_suspend_host(struct sdhci_host *host, pm_message_t
> state);
>
> extern int sdhci_resume_host(struct sdhci_host *host);
>
> #endif
>
> +
>
> +#endif /* __SDHCI_H */
>


--
-- Pierre Ossman

WARNING: This correspondence is being monitored by FRA, a
Swedish intelligence agency. Make sure your server uses
encryption for SMTP traffic and consider using PGP for
end-to-end encryption.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2010-02-13 13:31    [W:0.031 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site