diff options
author | Andrey Konovalov <andrey.konovalov@linaro.org> | 2012-07-16 20:24:45 +0400 |
---|---|---|
committer | Andrey Konovalov <andrey.konovalov@linaro.org> | 2012-07-16 20:24:45 +0400 |
commit | 71f93c3f7964940a74309a44746f7203d353f13e (patch) | |
tree | c8caf50427b371b7518c589dceab612e11ed0d32 /drivers | |
parent | 3ae09534a8eaf2f922d18da54561fe06ca41b294 (diff) | |
parent | f5441fa87ede8b0e5b799d46cac422c696f1592e (diff) |
Automatically merging tracking-samslt-wlan into merge-linux-linaro
Conflicting files:
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/Makefile | 2 | ||||
-rw-r--r-- | drivers/mmc/core/sdio_irq.c | 2 | ||||
-rw-r--r-- | drivers/mmc/core/sdio_ops.c | 40 | ||||
-rw-r--r-- | drivers/mmc/core/sdio_ops.h | 1 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/Makefile | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/Kconfig | 12 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/Makefile | 28 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/sdio.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath/platform_data.c | 26 |
10 files changed, 111 insertions, 17 deletions
diff --git a/drivers/Makefile b/drivers/Makefile index e8c97821bf17..1d964f8c3dee 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -54,6 +54,7 @@ obj-$(CONFIG_TARGET_CORE) += target/ obj-$(CONFIG_MTD) += mtd/ obj-$(CONFIG_SPI) += spi/ obj-y += hsi/ +obj-y += mmc/ obj-y += net/ obj-$(CONFIG_ATM) += atm/ obj-$(CONFIG_FUSION) += message/ @@ -96,7 +97,6 @@ obj-$(CONFIG_EISA) += eisa/ obj-y += lguest/ obj-$(CONFIG_CPU_FREQ) += cpufreq/ obj-$(CONFIG_CPU_IDLE) += cpuidle/ -obj-y += mmc/ obj-$(CONFIG_MEMSTICK) += memstick/ obj-y += leds/ obj-$(CONFIG_SWITCH) += switch/ diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c index 3d8ceb4084de..6c1e63a72117 100644 --- a/drivers/mmc/core/sdio_irq.c +++ b/drivers/mmc/core/sdio_irq.c @@ -46,7 +46,7 @@ static int process_sdio_pending_irqs(struct mmc_host *host) return 1; } - ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_INTx, 0, &pending); + ret = mmc_io_rw_direct_irq(card, &pending); if (ret) { pr_debug("%s: error %d reading SDIO_CCCR_INTx\n", mmc_card_id(card), ret); diff --git a/drivers/mmc/core/sdio_ops.c b/drivers/mmc/core/sdio_ops.c index d29e20630eed..2fcb53e678cc 100644 --- a/drivers/mmc/core/sdio_ops.c +++ b/drivers/mmc/core/sdio_ops.c @@ -111,6 +111,46 @@ static int mmc_io_rw_direct_host(struct mmc_host *host, int write, unsigned fn, return 0; } +static struct mmc_command sdio_intx_cmd = { + .opcode = SD_IO_RW_DIRECT, + .arg = SDIO_CCCR_INTx << 9, + .flags = MMC_RSP_SPI_R5 | MMC_RSP_R5 | MMC_CMD_AC, +}; + +int mmc_io_rw_direct_irq(struct mmc_card *card, u8 *out) +{ + int err; + struct mmc_host *host ; + + BUG_ON(!card); + host = card->host; + BUG_ON(!host); + + err = mmc_wait_for_cmd(host, &sdio_intx_cmd, 0); + if (err) + return err; + + if (mmc_host_is_spi(host)) { + /* host driver already reported errors */ + } else { + if (sdio_intx_cmd.resp[0] & R5_ERROR) + return -EIO; + if (sdio_intx_cmd.resp[0] & R5_FUNCTION_NUMBER) + return -EINVAL; + if (sdio_intx_cmd.resp[0] & R5_OUT_OF_RANGE) + return -ERANGE; + } + + if (out) { + if (mmc_host_is_spi(host)) + *out = (sdio_intx_cmd.resp[0] >> 8) & 0xFF; + else + *out = sdio_intx_cmd.resp[0] & 0xFF; + } + + return 0; +} + int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn, unsigned addr, u8 in, u8 *out) { diff --git a/drivers/mmc/core/sdio_ops.h b/drivers/mmc/core/sdio_ops.h index 12a4d3ab174c..5fe8ad667452 100644 --- a/drivers/mmc/core/sdio_ops.h +++ b/drivers/mmc/core/sdio_ops.h @@ -15,6 +15,7 @@ int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr); int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn, unsigned addr, u8 in, u8* out); +int mmc_io_rw_direct_irq(struct mmc_card *card, u8 *out); int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn, unsigned addr, int incr_addr, u8 *buf, unsigned blocks, unsigned blksz); int sdio_reset(struct mmc_host *host); diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 37601ec6a958..2ebe589a6162 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2747,7 +2747,11 @@ int sdhci_add_host(struct sdhci_host *host) mmc->max_discard_to = (1 << 27) / host->timeout_clk; +#if defined(CONFIG_MACH_ORIGEN) && defined(CONFIG_ATH6KL_POLL) + mmc->caps |= MMC_CAP_ERASE | MMC_CAP_CMD23; +#else mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23; +#endif if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) host->flags |= SDHCI_AUTO_CMD12; diff --git a/drivers/net/wireless/ath/Makefile b/drivers/net/wireless/ath/Makefile index d716b748e574..fc2851e2b7c3 100644 --- a/drivers/net/wireless/ath/Makefile +++ b/drivers/net/wireless/ath/Makefile @@ -2,7 +2,7 @@ obj-$(CONFIG_ATH5K) += ath5k/ obj-$(CONFIG_ATH9K_HW) += ath9k/ obj-$(CONFIG_CARL9170) += carl9170/ obj-$(CONFIG_ATH6KL) += ath6kl/ - +obj-$(CONFIG_ATH6KL_PLATFORM_DATA) += platform_data.o obj-$(CONFIG_ATH_COMMON) += ath.o ath-objs := main.o \ diff --git a/drivers/net/wireless/ath/ath6kl/Kconfig b/drivers/net/wireless/ath/ath6kl/Kconfig index d755a5e7ed20..734a6ef3d08c 100644 --- a/drivers/net/wireless/ath/ath6kl/Kconfig +++ b/drivers/net/wireless/ath/ath6kl/Kconfig @@ -30,3 +30,15 @@ config ATH6KL_DEBUG depends on ATH6KL ---help--- Enables debug support + +config ATH6KL_PLATFORM_DATA + bool "Atheros ath6kl Platform data support" + depends on ATH6KL + ---help--- + Enables ath6kl platform data + +config ATH6KL_POLL + bool "Atheros ath6kl Polling support" + depends on ATH6KL + ---help--- + Enables workaround for ar6003 hw2.0 diff --git a/drivers/net/wireless/ath/ath6kl/Makefile b/drivers/net/wireless/ath/ath6kl/Makefile index 8cae8886f17d..ef3ba6a58da5 100644 --- a/drivers/net/wireless/ath/ath6kl/Makefile +++ b/drivers/net/wireless/ath/ath6kl/Makefile @@ -22,22 +22,22 @@ # Author(s): ="Atheros" #------------------------------------------------------------------------------ -obj-$(CONFIG_ATH6KL) += ath6kl_core.o -ath6kl_core-y += debug.o -ath6kl_core-y += hif.o -ath6kl_core-y += htc_mbox.o -ath6kl_core-y += htc_pipe.o -ath6kl_core-y += bmi.o -ath6kl_core-y += cfg80211.o -ath6kl_core-y += init.o -ath6kl_core-y += main.o -ath6kl_core-y += txrx.o -ath6kl_core-y += wmi.o -ath6kl_core-y += core.o -ath6kl_core-$(CONFIG_NL80211_TESTMODE) += testmode.o +obj-$(CONFIG_ATH6KL) += ath6kl.o +ath6kl-y += debug.o +ath6kl-y += hif.o +ath6kl-y += htc_mbox.o +ath6kl-y += htc_pipe.o +ath6kl-y += bmi.o +ath6kl-y += cfg80211.o +ath6kl-y += init.o +ath6kl-y += main.o +ath6kl-y += txrx.o +ath6kl-y += wmi.o +ath6kl-y += core.o +ath6kl-$(CONFIG_NL80211_TESTMODE) += testmode.o obj-$(CONFIG_ATH6KL_SDIO) += ath6kl_sdio.o -ath6kl_sdio-y += sdio.o +ath6kl-y += sdio.o obj-$(CONFIG_ATH6KL_USB) += ath6kl_usb.o ath6kl_usb-y += usb.o diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c index 05b95405f7b5..0a80af3ba109 100644 --- a/drivers/net/wireless/ath/ath6kl/sdio.c +++ b/drivers/net/wireless/ath/ath6kl/sdio.c @@ -23,6 +23,7 @@ #include <linux/mmc/sdio_ids.h> #include <linux/mmc/sdio.h> #include <linux/mmc/sd.h> +#include <linux/ath6kl.h> #include "hif.h" #include "hif-ops.h" #include "target.h" @@ -1423,7 +1424,11 @@ static struct sdio_driver ath6kl_sdio_driver = { static int __init ath6kl_sdio_init(void) { int ret; + const struct ath6kl_platform_data *wlan_data; + wlan_data = ath6kl_get_platform_data(); + if (!IS_ERR(wlan_data)) + wlan_data->setup_power(true); ret = sdio_register_driver(&ath6kl_sdio_driver); if (ret) ath6kl_err("sdio driver registration failed: %d\n", ret); @@ -1433,7 +1438,13 @@ static int __init ath6kl_sdio_init(void) static void __exit ath6kl_sdio_exit(void) { + const struct ath6kl_platform_data *wlan_data; + sdio_unregister_driver(&ath6kl_sdio_driver); + + wlan_data = ath6kl_get_platform_data(); + if (!IS_ERR(wlan_data)) + wlan_data->setup_power(false); } module_init(ath6kl_sdio_init); diff --git a/drivers/net/wireless/ath/platform_data.c b/drivers/net/wireless/ath/platform_data.c new file mode 100644 index 000000000000..dddffe409b09 --- /dev/null +++ b/drivers/net/wireless/ath/platform_data.c @@ -0,0 +1,26 @@ +#include <linux/module.h> +#include <linux/err.h> +#include <linux/ath6kl.h> + +static const struct ath6kl_platform_data *platform_data; + +int __init ath6kl_set_platform_data(const struct ath6kl_platform_data *data) +{ + if (platform_data) + return -EBUSY; + if (!data) + return -EINVAL; + + platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL); + if (!platform_data) + return -ENOMEM; + return 0; +} + +const struct ath6kl_platform_data *ath6kl_get_platform_data(void) +{ + if (!platform_data) + return ERR_PTR(-ENODEV); + return platform_data; +} +EXPORT_SYMBOL(ath6kl_get_platform_data); |