Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10664
b: refs/heads/master
c: 2cea752
h: refs/heads/master
v: v3
  • Loading branch information
R.Marek@sh.cvut.cz authored and Greg Kroah-Hartman committed Oct 28, 2005
1 parent a7a5a97 commit 0a99e7e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 92 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dbe0580d0d2fccf63b0349840a7ae3dbb16f3074
refs/heads/master: 2cea752f683af1be58ee8f25717c0a8118e0ac5b
119 changes: 28 additions & 91 deletions trunk/drivers/mmc/wbsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,16 +1033,13 @@ static void wbsd_set_ios(struct mmc_host* mmc, struct mmc_ios* ios)
}
else
{
if (setup & WBSD_DAT3_H)
{
setup &= ~WBSD_DAT3_H;
setup &= ~WBSD_DAT3_H;

/*
* We cannot resume card detection immediatly
* because of capacitance and delays in the chip.
*/
mod_timer(&host->ignore_timer, jiffies + HZ/100);
}
/*
* We cannot resume card detection immediatly
* because of capacitance and delays in the chip.
*/
mod_timer(&host->ignore_timer, jiffies + HZ/100);
}
wbsd_write_index(host, WBSD_IDX_SETUP, setup);

Expand Down Expand Up @@ -1464,24 +1461,22 @@ static int __devinit wbsd_scan(struct wbsd_host* host)
{
id = 0xFFFF;

host->config = config_ports[i];
host->unlock_code = unlock_codes[j];

wbsd_unlock_config(host);
outb(unlock_codes[j], config_ports[i]);
outb(unlock_codes[j], config_ports[i]);

outb(WBSD_CONF_ID_HI, config_ports[i]);
id = inb(config_ports[i] + 1) << 8;

outb(WBSD_CONF_ID_LO, config_ports[i]);
id |= inb(config_ports[i] + 1);

wbsd_lock_config(host);

for (k = 0;k < sizeof(valid_ids)/sizeof(int);k++)
{
if (id == valid_ids[k])
{
host->chip_id = id;
host->config = config_ports[i];
host->unlock_code = unlock_codes[i];

return 0;
}
Expand All @@ -1492,14 +1487,13 @@ static int __devinit wbsd_scan(struct wbsd_host* host)
DBG("Unknown hardware (id %x) found at %x\n",
id, config_ports[i]);
}

outb(LOCK_CODE, config_ports[i]);
}

release_region(config_ports[i], 2);
}

host->config = 0;
host->unlock_code = 0;

return -ENODEV;
}

Expand Down Expand Up @@ -1705,10 +1699,8 @@ static void __devexit wbsd_release_resources(struct wbsd_host* host)
* Configure the resources the chip should use.
*/

static void wbsd_chip_config(struct wbsd_host* host)
static void __devinit wbsd_chip_config(struct wbsd_host* host)
{
wbsd_unlock_config(host);

/*
* Reset the chip.
*/
Expand Down Expand Up @@ -1741,20 +1733,16 @@ static void wbsd_chip_config(struct wbsd_host* host)
*/
wbsd_write_config(host, WBSD_CONF_ENABLE, 1);
wbsd_write_config(host, WBSD_CONF_POWER, 0x20);

wbsd_lock_config(host);
}

/*
* Check that configured resources are correct.
*/

static int wbsd_chip_validate(struct wbsd_host* host)
static int __devinit wbsd_chip_validate(struct wbsd_host* host)
{
int base, irq, dma;

wbsd_unlock_config(host);

/*
* Select SD/MMC function.
*/
Expand All @@ -1770,8 +1758,6 @@ static int wbsd_chip_validate(struct wbsd_host* host)

dma = wbsd_read_config(host, WBSD_CONF_DRQ);

wbsd_lock_config(host);

/*
* Validate against given configuration.
*/
Expand All @@ -1785,20 +1771,6 @@ static int wbsd_chip_validate(struct wbsd_host* host)
return 1;
}

/*
* Powers down the SD function
*/

static void wbsd_chip_poweroff(struct wbsd_host* host)
{
wbsd_unlock_config(host);

wbsd_write_config(host, WBSD_CONF_DEVICE, DEVICE_SD);
wbsd_write_config(host, WBSD_CONF_ENABLE, 0);

wbsd_lock_config(host);
}

/*****************************************************************************\
* *
* Devices setup and shutdown *
Expand Down Expand Up @@ -1872,11 +1844,7 @@ static int __devinit wbsd_init(struct device* dev, int base, int irq, int dma,
*/
#ifdef CONFIG_PM
if (host->config)
{
wbsd_unlock_config(host);
wbsd_write_config(host, WBSD_CONF_PME, 0xA0);
wbsd_lock_config(host);
}
#endif
/*
* Allow device to initialise itself properly.
Expand Down Expand Up @@ -1917,11 +1885,16 @@ static void __devexit wbsd_shutdown(struct device* dev, int pnp)

mmc_remove_host(mmc);

/*
* Power down the SD/MMC function.
*/
if (!pnp)
wbsd_chip_poweroff(host);
{
/*
* Power down the SD/MMC function.
*/
wbsd_unlock_config(host);
wbsd_write_config(host, WBSD_CONF_DEVICE, DEVICE_SD);
wbsd_write_config(host, WBSD_CONF_ENABLE, 0);
wbsd_lock_config(host);
}

wbsd_release_resources(host);

Expand Down Expand Up @@ -1982,59 +1955,23 @@ static void __devexit wbsd_pnp_remove(struct pnp_dev * dev)
*/

#ifdef CONFIG_PM

static int wbsd_suspend(struct device *dev, pm_message_t state)
{
struct mmc_host *mmc = dev_get_drvdata(dev);
struct wbsd_host *host;
int ret;

if (!mmc)
return 0;

DBG("Suspending...\n");

ret = mmc_suspend_host(mmc, state);
if (!ret)
return ret;

host = mmc_priv(mmc);

wbsd_chip_poweroff(host);
DBGF("Not yet supported\n");

return 0;
}

static int wbsd_resume(struct device *dev)
{
struct mmc_host *mmc = dev_get_drvdata(dev);
struct wbsd_host *host;

if (!mmc)
return 0;

DBG("Resuming...\n");
DBGF("Not yet supported\n");

host = mmc_priv(mmc);

wbsd_chip_config(host);

/*
* Allow device to initialise itself properly.
*/
mdelay(5);

wbsd_init_device(host);

return mmc_resume_host(mmc);
return 0;
}

#else /* CONFIG_PM */

#else
#define wbsd_suspend NULL
#define wbsd_resume NULL

#endif /* CONFIG_PM */
#endif

static struct platform_device *wbsd_device;

Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/pci/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,18 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12,
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, quirk_ich4_lpc_acpi );
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1, quirk_ich4_lpc_acpi );

static void __devinit quirk_ich6_lpc_acpi(struct pci_dev *dev)
{
u32 region;

pci_read_config_dword(dev, 0x40, &region);
quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES, "ICH6 ACPI/GPIO/TCO");

pci_read_config_dword(dev, 0x48, &region);
quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1, "ICH6 GPIO");
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, quirk_ich6_lpc_acpi );

/*
* VIA ACPI: One IO region pointed to by longword at
* 0x48 or 0x20 (256 bytes of ACPI registers)
Expand Down

0 comments on commit 0a99e7e

Please sign in to comment.