diff options
Diffstat (limited to 'kernel/arch/unicore32')
-rw-r--r-- | kernel/arch/unicore32/Kconfig | 2 | ||||
-rw-r--r-- | kernel/arch/unicore32/include/asm/Kbuild | 3 | ||||
-rw-r--r-- | kernel/arch/unicore32/include/asm/dma-mapping.h | 57 | ||||
-rw-r--r-- | kernel/arch/unicore32/include/asm/memory.h | 6 | ||||
-rw-r--r-- | kernel/arch/unicore32/include/asm/pci.h | 10 | ||||
-rw-r--r-- | kernel/arch/unicore32/kernel/fpu-ucf64.c | 4 | ||||
-rw-r--r-- | kernel/arch/unicore32/kernel/irq.c | 5 | ||||
-rw-r--r-- | kernel/arch/unicore32/kernel/puv3-nb0916.c | 10 | ||||
-rw-r--r-- | kernel/arch/unicore32/kernel/time.c | 29 |
9 files changed, 25 insertions, 101 deletions
diff --git a/kernel/arch/unicore32/Kconfig b/kernel/arch/unicore32/Kconfig index 928237a7b..c9faddc61 100644 --- a/kernel/arch/unicore32/Kconfig +++ b/kernel/arch/unicore32/Kconfig @@ -222,7 +222,7 @@ config I2C_BATTERY_BQ27200 tristate "I2C Battery BQ27200 Support" select I2C_PUV3 select POWER_SUPPLY - select BATTERY_BQ27x00 + select BATTERY_BQ27XXX config I2C_EEPROM_AT24 tristate "I2C EEPROMs AT24 support" diff --git a/kernel/arch/unicore32/include/asm/Kbuild b/kernel/arch/unicore32/include/asm/Kbuild index 3e0c19d0f..256c45b3a 100644 --- a/kernel/arch/unicore32/include/asm/Kbuild +++ b/kernel/arch/unicore32/include/asm/Kbuild @@ -26,6 +26,7 @@ generic-y += kdebug.h generic-y += kmap_types.h generic-y += local.h generic-y += mcs_spinlock.h +generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h @@ -36,7 +37,6 @@ generic-y += poll.h generic-y += posix_types.h generic-y += preempt.h generic-y += resource.h -generic-y += scatterlist.h generic-y += sections.h generic-y += segment.h generic-y += sembuf.h @@ -62,4 +62,5 @@ generic-y += ucontext.h generic-y += unaligned.h generic-y += user.h generic-y += vga.h +generic-y += word-at-a-time.h generic-y += xor.h diff --git a/kernel/arch/unicore32/include/asm/dma-mapping.h b/kernel/arch/unicore32/include/asm/dma-mapping.h index 366460a81..8140e053c 100644 --- a/kernel/arch/unicore32/include/asm/dma-mapping.h +++ b/kernel/arch/unicore32/include/asm/dma-mapping.h @@ -18,8 +18,6 @@ #include <linux/scatterlist.h> #include <linux/swiotlb.h> -#include <asm-generic/dma-coherent.h> - #include <asm/memory.h> #include <asm/cacheflush.h> @@ -30,26 +28,6 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) return &swiotlb_dma_map_ops; } -static inline int dma_supported(struct device *dev, u64 mask) -{ - struct dma_map_ops *dma_ops = get_dma_ops(dev); - - if (unlikely(dma_ops == NULL)) - return 0; - - return dma_ops->dma_supported(dev, mask); -} - -static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) -{ - struct dma_map_ops *dma_ops = get_dma_ops(dev); - - if (dma_ops->mapping_error) - return dma_ops->mapping_error(dev, dma_addr); - - return 0; -} - #include <asm-generic/dma-mapping-common.h> static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) @@ -72,41 +50,6 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr) static inline void dma_mark_clean(void *addr, size_t size) {} -static inline int dma_set_mask(struct device *dev, u64 dma_mask) -{ - if (!dev->dma_mask || !dma_supported(dev, dma_mask)) - return -EIO; - - *dev->dma_mask = dma_mask; - - return 0; -} - -#define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) - -static inline void *dma_alloc_attrs(struct device *dev, size_t size, - dma_addr_t *dma_handle, gfp_t flag, - struct dma_attrs *attrs) -{ - struct dma_map_ops *dma_ops = get_dma_ops(dev); - - return dma_ops->alloc(dev, size, dma_handle, flag, attrs); -} - -#define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) - -static inline void dma_free_attrs(struct device *dev, size_t size, - void *cpu_addr, dma_addr_t dma_handle, - struct dma_attrs *attrs) -{ - struct dma_map_ops *dma_ops = get_dma_ops(dev); - - dma_ops->free(dev, size, cpu_addr, dma_handle, attrs); -} - -#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) -#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) - static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, enum dma_data_direction direction) { diff --git a/kernel/arch/unicore32/include/asm/memory.h b/kernel/arch/unicore32/include/asm/memory.h index debafc402..3bb0a29fd 100644 --- a/kernel/arch/unicore32/include/asm/memory.h +++ b/kernel/arch/unicore32/include/asm/memory.h @@ -61,12 +61,6 @@ #endif /* - * Convert a physical address to a Page Frame Number and back - */ -#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) -#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) - -/* * Convert a page to/from a physical address */ #define page_to_phys(page) (__pfn_to_phys(page_to_pfn(page))) diff --git a/kernel/arch/unicore32/include/asm/pci.h b/kernel/arch/unicore32/include/asm/pci.h index 654407e98..38b3f3785 100644 --- a/kernel/arch/unicore32/include/asm/pci.h +++ b/kernel/arch/unicore32/include/asm/pci.h @@ -18,16 +18,6 @@ #include <asm-generic/pci.h> #include <mach/hardware.h> /* for PCIBIOS_MIN_* */ -#ifdef CONFIG_PCI -static inline void pci_dma_burst_advice(struct pci_dev *pdev, - enum pci_dma_burst_strategy *strat, - unsigned long *strategy_parameter) -{ - *strat = PCI_DMA_BURST_INFINITY; - *strategy_parameter = ~0UL; -} -#endif - #define HAVE_PCI_MMAP extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, enum pci_mmap_state mmap_state, int write_combine); diff --git a/kernel/arch/unicore32/kernel/fpu-ucf64.c b/kernel/arch/unicore32/kernel/fpu-ucf64.c index 282a60ac8..a53343a90 100644 --- a/kernel/arch/unicore32/kernel/fpu-ucf64.c +++ b/kernel/arch/unicore32/kernel/fpu-ucf64.c @@ -90,8 +90,8 @@ void ucf64_exchandler(u32 inst, u32 fpexc, struct pt_regs *regs) tmp &= ~(FPSCR_CON); exc &= ~(FPSCR_CMPINSTR_BIT | FPSCR_CON); } else { - pr_debug(KERN_ERR "UniCore-F64 Error: unhandled exceptions\n"); - pr_debug(KERN_ERR "UniCore-F64 FPSCR 0x%08x INST 0x%08x\n", + pr_debug("UniCore-F64 Error: unhandled exceptions\n"); + pr_debug("UniCore-F64 FPSCR 0x%08x INST 0x%08x\n", cff(FPSCR), inst); ucf64_raise_sigfpe(0, regs); diff --git a/kernel/arch/unicore32/kernel/irq.c b/kernel/arch/unicore32/kernel/irq.c index 0be5ccd7c..eb1fd0030 100644 --- a/kernel/arch/unicore32/kernel/irq.c +++ b/kernel/arch/unicore32/kernel/irq.c @@ -112,10 +112,9 @@ static struct irq_chip puv3_low_gpio_chip = { * irq_controller_lock held, and IRQs disabled. Decode the IRQ * and call the handler. */ -static void -puv3_gpio_handler(unsigned int irq, struct irq_desc *desc) +static void puv3_gpio_handler(struct irq_desc *desc) { - unsigned int mask; + unsigned int mask, irq; mask = readl(GPIO_GEDR); do { diff --git a/kernel/arch/unicore32/kernel/puv3-nb0916.c b/kernel/arch/unicore32/kernel/puv3-nb0916.c index 46ebfdccb..aab5f341d 100644 --- a/kernel/arch/unicore32/kernel/puv3-nb0916.c +++ b/kernel/arch/unicore32/kernel/puv3-nb0916.c @@ -19,6 +19,7 @@ #include <linux/reboot.h> #include <linux/interrupt.h> #include <linux/i2c.h> +#include <linux/pwm.h> #include <linux/pwm_backlight.h> #include <linux/gpio.h> #include <linux/gpio_keys.h> @@ -49,11 +50,14 @@ static struct resource puv3_i2c_resources[] = { } }; +static struct pwm_lookup nb0916_pwm_lookup[] = { + PWM_LOOKUP("PKUnity-v3-PWM", 0, "pwm-backlight", NULL, 70 * 1024, + PWM_POLARITY_NORMAL), +}; + static struct platform_pwm_backlight_data nb0916_backlight_data = { - .pwm_id = 0, .max_brightness = 100, .dft_brightness = 100, - .pwm_period_ns = 70 * 1024, .enable_gpio = -1, }; @@ -112,6 +116,8 @@ int __init mach_nb0916_init(void) platform_device_register_simple("PKUnity-v3-I2C", -1, puv3_i2c_resources, ARRAY_SIZE(puv3_i2c_resources)); + pwm_add_table(nb0916_pwm_lookup, ARRAY_SIZE(nb0916_pwm_lookup)); + platform_device_register_data(NULL, "pwm-backlight", -1, &nb0916_backlight_data, sizeof(nb0916_backlight_data)); diff --git a/kernel/arch/unicore32/kernel/time.c b/kernel/arch/unicore32/kernel/time.c index d3824b2ff..ac4c5449b 100644 --- a/kernel/arch/unicore32/kernel/time.c +++ b/kernel/arch/unicore32/kernel/time.c @@ -46,29 +46,20 @@ puv3_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c) return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; } -static void -puv3_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c) +static int puv3_osmr0_shutdown(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_ONESHOT: - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - writel(readl(OST_OIER) & ~OST_OIER_E0, OST_OIER); - writel(readl(OST_OSSR) & ~OST_OSSR_M0, OST_OSSR); - break; - - case CLOCK_EVT_MODE_RESUME: - case CLOCK_EVT_MODE_PERIODIC: - break; - } + writel(readl(OST_OIER) & ~OST_OIER_E0, OST_OIER); + writel(readl(OST_OSSR) & ~OST_OSSR_M0, OST_OSSR); + return 0; } static struct clock_event_device ckevt_puv3_osmr0 = { - .name = "osmr0", - .features = CLOCK_EVT_FEAT_ONESHOT, - .rating = 200, - .set_next_event = puv3_osmr0_set_next_event, - .set_mode = puv3_osmr0_set_mode, + .name = "osmr0", + .features = CLOCK_EVT_FEAT_ONESHOT, + .rating = 200, + .set_next_event = puv3_osmr0_set_next_event, + .set_state_shutdown = puv3_osmr0_shutdown, + .set_state_oneshot = puv3_osmr0_shutdown, }; static cycle_t puv3_read_oscr(struct clocksource *cs) |