cregit-Linux how code gets into the kernel

Release 4.7 drivers/mmc/host/tmio_mmc.c

Directory: drivers/mmc/host
/*
 * linux/drivers/mmc/host/tmio_mmc.c
 *
 * Copyright (C) 2007 Ian Molton
 * Copyright (C) 2004 Ian Molton
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * Driver for the MMC / SD / SDIO cell found in:
 *
 * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3
 */

#include <linux/device.h>
#include <linux/mfd/core.h>
#include <linux/mfd/tmio.h>
#include <linux/mmc/host.h>
#include <linux/module.h>
#include <linux/pagemap.h>
#include <linux/scatterlist.h>

#include "tmio_mmc.h"

#ifdef CONFIG_PM_SLEEP

static int tmio_mmc_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); const struct mfd_cell *cell = mfd_get_cell(pdev); int ret; ret = pm_runtime_force_suspend(dev); /* Tell MFD core it can disable us now.*/ if (!ret && cell->disable) cell->disable(pdev); return ret; }

Contributors

PersonTokensPropCommitsCommitProp
ian moltonian molton2337.10%110.00%
guennadi liakhovetskiguennadi liakhovetski1727.42%330.00%
ulf hanssonulf hansson1422.58%220.00%
andres salomonandres salomon69.68%330.00%
philipp zabelphilipp zabel23.23%110.00%
Total62100.00%10100.00%


static int tmio_mmc_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); const struct mfd_cell *cell = mfd_get_cell(pdev); int ret = 0; /* Tell the MFD core we are ready to be enabled */ if (cell->resume) ret = cell->resume(pdev); if (!ret) ret = pm_runtime_force_resume(dev); return ret; }

Contributors

PersonTokensPropCommitsCommitProp
guennadi liakhovetskiguennadi liakhovetski3044.12%233.33%
philipp zabelphilipp zabel1725.00%116.67%
ulf hanssonulf hansson1420.59%233.33%
ian moltonian molton710.29%116.67%
Total68100.00%6100.00%

#endif
static int tmio_mmc_probe(struct platform_device *pdev) { const struct mfd_cell *cell = mfd_get_cell(pdev); struct tmio_mmc_data *pdata; struct tmio_mmc_host *host; struct resource *res; int ret = -EINVAL, irq; if (pdev->num_resources != 2) goto out; pdata = pdev->dev.platform_data; if (!pdata || !pdata->hclk) goto out; irq = platform_get_irq(pdev, 0); if (irq < 0) { ret = irq; goto out; } /* Tell the MFD core we are ready to be enabled */ if (cell->enable) { ret = cell->enable(pdev); if (ret) goto out; } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { ret = -EINVAL; goto cell_disable; } pdata->flags |= TMIO_MMC_HAVE_HIGH_REG; host = tmio_mmc_host_alloc(pdev); if (!host) goto cell_disable; /* SD control register space size is 0x200, 0x400 for bus_shift=1 */ host->bus_shift = resource_size(res) >> 10; ret = tmio_mmc_host_probe(host, pdata); if (ret) goto host_free; ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, IRQF_TRIGGER_FALLING, dev_name(&pdev->dev), host); if (ret) goto host_remove; pr_info("%s at 0x%08lx irq %d\n", mmc_hostname(host->mmc), (unsigned long)host->ctl, irq); return 0; host_remove: tmio_mmc_host_remove(host); host_free: tmio_mmc_host_free(host); cell_disable: if (cell->disable) cell->disable(pdev); out: return ret; }

Contributors

PersonTokensPropCommitsCommitProp
guennadi liakhovetskiguennadi liakhovetski7926.96%213.33%
magnus dammmagnus damm7324.91%320.00%
ian moltonian molton6522.18%320.00%
kuninori morimotokuninori morimoto6421.84%426.67%
arnd hannemannarnd hannemann82.73%213.33%
samuel ortizsamuel ortiz41.37%16.67%
Total293100.00%15100.00%


static int tmio_mmc_remove(struct platform_device *pdev) { const struct mfd_cell *cell = mfd_get_cell(pdev); struct mmc_host *mmc = platform_get_drvdata(pdev); if (mmc) { struct tmio_mmc_host *host = mmc_priv(mmc); tmio_mmc_host_remove(host); if (cell->disable) cell->disable(pdev); } return 0; }

Contributors

PersonTokensPropCommitsCommitProp
ian moltonian molton3347.83%114.29%
magnus dammmagnus damm2739.13%342.86%
guennadi liakhovetskiguennadi liakhovetski57.25%114.29%
andres salomonandres salomon45.80%228.57%
Total69100.00%7100.00%

/* ------------------- device registration ----------------------- */ static const struct dev_pm_ops tmio_mmc_dev_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume) SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend, tmio_mmc_host_runtime_resume, NULL) }; static struct platform_driver tmio_mmc_driver = { .driver = { .name = "tmio-mmc", .pm = &tmio_mmc_dev_pm_ops, }, .probe = tmio_mmc_probe, .remove = tmio_mmc_remove, }; module_platform_driver(tmio_mmc_driver); MODULE_DESCRIPTION("Toshiba TMIO SD/MMC driver"); MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); MODULE_LICENSE("GPL v2"); MODULE_ALIAS("platform:tmio-mmc");

Overall Contributors

PersonTokensPropCommitsCommitProp
ian moltonian molton19331.95%310.71%
guennadi liakhovetskiguennadi liakhovetski14624.17%414.29%
magnus dammmagnus damm10016.56%414.29%
kuninori morimotokuninori morimoto6410.60%414.29%
ulf hanssonulf hansson559.11%310.71%
philipp zabelphilipp zabel193.15%27.14%
arnd hannemannarnd hannemann101.66%27.14%
andres salomonandres salomon101.66%310.71%
samuel ortizsamuel ortiz40.66%13.57%
axel linaxel lin20.33%13.57%
rafael j. wysockirafael j. wysocki10.17%13.57%
Total604100.00%28100.00%
Directory: drivers/mmc/host
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}