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

Commit 7aefff51 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Andi Kleen
Browse files

PNP: introduce pnp_irq_mask_t typedef



This adds a typedef for the IRQ bitmap, which should cause
no functional change, but will make it easier to pass a
pointer to a bitmap to pnp_register_irq_resource().

Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
Acked-by: default avatarRene Herman <rene.herman@gmail.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent a1802c42
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -30,8 +30,10 @@ struct pnp_port {
};

#define PNP_IRQ_NR 256
typedef struct { DECLARE_BITMAP(bits, PNP_IRQ_NR); } pnp_irq_mask_t;

struct pnp_irq {
	DECLARE_BITMAP(map, PNP_IRQ_NR);	/* bitmask for IRQ lines */
	pnp_irq_mask_t map;	/* bitmap for IRQ lines */
	unsigned char flags;	/* IRQ flags */
	unsigned char pad;	/* pad */
	struct pnp_irq *next;	/* next IRQ */
+2 −2
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ static void pnp_print_irq(pnp_info_buffer_t * buffer, char *space,

	pnp_printf(buffer, "%sirq ", space);
	for (i = 0; i < PNP_IRQ_NR; i++)
		if (test_bit(i, irq->map)) {
		if (test_bit(i, irq->map.bits)) {
			if (!first) {
				pnp_printf(buffer, ",");
			} else {
@@ -78,7 +78,7 @@ static void pnp_print_irq(pnp_info_buffer_t * buffer, char *space,
			else
				pnp_printf(buffer, "%i", i);
		}
	if (bitmap_empty(irq->map, PNP_IRQ_NR))
	if (bitmap_empty(irq->map.bits, PNP_IRQ_NR))
		pnp_printf(buffer, "<none>");
	if (irq->flags & IORESOURCE_IRQ_HIGHEDGE)
		pnp_printf(buffer, " High-Edge");
+1 −1
Original line number Diff line number Diff line
@@ -441,7 +441,7 @@ static void __init isapnp_parse_irq_resource(struct pnp_dev *dev,
	if (!irq)
		return;
	bits = (tmp[1] << 8) | tmp[0];
	bitmap_copy(irq->map, &bits, 16);
	bitmap_copy(irq->map.bits, &bits, 16);
	if (size > 2)
		irq->flags = tmp[2];
	else
+3 −3
Original line number Diff line number Diff line
@@ -128,20 +128,20 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx)
	res->start = -1;
	res->end = -1;

	if (bitmap_empty(rule->map, PNP_IRQ_NR)) {
	if (bitmap_empty(rule->map.bits, PNP_IRQ_NR)) {
		res->flags |= IORESOURCE_DISABLED;
		dev_dbg(&dev->dev, "  irq %d disabled\n", idx);
		goto __add;
	}

	/* TBD: need check for >16 IRQ */
	res->start = find_next_bit(rule->map, PNP_IRQ_NR, 16);
	res->start = find_next_bit(rule->map.bits, PNP_IRQ_NR, 16);
	if (res->start < PNP_IRQ_NR) {
		res->end = res->start;
		goto __add;
	}
	for (i = 0; i < 16; i++) {
		if (test_bit(xtab[i], rule->map)) {
		if (test_bit(xtab[i], rule->map.bits)) {
			res->start = res->end = xtab[i];
			if (pnp_check_irq(dev, res))
				goto __add;
+2 −2
Original line number Diff line number Diff line
@@ -442,7 +442,7 @@ static __init void pnpacpi_parse_irq_option(struct pnp_dev *dev,

	for (i = 0; i < p->interrupt_count; i++)
		if (p->interrupts[i])
			__set_bit(p->interrupts[i], irq->map);
			__set_bit(p->interrupts[i], irq->map.bits);
	irq->flags = irq_flags(p->triggering, p->polarity, p->sharable);

	pnp_register_irq_resource(dev, option, irq);
@@ -463,7 +463,7 @@ static __init void pnpacpi_parse_ext_irq_option(struct pnp_dev *dev,

	for (i = 0; i < p->interrupt_count; i++)
		if (p->interrupts[i])
			__set_bit(p->interrupts[i], irq->map);
			__set_bit(p->interrupts[i], irq->map.bits);
	irq->flags = irq_flags(p->triggering, p->polarity, p->sharable);

	pnp_register_irq_resource(dev, option, irq);
Loading