From: jic23@kernel.org (Jonathan Cameron)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFT 4/5] iio: mxs-lradc: disable only mapped channels in mxs_lradc_hw_stop
Date: Sun, 17 Apr 2016 11:47:06 +0100 [thread overview]
Message-ID: <571369AA.8060106@kernel.org> (raw)
In-Reply-To: <1460648909-2657-5-git-send-email-stefan.wahren@i2se.com>
On 14/04/16 16:48, Stefan Wahren wrote:
> Disabling of the touchscreen IRQs is already done in
> mxs_lradc_disable_ts. There is no need to disable them in
> mxs_lradc_hw_stop again.
We could do with a little more documentation in the driver on
which bits in this register are doing what.
The disable_ts deals with bits 22-24...
The only other bit I think is ever used by the driver currently is
16 (channel 0).
So whilst this change probably works, I'm not sure of the logic behind it.
As far as I can tell your new clear is fine but in reality you could
just clear (0x3f << 16) and get the same result (which would be clearer
to my mind).
The key think here is that we don't support the higher bits on i.mx28
yet... Which are for button detection and threshold detection.
Have I understood this correctly?
Jonathan
So we only need to care of the
> mapped channels which are common for i.MX23 and i.MX28
> and we remove the now unused function mxs_lradc_irq_en_mask.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> ---
> drivers/iio/adc/mxs-lradc.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iio/adc/mxs-lradc.c b/drivers/iio/adc/mxs-lradc.c
> index 95d84c9..97c993f 100644
> --- a/drivers/iio/adc/mxs-lradc.c
> +++ b/drivers/iio/adc/mxs-lradc.c
> @@ -295,6 +295,7 @@ struct mxs_lradc {
> #define LRADC_CTRL1_LRADC_IRQ_EN(n) (1 << ((n) + 16))
> #define LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK (0x1fff << 16)
> #define LRADC_CTRL1_MX23_LRADC_IRQ_EN_MASK (0x01ff << 16)
> +#define LRADC_CTRL1_MAPPED_CHANS_IRQ_EN_MASK (0x00ff << 16)
> #define LRADC_CTRL1_LRADC_IRQ_EN_OFFSET 16
> #define LRADC_CTRL1_TOUCH_DETECT_IRQ BIT(8)
> #define LRADC_CTRL1_LRADC_IRQ(n) (1 << (n))
> @@ -373,13 +374,6 @@ static u32 mxs_lradc_plate_mask(struct mxs_lradc *lradc)
> return LRADC_CTRL0_MX28_PLATE_MASK;
> }
>
> -static u32 mxs_lradc_irq_en_mask(struct mxs_lradc *lradc)
> -{
> - if (lradc->soc == IMX23_LRADC)
> - return LRADC_CTRL1_MX23_LRADC_IRQ_EN_MASK;
> - return LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK;
> -}
> -
> static u32 mxs_lradc_irq_mask(struct mxs_lradc *lradc)
> {
> if (lradc->soc == IMX23_LRADC)
> @@ -1505,7 +1499,8 @@ static void mxs_lradc_hw_stop(struct mxs_lradc *lradc)
> {
> int i;
>
> - mxs_lradc_reg_clear(lradc, mxs_lradc_irq_en_mask(lradc), LRADC_CTRL1);
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL1_MAPPED_CHANS_IRQ_EN_MASK,
> + LRADC_CTRL1);
>
> for (i = 0; i < LRADC_MAX_DELAY_CHANS; i++)
> mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(i));
>
next prev parent reply other threads:[~2016-04-17 10:47 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 15:48 [PATCH RFT 0/5] iio: mxs-lradc: fix leak and implement PM ops Stefan Wahren
2016-04-14 15:48 ` [PATCH RFT 1/5] iio: mxs-lradc: fix memory leak Stefan Wahren
2016-04-14 20:01 ` Marek Vasut
2016-04-17 10:08 ` Jonathan Cameron
2016-04-18 17:16 ` Marek Vasut
2016-04-19 6:33 ` Stefan Wahren
2016-04-19 10:32 ` Marek Vasut
2016-04-19 13:37 ` Stefan Wahren
2016-04-19 18:58 ` Jonathan Cameron
2016-04-19 19:29 ` Marek Vasut
2016-04-18 6:19 ` Stefan Wahren
2016-04-18 10:45 ` Marek Vasut
2016-04-14 15:48 ` [PATCH RFT 2/5] iio: mxs-lradc: move TS config into suitable function Stefan Wahren
2016-04-14 20:01 ` Marek Vasut
2016-04-17 10:13 ` Jonathan Cameron
2016-04-17 12:19 ` Torokhov
2016-04-18 6:26 ` Stefan Wahren
2016-04-14 15:48 ` [PATCH RFT 3/5] iio: mxs-lradc: move STMP reset out of ADC init Stefan Wahren
2016-04-15 6:48 ` Juergen Borleis
2016-04-15 10:12 ` Marek Vasut
2016-04-17 10:24 ` Jonathan Cameron
2016-04-14 15:48 ` [PATCH RFT 4/5] iio: mxs-lradc: disable only mapped channels in mxs_lradc_hw_stop Stefan Wahren
2016-04-17 10:47 ` Jonathan Cameron [this message]
2016-04-18 6:36 ` Stefan Wahren
2016-04-14 15:48 ` [PATCH RFT 5/5] iio: mxs-lradc: implement suspend/resume support Stefan Wahren
2016-04-17 10:48 ` Jonathan Cameron
2016-04-14 19:55 ` [PATCH RFT 0/5] iio: mxs-lradc: fix leak and implement PM ops Marek Vasut
2016-04-18 6:17 ` Stefan Wahren
2016-04-18 10:44 ` Marek Vasut
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=571369AA.8060106@kernel.org \
--to=jic23@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).