Four minor merge conflicts: 1) qca_spi.c renamed the local variable used for the SPI device from spi_device to spi, meanwhile the spi_set_drvdata() call got moved further up in the probe function. 2) Two changes were both adding new members to codel params structure, and thus we had overlapping changes to the initializer function. 3) 'net' was making a fix to sk_release_kernel() which is completely removed in 'net-next'. 4) In net_namespace.c, the rtnl_net_fill() call for GET operations had the command value fixed, meanwhile 'net-next' adjusted the argument signature a bit. This also matches example merge resolutions posted by Stephen Rothwell over the past two days. Signed-off-by: David S. Miller <davem@davemloft.net>tirimbino
commit
b04096ff33
@ -0,0 +1,30 @@ |
||||
Abracon ABX80X I2C ultra low power RTC/Alarm chip |
||||
|
||||
The Abracon ABX80X family consist of the ab0801, ab0803, ab0804, ab0805, ab1801, |
||||
ab1803, ab1804 and ab1805. The ab0805 is the superset of ab080x and the ab1805 |
||||
is the superset of ab180x. |
||||
|
||||
Required properties: |
||||
|
||||
- "compatible": should one of: |
||||
"abracon,abx80x" |
||||
"abracon,ab0801" |
||||
"abracon,ab0803" |
||||
"abracon,ab0804" |
||||
"abracon,ab0805" |
||||
"abracon,ab1801" |
||||
"abracon,ab1803" |
||||
"abracon,ab1804" |
||||
"abracon,ab1805" |
||||
Using "abracon,abx80x" will enable chip autodetection. |
||||
- "reg": I2C bus address of the device |
||||
|
||||
Optional properties: |
||||
|
||||
The abx804 and abx805 have a trickle charger that is able to charge the |
||||
connected battery or supercap. Both the following properties have to be defined |
||||
and valid to enable charging: |
||||
|
||||
- "abracon,tc-diode": should be "standard" (0.6V) or "schottky" (0.3V) |
||||
- "abracon,tc-resistor": should be <0>, <3>, <6> or <11>. 0 disables the output |
||||
resistor, the other values are in ohm. |
@ -0,0 +1,200 @@ |
||||
/*
|
||||
* Intel Reference Systems cplds |
||||
* |
||||
* Copyright (C) 2014 Robert Jarzmik |
||||
* |
||||
* 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; either version 2 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* Cplds motherboard driver, supporting lubbock and mainstone SoC board. |
||||
*/ |
||||
|
||||
#include <linux/bitops.h> |
||||
#include <linux/gpio.h> |
||||
#include <linux/gpio/consumer.h> |
||||
#include <linux/interrupt.h> |
||||
#include <linux/io.h> |
||||
#include <linux/irq.h> |
||||
#include <linux/irqdomain.h> |
||||
#include <linux/mfd/core.h> |
||||
#include <linux/module.h> |
||||
#include <linux/of_platform.h> |
||||
|
||||
#define FPGA_IRQ_MASK_EN 0x0 |
||||
#define FPGA_IRQ_SET_CLR 0x10 |
||||
|
||||
#define CPLDS_NB_IRQ 32 |
||||
|
||||
struct cplds { |
||||
void __iomem *base; |
||||
int irq; |
||||
unsigned int irq_mask; |
||||
struct gpio_desc *gpio0; |
||||
struct irq_domain *irqdomain; |
||||
}; |
||||
|
||||
static irqreturn_t cplds_irq_handler(int in_irq, void *d) |
||||
{ |
||||
struct cplds *fpga = d; |
||||
unsigned long pending; |
||||
unsigned int bit; |
||||
|
||||
pending = readl(fpga->base + FPGA_IRQ_SET_CLR) & fpga->irq_mask; |
||||
for_each_set_bit(bit, &pending, CPLDS_NB_IRQ) |
||||
generic_handle_irq(irq_find_mapping(fpga->irqdomain, bit)); |
||||
|
||||
return IRQ_HANDLED; |
||||
} |
||||
|
||||
static void cplds_irq_mask_ack(struct irq_data *d) |
||||
{ |
||||
struct cplds *fpga = irq_data_get_irq_chip_data(d); |
||||
unsigned int cplds_irq = irqd_to_hwirq(d); |
||||
unsigned int set, bit = BIT(cplds_irq); |
||||
|
||||
fpga->irq_mask &= ~bit; |
||||
writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN); |
||||
set = readl(fpga->base + FPGA_IRQ_SET_CLR); |
||||
writel(set & ~bit, fpga->base + FPGA_IRQ_SET_CLR); |
||||
} |
||||
|
||||
static void cplds_irq_unmask(struct irq_data *d) |
||||
{ |
||||
struct cplds *fpga = irq_data_get_irq_chip_data(d); |
||||
unsigned int cplds_irq = irqd_to_hwirq(d); |
||||
unsigned int bit = BIT(cplds_irq); |
||||
|
||||
fpga->irq_mask |= bit; |
||||
writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN); |
||||
} |
||||
|
||||
static struct irq_chip cplds_irq_chip = { |
||||
.name = "pxa_cplds", |
||||
.irq_mask_ack = cplds_irq_mask_ack, |
||||
.irq_unmask = cplds_irq_unmask, |
||||
.flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE, |
||||
}; |
||||
|
||||
static int cplds_irq_domain_map(struct irq_domain *d, unsigned int irq, |
||||
irq_hw_number_t hwirq) |
||||
{ |
||||
struct cplds *fpga = d->host_data; |
||||
|
||||
irq_set_chip_and_handler(irq, &cplds_irq_chip, handle_level_irq); |
||||
irq_set_chip_data(irq, fpga); |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
static const struct irq_domain_ops cplds_irq_domain_ops = { |
||||
.xlate = irq_domain_xlate_twocell, |
||||
.map = cplds_irq_domain_map, |
||||
}; |
||||
|
||||
static int cplds_resume(struct platform_device *pdev) |
||||
{ |
||||
struct cplds *fpga = platform_get_drvdata(pdev); |
||||
|
||||
writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN); |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
static int cplds_probe(struct platform_device *pdev) |
||||
{ |
||||
struct resource *res; |
||||
struct cplds *fpga; |
||||
int ret; |
||||
unsigned int base_irq = 0; |
||||
unsigned long irqflags = 0; |
||||
|
||||
fpga = devm_kzalloc(&pdev->dev, sizeof(*fpga), GFP_KERNEL); |
||||
if (!fpga) |
||||
return -ENOMEM; |
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
||||
if (res) { |
||||
fpga->irq = (unsigned int)res->start; |
||||
irqflags = res->flags; |
||||
} |
||||
if (!fpga->irq) |
||||
return -ENODEV; |
||||
|
||||
base_irq = platform_get_irq(pdev, 1); |
||||
if (base_irq < 0) |
||||
base_irq = 0; |
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
||||
fpga->base = devm_ioremap_resource(&pdev->dev, res); |
||||
if (IS_ERR(fpga->base)) |
||||
return PTR_ERR(fpga->base); |
||||
|
||||
platform_set_drvdata(pdev, fpga); |
||||
|
||||
writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN); |
||||
writel(0, fpga->base + FPGA_IRQ_SET_CLR); |
||||
|
||||
ret = devm_request_irq(&pdev->dev, fpga->irq, cplds_irq_handler, |
||||
irqflags, dev_name(&pdev->dev), fpga); |
||||
if (ret == -ENOSYS) |
||||
return -EPROBE_DEFER; |
||||
|
||||
if (ret) { |
||||
dev_err(&pdev->dev, "couldn't request main irq%d: %d\n", |
||||
fpga->irq, ret); |
||||
return ret; |
||||
} |
||||
|
||||
irq_set_irq_wake(fpga->irq, 1); |
||||
fpga->irqdomain = irq_domain_add_linear(pdev->dev.of_node, |
||||
CPLDS_NB_IRQ, |
||||
&cplds_irq_domain_ops, fpga); |
||||
if (!fpga->irqdomain) |
||||
return -ENODEV; |
||||
|
||||
if (base_irq) { |
||||
ret = irq_create_strict_mappings(fpga->irqdomain, base_irq, 0, |
||||
CPLDS_NB_IRQ); |
||||
if (ret) { |
||||
dev_err(&pdev->dev, "couldn't create the irq mapping %d..%d\n", |
||||
base_irq, base_irq + CPLDS_NB_IRQ); |
||||
return ret; |
||||
} |
||||
} |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
static int cplds_remove(struct platform_device *pdev) |
||||
{ |
||||
struct cplds *fpga = platform_get_drvdata(pdev); |
||||
|
||||
irq_set_chip_and_handler(fpga->irq, NULL, NULL); |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
static const struct of_device_id cplds_id_table[] = { |
||||
{ .compatible = "intel,lubbock-cplds-irqs", }, |
||||
{ .compatible = "intel,mainstone-cplds-irqs", }, |
||||
{ } |
||||
}; |
||||
MODULE_DEVICE_TABLE(of, cplds_id_table); |
||||
|
||||
static struct platform_driver cplds_driver = { |
||||
.driver = { |
||||
.name = "pxa_cplds_irqs", |
||||
.of_match_table = of_match_ptr(cplds_id_table), |
||||
}, |
||||
.probe = cplds_probe, |
||||
.remove = cplds_remove, |
||||
.resume = cplds_resume, |
||||
}; |
||||
|
||||
module_platform_driver(cplds_driver); |
||||
|
||||
MODULE_DESCRIPTION("PXA Cplds interrupts driver"); |
||||
MODULE_AUTHOR("Robert Jarzmik <robert.jarzmik@free.fr>"); |
||||
MODULE_LICENSE("GPL"); |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue