]> Pileus Git - ~andy/linux/commitdiff
Merge branch 'devel-stable' into devel
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 24 May 2010 22:08:52 +0000 (23:08 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 24 May 2010 22:08:52 +0000 (23:08 +0100)
arch/arm/include/asm/hardirq.h
arch/arm/mach-nomadik/clock.c
arch/arm/mach-w90x900/dev.c
arch/arm/mach-w90x900/include/mach/mfp.h [new file with mode: 0644]
arch/arm/mach-w90x900/mfp.c
drivers/char/hw_random/nomadik-rng.c

index 182310b991950b6e22d69930b376d3337335d80a..6d7485aff9558dcfba7de1f1cfb4a648778a6c6b 100644 (file)
@@ -12,7 +12,9 @@ typedef struct {
 
 #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
 
-#if NR_IRQS > 256
+#if NR_IRQS > 512
+#define HARDIRQ_BITS   10
+#elif NR_IRQS > 256
 #define HARDIRQ_BITS   9
 #else
 #define HARDIRQ_BITS   8
index 60f5bee09f2e5beba127efc7a728768278dd71a3..2c471fc451d743a590bd22c9cbdd07a985191c1d 100644 (file)
@@ -56,6 +56,7 @@ static struct clk_lookup lookups[] = {
        CLK(&clk_default, "gpio.1"),
        CLK(&clk_default, "gpio.2"),
        CLK(&clk_default, "gpio.3"),
+       CLK(&clk_default, "rng"),
 };
 
 static int __init clk_init(void)
index e2958eb567f9f1e5a2047f0dc4aebd7327adaba3..b2eda4dc1c34ea7172a773899275c18bbfab5dd4 100644 (file)
@@ -423,6 +423,33 @@ void  nuc900_fb_set_platdata(struct nuc900fb_mach_info *pd)
 }
 #endif
 
+/* AUDIO controller*/
+static u64 nuc900_device_audio_dmamask = -1;
+static struct resource nuc900_ac97_resource[] = {
+       [0] = {
+               .start = W90X900_PA_ACTL,
+               .end   = W90X900_PA_ACTL + W90X900_SZ_ACTL - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_ACTL,
+               .end   = IRQ_ACTL,
+               .flags = IORESOURCE_IRQ,
+       }
+
+};
+
+struct platform_device nuc900_device_audio = {
+       .name           = "nuc900-audio",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(nuc900_ac97_resource),
+       .resource       = nuc900_ac97_resource,
+       .dev              = {
+               .dma_mask               = &nuc900_device_audio_dmamask,
+               .coherent_dma_mask      = -1,
+       }
+};
+
 /*Here should be your evb resourse,such as LCD*/
 
 static struct platform_device *nuc900_public_dev[] __initdata = {
@@ -434,6 +461,7 @@ static struct platform_device *nuc900_public_dev[] __initdata = {
        &nuc900_device_emc,
        &nuc900_device_spi,
        &nuc900_device_wdt,
+       &nuc900_device_audio,
 };
 
 /* Provide adding specific CPU platform devices API */
diff --git a/arch/arm/mach-w90x900/include/mach/mfp.h b/arch/arm/mach-w90x900/include/mach/mfp.h
new file mode 100644 (file)
index 0000000..94c0e71
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * arch/arm/mach-w90x900/include/mach/mfp.h
+ *
+ * Copyright (c) 2010 Nuvoton technology corporation.
+ *
+ * Wan ZongShun <mcuos.com@gmail.com>
+ *
+ * Based on arch/arm/mach-s3c2410/include/mach/map.h
+ *
+ * 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;version 2 of the License.
+ *
+ */
+
+#ifndef __ASM_ARCH_MFP_H
+#define __ASM_ARCH_MFP_H
+
+extern void mfp_set_groupf(struct device *dev);
+extern void mfp_set_groupc(struct device *dev);
+extern void mfp_set_groupi(struct device *dev);
+extern void mfp_set_groupg(struct device *dev);
+
+#endif /* __ASM_ARCH_MFP_H */
index a47dc9a708ee0a29aaa4c62009f0344c07c9e93b..fb7fb627b1a564ca920fdb747080988f3fb75551 100644 (file)
 
 #define GPIOG0TO1      (0x03 << 14)
 #define GPIOG2TO3      (0x03 << 16)
+#define GPIOG22TO23    (0x03 << 22)
+
 #define ENSPI          (0x0a << 14)
 #define ENI2C0         (0x01 << 14)
 #define ENI2C1         (0x01 << 16)
+#define ENAC97         (0x02 << 22)
 
 static DEFINE_MUTEX(mfp_mutex);
 
@@ -146,6 +149,9 @@ void mfp_set_groupg(struct device *dev)
        } else if (strcmp(dev_id, "nuc900-i2c1") == 0) {
                mfpen &= ~(GPIOG2TO3);
                mfpen |= ENI2C1;/*enable i2c1*/
+       } else if (strcmp(dev_id, "nuc900-audio") == 0) {
+               mfpen &= ~(GPIOG22TO23);
+               mfpen |= ENAC97;/*enable AC97*/
        } else {
                mfpen &= ~(GPIOG0TO1 | GPIOG2TO3);/*GPIOG[3:0]*/
        }
index a8b4c401014483e4fea73ff193f93e4d306049dd..a348c7e9aa0bbb44a360afb0f92806be6cc1560b 100644 (file)
 #include <linux/amba/bus.h>
 #include <linux/hw_random.h>
 #include <linux/io.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+
+static struct clk *rng_clk;
 
 static int nmk_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
 {
@@ -40,6 +44,15 @@ static int nmk_rng_probe(struct amba_device *dev, struct amba_id *id)
        void __iomem *base;
        int ret;
 
+       rng_clk = clk_get(&dev->dev, NULL);
+       if (IS_ERR(rng_clk)) {
+               dev_err(&dev->dev, "could not get rng clock\n");
+               ret = PTR_ERR(rng_clk);
+               return ret;
+       }
+
+       clk_enable(rng_clk);
+
        ret = amba_request_regions(dev, dev->dev.init_name);
        if (ret)
                return ret;
@@ -57,6 +70,8 @@ out_unmap:
        iounmap(base);
 out_release:
        amba_release_regions(dev);
+       clk_disable(rng_clk);
+       clk_put(rng_clk);
        return ret;
 }
 
@@ -66,6 +81,8 @@ static int nmk_rng_remove(struct amba_device *dev)
        hwrng_unregister(&nmk_rng);
        iounmap(base);
        amba_release_regions(dev);
+       clk_disable(rng_clk);
+       clk_put(rng_clk);
        return 0;
 }