--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
-@@ -651,6 +651,10 @@
+@@ -642,6 +642,10 @@ static const struct spi_device_id m25p_i
/* Everspin */
- { "mr25h256", CAT25_INFO( 32 * 1024, 1, 256, 2) },
+ { "mr25h256", CAT25_INFO( 32 * 1024, 1, 256, 2) },
+ /* GigaDevice */
+ { "gd25q32", INFO(0xc84016, 0, 64 * 1024, 64, SECT_4K) },
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
-@@ -299,7 +299,7 @@ cmd_bzip2 = (cat $(filter-out FORCE,$^)
+@@ -299,7 +299,7 @@ cmd_bzip2 = (cat $(filter-out FORCE,$^)
quiet_cmd_lzma = LZMA $@
cmd_lzma = (cat $(filter-out FORCE,$^) | \
--- a/arch/mips/include/asm/string.h
+++ b/arch/mips/include/asm/string.h
-@@ -133,11 +133,44 @@ strncmp(__const__ char *__cs, __const__
+@@ -133,11 +133,44 @@ strncmp(__const__ char *__cs, __const__
#define __HAVE_ARCH_MEMSET
extern void *memset(void *__s, int __c, size_t __count);
};
#define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags) \
-@@ -665,6 +667,10 @@ static const struct spi_device_id m25p_i
+@@ -669,6 +671,10 @@ static const struct spi_device_id m25p_i
{ "n25q128a13", INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
{ "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
/* Spansion -- single (large) sector size only, at least
* for the chips listed here (without boot sectors).
*/
-@@ -909,6 +915,9 @@ static int m25p_probe(struct spi_device
+@@ -913,6 +919,9 @@ static int m25p_probe(struct spi_device
if (info->flags & SECT_4K) {
flash->erase_opcode = OPCODE_BE_4K;
flash->mtd.erasesize = 4096;
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
-@@ -750,6 +750,7 @@ static const struct spi_device_id m25p_i
+@@ -754,6 +754,7 @@ static const struct spi_device_id m25p_i
{ "w25q64", INFO(0xef4017, 0, 64 * 1024, 128, SECT_4K) },
{ "w25q80", INFO(0xef5014, 0, 64 * 1024, 16, SECT_4K) },
{ "w25q80bl", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) },
/****************************************************************************/
struct m25p {
-@@ -913,7 +919,7 @@ static int m25p_probe(struct spi_device
+@@ -917,7 +923,7 @@ static int m25p_probe(struct spi_device
flash->mtd._write = m25p80_write;
/* prefer "small sector" erase if possible */
#include <linux/pagemap.h>
#include <linux/mtd/mtd.h>
#include <linux/interrupt.h>
-@@ -236,7 +238,9 @@ static int yaffs_file_flush(struct file
+@@ -236,7 +238,9 @@ static int yaffs_file_flush(struct file
static int yaffs_file_flush(struct file *file);
#endif
result = yaffs_rd_chunk_tags_nand(dev,nand_chunk,buffer,&tempTags);
if(memcmp(buffer,data,dev->data_bytes_per_chunk) ||
tempTags.obj_id != tags->obj_id ||
-@@ -424,7 +424,7 @@ static int yaffs_write_new_chunk(struct
+@@ -424,7 +424,7 @@ static int yaffs_write_new_chunk(struct
* lot of checks that are most likely not needed.
*
* Mods to the above
* rest of the block.
*/
-@@ -486,7 +486,7 @@ static int yaffs_write_new_chunk(struct
+@@ -486,7 +486,7 @@ static int yaffs_write_new_chunk(struct
}
/* Free chunks already includes softdeleted chunks.
* How ever this chunk is going to soon be really deleted
* which will increment free chunks.
-@@ -2752,7 +2752,7 @@ int yaffs_put_chunk_in_file(yaffs_obj_t
+@@ -2752,7 +2752,7 @@ int yaffs_put_chunk_in_file(yaffs_obj_t
NULL);
if (!tn)
return YAFFS_FAIL;
#ifdef CONFIG_YAFFS_SHORT_NAMES_IN_RAM
else if (obj->short_name[0]) {
yaffs_strcpy(name, obj->short_name);
-@@ -4861,9 +4861,9 @@ int yaffs_set_attribs(yaffs_obj_t *obj,
+@@ -4861,9 +4861,9 @@ int yaffs_set_attribs(yaffs_obj_t *obj,
if (valid & ATTR_MODE)
obj->yst_mode = attr->ia_mode;
if (valid & ATTR_UID)
if (valid & ATTR_ATIME)
obj->yst_atime = Y_TIME_CONVERT(attr->ia_atime);
-@@ -4886,9 +4886,9 @@ int yaffs_get_attribs(yaffs_obj_t *obj,
+@@ -4886,9 +4886,9 @@ int yaffs_get_attribs(yaffs_obj_t *obj,
attr->ia_mode = obj->yst_mode;
valid |= ATTR_MODE;
/* LzmaDecode
--- a/lib/lzma/LzmaDec.c
+++ b/lib/lzma/LzmaDec.c
-@@ -682,7 +682,7 @@ static void LzmaDec_InitRc(CLzmaDec *p,
+@@ -682,7 +682,7 @@ static void LzmaDec_InitRc(CLzmaDec *p,
p->needFlush = 0;
}
{
CLzmaProps propNew;
RINOK(LzmaProps_Decode(&propNew, props, propsSize));
-@@ -944,7 +944,7 @@ SRes LzmaDec_AllocateProbs(CLzmaDec *p,
+@@ -944,7 +944,7 @@ SRes LzmaDec_AllocateProbs(CLzmaDec *p,
return SZ_OK;
}
void MatchFinder_Construct(CMatchFinder *p);
/* Conditions:
-@@ -70,12 +65,6 @@ int MatchFinder_Create(CMatchFinder *p,
+@@ -70,12 +65,6 @@ int MatchFinder_Create(CMatchFinder *p,
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
ISzAlloc *alloc);
void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc);
depends on NETFILTER_ADVANCED
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
-@@ -131,6 +131,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_RECENT)
+@@ -131,6 +131,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_RECENT)
obj-$(CONFIG_NETFILTER_XT_MATCH_SCTP) += xt_sctp.o
obj-$(CONFIG_NETFILTER_XT_MATCH_SOCKET) += xt_socket.o
obj-$(CONFIG_NETFILTER_XT_MATCH_STATE) += xt_state.o
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
-@@ -261,10 +261,34 @@ static int ct_open(struct inode *inode,
+@@ -267,10 +267,34 @@ static int ct_open(struct inode *inode,
sizeof(struct ct_iter_state));
}
.llseek = seq_lseek,
.release = seq_release_net,
};
-@@ -366,7 +390,7 @@ static int nf_conntrack_standalone_init_
+@@ -372,7 +396,7 @@ static int nf_conntrack_standalone_init_
{
struct proc_dir_entry *pde;
counters = alloc_counters(table);
if (IS_ERR(counters))
-@@ -961,6 +990,14 @@ copy_entries_to_user(unsigned int total_
+@@ -960,6 +989,14 @@ copy_entries_to_user(unsigned int total_
+ ret = -EFAULT;
goto free_counters;
}
-
++
+ flags = e->ip.flags & IPT_F_MASK;
+ if (copy_to_user(userptr + off
+ + offsetof(struct ipt_entry, ip.flags),
+ ret = -EFAULT;
+ goto free_counters;
+ }
-+
+
for (i = sizeof(struct ipt_entry);
i < e->target_offset;
- i += m->u.match_size) {
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
-@@ -898,25 +898,7 @@ void netlink_detachskb(struct sock *sk,
+@@ -898,25 +898,7 @@ void netlink_detachskb(struct sock *sk,
static struct sk_buff *netlink_trim(struct sk_buff *skb, gfp_t allocation)
{
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
-@@ -2340,13 +2340,13 @@ int prism2_ap_get_sta_qual(local_info_t
+@@ -2340,13 +2340,13 @@ int prism2_ap_get_sta_qual(local_info_t
addr[count].sa_family = ARPHRD_ETHER;
memcpy(addr[count].sa_data, sta->addr, ETH_ALEN);
if (sta->last_rx_silence == 0)
default y
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
-@@ -44,6 +44,7 @@ static void quirk_mmio_always_on(struct
+@@ -44,6 +44,7 @@ static void quirk_mmio_always_on(struct
DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_ANY_ID, PCI_ANY_ID,
PCI_CLASS_BRIDGE_HOST, 8, quirk_mmio_always_on);
help
--- a/net/core/Makefile
+++ b/net/core/Makefile
-@@ -8,9 +8,9 @@ obj-y := sock.o request_sock.o skbuff.o
+@@ -8,9 +8,9 @@ obj-y := sock.o request_sock.o skbuff.o
obj-$(CONFIG_SYSCTL) += sysctl_net_core.o
obj-y += dev.o ethtool.o dev_addr_lists.o dst.o netevent.o \
* All of these routines try to estimate how many bits of randomness a
* particular randomness source. They do this by keeping track of the
* first and second order deltas of the event timings.
-@@ -796,6 +806,63 @@ void add_disk_randomness(struct gendisk
+@@ -796,6 +806,63 @@ void add_disk_randomness(struct gendisk
}
#endif
{ .compatible = "arm,cortex-a9-twd-timer", },
--- a/drivers/watchdog/mpcore_wdt.c
+++ b/drivers/watchdog/mpcore_wdt.c
-@@ -101,9 +101,7 @@ static void mpcore_wdt_keepalive(struct
+@@ -101,9 +101,7 @@ static void mpcore_wdt_keepalive(struct
spin_lock(&wdt_lock);
/* Assume prescale is set to 256 */
CFLAGS:=-Os -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp
MAINTAINER:=Florian Fainelli <florian@openwrt.org>
-LINUX_VERSION:=3.8-rc4
+LINUX_VERSION:=3.8-rc6
include $(INCLUDE_DIR)/target.mk
+++ /dev/null
-The Armada XP GPIO controller has two ways of notifying interrupts:
-using global interrupts or using per-CPU interrupts. In an attempt to
-use the best available features, the 'marvell,armadaxp-gpio'
-compatible string selects a variant of the gpio-mvebu driver that
-makes use of the per-CPU interrupts.
-
-Unfortunately, this doesn't work properly in a SMP context, because we
-fall into cases where the GPIO interrupt is enabled on CPU X at the
-GPIO controller level, but on CPU Y at the interrupt controller
-level. It is not yet clear how to fix that easily.
-
-So for 3.8, our approach is to switch to global interrupts for GPIOs,
-so that we do not fall into this per-CPU interrupts problem.
-
-This patch therefore fixes GPIO interrupts on Armada XP
-platforms. Without this patch, GPIO interrupts simply do not work
-reliably, because their proper operation depends on which CPU the code
-requesting the interrupt is running.
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
----
-This is 3.8-rc material.
----
- arch/arm/boot/dts/armada-xp-mv78230.dtsi | 14 ++++++--------
- arch/arm/boot/dts/armada-xp-mv78260.dtsi | 21 +++++++++------------
- arch/arm/boot/dts/armada-xp-mv78460.dtsi | 21 +++++++++------------
- 3 files changed, 24 insertions(+), 32 deletions(-)
-
---- a/arch/arm/boot/dts/armada-xp-mv78230.dtsi
-+++ b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
-@@ -50,27 +50,25 @@
- };
-
- gpio0: gpio@d0018100 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018100 0x40>,
-- <0xd0018800 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018100 0x40>;
- ngpios = <32>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <16>, <17>, <18>, <19>;
-+ interrupts = <82>, <83>, <84>, <85>;
- };
-
- gpio1: gpio@d0018140 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018140 0x40>,
-- <0xd0018840 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018140 0x40>;
- ngpios = <17>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <20>, <21>, <22>;
-+ interrupts = <87>, <88>, <89>;
- };
- };
- };
---- a/arch/arm/boot/dts/armada-xp-mv78260.dtsi
-+++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
-@@ -51,39 +51,36 @@
- };
-
- gpio0: gpio@d0018100 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018100 0x40>,
-- <0xd0018800 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018100 0x40>;
- ngpios = <32>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <16>, <17>, <18>, <19>;
-+ interrupts = <82>, <83>, <84>, <85>;
- };
-
- gpio1: gpio@d0018140 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018140 0x40>,
-- <0xd0018840 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018140 0x40>;
- ngpios = <32>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <20>, <21>, <22>, <23>;
-+ interrupts = <87>, <88>, <89>, <90>;
- };
-
- gpio2: gpio@d0018180 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018180 0x40>,
-- <0xd0018870 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018180 0x40>;
- ngpios = <3>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <24>;
-+ interrupts = <91>;
- };
-
- ethernet@d0034000 {
---- a/arch/arm/boot/dts/armada-xp-mv78460.dtsi
-+++ b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
-@@ -66,39 +66,36 @@
- };
-
- gpio0: gpio@d0018100 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018100 0x40>,
-- <0xd0018800 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018100 0x40>;
- ngpios = <32>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <16>, <17>, <18>, <19>;
-+ interrupts = <82>, <83>, <84>, <85>;
- };
-
- gpio1: gpio@d0018140 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018140 0x40>,
-- <0xd0018840 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018140 0x40>;
- ngpios = <32>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <20>, <21>, <22>, <23>;
-+ interrupts = <87>, <88>, <89>, <90>;
- };
-
- gpio2: gpio@d0018180 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018180 0x40>,
-- <0xd0018870 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018180 0x40>;
- ngpios = <3>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <24>;
-+ interrupts = <91>;
- };
-
- ethernet@d0034000 {
+From patchwork Wed Jan 16 13:13:57 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [2/5] mmc: mvsdio: use slot-gpio infrastructure for write protect gpio
+Date: Wed, 16 Jan 2013 13:13:57 -0000
+From: Andrew Lunn <andrew@lunn.ch>
+X-Patchwork-Id: 1987931
+Message-Id: <1358342040-7130-3-git-send-email-andrew@lunn.ch>
+To: Jason Cooper <jason@lakedaemon.net>
+Cc: linux ARM <linux-arm-kernel@lists.infradead.org>,
+ linux-mmc@vger.kernel.org, linux@arm.linux.org.uk,
+ Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
+ Andrew Lunn <andrew@lunn.ch>
+
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
The MMC core subsystem provides in drivers/mmc/core/slot-gpio.c a nice
set of helper functions to simplify the management of the write
protect GPIO in MMC host drivers. This patch migrates the mvsdio
binding for this driver.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Andrew Lunn <andrew@lunn.ch>
+Tested-by: Stefan Peter <s.peter@mpl.ch>
+Tested-by: Florian Fainelli <florian@openwrt.org>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+
---
- drivers/mmc/host/mvsdio.c | 34 +++++-----------------------------
- 1 file changed, 5 insertions(+), 29 deletions(-)
+drivers/mmc/host/mvsdio.c | 30 +++++-------------------------
+ 1 file changed, 5 insertions(+), 25 deletions(-)
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
#include <asm/sizes.h>
#include <asm/unaligned.h>
-@@ -54,7 +55,6 @@ struct mvsd_host {
- int irq;
+@@ -52,7 +53,6 @@ struct mvsd_host {
+ struct device *dev;
struct clk *clk;
int gpio_card_detect;
- int gpio_write_protect;
};
#define mvsd_write(offs, val) writel(val, iobase + (offs))
-@@ -566,20 +566,6 @@ static void mvsd_enable_sdio_irq(struct
+@@ -564,20 +564,6 @@ static void mvsd_enable_sdio_irq(struct
spin_unlock_irqrestore(&host->lock, flags);
}
static void mvsd_power_up(struct mvsd_host *host)
{
void __iomem *iobase = host->base;
-@@ -676,7 +662,7 @@ static void mvsd_set_ios(struct mmc_host
+@@ -674,7 +660,7 @@ static void mvsd_set_ios(struct mmc_host
static const struct mmc_host_ops mvsd_ops = {
.request = mvsd_request,
.set_ios = mvsd_set_ios,
.enable_sdio_irq = mvsd_enable_sdio_irq,
};
-@@ -798,15 +784,7 @@ static int __init mvsd_probe(struct plat
+@@ -793,15 +779,7 @@ static int __init mvsd_probe(struct plat
if (!host->gpio_card_detect)
mmc->caps |= MMC_CAP_NEEDS_POLL;
- if (mvsd_data->gpio_write_protect) {
-- ret = gpio_request(mvsd_data->gpio_write_protect,
-- DRIVER_NAME " wp");
+- ret = devm_gpio_request_one(&pdev->dev,
+- mvsd_data->gpio_write_protect,
+- GPIOF_IN, DRIVER_NAME " wp");
- if (ret == 0) {
-- gpio_direction_input(mvsd_data->gpio_write_protect);
- host->gpio_write_protect =
- mvsd_data->gpio_write_protect;
- }
setup_timer(&host->timer, mvsd_timeout_timer, (unsigned long)host);
platform_set_drvdata(pdev, mmc);
-@@ -831,8 +809,7 @@ out:
- free_irq(gpio_to_irq(host->gpio_card_detect), host);
- gpio_free(host->gpio_card_detect);
- }
-- if (host->gpio_write_protect)
-- gpio_free(host->gpio_write_protect);
-+ mmc_gpio_free_ro(mmc);
- if (host->base)
- iounmap(host->base);
- }
-@@ -861,8 +838,7 @@ static int __exit mvsd_remove(struct pla
- }
- mmc_remove_host(mmc);
- free_irq(host->irq, host);
-- if (host->gpio_write_protect)
-- gpio_free(host->gpio_write_protect);
+@@ -820,6 +798,7 @@ static int __init mvsd_probe(struct plat
+
+ out:
+ if (mmc) {
+ mmc_gpio_free_ro(mmc);
- del_timer_sync(&host->timer);
- mvsd_power_down(host);
- iounmap(host->base);
+ if (!IS_ERR(host->clk))
+ clk_disable_unprepare(host->clk);
+ mmc_free_host(mmc);
+@@ -834,6 +813,7 @@ static int __exit mvsd_remove(struct pla
+
+ struct mvsd_host *host = mmc_priv(mmc);
+
++ mmc_gpio_free_ro(mmc);
+ mmc_remove_host(mmc);
+ del_timer_sync(&host->timer);
+ mvsd_power_down(host);
+From patchwork Wed Jan 16 13:13:58 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [3/5] mmc: mvsdio: use slot-gpio for card detect gpio
+Date: Wed, 16 Jan 2013 13:13:58 -0000
+From: Andrew Lunn <andrew@lunn.ch>
+X-Patchwork-Id: 1987941
+Message-Id: <1358342040-7130-4-git-send-email-andrew@lunn.ch>
+To: Jason Cooper <jason@lakedaemon.net>
+Cc: linux ARM <linux-arm-kernel@lists.infradead.org>,
+ linux-mmc@vger.kernel.org, linux@arm.linux.org.uk,
+ Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
+ Andrew Lunn <andrew@lunn.ch>
+
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
The MMC core subsystem provides in drivers/mmc/core/slot-gpio.c a nice
set of helper functions to simplify the management of the card detect
GPIO in MMC host drivers. This patch migrates the mvsdio driver to
driver.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Andrew Lunn <andrew@lunn.ch>
+Tested-by: Stefan Peter <s.peter@mpl.ch>
+Tested-by: Florian Fainelli <florian@openwrt.org>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+
---
- drivers/mmc/host/mvsdio.c | 44 +++++++++-----------------------------------
- 1 file changed, 9 insertions(+), 35 deletions(-)
+drivers/mmc/host/mvsdio.c | 39 +++++++++------------------------------
+ 1 file changed, 9 insertions(+), 30 deletions(-)
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
-@@ -54,7 +54,6 @@ struct mvsd_host {
- struct resource *res;
- int irq;
+@@ -52,7 +52,6 @@ struct mvsd_host {
+ struct mmc_host *mmc;
+ struct device *dev;
struct clk *clk;
- int gpio_card_detect;
};
#define mvsd_write(offs, val) writel(val, iobase + (offs))
-@@ -540,13 +539,6 @@ static void mvsd_timeout_timer(unsigned
+@@ -538,13 +537,6 @@ static void mvsd_timeout_timer(unsigned
mmc_request_done(host->mmc, mrq);
}
static void mvsd_enable_sdio_irq(struct mmc_host *mmc, int enable)
{
struct mvsd_host *host = mmc_priv(mmc);
-@@ -765,23 +757,11 @@ static int __init mvsd_probe(struct plat
+@@ -757,26 +749,11 @@ static int __init mvsd_probe(struct plat
+ if (!IS_ERR(host->clk))
clk_prepare_enable(host->clk);
- }
- if (mvsd_data->gpio_card_detect) {
-- ret = gpio_request(mvsd_data->gpio_card_detect,
-- DRIVER_NAME " cd");
+- ret = devm_gpio_request_one(&pdev->dev,
+- mvsd_data->gpio_card_detect,
+- GPIOF_IN, DRIVER_NAME " cd");
- if (ret == 0) {
-- gpio_direction_input(mvsd_data->gpio_card_detect);
- irq = gpio_to_irq(mvsd_data->gpio_card_detect);
-- ret = request_irq(irq, mvsd_card_detect_irq,
-- IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING,
-- DRIVER_NAME " cd", host);
+- ret = devm_request_irq(&pdev->dev, irq,
+- mvsd_card_detect_irq,
+- IRQ_TYPE_EDGE_RISING |
+- IRQ_TYPE_EDGE_FALLING,
+- DRIVER_NAME " cd", host);
- if (ret == 0)
- host->gpio_card_detect =
- mvsd_data->gpio_card_detect;
- else
-- gpio_free(mvsd_data->gpio_card_detect);
+- devm_gpio_free(&pdev->dev,
+- mvsd_data->gpio_card_detect);
- }
- }
- if (!host->gpio_card_detect)
mmc->caps |= MMC_CAP_NEEDS_POLL;
mmc_gpio_request_ro(mmc, mvsd_data->gpio_write_protect);
-@@ -794,9 +774,9 @@ static int __init mvsd_probe(struct plat
+@@ -789,15 +766,16 @@ static int __init mvsd_probe(struct plat
pr_notice("%s: %s driver initialized, ",
mmc_hostname(mmc), DRIVER_NAME);
else
printk("lacking card detect (fall back to polling)\n");
return 0;
-@@ -805,10 +785,7 @@ out:
- if (host) {
- if (host->irq)
- free_irq(host->irq, host);
-- if (host->gpio_card_detect) {
-- free_irq(gpio_to_irq(host->gpio_card_detect), host);
-- gpio_free(host->gpio_card_detect);
-- }
-+ mmc_gpio_free_cd(mmc);
- mmc_gpio_free_ro(mmc);
- if (host->base)
- iounmap(host->base);
-@@ -832,10 +809,7 @@ static int __exit mvsd_remove(struct pla
- if (mmc) {
- struct mvsd_host *host = mmc_priv(mmc);
-- if (host->gpio_card_detect) {
-- free_irq(gpio_to_irq(host->gpio_card_detect), host);
-- gpio_free(host->gpio_card_detect);
-- }
+ out:
+ if (mmc) {
+ mmc_gpio_free_cd(mmc);
- mmc_remove_host(mmc);
- free_irq(host->irq, host);
mmc_gpio_free_ro(mmc);
+ if (!IS_ERR(host->clk))
+ clk_disable_unprepare(host->clk);
+@@ -813,6 +791,7 @@ static int __exit mvsd_remove(struct pla
+
+ struct mvsd_host *host = mmc_priv(mmc);
+
++ mmc_gpio_free_cd(mmc);
+ mmc_gpio_free_ro(mmc);
+ mmc_remove_host(mmc);
+ del_timer_sync(&host->timer);
+From patchwork Wed Jan 16 13:13:59 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [4/5] mmc: mvsdio: implement a Device Tree binding
+Date: Wed, 16 Jan 2013 13:13:59 -0000
+From: Andrew Lunn <andrew@lunn.ch>
+X-Patchwork-Id: 1987921
+Message-Id: <1358342040-7130-5-git-send-email-andrew@lunn.ch>
+To: Jason Cooper <jason@lakedaemon.net>
+Cc: linux ARM <linux-arm-kernel@lists.infradead.org>,
+ linux-mmc@vger.kernel.org, linux@arm.linux.org.uk,
+ Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
+ Andrew Lunn <andrew@lunn.ch>
+
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
This patch adds a simple Device Tree binding for the mvsdio driver, as
well as the necessary documentation for it. Compatibility with non-DT
platforms is preserved, by keeping the platform_data based
the "clock" field of the mvsdio_platform_data structure.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Andrew Lunn <andrew@lunn.ch>
+Tested-by: Stefan Peter <s.peter@mpl.ch>
+Tested-by: Florian Fainelli <florian@openwrt.org>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+
---
- .../devicetree/bindings/mmc/orion-sdio.txt | 17 ++++++
- drivers/mmc/host/mvsdio.c | 60 +++++++++++++++-----
- 2 files changed, 62 insertions(+), 15 deletions(-)
+.../devicetree/bindings/mmc/orion-sdio.txt | 17 ++++++
+ drivers/mmc/host/mvsdio.c | 62 +++++++++++++++-----
+ 2 files changed, 64 insertions(+), 15 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mmc/orion-sdio.txt
--- /dev/null
#include <linux/mmc/host.h>
#include <linux/mmc/slot-gpio.h>
-@@ -683,17 +685,17 @@ mv_conf_mbus_windows(struct mvsd_host *h
+@@ -681,17 +683,17 @@ mv_conf_mbus_windows(struct mvsd_host *h
static int __init mvsd_probe(struct platform_device *pdev)
{
+ if (!r || irq < 0)
return -ENXIO;
- r = request_mem_region(r->start, SZ_1K, DRIVER_NAME);
-@@ -710,7 +712,35 @@ static int __init mvsd_probe(struct plat
+ mmc = mmc_alloc_host(sizeof(struct mvsd_host), &pdev->dev);
+@@ -703,8 +705,37 @@ static int __init mvsd_probe(struct plat
+ host = mmc_priv(mmc);
host->mmc = mmc;
host->dev = &pdev->dev;
- host->res = r;
- host->base_clock = mvsd_data->clock / 2;
+- host->clk = ERR_PTR(-EINVAL);
+
+ /* Some non-DT platforms do not pass a clock, and the clock
+ frequency is passed through platform_data. On DT platforms,
+ a clock must always be passed, even if there is no gatable
+ clock associated to the SDIO interface (it can simply be a
+ fixed rate clock). */
-+ host->clk = clk_get(&pdev->dev, NULL);
++ host->clk = devm_clk_get(&pdev->dev, NULL);
+ if (!IS_ERR(host->clk))
+ clk_prepare_enable(host->clk);
+
+ } else {
+ const struct mvsdio_platform_data *mvsd_data;
+ mvsd_data = pdev->dev.platform_data;
-+ if (!mvsd_data)
-+ return -ENXIO;
++ if (!mvsd_data) {
++ ret = -ENXIO;
++ goto out;
++ }
+ host->base_clock = mvsd_data->clock / 2;
+ gpio_card_detect = mvsd_data->gpio_card_detect;
+ gpio_write_protect = mvsd_data->gpio_write_protect;
mmc->ops = &mvsd_ops;
-@@ -750,21 +780,14 @@ static int __init mvsd_probe(struct plat
- } else
- host->irq = irq;
+@@ -743,20 +774,14 @@ static int __init mvsd_probe(struct plat
+ goto out;
+ }
- /* Not all platforms can gate the clock, so it is not
- an error if the clock does not exists. */
-- host->clk = clk_get(&pdev->dev, NULL);
-- if (!IS_ERR(host->clk)) {
+- host->clk = devm_clk_get(&pdev->dev, NULL);
+- if (!IS_ERR(host->clk))
- clk_prepare_enable(host->clk);
-- }
-
- if (gpio_is_valid(mvsd_data->gpio_card_detect)) {
- ret = mmc_gpio_request_cd(mmc, mvsd_data->gpio_card_detect);
setup_timer(&host->timer, mvsd_timeout_timer, (unsigned long)host);
platform_set_drvdata(pdev, mmc);
-@@ -776,7 +799,7 @@ static int __init mvsd_probe(struct plat
+@@ -768,7 +793,7 @@ static int __init mvsd_probe(struct plat
mmc_hostname(mmc), DRIVER_NAME);
if (!(mmc->caps & MMC_CAP_NEEDS_POLL))
printk("using GPIO %d for card detection\n",
else
printk("lacking card detect (fall back to polling)\n");
return 0;
-@@ -855,12 +878,19 @@ static int mvsd_resume(struct platform_d
+@@ -832,12 +857,19 @@ static int mvsd_resume(struct platform_d
#define mvsd_resume NULL
#endif
+From patchwork Wed Jan 16 13:14:00 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [5/5] mmc: mvsdio: add pinctrl integration
+Date: Wed, 16 Jan 2013 13:14:00 -0000
+From: Andrew Lunn <andrew@lunn.ch>
+X-Patchwork-Id: 1987901
+Message-Id: <1358342040-7130-6-git-send-email-andrew@lunn.ch>
+To: Jason Cooper <jason@lakedaemon.net>
+Cc: linux ARM <linux-arm-kernel@lists.infradead.org>,
+ linux-mmc@vger.kernel.org, linux@arm.linux.org.uk,
+ Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
+ Andrew Lunn <andrew@lunn.ch>
+
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
On many Marvell SoCs, the pins used for the SDIO interface are part of
the MPP pins, that are muxable pins. In order to get the muxing of
those pins correct, this commit integrates the mvsdio driver with the
infrastructure.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Andrew Lunn <andrew@lunn.ch>
+Tested-by: Stefan Peter <s.peter@mpl.ch>
+Tested-by: Florian Fainelli <florian@openwrt.org>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+
---
- drivers/mmc/host/mvsdio.c | 6 ++++++
+drivers/mmc/host/mvsdio.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/mmc/host/mvsdio.c
#include <asm/sizes.h>
#include <asm/unaligned.h>
-@@ -692,6 +693,7 @@ static int __init mvsd_probe(struct plat
+@@ -690,6 +691,7 @@ static int __init mvsd_probe(struct plat
struct resource *r;
int ret, irq;
int gpio_card_detect, gpio_write_protect;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0);
-@@ -713,6 +715,10 @@ static int __init mvsd_probe(struct plat
+@@ -706,6 +708,10 @@ static int __init mvsd_probe(struct plat
+ host->mmc = mmc;
host->dev = &pdev->dev;
- host->res = r;
+ pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+ if (IS_ERR(pinctrl))
+
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
-@@ -5,3 +5,4 @@ obj-y += system-controller.o
+@@ -7,3 +7,4 @@ obj-y += system-controller.o
obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o irq-armada-370-xp.o addr-map.o coherency.o coherency_ll.o pmsu.o
obj-$(CONFIG_SMP) += platsmp.o headsmp.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o