From 60df18b0187a976d58f402be7661ba52c0eb9e03 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Tue, 5 Oct 2010 13:08:50 +0300 Subject: CMT: Add hardware version field to driver platform data platform Signed-off-by: Kai Vehmanen Signed-off-by: Joni Lapilainen --- drivers/misc/cmt/cmt.c | 11 +++++++++-- include/linux/cmt.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/misc/cmt/cmt.c b/drivers/misc/cmt/cmt.c index 9efcd9b595c4..e4b0b6c74b10 100644 --- a/drivers/misc/cmt/cmt.c +++ b/drivers/misc/cmt/cmt.c @@ -135,6 +135,7 @@ static int __init cmt_probe(struct platform_device *pd) struct cmt_device *cmt; int irq; int err; + int pflags; if (!pdata) { pr_err("CMT: No platform_data found on cmt device\n"); @@ -157,11 +158,17 @@ static int __init cmt_probe(struct platform_device *pd) gpio_direction_input(cmt->cmt_rst_ind_gpio); tasklet_init(&cmt->cmt_rst_ind_tasklet, do_cmt_rst_ind_tasklet, (unsigned long)cmt); + if (pdata->cmt_ver == 1) + pflags = IRQF_TRIGGER_FALLING; + else + pflags = IRQF_TRIGGER_RISING; + irq = gpio_to_irq(cmt->cmt_rst_ind_gpio); err = request_irq(irq, cmt_rst_ind_isr, - IRQF_DISABLED | IRQF_TRIGGER_RISING, "cmt_rst_ind", cmt); + IRQF_DISABLED | pflags, "cmt_rst_ind", cmt); if (err < 0) { - dev_err(&pd->dev, "Request cmt_rst_ind irq(%d) failed\n", irq); + dev_err(&pd->dev, "Request cmt_rst_ind irq(%d) failed (flags %d)\n", + irq, pflags); goto rback2; } enable_irq_wake(irq); diff --git a/include/linux/cmt.h b/include/linux/cmt.h index 90b3f5433f92..bb578ea77691 100644 --- a/include/linux/cmt.h +++ b/include/linux/cmt.h @@ -39,9 +39,11 @@ struct cmt_device; /* * struct cmt_platform_data - CMT platform data * @ape_rst_rq_gpio: GPIO line number for the CMT reset line + * @cmt_ver: CMT hardware version */ struct cmt_platform_data { unsigned int cmt_rst_ind_gpio; + unsigned int cmt_ver; }; struct cmt_device *cmt_get(const char *name); -- cgit v1.2.3