/* * This buffer is shared between FIQ and IRQ contexts. * The FIQ and IRQ isrs can both read and write it. * It is structured as a header section several 32bit slots, * followed by the circular buffer where the FIQ isr stores * keystrokes received from the qwerty keyboard. See * <linux/platform_data/ams-delta-fiq.h> for details of offsets.
*/ staticunsignedint fiq_buffer[1024];
/* Store irq_chip location for IRQ handler use */
irq_chip = chip->irq.chip; if (!irq_chip) {
pr_err("%s: GPIO chip %s is missing IRQ function\n", __func__,
chip->label); return;
}
for (i = 0; i < ARRAY_SIZE(irq_data); i++) {
gpiod = gpiochip_request_own_desc(chip, i, pin_name[i],
GPIO_ACTIVE_HIGH, GPIOD_IN); if (IS_ERR(gpiod)) {
pr_err("%s: failed to get GPIO pin %d (%ld)\n",
__func__, i, PTR_ERR(gpiod)); return;
} /* Store irq_data location for IRQ handler use */
irq_data[i] = irq_get_irq_data(gpiod_to_irq(gpiod));
/* * FIQ handler takes full control over serio data and clk GPIO * pins. Initialize them and keep requested so nobody can * interfere. Fail if any of those two couldn't be requested.
*/ switch (i) { case AMS_DELTA_GPIO_PIN_KEYBRD_DATA:
data = gpiod;
gpiod_direction_input(data); break; case AMS_DELTA_GPIO_PIN_KEYBRD_CLK:
clk = gpiod;
gpiod_direction_input(clk); break; default:
gpiochip_free_own_desc(gpiod); break;
}
} if (!data || !clk) goto out_gpio;
/* * Initialise the buffer which is shared * between FIQ mode and IRQ mode
*/
fiq_buffer[FIQ_GPIO_INT_MASK] = 0;
fiq_buffer[FIQ_MASK] = 0;
fiq_buffer[FIQ_STATE] = 0;
fiq_buffer[FIQ_KEY] = 0;
fiq_buffer[FIQ_KEYS_CNT] = 0;
fiq_buffer[FIQ_KEYS_HICNT] = 0;
fiq_buffer[FIQ_TAIL_OFFSET] = 0;
fiq_buffer[FIQ_HEAD_OFFSET] = 0;
fiq_buffer[FIQ_BUF_LEN] = 256;
fiq_buffer[FIQ_MISSED_KEYS] = 0;
fiq_buffer[FIQ_BUFFER_START] =
(unsignedint) &fiq_buffer[FIQ_CIRC_BUFF];
for (i = FIQ_CNT_INT_00; i <= FIQ_CNT_INT_15; i++)
fiq_buffer[i] = 0;
/* * FIQ mode r9 always points to the fiq_buffer, because the FIQ isr * will run in an unpredictable context. The fiq_buffer is the FIQ isr's * only means of communication with the IRQ level and other kernel * context code.
*/
FIQ_regs.ARM_r9 = (unsignedint)fiq_buffer;
set_fiq_regs(&FIQ_regs);
/* * Since FIQ handler performs handling of GPIO registers for * "keybrd_clk" IRQ pin, ams_delta_serio driver used to set * handle_simple_irq() as active IRQ handler for that pin to avoid * bad interaction with gpio-omap driver. This is no longer needed * as handle_simple_irq() is now the default handler for OMAP GPIO * edge interrupts. * This comment replaces the obsolete code which has been removed * from the ams_delta_serio driver and stands here only as a reminder * of that dependency on gpio-omap driver behavior.
*/
return;
out_gpio: if (data)
gpiochip_free_own_desc(data); if (clk)
gpiochip_free_own_desc(clk);
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.