mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] ds1wm: simplify platform_data
@ 2007-05-01 22:00 Matt Reimer
  2007-05-01 22:00 ` [PATCH 2/2] ds1wm: disable interrupts when turning off ds1wm Matt Reimer
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Reimer @ 2007-05-01 22:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Matt Reimer

Simplify ds1wm's platform_data by using IORESOURCE_IRQ_* flags rather
than the platform_data field active_high.

Signed-off-by: Matt Reimer <mreimer@vpop.net>
---
 drivers/w1/masters/ds1wm.c |   11 +++++++----
 include/linux/ds1wm.h      |    1 -
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c
index c3ea34d..8b08609 100644
--- a/drivers/w1/masters/ds1wm.c
+++ b/drivers/w1/masters/ds1wm.c
@@ -90,6 +90,7 @@ struct ds1wm_data {
 	struct platform_device *pdev;
 	struct ds1wm_platform_data *pdata;
 	int		irq;
+	int		active_high;
 	struct clk	*clk;
 	int		slave_present;
 	void		*reset_complete;
@@ -141,7 +142,7 @@ static int ds1wm_reset(struct ds1wm_data *ds1wm_data)
 	ds1wm_data->reset_complete = &reset_done;
 
 	ds1wm_write_register(ds1wm_data, DS1WM_INT_EN, DS1WM_INTEN_EPD |
-		(ds1wm_data->pdata->active_high ? DS1WM_INTEN_IAS : 0));
+		(ds1wm_data->active_high ? DS1WM_INTEN_IAS : 0));
 
 	ds1wm_write_register(ds1wm_data, DS1WM_CMD, DS1WM_CMD_1W_RESET);
 
@@ -163,7 +164,7 @@ static int ds1wm_reset(struct ds1wm_data *ds1wm_data)
 
 	ds1wm_write_register(ds1wm_data, DS1WM_INT_EN,
 		DS1WM_INTEN_ERBF | DS1WM_INTEN_ETMT | DS1WM_INTEN_EPD |
-		(ds1wm_data->pdata->active_high ? DS1WM_INTEN_IAS : 0));
+		(ds1wm_data->active_high ? DS1WM_INTEN_IAS : 0));
 
 	if (!ds1wm_data->slave_present) {
                 dev_dbg(&ds1wm_data->pdev->dev, "reset: no devices found\n");
@@ -356,9 +357,11 @@ static int ds1wm_probe(struct platform_device *pdev)
 		goto err1;
 	}
 	ds1wm_data->irq = res->start;
+	ds1wm_data->active_high = (res->flags & IORESOURCE_IRQ_HIGHEDGE) ?
+		1 : 0;
 
-	set_irq_type(ds1wm_data->irq, res->flags & IORESOURCE_IRQ_LOWEDGE ?
-			IRQ_TYPE_EDGE_FALLING : IRQ_TYPE_EDGE_RISING);
+	set_irq_type(ds1wm_data->irq, ds1wm_data->active_high ?
+			IRQ_TYPE_EDGE_RISING : IRQ_TYPE_EDGE_FALLING);
 
 	ret = request_irq(ds1wm_data->irq, ds1wm_isr, IRQF_DISABLED,
 			  "ds1wm", ds1wm_data);
diff --git a/include/linux/ds1wm.h b/include/linux/ds1wm.h
index feeb64d..31f6e3c 100644
--- a/include/linux/ds1wm.h
+++ b/include/linux/ds1wm.h
@@ -6,7 +6,6 @@ struct ds1wm_platform_data {
 			     * e.g. on h5xxx and h2200 this is 2
 			     * (registers aligned to 4-byte boundaries),
 			     * while on hx4700 this is 1 */
-	int active_high;    /* interrupt polarity, passed to DS1WM as IAS bit */
 	void (*enable)(struct platform_device *pdev);
 	void (*disable)(struct platform_device *pdev);
 };
-- 
1.5.1.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2/2] ds1wm: disable interrupts when turning off ds1wm
  2007-05-01 22:00 [PATCH 1/2] ds1wm: simplify platform_data Matt Reimer
@ 2007-05-01 22:00 ` Matt Reimer
  0 siblings, 0 replies; 2+ messages in thread
From: Matt Reimer @ 2007-05-01 22:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Matt Reimer

Disable interrupts when turning off ds1wm.

Signed-off-by: Matt Reimer <mreimer@vpop.net>
---
 drivers/w1/masters/ds1wm.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c
index 8b08609..1940691 100644
--- a/drivers/w1/masters/ds1wm.c
+++ b/drivers/w1/masters/ds1wm.c
@@ -237,6 +237,10 @@ static void ds1wm_down(struct ds1wm_data *ds1wm_data)
 {
 	ds1wm_reset(ds1wm_data);
 
+	/* Disable interrupts. */
+	ds1wm_write_register(ds1wm_data, DS1WM_INT_EN,
+			     ds1wm_data->active_high ? DS1WM_INTEN_IAS : 0);
+
 	if (ds1wm_data->pdata->disable)
 		ds1wm_data->pdata->disable(ds1wm_data->pdev);
 
-- 
1.5.1.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-01 22:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-01 22:00 [PATCH 1/2] ds1wm: simplify platform_data Matt Reimer
2007-05-01 22:00 ` [PATCH 2/2] ds1wm: disable interrupts when turning off ds1wm Matt Reimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®