LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Philipp Zabel <philipp.zabel@gmail.com>
Cc: linux-kernel@vger.kernel.org, johnpol@2ka.mipt.ru,
	mreimer@vpop.net, szabolcs.gyurko@tlt.hu
Subject: Re: [PATCH] DS1WM: decouple host IRQ and INTR active state settings.
Date: Mon, 7 Jan 2008 15:10:22 -0800	[thread overview]
Message-ID: <20080107151022.82901fcc.akpm@linux-foundation.org> (raw)
In-Reply-To: <1199627174.28826.11.camel@localhost.localdomain>

On Sun, 06 Jan 2008 14:46:14 +0100
Philipp Zabel <philipp.zabel@gmail.com> wrote:

> The DS1WM driver incorrectly infers the IAS bit (1-wire interrupt active
> high) from IRQ settings. There are devices that have IAS=0 but still need
> the IRQ to trigger on a rising edge. With this patch, machines with DS1WM
> that need IAS=1 have to set .active_high=1 in the ds1wm_platform_data.
> 
> Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
> ---
>  drivers/w1/masters/ds1wm.c |    9 +++++----
>  include/linux/ds1wm.h      |    1 +
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c
> index 5747997..688e435 100644
> --- a/drivers/w1/masters/ds1wm.c
> +++ b/drivers/w1/masters/ds1wm.c
> @@ -361,11 +361,12 @@ 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;
> +	ds1wm_data->active_high = plat->active_high;
>  
> -	set_irq_type(ds1wm_data->irq, ds1wm_data->active_high ?
> -			IRQ_TYPE_EDGE_RISING : IRQ_TYPE_EDGE_FALLING);
> +	if (res->flags & IORESOURCE_IRQ_HIGHEDGE)
> +		set_irq_type(ds1wm_data->irq, IRQ_TYPE_EDGE_RISING);
> +	if (res->flags & IORESOURCE_IRQ_LOWEDGE)
> +		set_irq_type(ds1wm_data->irq, 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 31f6e3c..d3c65e4 100644
> --- a/include/linux/ds1wm.h
> +++ b/include/linux/ds1wm.h
> @@ -6,6 +6,7 @@ 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;
>  	void (*enable)(struct platform_device *pdev);
>  	void (*disable)(struct platform_device *pdev);
>  };

But no drivers are converted to set ds1wm_platform_data.active_high.  Won't
IORESOURCE_IRQ_HIGHEDGE devices be broken by this change?

  parent reply	other threads:[~2008-01-07 23:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-06 13:46 Philipp Zabel
2008-01-07 15:41 ` Evgeniy Polyakov
2008-01-07 20:04 ` Matt Reimer
2008-01-07 23:10 ` Andrew Morton [this message]
2008-01-08  0:13   ` Matt Reimer
2008-01-08  8:21     ` pHilipp Zabel
2008-02-06  7:26       ` Andrew Morton
2008-02-06 14:35         ` pHilipp Zabel
2008-02-06 18:01           ` Andrew Morton
2008-02-06 18:19             ` Matt Reimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080107151022.82901fcc.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mreimer@vpop.net \
    --cc=philipp.zabel@gmail.com \
    --cc=szabolcs.gyurko@tlt.hu \
    --subject='Re: [PATCH] DS1WM: decouple host IRQ and INTR active state settings.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).