Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 135cedad authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc: (26 commits)
  mmc: sdio_ops.c should #include "sdio_ops.h"
  mmc: proper prototypes for mmc_attach_*()
  mmc: make __mmc_release_bus() static
  sdhci: improve no card, no reset quirk
  MMC: OMAP: Do not busy wait for end of command for ever
  MMC: OMAP: Start new commands from work queue instead of irq
  MMC: OMAP: Lazy clock shutdown
  MMC: OMAP: Move failing command abortion to workqueue
  MMC: OMAP: Use tasklet instead of workqueue for cover switch notification
  MMC: OMAP: Check the get_cover_state function pointer if not set
  MMC: OMAP: Using setup_timer instead of init_timer
  MMC: OMAP: Abort stuck commands
  MMC: OMAP: General cleanup for MMC multislot support
  MMC: OMAP: Power functions modified to MMC multislot support
  MMC: OMAP: Fix timeout calculation for MMC multislot support
  MMC: OMAP: New release dma and abort xfer functions
  MMC: OMAP: Add back cover switch support
  MMC: OMAP: Introduce new multislot structure and change driver to use it
  MMC: OMAP: Remove cover switch handling to allow adding multislot support
  MMC: OMAP: Fix the BYTEBLOCK capability removal
  ...
parents 8a322726 e70aa3fa
Loading
Loading
Loading
Loading
+1 −5
Original line number Original line Diff line number Diff line
@@ -35,10 +35,6 @@
#include "sd_ops.h"
#include "sd_ops.h"
#include "sdio_ops.h"
#include "sdio_ops.h"


extern int mmc_attach_mmc(struct mmc_host *host, u32 ocr);
extern int mmc_attach_sd(struct mmc_host *host, u32 ocr);
extern int mmc_attach_sdio(struct mmc_host *host, u32 ocr);

static struct workqueue_struct *workqueue;
static struct workqueue_struct *workqueue;


/*
/*
@@ -516,7 +512,7 @@ static void mmc_power_off(struct mmc_host *host)
/*
/*
 * Cleanup when the last reference to the bus operator is dropped.
 * Cleanup when the last reference to the bus operator is dropped.
 */
 */
void __mmc_release_bus(struct mmc_host *host)
static void __mmc_release_bus(struct mmc_host *host)
{
{
	BUG_ON(!host);
	BUG_ON(!host);
	BUG_ON(host->bus_refs);
	BUG_ON(host->bus_refs);
+4 −0
Original line number Original line Diff line number Diff line
@@ -46,6 +46,10 @@ void mmc_rescan(struct work_struct *work);
void mmc_start_host(struct mmc_host *host);
void mmc_start_host(struct mmc_host *host);
void mmc_stop_host(struct mmc_host *host);
void mmc_stop_host(struct mmc_host *host);


int mmc_attach_mmc(struct mmc_host *host, u32 ocr);
int mmc_attach_sd(struct mmc_host *host, u32 ocr);
int mmc_attach_sdio(struct mmc_host *host, u32 ocr);

extern int use_spi_crc;
extern int use_spi_crc;


#endif
#endif
+22 −17
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
 *  linux/drivers/mmc/core/host.c
 *  linux/drivers/mmc/core/host.c
 *
 *
 *  Copyright (C) 2003 Russell King, All Rights Reserved.
 *  Copyright (C) 2003 Russell King, All Rights Reserved.
 *  Copyright (C) 2007 Pierre Ossman
 *  Copyright (C) 2007-2008 Pierre Ossman
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * 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
 * it under the terms of the GNU General Public License version 2 as
@@ -57,12 +57,25 @@ static DEFINE_SPINLOCK(mmc_host_lock);
 */
 */
struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
{
{
	int err;
	struct mmc_host *host;
	struct mmc_host *host;


	if (!idr_pre_get(&mmc_host_idr, GFP_KERNEL))
		return NULL;

	host = kzalloc(sizeof(struct mmc_host) + extra, GFP_KERNEL);
	host = kzalloc(sizeof(struct mmc_host) + extra, GFP_KERNEL);
	if (!host)
	if (!host)
		return NULL;
		return NULL;


	spin_lock(&mmc_host_lock);
	err = idr_get_new(&mmc_host_idr, host, &host->index);
	spin_unlock(&mmc_host_lock);
	if (err)
		goto free;

	snprintf(host->class_dev.bus_id, BUS_ID_SIZE,
		 "mmc%d", host->index);

	host->parent = dev;
	host->parent = dev;
	host->class_dev.parent = dev;
	host->class_dev.parent = dev;
	host->class_dev.class = &mmc_host_class;
	host->class_dev.class = &mmc_host_class;
@@ -85,6 +98,10 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
	host->max_blk_count = PAGE_CACHE_SIZE / 512;
	host->max_blk_count = PAGE_CACHE_SIZE / 512;


	return host;
	return host;

free:
	kfree(host);
	return NULL;
}
}


EXPORT_SYMBOL(mmc_alloc_host);
EXPORT_SYMBOL(mmc_alloc_host);
@@ -104,18 +121,6 @@ int mmc_add_host(struct mmc_host *host)
	WARN_ON((host->caps & MMC_CAP_SDIO_IRQ) &&
	WARN_ON((host->caps & MMC_CAP_SDIO_IRQ) &&
		!host->ops->enable_sdio_irq);
		!host->ops->enable_sdio_irq);


	if (!idr_pre_get(&mmc_host_idr, GFP_KERNEL))
		return -ENOMEM;

	spin_lock(&mmc_host_lock);
	err = idr_get_new(&mmc_host_idr, host, &host->index);
	spin_unlock(&mmc_host_lock);
	if (err)
		return err;

	snprintf(host->class_dev.bus_id, BUS_ID_SIZE,
		 "mmc%d", host->index);

	led_trigger_register_simple(host->class_dev.bus_id, &host->led);
	led_trigger_register_simple(host->class_dev.bus_id, &host->led);


	err = device_add(&host->class_dev);
	err = device_add(&host->class_dev);
@@ -144,10 +149,6 @@ void mmc_remove_host(struct mmc_host *host)
	device_del(&host->class_dev);
	device_del(&host->class_dev);


	led_trigger_unregister_simple(host->led);
	led_trigger_unregister_simple(host->led);

	spin_lock(&mmc_host_lock);
	idr_remove(&mmc_host_idr, host->index);
	spin_unlock(&mmc_host_lock);
}
}


EXPORT_SYMBOL(mmc_remove_host);
EXPORT_SYMBOL(mmc_remove_host);
@@ -160,6 +161,10 @@ EXPORT_SYMBOL(mmc_remove_host);
 */
 */
void mmc_free_host(struct mmc_host *host)
void mmc_free_host(struct mmc_host *host)
{
{
	spin_lock(&mmc_host_lock);
	idr_remove(&mmc_host_idr, host->index);
	spin_unlock(&mmc_host_lock);

	put_device(&host->class_dev);
	put_device(&host->class_dev);
}
}


+2 −2
Original line number Original line Diff line number Diff line
@@ -128,12 +128,12 @@ static int sdio_irq_thread(void *_host)
			}
			}
		}
		}


		set_task_state(current, TASK_INTERRUPTIBLE);
		set_current_state(TASK_INTERRUPTIBLE);
		if (host->caps & MMC_CAP_SDIO_IRQ)
		if (host->caps & MMC_CAP_SDIO_IRQ)
			host->ops->enable_sdio_irq(host, 1);
			host->ops->enable_sdio_irq(host, 1);
		if (!kthread_should_stop())
		if (!kthread_should_stop())
			schedule_timeout(period);
			schedule_timeout(period);
		set_task_state(current, TASK_RUNNING);
		set_current_state(TASK_RUNNING);
	} while (!kthread_should_stop());
	} while (!kthread_should_stop());


	if (host->caps & MMC_CAP_SDIO_IRQ)
	if (host->caps & MMC_CAP_SDIO_IRQ)
+1 −0
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
#include <linux/mmc/sdio.h>
#include <linux/mmc/sdio.h>


#include "core.h"
#include "core.h"
#include "sdio_ops.h"


int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
{
{
Loading