lkml.org 
[lkml]   [2012]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectPCA GPIO interrupt triggers
    Hi,

    I'm using a GPIO chip (PCA9554) for a matrix-keypad. The keypad driver
    itself needs interrupts for both rising and falling edges. The PCA
    driver (gpio-pca953x.c) doesn't support it, but I don't understand why.

    I think, this patch should work:

    diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
    index 147df8a..be9aff4 100644
    --- a/drivers/gpio/gpio-pca953x.c
    +++ b/drivers/gpio/gpio-pca953x.c
    @@ -356,12 +356,6 @@ static int pca953x_irq_set_type(struct irq_data *d,
    unsigned int type)
    uint16_t level = d->irq - chip->irq_base;
    uint16_t mask = 1 << level;

    - if (!(type & IRQ_TYPE_EDGE_BOTH)) {
    - dev_err(&chip->client->dev, "irq %d: unsupported type %d\n",
    - d->irq, type);
    - return -EINVAL;
    - }
    -
    if (type & IRQ_TYPE_EDGE_FALLING)
    chip->irq_trig_fall |= mask;
    else
    I think that the other parts of the code checks for rising and falling
    edges correctly. Am I missing something?

    --
    Ruskó Péter
    Fejlesztőmérnök

    Prolan Zrt. / Prolan Co.
    Hungary 2011 Budakalász, Szentendrei út 1-3.
    Tel./Phone: +36 20 954 3118
    Fax: +36 26 540 420
    E-mail: rusko.peter@prolan.hu
    Web: www.prolan.hu
    Timezone:CET
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2012-03-23 06:45    [W:0.023 / U:0.292 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site