diff options
author | Kai Vehmanen <kai.vehmanen@nokia.com> | 2010-10-05 13:08:50 +0300 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2013-08-11 00:01:08 +0200 |
commit | 60df18b0187a976d58f402be7661ba52c0eb9e03 (patch) | |
tree | 5bf38ad16ccbd6e876a6eb51f0e7159a508e4c37 | |
parent | 1924c3dd54cb921c0fe2fc721f2455aaef0e527c (diff) | |
download | linux-60df18b0187a976d58f402be7661ba52c0eb9e03.tar.bz2 |
CMT: Add hardware version field to driver platform data platform
Signed-off-by: Kai Vehmanen <kai.vehmanen@nokia.com>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
-rw-r--r-- | drivers/misc/cmt/cmt.c | 11 | ||||
-rw-r--r-- | 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); |