cff2f741b8
Here's the large driver core updates for 3.8-rc1. The biggest thing here is the various __dev* marking removals. This is going to be a pain for the merge with different subsystem trees, I know, but all of the patches included here have been ACKed by their various subsystem maintainers, as they wanted them to go through here. If this is too much of a pain, I can pull all of them out of this tree and just send you one with the other fixes/updates and then, after 3.8-rc1 is out, do the rest of the removals to ensure we catch them all, it's up to you. The merges should all be trivial, and Stephen has been doing them all in linux-next for a few weeks now quite easily. Other than the __dev* marking removals, there's nothing major here, some firmware loading updates and other minor things in the driver core. All of these have (much to Stephen's annoyance), been in linux-next for a while. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEABECAAYFAlDHkPkACgkQMUfUDdst+ykaWgCfW7AM30cv0nzoVO08ax6KjlG1 KVYAn3z/KYazvp4B6LMvrW9y0G34Wmad =yvVr -----END PGP SIGNATURE----- Merge tag 'driver-core-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg Kroah-Hartman: "Here's the large driver core updates for 3.8-rc1. The biggest thing here is the various __dev* marking removals. This is going to be a pain for the merge with different subsystem trees, I know, but all of the patches included here have been ACKed by their various subsystem maintainers, as they wanted them to go through here. If this is too much of a pain, I can pull all of them out of this tree and just send you one with the other fixes/updates and then, after 3.8-rc1 is out, do the rest of the removals to ensure we catch them all, it's up to you. The merges should all be trivial, and Stephen has been doing them all in linux-next for a few weeks now quite easily. Other than the __dev* marking removals, there's nothing major here, some firmware loading updates and other minor things in the driver core. All of these have (much to Stephen's annoyance), been in linux-next for a while. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" Fixed up trivial conflicts in drivers/gpio/gpio-{em,stmpe}.c due to gpio update. * tag 'driver-core-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (93 commits) modpost.c: Stop checking __dev* section mismatches init.h: Remove __dev* sections from the kernel acpi: remove use of __devinit PCI: Remove __dev* markings PCI: Always build setup-bus when PCI is enabled PCI: Move pci_uevent into pci-driver.c PCI: Remove CONFIG_HOTPLUG ifdefs unicore32/PCI: Remove CONFIG_HOTPLUG ifdefs sh/PCI: Remove CONFIG_HOTPLUG ifdefs powerpc/PCI: Remove CONFIG_HOTPLUG ifdefs mips/PCI: Remove CONFIG_HOTPLUG ifdefs microblaze/PCI: Remove CONFIG_HOTPLUG ifdefs dma: remove use of __devinit dma: remove use of __devexit_p firewire: remove use of __devinitdata firewire: remove use of __devinit leds: remove use of __devexit leds: remove use of __devinit leds: remove use of __devexit_p mmc: remove use of __devexit ...
136 lines
3.1 KiB
C
136 lines
3.1 KiB
C
/*
|
|
* Synopsys DesignWare Multimedia Card Interface driver
|
|
*
|
|
* Copyright (C) 2009 NXP Semiconductors
|
|
* Copyright (C) 2009, 2010 Imagination Technologies Ltd.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*/
|
|
|
|
#include <linux/interrupt.h>
|
|
#include <linux/module.h>
|
|
#include <linux/io.h>
|
|
#include <linux/irq.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/mmc/host.h>
|
|
#include <linux/mmc/mmc.h>
|
|
#include <linux/mmc/dw_mmc.h>
|
|
#include <linux/of.h>
|
|
|
|
#include "dw_mmc.h"
|
|
|
|
int dw_mci_pltfm_register(struct platform_device *pdev,
|
|
const struct dw_mci_drv_data *drv_data)
|
|
{
|
|
struct dw_mci *host;
|
|
struct resource *regs;
|
|
int ret;
|
|
|
|
host = devm_kzalloc(&pdev->dev, sizeof(struct dw_mci), GFP_KERNEL);
|
|
if (!host)
|
|
return -ENOMEM;
|
|
|
|
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
if (!regs)
|
|
return -ENXIO;
|
|
|
|
host->irq = platform_get_irq(pdev, 0);
|
|
if (host->irq < 0)
|
|
return host->irq;
|
|
|
|
host->drv_data = drv_data;
|
|
host->dev = &pdev->dev;
|
|
host->irq_flags = 0;
|
|
host->pdata = pdev->dev.platform_data;
|
|
host->regs = devm_request_and_ioremap(&pdev->dev, regs);
|
|
if (!host->regs)
|
|
return -ENOMEM;
|
|
|
|
if (drv_data && drv_data->init) {
|
|
ret = drv_data->init(host);
|
|
if (ret)
|
|
return ret;
|
|
}
|
|
|
|
platform_set_drvdata(pdev, host);
|
|
ret = dw_mci_probe(host);
|
|
return ret;
|
|
}
|
|
EXPORT_SYMBOL_GPL(dw_mci_pltfm_register);
|
|
|
|
static int dw_mci_pltfm_probe(struct platform_device *pdev)
|
|
{
|
|
return dw_mci_pltfm_register(pdev, NULL);
|
|
}
|
|
|
|
static int dw_mci_pltfm_remove(struct platform_device *pdev)
|
|
{
|
|
struct dw_mci *host = platform_get_drvdata(pdev);
|
|
|
|
platform_set_drvdata(pdev, NULL);
|
|
dw_mci_remove(host);
|
|
return 0;
|
|
}
|
|
EXPORT_SYMBOL_GPL(dw_mci_pltfm_remove);
|
|
|
|
#ifdef CONFIG_PM_SLEEP
|
|
/*
|
|
* TODO: we should probably disable the clock to the card in the suspend path.
|
|
*/
|
|
static int dw_mci_pltfm_suspend(struct device *dev)
|
|
{
|
|
int ret;
|
|
struct dw_mci *host = dev_get_drvdata(dev);
|
|
|
|
ret = dw_mci_suspend(host);
|
|
if (ret)
|
|
return ret;
|
|
|
|
return 0;
|
|
}
|
|
|
|
static int dw_mci_pltfm_resume(struct device *dev)
|
|
{
|
|
int ret;
|
|
struct dw_mci *host = dev_get_drvdata(dev);
|
|
|
|
ret = dw_mci_resume(host);
|
|
if (ret)
|
|
return ret;
|
|
|
|
return 0;
|
|
}
|
|
#else
|
|
#define dw_mci_pltfm_suspend NULL
|
|
#define dw_mci_pltfm_resume NULL
|
|
#endif /* CONFIG_PM_SLEEP */
|
|
|
|
SIMPLE_DEV_PM_OPS(dw_mci_pltfm_pmops, dw_mci_pltfm_suspend, dw_mci_pltfm_resume);
|
|
EXPORT_SYMBOL_GPL(dw_mci_pltfm_pmops);
|
|
|
|
static const struct of_device_id dw_mci_pltfm_match[] = {
|
|
{ .compatible = "snps,dw-mshc", },
|
|
{},
|
|
};
|
|
MODULE_DEVICE_TABLE(of, dw_mci_pltfm_match);
|
|
|
|
static struct platform_driver dw_mci_pltfm_driver = {
|
|
.probe = dw_mci_pltfm_probe,
|
|
.remove = __devexit_p(dw_mci_pltfm_remove),
|
|
.driver = {
|
|
.name = "dw_mmc",
|
|
.of_match_table = of_match_ptr(dw_mci_pltfm_match),
|
|
.pm = &dw_mci_pltfm_pmops,
|
|
},
|
|
};
|
|
|
|
module_platform_driver(dw_mci_pltfm_driver);
|
|
|
|
MODULE_DESCRIPTION("DW Multimedia Card Interface driver");
|
|
MODULE_AUTHOR("NXP Semiconductor VietNam");
|
|
MODULE_AUTHOR("Imagination Technologies Ltd");
|
|
MODULE_LICENSE("GPL v2");
|