Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3f4c927 authored by Lennert Buytenhek's avatar Lennert Buytenhek
Browse files

ARM: PXA SoCs: irq_data conversion.

parent 406b0050
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -477,25 +477,25 @@ static inline void balloon3_leds_init(void) {}
/******************************************************************************
 * FPGA IRQ
 ******************************************************************************/
static void balloon3_mask_irq(unsigned int irq)
static void balloon3_mask_irq(struct irq_data *d)
{
	int balloon3_irq = (irq - BALLOON3_IRQ(0));
	int balloon3_irq = (d->irq - BALLOON3_IRQ(0));
	balloon3_irq_enabled &= ~(1 << balloon3_irq);
	__raw_writel(~balloon3_irq_enabled, BALLOON3_INT_CONTROL_REG);
}

static void balloon3_unmask_irq(unsigned int irq)
static void balloon3_unmask_irq(struct irq_data *d)
{
	int balloon3_irq = (irq - BALLOON3_IRQ(0));
	int balloon3_irq = (d->irq - BALLOON3_IRQ(0));
	balloon3_irq_enabled |= (1 << balloon3_irq);
	__raw_writel(~balloon3_irq_enabled, BALLOON3_INT_CONTROL_REG);
}

static struct irq_chip balloon3_irq_chip = {
	.name		= "FPGA",
	.ack		= balloon3_mask_irq,
	.mask		= balloon3_mask_irq,
	.unmask		= balloon3_unmask_irq,
	.irq_ack	= balloon3_mask_irq,
	.irq_mask	= balloon3_mask_irq,
	.irq_unmask	= balloon3_unmask_irq,
};

static void balloon3_irq_handler(unsigned int irq, struct irq_desc *desc)
@@ -504,8 +504,13 @@ static void balloon3_irq_handler(unsigned int irq, struct irq_desc *desc)
					balloon3_irq_enabled;
	do {
		/* clear useless edge notification */
		if (desc->chip->ack)
			desc->chip->ack(BALLOON3_AUX_NIRQ);
		if (desc->irq_data.chip->irq_ack) {
			struct irq_data *d;

			d = irq_get_irq_data(BALLOON3_AUX_NIRQ);
			desc->irq_data.chip->irq_ack(d);
		}

		while (pending) {
			irq = BALLOON3_IRQ(0) + __ffs(pending);
			generic_handle_irq(irq);
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ void __init cmx2xx_pci_adjust_zones(unsigned long *zone_size,
static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc)
{
	/* clear our parent irq */
	desc->chip->ack(irq);
	desc->irq_data.chip->irq_ack(&desc->irq_data);

	it8152_irq_demux(irq, desc);
}
+3 −1
Original line number Diff line number Diff line
@@ -9,11 +9,13 @@
 * published by the Free Software Foundation.
 */

struct irq_data;
struct sys_timer;

extern struct sys_timer pxa_timer;
extern void __init pxa_init_irq(int irq_nr,
				int (*set_wake)(unsigned int, unsigned int));
				int (*set_wake)(struct irq_data *,
						unsigned int));
extern void __init pxa25x_init_irq(void);
#ifdef CONFIG_CPU_PXA26x
extern void __init pxa26x_init_irq(void);
+25 −25
Original line number Diff line number Diff line
@@ -53,37 +53,37 @@ static inline int cpu_has_ipr(void)
	return !cpu_is_pxa25x();
}

static void pxa_mask_irq(unsigned int irq)
static void pxa_mask_irq(struct irq_data *d)
{
	void __iomem *base = get_irq_chip_data(irq);
	void __iomem *base = irq_data_get_irq_chip_data(d);
	uint32_t icmr = __raw_readl(base + ICMR);

	icmr &= ~(1 << IRQ_BIT(irq));
	icmr &= ~(1 << IRQ_BIT(d->irq));
	__raw_writel(icmr, base + ICMR);
}

static void pxa_unmask_irq(unsigned int irq)
static void pxa_unmask_irq(struct irq_data *d)
{
	void __iomem *base = get_irq_chip_data(irq);
	void __iomem *base = irq_data_get_irq_chip_data(d);
	uint32_t icmr = __raw_readl(base + ICMR);

	icmr |= 1 << IRQ_BIT(irq);
	icmr |= 1 << IRQ_BIT(d->irq);
	__raw_writel(icmr, base + ICMR);
}

static struct irq_chip pxa_internal_irq_chip = {
	.name		= "SC",
	.ack		= pxa_mask_irq,
	.mask		= pxa_mask_irq,
	.unmask		= pxa_unmask_irq,
	.irq_ack	= pxa_mask_irq,
	.irq_mask	= pxa_mask_irq,
	.irq_unmask	= pxa_unmask_irq,
};

/*
 * GPIO IRQs for GPIO 0 and 1
 */
static int pxa_set_low_gpio_type(unsigned int irq, unsigned int type)
static int pxa_set_low_gpio_type(struct irq_data *d, unsigned int type)
{
	int gpio = irq - IRQ_GPIO0;
	int gpio = d->irq - IRQ_GPIO0;

	if (__gpio_is_occupied(gpio)) {
		pr_err("%s failed: GPIO is configured\n", __func__);
@@ -103,31 +103,31 @@ static int pxa_set_low_gpio_type(unsigned int irq, unsigned int type)
	return 0;
}

static void pxa_ack_low_gpio(unsigned int irq)
static void pxa_ack_low_gpio(struct irq_data *d)
{
	GEDR0 = (1 << (irq - IRQ_GPIO0));
	GEDR0 = (1 << (d->irq - IRQ_GPIO0));
}

static void pxa_mask_low_gpio(unsigned int irq)
static void pxa_mask_low_gpio(struct irq_data *d)
{
	struct irq_desc *desc = irq_to_desc(irq);
	struct irq_desc *desc = irq_to_desc(d->irq);

	desc->chip->mask(irq);
	desc->irq_data.chip->irq_mask(d);
}

static void pxa_unmask_low_gpio(unsigned int irq)
static void pxa_unmask_low_gpio(struct irq_data *d)
{
	struct irq_desc *desc = irq_to_desc(irq);
	struct irq_desc *desc = irq_to_desc(d->irq);

	desc->chip->unmask(irq);
	desc->irq_data.chip->irq_unmask(d);
}

static struct irq_chip pxa_low_gpio_chip = {
	.name		= "GPIO-l",
	.ack		= pxa_ack_low_gpio,
	.mask		= pxa_mask_low_gpio,
	.unmask		= pxa_unmask_low_gpio,
	.set_type	= pxa_set_low_gpio_type,
	.irq_ack	= pxa_ack_low_gpio,
	.irq_mask	= pxa_mask_low_gpio,
	.irq_unmask	= pxa_unmask_low_gpio,
	.irq_set_type	= pxa_set_low_gpio_type,
};

static void __init pxa_init_low_gpio_irq(set_wake_t fn)
@@ -145,7 +145,7 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
		set_irq_flags(irq, IRQF_VALID);
	}

	pxa_low_gpio_chip.set_wake = fn;
	pxa_low_gpio_chip.irq_set_wake = fn;
}

static inline void __iomem *irq_base(int i)
@@ -188,7 +188,7 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
	/* only unmasked interrupts kick us out of idle */
	__raw_writel(1, irq_base(0) + ICCR);

	pxa_internal_irq_chip.set_wake = fn;
	pxa_internal_irq_chip.irq_set_wake = fn;
	pxa_init_low_gpio_irq(fn);
}

+9 −8
Original line number Diff line number Diff line
@@ -95,9 +95,9 @@ static unsigned long lpd270_pin_config[] __initdata = {

static unsigned int lpd270_irq_enabled;

static void lpd270_mask_irq(unsigned int irq)
static void lpd270_mask_irq(struct irq_data *d)
{
	int lpd270_irq = irq - LPD270_IRQ(0);
	int lpd270_irq = d->irq - LPD270_IRQ(0);

	__raw_writew(~(1 << lpd270_irq), LPD270_INT_STATUS);

@@ -105,9 +105,9 @@ static void lpd270_mask_irq(unsigned int irq)
	__raw_writew(lpd270_irq_enabled, LPD270_INT_MASK);
}

static void lpd270_unmask_irq(unsigned int irq)
static void lpd270_unmask_irq(struct irq_data *d)
{
	int lpd270_irq = irq - LPD270_IRQ(0);
	int lpd270_irq = d->irq - LPD270_IRQ(0);

	lpd270_irq_enabled |= 1 << lpd270_irq;
	__raw_writew(lpd270_irq_enabled, LPD270_INT_MASK);
@@ -115,9 +115,9 @@ static void lpd270_unmask_irq(unsigned int irq)

static struct irq_chip lpd270_irq_chip = {
	.name		= "CPLD",
	.ack		= lpd270_mask_irq,
	.mask		= lpd270_mask_irq,
	.unmask		= lpd270_unmask_irq,
	.irq_ack	= lpd270_mask_irq,
	.irq_mask	= lpd270_mask_irq,
	.irq_unmask	= lpd270_unmask_irq,
};

static void lpd270_irq_handler(unsigned int irq, struct irq_desc *desc)
@@ -126,7 +126,8 @@ static void lpd270_irq_handler(unsigned int irq, struct irq_desc *desc)

	pending = __raw_readw(LPD270_INT_STATUS) & lpd270_irq_enabled;
	do {
		desc->chip->ack(irq);	/* clear useless edge notification */
		/* clear useless edge notification */
		desc->irq_data.chip->irq_ack(&desc->irq_data);
		if (likely(pending)) {
			irq = LPD270_IRQ(0) + __ffs(pending);
			generic_handle_irq(irq);
Loading