wbsd.c (41be702a542a0d14bb0b1c16e824fa9ed27616ec) wbsd.c (6606110d89aefcb21b9e70adfe064987cbd8393a)
1/*
2 * linux/drivers/mmc/host/wbsd.c - Winbond W83L51xD SD/MMC driver
3 *
4 * Copyright (C) 2004-2007 Pierre Ossman, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at

--- 789 unchanged lines hidden (view full) ---

798
799 /* ACMDs. We don't keep track of state, so we just treat them
800 * like any other command. */
801 case 51:
802 break;
803
804 default:
805#ifdef CONFIG_MMC_DEBUG
1/*
2 * linux/drivers/mmc/host/wbsd.c - Winbond W83L51xD SD/MMC driver
3 *
4 * Copyright (C) 2004-2007 Pierre Ossman, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at

--- 789 unchanged lines hidden (view full) ---

798
799 /* ACMDs. We don't keep track of state, so we just treat them
800 * like any other command. */
801 case 51:
802 break;
803
804 default:
805#ifdef CONFIG_MMC_DEBUG
806 pr_warning("%s: Data command %d is not "
807 "supported by this controller.\n",
806 pr_warn("%s: Data command %d is not supported by this controller\n",
808 mmc_hostname(host->mmc), cmd->opcode);
809#endif
810 cmd->error = -EINVAL;
811
812 goto done;
813 };
814 }
815

--- 608 unchanged lines hidden (view full) ---

1424
1425 kfree(host->dma_buffer);
1426 host->dma_buffer = NULL;
1427
1428free:
1429 free_dma(dma);
1430
1431err:
807 mmc_hostname(host->mmc), cmd->opcode);
808#endif
809 cmd->error = -EINVAL;
810
811 goto done;
812 };
813 }
814

--- 608 unchanged lines hidden (view full) ---

1423
1424 kfree(host->dma_buffer);
1425 host->dma_buffer = NULL;
1426
1427free:
1428 free_dma(dma);
1429
1430err:
1432 pr_warning(DRIVER_NAME ": Unable to allocate DMA %d. "
1433 "Falling back on FIFO.\n", dma);
1431 pr_warn(DRIVER_NAME ": Unable to allocate DMA %d - falling back on FIFO\n",
1432 dma);
1434}
1435
1436static void wbsd_release_dma(struct wbsd_host *host)
1437{
1438 if (host->dma_addr) {
1439 dma_unmap_single(mmc_dev(host->mmc), host->dma_addr,
1440 WBSD_DMA_SIZE, DMA_BIDIRECTIONAL);
1441 }

--- 217 unchanged lines hidden (view full) ---

1659 host = mmc_priv(mmc);
1660
1661 /*
1662 * Scan for hardware.
1663 */
1664 ret = wbsd_scan(host);
1665 if (ret) {
1666 if (pnp && (ret == -ENODEV)) {
1433}
1434
1435static void wbsd_release_dma(struct wbsd_host *host)
1436{
1437 if (host->dma_addr) {
1438 dma_unmap_single(mmc_dev(host->mmc), host->dma_addr,
1439 WBSD_DMA_SIZE, DMA_BIDIRECTIONAL);
1440 }

--- 217 unchanged lines hidden (view full) ---

1658 host = mmc_priv(mmc);
1659
1660 /*
1661 * Scan for hardware.
1662 */
1663 ret = wbsd_scan(host);
1664 if (ret) {
1665 if (pnp && (ret == -ENODEV)) {
1667 pr_warning(DRIVER_NAME
1668 ": Unable to confirm device presence. You may "
1669 "experience lock-ups.\n");
1666 pr_warn(DRIVER_NAME ": Unable to confirm device presence - you may experience lock-ups\n");
1670 } else {
1671 wbsd_free_mmc(dev);
1672 return ret;
1673 }
1674 }
1675
1676 /*
1677 * Request resources.

--- 5 unchanged lines hidden (view full) ---

1683 return ret;
1684 }
1685
1686 /*
1687 * See if chip needs to be configured.
1688 */
1689 if (pnp) {
1690 if ((host->config != 0) && !wbsd_chip_validate(host)) {
1667 } else {
1668 wbsd_free_mmc(dev);
1669 return ret;
1670 }
1671 }
1672
1673 /*
1674 * Request resources.

--- 5 unchanged lines hidden (view full) ---

1680 return ret;
1681 }
1682
1683 /*
1684 * See if chip needs to be configured.
1685 */
1686 if (pnp) {
1687 if ((host->config != 0) && !wbsd_chip_validate(host)) {
1691 pr_warning(DRIVER_NAME
1692 ": PnP active but chip not configured! "
1693 "You probably have a buggy BIOS. "
1694 "Configuring chip manually.\n");
1688 pr_warn(DRIVER_NAME ": PnP active but chip not configured! You probably have a buggy BIOS. Configuring chip manually.\n");
1695 wbsd_chip_config(host);
1696 }
1697 } else
1698 wbsd_chip_config(host);
1699
1700 /*
1701 * Power Management stuff. No idea how this works.
1702 * Not tested.

--- 176 unchanged lines hidden (view full) ---

1879
1880 host = mmc_priv(mmc);
1881
1882 /*
1883 * See if chip needs to be configured.
1884 */
1885 if (host->config != 0) {
1886 if (!wbsd_chip_validate(host)) {
1689 wbsd_chip_config(host);
1690 }
1691 } else
1692 wbsd_chip_config(host);
1693
1694 /*
1695 * Power Management stuff. No idea how this works.
1696 * Not tested.

--- 176 unchanged lines hidden (view full) ---

1873
1874 host = mmc_priv(mmc);
1875
1876 /*
1877 * See if chip needs to be configured.
1878 */
1879 if (host->config != 0) {
1880 if (!wbsd_chip_validate(host)) {
1887 pr_warning(DRIVER_NAME
1888 ": PnP active but chip not configured! "
1889 "You probably have a buggy BIOS. "
1890 "Configuring chip manually.\n");
1881 pr_warn(DRIVER_NAME ": PnP active but chip not configured! You probably have a buggy BIOS. Configuring chip manually.\n");
1891 wbsd_chip_config(host);
1892 }
1893 }
1894
1895 /*
1896 * Allow device to initialise itself properly.
1897 */
1898 mdelay(5);

--- 125 unchanged lines hidden ---
1882 wbsd_chip_config(host);
1883 }
1884 }
1885
1886 /*
1887 * Allow device to initialise itself properly.
1888 */
1889 mdelay(5);

--- 125 unchanged lines hidden ---